oomph::Edge Class Reference

Edge class. More...

#include <mesh.h>

Public Member Functions

 Edge (Node *node1_pt, Node *node2_pt)
 Constructor: Pass in the two vertex nodes. More...
 
Nodenode1_pt () const
 Access to the first vertex node. More...
 
Nodenode2_pt () const
 Access to the second vertex node. More...
 
bool operator== (const Edge &other) const
 Comparison operator. More...
 
bool operator< (const Edge &other) const
 Less-than operator. More...
 
bool is_on_boundary () const
 
bool is_boundary_edge () const
 

Private Attributes

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

Detailed Description

Edge class.

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

Constructor & Destructor Documentation

◆ Edge()

oomph::Edge::Edge ( Node node1_pt,
Node node2_pt 
)
inline

Constructor: Pass in the two vertex nodes.

2696  {
2697  if (node1_pt == node2_pt)
2698  {
2699 #ifdef PARANOID
2700  std::ostringstream error_stream;
2701  error_stream << "Edge cannot have two identical vertex nodes\n";
2702  throw OomphLibError(
2703  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2704 #endif
2705  }
2706 
2707 
2708  // Sort lexicographically based on pointer address of nodes
2709  if (node1_pt > node2_pt)
2710  {
2711  Node1_pt = node1_pt;
2712  Node2_pt = node2_pt;
2713  }
2714  else
2715  {
2716  Node1_pt = node2_pt;
2717  Node2_pt = node1_pt;
2718  }
2719  }
Node * node2_pt() const
Access to the second vertex node.
Definition: mesh.h:2729
Node * node1_pt() const
Access to the first vertex node.
Definition: mesh.h:2723
Node * Node1_pt
First vertex node.
Definition: mesh.h:2791
Node * Node2_pt
Second vertex node.
Definition: mesh.h:2794
#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, OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

Member Function Documentation

◆ is_boundary_edge()

bool oomph::Edge::is_boundary_edge ( ) const
inline

Test whether the Edge is a boundary edge, i.e. does it connnect two boundary nodes?

2784  {
2785  return ((dynamic_cast<BoundaryNodeBase*>(Node1_pt) != 0) &&
2786  (dynamic_cast<BoundaryNodeBase*>(Node2_pt) != 0));
2787  }

References Node1_pt, and Node2_pt.

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

◆ is_on_boundary()

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

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

2776  {
2777  return (Node1_pt->is_on_boundary() && Node2_pt->is_on_boundary());
2778  }
virtual bool is_on_boundary() const
Definition: nodes.h:1373

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

◆ node1_pt()

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

Access to the first vertex node.

2724  {
2725  return Node1_pt;
2726  }

References Node1_pt.

Referenced by Edge(), operator<(), operator==(), and oomph::ThinLayerBrickOnTetMesh< ELEMENT >::ThinLayerBrickOnTetMesh().

◆ node2_pt()

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

Access to the second vertex node.

2730  {
2731  return Node2_pt;
2732  }

References Node2_pt.

Referenced by Edge(), operator<(), operator==(), and oomph::ThinLayerBrickOnTetMesh< ELEMENT >::ThinLayerBrickOnTetMesh().

◆ operator<()

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

Less-than operator.

2751  {
2752  if (Node1_pt < other.node1_pt())
2753  {
2754  return true;
2755  }
2756  else if (Node1_pt == other.node1_pt())
2757  {
2758  if (Node2_pt < other.node2_pt())
2759  {
2760  return true;
2761  }
2762  else
2763  {
2764  return false;
2765  }
2766  }
2767  else
2768  {
2769  return false;
2770  }
2771  }

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

◆ operator==()

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

Comparison operator.

2736  {
2737  if ((Node1_pt == other.node1_pt()) && (Node2_pt == other.node2_pt()))
2738 
2739  {
2740  return true;
2741  }
2742  else
2743  {
2744  return false;
2745  }
2746  }

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

Member Data Documentation

◆ Node1_pt

Node* oomph::Edge::Node1_pt
private

First vertex node.

Referenced by Edge(), is_boundary_edge(), is_on_boundary(), node1_pt(), operator<(), and operator==().

◆ Node2_pt

Node* oomph::Edge::Node2_pt
private

Second vertex node.

Referenced by Edge(), is_boundary_edge(), is_on_boundary(), node2_pt(), operator<(), and operator==().


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