ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkFEMObject.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkFEMObject_h
19 #define __itkFEMObject_h
20 
21 #include "itkDataObject.h"
22 
23 #include "itkFEMElementBase.h"
26 #include "itkFEMLoadBase.h"
27 #include "itkFEMLoadNode.h"
28 #include "itkFEMLoadBC.h"
29 #include "itkFEMLoadBCMFC.h"
30 #include "itkFEMLoadEdge.h"
31 #include "itkFEMLoadGrav.h"
32 #include "itkFEMLoadLandmark.h"
33 #include "itkFEMMaterialBase.h"
35 #include "itkVectorContainer.h"
36 
37 namespace itk
38 {
39 namespace fem
40 {
73 template <unsigned int VDimension = 3>
74 class FEMObject : public DataObject
75 {
76 public:
78  typedef FEMObject Self;
82 
84  itkNewMacro(Self);
85 
87  itkTypeMacro(FEMObject, DataObject);
88 
89  itkStaticConstMacro(FEMDimension, unsigned int, VDimension);
90  itkStaticConstMacro(MaxDimensions, unsigned int, 3);
91 
92  typedef unsigned long ElementIdentifier;
93  typedef unsigned long NodeIdentifier;
94  typedef unsigned long LoadIdentifier;
95  typedef unsigned long MaterialIdentifier;
96 
102 
112 
114  typedef typename
116  typedef typename
118  typedef typename
120  typedef typename
122  typedef typename
124  typedef typename
126  typedef typename
128  typedef typename
130 
131  // Copy the contents
132  void DeepCopy(FEMObject *Copy);
133 
134  // Get methods to get the entire VectorContainers for Elements, Nodes, Loads, and Materials
135  itkGetModifiableObjectMacro(ElementContainer, ElementContainerType);
136  itkGetModifiableObjectMacro(NodeContainer, NodeContainerType);
137  itkGetModifiableObjectMacro(LoadContainer, LoadContainerType);
138  itkGetModifiableObjectMacro(MaterialContainer, MaterialContainerType);
139 
141  unsigned int GetNumberOfDegreesOfFreedom(void) const
142  {
143  return m_NGFN;
144  }
145 
147  unsigned int GetNumberOfMultiFreedomConstraints(void) const
148  {
149  return m_NMFC;
150  }
151 
153  unsigned int GetNumberOfNodes(void) const
154  {
155  return m_NodeContainer->Size();
156  }
157 
159  unsigned int GetNumberOfElements(void) const
160  {
161  return m_ElementContainer->Size();
162  }
163 
165  unsigned int GetNumberOfLoads(void) const
166  {
167  return m_LoadContainer->Size();
168  }
169 
171  unsigned int GetNumberOfMaterials(void) const
172  {
173  return m_MaterialContainer->Size();
174  }
175 
180 
185 
190 
195 
200  {
201  this->AddNextMaterialInternal(mat.GetPointer());
202  }
204  {
205  this->AddNextMaterialInternal(mat.GetPointer());
206  }
207 
212 
217  { this->AddNextLoadInternal(ld.GetPointer()); }
219  { this->AddNextLoadInternal(ld.GetPointer()); }
221  { this->AddNextLoadInternal(ld.GetPointer()); }
223  { this->AddNextLoadInternal(ld.GetPointer()); }
225  { this->AddNextLoadInternal(ld.GetPointer()); }
227  { this->AddNextLoadInternal(ld.GetPointer()); }
229  { this->AddNextLoadInternal(ld.GetPointer()); }
230 
234  void InsertLoad(Load::Pointer ld, LoadIdentifier index);
235 
242 
246  Element::ConstPointer GetElementWithGlobalNumber(int globalNumber) const;
249 
256 
261 
268 
272  Material::ConstPointer GetMaterialWithGlobalNumber(int globalNumber) const;
275 
282 
286  Load::Pointer GetLoadWithGlobalNumber(int globalNumber);
287 
291  void Clear();
292 
297  void RenumberNodeContainer();
298 
305  void FinalizeMesh();
306 
307 protected:
309  FEMObject();
310  ~FEMObject();
311  virtual void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
313 
319  void GenerateGFN(void);
320 
326  void GenerateMFC(void);
327 
332  unsigned int m_NGFN;
333 
338  unsigned int m_NMFC;
339 
344 
345 private:
346  FEMObject(const Self &); // purposely not implemented
347  void operator=(const Self &); // purposely not implemented
348 
349  void AddNextLoadInternal(Load *l);
350 }; // End Class: FEMObject
351 
352 }
353 }
354 
355 #ifndef ITK_MANUAL_INSTANTIATION
356 #include "itkFEMObject.hxx"
357 #endif
358 
359 #endif // #ifndef __itkFEMObject_h
void InsertLoad(Load::Pointer ld, LoadIdentifier index)
void InsertElement(Element::Pointer e, ElementIdentifier index)
DataObject Superclass
Definition: itkFEMObject.h:79
unsigned int m_NMFC
Definition: itkFEMObject.h:338
MaterialContainerType::ConstPointer MaterialContainerConstPointer
Definition: itkFEMObject.h:111
Material::ConstPointer GetMaterialWithGlobalNumber(int globalNumber) const
Implements N-dimensional Finite element (FE) models including elements, materials, and loads.
Definition: itkFEMObject.h:74
Element::ConstPointer GetElement(ElementIdentifier index) const
unsigned long ElementIdentifier
Definition: itkFEMObject.h:92
ElementContainerType::Iterator ElementContainerIterator
Definition: itkFEMObject.h:117
LoadContainerType::ConstPointer LoadContainerConstPointer
Definition: itkFEMObject.h:109
void AddNextLoad(LoadBCMFC::Pointer ld)
Definition: itkFEMObject.h:220
void AddNextLoad(LoadGravConst::Pointer ld)
Definition: itkFEMObject.h:226
NodeContainerType::Pointer NodeContainerPointer
Definition: itkFEMObject.h:106
Load::ConstPointer GetLoad(LoadIdentifier index) const
void AddNextLoadInternal(Load *l)
MaterialContainerPointer m_MaterialContainer
Definition: itkFEMObject.h:343
SmartPointer< const Self > ConstPointer
Definition: itkFEMObject.h:81
void AddNextLoad(LoadNode::Pointer ld)
Definition: itkFEMObject.h:218
void AddNextMaterialInternal(Material *mat)
ElementContainerPointer m_ElementContainer
Definition: itkFEMObject.h:340
void AddNextMaterial(MaterialLinearElasticity::Pointer mat)
Definition: itkFEMObject.h:203
ObjectType * GetPointer() const
static const double e
The base of the natural logarithm or Euler&#39;s number
Definition: itkMath.h:45
Load::Pointer GetLoadWithGlobalNumber(int globalNumber)
void AddNextLoad(LoadBC::Pointer ld)
Definition: itkFEMObject.h:222
NodeContainerPointer m_NodeContainer
Definition: itkFEMObject.h:341
unsigned int m_NGFN
Definition: itkFEMObject.h:332
unsigned int GetNumberOfElements(void) const
Definition: itkFEMObject.h:159
unsigned int GetNumberOfMaterials(void) const
Definition: itkFEMObject.h:171
MaterialContainerType::Pointer MaterialContainerPointer
Definition: itkFEMObject.h:110
unsigned long LoadIdentifier
Definition: itkFEMObject.h:94
void GenerateGFN(void)
unsigned long MaterialIdentifier
Definition: itkFEMObject.h:95
VectorContainer< NodeIdentifier, Element::Node::Pointer > NodeContainerType
Definition: itkFEMObject.h:101
SmartPointer< Self > Pointer
Definition: itkFEMObject.h:80
Base class for storing all the implicit material and other properties required to fully define the el...
void AddNextLoad(LoadEdge::Pointer ld)
Definition: itkFEMObject.h:224
void AddNextMaterial(Material::Pointer mat)
Definition: itkFEMObject.h:199
LoadContainerPointer m_LoadContainer
Definition: itkFEMObject.h:342
VectorContainer< MaterialIdentifier, Material::Pointer > MaterialContainerType
Definition: itkFEMObject.h:99
Element::ConstPointer GetElementWithGlobalNumber(int globalNumber) const
void AddNextLoad(Load::Pointer ld)
Definition: itkFEMObject.h:216
unsigned int GetNumberOfLoads(void) const
Definition: itkFEMObject.h:165
VectorContainer< ElementIdentifier, Element::Pointer > ElementContainerType
Definition: itkFEMObject.h:100
LoadContainerType::Pointer LoadContainerPointer
Definition: itkFEMObject.h:108
void RenumberNodeContainer()
void InsertMaterial(Material::Pointer e, MaterialIdentifier index)
unsigned int GetNumberOfNodes(void) const
Definition: itkFEMObject.h:153
static const unsigned int FEMDimension
Definition: itkFEMObject.h:89
LoadContainerType::Iterator LoadContainerIterator
Definition: itkFEMObject.h:125
NodeContainerType::ConstPointer NodeContainerConstPointer
Definition: itkFEMObject.h:107
Material::ConstPointer GetMaterial(MaterialIdentifier index) const
unsigned int GetNumberOfDegreesOfFreedom(void) const
Definition: itkFEMObject.h:141
unsigned long NodeIdentifier
Definition: itkFEMObject.h:93
MaterialContainerType::Iterator MaterialContainerIterator
Definition: itkFEMObject.h:129
void DeepCopy(FEMObject *Copy)
NodeContainerType::ConstIterator NodeContainerConstIterator
Definition: itkFEMObject.h:119
ElementContainerType::ConstPointer ElementContainerConstPointer
Definition: itkFEMObject.h:105
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
unsigned int GetNumberOfMultiFreedomConstraints(void) const
Definition: itkFEMObject.h:147
void AddNextNode(Element::Node::Pointer e)
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
void GenerateMFC(void)
static const unsigned int MaxDimensions
Definition: itkFEMObject.h:90
void AddNextElement(Element::Pointer e)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void InsertNode(Element::Node::Pointer e, NodeIdentifier index)
General abstract load base class.
MaterialContainerType::ConstIterator MaterialContainerConstIterator
Definition: itkFEMObject.h:127
Element::Node::Pointer GetNodeWithGlobalNumber(int globalNumber)
NodeContainerType::Iterator NodeContainerIterator
Definition: itkFEMObject.h:121
Element::Node::Pointer GetNode(NodeIdentifier index)
ElementContainerType::Pointer ElementContainerPointer
Definition: itkFEMObject.h:104
void AddNextLoad(LoadLandmark::Pointer ld)
Definition: itkFEMObject.h:228
LoadContainerType::ConstIterator LoadContainerConstIterator
Definition: itkFEMObject.h:123
void operator=(const Self &)
Base class for all data objects in ITK.
VectorContainer< LoadIdentifier, Load::Pointer > LoadContainerType
Definition: itkFEMObject.h:98
ElementContainerType::ConstIterator ElementContainerConstIterator
Definition: itkFEMObject.h:115