Chaste Release::3.1
AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX > Class Template Reference

#include <AbstractContinuumMechanicsAssembler.hpp>

Inheritance diagram for AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >:
Collaboration diagram for AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >:

List of all members.

Public Member Functions

 AbstractContinuumMechanicsAssembler (QuadraticMesh< DIM > *pMesh, unsigned numQuadPoints=3)
virtual ~AbstractContinuumMechanicsAssembler ()

Protected Member Functions

void DoAssemble ()
virtual c_matrix< double,
SPATIAL_BLOCK_SIZE_ELEMENTAL,
SPATIAL_BLOCK_SIZE_ELEMENTAL
ComputeSpatialSpatialMatrixTerm (c_vector< double, NUM_NODES_PER_ELEMENT > &rQuadPhi, c_matrix< double, DIM, NUM_NODES_PER_ELEMENT > &rGradQuadPhi, c_vector< double, DIM > &rX, Element< DIM, DIM > *pElement)
virtual c_matrix< double,
SPATIAL_BLOCK_SIZE_ELEMENTAL,
PRESSURE_BLOCK_SIZE_ELEMENTAL
ComputeSpatialPressureMatrixTerm (c_vector< double, NUM_NODES_PER_ELEMENT > &rQuadPhi, c_matrix< double, DIM, NUM_NODES_PER_ELEMENT > &rGradQuadPhi, c_vector< double, NUM_VERTICES_PER_ELEMENT > &rLinearPhi, c_matrix< double, DIM, NUM_VERTICES_PER_ELEMENT > &rGradLinearPhi, c_vector< double, DIM > &rX, Element< DIM, DIM > *pElement)
virtual c_matrix< double,
PRESSURE_BLOCK_SIZE_ELEMENTAL,
PRESSURE_BLOCK_SIZE_ELEMENTAL
ComputePressurePressureMatrixTerm (c_vector< double, NUM_VERTICES_PER_ELEMENT > &rLinearPhi, c_matrix< double, DIM, NUM_VERTICES_PER_ELEMENT > &rGradLinearPhi, c_vector< double, DIM > &rX, Element< DIM, DIM > *pElement)
virtual c_vector< double,
SPATIAL_BLOCK_SIZE_ELEMENTAL
ComputeSpatialVectorTerm (c_vector< double, NUM_NODES_PER_ELEMENT > &rQuadPhi, c_matrix< double, DIM, NUM_NODES_PER_ELEMENT > &rGradQuadPhi, c_vector< double, DIM > &rX, Element< DIM, DIM > *pElement)
virtual c_vector< double,
PRESSURE_BLOCK_SIZE_ELEMENTAL
ComputePressureVectorTerm (c_vector< double, NUM_VERTICES_PER_ELEMENT > &rLinearPhi, c_matrix< double, DIM, NUM_VERTICES_PER_ELEMENT > &rGradLinearPhi, c_vector< double, DIM > &rX, Element< DIM, DIM > *pElement)
void AssembleOnElement (Element< DIM, DIM > &rElement, c_matrix< double, STENCIL_SIZE, STENCIL_SIZE > &rAElem, c_vector< double, STENCIL_SIZE > &rBElem)

Protected Attributes

QuadraticMesh< DIM > * mpMesh
GaussianQuadratureRule< DIM > * mpQuadRule

Static Private Attributes

static const bool BLOCK_SYMMETRIC_MATRIX = true
static const unsigned NUM_VERTICES_PER_ELEMENT = DIM+1
static const unsigned NUM_NODES_PER_ELEMENT = (DIM+1)*(DIM+2)/2
static const unsigned SPATIAL_BLOCK_SIZE_ELEMENTAL = DIM*NUM_NODES_PER_ELEMENT
static const unsigned PRESSURE_BLOCK_SIZE_ELEMENTAL = NUM_VERTICES_PER_ELEMENT
static const unsigned STENCIL_SIZE = DIM*NUM_NODES_PER_ELEMENT + NUM_VERTICES_PER_ELEMENT

Detailed Description

template<unsigned DIM, bool CAN_ASSEMBLE_VECTOR, bool CAN_ASSEMBLE_MATRIX>
class AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >

Abstract class for assembling volume-integral parts of matrices and vectors in continuum mechanics problems.

For such problems, the matrix has, essentially, the form [A B1] [B2^T C ] (where often B1=B2 and C=0) and the vector has the form [b1] [b2] A is the spatial-spatial part, B1 the spatial-pressure part, etc.

Currently B1=B2 is assumed, this can be changed in the future.

This class works in the same way as the volume assembler in pde (AbstractFeVolumeIntegralAssembler), except the concrete class has to provide up to 6 methods, for each of the blocks A,B1,B2 and for b1 and b2.

The assembler is main used for fluids - currently it is used for assembling the matrix for Stokes flow [A B ; B^T 0], and the preconditioner for Stokes flow [A, B; B^T M], and will be useful for further fluids assemblies, and could be used for mixed-problem incompressible linear elasticity. We DON'T use this assembler in the incompressible nonlinear elasticity solver, because even though the matrix is of the right form, things like stress and stress-derivative need to be computed at the AssembleOnElement level and the assembly is in general too complex for this class to be used.

NOTE: The elemental matrix and vector is as above. The full matrix and vector uses a completely different ordering: for parallelisation reasons the pressure variables are interleaved with the spatial variables and dummy pressure variables are used for internal nodes. For example, in 2d, the ordering is [U1 V1 P1 , .. , Un Vn, Pn] where n is the total number of nodes.

Definition at line 85 of file AbstractContinuumMechanicsAssembler.hpp.


Constructor & Destructor Documentation

template<unsigned DIM, bool CAN_ASSEMBLE_VECTOR, bool CAN_ASSEMBLE_MATRIX>
AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::AbstractContinuumMechanicsAssembler ( QuadraticMesh< DIM > *  pMesh,
unsigned  numQuadPoints = 3 
) [inline]

Constructor

Parameters:
pMeshPointer to the mesh
numQuadPointsNumber of quadrature points in each direction, defaults to 3

Definition at line 292 of file AbstractContinuumMechanicsAssembler.hpp.

template<unsigned DIM, bool CAN_ASSEMBLE_VECTOR, bool CAN_ASSEMBLE_MATRIX>
virtual AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::~AbstractContinuumMechanicsAssembler ( ) [inline, virtual]

Destructor.

Definition at line 307 of file AbstractContinuumMechanicsAssembler.hpp.


Member Function Documentation

template<unsigned DIM, bool CAN_ASSEMBLE_VECTOR, bool CAN_ASSEMBLE_MATRIX>
void AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::AssembleOnElement ( Element< DIM, DIM > &  rElement,
c_matrix< double, STENCIL_SIZE, STENCIL_SIZE > &  rAElem,
c_vector< double, STENCIL_SIZE > &  rBElem 
) [protected]

Calculate the contribution of a single element to the linear system.

Parameters:
rElementThe element to assemble on.
rAElemThe element's contribution to the LHS matrix is returned in this n by n matrix, where n is the no. of nodes in this element. There is no need to zero this matrix before calling.
rBElemThe element's contribution to the RHS vector is returned in this vector of length n, the no. of nodes in this element. There is no need to zero this vector before calling.

Definition at line 431 of file AbstractContinuumMechanicsAssembler.hpp.

References QuadraticBasisFunction< ELEMENT_DIM >::ComputeBasisFunctions(), LinearBasisFunction< ELEMENT_DIM >::ComputeBasisFunctions(), LinearBasisFunction< ELEMENT_DIM >::ComputeTransformedBasisFunctionDerivatives(), QuadraticBasisFunction< ELEMENT_DIM >::ComputeTransformedBasisFunctionDerivatives(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), and NEVER_REACHED.

template<unsigned DIM, bool CAN_ASSEMBLE_VECTOR, bool CAN_ASSEMBLE_MATRIX>
virtual c_matrix<double,PRESSURE_BLOCK_SIZE_ELEMENTAL,PRESSURE_BLOCK_SIZE_ELEMENTAL> AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::ComputePressurePressureMatrixTerm ( c_vector< double, NUM_VERTICES_PER_ELEMENT > &  rLinearPhi,
c_matrix< double, DIM, NUM_VERTICES_PER_ELEMENT > &  rGradLinearPhi,
c_vector< double, DIM > &  rX,
Element< DIM, DIM > *  pElement 
) [inline, protected, virtual]

For a continuum mechanics problem in mixed form (displacement-pressure or velocity-pressure), the matrix has the form (except see comments about ordering above) [A B1] [B2^T C ] (where often B1=B2 and C=0). The function is related to the pressure-pressure block, ie matrix C.

For the contribution to A from a given element, this method should return the INTEGRAND in the definition of C. See concrete classes for examples. Needed to be implemented (overridden) if the concrete class is going to assemble matrices (ie if CAN_ASSEMBLE_MATRIX is true).

Default implementation returns a zero matrix - ie the block will be zero if this is not over-ridden

Parameters:
rLinearPhiAll the linear basis functions on this element, evaluated at the current quad point
rGradLinearPhiGradients of all the linear basis functions on this element, evaluated at the current quad point
rXCurrent location (physical position)
pElementCurrent element

Reimplemented in StokesFlowPreconditionerAssembler< DIM >.

Definition at line 200 of file AbstractContinuumMechanicsAssembler.hpp.

template<unsigned DIM, bool CAN_ASSEMBLE_VECTOR, bool CAN_ASSEMBLE_MATRIX>
virtual c_vector<double,PRESSURE_BLOCK_SIZE_ELEMENTAL> AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::ComputePressureVectorTerm ( c_vector< double, NUM_VERTICES_PER_ELEMENT > &  rLinearPhi,
c_matrix< double, DIM, NUM_VERTICES_PER_ELEMENT > &  rGradLinearPhi,
c_vector< double, DIM > &  rX,
Element< DIM, DIM > *  pElement 
) [inline, protected, virtual]

For a continuum mechanics problem in mixed form (displacement-pressure or velocity-pressure), the matrix has the form (except see comments about ordering above) [A B1] [B2^T C ] (where often B1=B2 and C=0) and the vector has the form [b1] [b2] The function is related to the pressure-block in the vector, ie b2.

For the contribution to b1 from a given element, this method should return the INTEGRAND in the definition of b2. See concrete classes for examples. Needed to be implemented (overridden) if the concrete class is going to assemble vectors (ie if CAN_ASSEMBLE_VECTOR is true).

Default implementation returns a zero vector - ie the block will be zero if this is not over-ridden

Parameters:
rLinearPhiAll the linear basis functions on this element, evaluated at the current quad point
rGradLinearPhiGradients of all the linear basis functions on this element, evaluated at the current quad point
rXCurrent location (physical position)
pElementCurrent element

Definition at line 262 of file AbstractContinuumMechanicsAssembler.hpp.

template<unsigned DIM, bool CAN_ASSEMBLE_VECTOR, bool CAN_ASSEMBLE_MATRIX>
virtual c_matrix<double,SPATIAL_BLOCK_SIZE_ELEMENTAL,PRESSURE_BLOCK_SIZE_ELEMENTAL> AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::ComputeSpatialPressureMatrixTerm ( c_vector< double, NUM_NODES_PER_ELEMENT > &  rQuadPhi,
c_matrix< double, DIM, NUM_NODES_PER_ELEMENT > &  rGradQuadPhi,
c_vector< double, NUM_VERTICES_PER_ELEMENT > &  rLinearPhi,
c_matrix< double, DIM, NUM_VERTICES_PER_ELEMENT > &  rGradLinearPhi,
c_vector< double, DIM > &  rX,
Element< DIM, DIM > *  pElement 
) [inline, protected, virtual]

For a continuum mechanics problem in mixed form (displacement-pressure or velocity-pressure), the matrix has the form (except see comments about ordering above) [A B1] [B2^T C ] (where often B1=B2 and C=0). The function is related to the spatial-pressure block, ie matrix B1. If BLOCK_SYMMETRIC_MATRIX is true, B1=B2 is assumed, so it also relates to B2.

For the contribution to A from a given element, this method should return the INTEGRAND in the definition of B. See concrete classes for examples. Needed to be implemented (overridden) if the concrete class is going to assemble matrices (ie if CAN_ASSEMBLE_MATRIX is true).

Default implementation returns a zero matrix - ie the block will be zero if this is not over-ridden

Parameters:
rQuadPhiAll the quadratic basis functions on this element, evaluated at the current quad point
rGradQuadPhiGradients of all the quadratic basis functions on this element, evaluated at the current quad point
rLinearPhiAll the linear basis functions on this element, evaluated at the current quad point
rGradLinearPhiGradients of all the linear basis functions on this element, evaluated at the current quad point
rXCurrent location (physical position corresponding to quad point)
pElementCurrent element

Reimplemented in StokesFlowAssembler< DIM >.

Definition at line 170 of file AbstractContinuumMechanicsAssembler.hpp.

template<unsigned DIM, bool CAN_ASSEMBLE_VECTOR, bool CAN_ASSEMBLE_MATRIX>
virtual c_matrix<double,SPATIAL_BLOCK_SIZE_ELEMENTAL,SPATIAL_BLOCK_SIZE_ELEMENTAL> AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::ComputeSpatialSpatialMatrixTerm ( c_vector< double, NUM_NODES_PER_ELEMENT > &  rQuadPhi,
c_matrix< double, DIM, NUM_NODES_PER_ELEMENT > &  rGradQuadPhi,
c_vector< double, DIM > &  rX,
Element< DIM, DIM > *  pElement 
) [inline, protected, virtual]

For a continuum mechanics problem in mixed form (displacement-pressure or velocity-pressure), the matrix has the form (except see comments about ordering above) [A B1] [B2^T C ] (where often B1=B2 and C=0). The function is related to the spatial-spatial block, ie matrix A.

For the contribution to A from a given element, this method should return the INTEGRAND in the definition of A. See concrete classes for examples. Needed to be implemented (overridden) if the concrete class is going to assemble matrices (ie if CAN_ASSEMBLE_MATRIX is true).

Default implementation returns a zero matrix - ie the block will be zero if this is not over-ridden

Parameters:
rQuadPhiAll the quadratic basis functions on this element, evaluated at the current quad point
rGradQuadPhiGradients of all the quadratic basis functions on this element, evaluated at the current quad point
rXCurrent location (physical position)
pElementCurrent element

Reimplemented in StokesFlowAssembler< DIM >.

Definition at line 140 of file AbstractContinuumMechanicsAssembler.hpp.

template<unsigned DIM, bool CAN_ASSEMBLE_VECTOR, bool CAN_ASSEMBLE_MATRIX>
virtual c_vector<double,SPATIAL_BLOCK_SIZE_ELEMENTAL> AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::ComputeSpatialVectorTerm ( c_vector< double, NUM_NODES_PER_ELEMENT > &  rQuadPhi,
c_matrix< double, DIM, NUM_NODES_PER_ELEMENT > &  rGradQuadPhi,
c_vector< double, DIM > &  rX,
Element< DIM, DIM > *  pElement 
) [inline, protected, virtual]

For a continuum mechanics problem in mixed form (displacement-pressure or velocity-pressure), the matrix has the form (except see comments about ordering above) [A B1] [B2^T C ] (where often B1=B2 and C=0) and the vector has the form [b1] [b2] The function is related to the spatial-block in the vector, ie b1.

For the contribution to b1 from a given element, this method should return the INTEGRAND in the definition of b1. See concrete classes for examples. Needed to be implemented (overridden) if the concrete class is going to assemble vectors (ie if CAN_ASSEMBLE_VECTOR is true).

Default implementation returns a zero vector - ie the block will be zero if this is not over-ridden

Parameters:
rQuadPhiAll the quadratic basis functions on this element, evaluated at the current quad point
rGradQuadPhiGradients of all the quadratic basis functions on this element, evaluated at the current quad point
rXCurrent location (physical position)
pElementCurrent element

Reimplemented in StokesFlowAssembler< DIM >.

Definition at line 231 of file AbstractContinuumMechanicsAssembler.hpp.

template<unsigned DIM, bool CAN_ASSEMBLE_VECTOR, bool CAN_ASSEMBLE_MATRIX>
void AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::DoAssemble ( ) [protected, virtual]

Member Data Documentation

template<unsigned DIM, bool CAN_ASSEMBLE_VECTOR, bool CAN_ASSEMBLE_MATRIX>
const bool AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::BLOCK_SYMMETRIC_MATRIX = true [static, private]

Whether the matrix is block symmetric (B1=B2). Currently fixed to true, in the future this may become a template.

Definition at line 90 of file AbstractContinuumMechanicsAssembler.hpp.

template<unsigned DIM, bool CAN_ASSEMBLE_VECTOR, bool CAN_ASSEMBLE_MATRIX>
QuadraticMesh<DIM>* AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::mpMesh [protected]

The quadratic mesh

Definition at line 108 of file AbstractContinuumMechanicsAssembler.hpp.

template<unsigned DIM, bool CAN_ASSEMBLE_VECTOR, bool CAN_ASSEMBLE_MATRIX>
GaussianQuadratureRule<DIM>* AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::mpQuadRule [protected]
template<unsigned DIM, bool CAN_ASSEMBLE_VECTOR, bool CAN_ASSEMBLE_MATRIX>
const unsigned AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::NUM_NODES_PER_ELEMENT = (DIM+1)*(DIM+2)/2 [static, private]

Number of nodes per element.

Reimplemented in StokesFlowAssembler< DIM >.

Definition at line 96 of file AbstractContinuumMechanicsAssembler.hpp.

template<unsigned DIM, bool CAN_ASSEMBLE_VECTOR, bool CAN_ASSEMBLE_MATRIX>
const unsigned AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::NUM_VERTICES_PER_ELEMENT = DIM+1 [static, private]

Number of vertices per element.

Reimplemented in StokesFlowAssembler< DIM >, and StokesFlowPreconditionerAssembler< DIM >.

Definition at line 93 of file AbstractContinuumMechanicsAssembler.hpp.

template<unsigned DIM, bool CAN_ASSEMBLE_VECTOR, bool CAN_ASSEMBLE_MATRIX>
const unsigned AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::PRESSURE_BLOCK_SIZE_ELEMENTAL = NUM_VERTICES_PER_ELEMENT [static, private]
template<unsigned DIM, bool CAN_ASSEMBLE_VECTOR, bool CAN_ASSEMBLE_MATRIX>
const unsigned AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::SPATIAL_BLOCK_SIZE_ELEMENTAL = DIM*NUM_NODES_PER_ELEMENT [static, private]
template<unsigned DIM, bool CAN_ASSEMBLE_VECTOR, bool CAN_ASSEMBLE_MATRIX>
const unsigned AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::STENCIL_SIZE = DIM*NUM_NODES_PER_ELEMENT + NUM_VERTICES_PER_ELEMENT [static, private]

Stencil size.

Definition at line 104 of file AbstractContinuumMechanicsAssembler.hpp.


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