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

#include <TriFace.hpp>

Inheritance diagram for TriFace:
Collaboration diagram for TriFace:

Public Member Functions

 TriFace (Node **theNodes)
 Builds the TriFace object from an array of three nodes. More...
 
 TriFace ()
 
 ~TriFace ()
 Destructor. More...
 
virtual int getNumNodes () const
 Returns the number of nodes for this type of face (three for the triangular face). More...
 
virtual ElementbuildCohesive (Element *side_elem, Node *node, Node *new_node)
 
- Public Member Functions inherited from Face
 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...
 
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
 
void replaceNode (Node *node, Node *new_node)
 
boolean containsNode (Node *node) const
 

Additional Inherited Members

- Public Types inherited from Face
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
}
 
- Static Public Member Functions inherited from Face
static Facecreate (eType type)
 
static void setMesh (Mesh *emesh)
 
- Protected Attributes inherited from Face
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 inherited from Face
static Meshs_mesh = 0
 

Detailed Description

Definition at line 8 of file TriFace.hpp.

Constructor & Destructor Documentation

TriFace ( Node **  theNodes)

Builds the TriFace object from an array of three nodes.

The element(s) must be set later with the setElement methods.

Definition at line 6 of file TriFace.cpp.

References Node::addFace(), Face::d_nodes, and i.

6  :
7  Face( e_tri )
8 {
9  d_nodes = new Node*[3];
10  int i;
11  for( i = 0; i < 3; i++ ){
12  d_nodes[i] = theNodes[i];
13  d_nodes[i]->addFace( this );
14  }
15 }
This class encapsulate a node over a window manifold.
Definition: Manifold_2.h:370
void addFace(Face *face)
Definition: Node.cpp:55
blockLoc i
Definition: read.cpp:79
Face()
Definition: Face.cpp:19
Node ** d_nodes
Array of nodes assigned to this face.
Definition: Face.hpp:161

Here is the call graph for this function:

TriFace ( )

Definition at line 17 of file TriFace.cpp.

References Face::d_nodes, and i.

17  {
18  d_nodes = new Node*[3];
19  int i;
20  for (i=0; i<3; i++) d_nodes[i]=0;
21 }
This class encapsulate a node over a window manifold.
Definition: Manifold_2.h:370
blockLoc i
Definition: read.cpp:79
Node ** d_nodes
Array of nodes assigned to this face.
Definition: Face.hpp:161
~TriFace ( )

Destructor.

Definition at line 23 of file TriFace.cpp.

References Face::d_nodes, i, and Node::removeFace().

23  {
24  int i;
25  for( i = 0; i < 3; i++ ){
26  d_nodes[i]->removeFace( this );
27  }
28 }
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

Here is the call graph for this function:

Member Function Documentation

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

Implements Face.

Definition at line 34 of file TriFace.cpp.

References Face::d_E1, Face::d_E2, Face::d_nodes, Element::getFaces(), i, and Element::replaceFace().

35  {
36 
37  int ind=-1;
38  int i;
39  for( i = 0; i < 3; i++ ){
40  if( d_nodes[i] == node ){
41  ind = i;
42  break;
43  }
44  }
45  Element* coelem;
46 
47  Node* new_nodes[6];
48 
49  //the order of the second three nodes looks wrong - need to assess and
50  //correct if so. Order should be 1,2,3, and 4,5,6 with 4 corresponding to
51  //3 and not to 1.
52 
53  //Note: when a cohesive element is made, it always has two doubled node
54  //numbers: when do they get updated?
55 
56  if( d_E1 == side_elem ){ // normal to side
57  new_nodes[0] = d_nodes[0];
58  new_nodes[1] = d_nodes[1];
59  new_nodes[2] = d_nodes[2];
60  new_nodes[3] = (ind == 0 ? new_node : d_nodes[0] );
61  new_nodes[4] = (ind == 1 ? new_node : d_nodes[1] );
62  new_nodes[5] = (ind == 2 ? new_node : d_nodes[2] );
63  d_E1 = d_E2;
64  d_E2 = 0;
65  coelem = new TCoElement( new_nodes );
66  // now for this face set E1 to the coelem
67  d_E2 = d_E1;
68  d_E1 = coelem;
69  Face* oface = coelem->getFaces()[1];
70  ((TriFace*)oface)->d_E2 = side_elem;
71  side_elem->replaceFace( this, oface );
72  }
73  else { // normal to the other side
74  d_E2 = 0;
75  new_nodes[0] = (ind == 0 ? new_node : d_nodes[0] );
76  new_nodes[1] = (ind == 1 ? new_node : d_nodes[1] );
77  new_nodes[2] = (ind == 2 ? new_node : d_nodes[2] );
78  new_nodes[3] = d_nodes[0];
79  new_nodes[4] = d_nodes[1];
80  new_nodes[5] = d_nodes[2];
81  coelem = new TCoElement( new_nodes );
82  // now for the new face set E2 to side_elem (will correct the nodes later)
83  Face* oface = coelem->getFaces()[0];
84  ((TriFace*)oface)->d_E2 = side_elem;
85  side_elem->replaceFace( this, oface );
86  }
87  return coelem;
88 }
This class encapsulate a node over a window manifold.
Definition: Manifold_2.h:370
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
Face ** getFaces()
Definition: Element.hpp:106
blockLoc i
Definition: read.cpp:79
Node ** d_nodes
Array of nodes assigned to this face.
Definition: Face.hpp:161
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

Here is the call graph for this function:

int getNumNodes ( ) const
virtual

Returns the number of nodes for this type of face (three for the triangular face).

Implements Face.

Definition at line 30 of file TriFace.cpp.

31 { return 3; }

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