19 #ifndef itkFEMElementBase_h 20 #define itkFEMElementBase_h 27 #include "vnl/vnl_matrix.h" 28 #include "vnl/vnl_vector.h" 29 #include "ITKFEMExport.h" 134 enum { InvalidDegreeOfFreedomID = 0xffffffff };
167 smartPtr =
static_cast<Pointer
>(
new Self);
178 virtual::itk::LightObject::Pointer CreateAnother(
void)
const ITK_OVERRIDE;
202 this->ClearDegreesOfFreedom();
203 this->m_elements.clear();
213 return m_coordinates;
221 m_coordinates = coords;
229 if( i >= m_dof.size() )
231 return InvalidDegreeOfFreedomID;
242 if( i >= m_dof.size() )
244 m_dof.resize(i + 1, InvalidDegreeOfFreedomID);
250 virtual void ClearDegreesOfFreedom(
void)
const;
260 virtual void PrintSelf(std::ostream& os,
Indent indent)
const ITK_OVERRIDE;
272 mutable std::vector<DegreeOfFreedomIDType>
m_dof;
280 virtual VectorType GetStrainsAtPoint(
const VectorType & pt,
const Solution & sol,
unsigned int index)
const;
282 virtual VectorType GetStressesAtPoint(
const VectorType & pt,
const VectorType &
e,
const Solution & sol,
283 unsigned int index)
const;
305 virtual void GetStiffnessMatrix(MatrixType & Ke)
const;
316 virtual Float GetElementDeformationEnergy(MatrixType & LocalSolution)
const;
329 virtual void GetMassMatrix(MatrixType & Me)
const;
342 virtual void GetLandmarkContributionMatrix(
float eta, MatrixType & Le)
const;
351 virtual void GetStrainDisplacementMatrix(MatrixType & B,
const MatrixType & shapeDgl)
const = 0;
358 virtual void GetMaterialMatrix(MatrixType & D)
const = 0;
371 virtual VectorType InterpolateSolution(
const VectorType & pt,
373 unsigned int solutionIndex = 0)
const;
388 virtual Float InterpolateSolutionN(
const VectorType & pt,
const Solution & sol,
unsigned int f,
389 unsigned int solutionIndex = 0)
const;
399 if( local_dof > this->GetNumberOfDegreesOfFreedom() )
401 return InvalidDegreeOfFreedomID;
403 return this->GetNode(local_dof /
404 this->GetNumberOfDegreesOfFreedomPerNode() )
405 ->GetDegreeOfFreedom(local_dof % this->GetNumberOfDegreesOfFreedomPerNode() );
464 virtual void GetIntegrationPointAndWeight(
unsigned int i,
467 unsigned int order = 0)
const = 0;
479 virtual unsigned int GetNumberOfIntegrationPoints(
unsigned int order = 0)
const = 0;
489 itkStaticConstMacro(gaussMaxOrder,
unsigned int, 10);
502 static const Float gaussPoint[gaussMaxOrder + 1][gaussMaxOrder];
509 static const Float gaussWeight[gaussMaxOrder + 1][gaussMaxOrder];
525 virtual unsigned int GetNumberOfNodes(
void)
const = 0;
530 virtual NodeIDType GetNode(
unsigned int n)
const = 0;
535 virtual void SetNode(
unsigned int n, NodeIDType node) = 0;
543 virtual const VectorType & GetNodeCoordinates(
unsigned int n)
const = 0;
550 virtual VectorType GetGlobalFromLocalCoordinates(
const VectorType & pt)
const;
558 virtual bool GetLocalFromGlobalCoordinates(
const VectorType & globalPt, VectorType & localPt)
const = 0;
565 virtual unsigned int GetNumberOfSpatialDimensions()
const = 0;
574 virtual VectorType ShapeFunctions(
const VectorType & pt)
const = 0;
591 virtual void ShapeFunctionDerivatives(
const VectorType & pt, MatrixType & shapeD)
const = 0;
612 virtual void ShapeFunctionGlobalDerivatives(
const VectorType & pt, MatrixType & shapeDgl,
const MatrixType *pJ = ITK_NULLPTR,
613 const MatrixType *pshapeD = ITK_NULLPTR)
const;
636 virtual void Jacobian(
const VectorType & pt, MatrixType & J,
const MatrixType *pshapeD = ITK_NULLPTR)
const;
647 virtual Float JacobianDeterminant(
const VectorType & pt,
const MatrixType *pJ = ITK_NULLPTR)
const;
660 virtual void JacobianInverse(
const VectorType & pt, MatrixType & invJ,
const MatrixType *pJ = ITK_NULLPTR)
const;
667 virtual unsigned int GetNumberOfDegreesOfFreedom(
void)
const;
672 virtual std::vector<std::vector<int> > GetEdgeIds(
void)
const;
681 virtual unsigned int GetNumberOfDegreesOfFreedomPerNode(
void)
const = 0;
684 virtual void PopulateEdgeIds(
void) = 0;
691 virtual void PrintSelf(std::ostream& os,
Indent indent)
const ITK_OVERRIDE;
698 #endif // #ifndef itkFEMElementBase_h DegreeOfFreedomIDType GetDegreeOfFreedom(unsigned int i) const
DegreeOfFreedomIDType GetDegreeOfFreedom(unsigned int local_dof) const
LoadType::Pointer LoadPointer
std::vector< DegreeOfFreedomIDType > m_dof
unsigned long ElementIdentifier
std::vector< std::vector< int > > m_EdgeIds
std::set< Element * > SetOfElements
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes...
SmartPointer< const Self > ConstPointer
static T::Pointer Create()
void SetCoordinates(const VectorType &coords)
Class that stores information required to define a node.
void UnRegister() ITK_SP_NOEXCEPT
vnl_matrix< Float > MatrixType
static ITK_CONSTEXPR double e
The base of the natural logarithm or Euler's number
unsigned int DegreeOfFreedomIDType
Provides functions to access the values of the solution vector.
VectorContainer< ElementIdentifier, Element::Pointer > ArrayType1
Base class for all classes that define the FEM system.
vnl_vector< Float > VectorType
SmartPointer< Self > Pointer
SmartPointer< Self > Pointer
const VectorType & GetCoordinates(void) const
FEMLightObject Superclass
Abstract base element class.
Node::ConstPointer NodeIDType
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
SmartPointer< const Self > ConstPointer
Control indentation during Print() invocation.
FEMPArray< Self > ArrayType
FEMPArray< Element > ArrayType
void SetDegreeOfFreedom(unsigned int i, DegreeOfFreedomIDType dof) const
FEMLightObject Superclass