dune-fem  2.4.1-rc
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, passId > Class Template Referenceabstract

Base class for specific pass implementations. InsertFunctionPass simply inserts a discrete function from outside of the pass tree into the current pass tree, for example when calculating the species transport the velocity function comes from a different pass but has to be inserted into the species pass. More...

#include </local/tomalk/somewhere/tmp/dune-fem/dune/fem/pass/insertfunction.hh>

Inheritance diagram for Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, passId >:
Inheritance graph

Classes

struct  LocalFunctionInitializer
 
struct  LocalFunctionInitializer< LocalFunctionAdapter< LFType > >
 

Public Types

typedef InsertFunctionPassDiscreteModel< DiscreteFunction > DiscreteModelType
 type of discrete model for this class More...
 
typedef DiscreteModelType::Traits Traits
 type of traits for this class More...
 
typedef PreviousPass PreviousPassType
 Repetition of template arguments. More...
 
typedef BaseType::TotalArgumentType ArgumentType
 
typedef BaseType::GlobalArgumentType GlobalArgumentType
 
typedef Traits::DestinationType DestinationType
 discrete function representing the return value of this pass More...
 
typedef Traits::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
 discrete function space belonging to DestinationType More...
 
typedef Dune::PushBackTuple< typename PreviousPassType::PassIds, std::integral_constant< int, passIdImp > >::type PassIds
 pass ids up to here (tuple of integral constants) More...
 
typedef DeleteHandler< DestinationTypeDeleteHandlerType
 type of mem handler, which deletes destination More...
 
typedef DestinationType::DiscreteFunctionSpaceType::CommunicationManagerType::NonBlockingCommunicationType NonBlockingCommunicationType
 
typedef PreviousPassType::NextArgumentType LocalArgumentType
 Tuple containing destination types of all preceding passes. More...
 
typedef PushFrontTuple< LocalArgumentType, const GlobalArgumentType * >::type TotalArgumentType
 
typedef PushBackTuple< LocalArgumentType, DestinationType * >::type NextArgumentType
 Tuple containing destination types of all passes up to this one. More...
 
typedef PreviousPass::GlobalArgumentType DomainFunctionType
 type of discrete function in the operator's domain More...
 
typedef InsertFunctionPassDiscreteModel< DiscreteFunction >::Traits::DestinationType RangeFunctionType
 type of discrete function in the operator's range More...
 
typedef PreviousPass::GlobalArgumentType::RangeFieldType DomainFieldType
 field type of the operator's domain More...
 
typedef InsertFunctionPassDiscreteModel< DiscreteFunction >::Traits::DestinationType::RangeFieldType RangeFieldType
 field type of the operator's range More...
 

Public Member Functions

 InsertFunctionPass (const DestinationType &destination, PreviousPassType &previousPass)
 
 InsertFunctionPass (const DestinationType &destination, PreviousPassType &previousPass, const DiscreteFunctionSpaceType &space)
 
 InsertFunctionPass (PreviousPassType &previousPass)
 
 InsertFunctionPass (const DestinationType *destination, const std::shared_ptr< PreviousPassType > &previousPass)
 
 ~InsertFunctionPass ()
 destructor More...
 
void allocateLocalMemory ()
 
const DiscreteFunctionSpaceTypespace () const
 return reference to space More...
 
void setDestination (const DestinationType &destination)
 set internal destination pointer to dest More...
 
int passNumber () const
 
void printTexInfo (std::ostream &out) const
 printTex info of operator More...
 
void operator() (const GlobalArgumentType &arg, DestinationType &dest) const
 Application operator. The application operator is called by the client directly. It makes only sense to call this operator directly on the last pass. More...
 
virtual void operator() (const DomainFunctionType &u, RangeFunctionType &w) const =0
 application operator More...
 
void setTime (const double t)
 Set time provider (which gives you access to the global time). More...
 
double timeStepEstimate () const
 return time step estimate for explicit Runge Kutta solver, calls recursively the method timeStepEstimateImpl of all previous passes. Make sure to overload the method timeStepEstimateImpl in your implementation if this method really does something. More...
 
double time () const
 return current time of calculation More...
 
const DestinationTypedestination () const
 return reference to internal discrete function More...
 
void pass (const GlobalArgumentType &arg) const
 
NextArgumentType localArgument () const
 Returns a compilation of the results of the preceding passes. More...
 
void finalizeCommunication (const GlobalArgumentType &arg) const
 finalizeCommunication collects possbily initiated non-blocking communications for all passes including the global argument this method will be called from the next pass More...
 
void receiveCommunication (const GlobalArgumentType &arg) const
 finalizeCommunication collects possbily initiated non-blocking communications for all passes including the global argument this method will be called from the next pass More...
 
virtual double timeStepEstimateImpl () const
 
virtual bool requireCommunication () const
 requireCommunication returns true if the pass needs communication at all More...
 

Static Public Attributes

static const int passNum
 position in pass tree More...
 
static const int passId
 

Protected Member Functions

void compute (const ArgumentType &arg, DestinationType &dest) const
 
void finalizeCommunication (const TotalArgumentType &totalArg) const
 finalizeCommunication collects possbily initiated non-blocking communications for all passes More...
 
void receiveCommunication (const TotalArgumentType &totalArg) const
 receiveCommunication collects possbily initiated non-blocking communications for all passes More...
 
virtual void initComm () const
 initializeCommunication of this pass, this will initialize the communication of destination_ and has to be overloaded in the implementation More...
 
virtual void finalizeComm () const
 finalizeCommunication of this pass, this will collect the communication of destination_ and has to be overloaded in the implementation More...
 
virtual void receiveComm () const
 receiveCommunication of this pass, which will reset changes the communication did to the destination_ and has to be overloaded in the implementation More...
 

Protected Attributes

std::shared_ptr< PreviousPassTypeprevPassPtr_
 
DestinationTypedestination_
 destination (might be set from outside) More...
 
DeleteHandlerTypedeleteHandler_
 object to delete destination_ More...
 
PreviousPassTypepreviousPass_
 
double time_
 
bool finalizeCommunication_
 

Detailed Description

template<class DiscreteFunction, class PreviousPass, int passId>
class Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, passId >

Base class for specific pass implementations. InsertFunctionPass simply inserts a discrete function from outside of the pass tree into the current pass tree, for example when calculating the species transport the velocity function comes from a different pass but has to be inserted into the species pass.

Member Typedef Documentation

template<class DiscreteFunction , class PreviousPass , int passId>
typedef BaseType::TotalArgumentType Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, passId >::ArgumentType
typedef DeleteHandler<DestinationType> Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::DeleteHandlerType
inherited

type of mem handler, which deletes destination

template<class DiscreteFunction , class PreviousPass , int passId>
typedef Traits::DestinationType Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, passId >::DestinationType

discrete function representing the return value of this pass

template<class DiscreteFunction , class PreviousPass , int passId>
typedef Traits::DiscreteFunctionSpaceType Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, passId >::DiscreteFunctionSpaceType

discrete function space belonging to DestinationType

template<class DiscreteFunction , class PreviousPass , int passId>
typedef InsertFunctionPassDiscreteModel< DiscreteFunction > Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, passId >::DiscreteModelType

type of discrete model for this class

typedef PreviousPass::GlobalArgumentType ::RangeFieldType Dune::Fem::Operator< PreviousPass::GlobalArgumentType , InsertFunctionPassDiscreteModel< DiscreteFunction >::Traits::DestinationType >::DomainFieldType
inherited

field type of the operator's domain

typedef PreviousPass::GlobalArgumentType Dune::Fem::Operator< PreviousPass::GlobalArgumentType , InsertFunctionPassDiscreteModel< DiscreteFunction >::Traits::DestinationType >::DomainFunctionType
inherited

type of discrete function in the operator's domain

template<class DiscreteFunction , class PreviousPass , int passId>
typedef BaseType::GlobalArgumentType Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, passId >::GlobalArgumentType
typedef PreviousPassType::NextArgumentType Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::LocalArgumentType
inherited

Tuple containing destination types of all preceding passes.

typedef PushBackTuple< LocalArgumentType, DestinationType* >::type Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::NextArgumentType
inherited

Tuple containing destination types of all passes up to this one.

typedef DestinationType :: DiscreteFunctionSpaceType :: CommunicationManagerType :: NonBlockingCommunicationType Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::NonBlockingCommunicationType
inherited
typedef Dune::PushBackTuple< typename PreviousPassType::PassIds, std::integral_constant< int, passIdImp > >::type Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::PassIds
inherited

pass ids up to here (tuple of integral constants)

template<class DiscreteFunction , class PreviousPass , int passId>
typedef PreviousPass Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, passId >::PreviousPassType

Repetition of template arguments.

typedef InsertFunctionPassDiscreteModel< DiscreteFunction >::Traits::DestinationType ::RangeFieldType Dune::Fem::Operator< PreviousPass::GlobalArgumentType , InsertFunctionPassDiscreteModel< DiscreteFunction >::Traits::DestinationType >::RangeFieldType
inherited

field type of the operator's range

typedef InsertFunctionPassDiscreteModel< DiscreteFunction >::Traits::DestinationType Dune::Fem::Operator< PreviousPass::GlobalArgumentType , InsertFunctionPassDiscreteModel< DiscreteFunction >::Traits::DestinationType >::RangeFunctionType
inherited

type of discrete function in the operator's range

typedef PushFrontTuple< LocalArgumentType, const GlobalArgumentType* >::type Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::TotalArgumentType
inherited

Tuple containing destination types of all preceding passes plus the global argument. This serves as the argument for this pass' computations

template<class DiscreteFunction , class PreviousPass , int passId>
typedef DiscreteModelType::Traits Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, passId >::Traits

type of traits for this class

Constructor & Destructor Documentation

template<class DiscreteFunction , class PreviousPass , int passId>
Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, passId >::InsertFunctionPass ( const DestinationType destination,
PreviousPassType previousPass 
)
inline

constructor

Parameters
[in]destinationto be stored in this pass
[in]previousPassprevious pass in the tree
template<class DiscreteFunction , class PreviousPass , int passId>
Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, passId >::InsertFunctionPass ( const DestinationType destination,
PreviousPassType previousPass,
const DiscreteFunctionSpaceType space 
)
inline

constructor

Parameters
[in]destinationto be stored in this pass
[in]previousPassprevious pass in the tree
[in]spacediscrete function space
Note
The argument space is ignored; it just makes the constructor look like that from other passes.
template<class DiscreteFunction , class PreviousPass , int passId>
Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, passId >::InsertFunctionPass ( PreviousPassType previousPass)
inlineexplicit

constructor

Parameters
[in]previousPassprevious pass in the tree
template<class DiscreteFunction , class PreviousPass , int passId>
Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, passId >::InsertFunctionPass ( const DestinationType destination,
const std::shared_ptr< PreviousPassType > &  previousPass 
)
inline

default constructor

Note
This constructor creates and instance of previous pass
template<class DiscreteFunction , class PreviousPass , int passId>
Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, passId >::~InsertFunctionPass ( )
inline

destructor

Member Function Documentation

template<class DiscreteFunction , class PreviousPass , int passId>
void Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, passId >::allocateLocalMemory ( )
inlinevirtual

Allocates the local memory of a pass, if needed. If memory is allocated, then deleteHandler must be set for removal of memory to avoid leaks

Implements Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction >, PreviousPass, passId >.

template<class DiscreteFunction , class PreviousPass , int passId>
void Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, passId >::compute ( const ArgumentType arg,
DestinationType dest 
) const
inlineprotectedvirtual

Does the actual computations. Needs to be overridden in the derived clases

Implements Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction >, PreviousPass, passId >.

const DestinationType& Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::destination ( ) const
inlineinherited

return reference to internal discrete function

virtual void Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::finalizeComm ( ) const
inlineprotectedvirtualinherited

finalizeCommunication of this pass, this will collect the communication of destination_ and has to be overloaded in the implementation

void Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::finalizeCommunication ( const GlobalArgumentType arg) const
inlineinherited

finalizeCommunication collects possbily initiated non-blocking communications for all passes including the global argument this method will be called from the next pass

void Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::finalizeCommunication ( const TotalArgumentType totalArg) const
inlineprotectedinherited

finalizeCommunication collects possbily initiated non-blocking communications for all passes

virtual void Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::initComm ( ) const
inlineprotectedvirtualinherited

initializeCommunication of this pass, this will initialize the communication of destination_ and has to be overloaded in the implementation

NextArgumentType Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::localArgument ( ) const
inlineinherited

Returns a compilation of the results of the preceding passes.

virtual void Dune::Fem::Operator< PreviousPass::GlobalArgumentType , InsertFunctionPassDiscreteModel< DiscreteFunction >::Traits::DestinationType >::operator() ( const DomainFunctionType u,
RangeFunctionType w 
) const
pure virtualinherited

application operator

Parameters
[in]uargument discrete function
[out]wdestination discrete function
Note
This method has to be implemented by all derived classes.
void Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::operator() ( const GlobalArgumentType arg,
DestinationType dest 
) const
inlineinherited

Application operator. The application operator is called by the client directly. It makes only sense to call this operator directly on the last pass.

void Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::pass ( const GlobalArgumentType arg) const
inlineinherited

Same as application operator, but uses own memory instead of the discrete function provided by the client. This method is called on all passes except the last one.

int Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::passNumber ( ) const
inlineinherited
void Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::printTexInfo ( std::ostream &  out) const
inlineinherited

printTex info of operator

virtual void Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::receiveComm ( ) const
inlineprotectedvirtualinherited

receiveCommunication of this pass, which will reset changes the communication did to the destination_ and has to be overloaded in the implementation

void Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::receiveCommunication ( const GlobalArgumentType arg) const
inlineinherited

finalizeCommunication collects possbily initiated non-blocking communications for all passes including the global argument this method will be called from the next pass

void Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::receiveCommunication ( const TotalArgumentType totalArg) const
inlineprotectedinherited

receiveCommunication collects possbily initiated non-blocking communications for all passes

virtual bool Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::requireCommunication ( ) const
inlinevirtualinherited

requireCommunication returns true if the pass needs communication at all

Note
The default implementation returns true
template<class DiscreteFunction , class PreviousPass , int passId>
void Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, passId >::setDestination ( const DestinationType destination)
inline

set internal destination pointer to dest

void Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::setTime ( const double  t)
inlineinherited

Set time provider (which gives you access to the global time).

template<class DiscreteFunction , class PreviousPass , int passId>
const DiscreteFunctionSpaceType& Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, passId >::space ( ) const
inline

return reference to space

double Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::time ( ) const
inlineinherited

return current time of calculation

double Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::timeStepEstimate ( ) const
inlineinherited

return time step estimate for explicit Runge Kutta solver, calls recursively the method timeStepEstimateImpl of all previous passes. Make sure to overload the method timeStepEstimateImpl in your implementation if this method really does something.

virtual double Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::timeStepEstimateImpl ( ) const
inlinevirtualinherited

derived passes have to implement this method returning the time step estimate

Member Data Documentation

DeleteHandlerType* Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::deleteHandler_
protectedinherited

object to delete destination_

DestinationType* Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::destination_
protectedinherited

destination (might be set from outside)

bool Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::finalizeCommunication_
mutableprotectedinherited
const int Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::passId
staticinherited
const int Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::passNum
staticinherited

position in pass tree

PreviousPassType& Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::previousPass_
protectedinherited
template<class DiscreteFunction , class PreviousPass , int passId>
std::shared_ptr< PreviousPassType > Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, passId >::prevPassPtr_
protected
double Dune::Fem::Pass< InsertFunctionPassDiscreteModel< DiscreteFunction > , PreviousPass , passIdImp >::time_
protectedinherited

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