oomph::RefineableQuadMeshWithMovingCylinder< ELEMENT > Class Template Reference

My Mesh. More...

#include <rectangle_with_moving_cylinder_mesh.template.h>

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

Public Member Functions

 RefineableQuadMeshWithMovingCylinder (GeomObject *cylinder_pt, const double &annular_region_radius, const double &length_of_central_box, const double &x_left, const double &x_right, const double &height, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
 ~RefineableQuadMeshWithMovingCylinder ()
 
- Public Member Functions inherited from oomph::RefineableQuadMesh< ELEMENT >
 RefineableQuadMesh ()
 Constructor: Setup static quadtree data. More...
 
 RefineableQuadMesh (const RefineableQuadMesh &dummy)=delete
 Broken copy constructor. More...
 
virtual ~RefineableQuadMesh ()
 Broken assignment operator. More...
 
virtual void setup_tree_forest ()
 
void setup_quadtree_forest ()
 
- Public Member Functions inherited from oomph::TreeBasedRefineableMesh< ELEMENT >
 TreeBasedRefineableMesh ()
 Constructor, call the constructor of the base class. More...
 
 TreeBasedRefineableMesh (const TreeBasedRefineableMesh &dummy)=delete
 Broken copy constructor. More...
 
virtual ~TreeBasedRefineableMesh ()
 Empty virtual destructor. More...
 
- Public Member Functions inherited from oomph::TreeBasedRefineableMeshBase
 TreeBasedRefineableMeshBase ()
 Constructor. More...
 
 TreeBasedRefineableMeshBase (const TreeBasedRefineableMeshBase &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const TreeBasedRefineableMeshBase &)=delete
 Broken assignment operator. More...
 
virtual ~TreeBasedRefineableMeshBase ()
 Empty Destructor: More...
 
void adapt (const Vector< double > &elemental_error)
 
void p_adapt (const Vector< double > &elemental_error)
 
void refine_uniformly (DocInfo &doc_info)
 Refine mesh uniformly and doc process. More...
 
void refine_uniformly ()
 Refine mesh uniformly. More...
 
void p_refine_uniformly (DocInfo &doc_info)
 p-refine mesh uniformly and doc process More...
 
void p_refine_uniformly ()
 p-refine mesh uniformly More...
 
unsigned unrefine_uniformly ()
 
void p_unrefine_uniformly (DocInfo &doc_info)
 p-unrefine mesh uniformly More...
 
TreeForestforest_pt ()
 Return pointer to the Forest represenation of the mesh. More...
 
void doc_adaptivity_targets (std::ostream &outfile)
 Doc the targets for mesh adaptation. More...
 
unsignedmax_refinement_level ()
 Access fct for max. permissible refinement level (relative to base mesh) More...
 
unsignedmin_refinement_level ()
 Access fct for min. permissible refinement level (relative to base mesh) More...
 
unsignedmax_p_refinement_level ()
 
unsignedmin_p_refinement_level ()
 
virtual void adapt_mesh (DocInfo &doc_info)
 
virtual void adapt_mesh ()
 
void p_adapt_mesh (DocInfo &doc_info)
 
void p_adapt_mesh ()
 
virtual void refine_selected_elements (const Vector< unsigned > &elements_to_be_refined)
 
virtual void refine_selected_elements (const Vector< RefineableElement * > &elements_to_be_refined)
 
void p_refine_selected_elements (const Vector< unsigned > &elements_to_be_refined)
 p-refine mesh by refining the elements identified by their numbers. More...
 
void p_refine_selected_elements (const Vector< PRefineableElement * > &elements_to_be_refined_pt)
 p-refine mesh by refining the elements identified by their pointers. More...
 
virtual void refine_base_mesh_as_in_reference_mesh (TreeBasedRefineableMeshBase *const &ref_mesh_pt)
 Refine to same degree as the reference mesh. More...
 
virtual bool refine_base_mesh_as_in_reference_mesh_minus_one (TreeBasedRefineableMeshBase *const &ref_mesh_pt)
 
virtual void refine_as_in_reference_mesh (TreeBasedRefineableMeshBase *const &ref_mesh_pt)
 
virtual void get_refinement_levels (unsigned &min_refinement_level, unsigned &max_refinement_level)
 Get max/min refinement levels in mesh. More...
 
virtual void get_elements_at_refinement_level (unsigned &refinement_level, Vector< RefineableElement * > &level_elements)
 
virtual void get_refinement_pattern (Vector< Vector< unsigned >> &to_be_refined)
 
void refine_base_mesh (Vector< Vector< unsigned >> &to_be_refined)
 Refine base mesh according to specified refinement pattern. More...
 
virtual void refine (std::ifstream &restart_file)
 Refine mesh according to refinement pattern in restart file. More...
 
virtual void dump_refinement (std::ostream &outfile)
 Dump refinement pattern to allow for rebuild. More...
 
virtual void read_refinement (std::ifstream &restart_file, Vector< Vector< unsigned >> &to_be_refined)
 Read refinement pattern to allow for rebuild. More...
 
unsigned uniform_refinement_level_when_pruned () const
 
unsigneduniform_refinement_level_when_pruned ()
 Level to which the mesh was uniformly refined when it was pruned. More...
 
- Public Member Functions inherited from oomph::RefineableMeshBase
bool adapt_flag ()
 
 RefineableMeshBase ()
 
 RefineableMeshBase (const RefineableMeshBase &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const RefineableMeshBase &)=delete
 Broken assignment operator. More...
 
virtual ~RefineableMeshBase ()
 Empty Destructor: More...
 
unsigned nrefined ()
 Access fct for number of elements that were refined. More...
 
unsigned nunrefined ()
 Access fct for number of elements that were unrefined. More...
 
unsignednrefinement_overruled ()
 
unsignedmax_keep_unrefined ()
 
ErrorEstimator *& spatial_error_estimator_pt ()
 Access to spatial error estimator. More...
 
ErrorEstimatorspatial_error_estimator_pt () const
 Access to spatial error estimator (const version. More...
 
doublemin_permitted_error ()
 
doublemax_permitted_error ()
 
doublemin_error ()
 
doublemax_error ()
 
DocInfo *& doc_info_pt ()
 Access fct for pointer to DocInfo. More...
 
void enable_adaptation ()
 Enable adaptation. More...
 
void disable_adaptation ()
 Disable adaptation. More...
 
void enable_p_adaptation ()
 Enable adaptation. More...
 
void disable_p_adaptation ()
 Disable adaptation. More...
 
void enable_additional_synchronisation_of_hanging_nodes ()
 Enable additional synchronisation of hanging nodes. More...
 
void disable_additional_synchronisation_of_hanging_nodes ()
 Disable additional synchronisation of hanging nodes. More...
 
bool is_adaptation_enabled () const
 Return whether the mesh is to be adapted. More...
 
bool is_p_adaptation_enabled () const
 Return whether the mesh is to be adapted. More...
 
bool is_additional_synchronisation_of_hanging_nodes_disabled () const
 Return whether additional synchronisation is enabled. More...
 
DocInfo doc_info ()
 Access fct for DocInfo. More...
 
void p_unrefine_uniformly (DocInfo &doc_info)
 p-unrefine mesh uniformly 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 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...
 
- Public Member Functions inherited from oomph::QuadMeshBase
 QuadMeshBase ()
 Constructor (empty) More...
 
 QuadMeshBase (const QuadMeshBase &node)=delete
 Broken copy constructor. More...
 
void operator= (const QuadMeshBase &)=delete
 Broken assignment operator. More...
 
virtual ~QuadMeshBase ()
 Destructor (empty) More...
 
void setup_boundary_element_info ()
 
void setup_boundary_element_info (std::ostream &outfile)
 

Private Attributes

RefineableRectangleWithHoleAndAnnularRegionMesh< ELEMENT > * Central_mesh_pt
 
bool Coarse_problem
 

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::TreeBasedRefineableMeshBase
void complete_hanging_nodes (const int &ncont_interpolated_values)
 Complete the hanging node scheme recursively. More...
 
void complete_hanging_nodes_recursively (Node *&nod_pt, Vector< Node * > &master_nodes, Vector< double > &hang_weights, const int &ival)
 Auxiliary routine for recursive hanging node completion. 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)
 
- Protected Attributes inherited from oomph::TreeBasedRefineableMeshBase
unsigned Uniform_refinement_level_when_pruned
 Level to which the mesh was uniformly refined when it was pruned. More...
 
unsigned Max_refinement_level
 Max. permissible refinement level (relative to base mesh) More...
 
unsigned Min_refinement_level
 Min. permissible refinement level (relative to base mesh) More...
 
unsigned Max_p_refinement_level
 Max. permissible p-refinement level (relative to base mesh) More...
 
unsigned Min_p_refinement_level
 Min. permissible p-refinement level (relative to base mesh) More...
 
TreeForestForest_pt
 Forest representation of the mesh. More...
 
- Protected Attributes inherited from oomph::RefineableMeshBase
ErrorEstimatorSpatial_error_estimator_pt
 Pointer to spatial error estimator. More...
 
double Max_permitted_error
 Max. error (i.e. split elements if their error is larger) More...
 
double Min_permitted_error
 Min. error (i.e. (try to) merge elements if their error is smaller) More...
 
double Min_error
 Min.actual error. More...
 
double Max_error
 Max. actual error. More...
 
unsigned Nrefined
 Stats: Number of elements that were refined. More...
 
unsigned Nunrefined
 Stats: Number of elements that were unrefined. More...
 
bool Adapt_flag
 Flag that requests adaptation. More...
 
bool P_adapt_flag
 Flag that requests p-adaptation. More...
 
bool Additional_synchronisation_of_hanging_nodes_not_required
 Flag that disables additional synchronisation of hanging nodes. More...
 
DocInfoDoc_info_pt
 Pointer to DocInfo. More...
 
unsigned Max_keep_unrefined
 
unsigned Nrefinement_overruled
 
- 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
 

Detailed Description

template<class ELEMENT>
class oomph::RefineableQuadMeshWithMovingCylinder< ELEMENT >

My Mesh.

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

Constructor & Destructor Documentation

◆ RefineableQuadMeshWithMovingCylinder()

template<class ELEMENT >
oomph::RefineableQuadMeshWithMovingCylinder< ELEMENT >::RefineableQuadMeshWithMovingCylinder ( GeomObject cylinder_pt,
const double annular_region_radius,
const double length_of_central_box,
const double x_left,
const double x_right,
const double height,
TimeStepper time_stepper_pt = &Mesh::Default_TimeStepper 
)

Constructor. Pass pointer to geometric object that represents the cylinder; hierher 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; hierher 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.

1403  {
1404  // Do you want a coarse problem?
1405  Coarse_problem = false; // true; // hierher
1406 
1407  // Vector for pointers to all the temporary meshes
1408  Vector<Mesh*> all_temp_mesh_pt;
1409 
1410  // Build central mesh
1411  Central_mesh_pt =
1412  new RefineableRectangleWithHoleAndAnnularRegionMesh<ELEMENT>(
1413  cylinder_pt,
1414  annular_region_radius,
1415  length_of_central_box,
1416  time_stepper_pt);
1417 
1418  // Add this mesh to the list of temproary meshes
1419  all_temp_mesh_pt.push_back(Central_mesh_pt);
1420 
1421  // Bulk mesh left boundary id
1422  unsigned int left_boundary_id = 3;
1423 
1424  // Bulk mesh top boundary id
1425  unsigned int top_boundary_id = 2;
1426 
1427  // Bulk mesh right boundary id
1428  unsigned int right_boundary_id = 1;
1429 
1430  // Bulk mesh bottom boundary id
1431  unsigned int bottom_boundary_id = 0;
1432 
1433  // Build the surrounding meshes
1434 
1435  // Right mesh
1436  double l_right = x_right - 0.5 * length_of_central_box;
1437  unsigned n_right =
1438  std::max(unsigned(1), unsigned(l_right / length_of_central_box));
1439  if (Coarse_problem)
1440  {
1441  n_right = 1;
1442  }
1443 
1444  Mesh* surrounding_right_mesh_pt =
1445  TwoDimensionalPMLHelper::create_right_pml_mesh<PMLLayerElement<ELEMENT>>(
1446  Central_mesh_pt, right_boundary_id, n_right, l_right, time_stepper_pt);
1447 
1448  all_temp_mesh_pt.push_back(surrounding_right_mesh_pt);
1449 
1450  // Remove nodes from top and bottom boundaries (0 and 2)
1451  for (unsigned ibound_rm = 0; ibound_rm <= 2; ibound_rm += 2)
1452  {
1453  unsigned num_nod = surrounding_right_mesh_pt->nboundary_node(ibound_rm);
1454  for (unsigned inod = 0; inod < num_nod; inod++)
1455  {
1456  Node* nod_pt =
1457  surrounding_right_mesh_pt->boundary_node_pt(ibound_rm, inod);
1458  if (nod_pt->is_on_boundary(ibound_rm))
1459  {
1460  nod_pt->remove_from_boundary(ibound_rm);
1461  }
1462  }
1463  }
1464 
1465  // Top mesh
1466  double l_top = 0.5 * height - 0.5 * length_of_central_box;
1467  unsigned n_top =
1468  std::max(unsigned(1), unsigned(l_top / length_of_central_box));
1469  if (Coarse_problem)
1470  {
1471  n_top = 1;
1472  }
1473  Mesh* surrounding_top_mesh_pt =
1474  TwoDimensionalPMLHelper::create_top_pml_mesh<PMLLayerElement<ELEMENT>>(
1475  Central_mesh_pt, top_boundary_id, n_top, l_top, time_stepper_pt);
1476  all_temp_mesh_pt.push_back(surrounding_top_mesh_pt);
1477 
1478  // Remove nodes from right and left boundaries (1 and 3)
1479  for (unsigned ibound_rm = 1; ibound_rm <= 3; ibound_rm += 2)
1480  {
1481  unsigned num_nod = surrounding_top_mesh_pt->nboundary_node(ibound_rm);
1482  for (unsigned inod = 0; inod < num_nod; inod++)
1483  {
1484  Node* nod_pt =
1485  surrounding_top_mesh_pt->boundary_node_pt(ibound_rm, inod);
1486  if (nod_pt->is_on_boundary(ibound_rm))
1487  {
1488  nod_pt->remove_from_boundary(ibound_rm);
1489  }
1490  }
1491  }
1492 
1493 
1494  // Left mesh
1495  double l_left = -0.5 * length_of_central_box - x_left;
1496  unsigned n_left =
1497  std::max(unsigned(1), unsigned(l_left / length_of_central_box));
1498  if (Coarse_problem)
1499  {
1500  n_left = 1;
1501  }
1502  Mesh* surrounding_left_mesh_pt =
1503  TwoDimensionalPMLHelper::create_left_pml_mesh<PMLLayerElement<ELEMENT>>(
1504  Central_mesh_pt, left_boundary_id, n_left, l_left, time_stepper_pt);
1505  all_temp_mesh_pt.push_back(surrounding_left_mesh_pt);
1506 
1507  // Remove nodes from top and bottom boundaries (0 and 2)
1508  for (unsigned ibound_rm = 0; ibound_rm <= 2; ibound_rm += 2)
1509  {
1510  unsigned num_nod = surrounding_left_mesh_pt->nboundary_node(ibound_rm);
1511  for (unsigned inod = 0; inod < num_nod; inod++)
1512  {
1513  Node* nod_pt =
1514  surrounding_left_mesh_pt->boundary_node_pt(ibound_rm, inod);
1515  if (nod_pt->is_on_boundary(ibound_rm))
1516  {
1517  nod_pt->remove_from_boundary(ibound_rm);
1518  }
1519  }
1520  }
1521 
1522  // Bottom mesh
1523  double l_bottom = 0.5 * height - 0.5 * length_of_central_box;
1524  unsigned n_bottom =
1525  std::max(unsigned(1), unsigned(l_bottom / length_of_central_box));
1526  if (Coarse_problem)
1527  {
1528  n_bottom = 1;
1529  }
1530  Mesh* surrounding_bottom_mesh_pt =
1531  TwoDimensionalPMLHelper::create_bottom_pml_mesh<PMLLayerElement<ELEMENT>>(
1533  bottom_boundary_id,
1534  n_bottom,
1535  l_bottom,
1536  time_stepper_pt);
1537  all_temp_mesh_pt.push_back(surrounding_bottom_mesh_pt);
1538 
1539 
1540  // Remove nodes from right and left boundaries (1 and 3)
1541  for (unsigned ibound_rm = 1; ibound_rm <= 3; ibound_rm += 2)
1542  {
1543  unsigned num_nod = surrounding_bottom_mesh_pt->nboundary_node(ibound_rm);
1544  for (unsigned inod = 0; inod < num_nod; inod++)
1545  {
1546  Node* nod_pt =
1547  surrounding_bottom_mesh_pt->boundary_node_pt(ibound_rm, inod);
1548  if (nod_pt->is_on_boundary(ibound_rm))
1549  {
1550  nod_pt->remove_from_boundary(ibound_rm);
1551  }
1552  }
1553  }
1554 
1555  // Build corner Surrounding meshes
1556  Mesh* surrounding_top_right_mesh_pt =
1558  PMLLayerElement<ELEMENT>>(surrounding_right_mesh_pt,
1559  surrounding_top_mesh_pt,
1561  right_boundary_id,
1562  time_stepper_pt);
1563  all_temp_mesh_pt.push_back(surrounding_top_right_mesh_pt);
1564 
1565  Mesh* surrounding_bottom_right_mesh_pt =
1567  PMLLayerElement<ELEMENT>>(surrounding_right_mesh_pt,
1568  surrounding_bottom_mesh_pt,
1570  right_boundary_id,
1571  time_stepper_pt);
1572  all_temp_mesh_pt.push_back(surrounding_bottom_right_mesh_pt);
1573 
1574  Mesh* surrounding_top_left_mesh_pt =
1576  PMLLayerElement<ELEMENT>>(surrounding_left_mesh_pt,
1577  surrounding_top_mesh_pt,
1579  left_boundary_id,
1580  time_stepper_pt);
1581  all_temp_mesh_pt.push_back(surrounding_top_left_mesh_pt);
1582 
1583  Mesh* surrounding_bottom_left_mesh_pt =
1585  PMLLayerElement<ELEMENT>>(surrounding_left_mesh_pt,
1586  surrounding_bottom_mesh_pt,
1588  left_boundary_id,
1589  time_stepper_pt);
1590  all_temp_mesh_pt.push_back(surrounding_bottom_left_mesh_pt);
1591 
1592 
1593  // Copy all elements across
1594  unsigned n_mesh = all_temp_mesh_pt.size();
1595  unsigned nel = 0;
1596  unsigned nnod = 0;
1597  for (unsigned i = 0; i < n_mesh; i++)
1598  {
1599  nel += all_temp_mesh_pt[i]->nelement();
1600  nnod += all_temp_mesh_pt[i]->nnode();
1601  }
1602  this->Element_pt.resize(nel);
1603  this->Node_pt.resize(nnod);
1604 
1605  unsigned count_el = 0;
1606  unsigned count_nod = 0;
1607  for (unsigned i = 0; i < n_mesh; i++)
1608  {
1609  unsigned nel = all_temp_mesh_pt[i]->nelement();
1610  for (unsigned e = 0; e < nel; e++)
1611  {
1612  this->Element_pt[count_el] = all_temp_mesh_pt[i]->element_pt(e);
1613  count_el++;
1614  }
1615  unsigned nnod = all_temp_mesh_pt[i]->nnode();
1616  for (unsigned j = 0; j < nnod; j++)
1617  {
1618  this->Node_pt[count_nod] = all_temp_mesh_pt[i]->node_pt(j);
1619  count_nod++;
1620  }
1621  }
1622 
1623  // Remove nodes on outer boundaries (0 to 3) of central mesh
1624  // from their respective boundaries (otherwise they get added
1625  // to the mesh boundaries during adaptation)
1626  for (unsigned b = 0; b < 4; b++)
1627  {
1628  unsigned nnod = Central_mesh_pt->nboundary_node(b);
1629  for (unsigned j = 0; j < nnod; j++)
1630  {
1631  Node* nod_pt = Central_mesh_pt->boundary_node_pt(b, j);
1632  nod_pt->remove_from_boundary(b);
1633  }
1634  }
1635 
1636  // Setup boundaries:
1637  //==================
1638  this->set_nboundary(5);
1639 
1640 
1641  Vector<Mesh*> pml_mesh_pt;
1642 
1643  // Top meshes:
1644  //------------
1645  {
1646  // Upper boundary in top mesh (same number in this mesh)
1647  unsigned ibound = 2;
1648 
1649  // Loop over relevant meshes
1650  Vector<Mesh*> all_mesh_pt;
1651  all_mesh_pt.push_back(surrounding_top_left_mesh_pt);
1652  all_mesh_pt.push_back(surrounding_top_mesh_pt);
1653  all_mesh_pt.push_back(surrounding_top_right_mesh_pt);
1654  unsigned n_mesh = all_mesh_pt.size();
1655  for (unsigned m = 0; m < n_mesh; m++)
1656  {
1657  pml_mesh_pt.push_back(all_mesh_pt[m]);
1658  unsigned num_nod = all_mesh_pt[m]->nboundary_node(ibound);
1659  for (unsigned inod = 0; inod < num_nod; inod++)
1660  {
1661  Node* nod_pt = all_mesh_pt[m]->boundary_node_pt(ibound, inod);
1662  this->add_boundary_node(ibound, nod_pt);
1663  }
1664  }
1665  }
1666 
1667  // Left meshes:
1668  //------------
1669  {
1670  // Left boundary (same number in this mesh)
1671  unsigned ibound = 3;
1672 
1673  pml_mesh_pt.push_back(surrounding_left_mesh_pt);
1674 
1675  // Loop over relevant meshes
1676  Vector<Mesh*> all_mesh_pt;
1677  all_mesh_pt.push_back(surrounding_top_left_mesh_pt);
1678  all_mesh_pt.push_back(surrounding_left_mesh_pt);
1679  all_mesh_pt.push_back(surrounding_bottom_left_mesh_pt);
1680  unsigned n_mesh = all_mesh_pt.size();
1681  for (unsigned m = 0; m < n_mesh; m++)
1682  {
1683  unsigned num_nod = all_mesh_pt[m]->nboundary_node(ibound);
1684  for (unsigned inod = 0; inod < num_nod; inod++)
1685  {
1686  Node* nod_pt = all_mesh_pt[m]->boundary_node_pt(ibound, inod);
1687  this->add_boundary_node(ibound, nod_pt);
1688  }
1689  }
1690  }
1691 
1692  // Bottom meshes:
1693  //---------------
1694  {
1695  // Bottom boundary (same number in this mesh)
1696  unsigned ibound = 0;
1697 
1698  // Loop over relevant meshes
1699  Vector<Mesh*> all_mesh_pt;
1700  all_mesh_pt.push_back(surrounding_bottom_left_mesh_pt);
1701  all_mesh_pt.push_back(surrounding_bottom_mesh_pt);
1702  all_mesh_pt.push_back(surrounding_bottom_right_mesh_pt);
1703  unsigned n_mesh = all_mesh_pt.size();
1704  for (unsigned m = 0; m < n_mesh; m++)
1705  {
1706  pml_mesh_pt.push_back(all_mesh_pt[m]);
1707  unsigned num_nod = all_mesh_pt[m]->nboundary_node(ibound);
1708  for (unsigned inod = 0; inod < num_nod; inod++)
1709  {
1710  Node* nod_pt = all_mesh_pt[m]->boundary_node_pt(ibound, inod);
1711  this->add_boundary_node(ibound, nod_pt);
1712  }
1713  }
1714  }
1715 
1716  // Right meshes:
1717  //--------------
1718  {
1719  // Right boundary (same number in this mesh)
1720  unsigned ibound = 1;
1721 
1722  pml_mesh_pt.push_back(surrounding_right_mesh_pt);
1723 
1724  // Loop over relevant meshes
1725  Vector<Mesh*> all_mesh_pt;
1726  all_mesh_pt.push_back(surrounding_bottom_right_mesh_pt);
1727  all_mesh_pt.push_back(surrounding_right_mesh_pt);
1728  all_mesh_pt.push_back(surrounding_top_right_mesh_pt);
1729  unsigned n_mesh = all_mesh_pt.size();
1730  for (unsigned m = 0; m < n_mesh; m++)
1731  {
1732  unsigned num_nod = all_mesh_pt[m]->nboundary_node(ibound);
1733  for (unsigned inod = 0; inod < num_nod; inod++)
1734  {
1735  Node* nod_pt = all_mesh_pt[m]->boundary_node_pt(ibound, inod);
1736  this->add_boundary_node(ibound, nod_pt);
1737  }
1738  }
1739  }
1740 
1741  // No slip on boundary of inner mesh
1742  //----------------------------------
1743  {
1744  // Inner boundary
1745  unsigned ibound = 4;
1746 
1747  // Pin both velocities
1748  unsigned num_nod = Central_mesh_pt->nboundary_node(ibound);
1749  for (unsigned inod = 0; inod < num_nod; inod++)
1750  {
1751  Node* nod_pt = Central_mesh_pt->boundary_node_pt(ibound, inod);
1752  this->add_boundary_node(ibound, nod_pt);
1753  }
1754  }
1755 
1756  // Setup quadtree forest for mesh refinement
1757  this->setup_quadtree_forest();
1758 
1759  // Setup boundary element lookup schemes
1761 
1762  // Cleanup. NOTE: Can't delete Central_mesh_pt as it's responsible for
1763  // deleting Domain_pt but
1764  unsigned n_pml_mesh = pml_mesh_pt.size();
1765  for (unsigned j = 0; j < n_pml_mesh; j++)
1766  {
1767  pml_mesh_pt[j]->flush_element_and_node_storage();
1768  delete pml_mesh_pt[j];
1769  pml_mesh_pt[j] = 0;
1770  }
1771  Central_mesh_pt->flush_element_and_node_storage();
1772  } // End of RefineableQuadMeshWithMovingCylinder
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Scalar * b
Definition: benchVecAdd.cpp:17
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
void set_nboundary(const unsigned &nbound)
Set the number of boundaries in the mesh.
Definition: mesh.h:505
Mesh()
Default constructor.
Definition: mesh.h:236
Vector< GeneralisedElement * > Element_pt
Vector of pointers to generalised elements.
Definition: mesh.h:186
void setup_boundary_element_info()
Definition: quad_mesh.h:73
bool Coarse_problem
Definition: rectangle_with_moving_cylinder_mesh.template.h:358
RefineableRectangleWithHoleAndAnnularRegionMesh< ELEMENT > * Central_mesh_pt
Definition: rectangle_with_moving_cylinder_mesh.template.h:355
void setup_quadtree_forest()
Definition: refineable_quad_mesh.h:88
#define max(a, b)
Definition: datatypes.h:23
int * m
Definition: level2_cplx_impl.h:294
double height(const double &x)
Height of domain.
Definition: simple_spine_channel.cc:429
Mesh * create_bottom_right_pml_mesh(Mesh *pml_right_mesh_pt, Mesh *pml_bottom_mesh_pt, Mesh *bulk_mesh_pt, const unsigned &right_boundary_id, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Definition: pml_meshes.h:2103
Mesh * create_top_right_pml_mesh(Mesh *pml_right_mesh_pt, Mesh *pml_top_mesh_pt, Mesh *bulk_mesh_pt, const unsigned &right_boundary_id, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Definition: pml_meshes.h:1968
Mesh * create_top_left_pml_mesh(Mesh *pml_left_mesh_pt, Mesh *pml_top_mesh_pt, Mesh *bulk_mesh_pt, const unsigned &left_boundary_id, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Definition: pml_meshes.h:2234
Mesh * create_bottom_left_pml_mesh(Mesh *pml_left_mesh_pt, Mesh *pml_bottom_mesh_pt, Mesh *bulk_mesh_pt, const unsigned &left_boundary_id, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Definition: pml_meshes.h:2367
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References b, oomph::Mesh::boundary_node_pt(), oomph::TwoDimensionalPMLHelper::create_bottom_left_pml_mesh(), oomph::TwoDimensionalPMLHelper::create_bottom_right_pml_mesh(), oomph::TwoDimensionalPMLHelper::create_top_left_pml_mesh(), oomph::TwoDimensionalPMLHelper::create_top_right_pml_mesh(), e(), Global_Physical_Variables::height(), i, oomph::Node::is_on_boundary(), j, m, max, oomph::Mesh::nboundary_node(), and oomph::Node::remove_from_boundary().

◆ ~RefineableQuadMeshWithMovingCylinder()

Destructor: Delete the part of the mesh which has a Domain representation

341  {
342  // Delete the central mesh
343  delete Central_mesh_pt;
344 
345  // Make it a null pointer
346  Central_mesh_pt = 0;
347  } // End of ~RefineableQuadMeshWithMovingCylinder

References oomph::RefineableQuadMeshWithMovingCylinder< ELEMENT >::Central_mesh_pt.

Member Data Documentation

◆ Central_mesh_pt

template<class ELEMENT >
RefineableRectangleWithHoleAndAnnularRegionMesh<ELEMENT>* oomph::RefineableQuadMeshWithMovingCylinder< ELEMENT >::Central_mesh_pt
private

Pointer to the part of the mesh which has a Domain representation. We have to store it because we can't delete it in the constructor as it would delete the Domain pointer which might be needed after the whole mesh has been constructed (e.g. for the mesh extrusion machinery)...

Referenced by oomph::RefineableQuadMeshWithMovingCylinder< ELEMENT >::~RefineableQuadMeshWithMovingCylinder().

◆ Coarse_problem

template<class ELEMENT >
bool oomph::RefineableQuadMeshWithMovingCylinder< ELEMENT >::Coarse_problem
private

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