ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkFEMElement2DC1Beam.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 __itkFEMElement2DC1Beam_h
00020 #define __itkFEMElement2DC1Beam_h
00021 
00022 #include "itkFEMElementStd.h"
00023 #include "itkFEMLoadElementBase.h"
00024 #include "itkFEMMaterialLinearElasticity.h"
00025 
00026 namespace itk
00027 {
00028 namespace fem
00029 {
00038 class Element2DC1Beam : public ElementStd<2, 2>
00039 {
00040 public:
00041 
00043   typedef Element2DC1Beam          Self;
00044   typedef ElementStd<2, 2>         TemplatedParentClass;
00045   typedef TemplatedParentClass     Superclass;
00046   typedef SmartPointer<Self>       Pointer;
00047   typedef SmartPointer<const Self> ConstPointer;
00048 
00050   itkSimpleNewMacro(Self);
00051 
00053   itkTypeMacro(Element2DC1Beam, TemplatedParentClass);
00054 
00057   virtual::itk::LightObject::Pointer CreateAnother(void) const;
00058 
00059 
00063   Element2DC1Beam();
00064 
00068   Element2DC1Beam(Node::ConstPointer n1_, Node::ConstPointer n2_, Material::ConstPointer mat_);
00069 
00070   // ////////////////////////////////////////////////////////////////////////
00071   /*
00072    * Methods related to the physics of the problem.
00073    */
00074 
00076   virtual void GetStiffnessMatrix(MatrixType & Ke) const;
00077 
00079   virtual void GetMassMatrix(MatrixType & Me) const;
00080 
00082   virtual void GetStrainDisplacementMatrix(MatrixType &, const MatrixType &) const
00083   {
00084   }
00085 
00087   virtual void GetMaterialMatrix(MatrixType &) const
00088   {
00089   }
00090 
00091   // ////////////////////////////////////////////////////////////////////////
00096   enum { DefaultIntegrationOrder = 1 };
00097 
00099   virtual void GetIntegrationPointAndWeight(unsigned int i, VectorType & pt, Float & w, unsigned int order = 0) const;
00100 
00101   virtual unsigned int GetNumberOfIntegrationPoints(unsigned int order) const;
00102 
00103   // ////////////////////////////////////////////////////////////////////////
00109   virtual VectorType ShapeFunctions(const VectorType & pt) const;
00110 
00112   virtual void ShapeFunctionDerivatives(const VectorType & pt, MatrixType & shapeD) const;
00113 
00115   virtual bool GetLocalFromGlobalCoordinates(const VectorType &, VectorType &) const
00116   {
00117     return false;
00118   }
00119 
00121   virtual Float JacobianDeterminant(const VectorType & pt, const MatrixType *pJ) const;
00122 
00124   virtual unsigned int GetNumberOfDegreesOfFreedomPerNode(void) const
00125   {
00126     return 3;
00127   }
00128 
00132   virtual Material::ConstPointer GetMaterial(void) const
00133   {
00134     return dynamic_cast<const Material *>(m_mat);
00135   }
00136 
00137   virtual void SetMaterial(Material::ConstPointer mat_)
00138   {
00139     m_mat =
00140       dynamic_cast<const MaterialLinearElasticity *>( mat_.GetPointer() );
00141   }
00142 
00144   virtual void PopulateEdgeIds(void) { /* empty */ }
00145 protected:
00146   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00147 
00148 private:
00149 
00153   const MaterialLinearElasticity *m_mat;
00154 
00155 };
00156 
00157 }
00158 }  // end namespace itk::fem
00159 
00160 #endif // #ifndef __itkFEMElement2DC1Beam_h
00161