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
Get it
Installation guide
Get code from subversion repository
Get code as tar file
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// Version 1.0; svn revision $LastChangedRevision$
7
//LIC//
8
//LIC// $LastChangedDate$
9
//LIC//
10
//LIC// Copyright (C) 2006-2016 Matthias Heil and Andrew Hazel
11
//LIC//
12
//LIC// This library is free software; you can redistribute it and/or
13
//LIC// modify it under the terms of the GNU Lesser General Public
14
//LIC// License as published by the Free Software Foundation; either
15
//LIC// version 2.1 of the License, or (at your option) any later version.
16
//LIC//
17
//LIC// This library is distributed in the hope that it will be useful,
18
//LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
//LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
//LIC// Lesser General Public License for more details.
21
//LIC//
22
//LIC// You should have received a copy of the GNU Lesser General Public
23
//LIC// License along with this library; if not, write to the Free Software
24
//LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25
//LIC// 02110-1301 USA.
26
//LIC//
27
//LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
28
//LIC//
29
//LIC//====================================================================
30
#ifndef LMESH2OOMPH_D_HEADER
31
#define LMESH2OOMPH_D_HEADER
32
33
#include "
line_mesh.h
"
34
#include "
refineable_mesh.h
"
35
#include "
refineable_line_element.h
"
36
//Include to fill in additional_setup_shared_node_scheme() function
37
#include "
refineable_mesh.template.cc
"
38
39
namespace
oomph
40
{
41
42
//===========================================================================
43
/// Intermediate mesh class that implements the mesh adaptation functions
44
/// specified in the RefineableMesh class for meshes that contain the
45
/// refineable variant of QElement s [The class ELEMENT provided as the
46
/// template parameter must be of type RefineableQElement<1>].
47
///
48
/// Mesh adaptation/refinement is implemented by BinaryTree procedures
49
/// and any concrete implementation of this class needs to provide a
50
/// BinaryTreeForest representation of the initial (coarse) mesh.
51
//===========================================================================
52
template
<
class
ELEMENT>
53
class
RefineableLineMesh
:
public
virtual
TreeBasedRefineableMesh
<ELEMENT>,
54
public
virtual
LineMeshBase
55
{
56
57
public
:
58
59
/// Constructor: Set up static binary tree data
60
RefineableLineMesh
()
61
{
62
// BinaryTree static data needs to be setup before binary tree-based
63
// mesh refinement works
64
BinaryTree::setup_static_data
();
65
}
66
67
/// Broken copy constructor
68
RefineableLineMesh
(
const
RefineableLineMesh
& dummy)
69
{
70
BrokenCopy::broken_copy
(
"RefineableLineMesh"
);
71
}
72
73
/// Broken assignment operator
74
void
operator=
(
const
RefineableLineMesh
&)
75
{
76
BrokenCopy::broken_assign
(
"RefineableLineMesh"
);
77
}
78
79
/// Destructor:
80
virtual
~RefineableLineMesh
() {}
81
82
/// \short Set up the tree forest associated with the Mesh.
83
/// Forwards call to setup_binary_tree_forest().
84
virtual
void
setup_tree_forest
()
85
{
86
setup_binary_tree_forest
();
87
}
88
89
/// Set up BinaryTreeForest. Wipes any existing tree structure and
90
/// regards the currently active elements as the root trees in the forest.
91
void
setup_binary_tree_forest
()
92
{
93
// This wipes all elements/binary trees in the tree representation
94
// but leaves the leaf elements alone
95
if
(this->
Forest_pt
!=0)
delete
this->
Forest_pt
;
96
97
// Each finite element in the coarse base mesh gets associated with
98
// (the root of) a BinaryTree. Store BinaryTreeRoots in vector:
99
Vector<TreeRoot*>
trees_pt;
100
101
// Determine number of elements in mesh
102
const
unsigned
n_element=this->
nelement
();
103
104
// Loop over all elements, build corresponding BinaryTree and store
105
// BinaryTreeRoots in vector:
106
for
(
unsigned
e
=0;
e
<n_element;
e
++)
107
{
108
// Get pointer to full element type
109
ELEMENT* el_pt =
dynamic_cast<
ELEMENT*
>
(this->
element_pt
(
e
));
110
111
// Build associated binary tree(root) -- pass pointer to corresponding
112
// finite element and add the pointer to vector of binary tree (roots):
113
trees_pt.push_back(
new
BinaryTreeRoot
(el_pt));
114
}
115
116
// Plant BinaryTreeRoots in BinaryTreeForest
117
this->
Forest_pt
=
new
BinaryTreeForest
(trees_pt);
118
}
119
120
};
121
122
}
// End of namespace
123
124
#endif
oomph::RefineableLineMesh::~RefineableLineMesh
virtual ~RefineableLineMesh()
Destructor:
Definition:
refineable_line_mesh.h:80
oomph::BrokenCopy::broken_copy
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
Definition:
oomph_utilities.cc:107
oomph::BinaryTreeRoot
Definition:
binary_tree.h:232
line_mesh.h
oomph::RefineableLineMesh::setup_binary_tree_forest
void setup_binary_tree_forest()
Definition:
refineable_line_mesh.h:91
oomph::RefineableLineMesh
Definition:
refineable_line_mesh.h:53
e
e
Definition:
cfortran.h:575
refineable_mesh.template.cc
oomph::TreeBasedRefineableMeshBase::Forest_pt
TreeForest * Forest_pt
Forest representation of the mesh.
Definition:
refineable_mesh.h:727
oomph::Mesh::nelement
unsigned long nelement() const
Return number of elements in the mesh.
Definition:
mesh.h:587
oomph::BinaryTree::setup_static_data
static void setup_static_data()
Set up the static data, reflection schemes, etc.
Definition:
binary_tree.cc:90
oomph
Definition:
advection_diffusion_elements.cc:33
oomph::Vector
Definition:
Vector.h:63
oomph::BinaryTreeForest
Definition:
binary_tree.h:293
oomph::TreeBasedRefineableMesh
Definition:
refineable_mesh.h:769
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:84
oomph::LineMeshBase
Base class for line meshes (meshes made of 1D line elements)
Definition:
line_mesh.h:58
refineable_line_element.h
oomph::RefineableLineMesh::operator=
void operator=(const RefineableLineMesh &)
Broken assignment operator.
Definition:
refineable_line_mesh.h:74
oomph::BrokenCopy::broken_assign
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
Definition:
oomph_utilities.cc:90
oomph::RefineableLineMesh::RefineableLineMesh
RefineableLineMesh()
Constructor: Set up static binary tree data.
Definition:
refineable_line_mesh.h:60
oomph::Mesh::element_pt
const Vector< GeneralisedElement * > & element_pt() const
Return reference to the Vector of elements.
Definition:
mesh.h:470
oomph::RefineableLineMesh::RefineableLineMesh
RefineableLineMesh(const RefineableLineMesh &dummy)
Broken copy constructor.
Definition:
refineable_line_mesh.h:68
refineable_mesh.h