geompack_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// Copyright (C) 2006-2023 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_GEOMPACK_MESH_HEADER
27 #define OOMPH_GEOMPACK_MESH_HEADER
28 
29 #include "../generic/geompack_scaffold_mesh.h"
30 
31 namespace oomph
32 {
33  //=========start_of_geompackquadmesh_class================================
34  /// Quadrilateral mesh generator; Uses input from Geompack++.
35  /// See: http://members.shaw.ca/bjoe/
36  /// Currently only for four-noded quads -- extension to higher-order
37  /// quads should be trivial (see the corresponding classes for
38  /// triangular meshes).
39  //========================================================================
40  template<class ELEMENT>
41  class GeompackQuadMesh : public Mesh
42  {
43  public:
44  /// Constructor with the input files
45  GeompackQuadMesh(const std::string& mesh_file_name,
46  const std::string& curve_file_name,
47  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
48  {
49  // Mesh can only be built with four-noded 2D Qelements.
50  MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2,
51  2);
52 
53  // Build scaffold
54  Tmp_mesh_pt =
55  new GeompackQuadScaffoldMesh(mesh_file_name, curve_file_name);
56 
57  // Convert mesh from scaffold to actual mesh
58  build_from_scaffold(time_stepper_pt);
59 
60  // Kill the scaffold
61  delete Tmp_mesh_pt;
62  Tmp_mesh_pt = 0;
63  }
64 
65  /// Empty destructor
67 
68  private:
69  /// Temporary scaffold mesh
71 
72  /// Build mesh from scaffold
73  void build_from_scaffold(TimeStepper* time_stepper_pt);
74  };
75 
76 } // namespace oomph
77 
78 #endif
Quadrilateral mesh generator; Uses input from Geompack++. See: http://members.shaw....
GeompackQuadScaffoldMesh * Tmp_mesh_pt
Temporary scaffold mesh.
void build_from_scaffold(TimeStepper *time_stepper_pt)
Build mesh from scaffold.
~GeompackQuadMesh()
Empty destructor.
GeompackQuadMesh(const std::string &mesh_file_name, const std::string &curve_file_name, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor with the input files.
Mesh that is based on input files generated by the quadrilateral mesh generator Geompack.
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
////////////////////////////////////////////////////////////////////// //////////////////////////////...
Definition: timesteppers.h:231
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...