IFEM  90A354
ModelGenerator.h
Go to the documentation of this file.
1 // $Id$
2 //==============================================================================
12 //==============================================================================
13 
14 #ifndef _MODEL_GENERATOR_H
15 #define _MODEL_GENERATOR_H
16 
17 #include <string>
18 
19 class SIMinput;
20 class ASMbase;
21 namespace tinyxml2 { class XMLElement; }
22 
23 
29 {
30 public:
33  explicit ModelGenerator(const tinyxml2::XMLElement* elem) : geo(elem) {}
35  virtual ~ModelGenerator() {}
36 
38  virtual bool createGeometry(SIMinput& sim) const;
39 
41  virtual bool createTopologySets(SIMinput& sim) const = 0;
42 
44  virtual bool createTopology(SIMinput&) const { return true; }
45 
46 protected:
50  virtual std::string createG2(int nsd, bool rational) const { return ""; }
51 
53  bool topologySets() const;
54 
55 protected:
56  const tinyxml2::XMLElement* geo;
57 };
58 
59 
66 {
67 public:
69  explicit DefaultGeometry1D(const tinyxml2::XMLElement* geo) : ModelGenerator(geo) {}
71  virtual ~DefaultGeometry1D() {}
72 
74  virtual bool createTopologySets(SIMinput& sim) const;
75 
76 protected:
78  virtual std::string createG2(int nsd, bool rational = false) const;
79 };
80 
81 
88 {
89 public:
91  explicit DefaultGeometry2D(const tinyxml2::XMLElement* geo) : ModelGenerator(geo) {}
93  virtual ~DefaultGeometry2D() {}
94 
96  virtual bool createTopologySets(SIMinput& sim) const;
97 
98 protected:
100  virtual std::string createG2(int nsd, bool rational = false) const;
101 };
102 
103 
110 {
111 public:
113  explicit DefaultGeometry3D(const tinyxml2::XMLElement* geo) : ModelGenerator(geo) {}
115  virtual ~DefaultGeometry3D() {}
116 
118  virtual bool createTopologySets(SIMinput& sim) const;
119 
120 protected:
122  virtual std::string createG2(int, bool rational = false) const;
123 };
124 
125 #endif
Base class for spline-based finite element (FE) assembly drivers.
Definition: ASMbase.h:70
Default model generator for 1D FEM simulators.
Definition: ModelGenerator.h:66
virtual std::string createG2(int nsd, bool rational=false) const
Generates the G2 description of the geometry.
Definition: ModelGenerator.C:63
virtual bool createTopologySets(SIMinput &sim) const
Creates topology sets for the specified sim object.
Definition: ModelGenerator.C:111
DefaultGeometry1D(const tinyxml2::XMLElement *geo)
The constructor forwards to the base class.
Definition: ModelGenerator.h:69
virtual ~DefaultGeometry1D()
Empty destructor.
Definition: ModelGenerator.h:71
Default model generator for 2D FEM simulators.
Definition: ModelGenerator.h:88
virtual ~DefaultGeometry2D()
Empty destructor.
Definition: ModelGenerator.h:93
DefaultGeometry2D(const tinyxml2::XMLElement *geo)
The constructor forwards to the base class.
Definition: ModelGenerator.h:91
virtual std::string createG2(int nsd, bool rational=false) const
Generates the G2 description of the geometry.
Definition: ModelGenerator.C:127
virtual bool createTopologySets(SIMinput &sim) const
Creates topology sets for the specified sim object.
Definition: ModelGenerator.C:184
Default model generator for 3D FEM simulators.
Definition: ModelGenerator.h:110
DefaultGeometry3D(const tinyxml2::XMLElement *geo)
The constructor forwards to the base class.
Definition: ModelGenerator.h:113
virtual ~DefaultGeometry3D()
Empty destructor.
Definition: ModelGenerator.h:115
virtual bool createTopologySets(SIMinput &sim) const
Creates topology sets for the specified sim object.
Definition: ModelGenerator.C:273
virtual std::string createG2(int, bool rational=false) const
Generates the G2 description of the geometry.
Definition: ModelGenerator.C:203
Base class for model generators for FEM simulators.
Definition: ModelGenerator.h:29
virtual bool createTopology(SIMinput &) const
Creates topology for multi-patch geometries.
Definition: ModelGenerator.h:44
ModelGenerator(const tinyxml2::XMLElement *elem)
The constructor initializes the common members.
Definition: ModelGenerator.h:33
const tinyxml2::XMLElement * geo
Pointer to XML element describing geometry.
Definition: ModelGenerator.h:56
virtual bool createGeometry(SIMinput &sim) const
Creates geometry for the specified sim object..
Definition: ModelGenerator.C:53
virtual bool createTopologySets(SIMinput &sim) const =0
Creates topology sets for the specified sim object.
virtual ~ModelGenerator()
Empty destructor.
Definition: ModelGenerator.h:35
virtual std::string createG2(int nsd, bool rational) const
Generates the G2 description of the geometry.
Definition: ModelGenerator.h:50
bool topologySets() const
Returns true if topology sets is to be generated.
Definition: ModelGenerator.C:46
Sub-class with functionality for model input and setup.
Definition: SIMinput.h:37