full_circle_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
27#ifndef OOMPH_FULL_CIRCLE_MESH_HEADER
28#define OOMPH_FULL_CIRCLE_MESH_HEADER
29
30// Headers
31#include "generic/refineable_quad_mesh.h"
32
33// Include the headers file for domain
34#include "full_circle_domain.h"
35
36namespace oomph
37{
38 //====================================================================
39 /// Full circle mesh class.
40 /// The domain is specified by the GeomObject that identifies
41 /// the entire area. Non-refineable base version!
42 ///
43 /// The mesh boundaries are numbered as follows:
44 /// - Boundary 0: The outer wall, represented by \f$\xi_1 = 1\f$.
45 /// .
46 ///
47 //====================================================================
48 template<class ELEMENT>
49 class FullCircleMesh : public virtual QuadMeshBase
50 {
51 public:
52 /// Constructor: Pass pointer to geometric object that
53 /// specifies the area; values of theta at which dividing lines
54 /// are to be placed, fractions of the radius for the central box
55 /// at the dividing lines and the timestepper.
56 /// Timestepper defaults to Steady dummy timestepper.
60 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper);
61
62 /// Destructor: empty
64 {
65 delete Domain_pt;
66 }
67
68 /// Access function to GeomObject representing wall
70 {
71 return Area_pt;
72 }
73
74 /// Access function to domain
76 {
77 return Domain_pt;
78 }
79
80 /// Access function to underlying domain
82 {
83 return Domain_pt;
84 }
85
86 protected:
87 /// Pointer to domain
89
90 /// Pointer to the geometric object that represents the entire domain
92 };
93
94
95 ////////////////////////////////////////////////////////////////////
96 ////////////////////////////////////////////////////////////////////
97 ////////////////////////////////////////////////////////////////////
98
99 //=============================================================
100 /// Adaptative version of the FullCircleMesh base mesh.
101 /// The domain is specified by the GeomObject that identifies
102 /// the entire area
103 ///
104 /// The mesh boundaries are numbered as follows:
105 /// - Boundary 1: The outer wall, represetned by \f$\xi_1 = 1\f$.
106 /// .
107 ///
108 //=============================================================
109 template<class ELEMENT>
111 public RefineableQuadMesh<ELEMENT>
112
113 {
114 public:
115 /// Constructor for adaptive deformable quarter tube mesh class.
116 /// Pass pointer to geometric object that
117 /// specifies the volume, start and end coordinates for the centreline
118 /// on the geometric object. Values of theta at which dividing lines
119 /// are to be placed, fractions of the radius for the central box
120 /// at the dividing lines, the number of layers
121 /// and the timestepper.
122 /// Timestepper defaults to Steady dummy timestepper.
124 GeomObject* wall_pt,
127 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
130 {
131 // Loop over all elements and set macro element pointer
133 ielem++)
134 {
135 dynamic_cast<RefineableQElement<2>*>(
137 ->set_macro_elem_pt(this->Domain_pt->macro_element_pt(ielem));
138 }
139
140 // Setup Quadtree forest: Turn elements into individual octrees
141 // and plant in forest
143 for (unsigned iel = 0; iel < FullCircleMesh<ELEMENT>::nelement(); iel++)
144 {
146 ELEMENT* ref_el_pt = dynamic_cast<ELEMENT*>(el_pt);
148 trees_pt.push_back(quadtree_root_pt);
149 }
150
151 this->Forest_pt = new QuadTreeForest(trees_pt);
152
153#ifdef PARANOID
154 // Run self test
155 unsigned success_flag =
156 dynamic_cast<QuadTreeForest*>(this->Forest_pt)->self_test();
157 if (success_flag == 0)
158 {
159 oomph_info << "Successfully built quadtree forest " << std::endl;
160 }
161 else
162 {
163 throw OomphLibError("Trouble in building quadtree forest ",
166 }
167#endif
168 }
169
170 /// Destructor: empty
172 };
173
174} // namespace oomph
176#endif
Topologically circular domain, e.g. a tube cross section. The entire domain must be defined by a Geom...
Full circle mesh class. The domain is specified by the GeomObject that identifies the entire area....
FullCircleDomain * Domain_pt
Pointer to domain.
GeomObject * Area_pt
Pointer to the geometric object that represents the entire domain.
GeomObject *& area_pt()
Access function to GeomObject representing wall.
FullCircleDomain * domain_pt() const
Access function to underlying domain.
virtual ~FullCircleMesh()
Destructor: empty.
FullCircleDomain * domain_pt()
Access function to domain.
Adaptative version of the FullCircleMesh base mesh. The domain is specified by the GeomObject that id...
RefineableFullCircleMesh(GeomObject *wall_pt, const Vector< double > &theta_positions, const Vector< double > &radius_box, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor for adaptive deformable quarter tube mesh class. Pass pointer to geometric object that sp...
virtual ~RefineableFullCircleMesh()
Destructor: empty.
Unstructured refineable Triangle Mesh.