Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Face Class Referenceabstract

The Face class is an abstract base class that supplies implemented general methods, as well as a vew virtual interface methods to child classes. More...

#include <Face.hpp>

Inheritance diagram for Face:
Collaboration diagram for Face:

Public Types

enum  Type { e_tri, e_quad, e_MAX_TYPE }
 
enum  eType {
  e_tet, e_hex, e_tri_cohesive, e_quad_cohesive,
  e_MAX_ELEMENT_TYPE
}
 

Public Member Functions

 Face (Type type)
 Constructor: set type & reset params. More...
 
 Face ()
 
 ~Face ()
 Destructor. More...
 
void setID (int theID)
 Sets the serial ID for the face. More...
 
int getID () const
 Returns the serial ID of the face. More...
 
void setFlag (int theFlag)
 Sets the flag for the face. More...
 
int getFlag () const
 Gets the flag for the face. More...
 
virtual int getNumNodes () const =0
 Retrieves the number of nodes that make up the face. More...
 
Node ** getNodes ()
 Returns the array of nodes. More...
 
void setElement1 (Element *elem1)
 Sets the pointer to the first element that this face is associated with. More...
 
ElementgetElement1 ()
 Get the pointer to the first element that this face is associated with. More...
 
void setElement2 (Element *elem2)
 Sets the pointer to the second element that this face is associated with. More...
 
ElementgetElement2 ()
 Get the pointer to the second element that this face is associated with. More...
 
void addElement (Element *theElement)
 
void removeElement (Element *theElement)
 
Type getFaceType () const
 Returns the face type of this face (see the Type attribute of the Face class). More...
 
boolean isExterior () const
 
virtual ElementbuildCohesive (Element *side_elem, Node *node, Node *new_node)=0
 
void replaceNode (Node *node, Node *new_node)
 
boolean containsNode (Node *node) const
 

Static Public Member Functions

static Facecreate (eType type)
 
static void setMesh (Mesh *emesh)
 

Protected Attributes

int d_ID
 Serial ID assigned to this face. More...
 
int d_flag
 User-defined integer flag assigned to this face. More...
 
Elementd_E1
 Pointer to the first element that this face is associated with. More...
 
Elementd_E2
 The second element that this face is associated with. More...
 
Node ** d_nodes
 Array of nodes assigned to this face. More...
 
Type d_eType
 The Type of face (triangular or square for now). More...
 

Static Protected Attributes

static Meshs_mesh = 0
 

Friends

istream & operator>> (istream &stream, Face &face)
 
ostream & operator<< (ostream &stream, Face &face)
 

Detailed Description

The Face class is an abstract base class that supplies implemented general methods, as well as a vew virtual interface methods to child classes.

It represents one face of a mesh element. It knows the nodes that make it up, and the elements that it is a part of. It knows whether or not it is on the surface of the mesh.

Author
Mark Brandyberry
Version
1.0
Since
2001

Definition at line 19 of file Face.hpp.

Member Enumeration Documentation

enum eType
Enumerator
e_tet 
e_hex 
e_tri_cohesive 
e_quad_cohesive 
e_MAX_ELEMENT_TYPE 

Definition at line 24 of file Face.hpp.

24  {
25  e_tet, // 0
26  e_hex, // 1
27  e_tri_cohesive, // 2
28  e_quad_cohesive, // 3
30  };
enum Type
Enumerator
e_tri 
e_quad 
e_MAX_TYPE 

Definition at line 22 of file Face.hpp.

Constructor & Destructor Documentation

Face ( Face::Type  ftype)

Constructor: set type & reset params.

Definition at line 10 of file Face.cpp.

10  :
11  d_ID(-1),
12  d_flag(-1),
13  d_E1(0),
14  d_E2(0),
15  d_nodes(0),
16  d_eType( ftype )
17 {}
Element * d_E2
The second element that this face is associated with.
Definition: Face.hpp:154
Element * d_E1
Pointer to the first element that this face is associated with.
Definition: Face.hpp:147
int d_ID
Serial ID assigned to this face.
Definition: Face.hpp:136
int d_flag
User-defined integer flag assigned to this face.
Definition: Face.hpp:141
Node ** d_nodes
Array of nodes assigned to this face.
Definition: Face.hpp:161
Type d_eType
The Type of face (triangular or square for now).
Definition: Face.hpp:166
Face ( )

Definition at line 19 of file Face.cpp.

19  :
20  d_ID(-1),
21  d_flag(-1),
22  d_E1(0),
23  d_E2(0),
24  d_nodes(0)
25 {}
Element * d_E2
The second element that this face is associated with.
Definition: Face.hpp:154
Element * d_E1
Pointer to the first element that this face is associated with.
Definition: Face.hpp:147
int d_ID
Serial ID assigned to this face.
Definition: Face.hpp:136
int d_flag
User-defined integer flag assigned to this face.
Definition: Face.hpp:141
Node ** d_nodes
Array of nodes assigned to this face.
Definition: Face.hpp:161
~Face ( )

Destructor.

when here face should not be in any element

Definition at line 27 of file Face.cpp.

References d_nodes.

27  {
28 
29  if( d_nodes ){
30  delete [] d_nodes;
31  }
32 }
Node ** d_nodes
Array of nodes assigned to this face.
Definition: Face.hpp:161

Member Function Documentation

void addElement ( Element theElement)
inline

Definition at line 200 of file Face.hpp.

References d_E1, and d_E2.

Referenced by Element::setFace().

200  {
201  if( d_E1 ){
202  d_E2 = theElement;
203  }
204  else {
205  d_E1 = theElement;
206  }
207 }
Element * d_E2
The second element that this face is associated with.
Definition: Face.hpp:154
Element * d_E1
Pointer to the first element that this face is associated with.
Definition: Face.hpp:147

Here is the caller graph for this function:

virtual Element* buildCohesive ( Element side_elem,
Node node,
Node new_node 
)
pure virtual

Implemented in QuadFace, and TriFace.

Referenced by Mesh::replaceNode().

Here is the caller graph for this function:

boolean containsNode ( Node node) const

Definition at line 108 of file Face.cpp.

References d_nodes, FALSE, getNumNodes(), i, and TRUE.

Referenced by Mesh::replaceNode().

108  {
109 
110  int i;
111  int numn = getNumNodes();
112  for( i = 0; i< numn; i++ ){
113  if( d_nodes[i] == node ){
114  return TRUE;
115  }
116  }
117  return FALSE;
118 }
#define FALSE
Definition: vinci.h:133
blockLoc i
Definition: read.cpp:79
#define TRUE
Definition: vinci.h:134
Node ** d_nodes
Array of nodes assigned to this face.
Definition: Face.hpp:161
virtual int getNumNodes() const =0
Retrieves the number of nodes that make up the face.

Here is the call graph for this function:

Here is the caller graph for this function:

Face * create ( Face::eType  type)
static

Definition at line 34 of file Face.cpp.

References e_hex, e_quad_cohesive, e_tet, e_tri_cohesive, and face.

Referenced by operator>>().

34  {
35 
36  Face *face;
37 
38  switch( type ){
39  case e_hex:
40  face = new QuadFace();
41  break;
42  case e_tet:
43  face = new TriFace();
44  break;
45  case e_tri_cohesive:
46  face = new TriFace();
47  break;
48  case e_quad_cohesive:
49  face = new QuadFace();
50  break;
51  default:
52  cerr << "BUG: Illegal element type in Face::create " << type << endl;
53  }
54 
55  return face;
56 }
static T_VertexSet * face
Definition: vinci_lass.c:79
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

Here is the caller graph for this function:

Element * getElement1 ( )
inline

Get the pointer to the first element that this face is associated with.

Definition at line 191 of file Face.hpp.

References d_E1.

Referenced by Mesh::addCohesive(), Node::getSeparateElements(), Mesh::replaceNode(), and Mesh::write_boundary().

192 { return d_E1; }
Element * d_E1
Pointer to the first element that this face is associated with.
Definition: Face.hpp:147

Here is the caller graph for this function:

Element * getElement2 ( )
inline

Get the pointer to the second element that this face is associated with.

Definition at line 197 of file Face.hpp.

References d_E2.

Referenced by Mesh::addCohesive(), Node::getSeparateElements(), and Mesh::replaceNode().

198 { return d_E2; }
Element * d_E2
The second element that this face is associated with.
Definition: Face.hpp:154

Here is the caller graph for this function:

Face::Type getFaceType ( ) const
inline

Returns the face type of this face (see the Type attribute of the Face class).

Definition at line 209 of file Face.hpp.

References d_eType.

210 { return d_eType; }
Type d_eType
The Type of face (triangular or square for now).
Definition: Face.hpp:166
int getFlag ( ) const
inline

Gets the flag for the face.

Will return -1 if it was not set.

Definition at line 182 of file Face.hpp.

References d_flag.

Referenced by Mesh::write_boundary().

183 { return d_flag; }
int d_flag
User-defined integer flag assigned to this face.
Definition: Face.hpp:141

Here is the caller graph for this function:

int getID ( ) const
inline

Returns the serial ID of the face.

Will return -1 if it was not set.

Definition at line 176 of file Face.hpp.

References d_ID.

177 { return d_ID; }
int d_ID
Serial ID assigned to this face.
Definition: Face.hpp:136
Node ** getNodes ( )
inline

Returns the array of nodes.

Definition at line 185 of file Face.hpp.

References d_nodes.

Referenced by Mesh::addCohesive(), operator>>(), and Node::sharedFace().

186 { return d_nodes; }
Node ** d_nodes
Array of nodes assigned to this face.
Definition: Face.hpp:161

Here is the caller graph for this function:

virtual int getNumNodes ( ) const
pure virtual

Retrieves the number of nodes that make up the face.

Will be either three or four depending upon the face type.

Implemented in QuadFace, and TriFace.

Referenced by Mesh::addCohesive(), containsNode(), operator>>(), replaceNode(), and Node::sharedFace().

Here is the caller graph for this function:

boolean isExterior ( ) const
inline

Definition at line 212 of file Face.hpp.

References d_E2, FALSE, and TRUE.

213 { return (d_E2 == 0 ? TRUE : FALSE); }
#define FALSE
Definition: vinci.h:133
Element * d_E2
The second element that this face is associated with.
Definition: Face.hpp:154
#define TRUE
Definition: vinci.h:134
void removeElement ( Element theElement)

Definition at line 81 of file Face.cpp.

References d_E1, and d_E2.

Referenced by HexElement::~HexElement(), QCoElement::~QCoElement(), TCoElement::~TCoElement(), and TetElement::~TetElement().

81  {
82 
83  if( theElement == d_E1 ){
84  d_E1 = d_E2;
85  d_E2 = 0;
86  }
87  else if( theElement == d_E2 ){
88  d_E2 = 0;
89  }
90 }
Element * d_E2
The second element that this face is associated with.
Definition: Face.hpp:154
Element * d_E1
Pointer to the first element that this face is associated with.
Definition: Face.hpp:147

Here is the caller graph for this function:

void replaceNode ( Node node,
Node new_node 
)

Definition at line 93 of file Face.cpp.

References Node::addFace(), d_nodes, getNumNodes(), i, and Node::removeFace().

Referenced by QCoElement::replaceFaceNode(), TCoElement::replaceFaceNode(), and Element::replaceNode().

93  {
94 
95  int i;
96  int numn = getNumNodes();
97  for( i = 0; i< numn; i++ ){
98  if( d_nodes[i] == node ){
99  d_nodes[i] = new_node;
100  node->removeFace( this );
101  new_node->addFace( this );
102  }
103  }
104 }
void addFace(Face *face)
Definition: Node.cpp:55
blockLoc i
Definition: read.cpp:79
Node ** d_nodes
Array of nodes assigned to this face.
Definition: Face.hpp:161
void removeFace(Face *face)
Definition: Node.cpp:70
virtual int getNumNodes() const =0
Retrieves the number of nodes that make up the face.

Here is the call graph for this function:

Here is the caller graph for this function:

void setElement1 ( Element elem1)
inline

Sets the pointer to the first element that this face is associated with.

Definition at line 188 of file Face.hpp.

References d_E1.

189 { d_E1 = elem1; }
Element * d_E1
Pointer to the first element that this face is associated with.
Definition: Face.hpp:147
void setElement2 ( Element elem2)
inline

Sets the pointer to the second element that this face is associated with.

Definition at line 194 of file Face.hpp.

References d_E2.

195 { d_E2 = elem2; }
Element * d_E2
The second element that this face is associated with.
Definition: Face.hpp:154
void setFlag ( int  theFlag)
inline

Sets the flag for the face.

Will return -1 if it was not set.

Definition at line 179 of file Face.hpp.

References d_flag.

Referenced by operator>>().

180 { d_flag = theFlag; }
int d_flag
User-defined integer flag assigned to this face.
Definition: Face.hpp:141

Here is the caller graph for this function:

void setID ( int  theID)
inline

Sets the serial ID for the face.

Definition at line 173 of file Face.hpp.

References d_ID.

Referenced by Mesh::addFace(), and Mesh::removeFace().

174 { d_ID = theID; }
int d_ID
Serial ID assigned to this face.
Definition: Face.hpp:136

Here is the caller graph for this function:

void setMesh ( Mesh emesh)
inlinestatic

Definition at line 215 of file Face.hpp.

References s_mesh.

Referenced by Mesh::Mesh().

216 { s_mesh = fmesh; }
static Mesh * s_mesh
Definition: Face.hpp:168

Here is the caller graph for this function:

Friends And Related Function Documentation

ostream& operator<< ( ostream &  stream,
Face face 
)
friend

Definition at line 59 of file Face.cpp.

59  {
60 
61  return stream;
62 }
istream& operator>> ( istream &  stream,
Face face 
)
friend

Definition at line 64 of file Face.cpp.

64  {
65 
66  // read nodes & set
67 
68  int numn = face.getNumNodes();
69  int i;
70  for( i = 0; i < numn; i++ ){
71  int node_id;
72  stream >> node_id;
73  Node *node = face.s_mesh->getNode(node_id);
74  face.d_nodes[i] = node;
75  }
76 
77  return stream;
78 
79 }
static Mesh * s_mesh
Definition: Face.hpp:168
This class encapsulate a node over a window manifold.
Definition: Manifold_2.h:370
Definition: adj.h:150
blockLoc i
Definition: read.cpp:79
Node * getNode(int ID)
The following get methods return a node, face or element.
Definition: Mesh.hpp:137
Node ** d_nodes
Array of nodes assigned to this face.
Definition: Face.hpp:161
virtual int getNumNodes() const =0
Retrieves the number of nodes that make up the face.

Member Data Documentation

Element* d_E1
protected

Pointer to the first element that this face is associated with.

A face will always have at least one element.

Definition at line 147 of file Face.hpp.

Referenced by addElement(), TriFace::buildCohesive(), QuadFace::buildCohesive(), getElement1(), removeElement(), and setElement1().

Element* d_E2
protected

The second element that this face is associated with.

This element will be Null if the face is an exterior face. This face will have a normal opposite of the one for the element in E2.

Definition at line 154 of file Face.hpp.

Referenced by addElement(), TriFace::buildCohesive(), QuadFace::buildCohesive(), getElement2(), isExterior(), removeElement(), and setElement2().

Type d_eType
protected

The Type of face (triangular or square for now).

Definition at line 166 of file Face.hpp.

Referenced by getFaceType().

int d_flag
protected

User-defined integer flag assigned to this face.

Definition at line 141 of file Face.hpp.

Referenced by getFlag(), and setFlag().

int d_ID
protected

Serial ID assigned to this face.

Definition at line 136 of file Face.hpp.

Referenced by getID(), and setID().

Node** d_nodes
protected

Array of nodes assigned to this face.

The number of nodes will depend on the type of face.

Definition at line 161 of file Face.hpp.

Referenced by TriFace::buildCohesive(), QuadFace::buildCohesive(), containsNode(), getNodes(), operator>>(), QuadFace::QuadFace(), replaceNode(), TriFace::TriFace(), ~Face(), QuadFace::~QuadFace(), and TriFace::~TriFace().

Mesh * s_mesh = 0
staticprotected

Definition at line 168 of file Face.hpp.

Referenced by operator>>(), and setMesh().


The documentation for this class was generated from the following files: