libMesh
tree_base.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_TREE_BASE_H
21 #define LIBMESH_TREE_BASE_H
22 
23 // Local includes
24 #include "libmesh/reference_counted_object.h"
25 
26 // C++ includes
27 #include <set>
28 
29 namespace libMesh
30 {
31 
32 
33 // Forward Declarations
34 class TreeBase;
35 class MeshBase;
36 class Point;
37 class Elem;
38 
39 
40 namespace Trees
41 {
55 enum BuildType {NODES=0,
59 }
60 
65 class TreeBase : public ReferenceCountedObject<TreeBase>
66 {
67 protected:
71  explicit
72  TreeBase (const MeshBase & m);
73 
74 public:
78  virtual ~TreeBase() {}
79 
83  virtual void print_nodes(std::ostream & out=libMesh::out) const = 0;
84 
88  virtual void print_elements(std::ostream & out=libMesh::out) const = 0;
89 
93  virtual unsigned int n_active_bins() const = 0;
94 
100  virtual const Elem * find_element(const Point & p,
101  const std::set<subdomain_id_type> * allowed_subdomains = libmesh_nullptr,
102  Real relative_tol = TOLERANCE) const = 0;
103 
104 protected:
105 
110  const MeshBase & mesh;
111 };
112 
113 // ------------------------------------------------------------
114 // TreeBase class inline methods
115 
116 // constructor
117 inline
119  mesh(m)
120 {
121 }
122 
123 } // namespace libMesh
124 
125 
126 #endif // LIBMESH_TREE_BASE_H
TreeBase(const MeshBase &m)
Constructor.
Definition: tree_base.h:118
This is the base class from which all geometric element types are derived.
Definition: elem.h:89
MeshBase & mesh
const class libmesh_nullptr_t libmesh_nullptr
static const Real TOLERANCE
The libMesh namespace provides an interface to certain functionality in the library.
This is the MeshBase class.
Definition: mesh_base.h:68
const MeshBase & mesh
Constant reference to a mesh.
Definition: tree_base.h:110
This class implements reference counting.
This is the base class for trees, it allows pointer usage of trees.
Definition: tree_base.h:65
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
OStreamProxy out
BuildType
enum defining how to build the tree.
Definition: tree_base.h:55
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
virtual ~TreeBase()
Destructor.
Definition: tree_base.h:78