Toggle navigation
Documentation
Big picture
The finite element method
The data structure
Not-so-quick guide
Optimisation
Order of action functions
Example codes and tutorials
List of example codes and tutorials
Meshing
Solvers
MPI parallel processing
Post-processing/visualisation
Other
Change log
Creating documentation
Coding conventions
Index
FAQ
About
People
Contact/Get involved
Publications
Acknowledgements
Copyright
Picture show
Go
src
generic
refineable_line_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_REFINEABLE_LINE_MESH_HEADER
27
#define OOMPH_REFINEABLE_LINE_MESH_HEADER
28
29
#include "
line_mesh.h
"
30
#include "
refineable_mesh.h
"
31
#include "
refineable_line_element.h
"
32
33
namespace
oomph
34
{
35
//===========================================================================
36
/// Intermediate mesh class that implements the mesh adaptation functions
37
/// specified in the RefineableMesh class for meshes that contain the
38
/// refineable variant of QElement s [The class ELEMENT provided as the
39
/// template parameter must be of type RefineableQElement<1>].
40
///
41
/// Mesh adaptation/refinement is implemented by BinaryTree procedures
42
/// and any concrete implementation of this class needs to provide a
43
/// BinaryTreeForest representation of the initial (coarse) mesh.
44
//===========================================================================
45
template
<
class
ELEMENT>
46
class
RefineableLineMesh
:
public
virtual
TreeBasedRefineableMesh
<ELEMENT>,
47
public
virtual
LineMeshBase
48
{
49
public
:
50
/// Constructor: Set up static binary tree data
51
RefineableLineMesh
()
52
{
53
// BinaryTree static data needs to be setup before binary tree-based
54
// mesh refinement works
55
BinaryTree::setup_static_data
();
56
}
57
58
/// Broken copy constructor
59
RefineableLineMesh
(
const
RefineableLineMesh
&
dummy
) =
delete
;
60
61
/// Broken assignment operator
62
void
operator=
(
const
RefineableLineMesh
&) =
delete
;
63
64
/// Destructor:
65
virtual
~RefineableLineMesh
() {}
66
67
/// Set up the tree forest associated with the Mesh.
68
/// Forwards call to setup_binary_tree_forest().
69
virtual
void
setup_tree_forest
()
70
{
71
setup_binary_tree_forest
();
72
}
73
74
/// Set up BinaryTreeForest. Wipes any existing tree structure and
75
/// regards the currently active elements as the root trees in the forest.
76
void
setup_binary_tree_forest
()
77
{
78
// This wipes all elements/binary trees in the tree representation
79
// but leaves the leaf elements alone
80
if
(this->
Forest_pt
!= 0)
delete
this->
Forest_pt
;
81
82
// Each finite element in the coarse base mesh gets associated with
83
// (the root of) a BinaryTree. Store BinaryTreeRoots in vector:
84
Vector<TreeRoot*>
trees_pt
;
85
86
// Determine number of elements in mesh
87
const
unsigned
n_element
= this->
nelement
();
88
89
// Loop over all elements, build corresponding BinaryTree and store
90
// BinaryTreeRoots in vector:
91
for
(
unsigned
e
= 0;
e
< n_element;
e
++)
92
{
93
// Get pointer to full element type
94
ELEMENT*
el_pt
=
dynamic_cast<
ELEMENT*
>
(this->
element_pt
(
e
));
95
96
// Build associated binary tree(root) -- pass pointer to corresponding
97
// finite element and add the pointer to vector of binary tree (roots):
98
trees_pt.push_back(
new
BinaryTreeRoot
(
el_pt
));
99
}
100
101
// Plant BinaryTreeRoots in BinaryTreeForest
102
this->
Forest_pt
=
new
BinaryTreeForest
(
trees_pt
);
103
}
104
};
105
106
}
// namespace oomph
107
108
#endif
e
e
Definition
cfortran.h:571
oomph::BinaryTreeForest
A BinaryTreeForest consists of a collection of BinaryTreeRoots. Each member tree can have neighbours ...
Definition
binary_tree.h:286
oomph::BinaryTreeRoot
BinaryTreeRoot is a BinaryTree that forms the root of a (recursive) binary tree. The "root node" is s...
Definition
binary_tree.h:231
oomph::BinaryTree::setup_static_data
static void setup_static_data()
Set up the static data, reflection schemes, etc.
Definition
binary_tree.cc:86
oomph::LineMeshBase
Base class for line meshes (meshes made of 1D line elements)
Definition
line_mesh.h:54
oomph::Mesh::element_pt
const Vector< GeneralisedElement * > & element_pt() const
Return reference to the Vector of elements.
Definition
mesh.h:464
oomph::Mesh::nelement
unsigned long nelement() const
Return number of elements in the mesh.
Definition
mesh.h:598
oomph::RefineableLineMesh
Intermediate mesh class that implements the mesh adaptation functions specified in the RefineableMesh...
Definition
refineable_line_mesh.h:48
oomph::RefineableLineMesh::setup_tree_forest
virtual void setup_tree_forest()
Set up the tree forest associated with the Mesh. Forwards call to setup_binary_tree_forest().
Definition
refineable_line_mesh.h:69
oomph::RefineableLineMesh::RefineableLineMesh
RefineableLineMesh(const RefineableLineMesh &dummy)=delete
Broken copy constructor.
oomph::RefineableLineMesh::~RefineableLineMesh
virtual ~RefineableLineMesh()
Destructor:
Definition
refineable_line_mesh.h:65
oomph::RefineableLineMesh::RefineableLineMesh
RefineableLineMesh()
Constructor: Set up static binary tree data.
Definition
refineable_line_mesh.h:51
oomph::RefineableLineMesh::operator=
void operator=(const RefineableLineMesh &)=delete
Broken assignment operator.
oomph::RefineableLineMesh::setup_binary_tree_forest
void setup_binary_tree_forest()
Set up BinaryTreeForest. Wipes any existing tree structure and regards the currently active elements ...
Definition
refineable_line_mesh.h:76
oomph::TAdvectionDiffusionReactionElement
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
Definition
Tadvection_diffusion_reaction_elements.h:66
oomph::TreeBasedRefineableMeshBase::Forest_pt
TreeForest * Forest_pt
Forest representation of the mesh.
Definition
refineable_mesh.h:768
oomph::TreeBasedRefineableMesh
Templated base class for refineable meshes. The use of the template parameter is required only for cr...
Definition
refineable_mesh.h:809
line_mesh.h
oomph
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition
advection_diffusion_elements.cc:30
refineable_line_element.h
refineable_mesh.h