26template<
short_t d,
class Z>
53template<
int d,
class T>
58 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
63 typedef typename gsEigen::aligned_allocator<gsHBox<d,T>> aalloc;
65 typedef typename std::vector<index_t> RefBox;
66 typedef typename std::list<gsHBox<d,T>,
typename gsHBox<d,T>::aalloc> Container;
67 typedef typename std::vector<gsHBox<d,T>,
typename gsHBox<d,T>::aalloc> SortedContainer;
68 typedef typename std::vector<Container> HContainer;
69 typedef typename Container::iterator Iterator;
70 typedef typename Container::reverse_iterator rIterator;
71 typedef typename Container::const_iterator cIterator;
72 typedef typename HContainer::iterator HIterator;
73 typedef typename HContainer::reverse_iterator rHIterator;
74 typedef typename HContainer::const_iterator cHIterator;
77 typedef memory::shared_ptr< gsHBox >
Ptr;
80 typedef memory::unique_ptr< gsHBox >
uPtr;
375 Container getSiblings()
const;
421 template<gsHNeighborhood _mode>
472 std::ostream&
print( std::ostream& os )
const;
479 RefBox
toBox()
const;
486 RefBox toRefBox(
index_t targetLevel)
const;
487 RefBox toRefBox()
const
489 return this->toRefBox(this->
level()+1);
497 RefBox toCrsBox(
index_t targetLevel)
const;
498 RefBox toCrsBox()
const
500 return this->toCrsBox(this->
level()-1);
504 HContainer boxUnion(
const HContainer & container1,
const HContainer & container2)
const;
506 const gsHTensorBasis<d,T> & basis()
const {
return *m_basis; }
507 void setBasis(
const gsHTensorBasis<d,T> * basis) { m_basis = basis; }
528 void clean(Container & container)
const;
541 void _computeIndices();
542 gsAABB<d, index_t> _computeIndices(
const gsMatrix<T> & coords,
index_t level);
543 gsAABB<d, index_t> _computeIndices(
const gsMatrix<T> & coords,
const gsMatrix<T> & center);
544 gsAABB<d, index_t> _computeIndices(
const gsMatrix<T> & coords);
546 gsAABB<d, index_t> _elevateBox(
const gsAABB<d, index_t> & box)
const;
547 gsAABB<d, index_t> _lowerBox(
const gsAABB<d, index_t> & box)
const;
549 Container _getParents(
typename gsHBox<d,T>::Container & container)
const;
550 HContainer _getParents(
typename gsHBox<d,T>::HContainer & container)
const;
553 Container _boxUnion(
const Container & container1,
const Container & container2)
const;
554 Container _makeUnique(
const Container & container)
const;
556 template<gsHNeighborhood _mode>
557 typename std::enable_if<_mode==gsHNeighborhood::Automatic, typename gsHBox<d,T>::Container>::type
558 getNeighborhood_impl(
index_t m)
560 if (
dynamic_cast<const gsTHBSplineBasis<d,T>*
>(this->basis()))
562 else if (
dynamic_cast<const gsHBSplineBasis<d,T>*
>(this->basis()))
566 template<gsHNeighborhood _mode>
567 typename std::enable_if<_mode==gsHNeighborhood::T, typename gsHBox<d,T>::Container>::type
568 getNeighborhood_impl(
index_t m)
573 template<gsHNeighborhood _mode>
574 typename std::enable_if<_mode==gsHNeighborhood::H, typename gsHBox<d,T>::Container>::type
575 getNeighborhood_impl(
index_t m)
582 gsAABB<d, index_t> m_indices;
585 mutable gsMatrix<T> m_coords;
586 mutable gsMatrix<T> m_center;
587 const gsHTensorBasis<d,T> * m_basis;
598template<
int d,
class T>
599std::ostream&
operator<<( std::ostream& os,
const gsHBox<d,T>& b )
601 return b.print( os );
607#ifndef GISMO_BUILD_LIB
608#include GISMO_HPP_HEADER(gsHBox.hpp)
611#include GISMO_HPP_HEADER(gsHBox.hpp)
612#undef EXTERN_CLASS_TEMPLATE
613#define EXTERN_CLASS_TEMPLATE CLASS_TEMPLATE_INST
617EXTERN_CLASS_TEMPLATE gsHBox<1,real_t>;
618EXTERN_CLASS_TEMPLATE gsHBox<2,real_t>;
619EXTERN_CLASS_TEMPLATE gsHBox<3,real_t>;
620EXTERN_CLASS_TEMPLATE gsHBox<4,real_t>;
622EXTERN_CLASS_TEMPLATE internal::gsXml< gsHBox<1,real_t> >;
623EXTERN_CLASS_TEMPLATE internal::gsXml< gsHBox<2,real_t> >;
624EXTERN_CLASS_TEMPLATE internal::gsXml< gsHBox<3,real_t> >;
625EXTERN_CLASS_TEMPLATE internal::gsXml< gsHBox<4,real_t> >;
This class provides a Hierarchical Box (gsHBox)
Definition gsHBox.h:55
Container getMultiLevelSupportExtension(index_t k)
Gets the multi-level support extension.
Definition gsHBox.hpp:477
Container toContainer()
Returns a container representation of the object.
Definition gsHBox.hpp:427
T getMaxCellLength() const
Return the length of the largest edge of the element.
Definition gsHBox.hpp:273
gsHBox()
Default constructor.
Definition gsHBox.hpp:27
bool marked() const
Returns whether the element is marked or not.
Definition gsHBox.hpp:337
bool isActive() const
Determines if the box is active on its current level.
Definition gsHBox.hpp:213
index_t levelInCenter() const
Gets the level in the center of the object.
Definition gsHBox.hpp:225
Container getSupportExtension()
Gets the support extension.
Definition gsHBox.hpp:444
T projectedErrorRef() const
The error contribution of *this when it is refined.
Definition gsHBox.hpp:307
gsHBox< d, T >::Container getNeighborhood(index_t m)
Gets the neighborhood.
Definition gsHBox.h:422
void computeCenter() const
Computes the center of this.
Definition gsHBox.hpp:649
index_t index() const
Gets the index stored in the object.
Definition gsHBox.hpp:328
gsHBox< d, T > getAncestor(index_t k) const
Gets the ancestor of the object on level k.
Definition gsHBox.hpp:351
bool contains(const gsHBox< d, T > &other) const
Checks if the other cell is contains in this cell.
Definition gsHBox.hpp:184
RefBox toBox() const
Returns a box representation of the object.
Definition gsHBox.hpp:776
Container getTneighborhood(index_t m)
Gets the T-neighborhood.
Definition gsHBox.hpp:517
Container getHneighborhood(index_t m)
Gets the H-neighborhood.
Definition gsHBox.hpp:493
index_t level() const
Gets the level of the object.
Definition gsHBox.hpp:287
void setIndex(index_t index)
Assigns an index to the object.
Definition gsHBox.hpp:325
void computeCoordinates() const
Computes the parametric coordinates of this.
Definition gsHBox.hpp:633
gsHBox< d, T > getParent() const
Gets the parent of the object.
Definition gsHBox.hpp:343
memory::shared_ptr< gsHBox > Ptr
Shared pointer for gsHTensorBasis.
Definition gsHBox.h:77
const point & lowerIndex() const
Gets the lower index of the box.
Definition gsHBox.hpp:279
void mark()
Marks this element for refinement.
Definition gsHBox.hpp:331
T projectedImprovement() const
Gives the projected improvement that can be expected for this.
Definition gsHBox.hpp:313
HContainer toHContainer()
Returns a hierarchical container representation of the object.
Definition gsHBox.hpp:435
memory::unique_ptr< gsHBox > uPtr
Unique pointer for gsHTensorBasis.
Definition gsHBox.h:80
T projectedSetBack() const
Gives the projected set-back that can be expected for this.
Definition gsHBox.hpp:319
Container getChildren() const
Gets the children of the object.
Definition gsHBox.hpp:374
const point & upperIndex() const
Gets the upper index of the box.
Definition gsHBox.hpp:281
void setAndProjectError(T error, index_t alpha=2, index_t beta=0)
Sets the error of the object and compute the projection of the error on a finer mesh....
Definition gsHBox.hpp:296
gsHBox< d, T > & operator=(const gsHBox< d, T > &other)
Assignment operator.
Definition gsHBox.hpp:132
void clean(Container &container) const
Cleans the container from bad elements (see good())
Definition gsHBox.hpp:948
bool isContained(const gsHBox< d, T > &other) const
Checks if the other cell is contained in this cell.
Definition gsHBox.hpp:167
Container getCextension(index_t m)
Gets the Coarsening extension, which is the coarsening neighborhood before checking for active elemen...
Definition gsHBox.hpp:557
bool good() const
Checks if the box has positive indices.
Definition gsHBox.hpp:942
index_t patch() const
Gets the patch ID of the object.
Definition gsHBox.hpp:284
T getMinCellLength() const
Return the length of the smallest edge of the element.
Definition gsHBox.hpp:267
const gsMatrix< T > & getCenter() const
Gets the center of the box.
Definition gsHBox.hpp:238
T getCellSize() const
Return the diagonal of the element.
Definition gsHBox.hpp:261
void setMark(bool mark)
Sets the mark.
Definition gsHBox.hpp:340
void setError(T error)
Sets the error of the object.
Definition gsHBox.hpp:290
bool isActiveOrContained() const
Determines if active or contained in the active elemebt. In other words; checks if the level of this ...
Definition gsHBox.hpp:219
T error() const
Gets the error stored in the object.
Definition gsHBox.hpp:304
std::ostream & print(std::ostream &os) const
Prints the object.
Definition gsHBox.hpp:612
T projectedErrorCrs() const
The error contribution of *this when it is coarsened.
Definition gsHBox.hpp:310
const gsMatrix< T > & getCoordinates() const
Gets the coordinates of the box (first column lower corner, second column higher corner).
Definition gsHBox.hpp:231
Container getDescendants(index_t k) const
Gets the descendants of the object on level k.
Definition gsHBox.hpp:382
Container getCneighborhood(index_t m)
Gets the Coarsening neighborhood.
Definition gsHBox.hpp:591
gsVector< T, d > upperCorner() const
Gets the upper corner of the box.
Definition gsHBox.hpp:254
void unmark()
Unmarks this element for refinement.
Definition gsHBox.hpp:334
gsVector< T, d > lowerCorner() const
Gets the lower corner of the box.
Definition gsHBox.hpp:247
bool isSame(const gsHBox< d, T > &other) const
Determines whether the this box is the same as the other box.
Definition gsHBox.hpp:199
Container toUnitBoxes() const
Returns unit boxes representation of the object.
Definition gsHBox.hpp:756
Re-implements gsDomainIterator for iteration over all boundary elements of a hierarchical parameter d...
Definition gsHDomainIterator.h:39
Class representing a (scalar) hierarchical tensor basis of functions .
Definition gsHTensorBasis.h:75
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
#define index_t
Definition gsConfig.h:32
Provides utility functions for gsHBox and gsHBoxContainer.
Provides declaration of iterator of hierarchical domain.
Provides definition of HTensorBasis abstract interface.
This is the main header file that collects wrappers of Eigen for linear algebra.
Provides declaration of input/output XML utilities struct.
std::ostream & operator<<(std::ostream &os, const _expr< E > &b)
Stream operator for expressions.
Definition gsExpressions.h:382
The G+Smo namespace, containing all definitions for the library.
Struct of for an Axis-aligned bounding box.
Definition gsAABB.h:31