37 #include "SolidMechanicsProblemDefinition.hpp" 38 #include "AbstractIncompressibleMaterialLaw.hpp" 39 #include "AbstractCompressibleMaterialLaw.hpp" 41 template<
unsigned DIM>
44 mSolveUsingSnes(false)
48 template<
unsigned DIM>
51 assert(rFixedNodes.size()==rFixedNodeLocations.size());
55 for (
unsigned i=0; i<this->mDirichletNodes.size(); i++)
57 unsigned index = this->mDirichletNodes[i];
58 c_vector<double,DIM> displacement;
59 for (
unsigned j=0; j<DIM; j++)
61 double location = rFixedNodeLocations[i](j);
64 if (location != this->
FREE)
66 displacement(j) = location - this->
mrMesh.
GetNode(index)->rGetLocation()[j];
70 displacement(j) = this->
FREE;
77 template<
unsigned DIM>
89 if (compressibilityType == INCOMPRESSIBLE)
103 template<
unsigned DIM>
115 if (compressibilityType == INCOMPRESSIBLE)
117 for (
unsigned i=0; i<rMaterialLaws.size(); i++)
119 assert(rMaterialLaws[i]);
127 for (
unsigned i=0; i<rMaterialLaws.size(); i++)
129 assert(rMaterialLaws[i]);
137 template<
unsigned DIM>
145 template<
unsigned DIM>
153 template<
unsigned DIM>
171 template<
unsigned DIM>
189 template<
unsigned DIM>
193 if ((compressibilityType==INCOMPRESSIBLE) && (pMaterialLaw==
nullptr))
196 EXCEPTION(
"Compressibility type was declared as INCOMPRESSIBLE but a compressible material law was given");
199 if ((compressibilityType==COMPRESSIBLE) && (pMaterialLaw==
nullptr))
202 EXCEPTION(
"Incompressibility type was declared as COMPRESSIBLE but an incompressible material law was given");
206 template<
unsigned DIM>
213 EXCEPTION(
"No material law has been set");
bool IsHomogeneousMaterial()
void SetFixedNodes(std::vector< unsigned > &rFixedNodes, std::vector< c_vector< double, DIM > > &rFixedNodeLocation)
std::vector< AbstractCompressibleMaterialLaw< DIM > * > mCompressibleMaterialLaws
std::vector< unsigned > mDirichletNodes
Node< SPACE_DIM > * GetNode(unsigned index) const
virtual unsigned GetNumElements() const
#define EXCEPTION(message)
virtual unsigned GetNumNodes() const
CompressibilityType mCompressibilityType
std::vector< AbstractIncompressibleMaterialLaw< DIM > * > mIncompressibleMaterialLaws
AbstractIncompressibleMaterialLaw< DIM > * GetIncompressibleMaterialLaw(unsigned elementIndex)
std::vector< c_vector< double, DIM > > mDirichletNodeValues
void SetMaterialLaw(CompressibilityType compressibilityType, AbstractMaterialLaw< DIM > *pMaterialLaw)
AbstractTetrahedralMesh< DIM, DIM > & mrMesh
CompressibilityType GetCompressibilityType()
AbstractCompressibleMaterialLaw< DIM > * GetCompressibleMaterialLaw(unsigned elementIndex)
void CheckCastSuccess(CompressibilityType compressibilityType, AbstractMaterialLaw< DIM > *pMaterialLaw)
SolidMechanicsProblemDefinition(AbstractTetrahedralMesh< DIM, DIM > &rMesh)
bool mIsHomogeneousMaterial