xda_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_XDA_TET_MESH_HEADER
27#define OOMPH_XDA_TET_MESH_HEADER
28
29// Config header
30#ifdef HAVE_CONFIG_H
31#include <oomph-lib-config.h>
32#endif
33
34#ifdef OOMPH_HAS_MPI
35// mpi headers
36#include "mpi.h"
37#endif
38
39#include <string>
40#include <iterator>
41#include <algorithm>
42
43#include "generic/mesh.h"
44#include "generic/tet_mesh.h"
45
46namespace oomph
47{
48 //========================================================================
49 /// Tet mesh made of quadratic (ten node) tets built from xda input file.
50 //========================================================================
51 template<class ELEMENT>
52 class XdaTetMesh : public virtual TetMeshBase
53 {
54 public:
55 /// Constructor: Pass name of xda file. Note that
56 /// all boundary elements get their own ID -- this is required for
57 /// FSI problems. In this case; the vector containing the oomph-lib
58 /// boundary IDs of all oomph-lib boundaries that collectively form
59 /// a given boundary as specified in the xda input file can be
60 /// obtained from the access function oomph_lib_boundary_ids(...).
61 /// Timestepper defaults to steady pseudo-timestepper.
62 XdaTetMesh(const std::string xda_file_name,
63 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper);
64
65 /// Setup boundary coordinate on boundary b while is
66 /// temporarily flattened to simplex faces. Boundary coordinates are the
67 /// x-y coordinates in the plane of that boundary with the
68 /// x-axis along the line from the (lexicographically)
69 /// "lower left" to the "upper right" node. The y axis
70 /// is obtained by taking the cross-product of the positive
71 /// x direction with the outer unit normal computed by
72 /// the face elements (or its negative if switch_normal is set
73 /// to true).
74 void setup_boundary_coordinates(const unsigned& b,
75 const bool& switch_normal)
76 {
77 std::ofstream outfile;
79 }
80
81 /// Setup boundary coordinate on boundary b while is
82 /// temporarily flattened to simplex faces. Boundary coordinates are the
83 /// x-y coordinates in the plane of that boundary with the
84 /// x-axis along the line from the (lexicographically)
85 /// "lower left" to the "upper right" node. The y axis
86 /// is obtained by taking the cross-product of the positive
87 /// x direction with the outer unit normal computed by
88 /// the face elements (or its negative if switch_normal is set
89 /// to true). Doc faces in output file.
90 void setup_boundary_coordinates(const unsigned& b,
91 const bool& switch_normal,
92 std::ofstream& outfile);
93
94 /// Access function to the number of distinct boundaries specified
95 /// in the original xda enumeration.
96 unsigned nxda_boundary()
97 {
98 return Boundary_id.size();
99 }
100
101 /// Access functions to the Vector of oomph-lib boundary ids
102 /// that make up boundary b in the original xda enumeration
107
108 private:
109 /// Vector of vectors containing the boundary IDs of
110 /// the overall boundary specified in the xda file.
112 };
113
114
115 ////////////////////////////////////////////////////////////////////
116 ////////////////////////////////////////////////////////////////////
117 ////////////////////////////////////////////////////////////////////
118
119 //==========================================================================
120 /// Xda-based tet mesh upgraded to become a solid mesh.
121 //=========================================================================
122 template<class ELEMENT>
123 class SolidXdaTetMesh : public virtual XdaTetMesh<ELEMENT>,
124 public virtual SolidMesh
125 {
126 public:
127 /// Constructor. Boundary coordinates are setup
128 /// automatically.
130 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
131 : XdaTetMesh<ELEMENT>(xda_file_name, time_stepper_pt)
132 {
133 // Assign the Lagrangian coordinates
135 }
136
137 /// Empty Destructor
138 virtual ~SolidXdaTetMesh() {}
139 };
140
141
142 ////////////////////////////////////////////////////////////////////
143 ////////////////////////////////////////////////////////////////////
144 ////////////////////////////////////////////////////////////////////
145
146} // namespace oomph
147
149#endif
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
Definition elements.cc:4320
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors.
Definition mesh.h:75
General SolidMesh class.
Definition mesh.h:2570
void set_lagrangian_nodal_coordinates()
Make the current configuration the undeformed one by setting the nodal Lagrangian coordinates to thei...
Definition mesh.cc:9564
Xda-based tet mesh upgraded to become a solid mesh.
SolidXdaTetMesh(const std::string xda_file_name, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor. Boundary coordinates are setup automatically.
virtual ~SolidXdaTetMesh()
Empty Destructor.
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...
Tet mesh made of quadratic (ten node) tets built from xda input file.
Vector< unsigned > oomph_lib_boundary_ids(const unsigned &xda_boundary_id)
Access functions to the Vector of oomph-lib boundary ids that make up boundary b in the original xda ...
Vector< Vector< unsigned > > Boundary_id
Vector of vectors containing the boundary IDs of the overall boundary specified in the xda file.
void setup_boundary_coordinates(const unsigned &b, const bool &switch_normal)
Setup boundary coordinate on boundary b while is temporarily flattened to simplex faces....
unsigned nxda_boundary()
Access function to the number of distinct boundaries specified in the original xda enumeration.
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).