Go to the documentation of this file.
100 switch (elmE->
T().n()) {
102 c = elmE->
vertex(0); r = 0.0;
168 std::ostream&
info(std::ostream& os)
const;
171 friend std::ostream& operator<< <>(std::ostream& os,
198 while (c && j) {c = c->
link(); j--;}
214 return clst.
info(os);
220 : lnk_(0), idx_(idx), nlf_(nlf), c_(c), r_(r) {
225 for(
const Cluster<F>* c = &chld; c != 0; c = c->lnk_)
226 nlf_ += c->nlf_ ? c->nlf_ : 1;
232 : lnk_(lnk), idx_(0), nlf_(0) {
240 os <<
concepts::typeOf(*
this) <<
"(idx = " << idx_ <<
", r = " << r_ <<
", c = " << c_;
241 os <<
", nleaf = " << nlf_ <<
", lnk = " << lnk_;
242 os <<
", chld = " << child() <<
')';
255 typedef typename Node::CF
F;
257 static Node*
child(
const Node* nd, uint j) {
return nd->child(j);}
259 return nd->element();
262 return nd->center();}
267 static uint
nleaf(
const Node* nd) {
return nd->nleaf();}
268 static uint
index(
const Node* nd) {
return nd->index();}
273 template<
class CNode>
276 template<
class CNode>
284 template<
class CNode>
286 friend std::ostream& operator<< <>(std::ostream& os,
const Tree<CNode>& t);
302 virtual std::ostream&
info(std::ostream& os)
const;
329 template<
class CNode>
334 const CNode* chld = Traits::child(clst, j);
337 if (Traits::nleaf(chld)) {
339 info_(chld, rhomin, rhomax, taumin, taumax, hh);
344 if (rho < rhomin) rhomin = rho;
345 if (rho > rhomax) rhomax = rho;
349 if (tau < taumin) taumin = tau;
350 if (tau > taumax) taumax = tau;
353 std::cout << *clst << std::endl;
354 std::cout << *chld << std::endl;
358 chld = Traits::child(clst, ++j);
363 template<
class CNode>
370 info_(root(), rhomin, rhomax, taumin, taumax, h);
372 os <<
"cluster::" <<
concepts::typeOf(*
this) <<
"(nclst = " << nclst() <<
", nleaf = " << nleaf();
376 os <<
", rho in [" << rhomin <<
", " << rhomax;
377 os <<
"], tau in [" << taumin <<
", " << taumax <<
"])";
387 #endif // clusterTree_hh
An abstract class for an element of a space.
Cluster< F > * child() const
First child of the cluster if the cluster is not a leaf.
Cluster< F > * link() const
Neighbouring cluster.
CE ce_
Child cluster or element.
Linear triangular element.
Constant triangular element.
#define conceptsException(exc)
Prepares an exception for throwing.
Abstract class for a space.
const concepts::Real3d & vertex(uint i) const
Returns a vertex of triangle.
CNode Node
Node type of the tree used for the interface of the far field matrices.
static uint nleaf(const Node *nd)
std::ostream & operator<<(std::ostream &os, const Cluster< F > &clst)
concepts::Real3d c_
Cluster center.
const concepts::Real3d & vertex(uint i) const
Returns vertex of triangle.
static const concepts::Real3d & center(const Node *nd)
concepts::Real radius() const
Radius of the cluster.
void operator()(const concepts::Element< F > &elm, concepts::Real3d &c, concepts::Real &r) const
Application operator computes the bounding ball of an element.
const concepts::Real3d & vertex(uint i) const
Returns a vertex of triangle.
static const concepts::Element< F > * element(const Node *nd)
concepts::Real r_
Cluster radius.
Computes the Cebysev ball of an element.
Interface class for a node in a cluster tree.
Cluster(const concepts::Element< F > &elm, const BBall< F > &ball, Cluster< F > *lnk)
Constructor if Cluster is a leaf in the tree.
void info_(const Node *clst, concepts::Real &rhomin, concepts::Real &rhomax, concepts::Real &taumin, concepts::Real &taumax, uint &h) const
Computes some information used by info()
virtual uint nclst() const =0
Number of clusters.
virtual const Node * root() const =0
Root node of the tree.
F CF
Typedef used for interface (trait) of the cluster tree.
Data structure to hold a pointer to an element or a child cluster.
const concepts::Real3d & vertex(uint i) const
Returns a vertex of triangle.
const concepts::Space< F > & space() const
Space of the tree.
Constant space element with a level dependent key.
void cebysev(const concepts::Real3d &x0, const concepts::Real3d &x1, concepts::Real3d &c, concepts::Real &r)
Computes the Cebysev ball of two or three points.
virtual void operator()(const concepts::Element< F > &elm, concepts::Real3d &c, concepts::Real &r) const =0
Application operator computes the bounding ball of an element.
Abstract class to compute a bounding ball of an element (the leafs of a cluster tree).
std::ostream & info(std::ostream &os) const
Tree(const concepts::Space< F > &spc)
Constructor.
static uint index(const Node *nd)
const concepts::Element< F > * elm
Node::CF F
Field of the node (Real or Cmplx)
const concepts::TMatrixBase< F > & T() const
Returns T matrix of the element.
Cluster< F > * lnk_
Neighbouring cluster.
Abstract class for a cluster tree.
virtual std::ostream & info(std::ostream &os) const
Used for the cluster classes for the boundary element method.
Constant triangular element with normed basis function.
const concepts::Real3d & vertex(uint i) const
Returns a vertex of triangle.
Traits::F F
Field (Real or Cmplx)
uint nleaf() const
Number of leafs of the cluster.
const concepts::Element< F > * element() const
Returns element if the cluster is a leaf.
uint index() const
Index (number) of the cluster.
Exception class to express a missing feature.
static Node * child(const Node *nd, uint j)
static concepts::Real radius(const Node *nd)
const concepts::Space< F > & spc_
Space of the tree.
Dirac element on triangles (used for collocation method).
TreeTraits< CNode > Traits
Interface of the tree.
std::string typeOf(const T &t)
Return the typeid name of a class object.
const concepts::Real3d & center() const
Center of the cluster.
uint nlf_
Number of leafs.
double Real
Type normally used for a floating point number.
virtual uint nleaf() const =0
Number of leafs.