Domain Class Reference

#include <Domain.hpp>

Collaboration diagram for Domain:

Collaboration graph
[legend]

List of all members.

Public Member Functions

const bool & isR3 () const
size_t reference (const TinyVector< 3, real_t > &ref) const
bool inside (const TinyVector< 3 > &X) const
ConstReferenceCounting< Scenescene () const
const Objectobject () const
void setObjects (ReferenceCounting< Object > objects)
 Domain (ConstReferenceCounting< Scene > scene)
 Domain (const Domain &D)
 ~Domain ()

Private Member Functions

void __buildReferenceAssociation (const Object &o)
bool __inShape (const TinyVector< 3 > &X) const

Private Attributes

bool __isR3
ReferenceCounting< Object__objects
ConstReferenceCounting< Scene__scene
std::map< TinyVector
< 3, real_t >, size_t > 
__povToReference

Friends

std::ostream & operator<< (std::ostream &os, const Domain &D)


Detailed Description

Definition at line 46 of file Domain.hpp.


Constructor & Destructor Documentation

Domain::Domain ( ConstReferenceCounting< Scene scene  ) 

Constructor

Parameters:
scene domain scene

Definition at line 30 of file Domain.cpp.

00031   : __isR3(true),
00032     __objects(0),
00033     __scene(scene)
00034 {
00035   ;
00036 }

Domain::Domain ( const Domain D  ) 

Copy constructor

Parameters:
D given domain

Definition at line 39 of file Domain.cpp.

00040   : __isR3(D.__isR3),
00041     __objects(D.__objects),
00042     __scene(D.__scene)
00043 {
00044   ;
00045 }

Domain::~Domain (  ) 

Destructor

Definition at line 48 of file Domain.cpp.

00049 {
00050   ;
00051 }


Member Function Documentation

void Domain::__buildReferenceAssociation ( const Object o  )  [private]

Definition at line 59 of file Domain.cpp.

References __povToReference, Intersection::begin(), Difference::begin(), Union::begin(), Shape::difference, Intersection::end(), Difference::end(), Union::end(), ffout(), Object::hasReference(), Shape::intersection, Shape::not_, Object::reference(), Object::shape(), Shape::type(), and Shape::union_.

Referenced by setObjects().

00060 {
00061   if (o.hasReference()) {
00062     const TinyVector<3, real_t>& ref = o.reference();
00063     if (__povToReference.find(ref) == __povToReference.end()) {
00064       const size_t n = __povToReference.size() + 1;
00065       __povToReference[ref] = n;
00066       ffout(2) << "\t\t" << ref << " -> " << n << '\n';
00067     }
00068   }
00069 
00070   const Shape& shape = (*o.shape());
00071 
00072   switch(shape.type()) {
00073   case Shape::union_: {
00074     const Union& U = static_cast<const Union&>(shape);
00075 
00076     for (Union::const_iterator i = U.begin();
00077          i != U.end(); ++i) {
00078       __buildReferenceAssociation(*(*i));
00079     }
00080     break;
00081   }
00082   case Shape::difference: {
00083     const Difference& D = static_cast<const Difference&>(shape);
00084 
00085     for (Difference::const_iterator i = D.begin();
00086          i != D.end(); ++i) {
00087       __buildReferenceAssociation(*(*i));
00088     }
00089     break;
00090   }
00091   case Shape::intersection: {
00092     const Intersection& I = static_cast<const Intersection&>(shape);
00093 
00094     for (Intersection::const_iterator i = I.begin();
00095          i != I.end(); ++i) {
00096       __buildReferenceAssociation(*(*i));
00097     }
00098     break;
00099   }
00100   case Shape::not_: {
00101     const Object& notObject = *(static_cast<const Not&>(shape).object());
00102     __buildReferenceAssociation(notObject);
00103     break;
00104   }
00105   default: {
00106     ;
00107   }
00108   }
00109 }

Here is the call graph for this function:

bool Domain::__inShape ( const TinyVector< 3 > &  X  )  const [inline, private]

Definition at line 67 of file Domain.hpp.

Referenced by inside().

00068   {
00069     return (*__objects).inside(X);
00070   }

const bool& Domain::isR3 (  )  const [inline]

Returns true if the considered domain is $\mathbf{R}^3$

Returns:
true if $\Omega=\mathbf{R}^3$

Definition at line 78 of file Domain.hpp.

References __isR3.

Referenced by MeshExpressionSurface::execute().

00079   {
00080     return __isR3;
00081   }

size_t Domain::reference ( const TinyVector< 3, real_t > &  ref  )  const [inline]

Definition at line 83 of file Domain.hpp.

References __povToReference, and ErrorHandler::normal.

Referenced by SurfaceMeshGenerator::Internals::__generateMesh(), and BoundaryMeshAssociation::setPOVMeshes().

00084   {
00085     std::map<TinyVector<3, real_t>, size_t>::const_iterator i
00086       = __povToReference.find(ref);
00087     if (i == __povToReference.end()) {
00088       std::stringstream errorMsg;
00089       errorMsg << "You provided the reference " << ref
00090                << " that is not used to define\n"
00091                << "your computational domain. The possible references are\n";
00092       for (std::map<TinyVector<3, real_t>, size_t>::const_iterator j
00093              = __povToReference.begin();
00094            j != __povToReference.end(); ++j) {
00095         errorMsg << '\t' << j->first << std::ends;
00096       }
00097       throw ErrorHandler(__FILE__,__LINE__,
00098                          errorMsg.str(),
00099                          ErrorHandler::normal);
00100     }
00101     return (*i).second;
00102   }

bool Domain::inside ( const TinyVector< 3 > &  X  )  const [inline]

Returns true if X is inside the domain

Parameters:
X 
Returns:

Definition at line 121 of file Domain.hpp.

References __inShape(), and __isR3.

Referenced by DegreeOfFreedomSetBuilder::__buildFEMFictitious(), FictitiousDomainMethod::__computesDegreesOfFreedom(), OctreeMeshBuilder::buildMesh(), ConformTransformationQ1CartesianHexahedron::integrateCharacteristic(), and MeshDomainTetrahedrizor::run().

00122   {
00123     return (__isR3 || __inShape(X));
00124   }

Here is the call graph for this function:

ConstReferenceCounting< Scene > Domain::scene (  )  const

read-only access to the scene

Returns:
__scene

Definition at line 54 of file Domain.cpp.

References __scene.

00055 {
00056   return __scene;
00057 }

const Object& Domain::object (  )  const [inline]

Returns the shape if defined...

Returns:
*__objects

Definition at line 138 of file Domain.hpp.

References __objects, and ErrorHandler::unexpected.

Referenced by SurfaceMeshGenerator::generateSurfacicMesh().

00139   {
00140     if (__objects == 0) {
00141       throw ErrorHandler(__FILE__,__LINE__,
00142                          "no object list available when no domain is defined ",
00143                          ErrorHandler::unexpected);
00144     }
00145 
00146     return (*__objects);
00147   }

void Domain::setObjects ( ReferenceCounting< Object objects  )  [inline]

Sets the shape of the domain

Parameters:
objects 

Definition at line 154 of file Domain.hpp.

References __buildReferenceAssociation(), __isR3, __objects, and ffout().

00155   {
00156     __isR3 = false;
00157     __objects = objects;
00158     ffout(2) << "\tReference translation (POV-Ray -> FEM)\n";
00159     this->__buildReferenceAssociation(*__objects);
00160     ffout(2) << "\tDone\n";
00161   }

Here is the call graph for this function:


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Domain D 
) [friend]

Outputs the Domain D in the std::ostream os.

Definition at line 107 of file Domain.hpp.

00109   {
00110     os << *D.__objects;
00111     return os;
00112   }


Member Data Documentation

bool Domain::__isR3 [private]

This boolean describes the Domain this way:

  • false: the domain is a subset of $ R^3$.
  • true: the domain is $ R^3$

Definition at line 53 of file Domain.hpp.

Referenced by inside(), isR3(), and setObjects().

The shape of the domain

Definition at line 56 of file Domain.hpp.

Referenced by object(), and setObjects().

The POV-Ray scene

Definition at line 59 of file Domain.hpp.

Referenced by scene().

std::map<TinyVector<3, real_t>, size_t> Domain::__povToReference [private]

The POV-Ray to internal references association

Definition at line 62 of file Domain.hpp.

Referenced by __buildReferenceAssociation(), and reference().


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

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