simple_cubic_tet_mesh.template.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// Version 1.0; svn revision $LastChangedRevision$
7 //LIC//
8 //LIC// $LastChangedDate$
9 //LIC//
10 //LIC// Copyright (C) 2006-2016 Matthias Heil and Andrew Hazel
11 //LIC//
12 //LIC// This library is free software; you can redistribute it and/or
13 //LIC// modify it under the terms of the GNU Lesser General Public
14 //LIC// License as published by the Free Software Foundation; either
15 //LIC// version 2.1 of the License, or (at your option) any later version.
16 //LIC//
17 //LIC// This library is distributed in the hope that it will be useful,
18 //LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 //LIC// Lesser General Public License for more details.
21 //LIC//
22 //LIC// You should have received a copy of the GNU Lesser General Public
23 //LIC// License along with this library; if not, write to the Free Software
24 //LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 //LIC// 02110-1301 USA.
26 //LIC//
27 //LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
28 //LIC//
29 //LIC//====================================================================
30 #ifndef OOMPH_SIMPLE_CUBIC_TET_MESH_HEADER
31 #define OOMPH_SIMPLE_CUBIC_TET_MESH_HEADER
32 
33 #include "../generic/Telements.h"
34 #include "../generic/tet_mesh.h"
35 #include "../generic/simple_cubic_scaffold_tet_mesh.h"
36 
37 namespace oomph
38 {
39 
40 //===================================================================
41 /// MySimple 3D tet mesh for TElements
42 //===================================================================
43 template <class ELEMENT>
45 {
46 
47  public:
48 
49  /// \short Constructor: Pass number of element blocks
50  /// in the x, y and z directions and the corresponding dimensions.
51  /// Timestepper defaults to Steady.
52  SimpleCubicTetMesh(const unsigned &n_x, const unsigned &n_y,
53  const unsigned &n_z, const double &l_x,
54  const double &l_y, const double &l_z,
55  TimeStepper* time_stepper_pt=&Mesh::Default_TimeStepper)
56  {
57  // Mesh can only be built with 3D Telements.
58  MeshChecker::assert_geometric_element<TElementGeometricBase,ELEMENT>(3);
59 
60 
61  std::ostringstream warn_message;
62  warn_message << "Note: The SimpleCubicTetMesh() is quite inefficient.\n"
63  << " If your code takes a long time in the constructor\n"
64  << " consider using another tet mesh\n";
65  OomphLibWarning(warn_message.str(),
66  "SimpleCubicTetMesh::SimpleCubicTetMesh()",
67  OOMPH_EXCEPTION_LOCATION);
68  oomph_info << "Starting mesh construction..." << std::endl;
69  double start_t = TimingHelpers::timer();
70 
71  // Build scaffold mesh
72  Tmp_mesh_pt = new SimpleCubicScaffoldTetMesh(n_x,n_y,n_z,
73  l_x,l_y,l_z);
74 
75  // Build actual mesh from scaffold mesh
76  build_from_scaffold(time_stepper_pt);
77 
78  delete Tmp_mesh_pt;
79 
80  double end_t = TimingHelpers::timer();
81  oomph_info << "...finished mesh construction. Total time [sec] "
82  << end_t-start_t << std::endl;
83  }
84 
85 
86 private:
87 
88  /// Build mesh from scaffold mesh
89  void build_from_scaffold(TimeStepper* time_stepper_pt);
90 
91  /// Temporary scaffold mesh
93 
94 };
95 
96 }
97 
98 #endif
MySimple 3D tet mesh for TElements.
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors. ...
Definition: mesh.h:85
Scaffold mesh for cubic tet mesh.
Mesh * Tmp_mesh_pt
Temporary scaffold mesh.
Base class for tet meshes (meshes made of 3D tet elements).
Definition: tet_mesh.h:645
OomphInfo oomph_info
double timer()
returns the time in seconds after some point in past
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
Definition: timesteppers.h:219
A general mesh class.
Definition: mesh.h:74
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...