#include <FunctionExpressionConvection.hpp>


Definition at line 38 of file FunctionExpressionConvection.hpp.
enum FunctionExpression::FunctionType [inherited] |
functions types ids
Definition at line 42 of file FunctionExpression.hpp.
00042 { 00043 constant, 00044 linearBase, 00045 normalComponent, 00046 fem, 00047 dg, 00048 spectral, 00049 derivative, 00050 meshReferences, 00051 composed, 00052 variable, 00053 cfunction, 00054 binaryOperation, 00055 unaryMinus, 00056 convection, 00057 00058 objectCharacteristic, 00059 meshCharacteristic, 00060 domainCharacteristic, 00061 00062 read, 00063 functionValue, 00064 not_, 00065 integrate 00066 };
enum Expression::Type [inherited] |
Reimplemented in IFStreamExpression, OFStreamExpression, and UnknownExpression.
Definition at line 42 of file Expression.hpp.
00042 { 00043 boolean, 00044 boundary, 00045 boundaryCondition, 00046 boundaryConditionList, 00047 00048 domain, 00049 00050 field, 00051 fieldlist, 00052 function, 00053 00054 ifstreamexpression, 00055 integrated, 00056 integratedOperator, 00057 insideExpression, 00058 insideListExpression, 00059 istreamexpression, 00060 istreamExpressionList, 00061 00062 linearExp, 00063 00064 mesh, 00065 multiLinearExp, 00066 multiLinearExpSum, 00067 multiLinearForm, 00068 multiLinearFormSum, 00069 00070 ofstreamexpression, 00071 option, 00072 ostreamexpression, 00073 ostreamExpressionList, 00074 00075 pdeEquation, 00076 pdeOperator, 00077 pdeOperatorSum, 00078 pdeProblem, 00079 problem, 00080 00081 real, 00082 00083 scene, 00084 solver, 00085 solverOptions, 00086 string, 00087 subOption, 00088 subOptionList, 00089 00090 testFunctionList, 00091 00092 unknown, 00093 unknownList, 00094 00095 variationalFormula, 00096 variationalBilinearOperator, 00097 variationalLinearOperator, 00098 variationalDirichlet, 00099 vector3 00100 };
| FunctionExpressionConvection::FunctionExpressionConvection | ( | ReferenceCounting< FieldExpression > | field, | |
| ReferenceCounting< RealExpression > | dt, | |||
| ReferenceCounting< FunctionExpression > | phi | |||
| ) |
Constructor
| field | advection field | |
| dt | time step | |
| phi | convected function |
Definition at line 98 of file FunctionExpressionConvection.cpp.
00101 : FunctionExpression(FunctionExpression::convection), 00102 __isToEvaluate(true), 00103 __field(field), 00104 __timeStep(dt), 00105 __convectedFunction(phi) 00106 { 00107 ; 00108 }
| FunctionExpressionConvection::FunctionExpressionConvection | ( | const FunctionExpressionConvection & | e | ) |
Copy constructor
| e | given function expression |
Definition at line 112 of file FunctionExpressionConvection.cpp.
00113 : FunctionExpression(f), 00114 __isToEvaluate(f.__isToEvaluate), 00115 __field(f.__field), 00116 __timeStep(f.__timeStep), 00117 __convectedFunction(f.__convectedFunction) 00118 { 00119 ; 00120 }
| FunctionExpressionConvection::~FunctionExpressionConvection | ( | ) |
| std::ostream & FunctionExpressionConvection::put | ( | std::ostream & | os | ) | const [protected, virtual] |
Specialization of the put function
| os | the stream |
Reimplemented from FunctionExpression.
Definition at line 28 of file FunctionExpressionConvection.cpp.
References __convectedFunction, __field, FunctionExpression::__scalarFunction, and __timeStep.
00029 { 00030 if (__scalarFunction != 0) { 00031 os << *__scalarFunction; 00032 } else { 00033 os << "convect(" << *__field << ',' 00034 << *__timeStep << ',' << *__convectedFunction << ')'; 00035 } 00036 return os; 00037 }
| bool FunctionExpressionConvection::hasBoundaryExpression | ( | ) | const [inline, virtual] |
Returns true if one of the functions has a boundary
Reimplemented from FunctionExpression.
Definition at line 60 of file FunctionExpressionConvection.hpp.
References __convectedFunction, and __field.
00061 { 00062 return (__field->hasBoundaryExpression() or 00063 __convectedFunction->hasBoundaryExpression()); 00064 }
| void FunctionExpressionConvection::execute | ( | ) | [virtual] |
Executes the expression
Implements Expression.
Definition at line 40 of file FunctionExpressionConvection.cpp.
References __convectedFunction, __field, __isToEvaluate, FunctionExpression::__scalarFunction, __timeStep, Mesh::cartesianHexahedraMesh, Information::getMesh(), Mesh::hexahedraMesh, StaticBase< Information >::instance(), Expression::mesh, ErrorHandler::normal, stringify(), Mesh::tetrahedraMesh, Mesh::type(), and ErrorHandler::unexpected.
00041 { 00042 __convectedFunction->execute(); 00043 00044 __field->execute(); 00045 __timeStep->execute(); 00046 00047 if (Information::instance().usesMesh()) { 00048 00049 const Mesh& mesh = *Information::instance().getMesh(); 00050 00051 if (__field->numberOfComponents() != 3) { 00052 throw ErrorHandler(__FILE__,__LINE__, 00053 "convection needs a 3 component field:\n" 00054 +stringify(*__field)+" has "+stringify(__field->numberOfComponents())+" components", 00055 ErrorHandler::normal); 00056 } 00057 00058 switch (mesh.type()) { 00059 case Mesh::cartesianHexahedraMesh: { 00060 __scalarFunction 00061 = new Convection<Structured3DMesh>(*__convectedFunction->function(), 00062 *__field->field(), 00063 __timeStep->realValue(), 00064 static_cast<const Structured3DMesh&>(mesh)); 00065 break; 00066 } 00067 case Mesh::tetrahedraMesh: { 00068 __scalarFunction 00069 = new Convection<MeshOfTetrahedra>(*__convectedFunction->function(), 00070 *__field->field(), 00071 __timeStep->realValue(), 00072 static_cast<const MeshOfTetrahedra&>(mesh)); 00073 break; 00074 } 00075 case Mesh::hexahedraMesh: { 00076 __scalarFunction 00077 = new Convection<MeshOfHexahedra>(*__convectedFunction->function(), 00078 *__field->field(), 00079 __timeStep->realValue(), 00080 static_cast<const MeshOfHexahedra&>(mesh)); 00081 break; 00082 } 00083 default: { 00084 throw ErrorHandler(__FILE__,__LINE__, 00085 "convection is not implemented for this kind of mesh", 00086 ErrorHandler::unexpected); 00087 } 00088 } 00089 00090 __isToEvaluate = false; 00091 } else { 00092 __isToEvaluate = true; 00093 } 00094 }

| const FunctionExpression::FunctionType & FunctionExpression::type | ( | ) | const [inherited] |
Read only access to the type of the function
Reimplemented from Expression.
Definition at line 43 of file FunctionExpression.cpp.
References FunctionExpression::__type.
00044 { 00045 return __type; 00046 }
| ConstReferenceCounting< ScalarFunctionBase > FunctionExpression::function | ( | ) | const [inherited] |
Access to the scalar function
Definition at line 50 of file FunctionExpression.cpp.
References FunctionExpression::__scalarFunction, and ASSERT.
Referenced by RealExpressionIntegrate::__integrate(), FunctionExpressionMeshReferences::ReferencesSet::add(), RealExpressionIntegrate::execute(), and FunctionExpressionVariable::execute().
00051 { 00052 ASSERT(__scalarFunction != 0); 00053 return __scalarFunction; 00054 }
| ReferenceCounting< FunctionExpression > FunctionExpression::value | ( | ) | [inherited] |
Access the value of the function expression
Definition at line 58 of file FunctionExpression.cpp.
References FunctionExpression::__scalarFunction, ASSERT, and FunctionExpression::hasBoundaryExpression().
00059 { 00060 ASSERT(__scalarFunction != 0); 00061 return new FunctionExpressionValue(__scalarFunction, 00062 this->hasBoundaryExpression()); 00063 }

| static Expression::Type Expression::getType | ( | ReferenceCounting< Expression > | e1, | |
| ReferenceCounting< Expression > | e2 | |||
| ) | [inline, static, protected, inherited] |
Traits conversion of types.
Definition at line 112 of file Expression.hpp.
References Expression::real.
00114 { 00115 return Expression::real; 00116 }
| virtual std::istream& Expression::_get | ( | std::istream & | is | ) | [inline, protected, virtual, inherited] |
Read *this to the input is.
Reimplemented in IStreamExpressionList, and RealExpressionVariable.
Definition at line 122 of file Expression.hpp.
References ErrorHandler::normal.
00123 { 00124 throw ErrorHandler(__FILE__,__LINE__, 00125 "operator >> is not supported for this expression", 00126 ErrorHandler::normal); 00127 return is; 00128 }
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const Expression & | e | |||
| ) | [friend, inherited] |
this function allows to output expressions.
Definition at line 143 of file Expression.hpp.
00144 { 00145 return e.put(os); 00146 }
| std::istream& operator>> | ( | std::istream & | is, | |
| Expression & | e | |||
| ) | [friend, inherited] |
this function allows to read expressions from streams
Definition at line 149 of file Expression.hpp.
00150 { 00151 return e._get(is); 00152 }
bool FunctionExpressionConvection::__isToEvaluate [private] |
true while function has not been evaluated
Definition at line 42 of file FunctionExpressionConvection.hpp.
Referenced by execute().
advection field
Definition at line 44 of file FunctionExpressionConvection.hpp.
Referenced by execute(), hasBoundaryExpression(), and put().
time step expression
Definition at line 46 of file FunctionExpressionConvection.hpp.
convected function
Definition at line 48 of file FunctionExpressionConvection.hpp.
Referenced by execute(), hasBoundaryExpression(), and put().
ConstReferenceCounting<ScalarFunctionBase> FunctionExpression::__scalarFunction [protected, inherited] |
The function associated to the expression
Definition at line 73 of file FunctionExpression.hpp.
Referenced by FunctionExpressionVariable::execute(), FunctionExpressionUnaryMinus::execute(), FunctionExpressionSpectral::execute(), FunctionExpressionRead::execute(), FunctionExpressionObjectCharacteristic::execute(), FunctionExpressionNot::execute(), FunctionExpressionNormalComponent::execute(), FunctionExpressionMeshReferences::execute(), FunctionExpressionMeshCharacteristic::execute(), FunctionExpressionLinearBasis::execute(), FunctionExpressionIntegrate::execute(), FunctionExpressionFEM::execute(), FunctionExpressionDomainCharacteristic::execute(), FunctionExpressionDG::execute(), FunctionExpressionDerivative::execute(), execute(), FunctionExpressionConstant::execute(), FunctionExpressionComposed::execute(), FunctionExpressionCFunction::execute(), FunctionExpressionBinaryOperation::execute(), FunctionExpression::function(), FunctionExpressionValue::FunctionExpressionValue(), put(), FunctionExpression::put(), and FunctionExpression::value().
1.5.6