00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
00062
00063
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
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
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
00161
00162
00163
00164 static void Dummy( void );
00165 #endif // #ifdef _MSC_VER
00166
00167 }}
00168
00169 #ifndef ITK_MANUAL_INSTANTIATION
00170 #include "itkFEMElementStd.txx"
00171 #endif
00172
00173 #endif // #ifndef __itkFEMElementStd_h