#include <AbstractContinuumMechanicsAssembler.hpp>
Inherits AbstractFeAssemblerInterface< 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 the form [A B1] [B2^T C ] (where often B1=B2 and C=0) and the vector has the form [b1] [b2]
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.
Definition at line 63 of file AbstractContinuumMechanicsAssembler.hpp.
AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::AbstractContinuumMechanicsAssembler | ( | QuadraticMesh< DIM > * | pMesh, | |
unsigned | numQuadPoints = 3 | |||
) | [inline] |
Constructor
pMesh | Pointer to the mesh | |
numQuadPoints | Number of quadrature points in each direction, defaults to 3 |
Definition at line 270 of file AbstractContinuumMechanicsAssembler.hpp.
References AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::mpQuadRule.
virtual AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::~AbstractContinuumMechanicsAssembler | ( | ) | [inline, virtual] |
Destructor.
Definition at line 285 of file AbstractContinuumMechanicsAssembler.hpp.
References AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::mpQuadRule.
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 | |||
) | [inline, protected] |
Calculate the contribution of a single element to the linear system.
rElement | The element to assemble on. | |
rAElem | The 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. | |
rBElem | The 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 396 of file AbstractContinuumMechanicsAssembler.hpp.
References AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::BLOCK_SYMMETRIC_MATRIX, AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::ComputePressurePressureMatrixTerm(), AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::ComputePressureVectorTerm(), AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::ComputeSpatialPressureMatrixTerm(), AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::ComputeSpatialSpatialMatrixTerm(), AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::ComputeSpatialVectorTerm(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), GaussianQuadratureRule< ELEMENT_DIM >::GetNumQuadPoints(), GaussianQuadratureRule< ELEMENT_DIM >::GetWeight(), AbstractFeAssemblerInterface< CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::mAssembleMatrix, AbstractFeAssemblerInterface< CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::mAssembleVector, AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::mpMesh, AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::mpQuadRule, NEVER_REACHED, AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::NUM_VERTICES_PER_ELEMENT, AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::PRESSURE_BLOCK_SIZE_ELEMENTAL, GaussianQuadratureRule< ELEMENT_DIM >::rGetQuadPoint(), and AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::SPATIAL_BLOCK_SIZE_ELEMENTAL.
Referenced by AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::DoAssemble().
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 [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
rLinearPhi | All the linear basis functions on this element, evaluated at the current quad point | |
rGradLinearPhi | Gradients of all the linear basis functions on this element, evaluated at the current quad point | |
rX | Current location (physical position) | |
pElement | Current element |
Definition at line 178 of file AbstractContinuumMechanicsAssembler.hpp.
Referenced by AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::AssembleOnElement().
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 [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
rLinearPhi | All the linear basis functions on this element, evaluated at the current quad point | |
rGradLinearPhi | Gradients of all the linear basis functions on this element, evaluated at the current quad point | |
rX | Current location (physical position) | |
pElement | Current element |
Definition at line 240 of file AbstractContinuumMechanicsAssembler.hpp.
Referenced by AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::AssembleOnElement().
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 [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
rQuadPhi | All the quadratic basis functions on this element, evaluated at the current quad point | |
rGradQuadPhi | Gradients of all the quadratic basis functions on this element, evaluated at the current quad point | |
rLinearPhi | All the linear basis functions on this element, evaluated at the current quad point | |
rGradLinearPhi | Gradients of all the linear basis functions on this element, evaluated at the current quad point | |
rX | Current location (physical position corresponding to quad point) | |
pElement | Current element |
Definition at line 148 of file AbstractContinuumMechanicsAssembler.hpp.
References AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::PRESSURE_BLOCK_SIZE_ELEMENTAL, and AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::SPATIAL_BLOCK_SIZE_ELEMENTAL.
Referenced by AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::AssembleOnElement().
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 [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
rQuadPhi | All the quadratic basis functions on this element, evaluated at the current quad point | |
rGradQuadPhi | Gradients of all the quadratic basis functions on this element, evaluated at the current quad point | |
rX | Current location (physical position) | |
pElement | Current element |
Definition at line 118 of file AbstractContinuumMechanicsAssembler.hpp.
Referenced by AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::AssembleOnElement().
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 [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
rQuadPhi | All the quadratic basis functions on this element, evaluated at the current quad point | |
rGradQuadPhi | Gradients of all the quadratic basis functions on this element, evaluated at the current quad point | |
rX | Current location (physical position) | |
pElement | Current element |
Definition at line 209 of file AbstractContinuumMechanicsAssembler.hpp.
Referenced by AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::AssembleOnElement().
void AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::DoAssemble | ( | ) | [inline, protected, virtual] |
The main assembly method. Protected, should only be called through Assemble(), AssembleMatrix() or AssembleVector() which set mAssembleMatrix, mAssembleVector accordingly. Involves looping over elements, and computing integrals and adding them to the vector or matrix
Implements AbstractFeAssemblerInterface< CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >.
Definition at line 310 of file AbstractContinuumMechanicsAssembler.hpp.
References AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::AssembleOnElement(), EXCEPTION, AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetOwnership(), PetscVecTools::GetSize(), PetscMatTools::GetSize(), AbstractFeAssemblerInterface< CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::mAssembleMatrix, AbstractFeAssemblerInterface< CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::mAssembleVector, AbstractFeAssemblerInterface< CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::mMatrixToAssemble, AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::mpMesh, AbstractFeAssemblerInterface< CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::mVectorToAssemble, AbstractFeAssemblerInterface< CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::mZeroMatrixBeforeAssembly, AbstractFeAssemblerInterface< CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::mZeroVectorBeforeAssembly, AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::NUM_NODES_PER_ELEMENT, AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::NUM_VERTICES_PER_ELEMENT, AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::STENCIL_SIZE, PetscMatTools::Zero(), and PetscVecTools::Zero().
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 68 of file AbstractContinuumMechanicsAssembler.hpp.
Referenced by AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::AssembleOnElement().
QuadraticMesh<DIM>* AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::mpMesh [protected] |
The quadratic mesh
Definition at line 86 of file AbstractContinuumMechanicsAssembler.hpp.
Referenced by AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::AssembleOnElement(), and AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::DoAssemble().
GaussianQuadratureRule<DIM>* AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::mpQuadRule [protected] |
Quadrature rule for volume integrals
Definition at line 89 of file AbstractContinuumMechanicsAssembler.hpp.
Referenced by AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::AbstractContinuumMechanicsAssembler(), AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::AssembleOnElement(), and AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::~AbstractContinuumMechanicsAssembler().
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.
Definition at line 74 of file AbstractContinuumMechanicsAssembler.hpp.
Referenced by AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::DoAssemble().
const unsigned AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::NUM_VERTICES_PER_ELEMENT = DIM+1 [static, private] |
Number of vertices per element.
Definition at line 71 of file AbstractContinuumMechanicsAssembler.hpp.
Referenced by AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::AssembleOnElement(), and AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::DoAssemble().
const unsigned AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::PRESSURE_BLOCK_SIZE_ELEMENTAL = NUM_VERTICES_PER_ELEMENT [static, private] |
Size of the pressure-block (the number of rows or columns in the submatrix C), restricted to one element
Definition at line 79 of file AbstractContinuumMechanicsAssembler.hpp.
Referenced by AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::AssembleOnElement(), AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::ComputePressurePressureMatrixTerm(), AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::ComputePressureVectorTerm(), and AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::ComputeSpatialPressureMatrixTerm().
const unsigned AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::SPATIAL_BLOCK_SIZE_ELEMENTAL = DIM*NUM_NODES_PER_ELEMENT [static, private] |
Size of the spatial-block (the number or rows or columns in the submatrix A), restricted to one element
Definition at line 77 of file AbstractContinuumMechanicsAssembler.hpp.
Referenced by AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::AssembleOnElement(), AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::ComputeSpatialPressureMatrixTerm(), AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::ComputeSpatialSpatialMatrixTerm(), and AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::ComputeSpatialVectorTerm().
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 82 of file AbstractContinuumMechanicsAssembler.hpp.
Referenced by AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::DoAssemble().