Skip to content
Snippets Groups Projects
Commit 2351a682 authored by Dr. Felix Tobias Schindler's avatar Dr. Felix Tobias Schindler
Browse files

[test.function_expression] reenabled Dune::Fem stuff

parent d3584d2b
No related branches found
No related tags found
No related merge requests found
...@@ -9,23 +9,23 @@ ...@@ -9,23 +9,23 @@
#include <dune/common/parametertree.hh> #include <dune/common/parametertree.hh>
#include <dune/common/fvector.hh> #include <dune/common/fvector.hh>
//#if HAVE_DUNE_FEM #if HAVE_DUNE_FEM
// #include <dune/fem/misc/mpimanager.hh> #include <dune/fem/misc/mpimanager.hh>
// #include <dune/fem/space/fvspace/fvspace.hh> #include <dune/fem/space/fvspace/fvspace.hh>
// #include <dune/fem/space/dgspace.hh> #include <dune/fem/space/dgspace.hh>
// #include <dune/fem/gridpart/adaptiveleafgridpart.hh> #include <dune/fem/gridpart/adaptiveleafgridpart.hh>
// #include <dune/fem/function/adaptivefunction.hh> #include <dune/fem/function/adaptivefunction.hh>
// #include <dune/fem/operator/projection/l2projection.hh> #include <dune/fem/operator/projection/l2projection.hh>
// #include <dune/fem/io/file/datawriter.hh> #include <dune/fem/io/file/datawriter.hh>
// #include <dune/stuff/fem/customprojection.hh> #include <dune/stuff/fem/customprojection.hh>
//#endif #endif
#include <dune/stuff/grid/provider/cube.hh> #include <dune/stuff/grid/provider.hh>
#include <dune/stuff/function/expression.hh> #include <dune/stuff/function/expression.hh>
//#if HAVE_EIGEN #if HAVE_EIGEN
#include <Eigen/Core> #include <Eigen/Core>
//#endif // HAVE_EIGEN #endif // HAVE_EIGEN
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
...@@ -101,7 +101,7 @@ int main(int argc, char** argv) ...@@ -101,7 +101,7 @@ int main(int argc, char** argv)
std::cout << "vector_f_from_paramtree_with_expressions(" << vector_x << ") = " << vector_value std::cout << "vector_f_from_paramtree_with_expressions(" << vector_x << ") = " << vector_value
<< " (should be 3 -3)" << std::endl; << " (should be 3 -3)" << std::endl;
//#if HAVE_EIGEN #if HAVE_EIGEN
std::cout << std::endl; std::cout << std::endl;
typedef Dune::Stuff::Function::Expression<double, 50, double, 1> ParameterFunctionType; typedef Dune::Stuff::Function::Expression<double, 50, double, 1> ParameterFunctionType;
typedef Eigen::VectorXd ParameterType; typedef Eigen::VectorXd ParameterType;
...@@ -134,35 +134,31 @@ int main(int argc, char** argv) ...@@ -134,35 +134,31 @@ int main(int argc, char** argv)
<< " (should be 1, mu[1] .. mu[4] are treated as 0)" << std::endl; << " (should be 1, mu[1] .. mu[4] are treated as 0)" << std::endl;
multiple_paramFunction.evaluate(vectorParam, paramValue); multiple_paramFunction.evaluate(vectorParam, paramValue);
std::cout << "multiple_paramFunction(" << vectorParam << ") = " << paramValue << " (should be 20)" << std::endl; std::cout << "multiple_paramFunction(" << vectorParam << ") = " << paramValue << " (should be 20)" << std::endl;
// this will fail: // this will fail:
// multiple_paramFunction.evaluate(tooLargeParam, paramValue); // multiple_paramFunction.evaluate(tooLargeParam, paramValue);
// std::cout << "scalar_paramFunction(" << tooLargeParam << ") = " << paramValue << " ()"<< std::endl; // std::cout << "scalar_paramFunction(" << tooLargeParam << ") = " << paramValue << " ()"<< std::endl;
//#endif // HAVE_EIGEN #endif // HAVE_EIGEN
//#if HAVE_DUNE_FEM #if HAVE_DUNE_FEM
// Dune::GridPtr< GridType > gridPtr( paramTree.get("dgf_file", "dummy") ); Dune::MPIManager::initialize(argc, argv);
// typedef Dune::AdaptiveLeafGridPart< GridType > typedef Dune::Stuff::Grid::Provider::Interface<> GridProviderType;
// GridPartType; GridProviderType* gridProvider = Dune::Stuff::Grid::Provider::create<>();
// GridPartType gridPart_(*gridPtr); typedef typename GridProviderType::GridType GridType;
// typedef ParameterFunctionType::FunctionSpaceType FSpace; typedef Dune::AdaptiveLeafGridPart<GridType> GridPartType;
// typedef Dune::DiscontinuousGalerkinSpace< FSpace, GridType& grid = *(gridProvider->grid());
// GridPartType, GridPartType gridPart(grid);
// 1 > typedef ScalarFunctionType::FunctionSpaceType FSpaceType;
// DiscreteFunctionSpaceType; typedef Dune::DiscontinuousGalerkinSpace<FSpaceType, GridPartType, 1> DiscreteFunctionSpaceType;
// typedef Dune::AdaptiveDiscreteFunction< DiscreteFunctionSpaceType > typedef Dune::AdaptiveDiscreteFunction<DiscreteFunctionSpaceType> DiscreteFunctionType;
// DiscreteFunctionType; DiscreteFunctionSpaceType disc_space(gridPart);
// DiscreteFunctionSpaceType disc_space(gridPart_); DiscreteFunctionType rf_disc("rf", disc_space);
// DiscreteFunctionType rf_disc("rf", disc_space); typedef Dune::tuple<const DiscreteFunctionType*> OutputTupleType;
// typedef Dune::tuple< const DiscreteFunctionType* > typedef Dune::DataWriter<GridType, OutputTupleType> DataWriterType;
// OutputTupleType; Dune::Stuff::Fem::BetterL2Projection::project(scalar_f_from_single_expression, rf_disc);
// typedef Dune::DataWriter< GridPartType::GridType, OutputTupleType out(&rf_disc);
// OutputTupleType > DataWriterType dt(grid, out);
// DataWriterType; dt.write();
// Dune::Stuff::Fem::BetterL2Projection::project(parameterFunction, rf_disc); #endif
// OutputTupleType out(&rf_disc);
// DataWriterType dt(gridPart_.grid(), out);
// dt.write();
//#endif
} catch (Dune::Exception& e) { } catch (Dune::Exception& e) {
std::cout << e.what() << std::endl; std::cout << e.what() << std::endl;
return 1; return 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment