simple_cubic_tet_mesh.h
Go to the documentation of this file.
1// LIC// ====================================================================
2// LIC// This file forms part of oomph-lib, the object-oriented,
3// LIC// multi-physics finite-element library, available
4// LIC// at http://www.oomph-lib.org.
5// LIC//
6// LIC// Copyright (C) 2006-2025 Matthias Heil and Andrew Hazel
7// LIC//
8// LIC// This library is free software; you can redistribute it and/or
9// LIC// modify it under the terms of the GNU Lesser General Public
10// LIC// License as published by the Free Software Foundation; either
11// LIC// version 2.1 of the License, or (at your option) any later version.
12// LIC//
13// LIC// This library is distributed in the hope that it will be useful,
14// LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16// LIC// Lesser General Public License for more details.
17// LIC//
18// LIC// You should have received a copy of the GNU Lesser General Public
19// LIC// License along with this library; if not, write to the Free Software
20// LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21// LIC// 02110-1301 USA.
22// LIC//
23// LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24// LIC//
25// LIC//====================================================================
26#ifndef OOMPH_SIMPLE_CUBIC_TET_MESH_HEADER
27#define OOMPH_SIMPLE_CUBIC_TET_MESH_HEADER
28
29#include "generic/Telements.h"
30#include "generic/tet_mesh.h"
32
33namespace oomph
34{
35 //===================================================================
36 /// MySimple 3D tet mesh for TElements
37 //===================================================================
38 template<class ELEMENT>
40 {
41 public:
42 /// Constructor: Pass number of element blocks
43 /// in the x, y and z directions and the corresponding dimensions.
44 /// Timestepper defaults to Steady.
46 const unsigned& n_x,
47 const unsigned& n_y,
48 const unsigned& n_z,
49 const double& l_x,
50 const double& l_y,
51 const double& l_z,
52 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
53 {
54 // Mesh can only be built with 3D Telements.
55 MeshChecker::assert_geometric_element<TElementGeometricBase, ELEMENT>(3);
56
57 std::ostringstream warn_message;
59 << "Note: The SimpleCubicTetMesh() is quite inefficient.\n"
60 << " If your code takes a long time in the constructor\n"
61 << " consider using another tet mesh\n";
63 "SimpleCubicTetMesh::SimpleCubicTetMesh()",
65 oomph_info << "Starting mesh construction..." << std::endl;
67
68 // Build scaffold mesh
71
72 // Build actual mesh from scaffold mesh
73 build_from_scaffold(time_stepper_pt);
74
75 delete Tmp_mesh_pt;
76
77 double end_t = TimingHelpers::timer();
78 oomph_info << "...finished mesh construction. Total time [sec] "
79 << end_t - start_t << std::endl;
80 }
81
82 private:
83 /// Build mesh from scaffold mesh
84 void build_from_scaffold(TimeStepper* time_stepper_pt);
85
86 /// Temporary scaffold mesh
88 };
89
90} // namespace oomph
91
93#endif
A general mesh class.
Definition mesh.h:67
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors.
Definition mesh.h:75
An OomphLibWarning object which should be created as a temporary object to issue a warning....
MySimple 3D tet mesh for TElements.
Mesh * Tmp_mesh_pt
Temporary scaffold mesh.
void build_from_scaffold(TimeStepper *time_stepper_pt)
Build mesh from scaffold mesh.
SimpleCubicTetMesh(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 element blocks in the x, y and z directions and the corresponding dimensi...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
Base class for tet meshes (meshes made of 3D tet elements).
Definition tet_mesh.h:847
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
double timer()
returns the time in seconds after some point in past
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...