BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > Class Template Reference

#include <BoundaryConditionCommonFEMDiscretization.hpp>

Inheritance diagram for BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >:

Inheritance graph
[legend]
Collaboration diagram for BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >:

Collaboration graph
[legend]

List of all members.

Public Types

typedef MeshType::CellType CellType
typedef FiniteElementTraits
< CellType,
TypeOfDiscretization >::Type 
FiniteElement
typedef
FiniteElement::QuadratureType 
QuadratureType
typedef FiniteElementTraits
< CellType,
TypeOfDiscretization >
::Transformation 
ConformTransformation

Public Member Functions

virtual void associatesMeshesToBoundaryConditions ()
const MeshType & mesh () const
MeshType & mesh ()
 BoundaryConditionCommonFEMDiscretization (const Problem &problem, const MeshType &aMesh, const DegreeOfFreedomSet &dof)
virtual ~BoundaryConditionCommonFEMDiscretization ()
const bool & dirichlet (const size_t i) const
const real_t & dirichletValue (const size_t i) const
const Vector< bool > & getDirichletList () const
virtual void getDiagonal (BaseVector &X) const =0
virtual void setMatrix (ReferenceCounting< BaseMatrix > A, ReferenceCounting< BaseVector > b) const =0
virtual void setSecondMember (ReferenceCounting< BaseMatrix > A, ReferenceCounting< BaseVector > b) const =0
virtual void timesX (const BaseVector &X, BaseVector &Z) const =0
virtual void transposedTimesX (const BaseVector &X, BaseVector &Z) const =0
const Problemproblem () const

Protected Member Functions

void __checkBoundaryMeshAssociation (const BoundaryMeshAssociation &bma)
void __associatesDefinedMeshToBoundaryConditions (const BoundaryMeshAssociation &bma)
template<typename MatrixType, typename BoundaryMeshType>
void __setVariationalBoundaryConditionsAlphaUV (const ScalarFunctionBase &alpha, const size_t &equationNumber, const size_t &unknownNumber, MatrixType &A, const BoundaryMeshType &surfaceMesh) const
 Here comes the template structures.
template<typename BoundaryMeshType>
void __setSecondMemberDirichlet (const Dirichlet &dirichlet, const size_t &equationNumber, const BoundaryMeshType &surfMesh) const
template<typename VectorType, typename BoundaryMeshType>
void __getDiagonalNaturalBoundaryConditions (const ScalarFunctionBase &alpha, const size_t &equationNumber, VectorType &z, const BoundaryMeshType &surfaceMesh) const
template<typename VectorType, typename BoundaryMeshType>
void __setVariationalBoundaryConditionsFV (const ScalarFunctionBase &g, const size_t &equationNumber, VectorType &b, const BoundaryMeshType &boundaryMesh) const
template<typename VectorType, typename BoundaryMeshType>
void __variationalBoundaryConditionsAlphaUVTimesX (const ScalarFunctionBase &alpha, const size_t &equationNumber, const size_t &unknownNumber, const VectorType &x, VectorType &z, const BoundaryMeshType &boundaryMesh) const
template<typename VectorType, typename BoundaryMeshType>
void __variationalBoundaryConditionsAlphaUVTransposedTimesX (const ScalarFunctionBase &alpha, const size_t &equationNumber, const size_t &unknownNumber, const VectorType &x, VectorType &z, const BoundaryMeshType &boundaryMesh) const

Static Protected Member Functions

template<typename FunctionClass>
static void __meshWrapper (const SurfaceMesh &surfmesh, const FunctionClass &F)
template<typename VectorType>
static void __StandardGetDiagonalVariationalBorderBilinearOperator (const BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > &__bc, VectorType &z)
template<typename VectorType>
static void __StandardGetDiagonalDirichletBorderBilinearOperator (const BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > &bc, VectorType &z)
template<typename MatrixType>
static void __StandardVariationalBorderBilinearOperator (const BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > &__bc, MatrixType &A)
template<typename MatrixType>
static void __StandardDirichletBorderBilinearOperator (const BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > &__bc, MatrixType &A)
template<typename VectorType>
static void __StandardVariationalBorderLinearOperator (const BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > &__bc, VectorType &b)
template<typename MatrixType, typename VectorType>
static void __StandardDirichletBorderLinearOperator (const BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > &bc, MatrixType &A, VectorType &b)
template<typename VectorType>
static void __StandardVariationalBorderBilinearOperatorTimesX (const BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > &__bc, const VectorType &x, VectorType &z)
template<typename VectorType>
static void __StandardVariationalBorderBilinearOperatorTransposedTimesX (const BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > &__bc, const VectorType &x, VectorType &z)
template<typename VectorType>
static void __StandardDirichletBorderBilinearOperatorTimesX (const BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > &bc, const VectorType &x, VectorType &z)
template<typename VectorType>
static void __StandardDirichletBorderBilinearOperatorTransposedTimesX (const BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > &bc, const VectorType &x, VectorType &z)

Protected Attributes

const MeshType & __mesh
ReferenceCounting
< BoundaryConditionSurfaceMeshAssociation
__bcMeshAssociation
const Problem__problem
const DegreeOfFreedomSet__degreeOfFreedomSet
Vector< bool > __dirichletList
 true for vertices supporting Dirichlet.
Vector< real_t > __dirichletValues


Detailed Description

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
class BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >

Definition at line 55 of file BoundaryConditionCommonFEMDiscretization.hpp.


Member Typedef Documentation

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
typedef MeshType::CellType BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::CellType

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
typedef FiniteElementTraits<CellType, TypeOfDiscretization>::Type BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::FiniteElement

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
typedef FiniteElement::QuadratureType BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::QuadratureType

The quadrature type

Definition at line 70 of file BoundaryConditionCommonFEMDiscretization.hpp.

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
typedef FiniteElementTraits<CellType, TypeOfDiscretization>::Transformation BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::ConformTransformation


Constructor & Destructor Documentation

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::BoundaryConditionCommonFEMDiscretization ( const Problem problem,
const MeshType &  aMesh,
const DegreeOfFreedomSet dof 
) [inline]

Constructs Boundary condition discretization using a problem, a mesh and a set of degrees of freedom

Parameters:
problem the given problem
aMesh a mesh
dof a set of degrees of freedom

Definition at line 163 of file BoundaryConditionCommonFEMDiscretization.hpp.

00166     : BoundaryConditionDiscretization(problem,dof),
00167       __mesh(aMesh)
00168   {
00169     ;
00170   }

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
virtual BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::~BoundaryConditionCommonFEMDiscretization (  )  [inline, virtual]

Destructor

Definition at line 176 of file BoundaryConditionCommonFEMDiscretization.hpp.

00177   {
00178     ;
00179   }


Member Function Documentation

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
void BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__checkBoundaryMeshAssociation ( const BoundaryMeshAssociation bma  )  [inline, protected]

Checks if boundary mesh association is correct

Parameters:
bma the BoundaryMeshAssociation

Definition at line 87 of file BoundaryConditionCommonFEMDiscretization.hpp.

References BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__mesh, BoundaryMeshAssociation::begin(), BoundaryMeshAssociation::end(), SurfaceMesh::isAssociatedTo(), ErrorHandler::normal, stringify(), and ErrorHandler::unexpected.

Referenced by BoundaryConditionFDMDiscretization< MeshType, TypeOfDiscretization >::associatesMeshesToBoundaryConditions(), and BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::associatesMeshesToBoundaryConditions().

00088   {
00089     for (BoundaryMeshAssociation::const_iterator i = bma.begin();
00090          i != bma.end(); ++i) {
00091       if (i->second == 0) {
00092         throw ErrorHandler(__FILE__,__LINE__,
00093                            "The mesh of boundary "
00094                            +stringify(*(i->first))+" was not generated",
00095                            ErrorHandler::unexpected);
00096       } else {
00097         const SurfaceMesh& s = *(i->second);
00098         if (not(s.isAssociatedTo(__mesh))) {
00099           throw ErrorHandler(__FILE__,__LINE__,
00100                              "The mesh of boundary "
00101                              +stringify(*(i->first))
00102                              +" is not related to the volume mesh"
00103                              +"(check your mesh and/or report the error)",
00104                              ErrorHandler::normal);
00105         }
00106       }
00107     }
00108   }

Here is the call graph for this function:

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
void BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__associatesDefinedMeshToBoundaryConditions ( const BoundaryMeshAssociation bma  )  [inline, protected]

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
virtual void BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::associatesMeshesToBoundaryConditions (  )  [inline, virtual]

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
const MeshType& BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::mesh (  )  const [inline]

Read only access to the mesh

Returns:
__mesh

Definition at line 139 of file BoundaryConditionCommonFEMDiscretization.hpp.

References BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__mesh.

00140   {
00141     return __mesh;
00142   }

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
MeshType& BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::mesh (  )  [inline]

Access to the mesh

Returns:
__mesh

Definition at line 149 of file BoundaryConditionCommonFEMDiscretization.hpp.

References BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__mesh.

00150   {
00151     return __mesh;
00152   }

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
template<typename MatrixType, typename BoundaryMeshType>
void BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__setVariationalBoundaryConditionsAlphaUV ( const ScalarFunctionBase alpha,
const size_t &  equationNumber,
const size_t &  unknownNumber,
MatrixType &  A,
const BoundaryMeshType &  surfaceMesh 
) const [inline, protected]

Here comes the template structures.

Definition at line 187 of file BoundaryConditionCommonFEMDiscretization.hpp.

References BoundaryConditionDiscretization::__degreeOfFreedomSet, BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__mesh, and DegreeOfFreedomSet::positionsSet().

00192   {
00193     typedef typename BoundaryMeshType::CellType BoundaryCellType;
00194 
00195     typedef
00196       typename FiniteElementTraits<BoundaryCellType,
00197       TypeOfDiscretization>::Transformation
00198       BoundaryConformTransformation;
00199 
00200     typedef
00201       typename FiniteElementTraits<BoundaryCellType,
00202       TypeOfDiscretization>::JacobianTransformation
00203       BoundaryConformTransformationJacobian;
00204 
00205     typedef
00206       typename FiniteElementTraits<BoundaryCellType,
00207       TypeOfDiscretization>::Type
00208       BoundaryFiniteElement;
00209 
00210     typedef
00211       typename BoundaryFiniteElement::QuadratureType
00212       BoundaryQuadratureType;
00213 
00214     const FiniteElement& finiteElement
00215       = FiniteElement::instance();
00216 
00217     const BoundaryQuadratureType& referenceBoundaryQuadrature
00218       = BoundaryQuadratureType::instance();
00219 
00220     const ScalarDegreeOfFreedomPositionsSet& dofPositions
00221       = this->__degreeOfFreedomSet.positionsSet(0);
00222   
00223     AutoPointer<ConformTransformation> pT;
00224 
00225     const CellType* currentCell = 0;
00226 
00227     for (typename BoundaryMeshType::const_iterator icell(surfaceMesh);
00228          not(icell.end()); ++icell) {
00229       const BoundaryCellType& cell = *icell;
00230       const BoundaryConformTransformation boundaryT(cell);
00231       const BoundaryConformTransformationJacobian boundaryJ(boundaryT);
00232 
00233       const CellType& K
00234         = static_cast<const CellType&>(cell.mother());
00235 
00236       if(currentCell != &K) {
00237         pT = new ConformTransformation(K);
00238         currentCell = &K;
00239       }
00240       const size_t cellNumber = __mesh.cellNumber(K);
00241 
00242       const ConformTransformation& T = *pT;
00243 
00244       for (size_t k=0; k<BoundaryQuadratureType::numberOfQuadraturePoints;
00245            k++) {
00246         // computes local quadrature vertex
00247         TinyVector<3, real_t> q;
00248         boundaryT.value(referenceBoundaryQuadrature[k], q);
00249 
00250         const real_t weight
00251           = referenceBoundaryQuadrature.weight(k)
00252           * boundaryJ.jacobianDet();
00253 
00254         TinyVector<3> coordinates;
00255         T.invertT(q, coordinates);
00256 
00257         const real_t AlphaValue = alpha(q);
00258 
00259         typename FiniteElement::ElementaryVector W;
00260         for (size_t l=0; l<FiniteElement::numberOfDegreesOfFreedom; l++)
00261           W[l] = finiteElement.W(l,coordinates);
00262 
00263         typename FiniteElement::ElementaryMatrix WiWj;
00264 
00265         for (size_t l=0; l<FiniteElement::numberOfDegreesOfFreedom; l++)
00266           for (size_t m=0; m<FiniteElement::numberOfDegreesOfFreedom; m++)
00267             WiWj(l,m) = W[l] * W[m];
00268 
00269         size_t indicesI[FiniteElement::numberOfDegreesOfFreedom];
00270         size_t indicesJ[FiniteElement::numberOfDegreesOfFreedom];
00271         for (size_t l=0; l<FiniteElement::numberOfDegreesOfFreedom; ++l) {
00272           const size_t variableDOFNumber = dofPositions(cellNumber,l);
00273           indicesI[l] = __degreeOfFreedomSet(unknownNumber,
00274                                              variableDOFNumber);
00275           indicesJ[l] = __degreeOfFreedomSet(equationNumber,
00276                                              variableDOFNumber);
00277         }
00278 
00279         for (size_t l=0; l<FiniteElement::numberOfDegreesOfFreedom; l++) {
00280           const size_t I = indicesI[l];
00281           for (size_t m=0; m<FiniteElement::numberOfDegreesOfFreedom; m++) {
00282             const size_t J = indicesJ[m];
00283             A(I,J) += weight * AlphaValue * WiWj(l,m);
00284           }
00285         }
00286       }
00287     }
00288   }  

Here is the call graph for this function:

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
template<typename BoundaryMeshType>
void BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__setSecondMemberDirichlet ( const Dirichlet dirichlet,
const size_t &  equationNumber,
const BoundaryMeshType &  surfMesh 
) const [inline, protected]

Definition at line 291 of file BoundaryConditionCommonFEMDiscretization.hpp.

References BoundaryConditionDiscretization::__degreeOfFreedomSet, BoundaryConditionDiscretization::__dirichletList, BoundaryConditionDiscretization::__dirichletValues, BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__mesh, Dirichlet::g(), DegreeOfFreedomSet::positionsSet(), and ScalarDegreeOfFreedomPositionsSet::vertex().

00294   {
00295     typedef FiniteElementTraits<typename BoundaryMeshType::CellType,
00296                                 TypeOfDiscretization>
00297       FEType;
00298 
00299     const ScalarDegreeOfFreedomPositionsSet& dofPositions
00300       = this->__degreeOfFreedomSet.positionsSet(0);
00301 
00302     typedef typename FEType::Transformation ConformTransformation;
00303 
00304 
00305     for (typename BoundaryMeshType::const_iterator iBorderCell(surfMesh);
00306          not(iBorderCell.end()); ++iBorderCell) {
00307       const typename BoundaryMeshType::CellType& borderCell = *iBorderCell;
00308 
00309       const size_t cellNumber
00310         = __mesh.cellNumber(static_cast<const CellType&>(borderCell.mother()));
00311       const size_t& faceNumber = borderCell.motherCellFaceNumber();
00312 
00313       for (size_t i=0; i<FiniteElement::numberOfFaceLivingDegreesOfFreedom; ++i) {
00314         const size_t& dofNumber = dofPositions(cellNumber,
00315                                                FiniteElement::facesDOF[faceNumber][i]);
00316         const size_t I = __degreeOfFreedomSet(equationNumber,
00317                                               dofPositions(cellNumber,
00318                                                            FiniteElement::facesDOF[faceNumber][i]));
00319         if (not(__dirichletList[I])) {
00320           const real_t GValue = dirichlet.g(dofPositions.vertex(dofNumber));
00321           __dirichletValues[I] = GValue;
00322           __dirichletList[I] = true;
00323         }
00324       }
00325     }
00326   }

Here is the call graph for this function:

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
template<typename VectorType, typename BoundaryMeshType>
void BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__getDiagonalNaturalBoundaryConditions ( const ScalarFunctionBase alpha,
const size_t &  equationNumber,
VectorType &  z,
const BoundaryMeshType &  surfaceMesh 
) const [inline, protected]

Definition at line 331 of file BoundaryConditionCommonFEMDiscretization.hpp.

References BoundaryConditionDiscretization::__degreeOfFreedomSet, BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__mesh, and DegreeOfFreedomSet::positionsSet().

00335   {
00336     typedef typename BoundaryMeshType::CellType BoundaryCellType;
00337 
00338     typedef
00339       typename FiniteElementTraits<BoundaryCellType,
00340       TypeOfDiscretization>::Transformation
00341       BoundaryConformTransformation;
00342 
00343     typedef
00344       typename FiniteElementTraits<BoundaryCellType,
00345       TypeOfDiscretization>::JacobianTransformation
00346       BoundaryConformTransformationJacobian;
00347 
00348     typedef
00349       typename FiniteElementTraits<BoundaryCellType,TypeOfDiscretization>::Type
00350       BoundaryFiniteElement;
00351 
00352     typedef typename BoundaryFiniteElement::QuadratureType BoundaryQuadratureType;
00353 
00354     const FiniteElement& finiteElement
00355       = FiniteElement::instance();
00356 
00357     const BoundaryQuadratureType& referenceBoundaryQuadrature
00358       = BoundaryQuadratureType::instance();
00359   
00360     const ScalarDegreeOfFreedomPositionsSet& dofPositions
00361       = this->__degreeOfFreedomSet.positionsSet(0);
00362   
00363     AutoPointer<ConformTransformation> pT;
00364 
00365     const CellType* currentCell = 0;
00366 
00367     for (typename BoundaryMeshType::const_iterator icell(surfaceMesh);
00368          not(icell.end()); ++icell) {
00369       const BoundaryCellType& cell = *icell;
00370       const BoundaryConformTransformation boundaryT(cell);
00371       const BoundaryConformTransformationJacobian boundaryJ(boundaryT);
00372 
00373       const CellType& K
00374         = static_cast<const CellType&>(cell.mother());
00375 
00376       if(currentCell != &K) {
00377         pT = new ConformTransformation(K);
00378         currentCell = &K;
00379       }
00380       const size_t cellNumber = __mesh.cellNumber(K);
00381       const ConformTransformation& T = *pT;
00382 
00383       for (size_t k=0; k<BoundaryQuadratureType::numberOfQuadraturePoints;
00384            k++) {
00385         // computes local quadrature vertex
00386         TinyVector<3, real_t> q;
00387         boundaryT.value(referenceBoundaryQuadrature[k], q);
00388 
00389         const real_t weight
00390           = referenceBoundaryQuadrature.weight(k)
00391           * boundaryJ.jacobianDet();
00392 
00393         TinyVector<3, real_t> coordinates;
00394         T.invertT(q, coordinates);
00395 
00396         const real_t AlphaValue = alpha(q);
00397 
00398         typename FiniteElement::ElementaryVector W;
00399 
00400         for (size_t l=0; l<FiniteElement::numberOfDegreesOfFreedom; l++) 
00401           W[l] = finiteElement.W(l,coordinates);
00402 
00403         size_t indices[FiniteElement::numberOfDegreesOfFreedom];
00404         for (size_t l=0; l<FiniteElement::numberOfDegreesOfFreedom; ++l) {
00405           indices[l] = __degreeOfFreedomSet(equationNumber,
00406                                             dofPositions(cellNumber,l));
00407         }
00408 
00409         for (size_t l=0; l<FiniteElement::numberOfDegreesOfFreedom; l++) {
00410           const size_t& I = indices[l];
00411           z[I] += W[l] * W[l] * weight * AlphaValue;
00412         }
00413       }
00414     }
00415   }

Here is the call graph for this function:

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
template<typename VectorType, typename BoundaryMeshType>
void BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__setVariationalBoundaryConditionsFV ( const ScalarFunctionBase g,
const size_t &  equationNumber,
VectorType &  b,
const BoundaryMeshType &  boundaryMesh 
) const [inline, protected]

Definition at line 420 of file BoundaryConditionCommonFEMDiscretization.hpp.

References BoundaryConditionDiscretization::__degreeOfFreedomSet, BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__mesh, and DegreeOfFreedomSet::positionsSet().

00424   {
00425     typedef typename BoundaryMeshType::CellType BoundaryCellType;
00426 
00427     typedef
00428       typename FiniteElementTraits<BoundaryCellType,
00429       TypeOfDiscretization>::Transformation
00430       BoundaryConformTransformation;
00431 
00432     typedef
00433       typename FiniteElementTraits<BoundaryCellType,
00434       TypeOfDiscretization>::JacobianTransformation
00435       BoundaryConformTransformationJacobian;
00436 
00437     typedef
00438       typename FiniteElementTraits<BoundaryCellType,
00439       TypeOfDiscretization>::Type
00440       BoundaryFiniteElement;
00441 
00442     typedef
00443       typename BoundaryFiniteElement::QuadratureType
00444       BoundaryQuadratureType;
00445 
00446     const FiniteElement& finiteElement
00447       = FiniteElement::instance();
00448 
00449     const BoundaryQuadratureType& referenceBoundaryQuadrature
00450       = BoundaryQuadratureType::instance();
00451 
00452     const ScalarDegreeOfFreedomPositionsSet& dofPositions
00453       = this->__degreeOfFreedomSet.positionsSet(0);
00454   
00455     AutoPointer<ConformTransformation> pT;
00456 
00457     const CellType* currentCell = 0;
00458 
00459     for (typename BoundaryMeshType::const_iterator icell(boundaryMesh);
00460          not(icell.end()); ++icell) {
00461       const BoundaryCellType& cell = *icell;
00462       const BoundaryConformTransformation boundaryT(cell);
00463       const BoundaryConformTransformationJacobian boundaryJ(boundaryT);
00464 
00465       const CellType& K
00466         = static_cast<const CellType&>(cell.mother());
00467 
00468       if (currentCell != &K) {
00469         pT = new ConformTransformation(K);
00470         currentCell = &K;
00471       }
00472 
00473       const ConformTransformation& T = *pT;
00474 
00475       for (size_t k=0; k<BoundaryQuadratureType::numberOfQuadraturePoints;
00476            k++) {
00477         // computes local quadrature vertex
00478         TinyVector<3, real_t> q;
00479         boundaryT.value(referenceBoundaryQuadrature[k], q);
00480 
00481         const real_t weight
00482           = referenceBoundaryQuadrature.weight(k)
00483           * boundaryJ.jacobianDet();
00484 
00485         TinyVector<3> coordinates;
00486         T.invertT(q, coordinates);
00487 
00488         const real_t GValue = g(q);
00489 
00490         typename FiniteElement::ElementaryVector W;
00491         size_t indices[FiniteElement::numberOfDegreesOfFreedom];
00492 
00493         for (size_t l=0; l<FiniteElement::numberOfDegreesOfFreedom; ++l) {
00494           W[l] = finiteElement.W(l,coordinates);
00495           indices[l] = dofPositions(__mesh.cellNumber(K),l);
00496         }
00497 
00498         for (size_t l=0; l<FiniteElement::numberOfDegreesOfFreedom; l++) {
00499           const size_t I = __degreeOfFreedomSet(equationNumber,
00500                                                 indices[l]);
00501           b[I] += weight * GValue * W[l];
00502         }
00503       }
00504     }
00505   }

Here is the call graph for this function:

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
template<typename VectorType, typename BoundaryMeshType>
void BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__variationalBoundaryConditionsAlphaUVTimesX ( const ScalarFunctionBase alpha,
const size_t &  equationNumber,
const size_t &  unknownNumber,
const VectorType &  x,
VectorType &  z,
const BoundaryMeshType &  boundaryMesh 
) const [inline, protected]

Definition at line 510 of file BoundaryConditionCommonFEMDiscretization.hpp.

References BoundaryConditionDiscretization::__degreeOfFreedomSet, BoundaryConditionDiscretization::__dirichletList, BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__mesh, and DegreeOfFreedomSet::positionsSet().

00516   {
00517     typedef typename BoundaryMeshType::CellType BoundaryCellType;
00518 
00519     typedef
00520       typename FiniteElementTraits<BoundaryCellType,
00521                                    TypeOfDiscretization>::Transformation
00522       BoundaryConformTransformation;
00523 
00524     typedef
00525       typename FiniteElementTraits<BoundaryCellType,
00526                                   TypeOfDiscretization>::JacobianTransformation
00527       BoundaryConformTransformationJacobian;
00528 
00529     typedef
00530       typename FiniteElementTraits<BoundaryCellType,
00531                                    TypeOfDiscretization>::Type
00532       BoundaryFiniteElement;
00533 
00534     typedef
00535       typename BoundaryFiniteElement::QuadratureType
00536       BoundaryQuadratureType;
00537 
00538     const FiniteElement& finiteElement
00539       = FiniteElement::instance();
00540 
00541     const BoundaryQuadratureType& referenceBoundaryQuadrature
00542       = BoundaryQuadratureType::instance();
00543 
00544     const ScalarDegreeOfFreedomPositionsSet& dofPositions
00545       = this->__degreeOfFreedomSet.positionsSet(0);
00546   
00547     AutoPointer<ConformTransformation> pT;
00548 
00549     const CellType* currentCell = 0;
00550 
00551     for (typename BoundaryMeshType::const_iterator icell(boundaryMesh);
00552          not(icell.end()); ++icell) {
00553       const BoundaryCellType& cell = *icell;
00554       const BoundaryConformTransformation boundaryT(cell);
00555       const BoundaryConformTransformationJacobian boundaryJ(boundaryT);
00556 
00557       const CellType& K = static_cast<const CellType&>(cell.mother());
00558 
00559       if(currentCell != &K) {
00560         pT = new ConformTransformation(K);
00561         currentCell = &K;
00562       }
00563 
00564       const size_t cellNumber = __mesh.cellNumber(K);
00565 
00566       const ConformTransformation& T = *pT;
00567 
00568       for (size_t k=0; k<BoundaryQuadratureType::numberOfQuadraturePoints;
00569            k++) {
00570         // computes local quadrature vertex
00571         TinyVector<3, real_t> q;
00572         boundaryT.value(referenceBoundaryQuadrature[k], q);
00573 
00574         const real_t weight
00575           = referenceBoundaryQuadrature.weight(k)
00576           * boundaryJ.jacobianDet();
00577 
00578         TinyVector<3> coordinates;
00579         T.invertT(q, coordinates);
00580 
00581         const real_t AlphaValue = alpha(q);
00582 
00583         typename FiniteElement::ElementaryVector W;
00584         for (size_t l=0; l<FiniteElement::numberOfDegreesOfFreedom; l++) 
00585           W[l] = finiteElement.W(l,coordinates);
00586 
00587         typename FiniteElement::ElementaryMatrix WiWj;
00588 
00589         for (size_t l=0; l<FiniteElement::numberOfDegreesOfFreedom; l++)
00590           for (size_t m=0; m<FiniteElement::numberOfDegreesOfFreedom; m++)
00591             WiWj(l,m) = W[l] * W[m];
00592 
00593         size_t indicesI[FiniteElement::numberOfDegreesOfFreedom];
00594         size_t indicesJ[FiniteElement::numberOfDegreesOfFreedom];
00595         for (size_t l=0; l<FiniteElement::numberOfDegreesOfFreedom; ++l) {
00596           const size_t variableDOFNumber = dofPositions(cellNumber,l);
00597           indicesI[l] = __degreeOfFreedomSet(unknownNumber,
00598                                              variableDOFNumber);
00599           indicesJ[l] = __degreeOfFreedomSet(equationNumber,
00600                                              variableDOFNumber);
00601         }
00602             
00603         for (size_t l=0; l<FiniteElement::numberOfDegreesOfFreedom; l++) {
00604           const size_t I = indicesI[l];
00605           if (not(__dirichletList[I])) {
00606             for (size_t m=0; m<FiniteElement::numberOfDegreesOfFreedom; m++) {
00607               const size_t J = indicesJ[m];
00608               if (not(__dirichletList[J])) {
00609                 z[I] += WiWj(l,m) * weight * AlphaValue * x[J];
00610               }
00611             }
00612           }
00613         }
00614       }
00615     }
00616   }

Here is the call graph for this function:

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
template<typename VectorType, typename BoundaryMeshType>
void BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__variationalBoundaryConditionsAlphaUVTransposedTimesX ( const ScalarFunctionBase alpha,
const size_t &  equationNumber,
const size_t &  unknownNumber,
const VectorType &  x,
VectorType &  z,
const BoundaryMeshType &  boundaryMesh 
) const [inline, protected]

Definition at line 621 of file BoundaryConditionCommonFEMDiscretization.hpp.

References BoundaryConditionDiscretization::__degreeOfFreedomSet, BoundaryConditionDiscretization::__dirichletList, BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__mesh, and DegreeOfFreedomSet::positionsSet().

00627   {
00628     typedef typename BoundaryMeshType::CellType BoundaryCellType;
00629 
00630     typedef
00631       typename FiniteElementTraits<BoundaryCellType,
00632                                    TypeOfDiscretization>::Transformation
00633       BoundaryConformTransformation;
00634 
00635     typedef
00636       typename FiniteElementTraits<BoundaryCellType,
00637                                    TypeOfDiscretization>::JacobianTransformation
00638       BoundaryConformTransformationJacobian;
00639 
00640     typedef
00641       typename FiniteElementTraits<BoundaryCellType,
00642                                    TypeOfDiscretization>::Type
00643       BoundaryFiniteElement;
00644 
00645     typedef
00646       typename BoundaryFiniteElement::QuadratureType
00647       BoundaryQuadratureType;
00648 
00649     const FiniteElement& finiteElement
00650       = FiniteElement::instance();
00651 
00652     const BoundaryQuadratureType& referenceBoundaryQuadrature
00653       = BoundaryQuadratureType::instance();
00654 
00655     const ScalarDegreeOfFreedomPositionsSet& dofPositions
00656       = this->__degreeOfFreedomSet.positionsSet(0);
00657   
00658     AutoPointer<ConformTransformation> pT;
00659 
00660     const CellType* currentCell = 0;
00661 
00662     for (typename BoundaryMeshType::const_iterator icell(boundaryMesh);
00663          not(icell.end()); ++icell) {
00664       const BoundaryCellType& cell = *icell;
00665       const BoundaryConformTransformation boundaryT(cell);
00666       const BoundaryConformTransformationJacobian boundaryJ(boundaryT);
00667 
00668       const CellType& K = static_cast<const CellType&>(cell.mother());
00669 
00670       if(currentCell != &K) {
00671         pT = new ConformTransformation(K);
00672         currentCell = &K;
00673       }
00674 
00675       const size_t cellNumber = __mesh.cellNumber(K);
00676 
00677       const ConformTransformation& T = *pT;
00678 
00679       for (size_t k=0; k<BoundaryQuadratureType::numberOfQuadraturePoints;
00680            k++) {
00681         // computes local quadrature vertex
00682         TinyVector<3, real_t> q;
00683         boundaryT.value(referenceBoundaryQuadrature[k], q);
00684 
00685         const real_t weight
00686           = referenceBoundaryQuadrature.weight(k)
00687           * boundaryJ.jacobianDet();
00688 
00689         TinyVector<3> coordinates;
00690         T.invertT(q, coordinates);
00691 
00692         const real_t AlphaValue = alpha(q);
00693 
00694         typename FiniteElement::ElementaryVector W;
00695         for (size_t l=0; l<FiniteElement::numberOfDegreesOfFreedom; l++) 
00696           W[l] = finiteElement.W(l,coordinates);
00697 
00698         typename FiniteElement::ElementaryMatrix WiWj;
00699 
00700         for (size_t l=0; l<FiniteElement::numberOfDegreesOfFreedom; l++)
00701           for (size_t m=0; m<FiniteElement::numberOfDegreesOfFreedom; m++)
00702             WiWj(l,m) = W[l] * W[m];
00703 
00704         size_t indicesI[FiniteElement::numberOfDegreesOfFreedom];
00705         size_t indicesJ[FiniteElement::numberOfDegreesOfFreedom];
00706         for (size_t l=0; l<FiniteElement::numberOfDegreesOfFreedom; ++l) {
00707           const size_t variableDOFNumber = dofPositions(cellNumber,l);
00708           indicesI[l] = __degreeOfFreedomSet(unknownNumber,
00709                                              variableDOFNumber);
00710           indicesJ[l] = __degreeOfFreedomSet(equationNumber,
00711                                              variableDOFNumber);
00712         }
00713             
00714         for (size_t l=0; l<FiniteElement::numberOfDegreesOfFreedom; l++) {
00715           const size_t I = indicesI[l];
00716           if (not(__dirichletList[I])) {
00717             for (size_t m=0; m<FiniteElement::numberOfDegreesOfFreedom; m++) {
00718               const size_t J = indicesJ[m];
00719               if (not(__dirichletList[J])) {
00720                 z[J] += WiWj(l,m) * weight * AlphaValue * x[I];
00721               }
00722             }
00723           }
00724         }
00725       }
00726     }
00727   }

Here is the call graph for this function:

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
template<typename FunctionClass>
static void BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__meshWrapper ( const SurfaceMesh surfmesh,
const FunctionClass &  F 
) [inline, static, protected]

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
template<typename VectorType>
static void BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__StandardGetDiagonalVariationalBorderBilinearOperator ( const BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > &  __bc,
VectorType &  z 
) [inline, static, protected]

Definition at line 757 of file BoundaryConditionCommonFEMDiscretization.hpp.

References VariationalBorderOperatorAlphaUV::alpha(), VariationalBilinearBorderOperator::alphaUV, BoundaryConditionSurfaceMeshAssociation::beginOfBilinear(), BoundaryConditionSurfaceMeshAssociation::endOfBilinear(), Mesh::surfaceMeshQuadrangles, Mesh::surfaceMeshTriangles, VariationalBorderOperator::testFunctionNumber(), Mesh::type(), and ErrorHandler::unexpected.

Referenced by BoundaryConditionDiscretizationPenalty< MeshType, TypeOfDiscretization >::getDiagonal(), BoundaryConditionDiscretizationFEM< MeshType, TypeOfDiscretization >::getDiagonal(), and BoundaryConditionDiscretizationElimination< MeshType, TypeOfDiscretization >::getDiagonal().

00760   {
00761     const BoundaryConditionSurfaceMeshAssociation& bcMeshAssociation = *__bc.__bcMeshAssociation;
00762 
00763     for (BoundaryConditionSurfaceMeshAssociation
00764            ::BilinearBorderOperatorMeshAssociation
00765            ::const_iterator i = bcMeshAssociation.beginOfBilinear();
00766          i != bcMeshAssociation.endOfBilinear(); ++i) {
00767 
00768       switch (i->first->type()) {
00769       case VariationalBilinearBorderOperator::alphaUV: {
00770         const VariationalBorderOperatorAlphaUV& V
00771           = dynamic_cast<const VariationalBorderOperatorAlphaUV&>(*i->first);
00772         const Mesh& boundaryMesh = (*i->second);
00773         switch(boundaryMesh.type()) {
00774         case Mesh::surfaceMeshTriangles: {
00775           __bc.__getDiagonalNaturalBoundaryConditions(V.alpha(),
00776                                                       V.testFunctionNumber(), z,
00777                                                       dynamic_cast<const SurfaceMeshOfTriangles&>(boundaryMesh));
00778           break;
00779         }
00780         case Mesh::surfaceMeshQuadrangles: {
00781           __bc.__getDiagonalNaturalBoundaryConditions(V.alpha(),
00782                                                       V.testFunctionNumber(), z,
00783                                                       dynamic_cast<const SurfaceMeshOfQuadrangles&>(boundaryMesh));
00784           break;
00785         }
00786         default: {
00787           throw ErrorHandler(__FILE__,__LINE__,
00788                              "not implemented",
00789                              ErrorHandler::unexpected);
00790         }
00791         }
00792         break;
00793       }
00794       default: {
00795         throw ErrorHandler(__FILE__,__LINE__,
00796                            "not implemented",
00797                            ErrorHandler::unexpected);
00798       }
00799       }
00800     }
00801   }

Here is the call graph for this function:

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
template<typename VectorType>
static void BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__StandardGetDiagonalDirichletBorderBilinearOperator ( const BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > &  bc,
VectorType &  z 
) [inline, static, protected]

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
template<typename MatrixType>
static void BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__StandardVariationalBorderBilinearOperator ( const BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > &  __bc,
MatrixType &  A 
) [inline, static, protected]

Definition at line 818 of file BoundaryConditionCommonFEMDiscretization.hpp.

References VariationalBorderOperatorAlphaUV::alpha(), VariationalBilinearBorderOperator::alphaUV, BoundaryConditionSurfaceMeshAssociation::beginOfBilinear(), BoundaryConditionSurfaceMeshAssociation::endOfBilinear(), Mesh::surfaceMeshQuadrangles, Mesh::surfaceMeshTriangles, VariationalBorderOperator::testFunctionNumber(), Mesh::type(), ErrorHandler::unexpected, and VariationalBilinearBorderOperator::unknownNumber().

Referenced by BoundaryConditionDiscretizationPenalty< MeshType, TypeOfDiscretization >::setMatrix(), BoundaryConditionDiscretizationFEM< MeshType, TypeOfDiscretization >::setMatrix(), and BoundaryConditionDiscretizationElimination< MeshType, TypeOfDiscretization >::setMatrix().

00821   {
00822     const BoundaryConditionSurfaceMeshAssociation& bcMeshAssociation = *__bc.__bcMeshAssociation;
00823 
00824     for (BoundaryConditionSurfaceMeshAssociation
00825            ::BilinearBorderOperatorMeshAssociation
00826            ::const_iterator i = bcMeshAssociation.beginOfBilinear();
00827          i != bcMeshAssociation.endOfBilinear(); ++i) {
00828 
00829       switch (i->first->type()) {
00830       case VariationalBilinearBorderOperator::alphaUV: {
00831         const VariationalBorderOperatorAlphaUV& V
00832           = dynamic_cast<const VariationalBorderOperatorAlphaUV&>(*i->first);
00833         
00834         const Mesh& boundaryMesh = *i->second;
00835 
00836         switch (boundaryMesh.type()) {
00837         case Mesh::surfaceMeshTriangles: {
00838           __bc.__setVariationalBoundaryConditionsAlphaUV<MatrixType> (V.alpha(),
00839                                                                       V.testFunctionNumber(),
00840                                                                       V.unknownNumber(),
00841                                                                       A,
00842                                                                       dynamic_cast<const SurfaceMeshOfTriangles&>(boundaryMesh));
00843           break;
00844         }
00845         case Mesh::surfaceMeshQuadrangles: {
00846           __bc.__setVariationalBoundaryConditionsAlphaUV<MatrixType> (V.alpha(),
00847                                                                       V.testFunctionNumber(),
00848                                                                       V.unknownNumber(),
00849                                                                       A,
00850                                                                       dynamic_cast<const SurfaceMeshOfQuadrangles&>(boundaryMesh));
00851           break;
00852         }
00853         default: {
00854           throw ErrorHandler(__FILE__,__LINE__,
00855                              "not implemented",
00856                              ErrorHandler::unexpected);
00857         }
00858         }
00859         break;
00860       }
00861       default: {
00862         throw ErrorHandler(__FILE__,__LINE__,
00863                            "not implemented",
00864                            ErrorHandler::unexpected);
00865       }
00866       }
00867     }
00868   }

Here is the call graph for this function:

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
template<typename MatrixType>
static void BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__StandardDirichletBorderBilinearOperator ( const BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > &  __bc,
MatrixType &  A 
) [inline, static, protected]

Definition at line 872 of file BoundaryConditionCommonFEMDiscretization.hpp.

Referenced by BoundaryConditionDiscretizationFEM< MeshType, TypeOfDiscretization >::setMatrix(), and BoundaryConditionDiscretizationElimination< MeshType, TypeOfDiscretization >::setMatrix().

00876   {
00877     for (size_t i=0; i<__bc.__dirichletList.size(); ++i) {
00878       if (__bc.__dirichletList[i]) {
00879         for (DoubleHashedMatrix::iterator lineBrowser = A.beginOfLine(i);
00880              lineBrowser != A.endOfLine(i); ++lineBrowser) {
00881 #warning should use a syntax like "M.line(i) = 0;"
00882           lineBrowser.second() = 0;
00883         }
00884         // makes the column i to be zero. Here the elimination modifies the second member.
00885         for (DoubleHashedMatrix::iterator columnBrowser = A.beginOfColumn(i);
00886              columnBrowser != A.endOfColumn(i); ++columnBrowser) {
00887           columnBrowser.second() = 0;
00888         }
00889         A(i,i) = 1.; // sets the diagonal to 1
00890       }
00891     }
00892   }

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
template<typename VectorType>
static void BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__StandardVariationalBorderLinearOperator ( const BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > &  __bc,
VectorType &  b 
) [inline, static, protected]

Definition at line 896 of file BoundaryConditionCommonFEMDiscretization.hpp.

References BoundaryConditionSurfaceMeshAssociation::beginOfLinear(), BoundaryConditionSurfaceMeshAssociation::endOfLinear(), VariationalBorderOperatorFV::f(), VariationalLinearBorderOperator::FV, Mesh::surfaceMeshQuadrangles, Mesh::surfaceMeshTriangles, VariationalBorderOperator::testFunctionNumber(), Mesh::type(), and ErrorHandler::unexpected.

Referenced by BoundaryConditionDiscretizationPenalty< MeshType, TypeOfDiscretization >::setSecondMember(), BoundaryConditionDiscretizationFEM< MeshType, TypeOfDiscretization >::setSecondMember(), and BoundaryConditionDiscretizationElimination< MeshType, TypeOfDiscretization >::setSecondMember().

00899   {
00900     const BoundaryConditionSurfaceMeshAssociation& bcMeshAssociation = *__bc.__bcMeshAssociation;
00901 
00902     for (BoundaryConditionSurfaceMeshAssociation
00903            ::LinearBorderOperatorMeshAssociation
00904            ::const_iterator i = bcMeshAssociation.beginOfLinear();
00905          i != bcMeshAssociation.endOfLinear(); ++i) {
00906 
00907       switch (i->first->type()) {
00908       case VariationalLinearBorderOperator::FV: {
00909         const VariationalBorderOperatorFV& V
00910           = dynamic_cast<const VariationalBorderOperatorFV&>(*i->first);
00911 
00912         const Mesh& boundaryMesh = (*i->second);
00913         switch(boundaryMesh.type()) {
00914         case Mesh::surfaceMeshTriangles: {
00915           __bc.__setVariationalBoundaryConditionsFV(V.f(), V.testFunctionNumber(), b,
00916                                                     dynamic_cast<const SurfaceMeshOfTriangles&>(boundaryMesh));
00917           break;
00918         }
00919         case Mesh::surfaceMeshQuadrangles: {
00920           __bc.__setVariationalBoundaryConditionsFV(V.f(), V.testFunctionNumber(), b,
00921                                                     dynamic_cast<const SurfaceMeshOfQuadrangles&>(boundaryMesh));
00922           break;
00923         }
00924         default: {
00925           throw ErrorHandler(__FILE__,__LINE__,
00926                              "not implemented",
00927                              ErrorHandler::unexpected);
00928         }
00929         }
00930         break;
00931       }
00932       default: {
00933         throw ErrorHandler(__FILE__,__LINE__,
00934                            "not implemented",
00935                            ErrorHandler::unexpected);
00936       }
00937       }
00938     }
00939   }

Here is the call graph for this function:

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
template<typename MatrixType, typename VectorType>
static void BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__StandardDirichletBorderLinearOperator ( const BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > &  bc,
MatrixType &  A,
VectorType &  b 
) [inline, static, protected]

Definition at line 944 of file BoundaryConditionCommonFEMDiscretization.hpp.

References BoundaryConditionSurfaceMeshAssociation::bc(), Mesh::surfaceMeshQuadrangles, Mesh::surfaceMeshTriangles, Mesh::type(), and ErrorHandler::unexpected.

Referenced by BoundaryConditionDiscretizationFEM< MeshType, TypeOfDiscretization >::setSecondMember().

00948   {
00949     bc.__dirichletValues.resize(bc.__degreeOfFreedomSet.size());
00950     bc.__dirichletValues = 0;
00951     const BoundaryConditionSurfaceMeshAssociation& bcMeshAssociation = *bc.__bcMeshAssociation;
00952 
00953     // Dirichlet on the mesh border ...
00954     for (size_t i=0; i<bc.problem().numberOfUnknown(); ++i) {
00955       for (BoundaryConditionSurfaceMeshAssociation
00956              ::DirichletMeshAssociation
00957              ::const_iterator ibcMesh = bcMeshAssociation.bc(i).begin();
00958            ibcMesh != bcMeshAssociation.bc(i).end();
00959            ++ibcMesh) {
00960         const Dirichlet& D = *ibcMesh->first;
00961         const Mesh& boundaryMesh = *ibcMesh->second;
00962         switch(boundaryMesh.type()) {
00963         case Mesh::surfaceMeshTriangles: {
00964           bc.__setSecondMemberDirichlet(D,i,
00965                                         dynamic_cast<const SurfaceMeshOfTriangles&>(boundaryMesh));
00966           break;
00967         }
00968         case Mesh::surfaceMeshQuadrangles: {
00969           bc.__setSecondMemberDirichlet(D,i,
00970                                         dynamic_cast<const SurfaceMeshOfQuadrangles&>(boundaryMesh));
00971           break;
00972         }
00973         default: {
00974           throw ErrorHandler(__FILE__,__LINE__,
00975                              "not implemented",
00976                              ErrorHandler::unexpected);
00977         }
00978         }
00979       }
00980     }
00981 
00982     Vector<bool> temp(bc.__dirichletList);
00983     bc.__dirichletList=false;
00984     Vector<real_t> y (bc.__dirichletValues.size());
00985     A.timesX(bc.__dirichletValues,y);
00986     b -= y;
00987     bc.__dirichletList=temp;
00988 
00989     for (size_t i=0; i<b.size(); ++i) {
00990       if (bc.__dirichletList[i]) {
00991         b[i] = bc.__dirichletValues[i];
00992       }
00993     }
00994   }

Here is the call graph for this function:

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
template<typename VectorType>
static void BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__StandardVariationalBorderBilinearOperatorTimesX ( const BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > &  __bc,
const VectorType &  x,
VectorType &  z 
) [inline, static, protected]

Definition at line 998 of file BoundaryConditionCommonFEMDiscretization.hpp.

References VariationalBorderOperatorAlphaUV::alpha(), VariationalBilinearBorderOperator::alphaUV, BoundaryConditionSurfaceMeshAssociation::beginOfBilinear(), BoundaryConditionSurfaceMeshAssociation::endOfBilinear(), Mesh::surfaceMeshQuadrangles, Mesh::surfaceMeshTriangles, VariationalBorderOperator::testFunctionNumber(), Mesh::type(), ErrorHandler::unexpected, and VariationalBilinearBorderOperator::unknownNumber().

Referenced by BoundaryConditionDiscretizationPenalty< MeshType, TypeOfDiscretization >::timesX(), BoundaryConditionDiscretizationFEM< MeshType, TypeOfDiscretization >::timesX(), and BoundaryConditionDiscretizationElimination< MeshType, TypeOfDiscretization >::timesX().

01002   {
01003     const BoundaryConditionSurfaceMeshAssociation& bcMeshAssociation = *__bc.__bcMeshAssociation;
01004     for (BoundaryConditionSurfaceMeshAssociation
01005            ::BilinearBorderOperatorMeshAssociation
01006            ::const_iterator i = bcMeshAssociation.beginOfBilinear();
01007          i != bcMeshAssociation.endOfBilinear(); ++i) {
01008 
01009       switch (i->first->type()) {
01010       case VariationalBilinearBorderOperator::alphaUV: {
01011 
01012         const VariationalBorderOperatorAlphaUV& V
01013           = dynamic_cast<const VariationalBorderOperatorAlphaUV&>(*i->first);
01014 
01015         const Mesh& boundaryMesh = (*i->second);
01016 
01017         switch(boundaryMesh.type()) {
01018         case Mesh::surfaceMeshTriangles : {
01019           __bc.__variationalBoundaryConditionsAlphaUVTimesX(V.alpha(),
01020                                                             V.testFunctionNumber(),
01021                                                             V.unknownNumber(),
01022                                                             x,
01023                                                             z,
01024                                                             dynamic_cast<const SurfaceMeshOfTriangles&>(boundaryMesh));
01025           break;
01026         }
01027         case Mesh::surfaceMeshQuadrangles : {
01028           __bc.__variationalBoundaryConditionsAlphaUVTimesX(V.alpha(),
01029                                                             V.testFunctionNumber(),
01030                                                             V.unknownNumber(),
01031                                                             x,
01032                                                             z,
01033                                                             dynamic_cast<const SurfaceMeshOfQuadrangles&>(boundaryMesh));
01034           break;
01035         }
01036         default: {
01037           throw ErrorHandler(__FILE__,__LINE__,
01038                              "not implemented",
01039                              ErrorHandler::unexpected);
01040         }
01041         }
01042         break;
01043       }
01044       default: {
01045         throw ErrorHandler(__FILE__,__LINE__,
01046                            "not implemented",
01047                            ErrorHandler::unexpected);
01048       }
01049       }
01050     }
01051   }

Here is the call graph for this function:

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
template<typename VectorType>
static void BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__StandardVariationalBorderBilinearOperatorTransposedTimesX ( const BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > &  __bc,
const VectorType &  x,
VectorType &  z 
) [inline, static, protected]

Definition at line 1055 of file BoundaryConditionCommonFEMDiscretization.hpp.

References VariationalBorderOperatorAlphaUV::alpha(), VariationalBilinearBorderOperator::alphaUV, BoundaryConditionSurfaceMeshAssociation::beginOfBilinear(), BoundaryConditionSurfaceMeshAssociation::endOfBilinear(), Mesh::surfaceMeshQuadrangles, Mesh::surfaceMeshTriangles, VariationalBorderOperator::testFunctionNumber(), Mesh::type(), ErrorHandler::unexpected, and VariationalBilinearBorderOperator::unknownNumber().

Referenced by BoundaryConditionDiscretizationPenalty< MeshType, TypeOfDiscretization >::transposedTimesX(), BoundaryConditionDiscretizationFEM< MeshType, TypeOfDiscretization >::transposedTimesX(), and BoundaryConditionDiscretizationElimination< MeshType, TypeOfDiscretization >::transposedTimesX().

01059   {
01060     const BoundaryConditionSurfaceMeshAssociation& bcMeshAssociation = *__bc.__bcMeshAssociation;
01061     for (BoundaryConditionSurfaceMeshAssociation
01062            ::BilinearBorderOperatorMeshAssociation
01063            ::const_iterator i = bcMeshAssociation.beginOfBilinear();
01064          i != bcMeshAssociation.endOfBilinear(); ++i) {
01065 
01066       switch (i->first->type()) {
01067       case VariationalBilinearBorderOperator::alphaUV: {
01068 
01069         const VariationalBorderOperatorAlphaUV& V
01070           = dynamic_cast<const VariationalBorderOperatorAlphaUV&>(*i->first);
01071 
01072         const Mesh& boundaryMesh = *i->second;
01073 
01074         switch(boundaryMesh.type()) {
01075         case Mesh::surfaceMeshTriangles: {
01076           __bc.__variationalBoundaryConditionsAlphaUVTransposedTimesX(V.alpha(),
01077                                                                       V.testFunctionNumber(),
01078                                                                       V.unknownNumber(),
01079                                                                       x, z,
01080                                                                       dynamic_cast<const SurfaceMeshOfTriangles&>(boundaryMesh));
01081           break;
01082         }
01083         case Mesh::surfaceMeshQuadrangles: {
01084           __bc.__variationalBoundaryConditionsAlphaUVTransposedTimesX(V.alpha(),
01085                                                                       V.testFunctionNumber(),
01086                                                                       V.unknownNumber(),
01087                                                                       x, z,
01088                                                                       dynamic_cast<const SurfaceMeshOfQuadrangles&>(boundaryMesh));
01089           break;
01090         }
01091         default: {        
01092           throw ErrorHandler(__FILE__,__LINE__,
01093                              "not implemented",
01094                              ErrorHandler::unexpected);
01095         }
01096         }
01097         break;
01098       }
01099       default: {
01100         throw ErrorHandler(__FILE__,__LINE__,
01101                            "not implemented",
01102                            ErrorHandler::unexpected);
01103       }
01104       }
01105     }
01106   }

Here is the call graph for this function:

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
template<typename VectorType>
static void BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__StandardDirichletBorderBilinearOperatorTimesX ( const BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > &  bc,
const VectorType &  x,
VectorType &  z 
) [inline, static, protected]

Definition at line 1110 of file BoundaryConditionCommonFEMDiscretization.hpp.

Referenced by BoundaryConditionDiscretizationFEM< MeshType, TypeOfDiscretization >::timesX(), and BoundaryConditionDiscretizationElimination< MeshType, TypeOfDiscretization >::timesX().

01114   {
01115     for (size_t i=0; i<bc.__dirichletList.size(); ++i) {
01116       if (bc.__dirichletList[i]) {
01117         z[i] = x[i];
01118       }
01119     }
01120   }

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
template<typename VectorType>
static void BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__StandardDirichletBorderBilinearOperatorTransposedTimesX ( const BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization > &  bc,
const VectorType &  x,
VectorType &  z 
) [inline, static, protected]

const bool& BoundaryConditionDiscretization::dirichlet ( const size_t  i  )  const [inline, inherited]

Definition at line 54 of file BoundaryConditionDiscretization.hpp.

References BoundaryConditionDiscretization::__dirichletList.

00055   {
00056     return __dirichletList[i];
00057   }

const real_t& BoundaryConditionDiscretization::dirichletValue ( const size_t  i  )  const [inline, inherited]

Definition at line 59 of file BoundaryConditionDiscretization.hpp.

References BoundaryConditionDiscretization::__dirichletValues.

00060   {
00061     return __dirichletValues[i];
00062   }

const Vector<bool>& BoundaryConditionDiscretization::getDirichletList (  )  const [inline, inherited]

Definition at line 64 of file BoundaryConditionDiscretization.hpp.

References BoundaryConditionDiscretization::__dirichletList.

00065   {
00066     return __dirichletList;
00067   }

virtual void BoundaryConditionDiscretization::getDiagonal ( BaseVector X  )  const [pure virtual, inherited]

virtual void BoundaryConditionDiscretization::setMatrix ( ReferenceCounting< BaseMatrix A,
ReferenceCounting< BaseVector b 
) const [pure virtual, inherited]

virtual void BoundaryConditionDiscretization::setSecondMember ( ReferenceCounting< BaseMatrix A,
ReferenceCounting< BaseVector b 
) const [pure virtual, inherited]

virtual void BoundaryConditionDiscretization::timesX ( const BaseVector X,
BaseVector Z 
) const [pure virtual, inherited]

virtual void BoundaryConditionDiscretization::transposedTimesX ( const BaseVector X,
BaseVector Z 
) const [pure virtual, inherited]

const Problem& BoundaryConditionDiscretization::problem (  )  const [inline, inherited]


Member Data Documentation

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
const MeshType& BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__mesh [protected]

template<typename MeshType, ScalarDiscretizationTypeBase::Type TypeOfDiscretization>
ReferenceCounting<BoundaryConditionSurfaceMeshAssociation> BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__bcMeshAssociation [protected]

const Problem& BoundaryConditionDiscretization::__problem [protected, inherited]

Vector<bool> BoundaryConditionDiscretization::__dirichletList [mutable, protected, inherited]

Vector<real_t> BoundaryConditionDiscretization::__dirichletValues [mutable, protected, inherited]


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

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