oomph::PMLQuadMesh< ELEMENT > Class Template Reference

PML mesh, derived from RectangularQuadMesh. More...

#include <pml_meshes.h>

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

Public Member Functions

 PMLQuadMesh (Mesh *bulk_mesh_pt, const unsigned &boundary_id, const unsigned &quad_boundary_id, const unsigned &n_pml_x, const unsigned &n_pml_y, const double &x_pml_start, const double &x_pml_end, const double &y_pml_start, const double &y_pml_end, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
- Public Member Functions inherited from oomph::PMLQuadMeshBase< ELEMENT >
 PMLQuadMeshBase (const unsigned &n_pml_x, const unsigned &n_pml_y, const double &x_pml_start, const double &x_pml_end, const double &y_pml_start, const double &y_pml_end, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 Constructor: Create the underlying rectangular quad mesh. More...
 
void pml_locate_zeta (const Vector< double > &x, FiniteElement *&coarse_mesh_el_pt)
 
- Public Member Functions inherited from oomph::RectangularQuadMesh< ELEMENT >
 RectangularQuadMesh (const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
 RectangularQuadMesh (const unsigned &nx, const unsigned &ny, const double &xmin, const double &xmax, const double &ymin, const double &ymax, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
 RectangularQuadMesh (const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, const bool &periodic_in_x, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
 RectangularQuadMesh (const unsigned &nx, const unsigned &ny, const double &xmin, const double &xmax, const double &ymin, const double &ymax, const bool &periodic_in_x, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
const unsignednx () const
 Return number of elements in x direction. More...
 
const unsignedny () const
 Return number of elements in y direction. More...
 
const double x_min () const
 Return the minimum value of x coordinate. More...
 
const double x_max () const
 Return the maximum value of x coordinate. More...
 
const double y_min () const
 Return the minimum value of y coordinate. More...
 
const double y_max () const
 Return the maximum value of y coordinate. More...
 
virtual void element_reorder ()
 
virtual double x_spacing_function (unsigned xelement, unsigned xnode, unsigned yelement, unsigned ynode)
 
virtual double y_spacing_function (unsigned xelement, unsigned xnode, unsigned yelement, unsigned ynode)
 
- 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)
 
- 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...
 

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::RectangularQuadMesh< ELEMENT >
void build_mesh (TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 Generic mesh construction function: contains all the hard work. More...
 
 RectangularQuadMesh (const unsigned &nx, const unsigned &ny, const double &xmin, const double &xmax, const double &ymin, const double &ymax, const bool &periodic_in_x, const bool &build, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
- 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::RectangularQuadMesh< ELEMENT >
unsigned Nx
 Nx: number of elements in x-direction. More...
 
unsigned Ny
 Ny: number of elements in y-direction. More...
 
unsigned Np
 Np: number of (linear) points in the element. More...
 
double Xmin
 Minimum value of x coordinate. More...
 
double Xmax
 Maximum value of x coordinate. More...
 
double Ymin
 Minimum value of y coordinate. More...
 
double Ymax
 Maximum value of y coordinate. More...
 
bool Xperiodic
 
- 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::PMLQuadMesh< ELEMENT >

PML mesh, derived from RectangularQuadMesh.

Constructor & Destructor Documentation

◆ PMLQuadMesh()

template<class ELEMENT >
oomph::PMLQuadMesh< ELEMENT >::PMLQuadMesh ( Mesh bulk_mesh_pt,
const unsigned boundary_id,
const unsigned quad_boundary_id,
const unsigned n_pml_x,
const unsigned n_pml_y,
const double x_pml_start,
const double x_pml_end,
const double y_pml_start,
const double y_pml_end,
TimeStepper time_stepper_pt = &Mesh::Default_TimeStepper 
)
inline

Constructor: Pass pointer to "bulk" mesh, the boundary ID of axis aligned boundary to which the mesh is supposed to be attached and the boundary ID in the rectangular quad mesh that contains the pml elements. 0: constant y, bulk mesh below; 1: constant x, bulk mesh to the right; 2: constant y, bulk mesh above; 3: constant x, bulk mesh to left.

Sort them depending on the boundary being used

Top boundary

Left boundary

Bottom boundary

Simple interior node numbering helpers to be precomputed before the main loop

Top left node in element

Lower right node in element

Used to find nodes in top row

Set all nodes from the PML mesh that must disappear after merging as obsolete

Simple interior element numbering helpers

Last element in mesh (top right)

The alignment is done individually for each boundary and depends on the ordering of the nodes, in this case of the RectangularQuadMesh<2,3> for each boundary. There are operations with mod and div 3 necessary in this case, as well as specific mechanisms to loop over the boundary in a certain way in order to obtain the convenient coordinates.

451  : PMLQuadMeshBase<ELEMENT>(n_pml_x,
452  n_pml_y,
453  x_pml_start,
454  x_pml_end,
455  y_pml_start,
456  y_pml_end,
457  time_stepper_pt)
458  {
459  unsigned n_boundary_node = bulk_mesh_pt->nboundary_node(boundary_id);
460 
461  // Create a vector of ordered boundary nodes
462  Vector<Node*> ordered_boundary_node_pt(n_boundary_node);
463 
464  // Fill the vector with the nodes on the respective boundary
465  for (unsigned n = 0; n < n_boundary_node; n++)
466  {
467  ordered_boundary_node_pt[n] =
468  bulk_mesh_pt->boundary_node_pt(boundary_id, n);
469  }
470 
472 
473  // Right boundary
474  if (quad_boundary_id == 3)
475  {
476  std::sort(ordered_boundary_node_pt.begin(),
477  ordered_boundary_node_pt.end(),
479  }
480 
482  if (quad_boundary_id == 0)
483  {
484  std::sort(ordered_boundary_node_pt.begin(),
485  ordered_boundary_node_pt.end(),
487  }
488 
490  if (quad_boundary_id == 1)
491  {
492  std::sort(ordered_boundary_node_pt.begin(),
493  ordered_boundary_node_pt.end(),
495  }
496 
498  if (quad_boundary_id == 2)
499  {
500  std::sort(ordered_boundary_node_pt.begin(),
501  ordered_boundary_node_pt.end(),
503  }
504 
505  unsigned nnode_1d = this->finite_element_pt(0)->nnode_1d();
506 
509 
511  unsigned interior_node_nr_helper_1 = nnode_1d * (nnode_1d - 1);
513  unsigned interior_node_nr_helper_2 = nnode_1d - 1;
515  unsigned interior_node_nr_helper_3 = nnode_1d * (nnode_1d - 1) - 1;
516 
519  unsigned nnod = this->nboundary_node(quad_boundary_id);
520  for (unsigned j = 0; j < nnod; j++)
521  {
522  this->boundary_node_pt(quad_boundary_id, j)->set_obsolete();
523  }
524 
525  // Kill the obsolete nodes
526  this->prune_dead_nodes();
527 
528  // Find the number of elements inside the PML mesh
529  unsigned n_pml_element = this->nelement();
530 
532 
534  unsigned interior_element_nr_helper_1 = n_pml_element - 1;
535 
536 
537  // Connect the elements in the pml mesh to the ones
538  // in the triangular mesh at element level
539  unsigned count = 0;
540 
541  // Each boundary requires a specific treatment
542  // Right boundary
543  if (quad_boundary_id == 3)
544  {
545  for (unsigned e = 0; e < n_pml_element; e++)
546  {
547  // If element is on the right boundary
548  if ((e % n_pml_x) == 0)
549  {
550  // Upcast from GeneralisedElement to bulk element
551  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(this->element_pt(e));
552 
553  // Loop over all nodes in element
554  unsigned n_node = el_pt->nnode();
555  for (unsigned inod = 0; inod < n_node; inod++)
556  {
557  if (inod % nnode_1d == 0)
558  {
559  // Get the pointer from the triangular mesh
560  el_pt->node_pt(inod) = ordered_boundary_node_pt[count];
561  count++;
562 
563  // Node between two elements
564  if (inod == interior_node_nr_helper_1)
565  {
566  count--;
567  }
568  }
569  }
570  }
571  }
572  }
573 
574  // Top boundary
575  if (quad_boundary_id == 0)
576  {
577  for (unsigned e = 0; e < n_pml_element; e++)
578  {
579  // If element is on the right boundary
580  if ((int)(e / n_pml_x) == 0)
581  {
582  // Upcast from GeneralisedElement to bulk element
583  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(this->element_pt(e));
584 
585  // Loop over all nodes in element
586  unsigned n_node = el_pt->nnode();
587  for (unsigned inod = 0; inod < n_node; inod++)
588  {
589  if ((int)(inod / nnode_1d) == 0)
590  {
591  // Get the pointer from the triangular mesh
592  el_pt->node_pt(inod) = ordered_boundary_node_pt[count];
593  count++;
594 
595  // Node between two elements
596  if (inod == interior_node_nr_helper_2)
597  {
598  count--;
599  }
600  }
601  }
602  }
603  }
604  }
605 
606  // Left boundary
607  if (quad_boundary_id == 1)
608  {
609  for (unsigned e = interior_element_nr_helper_1; e < n_pml_element; e--)
610  {
611  // If element is on the right boundary
612  if ((e % n_pml_x) == (n_pml_x - 1))
613  {
614  // Upcast from GeneralisedElement to bulk element
615  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(this->element_pt(e));
616 
617  // Loop over all nodes in element
618  unsigned n_node = el_pt->nnode();
619  unsigned starter = n_node - 1;
620  for (unsigned inod = starter; inod <= starter; inod--)
621  {
622  if (inod % nnode_1d == interior_node_nr_helper_2)
623  {
624  // Get the pointer from the triangular mesh
625  el_pt->node_pt(inod) = ordered_boundary_node_pt[count];
626  count++;
627 
628  // Node between two elements
629  if (inod == interior_node_nr_helper_2)
630  {
631  count--;
632  }
633  }
634  }
635  }
636  }
637  }
638 
639  // Bottom boundary
640  if (quad_boundary_id == 2)
641  {
642  for (unsigned e = interior_element_nr_helper_1; e < n_pml_element; e--)
643  {
644  // If element is on the top boundary
645  if (e >= (n_pml_x * (n_pml_y - 1)))
646  {
647  // Upcast from GeneralisedElement to bulk element
648  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(this->element_pt(e));
649 
650  // Loop over all nodes in element
651  unsigned n_node = el_pt->nnode();
652  unsigned starter = n_node - 1;
653  for (unsigned inod = starter; inod <= starter; inod--)
654  {
655  if (inod > interior_node_nr_helper_3)
656  {
657  // Get the pointer from the triangular mesh
658  el_pt->node_pt(inod) = ordered_boundary_node_pt[count];
659  count++;
660 
661  // Node between two elements
662  if (inod == interior_node_nr_helper_1)
663  {
664  count--;
665  }
666  }
667  }
668  }
669  }
670  }
671 
678 
679  // Loop over all elements and make sure the coordinates are aligned
680  for (unsigned e = 0; e < n_pml_element; e++)
681  {
682  // Upcast from GeneralisedElement to bulk element
683  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(this->element_pt(e));
684  unsigned n_node = el_pt->nnode();
685 
686  // Loop over all nodes in element
687  double temp_coordinate = 0.0;
688  for (unsigned inod = 0; inod < n_node; inod++)
689  {
690  // Check if we are looking at the left boundary of the quad mesh
691  if (quad_boundary_id == 3)
692  {
693  // If it is one of the ones on the left boundary
694  if (inod % nnode_1d == 0)
695  {
696  // Get the y-coordinate of the leftmost node in that element
697  temp_coordinate = el_pt->node_pt(inod)->x(1);
698  }
699 
700  // Each node's y-coordinate is reset to be the one of the leftmost
701  // node in that element on its x-coordinate
702  el_pt->node_pt(inod)->x(1) = temp_coordinate;
703  }
704  // End of left quad boundary check
705 
706  // Check if we are looking at the top boundary of the quad mesh
707  if (quad_boundary_id == 0)
708  {
709  // If it is one of the ones on the bottom boundary
710  if (inod > interior_node_nr_helper_2)
711  {
712  // Get the y-coordinate of the leftmost node in that element
713  el_pt->node_pt(inod)->x(0) =
714  el_pt->node_pt(inod - nnode_1d)->x(0);
715  }
716  }
717  // End of top quad boundary check
718  }
719  }
720 
721  for (unsigned e = interior_element_nr_helper_1; e < n_pml_element; e--)
722  {
723  // Upcast from GeneralisedElement to bulk element
724  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(this->element_pt(e));
725  unsigned n_node = el_pt->nnode();
726 
727  // Loop over all nodes in element
728  double temp_coordinate = 0.0;
729  unsigned starter = n_node - 1;
730  for (unsigned inod = starter; inod <= starter; inod--)
731  {
732  // Check if we are looking at the right boundary of the quad mesh
733  if (quad_boundary_id == 1)
734  {
735  // If it is one of the ones on the left boundary
736  if (inod % nnode_1d == interior_node_nr_helper_2)
737  {
738  // Get the y-coordinate of the leftmost node in that element
739  temp_coordinate = el_pt->node_pt(inod)->x(1);
740  }
741 
742  // Each node's y-coordinate is reset to be the one of the leftmost
743  // node in that element on its x-coordinate
744  el_pt->node_pt(inod)->x(1) = temp_coordinate;
745  }
746  // End of right quad boundary check
747 
748  // Check if we are looking at the top boundary of the quad mesh
749  if (quad_boundary_id == 2)
750  {
751  // If it is one of the ones on the bottom boundary
752  if (inod < interior_node_nr_helper_1)
753  {
754  // Get the y-coordinate of the leftmost node in that element
755  el_pt->node_pt(inod)->x(0) =
756  el_pt->node_pt(inod + nnode_1d)->x(0);
757  }
758  }
759  // End of top quad boundary check
760  }
761  }
762  // End of alignment
763  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Array< double, 1, 3 > e(1./3., 0.5, 2.)
virtual unsigned nnode_1d() const
Definition: elements.h:2218
unsigned long nboundary_node(const unsigned &ibound) const
Return number of nodes on a particular boundary.
Definition: mesh.h:833
FiniteElement * finite_element_pt(const unsigned &e) const
Definition: mesh.h:473
const Vector< GeneralisedElement * > & element_pt() const
Return reference to the Vector of elements.
Definition: mesh.h:460
Vector< Node * > prune_dead_nodes()
Definition: mesh.cc:966
Node *& boundary_node_pt(const unsigned &b, const unsigned &n)
Return pointer to node n on boundary b.
Definition: mesh.h:493
unsigned long nelement() const
Return number of elements in the mesh.
Definition: mesh.h:590
void set_obsolete()
Mark node as obsolete.
Definition: nodes.h:1436
bool sorter_bottom_boundary(Node *nod_i_pt, Node *nod_j_pt)
helper function for sorting the bottom boundary nodes
Definition: pml_meshes.cc:57
bool sorter_top_boundary(Node *nod_i_pt, Node *nod_j_pt)
helper function for sorting the top boundary nodes
Definition: pml_meshes.cc:45
bool sorter_right_boundary(Node *nod_i_pt, Node *nod_j_pt)
helper function for sorting the right boundary nodes
Definition: pml_meshes.cc:39
bool sorter_left_boundary(Node *nod_i_pt, Node *nod_j_pt)
helper function for sorting the left boundary nodes
Definition: pml_meshes.cc:51
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References oomph::Mesh::boundary_node_pt(), e(), oomph::Mesh::element_pt(), oomph::Mesh::finite_element_pt(), j, n, oomph::Mesh::nboundary_node(), oomph::Mesh::nelement(), oomph::FiniteElement::nnode_1d(), oomph::Mesh::prune_dead_nodes(), oomph::Node::set_obsolete(), oomph::TwoDimensionalPMLHelper::sorter_bottom_boundary(), oomph::TwoDimensionalPMLHelper::sorter_left_boundary(), oomph::TwoDimensionalPMLHelper::sorter_right_boundary(), and oomph::TwoDimensionalPMLHelper::sorter_top_boundary().


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