oomph::TFace Class Reference

Triangular Face class. More...

#include <Telements.h>

Public Member Functions

 TFace (Node *node1_pt, Node *node2_pt, Node *node3_pt)
 Constructor: Pass in the three vertex nodes. More...
 
Nodenode1_pt () const
 Access to the first vertex node. More...
 
Nodenode2_pt () const
 Access to the second vertex node. More...
 
Nodenode3_pt () const
 Access to the third vertex node. More...
 
bool operator== (const TFace &other) const
 Comparison operator. More...
 
bool operator< (const TFace &other) const
 Less-than operator. More...
 
bool is_on_boundary () const
 
bool is_boundary_face () const
 
void get_boundaries_pt (std::set< unsigned > *&boundaries_pt)
 

Private Attributes

NodeNode1_pt
 First vertex node. More...
 
NodeNode2_pt
 Second vertex node. More...
 
NodeNode3_pt
 Third vertex node. More...
 

Detailed Description

Triangular Face class.

//////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////

Constructor & Destructor Documentation

◆ TFace()

oomph::TFace::TFace ( Node node1_pt,
Node node2_pt,
Node node3_pt 
)
inline

Constructor: Pass in the three vertex nodes.

60  {
61  if ((node1_pt == node2_pt) || (node2_pt == node3_pt) ||
62  (node1_pt == node3_pt))
63  {
64 #ifdef PARANOID
65  std::ostringstream error_stream;
66  error_stream << "TFace cannot have two identical vertex nodes\n";
67  throw OomphLibError(
69 #endif
70  }
71 
72  // Sort lexicographically based on pointer address of nodes
73  std::set<Node*> nodes;
74  nodes.insert(node1_pt);
75  nodes.insert(node2_pt);
76  nodes.insert(node3_pt);
77  std::set<Node*>::iterator it = nodes.begin();
78  Node1_pt = (*it);
79  it++;
80  Node2_pt = (*it);
81  it++;
82  Node3_pt = (*it);
83  it++;
84  }
Node * Node2_pt
Second vertex node.
Definition: Telements.h:208
Node * node2_pt() const
Access to the second vertex node.
Definition: Telements.h:94
Node * Node3_pt
Third vertex node.
Definition: Telements.h:211
Node * node1_pt() const
Access to the first vertex node.
Definition: Telements.h:88
Node * Node1_pt
First vertex node.
Definition: Telements.h:205
Node * node3_pt() const
Access to the third vertex node.
Definition: Telements.h:100
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References node1_pt(), Node1_pt, node2_pt(), Node2_pt, node3_pt(), Node3_pt, OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

Member Function Documentation

◆ get_boundaries_pt()

void oomph::TFace::get_boundaries_pt ( std::set< unsigned > *&  boundaries_pt)
inline

Access to pointer to set of mesh boundaries that this face occupies; NULL if the node is not on any boundary. Construct via set intersection of the boundary sets for the associated vertex nodes

179  {
180  std::set<unsigned> set1;
181  std::set<unsigned>* set1_pt = &set1;
182  Node1_pt->get_boundaries_pt(set1_pt);
183  std::set<unsigned> set2;
184  std::set<unsigned>* set2_pt = &set2;
185  Node2_pt->get_boundaries_pt(set2_pt);
186  std::set<unsigned> set3;
187  std::set<unsigned>* set3_pt = &set3;
188  Node3_pt->get_boundaries_pt(set3_pt);
189  std::set<unsigned> aux_set;
190  set_intersection((*set1_pt).begin(),
191  (*set1_pt).end(),
192  (*set2_pt).begin(),
193  (*set2_pt).end(),
194  inserter(aux_set, aux_set.begin()));
195  set_intersection(aux_set.begin(),
196  aux_set.end(),
197  (*set3_pt).begin(),
198  (*set3_pt).end(),
199  inserter((*boundaries_pt), (*boundaries_pt).begin()));
200  }
virtual void get_boundaries_pt(std::set< unsigned > *&boundaries_pt)
Definition: nodes.h:1365

References oomph::Node::get_boundaries_pt(), Node1_pt, Node2_pt, and Node3_pt.

Referenced by oomph::BrickFromTetMesh< ELEMENT >::build_mesh().

◆ is_boundary_face()

bool oomph::TFace::is_boundary_face ( ) const
inline

Test whether the face is a boundary face, i.e. does it connnect three boundary nodes?

168  {
169  return ((dynamic_cast<BoundaryNodeBase*>(Node1_pt) != 0) &&
170  (dynamic_cast<BoundaryNodeBase*>(Node2_pt) != 0) &&
171  (dynamic_cast<BoundaryNodeBase*>(Node3_pt) != 0));
172  }

References Node1_pt, Node2_pt, and Node3_pt.

Referenced by oomph::BrickFromTetMesh< ELEMENT >::build_mesh().

◆ is_on_boundary()

bool oomph::TFace::is_on_boundary ( ) const
inline

Test whether the face lies on a boundary. Relatively simple test, based on all vertices lying on (some) boundary.

159  {
160  return (Node1_pt->is_on_boundary() && Node2_pt->is_on_boundary() &&
162  }
virtual bool is_on_boundary() const
Definition: nodes.h:1373

References oomph::Node::is_on_boundary(), Node1_pt, Node2_pt, and Node3_pt.

◆ node1_pt()

Node* oomph::TFace::node1_pt ( ) const
inline

Access to the first vertex node.

89  {
90  return Node1_pt;
91  }

References Node1_pt.

Referenced by operator<(), operator==(), and TFace().

◆ node2_pt()

Node* oomph::TFace::node2_pt ( ) const
inline

Access to the second vertex node.

95  {
96  return Node2_pt;
97  }

References Node2_pt.

Referenced by operator<(), operator==(), and TFace().

◆ node3_pt()

Node* oomph::TFace::node3_pt ( ) const
inline

Access to the third vertex node.

101  {
102  return Node3_pt;
103  }

References Node3_pt.

Referenced by operator<(), operator==(), and TFace().

◆ operator<()

bool oomph::TFace::operator< ( const TFace other) const
inline

Less-than operator.

122  {
123  if (Node1_pt < other.node1_pt())
124  {
125  return true;
126  }
127  else if (Node1_pt == other.node1_pt())
128  {
129  if (Node2_pt < other.node2_pt())
130  {
131  return true;
132  }
133  else if (Node2_pt == other.node2_pt())
134  {
135  if (Node3_pt < other.node3_pt())
136  {
137  return true;
138  }
139  else
140  {
141  return false;
142  }
143  }
144  else
145  {
146  return false;
147  }
148  }
149  else
150  {
151  return false;
152  }
153  }

References node1_pt(), Node1_pt, node2_pt(), Node2_pt, node3_pt(), and Node3_pt.

◆ operator==()

bool oomph::TFace::operator== ( const TFace other) const
inline

Comparison operator.

107  {
108  if ((Node1_pt == other.node1_pt()) && (Node2_pt == other.node2_pt()) &&
109  (Node3_pt == other.node3_pt()))
110  {
111  return true;
112  }
113  else
114  {
115  return false;
116  }
117  }

References node1_pt(), Node1_pt, node2_pt(), Node2_pt, node3_pt(), and Node3_pt.

Member Data Documentation

◆ Node1_pt

Node* oomph::TFace::Node1_pt
private

◆ Node2_pt

Node* oomph::TFace::Node2_pt
private

◆ Node3_pt

Node* oomph::TFace::Node3_pt
private

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