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
Installation
Installation guide
Copyright
About
People
Contact/Get involved
Publications
Acknowledgements
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-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 LMESH2OOMPH_D_HEADER
27
#define LMESH2OOMPH_D_HEADER
28
29
#include "
line_mesh.h
"
30
#include "
refineable_mesh.h
"
31
#include "
refineable_line_element.h
"
32
// Include to fill in additional_setup_shared_node_scheme() function
33
#include "
refineable_mesh.template.cc
"
34
35
namespace
oomph
36
{
37
//===========================================================================
38
/// Intermediate mesh class that implements the mesh adaptation functions
39
/// specified in the RefineableMesh class for meshes that contain the
40
/// refineable variant of QElement s [The class ELEMENT provided as the
41
/// template parameter must be of type RefineableQElement<1>].
42
///
43
/// Mesh adaptation/refinement is implemented by BinaryTree procedures
44
/// and any concrete implementation of this class needs to provide a
45
/// BinaryTreeForest representation of the initial (coarse) mesh.
46
//===========================================================================
47
template
<
class
ELEMENT>
48
class
RefineableLineMesh
:
public
virtual
TreeBasedRefineableMesh
<ELEMENT>,
49
public
virtual
LineMeshBase
50
{
51
public
:
52
/// Constructor: Set up static binary tree data
53
RefineableLineMesh
()
54
{
55
// BinaryTree static data needs to be setup before binary tree-based
56
// mesh refinement works
57
BinaryTree::setup_static_data
();
58
}
59
60
/// Broken copy constructor
61
RefineableLineMesh
(
const
RefineableLineMesh
& dummy) =
delete
;
62
63
/// Broken assignment operator
64
void
operator=
(
const
RefineableLineMesh
&) =
delete
;
65
66
/// Destructor:
67
virtual
~RefineableLineMesh
() {}
68
69
/// Set up the tree forest associated with the Mesh.
70
/// Forwards call to setup_binary_tree_forest().
71
virtual
void
setup_tree_forest
()
72
{
73
setup_binary_tree_forest
();
74
}
75
76
/// Set up BinaryTreeForest. Wipes any existing tree structure and
77
/// regards the currently active elements as the root trees in the forest.
78
void
setup_binary_tree_forest
()
79
{
80
// This wipes all elements/binary trees in the tree representation
81
// but leaves the leaf elements alone
82
if
(this->
Forest_pt
!= 0)
delete
this->
Forest_pt
;
83
84
// Each finite element in the coarse base mesh gets associated with
85
// (the root of) a BinaryTree. Store BinaryTreeRoots in vector:
86
Vector<TreeRoot*>
trees_pt;
87
88
// Determine number of elements in mesh
89
const
unsigned
n_element = this->
nelement
();
90
91
// Loop over all elements, build corresponding BinaryTree and store
92
// BinaryTreeRoots in vector:
93
for
(
unsigned
e
= 0;
e
< n_element;
e
++)
94
{
95
// Get pointer to full element type
96
ELEMENT* el_pt =
dynamic_cast<
ELEMENT*
>
(this->
element_pt
(
e
));
97
98
// Build associated binary tree(root) -- pass pointer to corresponding
99
// finite element and add the pointer to vector of binary tree (roots):
100
trees_pt.push_back(
new
BinaryTreeRoot
(el_pt));
101
}
102
103
// Plant BinaryTreeRoots in BinaryTreeForest
104
this->
Forest_pt
=
new
BinaryTreeForest
(trees_pt);
105
}
106
};
107
108
}
// namespace oomph
109
110
#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:460
oomph::Mesh::nelement
unsigned long nelement() const
Return number of elements in the mesh.
Definition:
mesh.h:590
oomph::RefineableLineMesh
Intermediate mesh class that implements the mesh adaptation functions specified in the RefineableMesh...
Definition:
refineable_line_mesh.h:50
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:71
oomph::RefineableLineMesh::RefineableLineMesh
RefineableLineMesh(const RefineableLineMesh &dummy)=delete
Broken copy constructor.
oomph::RefineableLineMesh::~RefineableLineMesh
virtual ~RefineableLineMesh()
Destructor:
Definition:
refineable_line_mesh.h:67
oomph::RefineableLineMesh::RefineableLineMesh
RefineableLineMesh()
Constructor: Set up static binary tree data.
Definition:
refineable_line_mesh.h:53
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:78
oomph::TreeBasedRefineableMeshBase::Forest_pt
TreeForest * Forest_pt
Forest representation of the mesh.
Definition:
refineable_mesh.h:768
oomph::TreeBasedRefineableMesh
///////////////////////////////////////////////////////////////// ///////////////////////////////////...
Definition:
refineable_mesh.h:809
oomph::Vector
A slight extension to the standard template vector class so that we can include "graceful" array rang...
Definition:
Vector.h:58
line_mesh.h
oomph
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
Definition:
advection_diffusion_elements.cc:30
refineable_line_element.h
refineable_mesh.h
refineable_mesh.template.cc