#include <tree.h>
Tree (const MeshBase &m, const unsigned int level, Trees::BuildType bt=Trees::NODES)
Tree (const Tree< N > &other_tree)
~Tree ()
void print_nodes () const
void print_elements () const
unsigned int n_active_bins () const
const Elem * find_element (const Point &p) const
const Elem * operator() (const Point &p) const
static std::string get_info ()
static void print_info ()
static unsigned int n_objects ()
typedef std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
void increment_constructor_count (const std::string &name)
void increment_destructor_count (const std::string &name)
static Counts _counts
static Threads::atomic< unsigned int > _n_objects
static Threads::spin_mutex _mutex
TreeNode< N > root
const Trees::BuildType build_type
Author:
Definition at line 44 of file tree.h.
Definition at line 105 of file reference_counter.h.
Definition at line 36 of file tree.C.
References MeshBase::active_elements_begin(), MeshBase::active_elements_end(), MeshTools::bounding_box(), MeshTools::build_nodes_to_elem_map(), Tree< N >::build_type, Trees::ELEMENTS, TreeBase::mesh, Trees::NODES, MeshBase::nodes_begin(), MeshBase::nodes_end(), and Tree< N >::root.
:
TreeBase(m),
root(m,level),
build_type(bt)
{
// Set the root node bounding box equal to the bounding
// box for the entire domain.
root.set_bounding_box (MeshTools::bounding_box(mesh));
if (build_type == Trees::NODES)
{
// Add all the nodes to the root node. It will
// automagically build the tree for us.
MeshBase::const_node_iterator it = mesh.nodes_begin();
const MeshBase::const_node_iterator end = mesh.nodes_end();
for (; it != end; ++it)
root.insert (*it);
// Now the tree contains the nodes.
// However, we want element pointers, so here we
// convert between the two.
std::vector<std::vector<const Elem*> > nodes_to_elem;
MeshTools::build_nodes_to_elem_map (mesh, nodes_to_elem);
root.transform_nodes_to_elements (nodes_to_elem);
}
else if (build_type == Trees::ELEMENTS)
{
// Add all active elements to the root node. It will
// automatically build the tree for us.
MeshBase::const_element_iterator it = mesh.active_elements_begin();
const MeshBase::const_element_iterator end = mesh.active_elements_end();
for (; it != end; ++it)
root.insert (*it);
}
}
Definition at line 137 of file tree.h.
:
TreeBase (other_tree),
root (other_tree.root),
build_type (other_tree.build_type)
{
libmesh_error();
}
Definition at line 61 of file tree.h.
{}
Implements TreeBase.
Definition at line 83 of file tree.C.
{
return root.find_element(p);
}
Definition at line 45 of file reference_counter.C.
References ReferenceCounter::_counts, and Quality::name().
Referenced by ReferenceCounter::print_info().
{
#if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
std::ostringstream out;
out << '
<< ' ----------------------------------------------------------------------------
<< '| Reference count information |
<< ' ---------------------------------------------------------------------------- ;
for (Counts::iterator it = _counts.begin();
it != _counts.end(); ++it)
{
const std::string name(it->first);
const unsigned int creations = it->second.first;
const unsigned int destructions = it->second.second;
out << '| ' << name << ' reference count information:
<< '| Creations: ' << creations << '
<< '| Destructions: ' << destructions << ';
}
out << ' ---------------------------------------------------------------------------- ;
return out.str();
#else
return '';
#endif
}
Definition at line 149 of file reference_counter.h.
References ReferenceCounter::_counts, Quality::name(), and Threads::spin_mtx.
Referenced by ReferenceCountedObject< Value >::ReferenceCountedObject().
{
Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
std::pair<unsigned int, unsigned int>& p = _counts[name];
p.first++;
}
Definition at line 167 of file reference_counter.h.
References ReferenceCounter::_counts, Quality::name(), and Threads::spin_mtx.
Referenced by ReferenceCountedObject< Value >::~ReferenceCountedObject().
{
Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
std::pair<unsigned int, unsigned int>& p = _counts[name];
p.second++;
}
Implements TreeBase.
Definition at line 78 of file tree.h.
References Tree< N >::root.
{ return root.n_active_bins(); }
Definition at line 76 of file reference_counter.h.
References ReferenceCounter::_n_objects.
Referenced by System::read_serialized_blocked_dof_objects(), and System::write_serialized_blocked_dof_objects().
{ return _n_objects; }
Definition at line 149 of file tree.h.
{
return this->find_element(p);
}
Implements TreeBase.
Definition at line 72 of file tree.h.
References Tree< N >::root.
{ std::cout << 'Printing elements...; root.print_elements(); }
Definition at line 83 of file reference_counter.C.
References ReferenceCounter::get_info().
{
#if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
std::cout << ReferenceCounter::get_info();
#endif
}
Implements TreeBase.
Definition at line 66 of file tree.h.
References Tree< N >::root.
{ std::cout << 'Printing nodes...; root.print_nodes(); }
Definition at line 110 of file reference_counter.h.
Referenced by ReferenceCounter::get_info(), ReferenceCounter::increment_constructor_count(), and ReferenceCounter::increment_destructor_count().
Definition at line 123 of file reference_counter.h.
Definition at line 118 of file reference_counter.h.
Referenced by ReferenceCounter::n_objects(), ReferenceCounter::ReferenceCounter(), and ReferenceCounter::~ReferenceCounter().
Definition at line 102 of file tree.h.
Referenced by Tree< N >::Tree().
Definition at line 101 of file tree_base.h.
Referenced by Tree< N >::Tree().
Definition at line 97 of file tree.h.
Referenced by Tree< N >::n_active_bins(), Tree< N >::print_elements(), Tree< N >::print_nodes(), and Tree< N >::Tree().
Generated automatically by Doxygen for libMesh from the source code.