BoundaryExpressionReferences Class Reference

#include <BoundaryExpressionReferences.hpp>

Inheritance diagram for BoundaryExpressionReferences:

Inheritance graph
[legend]
Collaboration diagram for BoundaryExpressionReferences:

Collaboration graph
[legend]

List of all members.

Public Types

typedef std::set
< ReferenceCounting
< RealExpression > > 
ReferencesSet
enum  BoundaryType {
  undefined, surfaceMesh, povray, references,
  list, variable
}
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

bool hasPOVBoundary () const
bool hasPredefinedBoundary () const
void execute ()
void add (ReferenceCounting< RealExpression > reference)
 BoundaryExpressionReferences ()
 BoundaryExpressionReferences (const std::string &borderName)
 BoundaryExpressionReferences (const BoundaryExpressionReferences &r)
 ~BoundaryExpressionReferences ()
const
BoundaryExpression::BoundaryType
boundaryType () const
ReferenceCounting< Boundaryboundary ()
const Expression::Typetype () const
 return the type.

Protected Member Functions

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

ReferenceCounting< Boundary__boundary

Private Member Functions

std::ostream & put (std::ostream &os) const

Private Attributes

ReferencesSet __references

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 33 of file BoundaryExpressionReferences.hpp.


Member Typedef Documentation

Definition at line 39 of file BoundaryExpressionReferences.hpp.


Member Enumeration Documentation

Enumerator:
undefined 
surfaceMesh 
povray 
references 
list 
variable 

Definition at line 43 of file BoundaryExpression.hpp.

00043                     {
00044     undefined,
00045     surfaceMesh,
00046     povray,
00047     references,
00048     list,
00049     variable
00050   };

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

BoundaryExpressionReferences::BoundaryExpressionReferences (  ) 

Constructor

Definition at line 71 of file BoundaryExpressionReferences.cpp.

00072   : BoundaryExpression(BoundaryExpression::references)
00073 {
00074   ;
00075 }

BoundaryExpressionReferences::BoundaryExpressionReferences ( const std::string &  borderName  ) 

Constructor

Parameters:
borderName name of the border

Definition at line 78 of file BoundaryExpressionReferences.cpp.

References __references, and ErrorHandler::unexpected.

00079   : BoundaryExpression(BoundaryExpression::references)
00080 {
00081   if (boundaryName=="xmin") {
00082     __references.insert(new RealExpressionValue(0));
00083     return;
00084   }
00085   if (boundaryName=="xmax") {
00086     __references.insert(new RealExpressionValue(1));
00087     return;
00088   }
00089   if (boundaryName=="ymin") {
00090     __references.insert(new RealExpressionValue(2));
00091     return;
00092   }
00093   if (boundaryName=="ymax") {
00094     __references.insert(new RealExpressionValue(3));
00095     return;
00096   }
00097   if (boundaryName=="zmin") {
00098     __references.insert(new RealExpressionValue(4));
00099     return;
00100   }
00101   if (boundaryName=="zmax") {
00102     __references.insert(new RealExpressionValue(5));
00103     return;
00104   }
00105   throw ErrorHandler(__FILE__,__LINE__,
00106                      "unknown boundary name: '"+boundaryName+"'",
00107                      ErrorHandler::unexpected);
00108 }

BoundaryExpressionReferences::BoundaryExpressionReferences ( const BoundaryExpressionReferences r  ) 

Copy constructor

Parameters:
r given boundary expression reference

Definition at line 111 of file BoundaryExpressionReferences.cpp.

00112   : BoundaryExpression(r),
00113     __references(r.__references)
00114 {
00115   ;
00116 }

BoundaryExpressionReferences::~BoundaryExpressionReferences (  ) 

Destructor

Definition at line 119 of file BoundaryExpressionReferences.cpp.

00120 {
00121   ;
00122 }


Member Function Documentation

std::ostream & BoundaryExpressionReferences::put ( std::ostream &  os  )  const [private, virtual]

Writes the expression to a stream

Parameters:
os given stream
Returns:
os

Implements Expression.

Definition at line 25 of file BoundaryExpressionReferences.cpp.

References __references.

00026 {
00027   for (BoundaryExpressionReferences::ReferencesSet::const_iterator i
00028          = __references.begin();
00029        i != __references.end(); ++i) {
00030     if (i != __references.begin()) {
00031       os  << ',';
00032     }
00033     os << (**i);
00034   }
00035   return os;
00036 }

bool BoundaryExpressionReferences::hasPOVBoundary (  )  const [inline, virtual]

Check is boundary has POVRay references

Returns:
false

Implements BoundaryExpression.

Definition at line 59 of file BoundaryExpressionReferences.hpp.

00060   {
00061     return false;
00062   }

bool BoundaryExpressionReferences::hasPredefinedBoundary (  )  const [inline, virtual]

Checks that the boundary is a predefined mesh boundary

Returns:
false

Implements BoundaryExpression.

Definition at line 70 of file BoundaryExpressionReferences.hpp.

00071   {
00072     return false;
00073   }

void BoundaryExpressionReferences::execute (  )  [virtual]

Eexecutes the expression

Implements Expression.

Definition at line 40 of file BoundaryExpressionReferences.cpp.

References BoundaryExpression::__boundary, __references, BoundaryReferences::add(), ErrorHandler::normal, and stringify().

00041 {
00042   for (BoundaryExpressionReferences::ReferencesSet::iterator i
00043          = __references.begin();
00044        i != __references.end(); ++i)
00045     {
00046       ReferenceCounting<RealExpression> ref = *i;
00047       (*ref).execute();
00048     }
00049 
00050   BoundaryReferences* b= new BoundaryReferences();
00051 
00052   for (BoundaryExpressionReferences::ReferencesSet::iterator i
00053          = __references.begin();
00054        i != __references.end(); ++i) {
00055     ReferenceCounting<RealExpression> ref = *i;
00056     const double value = (*ref).realValue();
00057     if ((value<0) or (value != int(value))) {
00058       throw ErrorHandler(__FILE__,__LINE__,
00059                          stringify(value)
00060                          +" is not a correct boundary reference\n"
00061                          +"Boundary references must be positive integers",
00062                          ErrorHandler::normal);
00063     }
00064     b->add(static_cast<size_t>(value));
00065   }
00066   __boundary = b;
00067 }

Here is the call graph for this function:

void BoundaryExpressionReferences::add ( ReferenceCounting< RealExpression reference  )  [inline]

Adds a reference to the set

Parameters:
reference added reference

Definition at line 86 of file BoundaryExpressionReferences.hpp.

References __references.

00087   {
00088     __references.insert(reference);
00089   }

const BoundaryExpression::BoundaryType& BoundaryExpression::boundaryType (  )  const [inline, inherited]

Read only access to the type of the boundary

Returns:
__boundaryType

Definition at line 80 of file BoundaryExpression.hpp.

References BoundaryExpression::__boundaryType.

00081   {
00082     return __boundaryType;
00083   }

ReferenceCounting< Boundary > BoundaryExpression::boundary (  )  [inherited]

Access to the boundary

Returns:
__boundary

Definition at line 25 of file BoundaryExpression.cpp.

References BoundaryExpression::__boundary.

Referenced by BoundaryExpressionList::add().

00026 {
00027   return __boundary;
00028 }

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   }

const Expression::Type& Expression::type (  )  const [inline, inherited]

return the type.

Reimplemented in FunctionExpression.

Definition at line 132 of file Expression.hpp.

References Expression::__type.

Referenced by MeshExpressionExtract::execute().

00133   {
00134     return __type;
00135   }


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

set of references

Definition at line 42 of file BoundaryExpressionReferences.hpp.

Referenced by add(), BoundaryExpressionReferences(), execute(), and put().


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

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