QuOc

 

Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

qc::FENonlinLevelsetVectorDiffOpInterface< ConfiguratorType, qc::QC_3D, NumCompArg, NumCompDest, Imp > Class Template Reference

Via "apply" or "applyAdd" this class computes the vector $\left(\int_\Gamma\vec{\vec{f}}\left(\vec\phi(x),\nabla\vec\phi(x),x\right):\nabla \vec\varphi_i(x) dx\!\!\right)_i$, where $\Gamma$ is the zero levelset passed to the constructor, $\vec\varphi_i$ is the vector-valued $i$th finite element basis function, and $\vec{\vec{f}}$ has to be defined in the derived classes as "getNonlinearity". $\vec\phi$ is the function passed to the apply-routines. More...

#include <FELevelsetOpInterface.h>

Inheritance diagram for qc::FENonlinLevelsetVectorDiffOpInterface< ConfiguratorType, qc::QC_3D, NumCompArg, NumCompDest, Imp >:
aol::Op< aol::MultiVector< ConfiguratorType::RealType > >

List of all members.

Public Member Functions

 FENonlinLevelsetVectorDiffOpInterface (const InitType &Grid, const ArrayType &LevelSetFunction)
void applyAdd (const aol::MultiVector< RealType > &Arg, aol::MultiVector< RealType > &Dest) const
void getNonlinearity (aol::DiscreteVectorFunctionDefault< ConfiguratorType, NumCompArg > &DiscFuncs, const typename ConfiguratorType::ElementType &El, const typename ConfiguratorType::VecType &RefCoord, aol::Mat< NumCompDest, ConfiguratorType::Dim, RealType > &NL) const

Protected Types

typedef ConfiguratorType::RealType RealType
typedef ConfiguratorType::ArrayType ArrayType
typedef ConfiguratorType::InitType InitType

Protected Member Functions

Imp & asImp ()
const Imp & asImp () const

Protected Attributes

const ConfiguratorType _config
const InitType_grid
const ArrayType_levelSetFunction
tpcfe::CFEGrid< RealType,
tpcfe::CFE_NONE > 
_cfeGrid

Detailed Description

template<typename ConfiguratorType, int NumCompArg, int NumCompDest, typename Imp>
class qc::FENonlinLevelsetVectorDiffOpInterface< ConfiguratorType, qc::QC_3D, NumCompArg, NumCompDest, Imp >

Via "apply" or "applyAdd" this class computes the vector $\left(\int_\Gamma\vec{\vec{f}}\left(\vec\phi(x),\nabla\vec\phi(x),x\right):\nabla \vec\varphi_i(x) dx\!\!\right)_i$, where $\Gamma$ is the zero levelset passed to the constructor, $\vec\varphi_i$ is the vector-valued $i$th finite element basis function, and $\vec{\vec{f}}$ has to be defined in the derived classes as "getNonlinearity". $\vec\phi$ is the function passed to the apply-routines.

Currently, only midpoint quadrature is implemented.

Author:
Wirth

Definition at line 744 of file FELevelsetOpInterface.h.


Member Typedef Documentation

template<typename ConfiguratorType , int NumCompArg, int NumCompDest, typename Imp >
typedef ConfiguratorType::ArrayType qc::FENonlinLevelsetVectorDiffOpInterface< ConfiguratorType, qc::QC_3D, NumCompArg, NumCompDest, Imp >::ArrayType [protected]

Definition at line 749 of file FELevelsetOpInterface.h.

template<typename ConfiguratorType , int NumCompArg, int NumCompDest, typename Imp >
typedef ConfiguratorType::InitType qc::FENonlinLevelsetVectorDiffOpInterface< ConfiguratorType, qc::QC_3D, NumCompArg, NumCompDest, Imp >::InitType [protected]

Definition at line 750 of file FELevelsetOpInterface.h.

template<typename ConfiguratorType , int NumCompArg, int NumCompDest, typename Imp >
typedef ConfiguratorType::RealType qc::FENonlinLevelsetVectorDiffOpInterface< ConfiguratorType, qc::QC_3D, NumCompArg, NumCompDest, Imp >::RealType [protected]

Definition at line 748 of file FELevelsetOpInterface.h.


Constructor & Destructor Documentation

template<typename ConfiguratorType , int NumCompArg, int NumCompDest, typename Imp >
qc::FENonlinLevelsetVectorDiffOpInterface< ConfiguratorType, qc::QC_3D, NumCompArg, NumCompDest, Imp >::FENonlinLevelsetVectorDiffOpInterface ( const InitType Grid,
const ArrayType LevelSetFunction 
) [inline]

Definition at line 758 of file FELevelsetOpInterface.h.

                                                                              :
      _config ( Grid ),
      _grid ( Grid ),
      _levelSetFunction ( LevelSetFunction ),
      _cfeGrid ( _grid.getGridDepth() ) {
    _cfeGrid.setAdjustLevelset ( 1.0e-10 );
    _cfeGrid.setDomainFrom ( LevelSetFunction );
    _cfeGrid.detectVirtualNodes ();
  }


Member Function Documentation

template<typename ConfiguratorType , int NumCompArg, int NumCompDest, typename Imp >
void qc::FENonlinLevelsetVectorDiffOpInterface< ConfiguratorType, qc::QC_3D, NumCompArg, NumCompDest, Imp >::applyAdd ( const aol::MultiVector< RealType > &  Arg,
aol::MultiVector< RealType > &  Dest 
) const [inline]

Definition at line 769 of file FELevelsetOpInterface.h.

References aol::MultiVector< _DataType >::numComponents().

                                                                                              {
    // check, whether Arg and Dest have correct size
    if ( Arg.numComponents() != NumCompArg || Dest.numComponents() != NumCompDest ) {
      cerr << Arg.numComponents() << " " << NumCompArg << " " << Dest.numComponents() << " " << NumCompDest << " " << endl;
      throw aol::Exception ( "Mismatching number of vectors.", __FILE__, __LINE__ );
    }

    // make a function of Arg and define "nl" (it will contain the nonlinear function value at each quadrature point) as well as "val" (quadrature result)
    aol::DiscreteVectorFunctionDefault<ConfiguratorType, NumCompArg> discrFuncsArg ( _grid, Arg );
    aol::Mat<NumCompDest, ConfiguratorType::Dim, RealType> nl;
    aol::Vec<NumCompDest, RealType> val;
    typename ConfiguratorType::VecType grad;
    const RealType h  = _cfeGrid.H();

    // traverse all triangles on the interface
    for ( tpcfe::CFEInterfaceTriangleIterator< tpcfe::CFEGrid<RealType, tpcfe::CFE_NONE> > itit ( _cfeGrid ); itit.notAtEnd(); ++itit ) {
      // compute center of mass for triangle
      std::vector< aol::Vec3< RealType > > triangleNodes = itit.getTriangRef().getLocalCoordinates();
      aol::Vec3<RealType> centerOfMass ( triangleNodes[0] + triangleNodes[1] + triangleNodes[2] );
      centerOfMass /= static_cast<RealType> ( 3 );

      // compute values needed for midpoint quadrature
      const qc::Element el ( itit.getTriangRef().getElement() );
      const RealType area = itit.getTriangRef().getArea ( h );
      asImp().getNonlinearity ( discrFuncsArg, el, centerOfMass, nl );

      // for each hat function compute its diff product with the nonlinear function and the midpoint quadrature of that
      const int numLocalDofs = _config.getNumLocalDofs ( el );
      const typename ConfiguratorType::BaseFuncSetType &bfs = _config.getBaseFunctionSet ( el );
      for ( int dof = 0; dof < numLocalDofs; dof++ ) {
        bfs.evaluateGradient ( dof, centerOfMass, grad );
        val = nl * grad * area;

        for ( int d = 0; d < NumCompDest; d++ )
          Dest[d][ _config.localToGlobal ( el, dof ) ] += val[d];
      }
    }
  }

template<typename ConfiguratorType , int NumCompArg, int NumCompDest, typename Imp >
const Imp& qc::FENonlinLevelsetVectorDiffOpInterface< ConfiguratorType, qc::QC_3D, NumCompArg, NumCompDest, Imp >::asImp (  )  const [inline, protected]

Definition at line 820 of file FELevelsetOpInterface.h.

{ return static_cast<const Imp&> ( *this ); }

template<typename ConfiguratorType , int NumCompArg, int NumCompDest, typename Imp >
Imp& qc::FENonlinLevelsetVectorDiffOpInterface< ConfiguratorType, qc::QC_3D, NumCompArg, NumCompDest, Imp >::asImp (  )  [inline, protected]

Definition at line 819 of file FELevelsetOpInterface.h.

{ return static_cast<Imp&> ( *this ); }

template<typename ConfiguratorType , int NumCompArg, int NumCompDest, typename Imp >
void qc::FENonlinLevelsetVectorDiffOpInterface< ConfiguratorType, qc::QC_3D, NumCompArg, NumCompDest, Imp >::getNonlinearity ( aol::DiscreteVectorFunctionDefault< ConfiguratorType, NumCompArg > &  DiscFuncs,
const typename ConfiguratorType::ElementType &  El,
const typename ConfiguratorType::VecType &  RefCoord,
aol::Mat< NumCompDest, ConfiguratorType::Dim, RealType > &  NL 
) const [inline]

Definition at line 809 of file FELevelsetOpInterface.h.

                                                                                        {
    throw aol::Exception ( "called the interface function", __FILE__, __LINE__ );
    this->asImp().getNonlinearity ( DiscFuncs, El, NL );
  }


Member Data Documentation

template<typename ConfiguratorType , int NumCompArg, int NumCompDest, typename Imp >
tpcfe::CFEGrid<RealType, tpcfe::CFE_NONE> qc::FENonlinLevelsetVectorDiffOpInterface< ConfiguratorType, qc::QC_3D, NumCompArg, NumCompDest, Imp >::_cfeGrid [protected]

Definition at line 755 of file FELevelsetOpInterface.h.

template<typename ConfiguratorType , int NumCompArg, int NumCompDest, typename Imp >
const ConfiguratorType qc::FENonlinLevelsetVectorDiffOpInterface< ConfiguratorType, qc::QC_3D, NumCompArg, NumCompDest, Imp >::_config [protected]

Definition at line 752 of file FELevelsetOpInterface.h.

template<typename ConfiguratorType , int NumCompArg, int NumCompDest, typename Imp >
const InitType& qc::FENonlinLevelsetVectorDiffOpInterface< ConfiguratorType, qc::QC_3D, NumCompArg, NumCompDest, Imp >::_grid [protected]

Definition at line 753 of file FELevelsetOpInterface.h.

template<typename ConfiguratorType , int NumCompArg, int NumCompDest, typename Imp >
const ArrayType& qc::FENonlinLevelsetVectorDiffOpInterface< ConfiguratorType, qc::QC_3D, NumCompArg, NumCompDest, Imp >::_levelSetFunction [protected]

Definition at line 754 of file FELevelsetOpInterface.h.


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

Generated on Fri Sep 9 2011 21:10:01 for QuocMesh by doxygen 1.7.1