Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Element.hpp
Go to the documentation of this file.
1 /* Generated by Together */
2 
3 #ifndef ELEMENT_H
4 #define ELEMENT_H
5 
6 #include <iostream.h>
7 #include "Face.hpp"
8 
9 class Node;
10 class Mesh;
11 
12 class Element {
13 public:
14 
15  enum Type {
16  e_tet, // 0
17  e_hex, // 1
21  };
22 
23  enum fType {e_tri, //0
24  e_quad, //1
26 
27  //static fType getFaceType(Element::Type type);
28 
31  };
32 
33  Element( Type type);
34 
35  ~Element();
36 
37  static Element* create( int id, Type type );
38 
39 
40  static void setMesh( Mesh* emesh );
41 
42  int getID() const;
43 
44  void setID(int theID);
45 
46  virtual int getNumNodes() const = 0;
47  Node** getNodes();
48 
49  virtual int getNumFaces() const = 0;
50  Face** getFaces();
51 
52  Type getElementType() const;
53 
54  boolean isCohesive() const;
55 
56 
57  int getMaterialType() const;
58  void setMaterialType( int mtype );
59 
60  virtual void setFromNodes(Node ** thenodes);
61 
62  void replaceNode (Node *node, Node *new_node);
63 
64  void replaceFace (Face *face, Face *new_face);
65 
66  virtual void replaceFaceNode (Node *node, Node *new_node, Face* face );
67 
68  virtual double getMinEdgeLength();
69 
70  friend istream& operator>>(istream& stream, Element& elem);
71 
72  friend ostream& operator<<(ostream& stream, Element& elem);
73 
74 protected:
75 
76  virtual void setFromMyNodes() = 0;
77 
78  virtual void setFaceFromNodes(int num, Node** nodes) = 0;
79 
80  void setFace(int num, Face* face);
81 
83 
84  int d_ID;
85 
88 
90 
91  static Mesh* s_mesh;
92 
93 
94 
95 };
96 
97 inline int Element::getID() const
98 { return d_ID; }
99 
100 inline void Element::setID(int theID)
101 { d_ID = theID; }
102 
104 { return d_nodes; }
105 
107 { return d_faces; }
108 
110 { return d_eType; }
111 
112 inline boolean Element::isCohesive() const {
113  return ( d_eType == e_tri_cohesive || d_eType == e_quad_cohesive
114  ? TRUE
115  : FALSE );
116 }
117 
118 inline int Element::getMaterialType() const
119 { return d_materialType; }
120 
121 inline void Element::setMaterialType( int mtype )
122 { d_materialType = mtype; }
123 
124 inline void Element::setMesh( Mesh* emesh )
125 { s_mesh = emesh; }
126 
127 inline void Element::setFace(int num, Face* face){
128  d_faces[num] = face;
129  face->addElement( this );
130 }
131 
132 #endif //ELEMENT_H
133 
#define FALSE
Definition: vinci.h:133
Face ** d_faces
Definition: Element.hpp:87
virtual void replaceFaceNode(Node *node, Node *new_node, Face *face)
Definition: Element.cpp:168
virtual int getNumNodes() const =0
static Element * create(int id, Type type)
Definition: Element.cpp:35
friend istream & operator>>(istream &stream, Element &elem)
Definition: Element.cpp:70
int getMaterialType() const
Definition: Element.hpp:118
int d_ID
Definition: Element.hpp:84
This class encapsulate a node over a window manifold.
Definition: Manifold_2.h:370
Definition: face.h:90
Type d_eType
Definition: Element.hpp:82
friend ostream & operator<<(ostream &stream, Element &elem)
Definition: Element.cpp:91
void addElement(Element *theElement)
Definition: Face.hpp:200
void replaceNode(Node *node, Node *new_node)
Definition: Element.cpp:138
void setMaterialType(int mtype)
Definition: Element.hpp:121
Class Mesh is the main class that holds all information to describe the current state of the mesh...
Definition: Mesh.hpp:19
Node ** d_nodes
Definition: Element.hpp:86
Definition: adj.h:150
virtual int getNumFaces() const =0
virtual void setFaceFromNodes(int num, Node **nodes)=0
virtual void setFromMyNodes()=0
Face ** getFaces()
Definition: Element.hpp:106
virtual void setFromNodes(Node **thenodes)
Definition: Element.cpp:59
Element(Type type)
Definition: Element.cpp:17
#define TRUE
Definition: vinci.h:134
void setID(int theID)
Definition: Element.hpp:100
static Mesh * s_mesh
Definition: Element.hpp:91
virtual double getMinEdgeLength()
Definition: Element.cpp:173
int getID() const
Definition: Element.hpp:97
static void setMesh(Mesh *emesh)
Definition: Element.hpp:124
boolean isCohesive() const
Definition: Element.hpp:112
static T_VertexSet * face
Definition: vinci_lass.c:79
~Element()
Definition: Element.cpp:25
Type getElementType() const
Definition: Element.hpp:109
Node ** getNodes()
Definition: Element.hpp:103
void setFace(int num, Face *face)
Definition: Element.hpp:127
void replaceFace(Face *face, Face *new_face)
Definition: Element.cpp:155
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
int d_materialType
Definition: Element.hpp:89
MaterialType
Definition: Element.hpp:29