FunctionExpressionFEM Class Reference

#include <FunctionExpressionFEM.hpp>

Inheritance diagram for FunctionExpressionFEM:

Inheritance graph
[legend]
Collaboration diagram for FunctionExpressionFEM:

Collaboration graph
[legend]

List of all members.

Public Types

enum  FunctionType {
  constant, linearBase, normalComponent, fem,
  dg, spectral, derivative, meshReferences,
  composed, variable, cfunction, binaryOperation,
  unaryMinus, convection, objectCharacteristic, meshCharacteristic,
  domainCharacteristic, read, functionValue, not_,
  integrate
}
 functions types ids More...
enum  Type {
  boolean, boundary, boundaryCondition, boundaryConditionList,
  domain, field, fieldlist, function,
  ifstreamexpression, integrated, integratedOperator, insideExpression,
  insideListExpression, istreamexpression, istreamExpressionList, linearExp,
  mesh, multiLinearExp, multiLinearExpSum, multiLinearForm,
  multiLinearFormSum, ofstreamexpression, option, ostreamexpression,
  ostreamExpressionList, pdeEquation, pdeOperator, pdeOperatorSum,
  pdeProblem, problem, real, scene,
  solver, solverOptions, string, subOption,
  subOptionList, testFunctionList, unknown, unknownList,
  variationalFormula, variationalBilinearOperator, variationalLinearOperator, variationalDirichlet,
  vector3
}

Public Member Functions

ReferenceCounting< MeshExpressionmesh () const
void execute ()
 FunctionExpressionFEM (ReferenceCounting< MeshExpression > mesh, ReferenceCounting< FunctionExpression > e, const ScalarDiscretizationTypeBase::Type &femType)
 FunctionExpressionFEM (const FunctionExpressionFEM &f)
 ~FunctionExpressionFEM ()
virtual bool hasBoundaryExpression () const
const
FunctionExpression::FunctionType
type () const
ConstReferenceCounting
< ScalarFunctionBase
function () const
ReferenceCounting
< FunctionExpression
value ()

Protected Member Functions

virtual std::ostream & put (std::ostream &os) const
virtual std::istream & _get (std::istream &is)
 Read *this to the input is.

Static Protected Member Functions

static Expression::Type getType (ReferenceCounting< Expression > e1, ReferenceCounting< Expression > e2)

Protected Attributes

ConstReferenceCounting
< ScalarFunctionBase
__scalarFunction

Private Attributes

const
ScalarDiscretizationTypeBase::Type 
__discretizationType
ReferenceCounting< MeshExpression__mesh
ReferenceCounting
< FunctionExpression
__functionExpression

Friends

std::ostream & operator<< (std::ostream &os, const Expression &e)
 this function allows to output expressions.
std::istream & operator>> (std::istream &is, Expression &e)
 this function allows to read expressions from streams


Detailed Description

Definition at line 37 of file FunctionExpressionFEM.hpp.


Member Enumeration Documentation

functions types ids

Enumerator:
constant 
linearBase 
normalComponent 
fem 
dg 
spectral 
derivative 
meshReferences 
composed 
variable 
cfunction 
binaryOperation 
unaryMinus 
convection 
objectCharacteristic 
meshCharacteristic 
domainCharacteristic 
read 
functionValue 
not_ 
integrate 

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]

Enumerator:
boolean 
boundary 
boundaryCondition 
boundaryConditionList 
domain 
field 
fieldlist 
function 
ifstreamexpression 
integrated 
integratedOperator 
insideExpression 
insideListExpression 
istreamexpression 
istreamExpressionList 
linearExp 
mesh 
multiLinearExp 
multiLinearExpSum 
multiLinearForm 
multiLinearFormSum 
ofstreamexpression 
option 
ostreamexpression 
ostreamExpressionList 
pdeEquation 
pdeOperator 
pdeOperatorSum 
pdeProblem 
problem 
real 
scene 
solver 
solverOptions 
string 
subOption 
subOptionList 
testFunctionList 
unknown 
unknownList 
variationalFormula 
variationalBilinearOperator 
variationalLinearOperator 
variationalDirichlet 
vector3 

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   };


Constructor & Destructor Documentation

FunctionExpressionFEM::FunctionExpressionFEM ( ReferenceCounting< MeshExpression mesh,
ReferenceCounting< FunctionExpression e,
const ScalarDiscretizationTypeBase::Type femType 
)

Constructor

Parameters:
mesh mesh of discretization
e expression of the function
femType discretization type

Definition at line 62 of file FunctionExpressionFEM.cpp.

00065   : FunctionExpression(FunctionExpression::fem),
00066     __discretizationType(discretizationType),
00067     __mesh(mesh),
00068     __functionExpression(function)
00069 {
00070   ;
00071 }

FunctionExpressionFEM::FunctionExpressionFEM ( const FunctionExpressionFEM f  ) 

Copy constructor

Parameters:
f given finite element function expression

Definition at line 74 of file FunctionExpressionFEM.cpp.

00075   : FunctionExpression(femFunction),
00076     __discretizationType(femFunction.__discretizationType),
00077     __mesh(femFunction.__mesh),
00078     __functionExpression(femFunction.__functionExpression)
00079 {
00080   ;
00081 }

FunctionExpressionFEM::~FunctionExpressionFEM (  ) 

Destructor

Definition at line 83 of file FunctionExpressionFEM.cpp.

00084 {
00085   ;
00086 }


Member Function Documentation

ReferenceCounting<MeshExpression> FunctionExpressionFEM::mesh (  )  const [inline]

Access to the mesh

Bug:
This function should not exist
Returns:
__mesh

Definition at line 57 of file FunctionExpressionFEM.hpp.

References __mesh.

00058   {
00059 #warning SHOULD NOT USE THIS FUNCTION
00060     return __mesh;
00061   }

void FunctionExpressionFEM::execute (  )  [virtual]

Executes the expression

Implements Expression.

Definition at line 34 of file FunctionExpressionFEM.cpp.

References __discretizationType, __functionExpression, __mesh, FunctionExpression::__scalarFunction, FEMFunctionBuilder::build(), FEMFunctionBuilder::getBuiltScalarFunction(), StaticBase< Information >::instance(), Information::setMesh(), and Information::unsetMesh().

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   // function has now been evaluated.
00056   __functionExpression = 0;
00057   Information::instance().unsetMesh();
00058 
00059 }

Here is the call graph for this function:

std::ostream & FunctionExpression::put ( std::ostream &  os  )  const [protected, virtual, inherited]

Specialization of the put function

Parameters:
os the stream
Returns:
the stream os

Implements Expression.

Reimplemented in FunctionExpressionConvection, FunctionExpressionDomainCharacteristic, FunctionExpressionMeshCharacteristic, FunctionExpressionMeshReferences, and FunctionExpressionVariable.

Definition at line 28 of file FunctionExpression.cpp.

References FunctionExpression::__scalarFunction.

00029 {
00030   os << *__scalarFunction;
00031   return os;
00032 }

bool FunctionExpression::hasBoundaryExpression (  )  const [virtual, inherited]

const FunctionExpression::FunctionType & FunctionExpression::type (  )  const [inherited]

Read only access to the type of the function

Returns:
__type

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]

ReferenceCounting< FunctionExpression > FunctionExpression::value (  )  [inherited]

Access the value of the function expression

Returns:
a FunctionExpressionValue

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 }

Here is the call graph for this function:

static Expression::Type Expression::getType ( ReferenceCounting< Expression e1,
ReferenceCounting< Expression e2 
) [inline, static, protected, inherited]

Traits conversion of types.

Todo:
IMPLEMENT IT.

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   }


Friends And Related Function Documentation

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   }


Member Data Documentation

type of discretization

Definition at line 42 of file FunctionExpressionFEM.hpp.

Referenced by execute().

mesh of discretization

Definition at line 45 of file FunctionExpressionFEM.hpp.

Referenced by execute(), and mesh().

expression defining the function

Definition at line 48 of file FunctionExpressionFEM.hpp.

Referenced by execute().


The documentation for this class was generated from the following files:

Generated on Wed Nov 19 00:07:05 2008 for FreeFEM3D (aka ff3d) by  doxygen 1.5.6