#include <AbstractFunctionalCalculator.hpp>
Inherited by PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.
Public Member Functions | |
virtual | ~AbstractFunctionalCalculator () |
double | Calculate (AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, Vec solution) |
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 |
double | CalculateOnElement (Element< ELEMENT_DIM, SPACE_DIM > &rElement) |
Private Attributes | |
ReplicatableVector | mSolutionReplicated |
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 and 2 quad points per dimension are currently hardcoded.
Definition at line 51 of file AbstractFunctionalCalculator.hpp.
virtual AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::~AbstractFunctionalCalculator | ( | ) | [inline, virtual] |
Destructor.
Definition at line 81 of file AbstractFunctionalCalculator.hpp.
double AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Calculate | ( | AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > & | rMesh, | |
Vec | solution | |||
) | [inline] |
Calculate the 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.
rMesh | The mesh | |
solution | The solution vector |
Definition at line 169 of file AbstractFunctionalCalculator.hpp.
References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::CalculateDesignatedOwnershipOfElement(), AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CalculateOnElement(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), ReplicatableVector::GetSize(), AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mSolutionReplicated, and ReplicatableVector::ReplicatePetscVector().
Referenced by PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ComputePseudoEcgAtOneTimeStep().
double AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CalculateOnElement | ( | Element< ELEMENT_DIM, SPACE_DIM > & | rElement | ) | [inline, private] |
Compute the contribution to the integral from one element.
rElement | The element |
NOTE: This assumes that the Jacobian is constant on an element, ie no curvilinear bases were used for position
Definition at line 106 of file AbstractFunctionalCalculator.hpp.
References AbstractTetrahedralElement< ELEMENT_DIM, SPACE_DIM >::CalculateInverseJacobian(), AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetIntegrand(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), GaussianQuadratureRule< ELEMENT_DIM >::GetNumQuadPoints(), GaussianQuadratureRule< ELEMENT_DIM >::GetWeight(), AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mSolutionReplicated, ChastePoint< DIM >::rGetLocation(), and GaussianQuadratureRule< ELEMENT_DIM >::rGetQuadPoint().
Referenced by AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Calculate().
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 | |||
) | [private, pure virtual] |
Get the integrand. Must be defined by the user.
rX | The point in space | |
rU | The unknown as a vector, u(i) = u_i | |
rGradU | The 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 >.
Referenced by AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CalculateOnElement().
ReplicatableVector AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mSolutionReplicated [private] |
Replicated store of the solution vector.
Definition at line 56 of file AbstractFunctionalCalculator.hpp.
Referenced by AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Calculate(), and AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CalculateOnElement().