ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkFEMElement2DStress.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 
19 #ifndef itkFEMElement2DStress_h
20 #define itkFEMElement2DStress_h
21 
22 #include "itkFEMElementBase.h"
24 
25 namespace itk
26 {
27 namespace fem
28 {
44 template <typename TBaseClass = Element>
45 class Element2DStress : public TBaseClass
46 {
47 public:
48 
51  typedef TBaseClass Superclass;
54 
56  itkTypeMacro(Element2DStress, TBaseClass);
57 
58  // Repeat the required typedefs and enums from parent class
59  typedef typename Superclass::Float Float;
62 
67 
68  // ////////////////////////////////////////////////////////////////////////
69  /*
70  * Methods related to the physics of the problem.
71  */
72 
76  virtual void GetStrainDisplacementMatrix(MatrixType & B, const MatrixType & shapeDgl) const ITK_OVERRIDE;
77 
81  virtual void GetMaterialMatrix(MatrixType & D) const ITK_OVERRIDE;
82 
86  void GetMassMatrix(MatrixType & Me) const ITK_OVERRIDE;
87 
91  virtual unsigned int GetNumberOfDegreesOfFreedomPerNode(void) const ITK_OVERRIDE
92  {
93  return 2;
94  }
95 
99  virtual Material::ConstPointer GetMaterial(void) const ITK_OVERRIDE
100  {
101  return dynamic_cast<const Material *>(m_mat);
102  }
103 
104  virtual void SetMaterial(Material::ConstPointer mat_) ITK_OVERRIDE
105  {
106  this->SetMaterialInternal(mat_.GetPointer());
107  }
108  virtual void SetMaterial(Material::Pointer mat_)
109  {
110  this->SetMaterialInternal(mat_.GetPointer());
111  }
112 
113 protected:
114 
115  virtual void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
116 
121  virtual void SetMaterialInternal(const Material *mat_)
122  {
123  m_mat =
124  dynamic_cast<const MaterialLinearElasticity *>( mat_ );
125  }
127 
128 }; // class Element2DStress
129 
130 }
131 } // end namespace itk::fem
132 
133 #ifndef ITK_MANUAL_INSTANTIATION
134 #include "itkFEMElement2DStress.hxx"
135 #endif
136 
137 #endif // #ifndef itkFEMElement2DStress_h
virtual void GetStrainDisplacementMatrix(MatrixType &B, const MatrixType &shapeDgl) const override
const MaterialLinearElasticity * m_mat
SmartPointer< Self > Pointer
Superclass::VectorType VectorType
Class that is used to define linear elasticity problem in 2D space.
virtual void GetMaterialMatrix(MatrixType &D) const override
ObjectType * GetPointer() const
SmartPointer< const Self > ConstPointer
vnl_matrix< Float > MatrixType
Linear elasticity material class.
Base class for storing all the implicit material and other properties required to fully define the el...
virtual unsigned int GetNumberOfDegreesOfFreedomPerNode(void) const override
virtual void SetMaterialInternal(const Material *mat_)
void GetMassMatrix(MatrixType &Me) const override
Superclass::MatrixType MatrixType
Superclass::VectorType VectorType
virtual void SetMaterial(Material::Pointer mat_)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
virtual void PrintSelf(std::ostream &os, Indent indent) const override
virtual Material::ConstPointer GetMaterial(void) const override
virtual void SetMaterial(Material::ConstPointer mat_) override
Superclass::MatrixType MatrixType