tree_base.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 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
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 = 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)
Definition: tree_base.h:118
The base class for all geometric element types.
Definition: elem.h:100
MeshBase & mesh
static const Real TOLERANCE
virtual unsigned int n_active_bins() const =0
virtual void print_elements(std::ostream &out=libMesh::out) const =0
Base class for Mesh.
Definition: mesh_base.h:77
const MeshBase & mesh
Definition: tree_base.h:110
virtual const Elem * find_element(const Point &p, const std::set< subdomain_id_type > *allowed_subdomains=nullptr, Real relative_tol=TOLERANCE) const =0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
BuildType
Base class for different Tree types.
Definition: tree_base.h:55
virtual void print_nodes(std::ostream &out=libMesh::out) const =0
OStreamProxy out(std::cout)
A geometric point in (x,y,z) space.
Definition: point.h:38
virtual ~TreeBase()
Definition: tree_base.h:78