#include <SolidMechanicsProblemDefinition.hpp>
Inherits ContinuumMechanicsProblemDefinition< DIM >.
Inherited by ElectroMechanicsProblemDefinition< DIM >.
Public Member Functions | |
SolidMechanicsProblemDefinition (QuadraticMesh< DIM > &rMesh) | |
virtual | ~SolidMechanicsProblemDefinition () |
void | SetMaterialLaw (CompressibilityType compressibilityType, AbstractMaterialLaw< DIM > *pMaterialLaw) |
void | SetMaterialLaw (CompressibilityType compressibilityType, std::vector< AbstractMaterialLaw< DIM > * > &rMaterialLaws) |
bool | IsHomogeneousMaterial () |
CompressibilityType | GetCompressibilityType () |
AbstractIncompressibleMaterialLaw < DIM > * | GetIncompressibleMaterialLaw (unsigned elementIndex) |
AbstractCompressibleMaterialLaw < DIM > * | GetCompressibleMaterialLaw (unsigned elementIndex) |
void | SetZeroDisplacementNodes (std::vector< unsigned > &rFixedNodes) |
void | SetFixedNodes (std::vector< unsigned > &rFixedNodes, std::vector< c_vector< double, DIM > > &rFixedNodeLocation) |
virtual void | Validate () |
Private Member Functions | |
void | CheckCastSuccess (CompressibilityType compressibilityType, AbstractMaterialLaw< DIM > *pMaterialLaw) |
Private Attributes | |
std::vector < AbstractIncompressibleMaterialLaw < DIM > * > | mIncompressibleMaterialLaws |
std::vector < AbstractCompressibleMaterialLaw < DIM > * > | mCompressibleMaterialLaws |
bool | mIsHomogeneousMaterial |
CompressibilityType | mCompressibilityType |
A class for specifying various parts of a solid mechanics problem, in particular the material laws for the deforming body, and (inheriting functionality from a base class): fixed nodes information, the body force (per unit mass) (usually acceleration due to gravity or zero), the traction boundary conditions, and the density.
Definition at line 42 of file SolidMechanicsProblemDefinition.hpp.
SolidMechanicsProblemDefinition< DIM >::SolidMechanicsProblemDefinition | ( | QuadraticMesh< DIM > & | rMesh | ) | [inline] |
Constructor. Note body force initialised to zero and density to 1.0
rMesh | Tesh being solved on |
Definition at line 36 of file SolidMechanicsProblemDefinition.cpp.
virtual SolidMechanicsProblemDefinition< DIM >::~SolidMechanicsProblemDefinition | ( | ) | [inline, virtual] |
Destructor
Definition at line 84 of file SolidMechanicsProblemDefinition.hpp.
void SolidMechanicsProblemDefinition< DIM >::CheckCastSuccess | ( | CompressibilityType | compressibilityType, | |
AbstractMaterialLaw< DIM > * | pMaterialLaw | |||
) | [inline, private] |
Helper function for checking whether a dynamic_cast succeeded or not, and throwing an exception if it failed.
compressibilityType | compressibility type | |
pMaterialLaw | material law |
Definition at line 194 of file SolidMechanicsProblemDefinition.cpp.
References EXCEPTION.
Referenced by SolidMechanicsProblemDefinition< DIM >::SetMaterialLaw().
CompressibilityType SolidMechanicsProblemDefinition< DIM >::GetCompressibilityType | ( | ) | [inline] |
Get whether the material is incompressible or compressible. SetMaterialLaw() must be called before calling this. (Which can be checked by calling Validate()).
Definition at line 147 of file SolidMechanicsProblemDefinition.cpp.
References SolidMechanicsProblemDefinition< DIM >::mCompressibilityType, SolidMechanicsProblemDefinition< DIM >::mCompressibleMaterialLaws, and SolidMechanicsProblemDefinition< DIM >::mIncompressibleMaterialLaws.
Referenced by CompressibleNonlinearElasticitySolver< DIM >::CompressibleNonlinearElasticitySolver(), IncompressibleNonlinearElasticitySolver< DIM >::IncompressibleNonlinearElasticitySolver(), and ElectroMechanicsProblemDefinition< DIM >::Validate().
AbstractCompressibleMaterialLaw< DIM > * SolidMechanicsProblemDefinition< DIM >::GetCompressibleMaterialLaw | ( | unsigned | elementIndex | ) | [inline] |
Get the material law for a given element, when the body is compressible. An assertion will fail if GetCompressibilityType()!=COMPRESSIBLE. If the material is homogeneous, it doesn't matter what the element index is.
elementIndex | index of element |
Definition at line 176 of file SolidMechanicsProblemDefinition.cpp.
References SolidMechanicsProblemDefinition< DIM >::mCompressibilityType, SolidMechanicsProblemDefinition< DIM >::mCompressibleMaterialLaws, SolidMechanicsProblemDefinition< DIM >::mIncompressibleMaterialLaws, SolidMechanicsProblemDefinition< DIM >::mIsHomogeneousMaterial, and ContinuumMechanicsProblemDefinition< DIM >::mrMesh.
AbstractIncompressibleMaterialLaw< DIM > * SolidMechanicsProblemDefinition< DIM >::GetIncompressibleMaterialLaw | ( | unsigned | elementIndex | ) | [inline] |
Get the material law for a given element, when the body is incompressible. An assertion will fail if GetCompressibilityType()!=INCOMPRESSIBLE. If the material is homogeneous, it doesn't matter what the element index is.
elementIndex | index of element |
Definition at line 158 of file SolidMechanicsProblemDefinition.cpp.
References SolidMechanicsProblemDefinition< DIM >::mCompressibilityType, SolidMechanicsProblemDefinition< DIM >::mCompressibleMaterialLaws, SolidMechanicsProblemDefinition< DIM >::mIncompressibleMaterialLaws, SolidMechanicsProblemDefinition< DIM >::mIsHomogeneousMaterial, and ContinuumMechanicsProblemDefinition< DIM >::mrMesh.
bool SolidMechanicsProblemDefinition< DIM >::IsHomogeneousMaterial | ( | ) | [inline] |
Get whether the material is homogeneous or heterogeneous. SetMaterialLaw() must be called before calling this.
Definition at line 139 of file SolidMechanicsProblemDefinition.cpp.
References SolidMechanicsProblemDefinition< DIM >::mCompressibleMaterialLaws, SolidMechanicsProblemDefinition< DIM >::mIncompressibleMaterialLaws, and SolidMechanicsProblemDefinition< DIM >::mIsHomogeneousMaterial.
void SolidMechanicsProblemDefinition< DIM >::SetFixedNodes | ( | std::vector< unsigned > & | rFixedNodes, | |
std::vector< c_vector< double, DIM > > & | rFixedNodeLocation | |||
) | [inline] |
Set a list of nodes to be fixed, with their corresponding new LOCATIONS (not displacements). (This class will store as displacements though, and it is displacements that will be returned by rGetDirichletNodeValues).
rFixedNodes | the fixed node indices | |
rFixedNodeLocation | corresponding locations |
Definition at line 44 of file SolidMechanicsProblemDefinition.cpp.
References ContinuumMechanicsProblemDefinition< DIM >::FREE, ContinuumMechanicsProblemDefinition< DIM >::mDirichletNodes, ContinuumMechanicsProblemDefinition< DIM >::mDirichletNodeValues, and ContinuumMechanicsProblemDefinition< DIM >::mrMesh.
void SolidMechanicsProblemDefinition< DIM >::SetMaterialLaw | ( | CompressibilityType | compressibilityType, | |
std::vector< AbstractMaterialLaw< DIM > * > & | rMaterialLaws | |||
) | [inline] |
Set a vector of material laws for the body, one for each element in the mesh (the heterogeneous case). If compressibilityType==INCOMPRESSIBLE, the material law pointer will be checked at run-time that it is of type `AbstractIncompressibleMaterialLaw`, and similarly for the compressible case. Any previous material information will be deleted.
compressibilityType | either 'INCOMPRESSIBLE' or 'COMPRESSIBLE' | |
rMaterialLaws | Vector of pointers to material laws |
Definition at line 102 of file SolidMechanicsProblemDefinition.cpp.
References SolidMechanicsProblemDefinition< DIM >::CheckCastSuccess(), SolidMechanicsProblemDefinition< DIM >::mCompressibilityType, SolidMechanicsProblemDefinition< DIM >::mCompressibleMaterialLaws, SolidMechanicsProblemDefinition< DIM >::mIncompressibleMaterialLaws, SolidMechanicsProblemDefinition< DIM >::mIsHomogeneousMaterial, and ContinuumMechanicsProblemDefinition< DIM >::mrMesh.
void SolidMechanicsProblemDefinition< DIM >::SetMaterialLaw | ( | CompressibilityType | compressibilityType, | |
AbstractMaterialLaw< DIM > * | pMaterialLaw | |||
) | [inline] |
Set a material law for the entire body (ie the homogeneous case). If compressibilityType==INCOMPRESSIBLE, the material law pointer will be checked at run-time that it is of type `AbstractIncompressibleMaterialLaw`, and similarly for the compressible case. Any previous material information will be deleted.
compressibilityType | either 'INCOMPRESSIBLE' or 'COMPRESSIBLE' | |
pMaterialLaw | The material law for the entire body |
Definition at line 75 of file SolidMechanicsProblemDefinition.cpp.
References SolidMechanicsProblemDefinition< DIM >::CheckCastSuccess(), SolidMechanicsProblemDefinition< DIM >::mCompressibilityType, SolidMechanicsProblemDefinition< DIM >::mCompressibleMaterialLaws, SolidMechanicsProblemDefinition< DIM >::mIncompressibleMaterialLaws, and SolidMechanicsProblemDefinition< DIM >::mIsHomogeneousMaterial.
Referenced by ElectroMechanicsProblemDefinition< DIM >::SetUseDefaultCardiacMaterialLaw().
void SolidMechanicsProblemDefinition< DIM >::SetZeroDisplacementNodes | ( | std::vector< unsigned > & | rFixedNodes | ) | [inline] |
Set a list of nodes (indices) to be fixed in space with zero displacement
rFixedNodes | the fixed nodes |
Definition at line 144 of file SolidMechanicsProblemDefinition.hpp.
References ContinuumMechanicsProblemDefinition< DIM >::SetZeroDirichletNodes().
void SolidMechanicsProblemDefinition< DIM >::Validate | ( | ) | [inline, virtual] |
Check all variables are set appropriately. Exceptions are thrown if any are not. Derived classes can override but should call this version as well.
Reimplemented from ContinuumMechanicsProblemDefinition< DIM >.
Reimplemented in ElectroMechanicsProblemDefinition< DIM >.
Definition at line 212 of file SolidMechanicsProblemDefinition.cpp.
References EXCEPTION, SolidMechanicsProblemDefinition< DIM >::mCompressibleMaterialLaws, and SolidMechanicsProblemDefinition< DIM >::mIncompressibleMaterialLaws.
CompressibilityType SolidMechanicsProblemDefinition< DIM >::mCompressibilityType [private] |
Whether the material is incompressible or compressible. (CompressibilityType is an enumeration).
Definition at line 65 of file SolidMechanicsProblemDefinition.hpp.
Referenced by SolidMechanicsProblemDefinition< DIM >::GetCompressibilityType(), SolidMechanicsProblemDefinition< DIM >::GetCompressibleMaterialLaw(), SolidMechanicsProblemDefinition< DIM >::GetIncompressibleMaterialLaw(), and SolidMechanicsProblemDefinition< DIM >::SetMaterialLaw().
std::vector<AbstractCompressibleMaterialLaw<DIM>*> SolidMechanicsProblemDefinition< DIM >::mCompressibleMaterialLaws [private] |
The material law, in the case of compressible material laws. This vector is either of size 1, representing a homogeneous material, or of size num_elements, representing a heterogeneous material, with a material law per element. If the material is incompressible, this vector will be of size zero.
Definition at line 59 of file SolidMechanicsProblemDefinition.hpp.
Referenced by SolidMechanicsProblemDefinition< DIM >::GetCompressibilityType(), SolidMechanicsProblemDefinition< DIM >::GetCompressibleMaterialLaw(), SolidMechanicsProblemDefinition< DIM >::GetIncompressibleMaterialLaw(), SolidMechanicsProblemDefinition< DIM >::IsHomogeneousMaterial(), SolidMechanicsProblemDefinition< DIM >::SetMaterialLaw(), and SolidMechanicsProblemDefinition< DIM >::Validate().
std::vector<AbstractIncompressibleMaterialLaw<DIM>*> SolidMechanicsProblemDefinition< DIM >::mIncompressibleMaterialLaws [private] |
The material law, in the case of incompressible material laws. This vector is either of size 1, representing a homogeneous material, or of size num_elements, representing a heterogeneous material, with a material law per element. If he material is compressible, this vector will be of size zero.
Definition at line 53 of file SolidMechanicsProblemDefinition.hpp.
Referenced by SolidMechanicsProblemDefinition< DIM >::GetCompressibilityType(), SolidMechanicsProblemDefinition< DIM >::GetCompressibleMaterialLaw(), SolidMechanicsProblemDefinition< DIM >::GetIncompressibleMaterialLaw(), SolidMechanicsProblemDefinition< DIM >::IsHomogeneousMaterial(), SolidMechanicsProblemDefinition< DIM >::SetMaterialLaw(), and SolidMechanicsProblemDefinition< DIM >::Validate().
bool SolidMechanicsProblemDefinition< DIM >::mIsHomogeneousMaterial [private] |
Whether the material is homogeneous (same material law everywhere) or heterogeneous
Definition at line 62 of file SolidMechanicsProblemDefinition.hpp.
Referenced by SolidMechanicsProblemDefinition< DIM >::GetCompressibleMaterialLaw(), SolidMechanicsProblemDefinition< DIM >::GetIncompressibleMaterialLaw(), SolidMechanicsProblemDefinition< DIM >::IsHomogeneousMaterial(), and SolidMechanicsProblemDefinition< DIM >::SetMaterialLaw().