oomph::RectangleWithHoleAndAnnularRegionMesh< ELEMENT > Class Template Reference

Domain-based mesh for rectangular mesh with circular hole. More...

#include <rectangle_with_moving_cylinder_mesh.template.h>

+ Inheritance diagram for oomph::RectangleWithHoleAndAnnularRegionMesh< ELEMENT >:

Public Member Functions

 RectangleWithHoleAndAnnularRegionMesh (GeomObject *cylinder_pt, const double &annular_region_radius, const double &length, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 Domain-based mesh for rectangular mesh with circular hole. More...
 
 ~RectangleWithHoleAndAnnularRegionMesh ()
 
RectangleWithHoleAndAnnularRegionDomaindomain_pt ()
 Access function to the domain. More...
 
- Public Member Functions inherited from oomph::Mesh
 Mesh ()
 Default constructor. More...
 
 Mesh (const Vector< Mesh * > &sub_mesh_pt)
 
void merge_meshes (const Vector< Mesh * > &sub_mesh_pt)
 
virtual void setup_boundary_element_info ()
 
virtual void setup_boundary_element_info (std::ostream &outfile)
 
virtual void reset_boundary_element_info (Vector< unsigned > &ntmp_boundary_elements, Vector< Vector< unsigned >> &ntmp_boundary_elements_in_region, Vector< FiniteElement * > &deleted_elements)
 Virtual function to perform the reset boundary elements info rutines. More...
 
template<class BULK_ELEMENT >
void doc_boundary_coordinates (const unsigned &b, std::ofstream &the_file)
 
virtual void scale_mesh (const double &factor)
 
 Mesh (const Mesh &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const Mesh &)=delete
 Broken assignment operator. More...
 
virtual ~Mesh ()
 Virtual Destructor to clean up all memory. More...
 
void flush_element_and_node_storage ()
 
void flush_element_storage ()
 
void flush_node_storage ()
 
Node *& node_pt (const unsigned long &n)
 Return pointer to global node n. More...
 
Nodenode_pt (const unsigned long &n) const
 Return pointer to global node n (const version) More...
 
GeneralisedElement *& element_pt (const unsigned long &e)
 Return pointer to element e. More...
 
GeneralisedElementelement_pt (const unsigned long &e) const
 Return pointer to element e (const version) More...
 
const Vector< GeneralisedElement * > & element_pt () const
 Return reference to the Vector of elements. More...
 
Vector< GeneralisedElement * > & element_pt ()
 Return reference to the Vector of elements. More...
 
FiniteElementfinite_element_pt (const unsigned &e) const
 
Node *& boundary_node_pt (const unsigned &b, const unsigned &n)
 Return pointer to node n on boundary b. More...
 
Nodeboundary_node_pt (const unsigned &b, const unsigned &n) const
 Return pointer to node n on boundary b. More...
 
void set_nboundary (const unsigned &nbound)
 Set the number of boundaries in the mesh. More...
 
void remove_boundary_nodes ()
 Clear all pointers to boundary nodes. More...
 
void remove_boundary_nodes (const unsigned &b)
 
void remove_boundary_node (const unsigned &b, Node *const &node_pt)
 Remove a node from the boundary b. More...
 
void add_boundary_node (const unsigned &b, Node *const &node_pt)
 Add a (pointer to) a node to the b-th boundary. More...
 
void copy_boundary_node_data_from_nodes ()
 
bool boundary_coordinate_exists (const unsigned &i) const
 Indicate whether the i-th boundary has an intrinsic coordinate. More...
 
unsigned long nelement () const
 Return number of elements in the mesh. More...
 
unsigned long nnode () const
 Return number of nodes in the mesh. More...
 
unsigned ndof_types () const
 Return number of dof types in mesh. More...
 
unsigned elemental_dimension () const
 Return number of elemental dimension in mesh. More...
 
unsigned nodal_dimension () const
 Return number of nodal dimension in mesh. More...
 
void add_node_pt (Node *const &node_pt)
 Add a (pointer to a) node to the mesh. More...
 
void add_element_pt (GeneralisedElement *const &element_pt)
 Add a (pointer to) an element to the mesh. More...
 
virtual void node_update (const bool &update_all_solid_nodes=false)
 
virtual void reorder_nodes (const bool &use_old_ordering=true)
 
virtual void get_node_reordering (Vector< Node * > &reordering, const bool &use_old_ordering=true) const
 
template<class BULK_ELEMENT , template< class > class FACE_ELEMENT>
void build_face_mesh (const unsigned &b, Mesh *const &face_mesh_pt)
 
unsigned self_test ()
 Self-test: Check elements and nodes. Return 0 for OK. More...
 
void max_and_min_element_size (double &max_size, double &min_size)
 
double total_size ()
 
void check_inverted_elements (bool &mesh_has_inverted_elements, std::ofstream &inverted_element_file)
 
void check_inverted_elements (bool &mesh_has_inverted_elements)
 
unsigned check_for_repeated_nodes (const double &epsilon=1.0e-12)
 
Vector< Node * > prune_dead_nodes ()
 
unsigned nboundary () const
 Return number of boundaries. More...
 
unsigned long nboundary_node (const unsigned &ibound) const
 Return number of nodes on a particular boundary. More...
 
FiniteElementboundary_element_pt (const unsigned &b, const unsigned &e) const
 Return pointer to e-th finite element on boundary b. More...
 
Nodeget_some_non_boundary_node () const
 
unsigned nboundary_element (const unsigned &b) const
 Return number of finite elements that are adjacent to boundary b. More...
 
int face_index_at_boundary (const unsigned &b, const unsigned &e) const
 
virtual void dump (std::ofstream &dump_file, const bool &use_old_ordering=true) const
 Dump the data in the mesh into a file for restart. More...
 
void dump (const std::string &dump_file_name, const bool &use_old_ordering=true) const
 Dump the data in the mesh into a file for restart. More...
 
virtual void read (std::ifstream &restart_file)
 Read solution from restart file. More...
 
void output_paraview (std::ofstream &file_out, const unsigned &nplot) const
 
void output_fct_paraview (std::ofstream &file_out, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt) const
 
void output_fct_paraview (std::ofstream &file_out, const unsigned &nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt) const
 
void output (std::ostream &outfile)
 Output for all elements. More...
 
void output (std::ostream &outfile, const unsigned &n_plot)
 Output at f(n_plot) points in each element. More...
 
void output (FILE *file_pt)
 Output for all elements (C-style output) More...
 
void output (FILE *file_pt, const unsigned &nplot)
 Output at f(n_plot) points in each element (C-style output) More...
 
void output (const std::string &output_filename)
 Output for all elements. More...
 
void output (const std::string &output_filename, const unsigned &n_plot)
 Output at f(n_plot) points in each element. More...
 
void output_fct (std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt)
 Output a given Vector function at f(n_plot) points in each element. More...
 
void output_fct (std::ostream &outfile, const unsigned &n_plot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt)
 
void output_boundaries (std::ostream &outfile)
 Output the nodes on the boundaries (into separate tecplot zones) More...
 
void output_boundaries (const std::string &output_filename)
 
void assign_initial_values_impulsive ()
 Assign initial values for an impulsive start. More...
 
void shift_time_values ()
 
void calculate_predictions ()
 
void set_nodal_and_elemental_time_stepper (TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
 
virtual void set_mesh_level_time_stepper (TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
 
void set_consistent_pinned_values_for_continuation (ContinuationStorageScheme *const &continuation_stepper_pt)
 Set consistent values for pinned data in continuation. More...
 
bool does_pointer_correspond_to_mesh_data (double *const &parameter_pt)
 Does the double pointer correspond to any mesh data. More...
 
void set_nodal_time_stepper (TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
 Set the timestepper associated with the nodal data in the mesh. More...
 
void set_elemental_internal_time_stepper (TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
 
virtual void compute_norm (double &norm)
 
virtual void compute_norm (Vector< double > &norm)
 
virtual void compute_error (std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
 
virtual void compute_error (std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
 
virtual void compute_error (FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
 
virtual void compute_error (FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, Vector< double > &error, Vector< double > &norm)
 
virtual void compute_error (std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
 
virtual void compute_error (std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, Vector< double > &error, Vector< double > &norm)
 
virtual void compute_error (FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
 Returns the norm of the error and that of the exact solution. More...
 
virtual void compute_error (FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
 
bool is_mesh_distributed () const
 Boolean to indicate if Mesh has been distributed. More...
 
OomphCommunicatorcommunicator_pt () const
 
void delete_all_external_storage ()
 Wipe the storage for all externally-based elements. More...
 

Protected Attributes

RectangleWithHoleAndAnnularRegionDomainDomain_pt
 Pointer to the domain. More...
 
- Protected Attributes inherited from oomph::Mesh
Vector< Vector< Node * > > Boundary_node_pt
 
bool Lookup_for_elements_next_boundary_is_setup
 
Vector< Vector< FiniteElement * > > Boundary_element_pt
 
Vector< Vector< int > > Face_index_at_boundary
 
Vector< Node * > Node_pt
 Vector of pointers to nodes. More...
 
Vector< GeneralisedElement * > Element_pt
 Vector of pointers to generalised elements. More...
 
std::vector< boolBoundary_coordinate_exists
 

Additional Inherited Members

- Public Types inherited from oomph::Mesh
typedef void(FiniteElement::* SteadyExactSolutionFctPt) (const Vector< double > &x, Vector< double > &soln)
 
typedef void(FiniteElement::* UnsteadyExactSolutionFctPt) (const double &time, const Vector< double > &x, Vector< double > &soln)
 
- Static Public Attributes inherited from oomph::Mesh
static Steady< 0 > Default_TimeStepper
 The Steady Timestepper. More...
 
static bool Suppress_warning_about_empty_mesh_level_time_stepper_function
 Static boolean flag to control warning about mesh level timesteppers. More...
 
- Protected Member Functions inherited from oomph::Mesh
unsigned long assign_global_eqn_numbers (Vector< double * > &Dof_pt)
 Assign (global) equation numbers to the nodes. More...
 
void describe_dofs (std::ostream &out, const std::string &current_string) const
 
void describe_local_dofs (std::ostream &out, const std::string &current_string) const
 
void assign_local_eqn_numbers (const bool &store_local_dof_pt)
 Assign local equation numbers in all elements. More...
 
void convert_to_boundary_node (Node *&node_pt, const Vector< FiniteElement * > &finite_element_pt)
 
void convert_to_boundary_node (Node *&node_pt)
 

Detailed Description

template<class ELEMENT>
class oomph::RectangleWithHoleAndAnnularRegionMesh< ELEMENT >

Domain-based mesh for rectangular mesh with circular hole.

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

Constructor & Destructor Documentation

◆ RectangleWithHoleAndAnnularRegionMesh()

template<class ELEMENT >
oomph::RectangleWithHoleAndAnnularRegionMesh< ELEMENT >::RectangleWithHoleAndAnnularRegionMesh ( GeomObject cylinder_pt,
const double annular_region_radius,
const double length,
TimeStepper time_stepper_pt = &Mesh::Default_TimeStepper 
)

Domain-based mesh for rectangular mesh with circular hole.

Constructor: Pass pointer to geometric object that represents the cylinder, the length and height of the domain. The GeomObject must be parametrised such that \(\zeta \in [0,2\pi]\) sweeps around the circumference in anticlockwise direction. Timestepper defaults to Steady default timestepper.

///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// Constructor: Pass pointer to geometric object that represents the cylinder, the length and height of the domain. The GeomObject must be parametrised such that \(\zeta \in [0,2\pi]\) sweeps around the circumference in anticlockwise direction. Timestepper defaults to Steady default timestepper.

917  {
918  // Create the domain
919  Domain_pt = new RectangleWithHoleAndAnnularRegionDomain(
920  cylinder_pt, annular_region_radius, length);
921 
922  // Initialise the node counter
923  unsigned long node_count = 0;
924 
925  // Vectors used to get data from domains
926  Vector<double> s(2), r(2);
927 
928  // Setup temporary storage for the Nodes
929  Vector<Node*> tmp_node_pt;
930 
931  // Number of macro elements in the domain
932  unsigned nmacro_element = Domain_pt->nmacro_element();
933 
934  // Now blindly loop over the macro elements and associate a finite
935  // element with each
936  for (unsigned e = 0; e < nmacro_element; e++)
937  {
938  // Create the FiniteElement and add to the Element_pt Vector
939  Element_pt.push_back(new ELEMENT);
940 
941  // Read out the number of linear points in the element
942  unsigned np = dynamic_cast<ELEMENT*>(finite_element_pt(e))->nnode_1d();
943 
944  // Loop over nodes in the column
945  for (unsigned l1 = 0; l1 < np; l1++)
946  {
947  // Loop over the nodes in the row
948  for (unsigned l2 = 0; l2 < np; l2++)
949  {
950  // Allocate the memory for the node
951  tmp_node_pt.push_back(finite_element_pt(e)->construct_node(
952  l1 * np + l2, time_stepper_pt));
953 
954  // Read out the position of the node from the macro element
955  s[0] = -1.0 + 2.0 * double(l2) / double(np - 1);
956  s[1] = -1.0 + 2.0 * double(l1) / double(np - 1);
957 
958  // Use the macro element map from local coordinates to global
959  // coordinates
961 
962  // Set the position of the node
963  tmp_node_pt[node_count]->x(0) = r[0];
964  tmp_node_pt[node_count]->x(1) = r[1];
965 
966  // Increment the node number
967  node_count++;
968  }
969  } // for (unsigned l1=0;l1<np;l1++)
970  } // for (unsigned e=0;e<nmacro_element;e++)
971 
972  //----------------------------------------------------------------
973  // Now the elements have been created, but there will be nodes in
974  // common, need to loop over the common edges and sort it, by
975  // reassigning pointers and the deleting excess nodes.
976  //----------------------------------------------------------------
977  // Read out the number of linear points in the element
978  unsigned np = dynamic_cast<ELEMENT*>(finite_element_pt(0))->nnode_1d();
979 
980  // Edge between Elements 0 and 1 (miss out the node which coincides
981  // with 4 elements; this will be dealt with separately later)
982  for (unsigned n = 1; n < np; n++)
983  {
984  // Set the nodes in element 1 to be the same as in element 0
985  finite_element_pt(1)->node_pt(n * np) =
986  finite_element_pt(0)->node_pt((np * np - 1) - n);
987 
988  // Remove the nodes in element 1 from the temporary node list
989  delete tmp_node_pt[np * np + n * np];
990 
991  // Make the corresponding pointer a null pointer
992  tmp_node_pt[np * np + n * np] = 0;
993  }
994 
995  // Edge between Elements 0 and 3 (miss out the node which coincides
996  // with 4 elements; this will be dealt with separately later)
997  for (unsigned n = 0; n < np - 1; n++)
998  {
999  // Set the nodes in element 3 to be the same as in element 0
1001 
1002  // Remove the nodes in element 3 from the temporary node list
1003  delete tmp_node_pt[3 * np * np + n * np];
1004 
1005  // Make the corresponding pointer a null pointer
1006  tmp_node_pt[3 * np * np + n * np] = 0;
1007  }
1008 
1009  // Edge between Element 1 and 2 (miss out the node which coincides
1010  // with 4 elements; this will be dealt with separately later)
1011  for (unsigned n = 1; n < np; n++)
1012  {
1013  // Set the nodes in element 2 to be the same as in element 1
1014  finite_element_pt(2)->node_pt(np * (np - 1) + n) =
1015  finite_element_pt(1)->node_pt((np - 1) + n * np);
1016 
1017  // Remove the nodes in element 2 from the temporary node list
1018  delete tmp_node_pt[2 * np * np + np * (np - 1) + n];
1019 
1020  // Make the corresponding pointer a null pointer
1021  tmp_node_pt[2 * np * np + np * (np - 1) + n] = 0;
1022  }
1023 
1024  // Edge between Element 3 and 2 (miss out the node which coincides
1025  // with 4 elements; this will be dealt with separately later)
1026  for (unsigned n = 1; n < np; n++)
1027  {
1028  // Set the nodes in element 2 to be the same as in element 3
1029  finite_element_pt(2)->node_pt(n) =
1030  finite_element_pt(3)->node_pt((np * np - 1) - n * np);
1031 
1032  // Remove the nodes in element 2 from the temporary node list
1033  delete tmp_node_pt[2 * np * np + n];
1034 
1035  // Make the corresponding pointer a null pointer
1036  tmp_node_pt[2 * np * np + n] = 0;
1037  }
1038 
1039  // Edge between Elements 4 and 5 (miss out the node which coincides
1040  // with 4 elements; this will be dealt with separately later)
1041  for (unsigned n = 0; n < np - 1; n++)
1042  {
1043  // Set the nodes in element 1 to be the same as in element 0
1044  finite_element_pt(5)->node_pt(n * np) =
1045  finite_element_pt(4)->node_pt((np * np - 1) - n);
1046 
1047  // Remove the nodes in element 1 from the temporary node list
1048  delete tmp_node_pt[5 * np * np + n * np];
1049 
1050  // Make the corresponding pointer a null pointer
1051  tmp_node_pt[5 * np * np + n * np] = 0;
1052  }
1053 
1054  // Edge between Elements 4 and 7 (miss out the node which coincides
1055  // with 4 elements; this will be dealt with separately later)
1056  for (unsigned n = 1; n < np; n++)
1057  {
1058  // Set the nodes in element 3 to be the same as in element 0
1060 
1061  // Remove the nodes in element 3 from the temporary node list
1062  delete tmp_node_pt[7 * np * np + n * np];
1063 
1064  // Make the corresponding pointer a null pointer
1065  tmp_node_pt[7 * np * np + n * np] = 0;
1066  }
1067 
1068  // Edge between Element 5 and 6 (miss out the node which coincides
1069  // with 4 elements; this will be dealt with separately later)
1070  for (unsigned n = 0; n < np - 1; n++)
1071  {
1072  // Set the nodes in element 2 to be the same as in element 1
1073  finite_element_pt(6)->node_pt(np * (np - 1) + n) =
1074  finite_element_pt(5)->node_pt((n + 1) * np - 1);
1075 
1076  // Remove the nodes in element 2 from the temporary node list
1077  delete tmp_node_pt[6 * np * np + np * (np - 1) + n];
1078 
1079  // Make the corresponding pointer a null pointer
1080  tmp_node_pt[6 * np * np + np * (np - 1) + n] = 0;
1081  }
1082 
1083  // Edge between Element 7 and 6 (miss out the node which coincides
1084  // with 4 elements; this will be dealt with separately later)
1085  for (unsigned n = 0; n < np - 1; n++)
1086  {
1087  // Set the nodes in element 2 to be the same as in element 3
1088  finite_element_pt(6)->node_pt(n) =
1089  finite_element_pt(7)->node_pt((np * np - 1) - n * np);
1090 
1091  // Remove the nodes in element 2 from the temporary node list
1092  delete tmp_node_pt[6 * np * np + n];
1093 
1094  // Make the corresponding pointer a null pointer
1095  tmp_node_pt[6 * np * np + n] = 0;
1096  }
1097 
1098  // Edge between Elements 0 and 4 (miss out the corner nodes as they have
1099  // coincide with 4 elements rather than just 2)
1100  for (unsigned n = 1; n < np - 1; n++)
1101  {
1102  // Set the nodes in element 1 to be the same as in element 0
1103  finite_element_pt(0)->node_pt((np - 1) + n * np) =
1104  finite_element_pt(4)->node_pt(n * np);
1105 
1106  // Remove the nodes in element 1 from the temporary node list
1107  delete tmp_node_pt[(n + 1) * np - 1];
1108 
1109  // Make the corresponding pointer a null pointer
1110  tmp_node_pt[(n + 1) * np - 1] = 0;
1111  }
1112 
1113  // Edge between Elements 1 and 5 (miss out the corner nodes as they have
1114  // coincide with 4 elements rather than just 2)
1115  for (unsigned n = 1; n < np - 1; n++)
1116  {
1117  // Set the nodes in element 3 to be the same as in element 0
1118  finite_element_pt(1)->node_pt(n) =
1119  finite_element_pt(5)->node_pt(np * (np - 1) + n);
1120 
1121  // Remove the nodes in element 1 from the temporary node list
1122  delete tmp_node_pt[np * np + n];
1123 
1124  // Make the corresponding pointer a null pointer
1125  tmp_node_pt[np * np + n] = 0;
1126  }
1127 
1128  // Edge between Element 2 and 6 (miss out the corner nodes as they have
1129  // coincide with 4 elements rather than just 2)
1130  for (unsigned n = 1; n < np - 1; n++)
1131  {
1132  // Set the nodes in element 2 to be the same as in element 1
1133  finite_element_pt(2)->node_pt(np * (np - 1) - n * np) =
1134  finite_element_pt(6)->node_pt((np * np - 1) - n * np);
1135 
1136  // Remove the nodes in element 1 from the temporary node list
1137  delete tmp_node_pt[2 * np * np + np * (np - 1) - n * np];
1138 
1139  // Make the corresponding pointer a null pointer
1140  tmp_node_pt[2 * np * np + np * (np - 1) - n * np] = 0;
1141  }
1142 
1143  // Edge between Element 3 and 7 (miss out the corner nodes as they have
1144  // coincide with 4 elements rather than just 2)
1145  for (unsigned n = 1; n < np - 1; n++)
1146  {
1147  // Set the nodes in element 2 to be the same as in element 3
1148  finite_element_pt(3)->node_pt((np * np - 1) - n) =
1149  finite_element_pt(7)->node_pt((np - 1) - n);
1150 
1151  // Remove the nodes in element 1 from the temporary node list
1152  delete tmp_node_pt[3 * np * np + (np * np - 1) - n];
1153 
1154  // Make the corresponding pointer a null pointer
1155  tmp_node_pt[3 * np * np + (np * np - 1) - n] = 0;
1156  }
1157 
1158  //--------------------------------------------------------------------
1159  // Now we'll deal with the corner nodes which lie in 4 elements rather
1160  // than just two elements. There are four of these to deal with.
1161  // Specifically:
1162  // Node 0: Lies in elements 0, 3, 4 and 7 (copy from element 0)
1163  // Node 1: Lies in elements 0, 1, 4 and 5 (copy from element 0)
1164  // Node 2: Lies in elements 1, 2, 5 and 6 (copy from element 1)
1165  // Node 3: Lies in elements 2, 3, 6 and 7 (copy from element 2)
1166  //--------------------------------------------------------------------
1167  //---------------
1168  // Corner node 0:
1169  //---------------
1170  // Set the corner node in element 3 to be the same as in element 0
1171  finite_element_pt(3)->node_pt(np * (np - 1)) =
1172  finite_element_pt(0)->node_pt(np - 1);
1173 
1174  // Set the corner node in element 4 to be the same as in element 0
1175  finite_element_pt(4)->node_pt(0) = finite_element_pt(0)->node_pt(np - 1);
1176 
1177  // Set the corner node in element 7 to be the same as in element 0
1178  finite_element_pt(7)->node_pt(0) = finite_element_pt(0)->node_pt(np - 1);
1179 
1180  // Remove the overwritten node in element 3 from the temporary node list
1181  delete tmp_node_pt[3 * np * np + np * (np - 1)];
1182 
1183  // Make the corresponding pointer a null pointer
1184  tmp_node_pt[3 * np * np + np * (np - 1)] = 0;
1185 
1186  // Remove the overwritten node in element 4 from the temporary node list
1187  delete tmp_node_pt[4 * np * np];
1188 
1189  // Make the corresponding pointer a null pointer
1190  tmp_node_pt[4 * np * np] = 0;
1191 
1192  // Remove the overwritten node in element 7 from the temporary node list
1193  delete tmp_node_pt[7 * np * np];
1194 
1195  // Make the corresponding pointer a null pointer
1196  tmp_node_pt[7 * np * np] = 0;
1197 
1198  //---------------
1199  // Corner node 1:
1200  //---------------
1201  // Set the corner node in element 3 to be the same as in element 0
1202  finite_element_pt(1)->node_pt(0) =
1203  finite_element_pt(0)->node_pt(np * np - 1);
1204 
1205  // Set the corner node in element 4 to be the same as in element 0
1206  finite_element_pt(4)->node_pt(np * (np - 1)) =
1207  finite_element_pt(0)->node_pt(np * np - 1);
1208 
1209  // Set the corner node in element 7 to be the same as in element 0
1210  finite_element_pt(5)->node_pt(np * (np - 1)) =
1211  finite_element_pt(0)->node_pt(np * np - 1);
1212 
1213  // Remove the overwritten node in element 1 from the temporary node list
1214  delete tmp_node_pt[np * np];
1215 
1216  // Make the corresponding pointer a null pointer
1217  tmp_node_pt[np * np] = 0;
1218 
1219  // Remove the overwritten node in element 4 from the temporary node list
1220  delete tmp_node_pt[4 * np * np + np * (np - 1)];
1221 
1222  // Make the corresponding pointer a null pointer
1223  tmp_node_pt[4 * np * np + np * (np - 1)] = 0;
1224 
1225  // Remove the overwritten node in element 5 from the temporary node list
1226  delete tmp_node_pt[5 * np * np + np * (np - 1)];
1227 
1228  // Make the corresponding pointer a null pointer
1229  tmp_node_pt[5 * np * np + np * (np - 1)] = 0;
1230 
1231  //---------------
1232  // Corner node 2:
1233  //---------------
1234  // Set the corner node in element 2 to be the same as in element 1
1235  finite_element_pt(2)->node_pt(np * (np - 1)) =
1236  finite_element_pt(1)->node_pt(np - 1);
1237 
1238  // Set the corner node in element 5 to be the same as in element 1
1239  finite_element_pt(5)->node_pt(np * np - 1) =
1240  finite_element_pt(1)->node_pt(np - 1);
1241 
1242  // Set the corner node in element 6 to be the same as in element 1
1243  finite_element_pt(6)->node_pt(np * np - 1) =
1244  finite_element_pt(1)->node_pt(np - 1);
1245 
1246  // Remove the overwritten node in element 2 from the temporary node list
1247  delete tmp_node_pt[2 * np * np + np * (np - 1)];
1248 
1249  // Make the corresponding pointer a null pointer
1250  tmp_node_pt[2 * np * np + np * (np - 1)] = 0;
1251 
1252  // Remove the overwritten node in element 5 from the temporary node list
1253  delete tmp_node_pt[5 * np * np + np * np - 1];
1254 
1255  // Make the corresponding pointer a null pointer
1256  tmp_node_pt[5 * np * np + np * np - 1] = 0;
1257 
1258  // Remove the overwritten node in element 6 from the temporary node list
1259  delete tmp_node_pt[6 * np * np + np * np - 1];
1260 
1261  // Make the corresponding pointer a null pointer
1262  tmp_node_pt[6 * np * np + np * np - 1] = 0;
1263 
1264  //---------------
1265  // Corner node 3:
1266  //---------------
1267  // Set the corner node in element 3 to be the same as in element 2
1268  finite_element_pt(3)->node_pt(np * np - 1) =
1269  finite_element_pt(2)->node_pt(0);
1270 
1271  // Set the corner node in element 4 to be the same as in element 2
1272  finite_element_pt(6)->node_pt(np - 1) = finite_element_pt(2)->node_pt(0);
1273 
1274  // Set the corner node in element 7 to be the same as in element 2
1275  finite_element_pt(7)->node_pt(np - 1) = finite_element_pt(2)->node_pt(0);
1276 
1277  // Remove the overwritten node in element 2 from the temporary node list
1278  delete tmp_node_pt[3 * np * np + np * np - 1];
1279 
1280  // Make the corresponding pointer a null pointer
1281  tmp_node_pt[3 * np * np + np * np - 1] = 0;
1282 
1283  // Remove the overwritten node in element 5 from the temporary node list
1284  delete tmp_node_pt[6 * np * np + np - 1];
1285 
1286  // Make the corresponding pointer a null pointer
1287  tmp_node_pt[6 * np * np + np - 1] = 0;
1288 
1289  // Remove the overwritten node in element 6 from the temporary node list
1290  delete tmp_node_pt[7 * np * np + np - 1];
1291 
1292  // Make the corresponding pointer a null pointer
1293  tmp_node_pt[7 * np * np + np - 1] = 0;
1294 
1295  //----------------------------------------------------------------------
1296  // Now all the nodes have been set up and the nodes which coincided with
1297  // each other have been deleted and the correct pointers have been set.
1298  // All that remains is to copy the nodes in the temporary storage into
1299  // the global storage vector Node_pt.
1300  //----------------------------------------------------------------------
1301  // Now set the actual true nodes
1302  for (unsigned long n = 0; n < node_count; n++)
1303  {
1304  // If it's not a null pointer
1305  if (tmp_node_pt[n] != 0)
1306  {
1307  // Add it to the global Node list
1308  Node_pt.push_back(tmp_node_pt[n]);
1309  }
1310  } // for (unsigned long n=0;n<node_count;n++)
1311 
1312  //-------------------------------------------------------------
1313  // Now sort out which boundary each node lies on. The outer box
1314  // has boundary numbering 0 for the South face, 1 for the East
1315  // face, 2 for the North face and 3 for the West face. Finally,
1316  // the cylinder boundary corresponds to boundary 4.
1317  //-------------------------------------------------------------
1318  // Finally set the nodes on the boundaries
1319  set_nboundary(5);
1320 
1321  // Loop over the nodes along an edge
1322  for (unsigned n = 0; n < np; n++)
1323  {
1324  // West face
1325  Node* nod_pt = finite_element_pt(0)->node_pt(n * np);
1326  convert_to_boundary_node(nod_pt);
1327  add_boundary_node(3, nod_pt);
1328 
1329  // North face
1330  nod_pt = finite_element_pt(1)->node_pt(np * (np - 1) + n);
1331  convert_to_boundary_node(nod_pt);
1332  add_boundary_node(2, nod_pt);
1333 
1334  // East face
1335  nod_pt = finite_element_pt(2)->node_pt(n * np + np - 1);
1336  convert_to_boundary_node(nod_pt);
1337  add_boundary_node(1, nod_pt);
1338 
1339  // South face
1340  nod_pt = finite_element_pt(3)->node_pt(n);
1341  convert_to_boundary_node(nod_pt);
1342  add_boundary_node(0, nod_pt);
1343  }
1344 
1345  // Loop over all but one node on an edge
1346  for (unsigned n = 0; n < np - 1; n++)
1347  {
1348  // First part of hole
1349  Node* nod_pt = finite_element_pt(4)->node_pt((np - 1) + n * np);
1350  convert_to_boundary_node(nod_pt);
1351  add_boundary_node(4, nod_pt);
1352 
1353  // Next part of hole
1354  nod_pt = finite_element_pt(5)->node_pt(n);
1355  convert_to_boundary_node(nod_pt);
1356  add_boundary_node(4, nod_pt);
1357 
1358  // Next part of hole
1359  nod_pt = finite_element_pt(6)->node_pt(np * (np - 1) - n * np);
1360  convert_to_boundary_node(nod_pt);
1361  add_boundary_node(4, nod_pt);
1362 
1363  // Final part of hole boundary
1364  nod_pt = finite_element_pt(7)->node_pt((np * np - 1) - n);
1365  convert_to_boundary_node(nod_pt);
1366  add_boundary_node(4, nod_pt);
1367  }
1368 
1369 #ifdef PARANOID
1370  // Make sure there are no duplicate nodes (i.e. two or more nodes that
1371  // occupy the same Eulerian position)
1373  {
1374  // Throw a warning
1375  OomphLibWarning("The mesh contains repeated nodes!\n",
1378  }
1379 #endif
1380  } // End of RectangleWithHoleAndAnnularRegionMesh
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Array< double, 1, 3 > e(1./3., 0.5, 2.)
unsigned nmacro_element()
Number of macro elements in domain.
Definition: domain.h:123
MacroElement * macro_element_pt(const unsigned &i)
Access to i-th macro element.
Definition: domain.h:116
virtual Node * construct_node(const unsigned &n)
Definition: elements.h:2509
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
void macro_map(const Vector< double > &s, Vector< double > &r)
The mapping from local to global coordinates at the current time : r(s)
Definition: macro_element.h:126
void add_boundary_node(const unsigned &b, Node *const &node_pt)
Add a (pointer to) a node to the b-th boundary.
Definition: mesh.cc:243
Vector< Node * > Node_pt
Vector of pointers to nodes.
Definition: mesh.h:183
FiniteElement * finite_element_pt(const unsigned &e) const
Definition: mesh.h:473
void set_nboundary(const unsigned &nbound)
Set the number of boundaries in the mesh.
Definition: mesh.h:505
unsigned check_for_repeated_nodes(const double &epsilon=1.0e-12)
Definition: mesh.h:752
void convert_to_boundary_node(Node *&node_pt, const Vector< FiniteElement * > &finite_element_pt)
Definition: mesh.cc:2590
Vector< GeneralisedElement * > Element_pt
Vector of pointers to generalised elements.
Definition: mesh.h:186
RectangleWithHoleAndAnnularRegionDomain * Domain_pt
Pointer to the domain.
Definition: rectangle_with_moving_cylinder_mesh.template.h:256
RealScalar s
Definition: level1_cplx_impl.h:130
r
Definition: UniformPSDSelfTest.py:20
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References e(), n, oomph::Domain::nmacro_element(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, UniformPSDSelfTest::r, oomph::RectangleWithHoleAndAnnularRegionDomain::RectangleWithHoleAndAnnularRegionDomain(), and s.

◆ ~RectangleWithHoleAndAnnularRegionMesh()

Destructor: We made the Domain object so we have a responsibility for deleting it!

234  {
235  // If it's a non-null pointer (don't know why it shouldn't be but
236  // still...)
237  if (Domain_pt != 0)
238  {
239  // Delete the domain pointer
240  delete Domain_pt;
241 
242  // Make it a null pointer
243  Domain_pt = 0;
244  }
245  } // End of ~RectangleWithHoleAndAnnularRegionMesh

References oomph::RectangleWithHoleAndAnnularRegionMesh< ELEMENT >::Domain_pt.

Member Function Documentation

◆ domain_pt()

template<class ELEMENT >
RectangleWithHoleAndAnnularRegionDomain* oomph::RectangleWithHoleAndAnnularRegionMesh< ELEMENT >::domain_pt ( )
inline

Access function to the domain.

249  {
250  // Return a pointer to the Domain object defining the domain
251  return Domain_pt;
252  }

References oomph::RectangleWithHoleAndAnnularRegionMesh< ELEMENT >::Domain_pt.

Member Data Documentation

◆ Domain_pt


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