Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Mesh.hpp
Go to the documentation of this file.
1 /* Generated by Together */
2 
3 #ifndef MESH_H
4 #define MESH_H
5 #include <iostream.h>
6 #include "general.hpp"
7 
8 class Element;
9 class Face;
10 class Node;
11 class ElementList;
12 
19 class Mesh {
20 public:
21 
22  Mesh();
23  ~Mesh();
24 
30  void addNode(Node* node);
31  void addFace(Face* face);
32  void addElement(Element* element);
33  void removeNode(Node* node);
34  void removeFace(Face* face);
35  void removeElement(Element* element);
36 
47  Node* getNode(int ID);
48  Face* getFace(int ID);
49  Element* getElement(int ID);
50 
56  int getNumNodes();
57  int getNumFaces();
58  int getNumElements();
59 
69  boolean addCohesive( int material1, int material2, int new_material=-1 );
70 
71  void replaceNode( Node* node, Node* new_node,
72  ElementList *sep_elements, int new_material );
73 
81  friend istream & operator>>(istream & stream, Mesh & mesh);
82 
91  friend ostream & operator<<(ostream & stream, Mesh & mesh);
92 
93  void write_boundary(ostream & stream);
94 
95 private:
96  double calcEdgeLength(int elementID);
97  double getMinEdge();
98  void setMinEdge(double me);
99 
106 
111 
117 
124 
132 
133  double minEdge;
134 };
135 
136 
137 inline Node* Mesh::getNode(int ID)
138 { return d_nodes[ID-1]; }
139 
140 inline Face* Mesh::getFace(int ID)
141 {return d_faces[ID-1];}
142 
143 inline Element* Mesh::getElement(int ID)
144 { return d_elements[ID-1];}
145 
146 inline int Mesh::getNumNodes()
147 { return d_numNodes; }
148 
149 inline int Mesh::getNumFaces()
150 { return d_numFaces; }
151 
153 { return d_numElements; }
154 
155 inline double Mesh::getMinEdge()
156 { return minEdge; }
157 
158 inline void Mesh::setMinEdge(double me)
159 { minEdge = me ; }
160 
161 #endif //MESH_H
void addFace(Face *face)
Definition: Mesh.cpp:96
int d_numFaces
Definition: Mesh.hpp:122
int getNumNodes()
The following get methods return the number of nodes, faces, or elements currently in the model...
Definition: Mesh.hpp:146
Face ** d_faces
1..*
Definition: Mesh.hpp:121
This class encapsulate a node over a window manifold.
Definition: Manifold_2.h:370
Definition: face.h:90
~Mesh()
Definition: Mesh.cpp:32
void removeNode(Node *node)
Definition: Mesh.cpp:77
int d_faceArraySize
Definition: Mesh.hpp:123
boolean addCohesive(int material1, int material2, int new_material=-1)
The addCohesive method is the driver for the entire process of adding cohesive elements to the mesh...
Definition: Mesh.cpp:167
void addNode(Node *node)
The following add/remove/get methods are utility methods to add, remove, or return instances of nodes...
Definition: Mesh.cpp:60
Class Mesh is the main class that holds all information to describe the current state of the mesh...
Definition: Mesh.hpp:19
int d_numElements
Definition: Mesh.hpp:130
int d_nodeArraySize
The current size of the nodes array (must be as big or bigger than numNodes).
Definition: Mesh.hpp:116
Definition: adj.h:150
Node ** d_nodes
An ordered array of all nodes in the mesh.
Definition: Mesh.hpp:105
double calcEdgeLength(int elementID)
Definition: Mesh.cpp:396
void addElement(Element *element)
Definition: Mesh.cpp:131
void removeElement(Element *element)
Definition: Mesh.cpp:148
int getNumElements()
Definition: Mesh.hpp:152
Element ** d_elements
Array of all the Elements in the mesh.
Definition: Mesh.hpp:129
void replaceNode(Node *node, Node *new_node, ElementList *sep_elements, int new_material)
Definition: Mesh.cpp:245
double minEdge
Definition: Mesh.hpp:133
int getNumFaces()
Definition: Mesh.hpp:149
void setMinEdge(double me)
Definition: Mesh.hpp:158
int d_numNodes
The number of Nodes in the nodes array.
Definition: Mesh.hpp:110
Node * getNode(int ID)
The following get methods return a node, face or element.
Definition: Mesh.hpp:137
void removeFace(Face *face)
Definition: Mesh.cpp:112
Mesh()
Definition: Mesh.cpp:14
Face * getFace(int ID)
Definition: Mesh.hpp:140
friend istream & operator>>(istream &stream, Mesh &mesh)
The mesh instream operator is used to drive the reading of the one input file to the code...
Definition: Mesh.cpp:402
int d_elementArraySize
Definition: Mesh.hpp:131
friend ostream & operator<<(ostream &stream, Mesh &mesh)
The mesh ostream operator is used to drive the writing of both output fils from the code...
Definition: Mesh.cpp:359
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
void write_boundary(ostream &stream)
Definition: Mesh.cpp:507
double getMinEdge()
Definition: Mesh.hpp:155
Element * getElement(int ID)
Definition: Mesh.hpp:143