ITK  4.9.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 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 
181 
186 
191 
196 
201  {
202  this->AddNextMaterialInternal(mat.GetPointer());
203  }
205  {
206  this->AddNextMaterialInternal(mat.GetPointer());
207  }
208 
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 
243 
247  Element::ConstPointer GetElementWithGlobalNumber(int globalNumber) const;
250 
257 
262 
269 
273  Material::ConstPointer GetMaterialWithGlobalNumber(int globalNumber) const;
276 
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();
312  virtual void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
314 
320  void GenerateGFN();
321 
327  void GenerateMFC();
328 
333  unsigned int m_NGFN;
334 
339  unsigned int m_NMFC;
340 
345 
346 private:
347  FEMObject(const Self &) ITK_DELETE_FUNCTION;
348  void operator=(const Self &) ITK_DELETE_FUNCTION;
349 
350  void AddNextLoadInternal(Load *l);
351 }; // End Class: FEMObject
352 
353 }
354 }
355 
356 #ifndef ITK_MANUAL_INSTANTIATION
357 #include "itkFEMObject.hxx"
358 #endif
359 
360 #endif // #ifndef itkFEMObject_h
void InsertLoad(Load::Pointer ld, LoadIdentifier index)
void InsertElement(Element::Pointer e, ElementIdentifier index)
DataObject Superclass
Definition: itkFEMObject.h:80
unsigned int m_NMFC
Definition: itkFEMObject.h:339
MaterialContainerType::ConstPointer MaterialContainerConstPointer
Definition: itkFEMObject.h:112
virtual void PrintSelf(std::ostream &os, Indent indent) const override
Material::ConstPointer GetMaterialWithGlobalNumber(int globalNumber) const
Implements N-dimensional Finite element (FE) models including elements, materials, and loads.
Definition: itkFEMObject.h:75
Element::ConstPointer GetElement(ElementIdentifier index) const
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
Load::ConstPointer GetLoad(LoadIdentifier index) const
void AddNextLoadInternal(Load *l)
MaterialContainerPointer m_MaterialContainer
Definition: itkFEMObject.h:344
SmartPointer< const Self > ConstPointer
Definition: itkFEMObject.h:82
void AddNextLoad(LoadNode::Pointer ld)
Definition: itkFEMObject.h:219
void AddNextMaterialInternal(Material *mat)
ElementContainerPointer m_ElementContainer
Definition: itkFEMObject.h:341
void AddNextMaterial(MaterialLinearElasticity::Pointer mat)
Definition: itkFEMObject.h:204
ObjectType * GetPointer() const
static const double e
The base of the natural logarithm or Euler&#39;s number
Definition: itkMath.h:47
Load::Pointer GetLoadWithGlobalNumber(int globalNumber)
void AddNextLoad(LoadBC::Pointer ld)
Definition: itkFEMObject.h:223
NodeContainerPointer m_NodeContainer
Definition: itkFEMObject.h:342
unsigned int m_NGFN
Definition: itkFEMObject.h:333
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
LoadContainerPointer m_LoadContainer
Definition: itkFEMObject.h:343
VectorContainer< MaterialIdentifier, Material::Pointer > MaterialContainerType
Definition: itkFEMObject.h:100
Element::ConstPointer GetElementWithGlobalNumber(int globalNumber) const
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
void RenumberNodeContainer()
void InsertMaterial(Material::Pointer e, MaterialIdentifier index)
unsigned int GetNumberOfNodes(void) const
Definition: itkFEMObject.h:154
static const unsigned int FEMDimension
Definition: itkFEMObject.h:90
LoadContainerType::Iterator LoadContainerIterator
Definition: itkFEMObject.h:126
NodeContainerType::ConstPointer NodeContainerConstPointer
Definition: itkFEMObject.h:108
Material::ConstPointer GetMaterial(MaterialIdentifier index) const
unsigned int GetNumberOfDegreesOfFreedom(void) const
Definition: itkFEMObject.h:142
unsigned long NodeIdentifier
Definition: itkFEMObject.h:94
MaterialContainerType::Iterator MaterialContainerIterator
Definition: itkFEMObject.h:130
void DeepCopy(FEMObject *Copy)
NodeContainerType::ConstIterator NodeContainerConstIterator
Definition: itkFEMObject.h:120
ElementContainerType::ConstPointer ElementContainerConstPointer
Definition: itkFEMObject.h:106
unsigned int GetNumberOfMultiFreedomConstraints(void) const
Definition: itkFEMObject.h:148
void AddNextNode(Element::Node::Pointer e)
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
static const unsigned int MaxDimensions
Definition: itkFEMObject.h:91
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:128
Element::Node::Pointer GetNodeWithGlobalNumber(int globalNumber)
NodeContainerType::Iterator NodeContainerIterator
Definition: itkFEMObject.h:122
Element::Node::Pointer GetNode(NodeIdentifier index)
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