CompareNodeCoordinatesY Class Reference

Public Member Functions

int operator() (Node *const &node1_pt, Node *const &node2_pt)
 The actual comparison operator. More...
 
int operator() (Node *const &node1_pt, Node *const &node2_pt)
 The actual comparison operator. More...
 

Member Function Documentation

◆ operator()() [1/2]

int CompareNodeCoordinatesY::operator() ( Node *const &  node1_pt,
Node *const &  node2_pt 
)
inline

The actual comparison operator.

78  {
79  unsigned n_dim = node1_pt->ndim();
80  if(n_dim != node2_pt->ndim())
81  {
82  throw OomphLibError("Can't compare two nodes of different dimension",
85  }
86 
87  //Make sure to handle the finite precision problems
88  return node1_pt->x(1) < node2_pt->x(1);
89  }
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
Definition: nodes.h:1054
Definition: oomph_definitions.h:222
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References oomph::Node::ndim(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::Node::x().

◆ operator()() [2/2]

int CompareNodeCoordinatesY::operator() ( Node *const &  node1_pt,
Node *const &  node2_pt 
)
inline

The actual comparison operator.

77  {
78  unsigned n_dim = node1_pt->ndim();
79  if(n_dim != node2_pt->ndim())
80  {
81  throw OomphLibError("Can't compare two nodes of different dimension",
84  }
85 
86  //Make sure to handle the finite precision problems
87  return node1_pt->x(1) < node2_pt->x(1);
88  }

References oomph::Node::ndim(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::Node::x().


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