ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkFEMElement2DStrain.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 
00019 #ifndef __itkFEMElement2DStrain_h
00020 #define __itkFEMElement2DStrain_h
00021 
00022 #include "itkFEMElementBase.h"
00023 #include "itkFEMMaterialLinearElasticity.h"
00024 
00025 namespace itk
00026 {
00027 namespace fem
00028 {
00050 template <class TBaseClass = Element>
00051 class Element2DStrain : public TBaseClass
00052 {
00053 public:
00054 
00056   typedef Element2DStrain          Self;
00057   typedef TBaseClass               Superclass;
00058   typedef SmartPointer<Self>       Pointer;
00059   typedef SmartPointer<const Self> ConstPointer;
00060 
00062   itkTypeMacro(Element2DStrain, TBaseClass);
00063 
00064   // Repeat the required typedefs and enums from parent class
00065   typedef typename Superclass::Float      Float;
00066   typedef typename Superclass::MatrixType MatrixType;
00067   typedef typename Superclass::VectorType VectorType;
00068 
00072   Element2DStrain();
00073 
00074   // ////////////////////////////////////////////////////////////////////////
00082   virtual void GetStrainDisplacementMatrix(MatrixType & B, const MatrixType & shapeDgl) const;
00083 
00087   virtual void GetMaterialMatrix(MatrixType & D) const;
00088 
00092   void GetMassMatrix(MatrixType & Me) const;
00093 
00097   virtual unsigned int GetNumberOfDegreesOfFreedomPerNode(void) const
00098   {
00099     return 2;
00100   }
00101 
00105   virtual Material::ConstPointer GetMaterial(void) const
00106   {
00107     return dynamic_cast<const Material *>(m_mat);
00108   }
00109 
00110   virtual void SetMaterial(Material::ConstPointer mat_)
00111   {
00112     m_mat =
00113       dynamic_cast<const MaterialLinearElasticity *>( mat_.GetPointer() );
00114   }
00115 
00116 protected:
00117 
00118   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00119 
00123   const MaterialLinearElasticity  *m_mat;
00124 };  // class Element2DStrain
00125 
00126 }
00127 }  // end namespace itk::fem
00128 
00129 #ifndef ITK_MANUAL_INSTANTIATION
00130 #include "itkFEMElement2DStrain.hxx"
00131 #endif
00132 
00133 #endif  // #ifndef __itkFEMElement2DStrain_h
00134