Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Face.hpp
Go to the documentation of this file.
1 /* Generated by Together */
2 
3 #ifndef FACE_H
4 #define FACE_H
5 #include "Node.hpp"
6 class Element;
7 class MVec;
8 
19 class Face {
20 public:
21  //face types
23 
24  enum eType {
25  e_tet, // 0
26  e_hex, // 1
30  };
31  // static int numFaceNodes(Type type);
32 
36  Face(Type type);
37 
38  Face();
39 
44  ~Face();
45 
46 
47  static Face* create(eType type);
48 
49  static void setMesh( Mesh* emesh );
50 
54  void setID(int theID);
55 
59  int getID() const;
60 
61 
65  void Face::setFlag(int theFlag);
66 
70  int Face::getFlag() const;
71 
72 
77  virtual int getNumNodes() const =0;
78 
82  Node** getNodes();
83 
84 
88  void setElement1(Element* elem1);
89 
94 
98  void setElement2(Element* elem2);
99 
100 
104  Element* getElement2();
105 
106 
107  void addElement(Element * theElement);
108 
109  void removeElement(Element * theElement);
110 
115  Type getFaceType() const;
116 
117  boolean isExterior() const;
118 
119  virtual Element* buildCohesive( Element* side_elem, Node* node,
120  Node* new_node ) = 0;
121 
122  void replaceNode (Node *node, Node *new_node );
123 
124  boolean containsNode( Node* node ) const;
125 
126  friend istream& operator>>(istream& stream, Face& face);
127 
128  friend ostream& operator<<(ostream& stream, Face& face);
129 
130 
131 protected:
132 
136  int d_ID;
137 
141  int d_flag;
142 
148 
155 
156 
162 
167 
168  static Mesh* s_mesh;
169 };
170 
171 #include "Element.hpp"
172 
173 inline void Face::setID(int theID)
174 { d_ID = theID; }
175 
176 inline int Face::getID() const
177 { return d_ID; }
178 
179 inline void Face::setFlag(int theFlag)
180 { d_flag = theFlag; }
181 
182 inline int Face::getFlag() const
183 { return d_flag; }
184 
186 { return d_nodes; }
187 
188 inline void Face::setElement1(Element* elem1)
189 { d_E1 = elem1; }
190 
192 { return d_E1; }
193 
194 inline void Face::setElement2(Element* elem2)
195 { d_E2 = elem2; }
196 
198 { return d_E2; }
199 
200 inline void Face::addElement(Element * theElement){
201  if( d_E1 ){
202  d_E2 = theElement;
203  }
204  else {
205  d_E1 = theElement;
206  }
207 }
208 
210 { return d_eType; }
211 
212 inline boolean Face::isExterior() const
213 { return (d_E2 == 0 ? TRUE : FALSE); }
214 
215 inline void Face::setMesh( Mesh* fmesh )
216 { s_mesh = fmesh; }
217 
218 #endif //FACE_H
219 
220 
#define FALSE
Definition: vinci.h:133
static Mesh * s_mesh
Definition: Face.hpp:168
void setFlag(int theFlag)
Sets the flag for the face.
Definition: Face.hpp:179
void replaceNode(Node *node, Node *new_node)
Definition: Face.cpp:93
This class encapsulate a node over a window manifold.
Definition: Manifold_2.h:370
Definition: face.h:90
static Face * create(eType type)
Definition: Face.cpp:34
void addElement(Element *theElement)
Definition: Face.hpp:200
Definition: MVec.hpp:8
Element * d_E2
The second element that this face is associated with.
Definition: Face.hpp:154
Element * getElement2()
Get the pointer to the second element that this face is associated with.
Definition: Face.hpp:197
Type getFaceType() const
Returns the face type of this face (see the Type attribute of the Face class).
Definition: Face.hpp:209
int getFlag() const
Gets the flag for the face.
Definition: Face.hpp:182
Element * d_E1
Pointer to the first element that this face is associated with.
Definition: Face.hpp:147
friend istream & operator>>(istream &stream, Face &face)
Definition: Face.cpp:64
Class Mesh is the main class that holds all information to describe the current state of the mesh...
Definition: Mesh.hpp:19
Definition: adj.h:150
boolean containsNode(Node *node) const
Definition: Face.cpp:108
friend ostream & operator<<(ostream &stream, Face &face)
Definition: Face.cpp:59
boolean isExterior() const
Definition: Face.hpp:212
~Face()
Destructor.
Definition: Face.cpp:27
int getID() const
Returns the serial ID of the face.
Definition: Face.hpp:176
int d_ID
Serial ID assigned to this face.
Definition: Face.hpp:136
virtual Element * buildCohesive(Element *side_elem, Node *node, Node *new_node)=0
void removeElement(Element *theElement)
Definition: Face.cpp:81
#define TRUE
Definition: vinci.h:134
Type
Definition: Face.hpp:22
Node ** getNodes()
Returns the array of nodes.
Definition: Face.hpp:185
Face()
Definition: Face.cpp:19
static void setMesh(Mesh *emesh)
Definition: Face.hpp:215
int d_flag
User-defined integer flag assigned to this face.
Definition: Face.hpp:141
void setID(int theID)
Sets the serial ID for the face.
Definition: Face.hpp:173
Node ** d_nodes
Array of nodes assigned to this face.
Definition: Face.hpp:161
void setElement1(Element *elem1)
Sets the pointer to the first element that this face is associated with.
Definition: Face.hpp:188
The Face class is an abstract base class that supplies implemented general methods, as well as a vew virtual interface methods to child classes.
Definition: Face.hpp:19
Element * getElement1()
Get the pointer to the first element that this face is associated with.
Definition: Face.hpp:191
eType
Definition: Face.hpp:24
void setElement2(Element *elem2)
Sets the pointer to the second element that this face is associated with.
Definition: Face.hpp:194
virtual int getNumNodes() const =0
Retrieves the number of nodes that make up the face.
Type d_eType
The Type of face (triangular or square for now).
Definition: Face.hpp:166