oomph::BoundaryNode< NODE_TYPE > Class Template Reference

#include <nodes.h>

+ Inheritance diagram for oomph::BoundaryNode< NODE_TYPE >:

Public Member Functions

void clear_copied_pointers ()
 
 BoundaryNode ()
 Default Constructor. More...
 
 BoundaryNode (const unsigned &n_dim, const unsigned &n_position_type, const unsigned &initial_n_value)
 
 BoundaryNode (TimeStepper *const &time_stepper_pt, const unsigned &n_dim, const unsigned &n_position_type, const unsigned &initial_n_value)
 
 BoundaryNode (const unsigned &n_lagrangian, const unsigned &n_lagrangian_type, const unsigned &n_dim, const unsigned &n_position_type, const unsigned &initial_n_value)
 
 BoundaryNode (TimeStepper *const &time_stepper_pt, const unsigned &n_lagrangian, const unsigned &n_lagrangian_type, const unsigned &n_dim, const unsigned &n_position_type, const unsigned &initial_n_value)
 
 ~BoundaryNode ()
 Destructor resets pointers if. More...
 
 BoundaryNode (const BoundaryNode< NODE_TYPE > &node)=delete
 Broken copy constructor. More...
 
void operator= (const BoundaryNode< NODE_TYPE > &)=delete
 Broken assignment operator. More...
 
bool boundary_coordinates_have_been_set_up ()
 Have boundary coordinates been set up? More...
 
void get_boundaries_pt (std::set< unsigned > *&boundaries_pt)
 
bool is_on_boundary () const
 
bool is_on_boundary (const unsigned &b) const
 
void add_to_boundary (const unsigned &b)
 Add the node to mesh boundary b, final overload. More...
 
void remove_from_boundary (const unsigned &b)
 Remover the node from mesh boundary b, final overload. More...
 
unsigned ncoordinates_on_boundary (const unsigned &b)
 Get the number of boundary coordinates on mesh boundary b. More...
 
void get_coordinates_on_boundary (const unsigned &b, Vector< double > &boundary_zeta)
 
void set_coordinates_on_boundary (const unsigned &b, const Vector< double > &boundary_zeta)
 
void get_coordinates_on_boundary (const unsigned &b, const unsigned &k, Vector< double > &boundary_zeta)
 
void set_coordinates_on_boundary (const unsigned &b, const unsigned &k, const Vector< double > &boundary_zeta)
 
unsigned nvalue_assigned_by_face_element (const unsigned &face_id=0) const
 
void assign_additional_values_with_face_id (const unsigned &n_additional_value, const unsigned &face_id=0)
 
void make_periodic (Node *const &node_pt)
 Make the node periodic. More...
 
void make_periodic_nodes (const Vector< Node * > &periodic_nodes_pt)
 
bool is_a_copy () const
 
bool is_a_copy (const unsigned &i) const
 
Nodecopied_node_pt () const
 
void assign_eqn_numbers (unsigned long &global_ndof, Vector< double * > &dof_pt)
 Overload the equation assignment operation. More...
 
void resize (const unsigned &n_value)
 Resize the number of equations. More...
 
void make_periodic (Node *const &node_pt)
 Make the node periodic. More...
 
- Public Member Functions inherited from oomph::BoundaryNodeBase
std::map< unsigned, unsigned > *& index_of_first_value_assigned_by_face_element_pt ()
 
unsigned index_of_first_value_assigned_by_face_element (const unsigned &face_id=0) const
 
unsigned index_of_first_value_assigned_by_face_element (const bool &throw_if_no_value_assigned_by_face_element, const bool &throw_quietly, const unsigned &face_id=0) const
 
 BoundaryNodeBase ()
 Default constructor, set the pointers to the storage to NULL. More...
 
virtual ~BoundaryNodeBase ()
 Destructor, clean up any allocated storage for the boundaries. More...
 
 BoundaryNodeBase (const BoundaryNodeBase &boundary_node_base)=delete
 Broken copy constructor. More...
 
void operator= (const BoundaryNodeBase &)=delete
 Broken assignment operator. More...
 
bool boundary_coordinates_have_been_set_up ()
 Have boundary coordinates been set up? More...
 
void get_boundaries_pt (std::set< unsigned > *&boundaries_pt)
 
void add_to_boundary (const unsigned &b)
 Add the node to the mesh boundary b. More...
 
void remove_from_boundary (const unsigned &b)
 Remove the node from the mesh boundary b. More...
 
bool is_on_boundary () const
 Test whether the node lies on a boundary. More...
 
bool is_on_boundary (const unsigned &b) const
 Test whether the node lies on mesh boundary b. More...
 
unsigned ncoordinates_on_boundary (const unsigned &b)
 Get the number of boundary coordinates on mesh boundary b. More...
 
void get_coordinates_on_boundary (const unsigned &b, Vector< double > &boundary_zeta)
 Return the vector of boundary coordinates on mesh boundary b. More...
 
void set_coordinates_on_boundary (const unsigned &b, const Vector< double > &boundary_zeta)
 Set the vector of boundary coordinates on mesh boundary b. More...
 
void get_coordinates_on_boundary (const unsigned &b, const unsigned &k, Vector< double > &boundary_zeta)
 
void set_coordinates_on_boundary (const unsigned &b, const unsigned &k, const Vector< double > &boundary_zeta)
 

Private Member Functions

void reset_copied_pointers ()
 Set pointers to the copied data used when we have periodic nodes. More...
 
void clear_additional_copied_pointers ()
 

Additional Inherited Members

- Protected Member Functions inherited from oomph::BoundaryNodeBase
void make_node_periodic (Node *const &node_pt, Node *const &original_node_pt)
 
void make_nodes_periodic (Node *const &node_pt, Vector< Node * > const &periodic_copies_pt)
 
- Protected Attributes inherited from oomph::BoundaryNodeBase
std::map< unsigned, unsigned > * Index_of_first_value_assigned_by_face_element_pt
 
NodeCopied_node_pt
 

Detailed Description

template<class NODE_TYPE>
class oomph::BoundaryNode< NODE_TYPE >

A template Class for BoundaryNodes; that is Nodes that MAY live on the boundary of a Mesh. The class is formed by a simple composition of the template parameter NODE_TYPE, which must be a Node class and the BoundaryNodeBase class. Final overloading of functions is always in favour of the BoundaryNodeBase implementation; i.e. these nodes can live on boundaries.

Constructor & Destructor Documentation

◆ BoundaryNode() [1/6]

template<class NODE_TYPE >
oomph::BoundaryNode< NODE_TYPE >::BoundaryNode ( )
inline

Default Constructor.

2382 : NODE_TYPE(), BoundaryNodeBase() {}
BoundaryNodeBase()
Default constructor, set the pointers to the storage to NULL.
Definition: nodes.h:2152

◆ BoundaryNode() [2/6]

template<class NODE_TYPE >
oomph::BoundaryNode< NODE_TYPE >::BoundaryNode ( const unsigned n_dim,
const unsigned n_position_type,
const unsigned initial_n_value 
)
inline

Steady constructor, for a BoundaryNode of spatial dimension n_dim. Simply passes all arguments through to the underlying Node constructor which allocates storage for initial_n_value values. NPosition_type is the number of coordinate types needed in the mapping between local and global coordinates (e.g. 1 for Lagrange-type elements; 2 for 1D Hermite elements; 4 for 2D Hermite elements, etc).

2394  : NODE_TYPE(n_dim, n_position_type, initial_n_value), BoundaryNodeBase()
2395  {
2396  }

◆ BoundaryNode() [3/6]

template<class NODE_TYPE >
oomph::BoundaryNode< NODE_TYPE >::BoundaryNode ( TimeStepper *const &  time_stepper_pt,
const unsigned n_dim,
const unsigned n_position_type,
const unsigned initial_n_value 
)
inline

Unsteady constructor for a BoundaryNode of spatial dimension n_dim. Simply passes all arguments through to the underlygin Node constructor which allocates storage for initial_n_value values with history values as required by the timestepper. n_position_type: # of coordinate types needed in the mapping between local and global coordinates (e.g. 1 for Lagrange-type elements; 2 for 1D Hermite elements; 4 for 2D Hermite elements).

2411  : NODE_TYPE(time_stepper_pt, n_dim, n_position_type, initial_n_value),
2413  {
2414  }

◆ BoundaryNode() [4/6]

template<class NODE_TYPE >
oomph::BoundaryNode< NODE_TYPE >::BoundaryNode ( const unsigned n_lagrangian,
const unsigned n_lagrangian_type,
const unsigned n_dim,
const unsigned n_position_type,
const unsigned initial_n_value 
)
inline

Steady constructor for Solid-type boundary nodes. The node has n_lagrangian Lagrangian coordinates of n_lagrangian_type types (1 for Lagrange elements, 2 for 1D Hermite etc.). The Eulerian dimension of the Node is n_dim and we have n_position_type (generalised) Eulerian coordinates. There are initial_n_value values stored at this node.

2429  : NODE_TYPE(n_lagrangian,
2430  n_lagrangian_type,
2431  n_dim,
2432  n_position_type,
2433  initial_n_value),
2435  {
2436  }

◆ BoundaryNode() [5/6]

template<class NODE_TYPE >
oomph::BoundaryNode< NODE_TYPE >::BoundaryNode ( TimeStepper *const &  time_stepper_pt,
const unsigned n_lagrangian,
const unsigned n_lagrangian_type,
const unsigned n_dim,
const unsigned n_position_type,
const unsigned initial_n_value 
)
inline

Unsteady constructor for Solid-type boundary nodes Allocates storage for initial_n_value nodal values with history values as required by timestepper. The node has n_lagrangian Lagrangian coordinates of n_lagrangian_type types (1 for Lagrange elements, 2 for 1D Hermite etc.)/ The Eulerian dimension of the Node is n_dim and we have n_position_type generalised Eulerian coordinates.

2451  : NODE_TYPE(time_stepper_pt,
2452  n_lagrangian,
2453  n_lagrangian_type,
2454  n_dim,
2455  n_position_type,
2456  initial_n_value),
2458  {
2459  }

◆ ~BoundaryNode()

template<class NODE_TYPE >
oomph::BoundaryNode< NODE_TYPE >::~BoundaryNode ( )
inline

Destructor resets pointers if.

2463  {
2464  // If there are any copies of this Node
2465  // then we need to clear their pointers to information stored in
2466  // this BoundaryNode
2467  // at this level because once we are down to the Node's destructor
2468  // the information no longer exists.
2469  for (unsigned i = 0; i < this->Ncopies; i++)
2470  {
2471  // Is the copied node a boundary node (it should be)
2472  BoundaryNode<NODE_TYPE>* cast_node_pt =
2473  dynamic_cast<BoundaryNode<NODE_TYPE>*>(this->Copy_of_data_pt[i]);
2474  // We can only do this if the node is a boundary node
2475  if (cast_node_pt != 0)
2476  {
2477  // This is required to clear out any pointers to the additional
2478  // data assigned by face elements
2479  cast_node_pt->clear_additional_copied_pointers();
2480  }
2481  // Otherwise there is a problem if it's not Hijacked Data
2482 #ifdef PARANOID
2483  else
2484  {
2485  if (dynamic_cast<HijackedData*>(this->Copy_of_data_pt[i]) == 0)
2486  {
2487  OomphLibError(
2488  "Copy of a BoundaryNode is not a BoundaryNode or HijackedData",
2489  "BoundaryNode::~BoundaryNode",
2491  }
2492  }
2493 #endif
2494  }
2495 
2496  // If the node was periodic then clear the pointers before deleting
2497  if (Copied_node_pt)
2498  {
2499  // Inform the node that the copy is being deleted
2500  // If the original has been deleted Copied_node_pt will be NULL
2501  Copied_node_pt->remove_copy(this);
2502  Copied_node_pt = 0;
2503  this->Value = 0;
2504  this->Eqn_number = 0;
2505  // Remove the information about the boundary node storage scheme
2507  }
2508  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Node * Copied_node_pt
Definition: nodes.h:2021
std::map< unsigned, unsigned > * Index_of_first_value_assigned_by_face_element_pt
Definition: nodes.h:2017
void remove_copy(Data *const &data_pt)
Definition: nodes.cc:102
GenericValue< UTF8<> > Value
Value with UTF8 encoding.
Definition: document.h:679
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61

References oomph::BoundaryNode< NODE_TYPE >::clear_additional_copied_pointers(), oomph::BoundaryNodeBase::Copied_node_pt, i, oomph::BoundaryNodeBase::Index_of_first_value_assigned_by_face_element_pt, OOMPH_EXCEPTION_LOCATION, and oomph::Data::remove_copy().

◆ BoundaryNode() [6/6]

template<class NODE_TYPE >
oomph::BoundaryNode< NODE_TYPE >::BoundaryNode ( const BoundaryNode< NODE_TYPE > &  node)
delete

Broken copy constructor.

Member Function Documentation

◆ add_to_boundary()

template<class NODE_TYPE >
void oomph::BoundaryNode< NODE_TYPE >::add_to_boundary ( const unsigned b)
inline

Add the node to mesh boundary b, final overload.

2546  {
2548  }
Scalar * b
Definition: benchVecAdd.cpp:17
void add_to_boundary(const unsigned &b)
Add the node to the mesh boundary b.
Definition: nodes.cc:3028

References oomph::BoundaryNodeBase::add_to_boundary(), and b.

◆ assign_additional_values_with_face_id()

template<class NODE_TYPE >
void oomph::BoundaryNode< NODE_TYPE >::assign_additional_values_with_face_id ( const unsigned n_additional_value,
const unsigned face_id = 0 
)
inlinevirtual

Member function to allocates storage for a given number of additional degrees of freedom, n_additional_value, associated with a particular face_id to the Node node_pt. Needs to be filled in here so that access to the nodal values is available.

Implements oomph::BoundaryNodeBase.

2679  {
2680 #ifdef PARANOID
2681  // If nothing is being added warn the user
2682  if (n_additional_value == 0)
2683  {
2684  std::ostringstream warn_message;
2685  warn_message
2686  << "No additional data values are being added to the boundary node "
2687  << this << "\n"
2688  << "by face id " << face_id << ".\n"
2689  << "This means that the function \n"
2690  << "BoundaryNode::index_of_first_value_assigned_by_face_element(id) "
2691  "\n"
2692  << "will return a value that is equal to the number of values stored "
2693  "at the Node.\n"
2694  << "Calling Node::value(...) with this index will lead to an "
2695  "out-of-range error.\n"
2696  << "The anticpated usage of a loop from the index over the number of "
2697  "values.\n"
2698  << "will not cause any problems, but if you try to do anything else, "
2699  "you may be surprised.\n"
2700  << "You have been warned!\n";
2701  OomphLibWarning(
2702  warn_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2703  }
2704 #endif
2705 
2706  // Allocate storage if not already assigned
2708  {
2710  new std::map<unsigned, unsigned>;
2711  }
2712 
2713  // Find the number of values already stored in the node
2714  const unsigned n_value = this->nvalue();
2715 
2716  // If this ID hasn't already been used
2718  face_id) ==
2719  this->Index_of_first_value_assigned_by_face_element_pt->end())
2720  {
2721  // Set the first index to by number of values
2722  (*Index_of_first_value_assigned_by_face_element_pt)[face_id] = n_value;
2723  }
2724  // Otherwise this ID has been used previously
2725  else
2726  {
2727  // Find the number of values associated with this id
2728  const unsigned n_value_for_id =
2729  this->nvalue_assigned_by_face_element(face_id);
2730 
2731  // If the number of current values is equal to the desired values
2732  // do nothing and return
2733  if (n_value_for_id == n_additional_value)
2734  {
2735  return;
2736  }
2737  // Otherwise
2738  else
2739  {
2740  // Safety check, are the value associated with this id
2741  // all at the end
2743  [face_id] +
2744  n_value_for_id) != n_value)
2745  {
2746 #ifdef PARANOID
2747  std::ostringstream warn_message;
2748  warn_message << "Trying to (resize) number of unknowns associated "
2749  "with face id "
2750  << face_id << "\n"
2751  << "but previous storage for this data is not at the "
2752  "end of the nodal values.\n"
2753  << "The anticipated usage here is within constructors "
2754  "that add additional equations\n"
2755  << "to existing FaceElements in which case we will "
2756  "always be at the end.\n"
2757  << "If you are trying to do something else, then try "
2758  "using a different id.\n"
2759  << " FaceElement::add_additional_values(...)."
2760  << " For consistency with earlier versions, this will "
2761  "do nothing!\n";
2762  OomphLibWarning(warn_message.str(),
2765 #endif
2766  // Just return without doing anything
2767  return;
2768  }
2769  } // Case when we are actually requesting additional values
2770  } // End case when ID has already been touched
2771 
2772  // Now finally resize the storage
2773  this->resize(n_value + n_additional_value);
2774  }
void resize(const unsigned &n_value)
Resize the number of equations.
Definition: nodes.h:2854
unsigned nvalue_assigned_by_face_element(const unsigned &face_id=0) const
Definition: nodes.h:2610
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References oomph::BoundaryNodeBase::Index_of_first_value_assigned_by_face_element_pt, oomph::BoundaryNode< NODE_TYPE >::nvalue_assigned_by_face_element(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::BoundaryNode< NODE_TYPE >::resize().

◆ assign_eqn_numbers()

template<class NODE_TYPE >
void oomph::BoundaryNode< NODE_TYPE >::assign_eqn_numbers ( unsigned long &  global_ndof,
Vector< double * > &  dof_pt 
)
inline

Overload the equation assignment operation.

2829  {
2830  // If the boundary node is not periodic call the ususal
2831  // assign equation numbers
2832  if (Copied_node_pt == 0)
2833  {
2834  NODE_TYPE::assign_eqn_numbers(global_ndof, dof_pt);
2835  }
2836  // Otherwise make sure that we assign equation numbers for
2837  // the variable position pointer of the solid node
2838  else
2839  {
2840  // Is it a solid node?
2841  SolidNode* solid_node_pt = dynamic_cast<SolidNode*>(this);
2842  if (solid_node_pt)
2843  {
2844  // If so we must let the variable position pointer take care of
2845  // itself
2846  solid_node_pt->variable_position_pt()->assign_eqn_numbers(global_ndof,
2847  dof_pt);
2848  }
2849  }
2850  }

References oomph::Data::assign_eqn_numbers(), oomph::BoundaryNodeBase::Copied_node_pt, and oomph::SolidNode::variable_position_pt().

◆ boundary_coordinates_have_been_set_up()

template<class NODE_TYPE >
bool oomph::BoundaryNode< NODE_TYPE >::boundary_coordinates_have_been_set_up ( )
inline

Have boundary coordinates been set up?

2518  {
2520  }
bool boundary_coordinates_have_been_set_up()
Have boundary coordinates been set up?
Definition: nodes.h:2170

References oomph::BoundaryNodeBase::boundary_coordinates_have_been_set_up().

◆ clear_additional_copied_pointers()

template<class NODE_TYPE >
void oomph::BoundaryNode< NODE_TYPE >::clear_additional_copied_pointers ( )
inlineprivate

Copy over additional information so that if the node is periodic it can remain active if the node that holds the periodic data is deleted

2289  {
2290  // Only worry about the face index if it has been assigned
2291  // which it will have been
2293  {
2294  // Allocate new storage for the index of first value assigned by face
2295  // element The other storage will be deleted
2297  new std::map<unsigned, unsigned>;
2298 
2299  // Cast copied_node_pt to BoundaryNode so that we can reset the index
2300  BoundaryNode<NODE_TYPE>* cast_copied_node_pt =
2301  dynamic_cast<BoundaryNode<NODE_TYPE>*>(Copied_node_pt);
2302 
2303  // Check that dynamic cast has worked
2304  if (cast_copied_node_pt)
2305  {
2306  // Initialise the values in the map to be those of the original data
2307  // std::map<unsigned,unsigned>::const_iterator it =
2308  // (*(cast_copied_node_pt->
2309  // index_of_first_value_assigned_by_face_element_pt())).begin();
2310  std::map<unsigned, unsigned>::const_iterator end =
2311  (*(cast_copied_node_pt
2312  ->index_of_first_value_assigned_by_face_element_pt()))
2313  .end();
2314  for (std::map<unsigned, unsigned>::const_iterator it =
2315  (*(cast_copied_node_pt
2317  .begin();
2318  it != end;
2319  it++)
2320  {
2322  [it->first] = it->second;
2323  }
2324  }
2325  }
2326  }
std::map< unsigned, unsigned > *& index_of_first_value_assigned_by_face_element_pt()
Definition: nodes.h:2046
static constexpr lastp1_t end
Definition: IndexedViewHelper.h:79

References oomph::BoundaryNodeBase::Copied_node_pt, Eigen::placeholders::end, and oomph::BoundaryNodeBase::index_of_first_value_assigned_by_face_element_pt().

Referenced by oomph::BoundaryNode< NODE_TYPE >::~BoundaryNode().

◆ clear_copied_pointers()

template<class NODE_TYPE >
void oomph::BoundaryNode< NODE_TYPE >::clear_copied_pointers ( )
inline

Clear pointers to the copied data used when we have periodic nodes. The shallow (pointer) copy is turned into a deep copy by allocating new data and copying the actual values across.

2333  {
2334 #ifdef PARANOID
2335  if (Copied_node_pt == 0)
2336  {
2337  throw OomphLibError("BoundaryNode has not been copied",
2340  }
2341 #endif
2342 
2343  // Simply zeroing these will cause problems during unrefinement because
2344  // the original could be deleted, but the "copy" remain. Instead we
2345  // allocate new storage and copy values over from the original.
2346 
2347  // Get the number of values and time storage
2348  //(must be the same as the original)
2349  const unsigned n_value = this->nvalue();
2350  const unsigned n_tstorage = this->ntstorage();
2351 
2352  // Allocate storage for equation numbers
2353  this->Eqn_number = new long[n_value];
2354 
2355  // Allocate storage for the values
2356  this->Value = new double*[n_value];
2357 
2358  // Allocate all data values in one big array
2359  double* values = new double[n_value * n_tstorage];
2360 
2361  // Set the pointers to the data values and equation numbers
2362  for (unsigned i = 0; i < n_value; ++i)
2363  {
2364  // Set the pointers
2365  this->Value[i] = &values[i * n_tstorage];
2366  // Initialise all the values to be those of the original data
2367  for (unsigned t = 0; t < n_tstorage; ++t)
2368  {
2369  this->Value[i][t] = Copied_node_pt->value(t, i);
2370  }
2371 
2372  // Copy over the values of the equation numbers
2373  this->Eqn_number[i] = Copied_node_pt->eqn_number(i);
2374  }
2375 
2376  // The node is no longer a copy
2377  Copied_node_pt = 0;
2378  }
long & eqn_number(const unsigned &i)
Return the equation number of the i-th stored variable.
Definition: nodes.h:367
double value(const unsigned &i) const
Definition: nodes.cc:2408
t
Definition: plotPSD.py:36

References oomph::BoundaryNodeBase::Copied_node_pt, oomph::Data::eqn_number(), i, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, plotPSD::t, and oomph::Node::value().

◆ copied_node_pt()

template<class NODE_TYPE >
Node* oomph::BoundaryNode< NODE_TYPE >::copied_node_pt ( ) const
inline

Return pointer to copied node (null if the current node is not a copy)

2823  {
2824  return Copied_node_pt;
2825  }

References oomph::BoundaryNodeBase::Copied_node_pt.

◆ get_boundaries_pt()

template<class NODE_TYPE >
void oomph::BoundaryNode< NODE_TYPE >::get_boundaries_pt ( std::set< unsigned > *&  boundaries_pt)
inline

Access to pointer to set of mesh boundaries that this node occupies; NULL if the node is not on any boundary Final overload

2526  {
2527  BoundaryNodeBase::get_boundaries_pt(boundaries_pt);
2528  }
void get_boundaries_pt(std::set< unsigned > *&boundaries_pt)
Definition: nodes.h:2177

References oomph::BoundaryNodeBase::get_boundaries_pt().

◆ get_coordinates_on_boundary() [1/2]

template<class NODE_TYPE >
void oomph::BoundaryNode< NODE_TYPE >::get_coordinates_on_boundary ( const unsigned b,
const unsigned k,
Vector< double > &  boundary_zeta 
)
inline

Return the vector of k-th generalised boundary coordinates on mesh boundary b Final overload

2586  {
2588  }
void get_coordinates_on_boundary(const unsigned &b, Vector< double > &boundary_zeta)
Return the vector of boundary coordinates on mesh boundary b.
Definition: nodes.h:2201
char char char int int * k
Definition: level2_impl.h:374

References b, oomph::BoundaryNodeBase::get_coordinates_on_boundary(), and k.

◆ get_coordinates_on_boundary() [2/2]

template<class NODE_TYPE >
void oomph::BoundaryNode< NODE_TYPE >::get_coordinates_on_boundary ( const unsigned b,
Vector< double > &  boundary_zeta 
)
inline

Return the vector of coordinates on mesh boundary b Final overload

2568  {
2570  }

References b, and oomph::BoundaryNodeBase::get_coordinates_on_boundary().

◆ is_a_copy() [1/2]

template<class NODE_TYPE >
bool oomph::BoundaryNode< NODE_TYPE >::is_a_copy ( ) const
inline

Return a boolean to indicate whether the data contains any copied values. If the node is periodic all values are copied

2793  {
2794  if (Copied_node_pt)
2795  {
2796  return true;
2797  }
2798  else
2799  {
2800  return false;
2801  }
2802  }

References oomph::BoundaryNodeBase::Copied_node_pt.

◆ is_a_copy() [2/2]

template<class NODE_TYPE >
bool oomph::BoundaryNode< NODE_TYPE >::is_a_copy ( const unsigned i) const
inline

Return a boolean to indicate whether the i-th value is a copied value. If the node is periodic all values are copies

2808  {
2809  if (Copied_node_pt)
2810  {
2811  return true;
2812  }
2813  else
2814  {
2815  return false;
2816  }
2817  }

References oomph::BoundaryNodeBase::Copied_node_pt.

◆ is_on_boundary() [1/2]

template<class NODE_TYPE >
bool oomph::BoundaryNode< NODE_TYPE >::is_on_boundary ( ) const
inline

Test whether the node lies on a boundary Final overload

2533  {
2535  }
bool is_on_boundary() const
Test whether the node lies on a boundary.
Definition: nodes.h:2189

References oomph::BoundaryNodeBase::is_on_boundary().

Referenced by oomph::HermiteQuadMesh< ELEMENT >::set_position_of_boundary_node().

◆ is_on_boundary() [2/2]

template<class NODE_TYPE >
bool oomph::BoundaryNode< NODE_TYPE >::is_on_boundary ( const unsigned b) const
inline

Test whether the node lies on mesh boundary b Final overload

2540  {
2542  }

References b, and oomph::BoundaryNodeBase::is_on_boundary().

◆ make_periodic() [1/2]

template<class NODE_TYPE >
void oomph::BoundaryNode< NODE_TYPE >::make_periodic ( Node *const &  node_pt)
inline

Make the node periodic.

2779  {
2780  BoundaryNodeBase::make_node_periodic(this, node_pt);
2781  }
void make_node_periodic(Node *const &node_pt, Node *const &original_node_pt)
Definition: nodes.cc:2951

References oomph::BoundaryNodeBase::make_node_periodic().

◆ make_periodic() [2/2]

void oomph::BoundaryNode< SolidNode >::make_periodic ( Node *const &  node_pt)
inline

Make the node periodic.

2886  {
2887 #ifdef PARANOID
2888  std::ostringstream warn_message;
2889  warn_message << "You are trying to make a Solid Node Periodic.\n"
2890  << "This action will reset pointers to stored values and "
2891  << "equation numbers,\n"
2892  << "meaning that all values will be shared by this Node and "
2893  << "its master.\n"
2894  << "Unfortunately, this does not ensure that the variable "
2895  << "nodal coordinates coincide.\n"
2896  << "For matching nodal coordinates the options are:\n"
2897  << "(i) Introduce Lagrange multipliers,\n"
2898  << "(ii) Pin one side and treat the data as dependent,\n"
2899  << "(iii) Hijack the nodal coordinates on one side "
2900  << "and specify an alternative equation.\n\n"
2901  << "If you plan to use refineability, then the easiest\n"
2902  << "option is to use Lagrange multipliers.\n"
2903  << std::endl;
2904  OomphLibWarning(
2905  warn_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2906 #endif
2907 
2908  BoundaryNodeBase::make_node_periodic(this, node_pt);
2909  }

References oomph::BoundaryNodeBase::make_node_periodic(), OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ make_periodic_nodes()

template<class NODE_TYPE >
void oomph::BoundaryNode< NODE_TYPE >::make_periodic_nodes ( const Vector< Node * > &  periodic_nodes_pt)
inline

Make the nodes passed in periodic_nodes periodic from this node

2786  {
2787  BoundaryNodeBase::make_nodes_periodic(this, periodic_nodes_pt);
2788  }
void make_nodes_periodic(Node *const &node_pt, Vector< Node * > const &periodic_copies_pt)
Definition: nodes.cc:2896

References oomph::BoundaryNodeBase::make_nodes_periodic().

◆ ncoordinates_on_boundary()

template<class NODE_TYPE >
unsigned oomph::BoundaryNode< NODE_TYPE >::ncoordinates_on_boundary ( const unsigned b)
inline

Get the number of boundary coordinates on mesh boundary b.

2559  {
2561  }
unsigned ncoordinates_on_boundary(const unsigned &b)
Get the number of boundary coordinates on mesh boundary b.
Definition: nodes.cc:3119

References b, and oomph::BoundaryNodeBase::ncoordinates_on_boundary().

◆ nvalue_assigned_by_face_element()

template<class NODE_TYPE >
unsigned oomph::BoundaryNode< NODE_TYPE >::nvalue_assigned_by_face_element ( const unsigned face_id = 0) const
inlinevirtual

Return the number of values associated with the i-th face element field. If no argument is specified we return the value associated with the first (and assumed to be only) face element attached to this node. Throws error only in paranoid mode if no values have been set by any FaceElements. If you want to catch such cases gracefully in all circumstances (there are examples with complex unstructured 3D meshes where it's not clear a priori if a node has been resized by FaceElements) use alternative version (with leading bool arguments) that always checks and throws so exceptions can be caught gracefully. Returns UINT_MAX if error.

Implements oomph::BoundaryNodeBase.

2611  {
2612 #ifdef PARANOID
2614  {
2615  std::ostringstream error_message;
2616  error_message
2617  << "Index_of_first_value_assigned_by_face_element_pt==0;\n"
2618  << "Pointer must be set via call to: \n\n"
2619  << " BoundaryNode::assign_additional_values_with_face_id(), \n\n"
2620  << "typically from FaceElement::add_additional_values(...).";
2621  throw OomphLibError(error_message.str(),
2624  return UINT_MAX;
2625  }
2626 #endif
2627 
2628  // How many values are there in total?
2629  unsigned nval = this->nvalue();
2630 
2631  // If ID is not present in the map then return 0
2634  {
2635  return 0;
2636  }
2637 
2638  // Otherwise the entry is present in the map
2639 
2640  // Single entry: Number of values is the difference between
2641  // number of values and first index
2642  else if ((*Index_of_first_value_assigned_by_face_element_pt).size() == 1)
2643  {
2644  return nval -
2645  (*Index_of_first_value_assigned_by_face_element_pt)[face_id];
2646  }
2647  else
2648  {
2649  // Find the next first index: Default: nvalue()
2650  unsigned next_first_index = nval;
2651  unsigned my_first_index =
2652  (*Index_of_first_value_assigned_by_face_element_pt)[face_id];
2653  for (std::map<unsigned, unsigned>::iterator it =
2654  (*Index_of_first_value_assigned_by_face_element_pt).begin();
2655  it != (*Index_of_first_value_assigned_by_face_element_pt).end();
2656  it++)
2657  {
2658  unsigned first_index = (*it).second;
2659  if ((first_index > my_first_index) &&
2660  (first_index < next_first_index))
2661  {
2662  next_first_index = first_index;
2663  }
2664  }
2665  return next_first_index - my_first_index;
2666  }
2667  }

References oomph::BoundaryNodeBase::Index_of_first_value_assigned_by_face_element_pt, OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

Referenced by oomph::BoundaryNode< NODE_TYPE >::assign_additional_values_with_face_id().

◆ operator=()

template<class NODE_TYPE >
void oomph::BoundaryNode< NODE_TYPE >::operator= ( const BoundaryNode< NODE_TYPE > &  )
delete

Broken assignment operator.

◆ remove_from_boundary()

template<class NODE_TYPE >
void oomph::BoundaryNode< NODE_TYPE >::remove_from_boundary ( const unsigned b)
inline

Remover the node from mesh boundary b, final overload.

2552  {
2554  }
void remove_from_boundary(const unsigned &b)
Remove the node from the mesh boundary b.
Definition: nodes.cc:3062

References b, and oomph::BoundaryNodeBase::remove_from_boundary().

◆ reset_copied_pointers()

template<class NODE_TYPE >
void oomph::BoundaryNode< NODE_TYPE >::reset_copied_pointers ( )
inlineprivate

Set pointers to the copied data used when we have periodic nodes.

2246  {
2247 #ifdef PARANOID
2248  if (Copied_node_pt == 0)
2249  {
2250  throw OomphLibError("BoundaryNode has not been copied",
2253  }
2254 #endif
2255 
2256  // Set the number of values
2257  this->Nvalue = Copied_node_pt->nvalue();
2258  this->Value = Copied_node_pt->Value;
2259  this->Eqn_number = Copied_node_pt->Eqn_number;
2260  // We won't ever need to worry about updating position pointers
2261  // because periodic solid problems are handled using lagrange multipliers.
2262 
2263  // Cast Copied_node_pt to BoundaryNode to copy over the
2264  // Face index pointer
2265  BoundaryNode<NODE_TYPE>* cast_copied_node_pt =
2266  dynamic_cast<BoundaryNode<NODE_TYPE>*>(Copied_node_pt);
2267 
2268  // Check that dynamic cast has worked
2269  if (cast_copied_node_pt)
2270  {
2272  cast_copied_node_pt
2273  ->index_of_first_value_assigned_by_face_element_pt();
2274  }
2275  else
2276  {
2277  std::ostringstream error_stream;
2278  error_stream << "Copied_node_pt is not of type BoundaryNode*"
2279  << std::endl;
2280  throw OomphLibError(
2281  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2282  }
2283  }
long * Eqn_number
Definition: nodes.h:116
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:483
double ** Value
Definition: nodes.h:112

References oomph::BoundaryNodeBase::Copied_node_pt, oomph::Data::Eqn_number, oomph::BoundaryNodeBase::index_of_first_value_assigned_by_face_element_pt(), oomph::Data::nvalue(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::Data::Value.

◆ resize()

template<class NODE_TYPE >
void oomph::BoundaryNode< NODE_TYPE >::resize ( const unsigned n_value)
inline

Resize the number of equations.

2855  {
2856  // If the node is periodic, warn, but do nothing
2857  if (Copied_node_pt)
2858  {
2859 #ifdef PARANOID
2860  unsigned n_value_new = Copied_node_pt->nvalue();
2861  // Check that we have already resized the original
2862  if (n_value_new != n_value)
2863  {
2864  std::ostringstream error_stream;
2865  error_stream
2866  << "Call to resize copied node before original has been resized!"
2867  << std::endl;
2868  throw OomphLibError(error_stream.str(),
2871  }
2872 #endif
2873  }
2874  // Otherwise call the underlying function
2875  else
2876  {
2877  NODE_TYPE::resize(n_value);
2878  }
2879  }
v resize(3)

References oomph::BoundaryNodeBase::Copied_node_pt, oomph::Data::nvalue(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and resize().

Referenced by oomph::BoundaryNode< NODE_TYPE >::assign_additional_values_with_face_id().

◆ set_coordinates_on_boundary() [1/2]

template<class NODE_TYPE >
void oomph::BoundaryNode< NODE_TYPE >::set_coordinates_on_boundary ( const unsigned b,
const unsigned k,
const Vector< double > &  boundary_zeta 
)
inline

Set the vector of k-th generalised boundary coordinates on mesh boundary b. Final overload

2595  {
2597  }
void set_coordinates_on_boundary(const unsigned &b, const Vector< double > &boundary_zeta)
Set the vector of boundary coordinates on mesh boundary b.
Definition: nodes.h:2210

References b, k, and oomph::BoundaryNodeBase::set_coordinates_on_boundary().

◆ set_coordinates_on_boundary() [2/2]

template<class NODE_TYPE >
void oomph::BoundaryNode< NODE_TYPE >::set_coordinates_on_boundary ( const unsigned b,
const Vector< double > &  boundary_zeta 
)
inline

Set the vector of coordinates on mesh boundary b Final overload

2576  {
2578  }

References b, and oomph::BoundaryNodeBase::set_coordinates_on_boundary().

Referenced by oomph::HermiteQuadMesh< ELEMENT >::set_position_of_boundary_node().


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