CompareNodeCoordinatesX 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...
 

Detailed Description

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

Member Function Documentation

◆ operator()() [1/2]

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

The actual comparison operator.

57  {
58  unsigned n_dim = node1_pt->ndim();
59  if(n_dim != node2_pt->ndim())
60  {
61  throw OomphLibError("Can't compare two nodes of different dimension",
64  }
65 
66  //Make sure to handle the finite precision problems
67  return node1_pt->x(0) < node2_pt->x(0);
68  }
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 CompareNodeCoordinatesX::operator() ( Node *const &  node1_pt,
Node *const &  node2_pt 
)
inline

The actual comparison operator.

56  {
57  unsigned n_dim = node1_pt->ndim();
58  if(n_dim != node2_pt->ndim())
59  {
60  throw OomphLibError("Can't compare two nodes of different dimension",
63  }
64 
65  //Make sure to handle the finite precision problems
66  return node1_pt->x(0) < node2_pt->x(0);
67  }

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: