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"
32
33namespace 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
52 {
53 // BinaryTree static data needs to be setup before binary tree-based
54 // mesh refinement works
56 }
57
58 /// Broken copy constructor
60
61 /// Broken assignment operator
62 void operator=(const RefineableLineMesh&) = delete;
63
64 /// Destructor:
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 {
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.
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:
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
103 }
104 };
105
106} // namespace oomph
107
108#endif
e
Definition cfortran.h:571
A BinaryTreeForest consists of a collection of BinaryTreeRoots. Each member tree can have neighbours ...
BinaryTreeRoot is a BinaryTree that forms the root of a (recursive) binary tree. The "root node" is s...
static void setup_static_data()
Set up the static data, reflection schemes, etc.
Base class for line meshes (meshes made of 1D line elements)
Definition line_mesh.h:54
const Vector< GeneralisedElement * > & element_pt() const
Return reference to the Vector of elements.
Definition mesh.h:464
unsigned long nelement() const
Return number of elements in the mesh.
Definition mesh.h:598
Intermediate mesh class that implements the mesh adaptation functions specified in the RefineableMesh...
virtual void setup_tree_forest()
Set up the tree forest associated with the Mesh. Forwards call to setup_binary_tree_forest().
RefineableLineMesh(const RefineableLineMesh &dummy)=delete
Broken copy constructor.
virtual ~RefineableLineMesh()
Destructor:
RefineableLineMesh()
Constructor: Set up static binary tree data.
void operator=(const RefineableLineMesh &)=delete
Broken assignment operator.
void setup_binary_tree_forest()
Set up BinaryTreeForest. Wipes any existing tree structure and regards the currently active elements ...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
TreeForest * Forest_pt
Forest representation of the mesh.
Templated base class for refineable meshes. The use of the template parameter is required only for cr...
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).