00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <FunctionExpressionFEM.hpp>
00021
00022 #include <MeshExpression.hpp>
00023 #include <Information.hpp>
00024
00025 #include <FEMFunctionBuilder.hpp>
00026 #include <FEMFunctionBase.hpp>
00027
00028 #include <ScalarFunctionBase.hpp>
00029
00030 #include <Mesh.hpp>
00031
00032 #include <ScalarDiscretizationTypeFEM.hpp>
00033
00034 void FunctionExpressionFEM::execute()
00035 {
00036 __mesh->execute();
00037
00038 Information::instance().setMesh(__mesh->mesh());
00039
00040 FEMFunctionBuilder builder;
00041
00042 if (__functionExpression != 0) {
00043 __functionExpression->execute();
00044
00045 builder.build(ScalarDiscretizationTypeFEM(__discretizationType),
00046 __mesh->mesh(),
00047 *(__functionExpression->function()));
00048 } else {
00049 builder.build(ScalarDiscretizationTypeFEM(__discretizationType),
00050 __mesh->mesh());
00051 }
00052
00053 __scalarFunction = builder.getBuiltScalarFunction();
00054
00055
00056 __functionExpression = 0;
00057 Information::instance().unsetMesh();
00058
00059 }
00060
00061 FunctionExpressionFEM::
00062 FunctionExpressionFEM(ReferenceCounting<MeshExpression> mesh,
00063 ReferenceCounting<FunctionExpression> function,
00064 const ScalarDiscretizationTypeBase::Type& discretizationType)
00065 : FunctionExpression(FunctionExpression::fem),
00066 __discretizationType(discretizationType),
00067 __mesh(mesh),
00068 __functionExpression(function)
00069 {
00070 ;
00071 }
00072
00073 FunctionExpressionFEM::
00074 FunctionExpressionFEM(const FunctionExpressionFEM& femFunction)
00075 : FunctionExpression(femFunction),
00076 __discretizationType(femFunction.__discretizationType),
00077 __mesh(femFunction.__mesh),
00078 __functionExpression(femFunction.__functionExpression)
00079 {
00080 ;
00081 }
00082
00083 FunctionExpressionFEM::~FunctionExpressionFEM()
00084 {
00085 ;
00086 }