ITK  4.13.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 #include "ITKFEMExport.h"
37 
38 namespace itk
39 {
40 namespace fem
41 {
74 template <unsigned int VDimension = 3>
75 class ITK_TEMPLATE_EXPORT FEMObject : public DataObject
76 {
77 public:
79  typedef FEMObject Self;
83 
85  itkNewMacro(Self);
86 
88  itkTypeMacro(FEMObject, DataObject);
89 
90  itkStaticConstMacro(FEMDimension, unsigned int, VDimension);
91  itkStaticConstMacro(MaxDimensions, unsigned int, 3);
92 
93  typedef unsigned long ElementIdentifier;
94  typedef unsigned long NodeIdentifier;
95  typedef unsigned long LoadIdentifier;
96  typedef unsigned long MaterialIdentifier;
97 
103 
113 
115  typedef typename
117  typedef typename
119  typedef typename
121  typedef typename
123  typedef typename
125  typedef typename
127  typedef typename
129  typedef typename
131 
132  // Copy the contents
133  void DeepCopy(FEMObject *Copy);
134 
135  // Get methods to get the entire VectorContainers for Elements, Nodes, Loads, and Materials
136  itkGetModifiableObjectMacro(ElementContainer, ElementContainerType);
137  itkGetModifiableObjectMacro(NodeContainer, NodeContainerType);
138  itkGetModifiableObjectMacro(LoadContainer, LoadContainerType);
139  itkGetModifiableObjectMacro(MaterialContainer, MaterialContainerType);
140 
142  unsigned int GetNumberOfDegreesOfFreedom(void) const
143  {
144  return m_NGFN;
145  }
146 
148  unsigned int GetNumberOfMultiFreedomConstraints(void) const
149  {
150  return m_NMFC;
151  }
152 
154  unsigned int GetNumberOfNodes(void) const
155  {
156  return m_NodeContainer->Size();
157  }
158 
160  unsigned int GetNumberOfElements(void) const
161  {
162  return m_ElementContainer->Size();
163  }
164 
166  unsigned int GetNumberOfLoads(void) const
167  {
168  return m_LoadContainer->Size();
169  }
170 
172  unsigned int GetNumberOfMaterials(void) const
173  {
174  return m_MaterialContainer->Size();
175  }
176 
180  void AddNextElement(Element::Pointer e);
181 
185  void InsertElement(Element::Pointer e, ElementIdentifier index);
186 
190  void AddNextNode(Element::Node::Pointer e);
191 
195  void InsertNode(Element::Node::Pointer e, NodeIdentifier index);
196 
201  {
202  this->AddNextMaterialInternal(mat.GetPointer());
203  }
205  {
206  this->AddNextMaterialInternal(mat.GetPointer());
207  }
208 
212  void InsertMaterial(Material::Pointer e, MaterialIdentifier index);
213 
218  { this->AddNextLoadInternal(ld.GetPointer()); }
220  { this->AddNextLoadInternal(ld.GetPointer()); }
222  { this->AddNextLoadInternal(ld.GetPointer()); }
224  { this->AddNextLoadInternal(ld.GetPointer()); }
226  { this->AddNextLoadInternal(ld.GetPointer()); }
228  { this->AddNextLoadInternal(ld.GetPointer()); }
230  { this->AddNextLoadInternal(ld.GetPointer()); }
231 
235  void InsertLoad(Load::Pointer ld, LoadIdentifier index);
236 
240  Element::ConstPointer GetElement(ElementIdentifier index) const;
241  Element::Pointer GetElement(ElementIdentifier index);
243 
247  Element::ConstPointer GetElementWithGlobalNumber(int globalNumber) const;
248  Element::Pointer GetElementWithGlobalNumber(int globalNumber);
250 
254  Element::Node::Pointer GetNode(NodeIdentifier index);
255  Element::Node::ConstPointer GetNode(NodeIdentifier index) const;
257 
261  Element::Node::Pointer GetNodeWithGlobalNumber(int globalNumber);
262 
266  Material::ConstPointer GetMaterial(MaterialIdentifier index) const;
267  Material::Pointer GetMaterial(MaterialIdentifier index);
269 
273  Material::ConstPointer GetMaterialWithGlobalNumber(int globalNumber) const;
274  Material::Pointer GetMaterialWithGlobalNumber(int globalNumber);
276 
280  Load::ConstPointer GetLoad(LoadIdentifier index) const;
281  Load::Pointer GetLoad(LoadIdentifier index);
283 
287  Load::Pointer GetLoadWithGlobalNumber(int globalNumber);
288 
292  void Clear();
293 
298  void RenumberNodeContainer();
299 
306  void FinalizeMesh();
307 
308 protected:
310  FEMObject();
311  ~FEMObject() ITK_OVERRIDE;
312  virtual void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
314 
320  void GenerateGFN();
321 
327  void GenerateMFC();
328 
329  void AddNextMaterialInternal(Material *mat);
333  unsigned int m_NGFN;
334 
339  unsigned int m_NMFC;
340 
341  ElementContainerPointer m_ElementContainer;
342  NodeContainerPointer m_NodeContainer;
343  LoadContainerPointer m_LoadContainer;
344  MaterialContainerPointer m_MaterialContainer;
345 
346 private:
347  ITK_DISALLOW_COPY_AND_ASSIGN(FEMObject);
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
DataObject Superclass
Definition: itkFEMObject.h:80
MaterialContainerType::ConstPointer MaterialContainerConstPointer
Definition: itkFEMObject.h:112
Implements N-dimensional Finite element (FE) models including elements, materials, and loads.
Definition: itkFEMObject.h:75
unsigned long ElementIdentifier
Definition: itkFEMObject.h:93
ElementContainerType::Iterator ElementContainerIterator
Definition: itkFEMObject.h:118
LoadContainerType::ConstPointer LoadContainerConstPointer
Definition: itkFEMObject.h:110
void AddNextLoad(LoadBCMFC::Pointer ld)
Definition: itkFEMObject.h:221
void AddNextLoad(LoadGravConst::Pointer ld)
Definition: itkFEMObject.h:227
NodeContainerType::Pointer NodeContainerPointer
Definition: itkFEMObject.h:107
SmartPointer< const Self > ConstPointer
Definition: itkFEMObject.h:82
void AddNextLoad(LoadNode::Pointer ld)
Definition: itkFEMObject.h:219
void AddNextMaterial(MaterialLinearElasticity::Pointer mat)
Definition: itkFEMObject.h:204
ObjectType * GetPointer() const
void AddNextLoad(LoadBC::Pointer ld)
Definition: itkFEMObject.h:223
unsigned int GetNumberOfElements(void) const
Definition: itkFEMObject.h:160
unsigned int GetNumberOfMaterials(void) const
Definition: itkFEMObject.h:172
MaterialContainerType::Pointer MaterialContainerPointer
Definition: itkFEMObject.h:111
unsigned long LoadIdentifier
Definition: itkFEMObject.h:95
unsigned long MaterialIdentifier
Definition: itkFEMObject.h:96
VectorContainer< NodeIdentifier, Element::Node::Pointer > NodeContainerType
Definition: itkFEMObject.h:102
SmartPointer< Self > Pointer
Definition: itkFEMObject.h:81
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:225
void AddNextMaterial(Material::Pointer mat)
Definition: itkFEMObject.h:200
VectorContainer< MaterialIdentifier, Material::Pointer > MaterialContainerType
Definition: itkFEMObject.h:100
void AddNextLoad(Load::Pointer ld)
Definition: itkFEMObject.h:217
unsigned int GetNumberOfLoads(void) const
Definition: itkFEMObject.h:166
VectorContainer< ElementIdentifier, Element::Pointer > ElementContainerType
Definition: itkFEMObject.h:101
LoadContainerType::Pointer LoadContainerPointer
Definition: itkFEMObject.h:109
unsigned int GetNumberOfNodes(void) const
Definition: itkFEMObject.h:154
LoadContainerType::Iterator LoadContainerIterator
Definition: itkFEMObject.h:126
NodeContainerType::ConstPointer NodeContainerConstPointer
Definition: itkFEMObject.h:108
unsigned int GetNumberOfDegreesOfFreedom(void) const
Definition: itkFEMObject.h:142
unsigned long NodeIdentifier
Definition: itkFEMObject.h:94
MaterialContainerType::Iterator MaterialContainerIterator
Definition: itkFEMObject.h:130
NodeContainerType::ConstIterator NodeContainerConstIterator
Definition: itkFEMObject.h:120
ElementContainerType::ConstPointer ElementContainerConstPointer
Definition: itkFEMObject.h:106
unsigned int GetNumberOfMultiFreedomConstraints(void) const
Definition: itkFEMObject.h:148
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
General abstract load base class.
MaterialContainerType::ConstIterator MaterialContainerConstIterator
Definition: itkFEMObject.h:128
NodeContainerType::Iterator NodeContainerIterator
Definition: itkFEMObject.h:122
static ITK_CONSTEXPR_VAR double e
The base of the natural logarithm or Euler&#39;s number
Definition: itkMath.h:56
ElementContainerType::Pointer ElementContainerPointer
Definition: itkFEMObject.h:105
void AddNextLoad(LoadLandmark::Pointer ld)
Definition: itkFEMObject.h:229
LoadContainerType::ConstIterator LoadContainerConstIterator
Definition: itkFEMObject.h:124
Base class for all data objects in ITK.
VectorContainer< LoadIdentifier, Load::Pointer > LoadContainerType
Definition: itkFEMObject.h:99
ElementContainerType::ConstIterator ElementContainerConstIterator
Definition: itkFEMObject.h:116