///////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////
bool oomph::NodeOrdering::node_global_position_comparison |
( |
Node * |
nd1_pt, |
|
|
Node * |
nd2_pt |
|
) |
| |
|
inline |
Function for ordering nodes. Return true if first node's position is "before" second nodes. Dimension 0 checked first, then... until they are different (by more than tol=1e-10). If they are both in exactly the same place an error is thrown.
2920 unsigned ndim = nd1_pt->ndim();
2923 for (
j = 0;
j < ndim;
j++)
2925 if (
std::abs(nd1_pt->x(
j) - nd2_pt->x(
j)) > 1
e-10)
2927 if (nd1_pt->x(
j) < nd2_pt->x(
j))
2939 std::string err =
"Nodes are at the same point to ~ 1e-10!";
2940 err +=
" difference is " +
2942 throw OomphLibError(
AnnoyingScalar abs(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:135
Array< double, 1, 3 > e(1./3., 0.5, 2.)
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
std::string to_string(T object, unsigned float_precision=8)
Definition: oomph_utilities.h:189
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2
References abs(), e(), j, oomph::Node::ndim(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::Global_string_for_annotation::string(), oomph::StringConversion::to_string(), and oomph::Node::x().
Referenced by oomph::Mesh::get_node_reordering().