oomph::BoundaryNodeBase Class Referenceabstract

#include <nodes.h>

+ Inheritance diagram for oomph::BoundaryNodeBase:

Public Member Functions

virtual void assign_additional_values_with_face_id (const unsigned &n_additional_value, const unsigned &face_id=0)=0
 
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
 
virtual unsigned nvalue_assigned_by_face_element (const unsigned &face_id=0) const =0
 
 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)
 

Protected Member Functions

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

std::map< unsigned, unsigned > * Index_of_first_value_assigned_by_face_element_pt
 
NodeCopied_node_pt
 

Private Attributes

std::map< unsigned, DenseMatrix< double > * > * Boundary_coordinates_pt
 
std::set< unsigned > * Boundaries_pt
 

Detailed Description

A class that contains the information required by Nodes that are located on Mesh boundaries. A BoundaryNode of a particular type is obtained by combining a given Node with this class. By differentiating between Nodes and BoundaryNodes we avoid a lot of un-necessary storage in the bulk Nodes.

Constructor & Destructor Documentation

◆ BoundaryNodeBase() [1/2]

oomph::BoundaryNodeBase::BoundaryNodeBase ( )
inline

Default constructor, set the pointers to the storage to NULL.

2154  Boundaries_pt(0),
2156  Copied_node_pt(0)
2157  {
2158  }
std::set< unsigned > * Boundaries_pt
Definition: nodes.h:2008
Node * Copied_node_pt
Definition: nodes.h:2021
std::map< unsigned, DenseMatrix< double > * > * Boundary_coordinates_pt
Definition: nodes.h:2004
std::map< unsigned, unsigned > * Index_of_first_value_assigned_by_face_element_pt
Definition: nodes.h:2017

◆ ~BoundaryNodeBase()

oomph::BoundaryNodeBase::~BoundaryNodeBase ( )
virtual

Destructor, clean up any allocated storage for the boundaries.

Destructor to clean up any memory that might have been allocated.

2994  {
2995  // Delete the set of boundaries on which the Node lies
2996  delete Boundaries_pt;
2997  Boundaries_pt = 0;
2998 
2999  // If the Boundary coordinates have been set then delete them
3000  if (Boundary_coordinates_pt != 0)
3001  {
3002  // Loop over the boundary coordinate entries and delete them
3003  for (std::map<unsigned, DenseMatrix<double>*>::iterator it =
3004  Boundary_coordinates_pt->begin();
3005  it != Boundary_coordinates_pt->end();
3006  ++it)
3007  {
3008  // Delete the vectors that have been allocated for the storage
3009  // of the boundary coordinates
3010  delete it->second;
3011  }
3012 
3013  // Now delete the Boundary coordinates map itself
3014  delete Boundary_coordinates_pt;
3015  // Set the pointer to null to be on the safe side
3017  }
3018 
3019  // Delete the map of face element's first value
3022  }

References Boundaries_pt, Boundary_coordinates_pt, and Index_of_first_value_assigned_by_face_element_pt.

◆ BoundaryNodeBase() [2/2]

oomph::BoundaryNodeBase::BoundaryNodeBase ( const BoundaryNodeBase boundary_node_base)
delete

Broken copy constructor.

Member Function Documentation

◆ add_to_boundary()

void oomph::BoundaryNodeBase::add_to_boundary ( const unsigned b)

Add the node to the mesh boundary b.

3029  {
3030  // If there is not storage then create storage and set the entry
3031  // to be the boundary b
3032  if (Boundaries_pt == 0)
3033  {
3034  Boundaries_pt = new std::set<unsigned>;
3035  }
3036 
3037  // //If the boundary is already stored in the node issue a warning
3038  // if(find(Boundaries_pt->begin(),Boundaries_pt->end(),b) !=
3039  // Boundaries_pt->end())
3040  // {
3041  // // MH: who cares?
3042  // // oomph_info << std::endl <<
3043  // "============================================"
3044  // // << std::endl << "Warning in Node::add_to_boundary() "
3045  // // << std::endl << "Node is already marked as being on boundary "
3046  // << b
3047  // // << std::endl << "============================================"
3048  // // << std::endl << std::endl;
3049  // }
3050  // else
3051  // {
3052 
3053  Boundaries_pt->insert(b);
3054 
3055  // }
3056  }
Scalar * b
Definition: benchVecAdd.cpp:17

References b, and Boundaries_pt.

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

◆ assign_additional_values_with_face_id()

virtual void oomph::BoundaryNodeBase::assign_additional_values_with_face_id ( const unsigned n_additional_value,
const unsigned face_id = 0 
)
pure virtual

Member function that 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

Implemented in oomph::BoundaryNode< NODE_TYPE >.

◆ boundary_coordinates_have_been_set_up()

bool oomph::BoundaryNodeBase::boundary_coordinates_have_been_set_up ( )
inline

Have boundary coordinates been set up?

2171  {
2172  return (Boundary_coordinates_pt != 0);
2173  }

References Boundary_coordinates_pt.

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

◆ get_boundaries_pt()

void oomph::BoundaryNodeBase::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

2178  {
2179  boundaries_pt = Boundaries_pt;
2180  }

References Boundaries_pt.

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

◆ get_coordinates_on_boundary() [1/2]

void oomph::BoundaryNodeBase::get_coordinates_on_boundary ( const unsigned b,
const unsigned k,
Vector< double > &  boundary_zeta 
)

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

Given the mesh boundary b, return the k-th generalised boundary coordinates of the node in the vector boundary_zeta

3167  {
3168  // Check that the node lies on a boundary
3169 #ifdef PARANOID
3170  if (Boundaries_pt == 0)
3171  {
3172  throw OomphLibError("Node does not lie on any boundary",
3175  }
3176 #endif
3177 
3178  // Does the node lie on the mesh boundary b
3179  if (!is_on_boundary(b))
3180  {
3181  std::ostringstream error_stream;
3182  error_stream << "Node is not on boundary " << b << std::endl;
3183 
3184  throw OomphLibError(
3185  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3186  }
3187 
3188 
3189 #ifdef PARANOID
3190  // Check that the boundary coordinates have been set
3191  if (Boundary_coordinates_pt == 0)
3192  {
3193  std::ostringstream error_stream;
3194  error_stream
3195  << "Boundary coordinates have not been set\n"
3196  << "[Note: In refineable problems, the boundary coordinates\n"
3197  << " will only be interpolated to newly created nodes\n"
3198  << " if Mesh::Boundary_coordinate_exists[...] has been\n"
3199  << " set to true!]\n";
3200  throw OomphLibError(
3201  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3202  }
3203 #endif
3204 
3205 
3206  // Find out how may coordinates there are from the map
3207  const unsigned nboundary_coord = (*Boundary_coordinates_pt)[b]->nrow();
3208 #ifdef PARANOID
3209  if (nboundary_coord != boundary_zeta.size())
3210  {
3211  std::ostringstream error_stream;
3212  error_stream << "Wrong number of coordinates in the vector boundary_zeta"
3213  << std::endl
3214  << "There are " << nboundary_coord << " boundary coordinates"
3215  << std::endl
3216  << "But bounday_zeta() has size " << boundary_zeta.size()
3217  << std::endl;
3218 
3219  throw OomphLibError(
3220  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3221  }
3222 #endif
3223 
3224  // Loop over and assign the coordinates
3225  for (unsigned i = 0; i < nboundary_coord; i++)
3226  {
3227  boundary_zeta[i] = (*(*Boundary_coordinates_pt)[b])(i, k);
3228  }
3229  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
bool is_on_boundary() const
Test whether the node lies on a boundary.
Definition: nodes.h:2189
char char char int int * k
Definition: level2_impl.h:374
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References b, Boundaries_pt, Boundary_coordinates_pt, i, is_on_boundary(), k, OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ get_coordinates_on_boundary() [2/2]

void oomph::BoundaryNodeBase::get_coordinates_on_boundary ( const unsigned b,
Vector< double > &  boundary_zeta 
)
inline

Return the vector of boundary coordinates on mesh boundary b.

2203  {
2204  // Just return the zero-th one
2205  get_coordinates_on_boundary(b, 0, boundary_zeta);
2206  }
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

References b.

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

◆ index_of_first_value_assigned_by_face_element() [1/2]

unsigned oomph::BoundaryNodeBase::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
inline

Return the index of the first value associated with the i-th face element value. If no argument id is specified we return the index associated with the first (and assumed to be only) face element attached to this node. If no values have been set by any FaceElements and throw_if_no_value_assigned_by_face_element is set to true, this is caught 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) by throwing an OomphLibError that can be caught gracefully. If throw_quietly is set to true we throw an OomphLibQuietException instead. You can catch either by catching the underlying std::runtime_error. In PARANOID mode we check regardless of the setting of throw_if_no_value_assigned_by_face_element (but respect the request for quietness). Returns UINT_MAX if error.

2102  {
2103  // Over-rule if paranoia rules
2104  bool local_throw_if_no_value_assigned_by_face_element =
2105  throw_if_no_value_assigned_by_face_element;
2106 #ifdef PARANOID
2107  local_throw_if_no_value_assigned_by_face_element = true;
2108 #endif
2109 
2110  if (local_throw_if_no_value_assigned_by_face_element)
2111  {
2113  {
2114  std::ostringstream error_message;
2115  error_message
2116  << "Index_of_first_value_assigned_by_face_element_pt==0;\n"
2117  << "Pointer must be set via call to: \n\n"
2118  << " BoundaryNode::assign_additional_values_with_face_id(...), "
2119  "\n\n"
2120  << "typically from FaceElement::add_additional_values(...).";
2121 
2122  if (throw_quietly)
2123  {
2124  throw OomphLibQuietException();
2125  }
2126  else
2127  {
2128  throw OomphLibError(error_message.str(),
2131  }
2132  return UINT_MAX;
2133  }
2134  }
2136  }

References Index_of_first_value_assigned_by_face_element_pt, OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ index_of_first_value_assigned_by_face_element() [2/2]

unsigned oomph::BoundaryNodeBase::index_of_first_value_assigned_by_face_element ( const unsigned face_id = 0) const
inline

Return the index of the first value associated with the i-th face element value. If no argument is specified we return the index 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.

2063  {
2064 #ifdef PARANOID
2066  {
2067  std::ostringstream error_message;
2068  error_message
2069  << "Index_of_first_value_assigned_by_face_element_pt==0;\n"
2070  << "Pointer must be set via call to: \n\n"
2071  << " BoundaryNode::assign_additional_values_with_face_id(...), \n\n"
2072  << "typically from FaceElement::add_additional_values(...).";
2073  throw OomphLibError(error_message.str(),
2076  return UINT_MAX;
2077  }
2078 #endif
2080  }

References Index_of_first_value_assigned_by_face_element_pt, OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

Referenced by ContactProblem< ELEMENT >::complete_problem_setup(), oomph::SurfaceMeltElement< ELEMENT >::disable_melting(), oomph::UnsteadyHeatFluxPseudoMeltElement< ELEMENT >::disable_melting(), oomph::NonlinearSurfaceContactElement< ELEMENT >::fill_in_contribution_to_residuals_surface_contact(), oomph::LinearSurfaceContactElement< ELEMENT >::fill_in_contribution_to_residuals_surface_contact(), oomph::HeatedLinearSurfaceContactElement< ELEMENT >::fill_in_contribution_to_residuals_surface_contact(), oomph::SurfaceMeltElement< ELEMENT >::fill_in_contribution_to_residuals_surface_melt(), oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::fill_in_generic_contribution_to_residuals_displ_lagr_multiplier(), oomph::FSIImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::fill_in_generic_contribution_to_residuals_fsi_displ_lagr_multiplier(), oomph::ImposeImpenetrabilityElement< ELEMENT >::fill_in_generic_contribution_to_residuals_parall_lagr_multiplier(), oomph::ImposeParallelOutflowElement< ELEMENT >::fill_in_generic_contribution_to_residuals_parall_lagr_multiplier(), oomph::LinearisedAxisymPoroelasticBJS_FSIElement< FLUID_BULK_ELEMENT, POROELASTICITY_BULK_ELEMENT >::fill_in_generic_residual_contribution_axisym_poroelastic_fsi(), oomph::LinearisedFSIAxisymmetricNStNoSlipBCElementElement< FLUID_BULK_ELEMENT, SOLID_BULK_ELEMENT >::fill_in_generic_residual_contribution_fsi_no_slip_axisym(), oomph::UnsteadyHeatFluxPseudoMeltElement< ELEMENT >::fill_in_generic_residual_contribution_ust_heat_flux(), oomph::ImposeImpenetrabilityElement< ELEMENT >::get_dof_numbers_for_unknowns(), oomph::ImposeParallelOutflowElement< ELEMENT >::get_dof_numbers_for_unknowns(), oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::get_dof_numbers_for_unknowns(), oomph::FSIImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::get_dof_numbers_for_unknowns(), oomph::SurfaceContactElementBase< ELEMENT >::get_interpolated_lagrange_p(), oomph::SurfaceMeltElement< ELEMENT >::get_interpolated_lagrange_p(), oomph::HeatedLinearSurfaceContactElement< ELEMENT >::heat_flux(), oomph::SurfaceMeltElement< ELEMENT >::interpolated_melt_rate(), oomph::UnsteadyHeatFluxPseudoMeltElement< ELEMENT >::output(), oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::output(), oomph::FSIImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::output(), oomph::UnsteadyHeatFluxPseudoMeltElement< ELEMENT >::plot_residual_landscape(), PressureWaveFSIProblem< FLUID_ELEMENT, SOLID_ELEMENT >::PressureWaveFSIProblem(), oomph::RefineableImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::refineable_fill_in_generic_contribution_to_residuals_displ_lagr_multiplier(), oomph::RefineableFSIImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::refineable_fill_in_generic_contribution_to_residuals_fsi_displ_lagr_multiplier(), oomph::NonlinearSurfaceContactElement< ELEMENT >::resulting_contact_force(), oomph::LinearSurfaceContactElement< ELEMENT >::resulting_contact_force(), oomph::SurfaceMeltElement< ELEMENT >::set_lagrange_multiplier_pressure_to_zero(), oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::square_of_l2_norm_of_error(), SurfactantProblem< ELEMENT, INTERFACE_ELEMENT >::SurfactantProblem(), and UnstructuredFSIProblem< FLUID_ELEMENT, SOLID_ELEMENT >::UnstructuredFSIProblem().

◆ index_of_first_value_assigned_by_face_element_pt()

std::map<unsigned, unsigned>*& oomph::BoundaryNodeBase::index_of_first_value_assigned_by_face_element_pt ( )
inline

◆ is_on_boundary() [1/2]

bool oomph::BoundaryNodeBase::is_on_boundary ( ) const
inline

◆ is_on_boundary() [2/2]

bool oomph::BoundaryNodeBase::is_on_boundary ( const unsigned b) const

Test whether the node lies on mesh boundary b.

Test whether the node lies on the mesh boundary b.

3100  {
3101  // If the node lies on any boundary
3102  if (Boundaries_pt != 0)
3103  {
3104  if (find(Boundaries_pt->begin(), Boundaries_pt->end(), b) !=
3105  Boundaries_pt->end())
3106  {
3107  return true;
3108  }
3109  }
3110 
3111  // If we haven't returned yet, then the node does not lie on the boundary
3112  return false;
3113  }

References b, and Boundaries_pt.

◆ make_node_periodic()

void oomph::BoundaryNodeBase::make_node_periodic ( Node *const &  node_pt,
Node *const &  copied_node_pt 
)
protected

Helper function that is used to turn BoundaryNodes into peridic boundary nodes by setting the data values of copied_node_pt to those of original_node_pt.

Helper function that is used to turn BoundaryNodes into peridic boundary nodes by setting the data values of copy_of_node_pt to those of copied_node_pt.

2953  {
2954  // Don't allow this node to already be a copy (you should clear it's
2955  // copied status first).
2956  if (node_pt->is_a_copy())
2957  {
2958  std::ostringstream error_stream;
2959  error_stream << "The node you are trying to make into a periodic copy is "
2960  "already a copy\n.";
2961  throw OomphLibError(
2962  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2963  }
2964 
2965  // If the node to be copied from is a copy then copy it's "copied_node_pt"
2966  // instead.
2967  if (copied_node_pt->is_a_copy())
2968  {
2969  make_node_periodic(node_pt, copied_node_pt->copied_node_pt());
2970  }
2971 
2972  // Otherwise just do it
2973  else
2974  {
2975  // Set the copied node pointer
2976  Copied_node_pt = copied_node_pt;
2977 
2978  // First copy the data values
2979  // Delete the storage allocated in the copy
2980  node_pt->delete_value_storage();
2981  // Now set the Value and Equation number pointers to be the same
2982  node_pt->Value = copied_node_pt->Value;
2983  node_pt->Eqn_number = copied_node_pt->Eqn_number;
2984 
2985  // Inform the node that it has been copied
2986  copied_node_pt->add_copy(node_pt);
2987  }
2988  }
void make_node_periodic(Node *const &node_pt, Node *const &original_node_pt)
Definition: nodes.cc:2951
void delete_value_storage()
Definition: nodes.cc:187

References oomph::Data::add_copy(), oomph::Node::copied_node_pt(), Copied_node_pt, oomph::Data::delete_value_storage(), oomph::Data::Eqn_number, oomph::Data::is_a_copy(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::Data::Value.

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

◆ make_nodes_periodic()

void oomph::BoundaryNodeBase::make_nodes_periodic ( Node *const &  copied_node_pt,
Vector< Node * > const &  periodic_copies_pt 
)
protected

Helper function that is used to turn BoundaryNodes into periodic boundary nodes by setting the data values of the nodes in the vector periodic_copies_pt to be the same as those in node_pt.

////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// Helper function that is used to turn BoundaryNodes into periodic boundary nodes by setting the data values of the nodes in the vector periodic_copies_pt to be the same as those in copied_node_pt. This function should be used when making doubly periodic sets of nodes.

2898  {
2899  // Don't allow copying if the original or periodic nodes are already
2900  // periodic
2901  bool already_a_copy = false;
2902  already_a_copy |= copied_node_pt->is_a_copy();
2903  const unsigned n_periodic = periodic_copies_pt.size();
2904  for (unsigned n = 0; n < n_periodic; n++)
2905  {
2906  already_a_copy |= periodic_copies_pt[n]->is_a_copy();
2907  }
2908 
2909  // If we have a copy bail
2910  if (already_a_copy)
2911  {
2912  std::ostringstream error_stream;
2913  error_stream
2914  << "The nodes you are trying to make periodic are already periodic\n"
2915  << "Or you are trying to make a copy of another already periodic "
2916  "node\n";
2917  error_stream << "Please copy the original data if you can\n";
2918  throw OomphLibError(
2919  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2920  }
2921 
2922  // Now we simply delete and copy over for each node
2923  for (unsigned n = 0; n < n_periodic; n++)
2924  {
2925  // Local cache of the node
2926  Node* const nod_pt = periodic_copies_pt[n];
2927  // Miss out the node itself if it's in the list
2928  if (nod_pt != copied_node_pt)
2929  {
2930  // Delete the storage allocated in the copy
2931  nod_pt->delete_value_storage();
2932  // Now set the Value and Equation number pointers to be the same
2933  nod_pt->Value = copied_node_pt->Value;
2934  nod_pt->Eqn_number = copied_node_pt->Eqn_number;
2935 
2936  // Set the copied node pointer in the copy
2937  BoundaryNodeBase* cast_nod_pt = dynamic_cast<BoundaryNodeBase*>(nod_pt);
2938  cast_nod_pt->Copied_node_pt = copied_node_pt;
2939  // Inform the node that it has been copied
2940  copied_node_pt->add_copy(nod_pt);
2941  }
2942  }
2943  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
BoundaryNodeBase()
Default constructor, set the pointers to the storage to NULL.
Definition: nodes.h:2152

References oomph::Data::add_copy(), Copied_node_pt, oomph::Data::delete_value_storage(), oomph::Data::Eqn_number, oomph::Data::is_a_copy(), n, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::Data::Value.

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

◆ ncoordinates_on_boundary()

unsigned oomph::BoundaryNodeBase::ncoordinates_on_boundary ( const unsigned b)

Get the number of boundary coordinates on mesh boundary b.

3120  {
3121  // Check that the node lies on a boundary
3122 #ifdef PARANOID
3123  if (Boundaries_pt == 0)
3124  {
3125  throw OomphLibError("Node does not lie on any boundary",
3128  }
3129 
3130 
3131  // Does the node lie on the mesh boundary b
3132  if (!is_on_boundary(b))
3133  {
3134  std::ostringstream error_stream;
3135  error_stream << "Node is not on boundary " << b << std::endl;
3136 
3137  throw OomphLibError(
3138  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3139  }
3140 
3141  // Check that the boundary coordinates have been set
3142  if (Boundary_coordinates_pt == 0)
3143  {
3144  std::ostringstream error_stream;
3145  error_stream
3146  << "Boundary coordinates have not been set\n"
3147  << "[Note: In refineable problems, the boundary coordinates\n"
3148  << " will only be interpolated to newly created nodes\n"
3149  << " if Mesh::Boundary_coordinate_exists[...] has been\n"
3150  << " set to true!]\n";
3151  throw OomphLibError(
3152  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3153  }
3154 #endif
3155 
3156  // Find out how may coordinates there are from the map
3157  return (*Boundary_coordinates_pt)[b]->nrow();
3158  }

References b, Boundaries_pt, Boundary_coordinates_pt, is_on_boundary(), OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

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

◆ nvalue_assigned_by_face_element()

virtual unsigned oomph::BoundaryNodeBase::nvalue_assigned_by_face_element ( const unsigned face_id = 0) const
pure virtual

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.

Implemented in oomph::BoundaryNode< NODE_TYPE >.

◆ operator=()

void oomph::BoundaryNodeBase::operator= ( const BoundaryNodeBase )
delete

Broken assignment operator.

◆ remove_from_boundary()

void oomph::BoundaryNodeBase::remove_from_boundary ( const unsigned b)

Remove the node from the mesh boundary b.

3063  {
3064 #ifdef PARANOID
3065  if (is_on_boundary(b) == false)
3066  {
3067  std::ostringstream error_stream;
3068  error_stream << "Node is not on boundary " << b << std::endl;
3069 
3070  throw OomphLibError(
3071  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3072  }
3073 #endif
3074 
3075  // Remove the boundary from the set
3076  Boundaries_pt->erase(b);
3077 
3078  // Need to delete the equivalent entry in the Boundary coordinate
3079  // map, if the storage has actually been allocated
3080  if (Boundary_coordinates_pt != 0)
3081  {
3082  // Delete the vector storage that has been allocated
3083  delete (*Boundary_coordinates_pt)[b];
3084  // Delete the entry in the map
3085  Boundary_coordinates_pt->erase(b);
3086  }
3087 
3088  // If all entries have been removed, delete the storage
3089  if (Boundaries_pt->size() == 0)
3090  {
3091  delete Boundaries_pt;
3092  Boundaries_pt = 0;
3093  }
3094  }

References b, Boundaries_pt, Boundary_coordinates_pt, is_on_boundary(), OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

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

◆ set_coordinates_on_boundary() [1/2]

void oomph::BoundaryNodeBase::set_coordinates_on_boundary ( const unsigned b,
const unsigned k,
const Vector< double > &  boundary_zeta 
)

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

Given the mesh boundary b, set the k-th generalised boundary coordinates of the node from the vector boundary_zeta

3238  {
3239  // Check that the node lies on a boundary
3240 #ifdef PARANOID
3241  if (Boundaries_pt == 0)
3242  {
3243  throw OomphLibError("Node does not lie on any boundary",
3246  }
3247 #endif
3248 
3249  // Does the node lie on the mesh boundary b
3250  if (!is_on_boundary(b))
3251  {
3252  std::ostringstream error_stream;
3253  error_stream << "Node is not on boundary " << b << std::endl;
3254 
3255  throw OomphLibError(
3256  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3257  }
3258 
3259  // If the storage has not been assigned, then assign it
3260  if (Boundary_coordinates_pt == 0)
3261  {
3262  Boundary_coordinates_pt = new std::map<unsigned, DenseMatrix<double>*>;
3263  }
3264 
3265 
3266  // Find the number of boundary coordinates
3267  const unsigned nboundary_coord = boundary_zeta.size();
3268 
3269  // Allocate the vector for the boundary coordinates, if we haven't already
3270  if ((*Boundary_coordinates_pt)[b] == 0)
3271  {
3272  // Need k+1 columns initially
3273  (*Boundary_coordinates_pt)[b] =
3274  new DenseMatrix<double>(nboundary_coord, k + 1);
3275  }
3276  // Otherwise resize it, in case the number of boundary coordinates
3277  // or the number of types has changed
3278  else
3279  {
3280  // Adjust number of boundary coordinates -- retain number of types
3281  unsigned ncol = (*Boundary_coordinates_pt)[b]->ncol();
3282  {
3283  (*Boundary_coordinates_pt)[b]->resize(nboundary_coord, ncol);
3284  }
3285 
3286  // Resize number of types if required
3287  if ((k + 1) > (*Boundary_coordinates_pt)[b]->ncol())
3288  {
3289  (*Boundary_coordinates_pt)[b]->resize(nboundary_coord, k + 1);
3290  }
3291  }
3292 
3293  // Loop over and assign the coordinates
3294  for (unsigned i = 0; i < nboundary_coord; i++)
3295  {
3296  (*(*Boundary_coordinates_pt)[b])(i, k) = boundary_zeta[i];
3297  }
3298  }

References b, Boundaries_pt, Boundary_coordinates_pt, i, is_on_boundary(), k, OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ set_coordinates_on_boundary() [2/2]

void oomph::BoundaryNodeBase::set_coordinates_on_boundary ( const unsigned b,
const Vector< double > &  boundary_zeta 
)
inline

Set the vector of boundary coordinates on mesh boundary b.

2212  {
2213  // Just do the zero-th one
2214  set_coordinates_on_boundary(b, 0, boundary_zeta);
2215  }
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.

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

Member Data Documentation

◆ Boundaries_pt

std::set<unsigned>* oomph::BoundaryNodeBase::Boundaries_pt
private

Pointer to set of mesh boundaries occupied by the Node; NULL if the Node is not on any boundaries

Referenced by add_to_boundary(), get_boundaries_pt(), get_coordinates_on_boundary(), is_on_boundary(), ncoordinates_on_boundary(), remove_from_boundary(), set_coordinates_on_boundary(), and ~BoundaryNodeBase().

◆ Boundary_coordinates_pt

std::map<unsigned, DenseMatrix<double>*>* oomph::BoundaryNodeBase::Boundary_coordinates_pt
private

Pointer to a map of pointers to intrinsic boundary coordinates of the Node, indexed by the boundary number. If the Node does not lie on a boundary this map should never be queried because unnecessary storage will then be allocated. Hence, it can only be accessed via the appropriate set and get functions.

Referenced by boundary_coordinates_have_been_set_up(), get_coordinates_on_boundary(), ncoordinates_on_boundary(), remove_from_boundary(), set_coordinates_on_boundary(), and ~BoundaryNodeBase().

◆ Copied_node_pt

◆ Index_of_first_value_assigned_by_face_element_pt

std::map<unsigned, unsigned>* oomph::BoundaryNodeBase::Index_of_first_value_assigned_by_face_element_pt
protected

Pointer to a map, indexed by the face element identifier it returns the position of the first face element value. If the Node does not lie on a face element this map should never be queried.

Referenced by oomph::BoundaryNode< NODE_TYPE >::assign_additional_values_with_face_id(), index_of_first_value_assigned_by_face_element(), index_of_first_value_assigned_by_face_element_pt(), oomph::BoundaryNode< NODE_TYPE >::nvalue_assigned_by_face_element(), oomph::BoundaryNode< NODE_TYPE >::~BoundaryNode(), and ~BoundaryNodeBase().


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