Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkFEMElementStd.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkFEMElementStd.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/09/10 14:29:41 $
00007   Version:   $Revision: 1.16 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 
00018 #ifndef __itkFEMElementStd_h
00019 #define __itkFEMElementStd_h
00020 
00021 #include "itkFEMElementBase.h"
00022 
00023 namespace itk {
00024 namespace fem {
00025 
00026 
00027 
00028 
00055 template<unsigned int VNumberOfNodes, unsigned int VNumberOfSpatialDimensions, class TBaseClass=Element>
00056 class ElementStd : public TBaseClass
00057 {
00058 FEM_ABSTRACT_CLASS(ElementStd,TBaseClass)
00059 public:
00060 
00061 // FIXME: Add concept cheking for TBaseClass, and TPointClass
00062 
00063   // Repeat typedefs and enums from parent class
00064   typedef typename Superclass::Float Float;
00065   typedef typename Superclass::MatrixType MatrixType;
00066   typedef typename Superclass::VectorType VectorType;
00067   typedef typename Superclass::LoadType LoadType;
00068   typedef typename Superclass::LoadPointer LoadPointer;
00069   typedef typename Superclass::NodeIDType NodeIDType;
00070   typedef typename Superclass::DegreeOfFreedomIDType DegreeOfFreedomIDType;
00071   typedef typename Superclass::Node Node;
00072   enum{ InvalidDegreeOfFreedomID = Superclass::InvalidDegreeOfFreedomID };
00073 
00077   enum { NumberOfNodes=VNumberOfNodes };
00078 
00082   enum { NumberOfSpatialDimensions=VNumberOfSpatialDimensions };
00083 
00084 
00085 
00086 
00090   ElementStd();
00091 
00092 
00093 
00095   /*
00096    * Methods that define the geometry of an element
00097    */
00098   virtual unsigned int GetNumberOfNodes( void ) const
00099   { return NumberOfNodes; }
00100 
00101   virtual NodeIDType GetNode(unsigned int n) const
00102   {
00103     if(n>=NumberOfNodes)
00104     {
00105       return 0;
00106     }
00107     return this->m_node[n];
00108   }
00109 
00110   virtual void SetNode(unsigned int n, NodeIDType node)
00111   {
00112     if(n>=NumberOfNodes) { return; }
00113     this->m_node[n]=node;
00114   }
00115 
00116   virtual const VectorType& GetNodeCoordinates( unsigned int n ) const
00117   {
00118     return m_node[n]->GetCoordinates();
00119   }
00120 
00121   virtual unsigned int GetNumberOfSpatialDimensions() const
00122   {
00123     return NumberOfSpatialDimensions;
00124   }
00125 
00126 
00127 
00128 
00130   /*
00131    * Methods related to I/O
00132    */
00133 
00137   virtual void Read( std::istream&, void* info );
00138 
00142   virtual void Write( std::ostream& f ) const;
00143 
00144 
00145 
00146 
00147 protected:
00148 
00152   NodeIDType m_node[NumberOfNodes];
00153 
00154 };
00155 
00156 
00157 
00158 
00159 #ifdef _MSC_VER
00160 // Declare a static dummy function to prevent a MSVC 6.0 SP5 from crashing.
00161 // I have no idea why things don't work when this is not declared, but it
00162 // looks like this declaration makes compiler forget about some of the
00163 // troubles it has with templates.
00164 static void Dummy( void );
00165 #endif // #ifdef _MSC_VER
00166 
00167 }} // end namespace itk::fem
00168 
00169 #ifndef ITK_MANUAL_INSTANTIATION
00170 #include "itkFEMElementStd.txx"
00171 #endif
00172 
00173 #endif // #ifndef __itkFEMElementStd_h

Generated at Wed May 24 23:07:41 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000