Chaste  Release::2018.1
AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM > Class Template Referenceabstract

#include <AbstractFunctionalCalculator.hpp>

+ Inheritance diagram for AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >:
+ Collaboration diagram for AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >:

Public Member Functions

virtual ~AbstractFunctionalCalculator ()
 
double Calculate (AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, Vec solution)
 
double CalculateOnElement (Element< ELEMENT_DIM, SPACE_DIM > &rElement)
 

Private Member Functions

virtual double GetIntegrand (ChastePoint< SPACE_DIM > &rX, c_vector< double, PROBLEM_DIM > &rU, c_matrix< double, PROBLEM_DIM, SPACE_DIM > &rGradU)=0
 
virtual bool ShouldSkipThisElement (Element< ELEMENT_DIM, SPACE_DIM > &rElement)
 

Private Attributes

ReplicatableVector mSolutionReplicated
 

Detailed Description

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
class AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >

This is an abstract class for computing user-defined integral-based functionals of a solution on the mesh. The user needs to define GetIntegrand() in the concrete class, and this class can then be used to compute the integral of f(x,u,grad_u) over the mesh, where x is position, u is the solution at x (possibly with multiple components, for which PROBLEM_DIM>1), grad_u the gradient of u and f the integrand as defined in the concrete class.

Note linear basis functions are the default, but that the functional may be non-polynomial. The order of integration used is the highest degree available (3rd order Gaussian quadrature)

Definition at line 58 of file AbstractFunctionalCalculator.hpp.

Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
virtual AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::~AbstractFunctionalCalculator ( )
inlinevirtual

Destructor.

Definition at line 89 of file AbstractFunctionalCalculator.hpp.

Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
double AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Calculate ( AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &  rMesh,
Vec  solution 
)
Returns
calculated integral over the given mesh, using the given solution vector on the mesh.

Note that, in parallel, this method uses a collective reduction step and should therefore always be called collectively.

Parameters
rMeshThe mesh
solutionThe solution vector

Definition at line 184 of file AbstractFunctionalCalculator.hpp.

References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::CalculateDesignatedOwnershipOfElement(), EXCEPTION, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and PetscTools::ReplicateException().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
double AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CalculateOnElement ( Element< ELEMENT_DIM, SPACE_DIM > &  rElement)
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
virtual double AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetIntegrand ( ChastePoint< SPACE_DIM > &  rX,
c_vector< double, PROBLEM_DIM > &  rU,
c_matrix< double, PROBLEM_DIM, SPACE_DIM > &  rGradU 
)
privatepure virtual
Returns
the integrand. Must be defined by the user.
Parameters
rXThe point in space
rUThe unknown as a vector, u(i) = u_i
rGradUThe gradient of the unknown as a matrix, rGradU(i,j) = d(u_i)/d(X_j)

Implemented in PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
bool AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ShouldSkipThisElement ( Element< ELEMENT_DIM, SPACE_DIM > &  rElement)
privatevirtual

Whether we should not calculate the functional on this element for any reason

Parameters
rElementthe element of interest
Returns
whether we should skip this element.

Reimplemented in PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.

Definition at line 221 of file AbstractFunctionalCalculator.hpp.

Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
ReplicatableVector AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mSolutionReplicated
private

Replicated store of the solution vector.

Definition at line 63 of file AbstractFunctionalCalculator.hpp.


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