oomph::SimpleCubicScaffoldTetMesh Class Reference

Scaffold mesh for cubic tet mesh. More...

#include <simple_cubic_scaffold_tet_mesh.h>

+ Inheritance diagram for oomph::SimpleCubicScaffoldTetMesh:

Public Member Functions

 SimpleCubicScaffoldTetMesh (const unsigned &n_x, const unsigned &n_y, const unsigned &n_z, const double &l_x, const double &l_y, const double &l_z, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 Constructor: Pass number of elements and dimensions of cube. 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...
 

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)
 
- 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

Scaffold mesh for cubic tet mesh.

Constructor & Destructor Documentation

◆ SimpleCubicScaffoldTetMesh()

oomph::SimpleCubicScaffoldTetMesh::SimpleCubicScaffoldTetMesh ( const unsigned n_x,
const unsigned n_y,
const unsigned n_z,
const double l_x,
const double l_y,
const double l_z,
TimeStepper time_stepper_pt = &Mesh::Default_TimeStepper 
)

Constructor: Pass number of elements and dimensions of cube.

Scaffold mesh for cubic tet mesh.

43  {
44  // Storage for the pointers to the nodes
45  RankThreeTensor<Node*> vertex_node_pt(n_x + 1, n_y + 1, n_z + 1);
46  RankThreeTensor<Node*> left_face_node_pt(n_x + 1, n_y + 1, n_z + 1);
47  RankThreeTensor<Node*> front_face_node_pt(n_x + 1, n_y + 1, n_z + 1);
48  RankThreeTensor<Node*> down_face_node_pt(n_x + 1, n_y + 1, n_z + 1);
49  RankThreeTensor<Node*> central_node_pt(n_x, n_y, n_z);
50 
51  // "Lower left" corner
52  double x_0 = 0.0;
53  double y_0 = 0.0;
54  double z_0 = 0.0;
55 
56  // Increments
57  double dx = l_x / double(n_x);
58  double dy = l_y / double(n_y);
59  double dz = l_z / double(n_z);
60 
61  // Total number of nodes
62  unsigned nnod = (n_x + 1) * (n_y + 1) * (n_z + 1) + // vertex nodes
63  n_x * n_y * n_z + // central nodes
64  (n_x * n_y) * (n_z + 1) + // faces
65  (n_x * n_z) * (n_y + 1) + (n_y * n_z) * (n_x + 1);
66  Node_pt.reserve(nnod);
67 
68  // Total number of elements
69  unsigned nelem = 24 * n_x * n_y * n_z;
70  Element_pt.reserve(nelem);
71 
72  // Six boundaries
73  set_nboundary(6);
74 
75 
76  // Generate the vertex nodes of all cells
77  //=======================================
78  Node* node_pt;
79  for (unsigned k = 0; k < n_z + 1; k++)
80  {
81  for (unsigned j = 0; j < n_y + 1; j++)
82  {
83  for (unsigned i = 0; i < n_x + 1; i++)
84  {
85  // Need to work out whether to create a boundary node or not
86  if (((i < n_x + 1) && (j < n_y + 1) && (k < n_z + 1)) &&
87  ((i == 0) || (i == n_x) || (j == 0) || (j == n_y) || (k == 0) ||
88  (k == n_z)))
89  {
90  node_pt = new BoundaryNode<Node>(3, 1, 0);
91  }
92  else
93  {
94  node_pt = new Node(3, 1, 0);
95  }
96 
97  vertex_node_pt(i, j, k) = node_pt;
98 
99  // Coordinates
100  node_pt->x(0) = x_0 + double(i) * dx;
101  node_pt->x(1) = y_0 + double(j) * dy;
102  node_pt->x(2) = z_0 + double(k) * dz;
103 
104  // Real node?
105  if ((i < n_x + 1) && (j < n_y + 1) && (k < n_z + 1))
106  {
107  // Add node
108  Node_pt.push_back(node_pt);
109 
110  // Left boundary is 0
111  if (i == 0)
112  {
114  }
115  // Right boundary is 1
116  else if (i == n_x)
117  {
119  }
120 
121  // Front boundary is 2
122  if (j == 0)
123  {
125  }
126  // Back boundary is 3
127  else if (j == n_y)
128  {
130  }
131 
132  // Down boundary is 4
133  if (k == 0)
134  {
136  }
137  // Up boundary is 5
138  else if (k == n_z)
139  {
141  }
142  }
143  }
144  }
145  }
146 
147 
148  // Generate the face nodes of all cells
149  //=====================================
150  for (unsigned k = 0; k < n_z + 1; k++)
151  {
152  for (unsigned j = 0; j < n_y + 1; j++)
153  {
154  for (unsigned i = 0; i < n_x + 1; i++)
155  {
156  // Node on front face of cell
157  //---------------------------
158  // Need to work out whether to create boundary node or not
159  if (((i < n_x) && (k < n_z)) && ((j == 0) || (j == n_y)))
160  {
161  node_pt = new BoundaryNode<Node>(3, 1, 0);
162  }
163  else
164  {
165  node_pt = new Node(3, 1, 0);
166  }
167  front_face_node_pt(i, j, k) = node_pt;
168 
169 
170  // Coordinates
171  node_pt->x(0) = x_0 + 0.5 * dx + double(i) * dx;
172  node_pt->x(1) = y_0 + double(j) * dy;
173  node_pt->x(2) = z_0 + 0.5 * dz + double(k) * dz;
174 
175  // Real node?
176  if ((i < n_x) && (k < n_z))
177  {
178  // Add node to mesh
179  Node_pt.push_back(node_pt);
180 
181  // Front boundary is 2
182  if (j == 0)
183  {
185  }
186  // Back boundary is 3
187  else if (j == n_y)
188  {
190  }
191  }
192 
193  // Node on left face of cell
194  //--------------------------
195  // Work out whether to construct boundary node or not
196  if (((j < n_y) && (k < n_z)) && ((i == 0) || (i == n_x)))
197  {
198  node_pt = new BoundaryNode<Node>(3, 1, 0);
199  }
200  else
201  {
202  node_pt = new Node(3, 1, 0);
203  }
204  left_face_node_pt(i, j, k) = node_pt;
205 
206  // Coordinates
207  node_pt->x(0) = x_0 + double(i) * dx;
208  node_pt->x(1) = y_0 + 0.5 * dy + double(j) * dy;
209  node_pt->x(2) = z_0 + 0.5 * dz + double(k) * dz;
210 
211 
212  // Real node?
213  if ((j < n_y) && (k < n_z))
214  {
215  // Add node to mesh
216  Node_pt.push_back(node_pt);
217 
218  // Left boundary is 0
219  if (i == 0)
220  {
222  }
223  // Right boundary is 1
224  else if (i == n_x)
225  {
227  }
228  }
229 
230  // Node on down face of cell
231  //--------------------------
232  if (((i < n_x) && (j < n_y)) && ((k == 0) || (k == n_z)))
233  {
234  node_pt = new BoundaryNode<Node>(3, 1, 0);
235  }
236  else
237  {
238  node_pt = new Node(3, 1, 0);
239  }
240  down_face_node_pt(i, j, k) = node_pt;
241 
242  // Coordinates
243  node_pt->x(0) = x_0 + 0.5 * dx + double(i) * dx;
244  node_pt->x(1) = y_0 + 0.5 * dy + double(j) * dy;
245  node_pt->x(2) = z_0 + double(k) * dz;
246 
247 
248  // Real node?
249  if ((i < n_x) && (j < n_y))
250  {
251  // Add node to mesh
252  Node_pt.push_back(node_pt);
253 
254  // Down boundary is 4
255  if (k == 0)
256  {
258  }
259  // Up boundary is 5
260  else if (k == n_z)
261  {
263  }
264  }
265  }
266  }
267  }
268 
269 
270  // Central nodes for all cells
271  for (unsigned k = 0; k < n_z; k++)
272  {
273  for (unsigned j = 0; j < n_y; j++)
274  {
275  for (unsigned i = 0; i < n_x; i++)
276  {
277  node_pt = new Node(3, 1, 0);
278  central_node_pt(i, j, k) = node_pt;
279  Node_pt.push_back(node_pt);
280  node_pt->x(0) = x_0 + 0.5 * dx + double(i) * dx;
281  node_pt->x(1) = y_0 + 0.5 * dy + double(j) * dy;
282  node_pt->x(2) = z_0 + 0.5 * dz + double(k) * dz;
283  }
284  }
285  }
286 
287 
288  // Loop over blocks and create elements
289  TElement<3, 2>* el_pt = 0;
290  for (unsigned k = 0; k < n_z; k++)
291  {
292  for (unsigned j = 0; j < n_y; j++)
293  {
294  for (unsigned i = 0; i < n_x; i++)
295  {
296  // FRONT FACE
297  //===========
298 
299  // Left element on front face
300  //---------------------------
301  el_pt = new TElement<3, 2>;
302 
303  // LFD
304  el_pt->node_pt(0) = vertex_node_pt(i, j, k);
305 
306  // Central front face
307  el_pt->node_pt(1) = front_face_node_pt(i, j, k);
308 
309  // LFU
310  el_pt->node_pt(2) = vertex_node_pt(i, j, k + 1);
311 
312  // central node
313  el_pt->node_pt(3) = central_node_pt(i, j, k);
314 
315  Element_pt.push_back(el_pt);
316 
317 
318  // Down element on front face
319  //---------------------------
320  el_pt = new TElement<3, 2>;
321 
322  // LFD
323  el_pt->node_pt(0) = vertex_node_pt(i, j, k);
324 
325  // RFD
326  el_pt->node_pt(1) = vertex_node_pt(i + 1, j, k);
327 
328  // Central front face
329  el_pt->node_pt(2) = front_face_node_pt(i, j, k);
330 
331  // Central node
332  el_pt->node_pt(3) = central_node_pt(i, j, k);
333 
334  Element_pt.push_back(el_pt);
335 
336 
337  // Right element on front face
338  //---------------------------
339  el_pt = new TElement<3, 2>;
340 
341  // RFD
342  el_pt->node_pt(0) = vertex_node_pt(i + 1, j, k);
343 
344  // RFU
345  el_pt->node_pt(1) = vertex_node_pt(i + 1, j, k + 1);
346 
347  // Central front face
348  el_pt->node_pt(2) = front_face_node_pt(i, j, k);
349 
350  // Central node
351  el_pt->node_pt(3) = central_node_pt(i, j, k);
352 
353  Element_pt.push_back(el_pt);
354 
355 
356  // Up element on front face
357  //---------------------------
358  el_pt = new TElement<3, 2>;
359 
360  // RFU
361  el_pt->node_pt(0) = vertex_node_pt(i + 1, j, k + 1);
362 
363  // LFU
364  el_pt->node_pt(1) = vertex_node_pt(i, j, k + 1);
365 
366  // Central front face
367  el_pt->node_pt(2) = front_face_node_pt(i, j, k);
368 
369  // Central node
370  el_pt->node_pt(3) = central_node_pt(i, j, k);
371 
372  Element_pt.push_back(el_pt);
373 
374 
375  // RIGHT FACE
376  //===========
377 
378  // Front element on right face
379  //---------------------------
380  el_pt = new TElement<3, 2>;
381 
382  // RFD
383  el_pt->node_pt(0) = vertex_node_pt(i + 1, j, k);
384 
385  // Central right face
386  el_pt->node_pt(1) = left_face_node_pt(i + 1, j, k);
387 
388  // RFU
389  el_pt->node_pt(2) = vertex_node_pt(i + 1, j, k + 1);
390 
391  // Central node
392  el_pt->node_pt(3) = central_node_pt(i, j, k);
393 
394  Element_pt.push_back(el_pt);
395 
396 
397  // Down element on right face
398  //---------------------------
399  el_pt = new TElement<3, 2>;
400 
401  // RFD
402  el_pt->node_pt(0) = vertex_node_pt(i + 1, j, k);
403 
404  // RBD
405  el_pt->node_pt(1) = vertex_node_pt(i + 1, j + 1, k);
406 
407  // Central right face
408  el_pt->node_pt(2) = left_face_node_pt(i + 1, j, k);
409 
410  // central node
411  el_pt->node_pt(3) = central_node_pt(i, j, k);
412 
413  Element_pt.push_back(el_pt);
414 
415 
416  // Back element on right face
417  //---------------------------
418  el_pt = new TElement<3, 2>;
419 
420  // RBD
421  el_pt->node_pt(0) = vertex_node_pt(i + 1, j + 1, k);
422 
423  // RBU
424  el_pt->node_pt(1) = vertex_node_pt(i + 1, j + 1, k + 1);
425 
426  // Central right face
427  el_pt->node_pt(2) = left_face_node_pt(i + 1, j, k);
428 
429  // central node
430  el_pt->node_pt(3) = central_node_pt(i, j, k);
431 
432  Element_pt.push_back(el_pt);
433 
434 
435  // Up element on right face
436  //---------------------------
437  el_pt = new TElement<3, 2>;
438 
439  // RBU
440  el_pt->node_pt(0) = vertex_node_pt(i + 1, j + 1, k + 1);
441 
442  // RFU
443  el_pt->node_pt(1) = vertex_node_pt(i + 1, j, k + 1);
444 
445  // Central right face
446  el_pt->node_pt(2) = left_face_node_pt(i + 1, j, k);
447 
448  // Central node
449  el_pt->node_pt(3) = central_node_pt(i, j, k);
450 
451  Element_pt.push_back(el_pt);
452 
453 
454  // UP FACE
455  //===========
456 
457  // Front element on up face
458  //---------------------------
459  el_pt = new TElement<3, 2>;
460 
461  // LFU
462  el_pt->node_pt(0) = vertex_node_pt(i, j, k + 1);
463 
464  // RFU
465  el_pt->node_pt(1) = vertex_node_pt(i + 1, j, k + 1);
466 
467  // Central up face
468  el_pt->node_pt(2) = down_face_node_pt(i, j, k + 1);
469 
470  // Central node
471  el_pt->node_pt(3) = central_node_pt(i, j, k);
472 
473  Element_pt.push_back(el_pt);
474 
475 
476  // Front element on up face
477  //---------------------------
478  el_pt = new TElement<3, 2>;
479 
480  // RFU
481  el_pt->node_pt(0) = vertex_node_pt(i + 1, j, k + 1);
482 
483  // RBU
484  el_pt->node_pt(1) = vertex_node_pt(i + 1, j + 1, k + 1);
485 
486  // Central up face
487  el_pt->node_pt(2) = down_face_node_pt(i, j, k + 1);
488 
489  // central node
490  el_pt->node_pt(3) = central_node_pt(i, j, k);
491 
492  Element_pt.push_back(el_pt);
493 
494 
495  // Back element on up face
496  //---------------------------
497  el_pt = new TElement<3, 2>;
498 
499  // RBU
500  el_pt->node_pt(0) = vertex_node_pt(i + 1, j + 1, k + 1);
501 
502  // LBU
503  el_pt->node_pt(1) = vertex_node_pt(i, j + 1, k + 1);
504 
505  // Central up face
506  el_pt->node_pt(2) = down_face_node_pt(i, j, k + 1);
507 
508  // central node
509  el_pt->node_pt(3) = central_node_pt(i, j, k);
510 
511  Element_pt.push_back(el_pt);
512 
513 
514  // Left element on up face
515  //---------------------------
516  el_pt = new TElement<3, 2>;
517 
518 
519  // LBU
520  el_pt->node_pt(0) = vertex_node_pt(i, j + 1, k + 1);
521 
522  // RFU
523  el_pt->node_pt(1) = vertex_node_pt(i, j, k + 1);
524 
525  // Central up face
526  el_pt->node_pt(2) = down_face_node_pt(i, j, k + 1);
527 
528  // Central node
529  el_pt->node_pt(3) = central_node_pt(i, j, k);
530 
531  Element_pt.push_back(el_pt);
532 
533 
534  // DOWN FACE
535  //===========
536 
537  // Front element on down face
538  //---------------------------
539  el_pt = new TElement<3, 2>;
540 
541  // LFD
542  el_pt->node_pt(0) = vertex_node_pt(i, j, k);
543 
544  // RFD
545  el_pt->node_pt(2) = vertex_node_pt(i + 1, j, k);
546 
547  // Central down face
548  el_pt->node_pt(1) = down_face_node_pt(i, j, k);
549 
550  // Central node
551  el_pt->node_pt(3) = central_node_pt(i, j, k);
552 
553  Element_pt.push_back(el_pt);
554 
555 
556  // Front element on down face
557  //---------------------------
558  el_pt = new TElement<3, 2>;
559 
560  // RFD
561  el_pt->node_pt(0) = vertex_node_pt(i + 1, j, k);
562 
563  // RBD
564  el_pt->node_pt(2) = vertex_node_pt(i + 1, j + 1, k);
565 
566  // Central down face
567  el_pt->node_pt(1) = down_face_node_pt(i, j, k);
568 
569  // central node
570  el_pt->node_pt(3) = central_node_pt(i, j, k);
571 
572  Element_pt.push_back(el_pt);
573 
574 
575  // Back element on down face
576  //---------------------------
577  el_pt = new TElement<3, 2>;
578 
579  // RBD
580  el_pt->node_pt(0) = vertex_node_pt(i + 1, j + 1, k);
581 
582  // LBD
583  el_pt->node_pt(2) = vertex_node_pt(i, j + 1, k);
584 
585  // Central down face
586  el_pt->node_pt(1) = down_face_node_pt(i, j, k);
587 
588  // central node
589  el_pt->node_pt(3) = central_node_pt(i, j, k);
590 
591  Element_pt.push_back(el_pt);
592 
593 
594  // Left element on down face
595  //---------------------------
596  el_pt = new TElement<3, 2>;
597 
598 
599  // LBD
600  el_pt->node_pt(0) = vertex_node_pt(i, j + 1, k);
601 
602  // RFD
603  el_pt->node_pt(2) = vertex_node_pt(i, j, k);
604 
605  // Central down face
606  el_pt->node_pt(1) = down_face_node_pt(i, j, k);
607 
608  // Central node
609  el_pt->node_pt(3) = central_node_pt(i, j, k);
610 
611  Element_pt.push_back(el_pt);
612 
613 
614  // BACK FACE
615  //===========
616 
617  // Left element on back face
618  //---------------------------
619  el_pt = new TElement<3, 2>;
620 
621  // LBD
622  el_pt->node_pt(0) = vertex_node_pt(i, j + 1, k);
623 
624  // Central back face
625  el_pt->node_pt(2) = front_face_node_pt(i, j + 1, k);
626 
627  // LBU
628  el_pt->node_pt(1) = vertex_node_pt(i, j + 1, k + 1);
629 
630  // central node
631  el_pt->node_pt(3) = central_node_pt(i, j, k);
632 
633  Element_pt.push_back(el_pt);
634 
635 
636  // Down element on back face
637  //---------------------------
638  el_pt = new TElement<3, 2>;
639 
640  // LBD
641  el_pt->node_pt(0) = vertex_node_pt(i, j + 1, k);
642 
643  // RBD
644  el_pt->node_pt(2) = vertex_node_pt(i + 1, j + 1, k);
645 
646  // Central back face
647  el_pt->node_pt(1) = front_face_node_pt(i, j + 1, k);
648 
649  // Central node
650  el_pt->node_pt(3) = central_node_pt(i, j, k);
651 
652  Element_pt.push_back(el_pt);
653 
654 
655  // Right element on back face
656  //---------------------------
657  el_pt = new TElement<3, 2>;
658 
659  // RBD
660  el_pt->node_pt(0) = vertex_node_pt(i + 1, j + 1, k);
661 
662  // RBU
663  el_pt->node_pt(2) = vertex_node_pt(i + 1, j + 1, k + 1);
664 
665  // Central back face
666  el_pt->node_pt(1) = front_face_node_pt(i, j + 1, k);
667 
668  // Central node
669  el_pt->node_pt(3) = central_node_pt(i, j, k);
670 
671  Element_pt.push_back(el_pt);
672 
673 
674  // Up element on back face
675  //---------------------------
676  el_pt = new TElement<3, 2>;
677 
678  // RBU
679  el_pt->node_pt(0) = vertex_node_pt(i + 1, j + 1, k + 1);
680 
681  // LBU
682  el_pt->node_pt(2) = vertex_node_pt(i, j + 1, k + 1);
683 
684  // Central back face
685  el_pt->node_pt(1) = front_face_node_pt(i, j + 1, k);
686 
687  // Central node
688  el_pt->node_pt(3) = central_node_pt(i, j, k);
689 
690  Element_pt.push_back(el_pt);
691 
692 
693  // LEFT FACE
694  //===========
695 
696  // Front element on left face
697  //---------------------------
698  el_pt = new TElement<3, 2>;
699 
700  // LFD
701  el_pt->node_pt(0) = vertex_node_pt(i, j, k);
702 
703  // Central left face
704  el_pt->node_pt(2) = left_face_node_pt(i, j, k);
705 
706  // LFU
707  el_pt->node_pt(1) = vertex_node_pt(i, j, k + 1);
708 
709  // Central node
710  el_pt->node_pt(3) = central_node_pt(i, j, k);
711 
712  Element_pt.push_back(el_pt);
713 
714 
715  // Down element on left face
716  //---------------------------
717  el_pt = new TElement<3, 2>;
718 
719  // LFD
720  el_pt->node_pt(0) = vertex_node_pt(i, j, k);
721 
722  // LBD
723  el_pt->node_pt(2) = vertex_node_pt(i, j + 1, k);
724 
725  // Central left face
726  el_pt->node_pt(1) = left_face_node_pt(i, j, k);
727 
728  // central node
729  el_pt->node_pt(3) = central_node_pt(i, j, k);
730 
731  Element_pt.push_back(el_pt);
732 
733 
734  // Back element on left face
735  //---------------------------
736  el_pt = new TElement<3, 2>;
737 
738  // LBD
739  el_pt->node_pt(0) = vertex_node_pt(i, j + 1, k);
740 
741  // LBU
742  el_pt->node_pt(2) = vertex_node_pt(i, j + 1, k + 1);
743 
744  // Central left face
745  el_pt->node_pt(1) = left_face_node_pt(i, j, k);
746 
747  // central node
748  el_pt->node_pt(3) = central_node_pt(i, j, k);
749 
750  Element_pt.push_back(el_pt);
751 
752 
753  // Up element on left face
754  //---------------------------
755  el_pt = new TElement<3, 2>;
756 
757  // LBU
758  el_pt->node_pt(0) = vertex_node_pt(i, j + 1, k + 1);
759 
760  // LFU
761  el_pt->node_pt(2) = vertex_node_pt(i, j, k + 1);
762 
763  // Central left face
764  el_pt->node_pt(1) = left_face_node_pt(i, j, k);
765 
766  // Central node
767  el_pt->node_pt(3) = central_node_pt(i, j, k);
768 
769  Element_pt.push_back(el_pt);
770  }
771  }
772  }
773 
774  if (Node_pt.size() != nnod)
775  {
776  std::ostringstream error_stream;
777  error_stream << "Some internal error in the constructor\n"
778  << "Actual number of nodes : " << Node_pt.size()
779  << "\ndoesn't match the prediction : " << nnod
780  << std::endl;
781 
782  throw OomphLibError(
783  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
784  }
785 
786 
787  if (Element_pt.size() != nelem)
788  {
789  std::ostringstream error_stream;
790  error_stream << "Some internal error in the constructor\n"
791  << "Actual number of elements : " << Element_pt.size()
792  << "\ndoesn't match the prediction : " << nelem
793  << std::endl;
794 
795  throw OomphLibError(
796  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
797  }
798 
799  // // Deliberately switch nodes to invert elements -- test for self_test()
800  // nelem=nelement();
801  // for (unsigned e=0;e<nelem;e++)
802  // {
803  // Node* node_pt=finite_element_pt(e)->node_pt(0);
804  // finite_element_pt(e)->node_pt(0)=
805  // finite_element_pt(e)->node_pt(1);
806  // finite_element_pt(e)->node_pt(1)=node_pt;
807  // }
808  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
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
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
Definition: mesh.h:436
Vector< GeneralisedElement * > Element_pt
Vector of pointers to generalised elements.
Definition: mesh.h:186
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
char char char int int * k
Definition: level2_impl.h:374
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References oomph::Mesh::add_boundary_node(), oomph::Mesh::Element_pt, i, j, k, oomph::Mesh::Node_pt, oomph::Mesh::node_pt(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::Mesh::set_nboundary(), and oomph::Node::x().


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