DGFunctionBuilder Class Reference

#include <DGFunctionBuilder.hpp>

Collaboration diagram for DGFunctionBuilder:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void build (const ScalarDiscretizationTypeDG &d, const Mesh *mesh)
void build (const ScalarDiscretizationTypeDG &d, const Mesh *mesh, const ScalarFunctionBase &f)
void build (const ScalarDiscretizationTypeDG &d, const Mesh *mesh, const Vector< real_t > &values, const real_t &outsideValue=0)
ReferenceCounting< DGFunctionBasegetBuiltDGFunction ()
ConstReferenceCounting
< ScalarFunctionBase
getBuiltScalarFunction () const
 DGFunctionBuilder ()
 ~DGFunctionBuilder ()

Private Member Functions

template<typename MeshType>
void __build (const ScalarDiscretizationTypeDG &d, const MeshType *mesh)

Private Attributes

ReferenceCounting< DGFunctionBase__builtFunction


Detailed Description

Definition at line 39 of file DGFunctionBuilder.hpp.


Constructor & Destructor Documentation

DGFunctionBuilder::DGFunctionBuilder (  ) 

Constructor

Definition at line 164 of file DGFunctionBuilder.cpp.

00165 {
00166   ;
00167 }

DGFunctionBuilder::~DGFunctionBuilder (  ) 

Detructor

Definition at line 170 of file DGFunctionBuilder.cpp.

00171 {
00172   ;
00173 }


Member Function Documentation

template<typename MeshType>
void DGFunctionBuilder::__build ( const ScalarDiscretizationTypeDG d,
const MeshType *  mesh 
) [inline, private]

Template function that builds the function according to a mesh type and a kind of discretization

Parameters:
d discretization type
mesh specialized type mesh

Definition at line 37 of file DGFunctionBuilder.cpp.

References __builtFunction, ScalarDiscretizationTypeBase::DGFEM0, ScalarDiscretizationTypeBase::DGFEM1, ScalarDiscretizationTypeBase::DGFEM2, ScalarDiscretizationTypeBase::type(), and ErrorHandler::unexpected.

Referenced by build().

00039 {
00040   typedef typename MeshType::CellType CellType;
00041 
00042   switch(d.type()) {
00043   case ScalarDiscretizationTypeBase::DGFEM0: {
00044     typedef
00045       FiniteElementTraits<CellType,ScalarDiscretizationTypeBase::lagrangianFEM0>
00046       FETraits;
00047 
00048     __builtFunction
00049       = new DGFunction<MeshType, FETraits>(mesh);
00050     break;
00051   }
00052   case ScalarDiscretizationTypeBase::DGFEM1: {
00053     typedef
00054       FiniteElementTraits<CellType,ScalarDiscretizationTypeBase::lagrangianFEM1>
00055       FETraits;
00056 
00057     __builtFunction
00058       = new DGFunction<MeshType, FETraits>(mesh);
00059     break;
00060   }
00061   case ScalarDiscretizationTypeBase::DGFEM2: {
00062     typedef
00063       FiniteElementTraits<CellType,ScalarDiscretizationTypeBase::lagrangianFEM2>
00064       FETraits;
00065 
00066     __builtFunction
00067       = new DGFunction<MeshType, FETraits>(mesh);
00068     break;
00069 
00070   }
00071   default: {
00072     throw ErrorHandler(__FILE__,__LINE__,
00073                        "unknown discretization type",
00074                        ErrorHandler::unexpected);
00075   }
00076   }
00077 }

Here is the call graph for this function:

void DGFunctionBuilder::build ( const ScalarDiscretizationTypeDG d,
const Mesh mesh 
)

General function to build a function according to a mesh and a discretization type

Parameters:
d discretization type
mesh a mesh

Definition at line 82 of file DGFunctionBuilder.cpp.

References __build(), Mesh::cartesianHexahedraMesh, Mesh::hexahedraMesh, Mesh::spectralMesh, Mesh::tetrahedraMesh, Mesh::trianglesMesh, Mesh::type(), and ErrorHandler::unexpected.

Referenced by build(), and FunctionExpressionDG::execute().

00084 {
00085   switch (mesh->type()) {
00086   case Mesh::cartesianHexahedraMesh: {
00087     const Structured3DMesh* m
00088       = dynamic_cast<const Structured3DMesh*>(mesh);
00089     this->__build(d, m);
00090     break;
00091   }
00092   case Mesh::hexahedraMesh: {
00093     const MeshOfHexahedra* m
00094       = dynamic_cast<const MeshOfHexahedra*>(mesh);
00095     this->__build(d, m);
00096     break;
00097   }
00098   case Mesh::spectralMesh: {
00099     const SpectralMesh* m
00100       = dynamic_cast<const SpectralMesh*>(mesh);
00101     this->__build(d, m);
00102     break;
00103   }
00104   case Mesh::tetrahedraMesh: {
00105     const MeshOfTetrahedra* m
00106       = dynamic_cast<const MeshOfTetrahedra*>(mesh);
00107     this->__build(d, m);
00108     break;
00109   }
00110   case Mesh::trianglesMesh: {
00111     const MeshOfTriangles* m
00112       = dynamic_cast<const MeshOfTriangles*>(mesh);
00113     this->__build(d, m);
00114     break;
00115   }
00116   default: {
00117     throw ErrorHandler(__FILE__,__LINE__,
00118                        "not supported mesh type",
00119                        ErrorHandler::unexpected);
00120   }
00121   }
00122 }

Here is the call graph for this function:

void DGFunctionBuilder::build ( const ScalarDiscretizationTypeDG d,
const Mesh mesh,
const ScalarFunctionBase f 
)

Build a function whose values are initialized to a given $ f $

Parameters:
d discretization type
mesh a mesh
f given function

Definition at line 126 of file DGFunctionBuilder.cpp.

References build().

00129 {
00130   this->build(d,mesh);
00131   DGFunctionBase& dgFunctionView = dynamic_cast<DGFunctionBase&>(*__builtFunction);
00132   dgFunctionView = u;
00133 }

Here is the call graph for this function:

void DGFunctionBuilder::build ( const ScalarDiscretizationTypeDG d,
const Mesh mesh,
const Vector< real_t > &  values,
const real_t &  outsideValue = 0 
)

Build a function whose values are initialized to given values

Parameters:
d discretization type
mesh a mesh
values given values
outsideValue returned value outside the mesh (necessary for function simplification)

Definition at line 138 of file DGFunctionBuilder.cpp.

References build(), and DGFunctionBase::setOutsideValue().

00142 {
00143   this->build(d,mesh);
00144   DGFunctionBase& dgFunctionView = dynamic_cast<DGFunctionBase&>(*__builtFunction);
00145   dgFunctionView = values;
00146   dgFunctionView.setOutsideValue(outsideValue);
00147 }

Here is the call graph for this function:

ReferenceCounting< DGFunctionBase > DGFunctionBuilder::getBuiltDGFunction (  ) 

Access to the built function

Returns:
__builtFunction

Definition at line 151 of file DGFunctionBuilder.cpp.

References __builtFunction.

00152 {
00153   return __builtFunction;
00154 }

ConstReferenceCounting< ScalarFunctionBase > DGFunctionBuilder::getBuiltScalarFunction (  )  const

Read-only access to the built function viewed as a standard scalar function

Returns:
__builtFunction

Definition at line 158 of file DGFunctionBuilder.cpp.

References __builtFunction.

Referenced by FunctionExpressionDG::execute().

00159 {
00160   return static_cast<const DGFunctionBase*>(__builtFunction);
00161 }


Member Data Documentation

the built function

Definition at line 43 of file DGFunctionBuilder.hpp.

Referenced by __build(), getBuiltDGFunction(), and getBuiltScalarFunction().


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

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