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 };
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;
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;
373 unsigned int solutionIndex = 0)
const;
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;
558 virtual bool GetLocalFromGlobalCoordinates(
const VectorType & globalPt,
VectorType & localPt)
const = 0;
565 virtual unsigned int GetNumberOfSpatialDimensions()
const = 0;
613 const MatrixType *pshapeD = 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
void UnRegister() noexcept
Light weight base class for most itk classes.
LoadType::Pointer LoadPointer
std::vector< DegreeOfFreedomIDType > m_dof
unsigned long ElementIdentifier
std::vector< std::vector< int > > m_EdgeIds
std::set< Element * > SetOfElements
SmartPointer< const Self > ConstPointer
static T::Pointer Create()
void SetCoordinates(const VectorType &coords)
Class that stores information required to define a node.
vnl_matrix< Float > MatrixType
ImageBaseType::SpacingType VectorType
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.
static ITK_CONSTEXPR_VAR double e
The base of the natural logarithm or Euler's number
FEMPArray< Element > ArrayType
void SetDegreeOfFreedom(unsigned int i, DegreeOfFreedomIDType dof) const
FEMLightObject Superclass