ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkFEMElement2DC0LinearTriangular.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 __itkFEMElement2DC0LinearTriangular_h
00020 #define __itkFEMElement2DC0LinearTriangular_h
00021 
00022 #include "itkFEMElementStd.h"
00023 
00024 namespace itk
00025 {
00026 namespace fem
00027 {
00057 class Element2DC0LinearTriangular : public ElementStd<3, 2>
00058 {
00059 public:
00060 
00062   typedef Element2DC0LinearTriangular Self;
00063   typedef ElementStd<3, 2>            TemplatedParentClass;
00064   typedef TemplatedParentClass        Superclass;
00065   typedef SmartPointer<Self>          Pointer;
00066   typedef SmartPointer<const Self>    ConstPointer;
00067 
00069   itkTypeMacro(Element2DC0LinearTriangular, TemplatedParentClass);
00070 
00071   // ////////////////////////////////////////////////////////////////////////
00076   enum { DefaultIntegrationOrder = 1 };
00077 
00079   virtual void GetIntegrationPointAndWeight(unsigned int i, VectorType & pt, Float & w, unsigned int order) const;
00080 
00082   virtual unsigned int GetNumberOfIntegrationPoints(unsigned int order) const;
00083 
00084   // ////////////////////////////////////////////////////////////////////////
00090   virtual VectorType ShapeFunctions(const VectorType & pt) const;
00091 
00093   virtual void ShapeFunctionDerivatives(const VectorType & pt, MatrixType & shapeD) const;
00094 
00096   virtual bool GetLocalFromGlobalCoordinates(const VectorType & globalPt, VectorType & localPt) const;
00097 
00098   // Since the Jacobian is not quadratic, we need to provide our
00099   // own implementation of calculating the determinant and inverse.
00100   virtual Float JacobianDeterminant(const VectorType & pt, const MatrixType *pJ = 0) const;
00101 
00103   virtual void JacobianInverse(const VectorType & pt, MatrixType & invJ, const MatrixType *pJ = 0) const;
00104 
00108   static const Float trigGaussRuleInfo[6][7][4];
00109 
00114   static const unsigned int Nip[6];
00115 protected:
00116   virtual void PopulateEdgeIds(void);
00117 
00118   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00119 
00120 };
00121 }
00122 }  // end namespace itk::fem
00123 
00124 #endif  // #ifndef __itkFEMElement2DC0LinearTriangular_h
00125