oomph::CompareBoundaryCoordinate< ELEMENT > Class Template Reference

#include <face_element_as_geometric_object.h>

Public Member Functions

int operator() (GeneralisedElement *const &element1_pt, GeneralisedElement *const &element2_pt)
 The actual comparison operator. More...
 

Detailed Description

template<class ELEMENT>
class oomph::CompareBoundaryCoordinate< ELEMENT >

A class to do comparison of the elements by lexicographic ordering, based on the boundary coordinates at the element's first node.

Member Function Documentation

◆ operator()()

template<class ELEMENT >
int oomph::CompareBoundaryCoordinate< ELEMENT >::operator() ( GeneralisedElement *const &  element1_pt,
GeneralisedElement *const &  element2_pt 
)
inline

The actual comparison operator.

188  {
189  // OK Dynamic cast the elements
190  FaceElementAsGeomObject<ELEMENT>* cast_element1_pt =
191  dynamic_cast<FaceElementAsGeomObject<ELEMENT>*>(element1_pt);
192  FaceElementAsGeomObject<ELEMENT>* cast_element2_pt =
193  dynamic_cast<FaceElementAsGeomObject<ELEMENT>*>(element2_pt);
194 
195 #ifdef PARANOID
196  if (cast_element1_pt == 0)
197  {
198  std::ostringstream error_message;
199  error_message
200  << "Failed to cast element1_pt to a FaceElementAsGeomObject"
201  << std::endl;
202  throw OomphLibError(error_message.str(),
205  }
206 
207  if (cast_element2_pt == 0)
208  {
209  std::ostringstream error_message;
210  error_message
211  << "Failed to cast element2_pt to a FaceElementAsGeomObject"
212  << std::endl;
213  throw OomphLibError(error_message.str(),
216  }
217 #endif
218 
219 
220  // Warning that this still needs to be generalised to higher
221  // dimensions (don't want to implement it until I can test it
222  // -- at the moment, the ordering isn't particularly important
223  // anyway...
224  // if (cast_element1_pt->dim()!=1)
225  // {
226  // std::ostringstream warn_message;
227  // warn_message
228  // << "Warning: Ordering of elements is currently based on their
229  // \n"
230  // << "zero-th surface coordinate. This may not be appropriate
231  // for\n"
232  // << cast_element1_pt->dim() << "-dimensional elements. \n";
233  // OomphLibWarning(warn_message.str(),
234  // "CompareBoundaryCoordinate::()",
235  // OOMPH_EXCEPTION_LOCATION);
236  // }
237 
238 
239  return cast_element1_pt->zeta_nodal(0, 0, 0) <
240  cast_element2_pt->zeta_nodal(0, 0, 0);
241  }
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::FaceElementAsGeomObject< ELEMENT >::zeta_nodal().


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