CompressibleNonlinearElasticitySolver< DIM > Class Template Reference

#include <CompressibleNonlinearElasticitySolver.hpp>

Inheritance diagram for CompressibleNonlinearElasticitySolver< DIM >:

Inheritance graph
[legend]
Collaboration diagram for CompressibleNonlinearElasticitySolver< DIM >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 CompressibleNonlinearElasticitySolver (QuadraticMesh< DIM > *pQuadMesh, AbstractMaterialLaw< DIM > *pMaterialLaw, c_vector< double, DIM > bodyForce, double density, std::string outputDirectory, std::vector< unsigned > &fixedNodes, std::vector< c_vector< double, DIM > > *pFixedNodeLocations=NULL)
 CompressibleNonlinearElasticitySolver (QuadraticMesh< DIM > *pQuadMesh, std::vector< AbstractMaterialLaw< DIM > * > &rMaterialLaws, c_vector< double, DIM > bodyForce, double density, std::string outputDirectory, std::vector< unsigned > &fixedNodes, std::vector< c_vector< double, DIM > > *pFixedNodeLocations=NULL)
 ~CompressibleNonlinearElasticitySolver ()

Protected Member Functions

virtual void AssembleOnElement (Element< DIM, DIM > &rElement, c_matrix< double, STENCIL_SIZE, STENCIL_SIZE > &rAElem, c_matrix< double, STENCIL_SIZE, STENCIL_SIZE > &rAElemPrecond, c_vector< double, STENCIL_SIZE > &rBElem, bool assembleResidual, bool assembleJacobian)
virtual void AssembleOnBoundaryElement (BoundaryElement< DIM-1, DIM > &rBoundaryElement, c_matrix< double, BOUNDARY_STENCIL_SIZE, BOUNDARY_STENCIL_SIZE > &rAelem, c_vector< double, BOUNDARY_STENCIL_SIZE > &rBelem, c_vector< double, DIM > &rTraction, bool assembleResidual, bool assembleJacobian)
void AssembleSystem (bool assembleResidual, bool assembleJacobian)
virtual void ComputeStressAndStressDerivative (AbstractMaterialLaw< DIM > *pMaterialLaw, c_matrix< double, DIM, DIM > &rC, c_matrix< double, DIM, DIM > &rInvC, double pressure, unsigned elementIndex, unsigned currentQuadPointGlobalIndex, c_matrix< double, DIM, DIM > &rT, FourthOrderTensor< DIM, DIM, DIM, DIM > &rDTdE, bool computeDTdE)

Protected Attributes

std::vector
< AbstractMaterialLaw< DIM > * > 
mMaterialLaws

Static Protected Attributes

static const size_t NUM_VERTICES_PER_ELEMENT = DIM+1
static const size_t NUM_NODES_PER_ELEMENT = (DIM+1)*(DIM+2)/2
static const size_t STENCIL_SIZE = DIM*NUM_NODES_PER_ELEMENT
static const size_t NUM_NODES_PER_BOUNDARY_ELEMENT = DIM*(DIM+1)/2
static const size_t BOUNDARY_STENCIL_SIZE = DIM*NUM_NODES_PER_BOUNDARY_ELEMENT

Friends

class TestCompressibleNonlinearElasticitySolver


Detailed Description

template<size_t DIM>
class CompressibleNonlinearElasticitySolver< DIM >

Finite elasticity solver. Solves static *compressible* nonlinear elasticity problems with arbitrary (compressible) material laws and a body force.

Uses quadratic basis functions for displacement, and is therefore outside the other assembler or solver hierarchy.

Definition at line 56 of file CompressibleNonlinearElasticitySolver.hpp.


Constructor & Destructor Documentation

template<size_t DIM>
CompressibleNonlinearElasticitySolver< DIM >::CompressibleNonlinearElasticitySolver ( QuadraticMesh< DIM > *  pQuadMesh,
AbstractMaterialLaw< DIM > *  pMaterialLaw,
c_vector< double, DIM >  bodyForce,
double  density,
std::string  outputDirectory,
std::vector< unsigned > &  fixedNodes,
std::vector< c_vector< double, DIM > > *  pFixedNodeLocations = NULL 
) [inline]

Constructor for homogeneous problems.

Parameters:
pQuadMesh The quadratic mesh to solve on
pMaterialLaw A single material law to use on all elements
bodyForce The body force if constant. (If not constant, pass in a zero vector and call SetFunctionalBodyForce()
density The density (assumed constant)
outputDirectory The output directory
fixedNodes Which nodes are fixed in space (the displacement is assumed to be zero unless the next parameter is given
pFixedNodeLocations Optional new locations of the fixed nodes.

Definition at line 559 of file CompressibleNonlinearElasticitySolver.cpp.

References AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::Initialise(), and CompressibleNonlinearElasticitySolver< DIM >::mMaterialLaws.

template<size_t DIM>
CompressibleNonlinearElasticitySolver< DIM >::CompressibleNonlinearElasticitySolver ( QuadraticMesh< DIM > *  pQuadMesh,
std::vector< AbstractMaterialLaw< DIM > * > &  rMaterialLaws,
c_vector< double, DIM >  bodyForce,
double  density,
std::string  outputDirectory,
std::vector< unsigned > &  fixedNodes,
std::vector< c_vector< double, DIM > > *  pFixedNodeLocations = NULL 
) [inline]

Variant constructor taking a vector of material laws for heterogeneous problems

Parameters:
pQuadMesh The quadratic mesh to solve on
rMaterialLaws Vector of material laws for each element
bodyForce The body force if constant. (If not constant, pass in a zero vector and call SetFunctionalBodyForce()
density The density (assumed constant)
outputDirectory The output directory
fixedNodes Which nodes are fixed in space (the displacement is assumed to be zero unless the next parameter is given
pFixedNodeLocations Optional new locations of the fixed nodes.

Definition at line 579 of file CompressibleNonlinearElasticitySolver.cpp.

References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::Initialise(), and CompressibleNonlinearElasticitySolver< DIM >::mMaterialLaws.

template<size_t DIM>
CompressibleNonlinearElasticitySolver< DIM >::~CompressibleNonlinearElasticitySolver (  )  [inline]

Destructor.

Definition at line 604 of file CompressibleNonlinearElasticitySolver.cpp.


Member Function Documentation

template<size_t DIM>
void CompressibleNonlinearElasticitySolver< DIM >::AssembleOnElement ( Element< DIM, DIM > &  rElement,
c_matrix< double, STENCIL_SIZE, STENCIL_SIZE > &  rAElem,
c_matrix< double, STENCIL_SIZE, STENCIL_SIZE > &  rAElemPrecond,
c_vector< double, STENCIL_SIZE > &  rBElem,
bool  assembleResidual,
bool  assembleJacobian 
) [inline, protected, virtual]

Assemble residual or jacobian on an element, using the current solution stored in mCurrrentSolution. The ordering assumed is (in 2d) rBElem = [u0 v0 u1 v1 .. u5 v5].

Parameters:
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.
rAElemPrecond The element's contribution to the matrix passed to PetSC in creating a preconditioner
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.
assembleResidual A bool stating whether to assemble the residual vector.
assembleJacobian A bool stating whether to assemble the Jacobian matrix.

Definition at line 187 of file CompressibleNonlinearElasticitySolver.cpp.

References QuadraticBasisFunction< ELEMENT_DIM >::ComputeBasisFunctions(), LinearBasisFunction< ELEMENT_DIM >::ComputeBasisFunctions(), CompressibleNonlinearElasticitySolver< DIM >::ComputeStressAndStressDerivative(), QuadraticBasisFunction< ELEMENT_DIM >::ComputeTransformedBasisFunctionDerivatives(), AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::dTdE, AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), GaussianQuadratureRule< ELEMENT_DIM >::GetNumQuadPoints(), GaussianQuadratureRule< ELEMENT_DIM >::GetWeight(), Inverse(), AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::mBodyForce, AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::mCurrentSolution, AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::mCurrentTime, AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::mDensity, CompressibleNonlinearElasticitySolver< DIM >::mMaterialLaws, AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::mpBodyForceFunction, AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::mpQuadMesh, AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::mpQuadratureRule, AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::mUsingBodyForceFunction, CompressibleNonlinearElasticitySolver< DIM >::NUM_NODES_PER_ELEMENT, CompressibleNonlinearElasticitySolver< DIM >::NUM_VERTICES_PER_ELEMENT, and GaussianQuadratureRule< ELEMENT_DIM >::rGetQuadPoint().

Referenced by CompressibleNonlinearElasticitySolver< DIM >::AssembleSystem().

template<size_t DIM>
void CompressibleNonlinearElasticitySolver< DIM >::AssembleOnBoundaryElement ( BoundaryElement< DIM-1, DIM > &  rBoundaryElement,
c_matrix< double, BOUNDARY_STENCIL_SIZE, BOUNDARY_STENCIL_SIZE > &  rAelem,
c_vector< double, BOUNDARY_STENCIL_SIZE > &  rBelem,
c_vector< double, DIM > &  rTraction,
bool  assembleResidual,
bool  assembleJacobian 
) [inline, protected, virtual]

Compute the term from the surface integral of s*phi, where s is a specified non-zero surface traction (ie Neumann boundary condition) to be added to the Rhs vector.

Parameters:
rBoundaryElement 
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.
rTraction 
assembleResidual A bool stating whether to assemble the residual vector.
assembleJacobian A bool stating whether to assemble the Jacobian matrix.

Definition at line 493 of file CompressibleNonlinearElasticitySolver.cpp.

References QuadraticBasisFunction< ELEMENT_DIM >::ComputeBasisFunctions(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), GaussianQuadratureRule< ELEMENT_DIM >::GetNumQuadPoints(), GaussianQuadratureRule< ELEMENT_DIM >::GetWeight(), AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::mCurrentTime, AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::mpBoundaryQuadratureRule, AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::mpQuadMesh, AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::mpTractionBoundaryConditionFunction, AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::mUsingTractionBoundaryConditionFunction, CompressibleNonlinearElasticitySolver< DIM >::NUM_NODES_PER_BOUNDARY_ELEMENT, and GaussianQuadratureRule< ELEMENT_DIM >::rGetQuadPoint().

Referenced by CompressibleNonlinearElasticitySolver< DIM >::AssembleSystem().

template<size_t DIM>
void CompressibleNonlinearElasticitySolver< DIM >::AssembleSystem ( bool  assembleResidual,
bool  assembleJacobian 
) [inline, protected, virtual]

Assemble the residual vector (using the current solution stored in mCurrentSolution, output going to mpLinearSystem->rGetRhsVector), or Jacobian matrix (using the current solution stored in mCurrentSolution, output going to mpLinearSystem->rGetLhsMatrix).

Parameters:
assembleResidual A bool stating whether to assemble the residual vector.
assembleJacobian A bool stating whether to assemble the Jacobian matrix.

Implements AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >.

Definition at line 49 of file CompressibleNonlinearElasticitySolver.cpp.

References LinearSystem::AddLhsMultipleValues(), LinearSystem::AddRhsMultipleValues(), AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::ApplyBoundaryConditions(), LinearSystem::AssembleFinalLhsMatrix(), LinearSystem::AssembleIntermediateLhsMatrix(), CompressibleNonlinearElasticitySolver< DIM >::AssembleOnBoundaryElement(), CompressibleNonlinearElasticitySolver< DIM >::AssembleOnElement(), LinearSystem::AssembleRhsVector(), CompressibleNonlinearElasticitySolver< DIM >::BOUNDARY_STENCIL_SIZE, PetscTools::GetMyRank(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetOwnership(), AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::mBoundaryElements, AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::mCurrentSolution, AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::mNumDofs, AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::mpLinearSystem, AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::mpPreconditionMatrixLinearSystem, AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::mpQuadMesh, AbstractNonlinearElasticitySolver< COMPRESSIBLE, DIM >::mSurfaceTractions, CompressibleNonlinearElasticitySolver< DIM >::NUM_NODES_PER_BOUNDARY_ELEMENT, CompressibleNonlinearElasticitySolver< DIM >::NUM_NODES_PER_ELEMENT, CompressibleNonlinearElasticitySolver< DIM >::STENCIL_SIZE, LinearSystem::ZeroLhsMatrix(), and LinearSystem::ZeroRhsVector().

template<size_t DIM>
void CompressibleNonlinearElasticitySolver< DIM >::ComputeStressAndStressDerivative ( AbstractMaterialLaw< DIM > *  pMaterialLaw,
c_matrix< double, DIM, DIM > &  rC,
c_matrix< double, DIM, DIM > &  rInvC,
double  pressure,
unsigned  elementIndex,
unsigned  currentQuadPointGlobalIndex,
c_matrix< double, DIM, DIM > &  rT,
FourthOrderTensor< DIM, DIM, DIM, DIM > &  rDTdE,
bool  computeDTdE 
) [inline, protected, virtual]

Simple (one-line function which just calls ComputeStressAndStressDerivative() on the material law, using C, inv(C), and p as the input and with rT and rDTdE as the output. Overloaded by other assemblers (eg cardiac mechanics) which need to add extra terms to the stress.

Parameters:
pMaterialLaw The material law for this element
rC The Lagrangian deformation tensor (F^T F)
rInvC The inverse of C. Should be computed by the user.
pressure The current pressure
elementIndex Index of the current element
currentQuadPointGlobalIndex The index (assuming an outer loop over elements and an inner loop over quadrature points), of the current quadrature point.
rT The stress will be returned in this parameter
rDTdE the stress derivative will be returned in this parameter, assuming the final parameter is true
computeDTdE A boolean flag saying whether the stress derivative is required or not.

Definition at line 477 of file CompressibleNonlinearElasticitySolver.cpp.

References AbstractMaterialLaw< DIM >::ComputeStressAndStressDerivative().

Referenced by CompressibleNonlinearElasticitySolver< DIM >::AssembleOnElement().


Member Data Documentation

template<size_t DIM>
const size_t CompressibleNonlinearElasticitySolver< DIM >::NUM_VERTICES_PER_ELEMENT = DIM+1 [static, protected]

Number of vertices per element

Definition at line 63 of file CompressibleNonlinearElasticitySolver.hpp.

Referenced by CompressibleNonlinearElasticitySolver< DIM >::AssembleOnElement().

template<size_t DIM>
const size_t CompressibleNonlinearElasticitySolver< DIM >::NUM_NODES_PER_ELEMENT = (DIM+1)*(DIM+2)/2 [static, protected]

template<size_t DIM>
const size_t CompressibleNonlinearElasticitySolver< DIM >::STENCIL_SIZE = DIM*NUM_NODES_PER_ELEMENT [static, protected]

Stencil size - number of unknowns per element (DIM*NUM_NODES_PER_ELEMENT displacement unknowns, no pressure unknowns

Definition at line 69 of file CompressibleNonlinearElasticitySolver.hpp.

Referenced by CompressibleNonlinearElasticitySolver< DIM >::AssembleSystem().

template<size_t DIM>
const size_t CompressibleNonlinearElasticitySolver< DIM >::NUM_NODES_PER_BOUNDARY_ELEMENT = DIM*(DIM+1)/2 [static, protected]

template<size_t DIM>
const size_t CompressibleNonlinearElasticitySolver< DIM >::BOUNDARY_STENCIL_SIZE = DIM*NUM_NODES_PER_BOUNDARY_ELEMENT [static, protected]

template<size_t DIM>
std::vector<AbstractMaterialLaw<DIM>*> CompressibleNonlinearElasticitySolver< DIM >::mMaterialLaws [protected]

The material laws for each element. This will either be of size 1 (same material law for all elements, ie homogeneous), or size num_elem.

Definition at line 80 of file CompressibleNonlinearElasticitySolver.hpp.

Referenced by CompressibleNonlinearElasticitySolver< DIM >::AssembleOnElement(), and CompressibleNonlinearElasticitySolver< DIM >::CompressibleNonlinearElasticitySolver().


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

Generated on Mon Apr 18 11:36:48 2011 for Chaste by  doxygen 1.5.5