Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ag-ohlberger
dune-community
dune-xt
Commits
2351a682
Commit
2351a682
authored
12 years ago
by
Dr. Felix Tobias Schindler
Browse files
Options
Downloads
Patches
Plain Diff
[test.function_expression] reenabled Dune::Fem stuff
parent
d3584d2b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/stuff/test/function_expression.cc
+40
-44
40 additions, 44 deletions
dune/stuff/test/function_expression.cc
with
40 additions
and
44 deletions
dune/stuff/test/function_expression.cc
+
40
−
44
View file @
2351a682
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment