QuOc

 

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

aol::FENonlinIntegrationScalarInterface< ConfiguratorType, Imp > Class Template Reference

Interface to compute $\int_\Omega f(\phi,x) dx$,. More...

#include <FEOpInterface.h>

Inheritance diagram for aol::FENonlinIntegrationScalarInterface< ConfiguratorType, Imp >:
aol::FEOpInterface< ConfiguratorType, aol::Vector< ConfiguratorType::RealType >, aol::Scalar< ConfiguratorType::RealType > > aol::Op< aol::Vector< ConfiguratorType::RealType >, aol::Scalar< ConfiguratorType::RealType > >

List of all members.

Public Types

typedef ConfiguratorType::RealType RealType

Public Member Functions

 FENonlinIntegrationScalarInterface (const typename ConfiguratorType::InitType &Initializer)
 FENonlinIntegrationScalarInterface (const ConfiguratorType &Config, const typename ConfiguratorType::InitType &Initializer)
virtual ~FENonlinIntegrationScalarInterface ()
void applyAdd (const aol::Vector< RealType > &Arg, aol::Scalar< RealType > &Dest) const
void applyAddIntegrand (const aol::Vector< RealType > &Arg, aol::Vector< RealType > &Dest) const
RealType evaluateIntegrand (const aol::DiscreteFunctionDefault< ConfiguratorType > &DiscFuncs, const typename ConfiguratorType::ElementType &El, int QuadPoint, const typename ConfiguratorType::DomVecType &RefCoord) const
 interface function, has to be provided in derived classes.

Protected Member Functions

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

Protected Attributes

const ConfiguratorType::InitType & _initializer

Detailed Description

template<typename ConfiguratorType, typename Imp>
class aol::FENonlinIntegrationScalarInterface< ConfiguratorType, Imp >

Interface to compute $\int_\Omega f(\phi,x) dx$,.

where $\phi$ is the argument of the operator. The integrand can be computed using "applyAddIntegrand"

Author:
Droske, Wirth

Definition at line 2636 of file FEOpInterface.h.


Member Typedef Documentation


Constructor & Destructor Documentation

template<typename ConfiguratorType, typename Imp>
aol::FENonlinIntegrationScalarInterface< ConfiguratorType, Imp >::FENonlinIntegrationScalarInterface ( const typename ConfiguratorType::InitType &  Initializer  )  [inline, explicit]

Definition at line 2643 of file FEOpInterface.h.

                                                                                                       :
      FEOpInterface<ConfiguratorType, aol::Vector<typename ConfiguratorType::RealType>, aol::Scalar<typename ConfiguratorType::RealType> > ( Initializer ), _initializer ( Initializer ) {
  }

template<typename ConfiguratorType, typename Imp>
aol::FENonlinIntegrationScalarInterface< ConfiguratorType, Imp >::FENonlinIntegrationScalarInterface ( const ConfiguratorType &  Config,
const typename ConfiguratorType::InitType &  Initializer 
) [inline]

Definition at line 2647 of file FEOpInterface.h.

                                                                                                                               :
      FEOpInterface<ConfiguratorType, aol::Vector<typename ConfiguratorType::RealType>, aol::Scalar<typename ConfiguratorType::RealType> > ( Config ), _initializer ( Initializer ) {
  }

template<typename ConfiguratorType, typename Imp>
virtual aol::FENonlinIntegrationScalarInterface< ConfiguratorType, Imp >::~FENonlinIntegrationScalarInterface (  )  [inline, virtual]

Definition at line 2651 of file FEOpInterface.h.

{}


Member Function Documentation

template<typename ConfiguratorType, typename Imp>
void aol::FENonlinIntegrationScalarInterface< ConfiguratorType, Imp >::applyAdd ( const aol::Vector< RealType > &  Arg,
aol::Scalar< RealType > &  Dest 
) const [inline]

Definition at line 2653 of file FEOpInterface.h.

                                                                                    {

    typedef typename ConfiguratorType::ElementIteratorType IteratorType;

    const aol::DiscreteFunctionDefault<ConfiguratorType> discFunc ( this->getConfigurator(), Arg );

    RealType res = 0.;

    const typename IteratorType::EndType end = this->getConfigurator().end();
    for ( IteratorType it = this->getConfigurator().begin(); it != end; ++it ) {
      typedef typename ConfiguratorType::QuadType QType;

      const typename ConfiguratorType::BaseFuncSetType &bfs = this->getConfigurator().getBaseFunctionSet ( *it );
      const int numQuadPoints = bfs.numQuadPoints( );

      RealType a = 0.;
      for ( int q = 0; q < numQuadPoints; ++q ) {
        a += this->asImp().evaluateIntegrand ( discFunc, *it, q, bfs.getRefCoord ( q ) ) * bfs.getWeight ( q );
      }

      a *= this->getConfigurator().vol ( *it );
      res += a;
    }
    Dest += res;
  }

template<typename ConfiguratorType, typename Imp>
void aol::FENonlinIntegrationScalarInterface< ConfiguratorType, Imp >::applyAddIntegrand ( const aol::Vector< RealType > &  Arg,
aol::Vector< RealType > &  Dest 
) const [inline]

Definition at line 2679 of file FEOpInterface.h.

                                                                                             {
    aol::Vector<RealType> dest( Dest, aol::STRUCT_COPY );
    const aol::DiscreteFunctionDefault<ConfiguratorType> discrFunc ( _initializer, Arg );

    aol::Vector<RealType> locWeight( Arg, aol::STRUCT_COPY );

    RealType *nl_cache = new RealType[ this->getConfigurator().maxNumQuadPoints() ];

    typedef typename ConfiguratorType::ElementIteratorType IteratorType;
    const typename IteratorType::EndType end_it = this->getConfigurator().end();
    for ( IteratorType it = this->getConfigurator().begin(); it != end_it; ++it ) {

      const typename ConfiguratorType::BaseFuncSetType &bfs = this->getConfigurator().getBaseFunctionSet ( *it );
      const int numQuadPoints = bfs.numQuadPoints( );
      for ( int q = 0; q < numQuadPoints; ++q )
        nl_cache[q] = this->asImp().evaluateIntegrand ( discrFunc, *it, q, bfs.getRefCoord ( q ) );

      const int numLocalDofs = this->getConfigurator().getNumLocalDofs ( *it );
      for ( int dof = 0; dof < numLocalDofs; dof++ ) {
        RealType a = 0., b = 0.;

        for ( int q = 0; q < numQuadPoints; ++q ) {
          RealType fac = bfs.evaluate ( dof, q ) * bfs.getWeight ( q );
          a += nl_cache[q] * fac;
          b += fac;
        }

        a *= this->getConfigurator().vol ( *it );
        b *= this->getConfigurator().vol ( *it );

        dest[ this->getConfigurator().localToGlobal ( *it, dof ) ] += a;
        locWeight[ this->getConfigurator().localToGlobal ( *it, dof ) ] += b;
      }
    }
    delete[] nl_cache;

    for ( int i = 0; i < locWeight.size(); ++i )
      dest[i] /= locWeight[i];
    Dest += dest;
  }

template<typename ConfiguratorType, typename Imp>
const Imp& aol::FENonlinIntegrationScalarInterface< ConfiguratorType, Imp >::asImp (  )  const [inline, protected]

Definition at line 2731 of file FEOpInterface.h.

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

template<typename ConfiguratorType, typename Imp>
RealType aol::FENonlinIntegrationScalarInterface< ConfiguratorType, Imp >::evaluateIntegrand ( const aol::DiscreteFunctionDefault< ConfiguratorType > &  DiscFuncs,
const typename ConfiguratorType::ElementType &  El,
int  QuadPoint,
const typename ConfiguratorType::DomVecType &  RefCoord 
) const [inline]

interface function, has to be provided in derived classes.

Reimplemented in aol::OneMinusHeavisideIntegrateFEFunction< ConfiguratorType, HeavisideFunctionType >, aol::PointwiseConstraintPenaltyEnergy< ConfiguratorType, PenaltyFunctionType >, aol::IntegrateFEFunction< ConfiguratorType >, and aol::IsoEnergyOp< ConfiguratorType >.

Definition at line 2721 of file FEOpInterface.h.

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


Member Data Documentation

template<typename ConfiguratorType, typename Imp>
const ConfiguratorType::InitType& aol::FENonlinIntegrationScalarInterface< ConfiguratorType, Imp >::_initializer [protected]

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

Generated on Fri Sep 9 2011 21:09:02 for QuocMesh by doxygen 1.7.1