28 template<
short_t d,
class T>
39 index_t maxInsLevel = tree.getMaxInsLevel();
40 tree.global2localIndex(uCornerGlob, maxInsLevel, uCornerLoc);
42 std::vector<index_t> wholeDomainAsBox(2*d+1, 0);
43 wholeDomainAsBox[0] = maxInsLevel;
45 std::copy(uCornerLoc.data(), uCornerLoc.data()+d, wholeDomainAsBox.begin()+d+1);
48 this->refineElements( wholeDomainAsBox );
50 tensorBasis & tpBasis = this->basis().tensorLevel(this->basis().maxLevel());
56 template<
short_t d,
class T>
59 gsWarn<<
"gsTHBSpline<d, T>::increaseMultiplicity: This code is not working properly!"<<std::endl;
62 std::vector<gsSortedVector<index_t> > OX = this->basis().getXmatrix();
65 this->basis().increaseMultiplicity(lvl,dir,knotValue,mult);
66 gsDebug<<
"increased"<<std::endl;
69 this->basis().transfer(OX, trMatrix);
72 this->m_coefs = trMatrix * this->m_coefs;
80 template<
short_t d,
class T>
337 template<
short_t d,
class T>
339 typename gsTHBSpline<d,T>::BoundaryGeometryType & result)
const
341 GISMO_ASSERT(d-1>=0,
"d must be greater or equal than 1");
342 GISMO_ASSERT(dir_fixed>=0 && static_cast<index_t>(dir_fixed)<d,
"cannot fix a dir greater than dim or smaller than 0");
344 typedef typename gsTHBSpline<d,T>::BoundaryBasisType THBBoundaryBasis;
345 typedef typename gsTHBSpline<d,T>::BoundaryGeometryType THBBoundary;
347 const THBBoundaryBasis * bBasis = this->basis().basisSlice(dir_fixed,par);
352 this->eval_into(val,point);
353 result = THBBoundary(*bBasis,point);
358 bBasis->anchors_into(anchorsSlice);
359 anchorsInGeom.resize(anchorsSlice.rows()+1,anchorsSlice.cols());
360 anchorsInGeom.topRows(dir_fixed)=anchorsSlice.topRows(dir_fixed);
362 anchorsInGeom.bottomRows(anchorsSlice.rows()-dir_fixed)=anchorsSlice.bottomRows(anchorsSlice.rows()-dir_fixed);
363 this->eval_into(anchorsInGeom,vals);
365 dynamic_cast<THBBoundary*
>(bBasis->interpolateData(vals,anchorsSlice).release());
366 GISMO_ASSERT(geom!=NULL,
"bBasis should have BoundaryGeometryType.");
377 template<
short_t d,
class T>
383 GSXML_COMMON_FUNCTIONS(gsTHBSpline<TMPLA2(d,T)>);
384 static std::string tag () {
return "Geometry"; }
385 static std::string type () {
return "THBSpline"+
to_string(d); }
387 static gsTHBSpline<d,T> *
get (gsXmlNode * node)
389 return getGeometryFromXml< gsTHBSpline<d,T> >(node);
392 static gsXmlNode * put (
const gsTHBSpline<d,T> & obj,
395 return putGeometryToXml< gsTHBSpline<d,T> >(obj,data);
A truncated hierarchical B-Spline function, in d dimensions.
Definition: gsTHBSpline.h:37
#define GISMO_NO_IMPLEMENTATION
Definition: gsDebug.h:129
void slice(index_t dir_fixed, T par, BoundaryGeometryType &result) const
Definition: gsTHBSpline.hpp:338
#define gsDebug
Definition: gsDebug.h:61
A tensor product of d B-spline functions, with arbitrary target dimension.
Definition: gsTensorBSpline.h:44
Provides declaration of ConstantFunction class.
Boehm's algorithm for knot insertion.
#define index_t
Definition: gsConfig.h:32
A tensor product B-spline basis.
Definition: gsTensorBSplineBasis.h:36
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
void increaseMultiplicity(index_t lvl, int dir, T knotValue, int mult=1)
Increase multiplicity of knot-value knotValue in level lvl and direction dir by mult.
Definition: gsTHBSpline.hpp:57
std::string to_string(const unsigned &i)
Helper to convert small unsigned to string.
Definition: gsXml.cpp:74
#define gsWarn
Definition: gsDebug.h:50
virtual memory::unique_ptr< gsGeometry< T > > makeGeometry(gsMatrix< T > coefs) const =0
Create a gsGeometry of proper type for this basis with the given coefficient matrix.
Class with a hierarchical domain structure represented by a box k-d-tree.
Definition: gsHDomain.h:75
void convertToBSpline(gsTensorBSpline< d, T > &result)
Refines the whole domain to the finest level present in the mesh. Returns the refined geometry as res...
Definition: gsTHBSpline.hpp:29
const point & upperCorner() const
Accessor for gsHDomain::m_upperIndex.
Definition: gsHDomain.h:249
#define GISMO_UNUSED(x)
Definition: gsDebug.h:112
void getBsplinePatches(gsMatrix< index_t > &b1, gsMatrix< index_t > &b2, gsVector< index_t > &level) const
Return the list of B-spline patches to represent a THB-spline geometry.
Definition: gsTHBSpline.hpp:83
void copy(T begin, T end, U *result)
Small wrapper for std::copy mimicking std::copy for a raw pointer destination, copies n positions sta...
Definition: gsMemory.h:391