oomph::RectangleWithHoleMesh< ELEMENT > Class Template Reference

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

#include <rectangle_with_hole_mesh.template.h>

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

Public Member Functions

 RectangleWithHoleMesh (GeomObject *cylinder_pt, const double &length, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
RectangleWithHoleDomaindomain_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

RectangleWithHoleDomainDomain_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::RectangleWithHoleMesh< ELEMENT >

Domain-based mesh for rectangular mesh with circular hole.

Constructor & Destructor Documentation

◆ RectangleWithHoleMesh()

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

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.

60  {
61  // Create the domain
62  Domain_pt = new RectangleWithHoleDomain(cylinder_pt, length);
63 
64  // Initialise the node counter
65  unsigned long node_count = 0;
66 
67  // Vectors used to get data from domains
68  Vector<double> s(2), r(2);
69 
70  // Setup temporary storage for the Node
71  Vector<Node*> Tmp_node_pt;
72 
73  // Now blindly loop over the macro elements and associate and finite
74  // element with each
75  unsigned nmacro_element = Domain_pt->nmacro_element();
76  for (unsigned e = 0; e < nmacro_element; e++)
77  {
78  // Create the FiniteElement and add to the Element_pt Vector
79  Element_pt.push_back(new ELEMENT);
80 
81  // Read out the number of linear points in the element
82  unsigned np = dynamic_cast<ELEMENT*>(finite_element_pt(e))->nnode_1d();
83 
84  // Loop over nodes in the column
85  for (unsigned l1 = 0; l1 < np; l1++)
86  {
87  // Loop over the nodes in the row
88  for (unsigned l2 = 0; l2 < np; l2++)
89  {
90  // Allocate the memory for the node
91  Tmp_node_pt.push_back(finite_element_pt(e)->construct_node(
92  l1 * np + l2, time_stepper_pt));
93 
94  // Read out the position of the node from the macro element
95  s[0] = -1.0 + 2.0 * (double)l2 / (double)(np - 1);
96  s[1] = -1.0 + 2.0 * (double)l1 / (double)(np - 1);
98 
99  // Set the position of the node
100  Tmp_node_pt[node_count]->x(0) = r[0];
101  Tmp_node_pt[node_count]->x(1) = r[1];
102 
103  // Increment the node number
104  node_count++;
105  }
106  }
107  } // End of loop over macro elements
108 
109 
110  // Now the elements have been created, but there will be nodes in
111  // common, need to loop over the common edges and sort it, by reassigning
112  // pointers and the deleting excess nodes
113 
114  // Read out the number of linear points in the element
115  unsigned np = dynamic_cast<ELEMENT*>(finite_element_pt(0))->nnode_1d();
116 
117  // Edge between Elements 0 and 1
118  for (unsigned n = 0; n < np; n++)
119  {
120  // Set the nodes in element 1 to be the same as in element 0
121  finite_element_pt(1)->node_pt(n * np) =
122  finite_element_pt(0)->node_pt((np - 1) * np + np - 1 - n);
123 
124  // Remove the nodes in element 1 from the temporary node list
125  delete Tmp_node_pt[np * np + n * np];
126  Tmp_node_pt[np * np + n * np] = 0;
127  }
128 
129  // Edge between Elements 0 and 3
130  for (unsigned n = 0; n < np; n++)
131  {
132  // Set the nodes in element 3 to be the same as in element 0
133  finite_element_pt(3)->node_pt(n * np) =
135 
136  // Remove the nodes in element 3 from the temporary node list
137  delete Tmp_node_pt[3 * np * np + n * np];
138  Tmp_node_pt[3 * np * np + n * np] = 0;
139  }
140 
141  // Edge between Element 1 and 2
142  for (unsigned n = 0; n < np; n++)
143  {
144  // Set the nodes in element 2 to be the same as in element 1
145  finite_element_pt(2)->node_pt(np * (np - 1) + n) =
146  finite_element_pt(1)->node_pt(np * n + np - 1);
147 
148  // Remove the nodes in element 2 from the temporary node list
149  delete Tmp_node_pt[2 * np * np + np * (np - 1) + n];
150  Tmp_node_pt[2 * np * np + np * (np - 1) + n] = 0;
151  }
152 
153 
154  // Edge between Element 3 and 2
155  for (unsigned n = 0; n < np; n++)
156  {
157  // Set the nodes in element 2 to be the same as in element 3
159  finite_element_pt(3)->node_pt(np * (np - n - 1) + np - 1);
160 
161  // Remove the nodes in element 2 from the temporary node list
162  delete Tmp_node_pt[2 * np * np + n];
163  Tmp_node_pt[2 * np * np + n] = 0;
164  }
165 
166 
167  // Now set the actual true nodes
168  for (unsigned long n = 0; n < node_count; n++)
169  {
170  if (Tmp_node_pt[n] != 0)
171  {
172  Node_pt.push_back(Tmp_node_pt[n]);
173  }
174  }
175 
176  // Finally set the nodes on the boundaries
177  set_nboundary(5);
178 
179  for (unsigned n = 0; n < np; n++)
180  {
181  // Left hand side
182  Node* nod_pt = finite_element_pt(0)->node_pt(n * np);
183  convert_to_boundary_node(nod_pt);
184  add_boundary_node(3, nod_pt);
185 
186  // Right hand side
187  nod_pt = finite_element_pt(2)->node_pt(n * np + np - 1);
188  convert_to_boundary_node(nod_pt);
189  add_boundary_node(1, nod_pt);
190 
191  // First part of lower boundary
192  nod_pt = finite_element_pt(3)->node_pt(n);
193  convert_to_boundary_node(nod_pt);
194  add_boundary_node(0, nod_pt);
195 
196  // First part of upper boundary
197  nod_pt = finite_element_pt(1)->node_pt(np * (np - 1) + n);
198  convert_to_boundary_node(nod_pt);
199  add_boundary_node(2, nod_pt);
200 
201  // First part of hole boundary
202  nod_pt = finite_element_pt(3)->node_pt(np * (np - 1) + n);
203  convert_to_boundary_node(nod_pt);
204  add_boundary_node(4, nod_pt);
205  }
206 
207  for (unsigned n = 1; n < np; n++)
208  {
209  // Next part of hole
210  Node* nod_pt = finite_element_pt(2)->node_pt(n * np);
211  convert_to_boundary_node(nod_pt);
212  add_boundary_node(4, nod_pt);
213  }
214 
215  for (unsigned n = 1; n < np; n++)
216  {
217  // Next part of hole
218  Node* nod_pt = finite_element_pt(1)->node_pt(np - n - 1);
219  convert_to_boundary_node(nod_pt);
220  add_boundary_node(4, nod_pt);
221  }
222 
223  for (unsigned n = 1; n < np - 1; n++)
224  {
225  // Final part of hole
226  Node* nod_pt =
227  finite_element_pt(0)->node_pt(np * (np - n - 1) + np - 1);
228  convert_to_boundary_node(nod_pt);
229  add_boundary_node(4, nod_pt);
230  }
231  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Rectangular domain with circular whole.
Definition: adaptive_hopf.cc:142
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
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
RectangleWithHoleDomain * Domain_pt
Pointer to the domain.
Definition: rectangle_with_hole_mesh.template.h:241
RealScalar s
Definition: level1_cplx_impl.h:130
r
Definition: UniformPSDSelfTest.py:20

References oomph::Mesh::add_boundary_node(), oomph::FiniteElement::construct_node(), oomph::Mesh::convert_to_boundary_node(), oomph::RectangleWithHoleMesh< ELEMENT >::Domain_pt, e(), oomph::Mesh::Element_pt, oomph::Mesh::finite_element_pt(), oomph::Domain::macro_element_pt(), oomph::MacroElement::macro_map(), n, oomph::Domain::nmacro_element(), oomph::FiniteElement::node_pt(), oomph::Mesh::Node_pt, UniformPSDSelfTest::r, s, and oomph::Mesh::set_nboundary().

Member Function Documentation

◆ domain_pt()

template<class ELEMENT >
RectangleWithHoleDomain* oomph::RectangleWithHoleMesh< ELEMENT >::domain_pt ( )
inline

Access function to the domain.

235  {
236  return Domain_pt;
237  }

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

Member Data Documentation

◆ Domain_pt


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