30 gsMultiPatch<T> gsMultiPatch<T>::coord(
const index_t c)
const
32 gsMultiPatch<T> result;
33 for ( const_iterator it = m_patches.begin(); it != m_patches.end(); ++it )
35 result.addPatch( (*it)->coord(c) );
42 :
BaseA( geo.parDim() )
44 m_patches.push_back(geo.
clone().release());
52 :
BaseA( other ),
BaseB( other ), m_patches( other.m_patches.size() )
55 cloneAll( other.m_patches.begin(), other.m_patches.end(),
56 this->m_patches.begin());
59 #if EIGEN_HAS_RVALUE_REFERENCES
67 BaseA::operator=(other);
68 m_patches.resize(other.m_patches.size());
70 cloneAll( other.m_patches.begin(), other.m_patches.end(),
71 this->m_patches.begin());
80 BaseA::operator=(
give(other));
81 m_patches =
give(other.m_patches);
90 :
BaseA( patches[0]->parDim(), patches.size() )
92 m_patches.swap(patches);
99 const std::vector<patchSide>&
boundary,
100 const std::vector<boundaryInterface>& interfaces )
101 :
BaseA( patches[0]->parDim(), patches.size(), boundary, interfaces )
103 m_patches.swap(patches);
117 for ( iterator it = m_patches.begin(); it != m_patches.end(); ++it )
119 ( *it )->setId(
id++ );
126 if ( !this->empty() ) {
127 os <<
"gsMultiPatch (" << this->nPatches() <<
"): ";
128 os <<
"#Boundaries= " << nBoundary() <<
", ";
129 os <<
"#Interfaces= " << nInterfaces() <<
".\n";
131 os <<
"gsMultiPatch ( empty! ).\n";
139 std::ostringstream os;
141 if ( nPatches() > 0 )
151 GISMO_ASSERT( m_patches.size() > 0 ,
"Empty multipatch object.");
152 return m_patches[0]->geoDim();
158 GISMO_ASSERT( m_patches.size() > 0 ,
"Empty multipatch object.");
159 return m_patches[0]->geoDim() - m_dim;
166 return m_patches[i]->basis().support();
173 GISMO_ASSERT( i < m_patches.size(),
"Invalid patch index requested from gsMultiPatch" );
174 return m_patches[i]->basis();
180 std::vector<gsBasis<T> *> bb;
181 bb.reserve(m_patches.size());
185 for ( const_iterator it = m_patches.begin();
186 it != m_patches.end(); ++it )
188 bb.push_back( (*it)->basis().source().clone().release() );
193 for ( const_iterator it = m_patches.begin();
194 it != m_patches.end(); ++it )
196 bb.push_back( (*it)->basis().clone().release() );
218 "Tried to add a patch of different dimension in a multipatch." );
220 index_t index = m_patches.size();
222 m_patches.push_back( g.release() ) ;
230 return addPatch(g.
clone());
237 = std::find( m_patches.begin(), m_patches.end(), g );
238 GISMO_ASSERT( it != m_patches.end(),
"Did not find the patch index." );
240 return it - m_patches.begin();
247 int p1 = findPatchIndex( g1 );
248 int p2 = findPatchIndex( g2 );
249 BaseA::addInterface( p1, s1, p2, s2 );
256 m_patches[pc.patch]->eval_into(m_patches[pc.patch]->parameterCenter(pc),coordinates);
265 m_patches[ps.
patch]->eval_into(m_patches[ps.
patch]->parameterCenter(ps),coordinates);
272 for (
typename PatchContainer::const_iterator it = m_patches.begin();
273 it != m_patches.end(); ++it )
275 ( *it )->uniformRefine(numKnots, mul);
283 for (
typename PatchContainer::const_iterator it = m_patches.begin();
284 it != m_patches.end(); ++it )
286 ( *it )->degreeElevate(elevationSteps, dir);
293 for (
typename PatchContainer::const_iterator it = m_patches.begin();
294 it != m_patches.end(); ++it )
296 ( *it )->degreeIncrease(elevationSteps, dir);
303 for (
typename PatchContainer::const_iterator it = m_patches.begin();
304 it != m_patches.end(); ++it )
306 ( *it )->degreeReduce(elevationSteps, -1);
313 for (
typename PatchContainer::const_iterator it = m_patches.begin();
314 it != m_patches.end(); ++it )
316 ( *it )->uniformCoarsen(numKnots);
323 result.setZero(geoDim(),2);
324 if ( m_patches.size() == 0 )
328 result.col(0) = patch(0).coefs().colwise().minCoeff().transpose();
329 result.col(1) = patch(0).coefs().colwise().maxCoeff().transpose();
331 for (const_iterator it = begin()+1; it != end(); ++it)
334 result.col(0) = result.col(0).cwiseMin( cc.colwise().minCoeff().transpose() ) ;
335 result.col(1) = result.col(1).cwiseMax( cc.colwise().maxCoeff().transpose() ) ;
344 n = math::exp2(parDim());
347 std::vector<gsGeometry<T>*> result;
348 result.reserve(nPatches() * n);
350 for (
size_t np = 0; np < nPatches(); ++np)
352 std::vector<gsGeometry<T>*> result_temp = m_patches[np]->uniformSplit(dir);
353 result.insert(result.end(), result_temp.begin(), result_temp.end());
368 BaseA::clearTopology();
370 const size_t np = m_patches.size();
371 const index_t nCorP = 1 << m_dim;
372 const index_t nCorS = 1 << (m_dim-1);
380 coor.resize(m_dim,nCorP);
382 coor.resize(m_dim,nCorP + 2*m_dim);
387 std::vector<gsMatrix<T> > pCorners(np);
389 std::vector<patchSide> pSide;
390 pSide.reserve(np * 2 * m_dim);
393 for (
size_t p=0; p<np; ++p)
395 supp = m_patches[p]->parameterRange();
400 boxPar = c.parameters(m_dim);
402 coor(i,c-1) = boxPar(i) ? supp(i,1) : supp(i,0);
411 const index_t dir = c.direction();
415 coor(i,l) = ( dir==i ? supp(i,s) :
416 (supp(i,1)+supp(i,0))/2.0 );
422 m_patches[p]->eval_into(coor,pCorners[p]);
431 std::vector<boxCorner> cId1, cId2;
435 std::set<index_t> found;
436 for (
size_t sideind=0; sideind<pSide.size(); ++sideind)
439 for (
size_t other=sideind+1; other<pSide.
size(); ++other)
442 pSide[other].getContainedCorners(m_dim,cId2);
443 matched.setConstant(
false);
447 if ( ( pCorners[side.
patch ].col(nCorP+side-1 ) -
448 pCorners[pSide[other].patch].col(nCorP+pSide[other]-1)
459 if ( matchVerticesOnSide( pCorners[side.
patch] , cId1, 0,
460 pCorners[pSide[other].patch], cId2,
461 matched, dirMap, dirOr, tol ) )
466 found.insert(sideind);
473 found.insert(found.end(), pSide.size());
474 for (
const auto & s : found)
477 BaseA::addBoundary( pSide[k] );
487 for (
typename PatchContainer::const_iterator it = m_patches.begin();
488 it != m_patches.end(); ++it )
489 if ( -1 == (*it)->orientation() )
490 (*it)->toggleOrientation();
492 if (this->nInterfaces() || this->nBoundary() )
493 this->computeTopology();
499 const gsMatrix<T> &cc2,
const std::vector<boxCorner> &ci2,
503 const bool computeOrientation = !(start&(start-1)) && (start != 0);
504 const bool setReference = start==0;
512 if (computeOrientation)
517 for (; o_dir<dim && parStart(o_dir)==parRef(o_dir) ;) ++o_dir;
521 refPar = ci2[reference].parameters(dim);
523 for (
size_t j=0;j<ci2.size();++j)
525 if( !matched(j) && (cc1.col(ci1[start]-1)-cc2.col(ci2[j]-1)).norm() < tol )
527 index_t newRef = (setReference) ? j : reference;
528 if (computeOrientation)
532 newPar = ci2[j].parameters(dim);
533 for (
index_t i=0; i< newPar.rows();++i)
535 if ( newPar(i)!=refPar(i) )
546 dirMap(o_dir) = d_dir;
547 dirO (o_dir) = (
static_cast<index_t>(j) > reference);
549 if ( start + 1 == static_cast<index_t>( ci1.size() ) )
554 newMatched = matched;
555 newMatched(j) =
true;
556 if (matchVerticesOnSide( cc1,ci1,start+1,cc2,ci2,newMatched,dirMap,dirO, tol,newRef))
571 std::vector<std::pair<index_t,index_t> > dof;
575 for (
index_t i = start; i!= end; ++i)
581 meanVal = m_patches[dof.front().first]->coef(dof.front().second);
582 for (
size_t k = 1; k!=dof.size(); ++k)
583 meanVal += m_patches[dof[k].first]->coef(dof[k].second);
584 meanVal.array() /= dof.size();
587 for (
size_t k = 0; k!=dof.size(); ++k)
588 m_patches[dof[k].first]->coef(dof[k].second) = meanVal;
595 const T tol2 = tol*tol;
600 const index_t sz = m_patches.size();
603 patchSizes[i] = m_patches[i]->coefsSize();
607 for ( const_iiterator it = iBegin(); it != iEnd(); ++it )
613 p1.
basis().matchWith(*it, p2.
basis(), bdr1, bdr2);
617 for (
index_t i = 0; i!= bdr1.size(); ++i )
619 if ( ( p1.
coef(bdr1(i)) - p2.
coef(bdr2(i)) ).squaredNorm() > tol2 )
623 gsWarn<<
"Big gap detected between patches "<< it->first().patch
624 <<
" and "<<it->second().patch <<
"\n";
630 mapper.
matchDof(it->first().patch, bdr1(i,0), it->second().patch, bdr2(i,0) );
649 gsSurfMesh::Point pt(0,0,0);
651 std::vector<std::pair<index_t,index_t> > pi = mapper.
anyPreImages();
658 pt.topRows(gd) = pp.
eval( pp.
basis().anchor(pi[j].second) );
660 pid[v] = pi[j].first;
661 anchor[v] = pi[j].second;
664 size_t np = nPatches();
673 for (
size_t p=0; p<np; ++p)
705 const T len1=box1(oDir1,1)-box1(oDir1,0);
709 box2(oDir2,0)=box2(oDir2,1);
710 box2(oDir2,1)+=scaling*len1;
714 box2(oDir2,1)=box2(oDir2,0);
715 box2(oDir2,0)-=scaling*len1;
726 for (
typename PatchContainer::const_iterator it = m_patches.begin();
727 it != m_patches.end(); ++it )
729 result.
addPatch( (*it)->approximateLinearly() );
732 result.gsBoxTopology::operator=(*this);
740 bool changed =
false;
742 std::vector<index_t> refEltsFirst;
743 std::vector<index_t> refEltsSecond;
746 switch( this->dim() )
749 changed = multiBasis.template repairInterfaceFindElements<2>( bi, refEltsFirst, refEltsSecond );
752 changed = multiBasis.template repairInterfaceFindElements<3>( bi, refEltsFirst, refEltsSecond );
761 if( refEltsFirst.size() > 0 )
764 patch(pi).basis().refineElements_withCoefs( patch(pi).coefs(), refEltsFirst );
766 if( refEltsSecond.size() > 0 )
769 patch(pi).basis().refineElements_withCoefs( patch(pi).coefs(), refEltsSecond );
783 pids.resize(points.cols());
784 pids.setConstant(-1);
785 preim.resize(parDim(), points.cols());
788 for (
index_t i = 0; i!=pids.size(); ++i)
792 for (
size_t k = 0; k!= m_patches.size(); ++k)
794 pr = m_patches[k]->parameterRange();
795 m_patches[k]->invertPoints(pt, tmp, accuracy);
796 if ( (tmp.array() >= pr.col(0).array()).all()
797 && (tmp.array() <= pr.col(1).array()).all() )
812 pid2.resize(points.cols());
813 pid2.setConstant(-1);
814 preim.resize(parDim(), points.cols());
817 for (
index_t i = 0; i!=pid2.size(); ++i)
821 for (
size_t k = 0; k!= m_patches.size(); ++k)
823 if (pid1==(
index_t)k)
continue;
825 pr = m_patches[k]->parameterRange();
826 m_patches[k]->invertPoints(pt, tmp);
827 if ( (tmp.array() >= pr.col(0).array()).all()
828 && (tmp.array() <= pr.col(1).array()).all() )
840 struct __closestPointHelper
842 __closestPointHelper() : dist(math::limits::max()), pid(-1) { }
849 template<
class T> std::pair<index_t,gsVector<T> >
850 gsMultiPatch<T>::closestPointTo(
const gsVector<T> & pt,
851 const T accuracy)
const
853 std::pair<index_t,gsVector<T> > result;
854 this->closestDistance(pt,result,accuracy);
860 T gsMultiPatch<T>::closestDistance(
const gsVector<T> & pt,
861 std::pair<
index_t,gsVector<T> > & result,
862 const T accuracy)
const
864 GISMO_ASSERT( pt.rows() == targetDim(),
"Invalid input point." <<
865 pt.rows() <<
"!="<< targetDim() );
870 # pragma omp declare reduction(minimum : struct __closestPointHelper : omp_out = (omp_in.dist < omp_out.dist ? omp_in : omp_out) )
871 struct __closestPointHelper cph;
872 # pragma omp parallel for default(shared) private(tmp) reduction(minimum:cph) //OpenMP 4.0, will not work on VS2019
874 struct __closestPointHelper cph;
876 for (
size_t k = 0; k < m_patches.size(); ++k)
881 const T val = this->patch(k).closestPointTo(pt, tmp, accuracy);
890 result = std::make_pair(cph.pid,
give(cph.preim));
900 GISMO_ASSERT(this->nPatches()==other.
nPatches(),
"Number of patches should be the same, but this->nPatches()!=other.nPatches() -> "<<this->nPatches()<<
"!="<<other.
nPatches());
901 std::vector<T> result(this->nPatches());
905 const int tid = omp_get_thread_num();
906 const int nt = omp_get_num_threads();
910 for (
size_t p=tid; p<this->nPatches(); p+=nt )
912 for (
size_t p=0; p<this->nPatches(); p++ )
915 result.at(p) = this->patch(p).HausdorffDistance(other.
patch(p),nsamples,accuracy,directed);
927 std::vector<T> distances = HausdorffDistance(other,nsamples,accuracy,directed);
928 return std::accumulate(distances.begin(), distances.end(), (T)( 0 ) ) / distances.size();
932 void gsMultiPatch<T>::constructInterfaceRep()
935 for ( iiterator it = iBegin(); it != iEnd(); ++it )
937 const gsGeometry<T> & p1 = *m_patches[it->first() .patch];
938 const gsGeometry<T> & p2 = *m_patches[it->second().patch];
939 m_ifaces[*it] = p1.iface(*it,p2);
947 for ( biterator it = bBegin(); it != bEnd(); ++it )
958 ifContainer ifaces = this->interfaces(l);
959 for ( iiterator it = ifaces.begin(); it != ifaces.end(); ++it )
963 m_ifaces[*it] = p1.
iface(*it,p2);
971 bContainer bdrs = this->boundaries(l);
972 for ( biterator it = bdrs.begin(); it != bdrs.end(); ++it )
982 for ( biterator it = bBegin(); it != bEnd(); ++it )
988 for ( iiterator it = iBegin(); it != iEnd(); ++it )
990 const gsGeometry<T> & p1 = *m_patches[it->first() .patch];
991 const gsGeometry<T> & p2 = *m_patches[it->second().patch];
992 m_sides[it->first()] = p1.
boundary(it->first());
993 m_sides[it->second()] = p2.boundary(it->second());
index_t addPatch(typename gsGeometry< T >::uPtr g)
Add a patch from a gsGeometry<T>::uPtr.
Definition: gsMultiPatch.hpp:210
Abstract base class representing a geometry map.
Definition: gsGeometry.h:92
gsMatrix< T >::RowXpr coef(index_t i)
Returns the i-th coefficient of the geometry as a row expression.
Definition: gsGeometry.h:346
gsMultiPatch & operator=(gsMultiPatch other)
Assignment operator (uses copy-and-swap idiom)
Definition: gsMultiPatch.h:63
void clear()
Clear (delete) all patches.
Definition: gsMultiPatch.h:319
Struct which represents a certain side of a patch.
Definition: gsBoundary.h:231
Half edge mesh structure.
bool nextCubePoint(Vec &cur, const Vec &end)
Iterate in lexigographic order through the points of the integer lattice contained in the cube [0...
Definition: gsCombinatorics.h:327
short_t geoDim() const
Dimension of the geometry (must match for all patches).
Definition: gsMultiPatch.hpp:149
#define short_t
Definition: gsConfig.h:35
static boxSide getFirst(short_t)
helper for iterating on sides of an n-dimensional box
Definition: gsBoundary.h:160
void addAutoBoundaries()
Make all patch sides which are not yet declared as interface or boundary to a boundary.
Definition: gsBoxTopology.cpp:75
gsBasis< T > & basis(const size_t i) const
Return the basis of the i-th patch.
Definition: gsMultiPatch.hpp:171
bool parameter() const
Returns the parameter value (false=0=start, true=1=end) that corresponds to this side.
Definition: gsBoundary.h:128
bool repairInterface(const boundaryInterface &bi)
Checks if the interface is fully matching, and if not, repairs it.
Definition: gsMultiPatch.hpp:737
Struct that defines the boundary sides and corners and types of a geometric object.
Definition: gsBoundary.h:55
void getContainedCorners(short_t dim, std::vector< patchCorner > &corners) const
returns the vector of the corners contained in the side
Definition: gsBoundary.cpp:35
gsSurfMesh toMesh() const
Creates a surface mesh out of this multipatch.
Definition: gsMultiPatch.hpp:641
Implements an affine function.
Provides declaration of Basis abstract interface.
S give(S &x)
Definition: gsMemory.h:266
gsMatrix< T > eval(const gsMatrix< T > &u) const
Evaluate the function,.
Definition: gsFunctionSet.hpp:120
Provides declaration of Geometry abstract interface.
#define index_t
Definition: gsConfig.h:32
#define GISMO_ENSURE(cond, message)
Definition: gsDebug.h:102
void fixOrientation()
Provides positive orientation for all patches.
Definition: gsMultiPatch.hpp:485
void uniformRefine(int numKnots=1, int mul=1)
Refine uniformly all patches by inserting numKnots in each knot-span with multipliplicity mul...
Definition: gsMultiPatch.hpp:270
void locatePoints(const gsMatrix< T > &points, gsVector< index_t > &pids, gsMatrix< T > &preim, const T accuracy=1e-6) const
For each point in points, locates the parametric coordinates of the point.
Definition: gsMultiPatch.hpp:779
Provides combinatorial unitilies.
Struct which represents a certain corner of a patch.
Definition: gsBoundary.h:392
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
void cloneAll(It start, It end, ItOut out)
Clones all pointers in the range [start end) and stores new raw pointers in iterator out...
Definition: gsMemory.h:295
Maintains a mapping from patch-local dofs to global dof indices and allows the elimination of individ...
Definition: gsDofMapper.h:68
void boundingBox(gsMatrix< T > &result) const
Returns a bounding box for the multipatch domain. The output result is a matrix with two columns...
Definition: gsMultiPatch.hpp:321
index_t coupledSize() const
Returns the number of coupled (not eliminated) dofs.
Definition: gsDofMapper.cpp:601
void uniformCoarsen(int numKnots=1)
Coarsen uniformly all patches by removing numKnots in each knot-span.
Definition: gsMultiPatch.hpp:311
gsMatrix< T > parameterRange(int i=0) const
Returns the range of parameter.
Definition: gsMultiPatch.hpp:164
A halfedge data structure for polygonal meshes.
Definition: gsSurfMesh.h:45
void finalize()
Must be called after all boundaries and interfaces have been marked to set up the dof numbering...
Definition: gsDofMapper.cpp:240
index_t size() const
size
Definition: gsMultiPatch.h:129
Provides the gsDofMapper class for re-indexing DoFs.
index_t index(index_t i, index_t k=0, index_t c=0) const
Returns the global dof index associated to local dof i of patch k.
Definition: gsDofMapper.h:325
gsMultiPatch< T > approximateLinearly(index_t nsamples) const
Computes linear approximation of the patches using nsamples per direction.
Definition: gsMultiPatch.hpp:722
Creates a mapped object or data pointer to a vector without copying data.
Definition: gsLinearAlgebra.h:129
Representation of an affine function.
Definition: gsAffineFunction.h:29
void matchDof(index_t u, index_t i, index_t v, index_t j, index_t comp=0)
Couples dof i of patch u with dof j of patch v such that they refer to the same global dof at compone...
Definition: gsDofMapper.cpp:99
static boxSide getEnd(short_t dim)
helper for iterating on sides of an n-dimensional box
Definition: gsBoundary.h:176
#define gsWarn
Definition: gsDebug.h:50
Holds a set of patch-wise bases and their topology information.
Definition: gsMultiBasis.h:36
gsGeometry< T > & patch(size_t i) const
Return the i-th patch.
Definition: gsMultiPatch.h:226
size_t nPatches() const
Number of patches.
Definition: gsMultiPatch.h:208
void permute(const std::vector< short_t > &perm)
Permutes the patches according to perm.
Definition: gsMultiPatch.hpp:203
GISMO_DEPRECATED index_t direction(index_t s)
Returns the parametric direction that corresponds to side s.
Definition: gsBoundary.h:1048
std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition: gsMultiPatch.hpp:124
size_t findPatchIndex(gsGeometry< T > *g) const
Search for the given geometry and return its patch index.
Definition: gsMultiPatch.hpp:234
std::vector< gsGeometry * > boundary() const
Get boundary of this geometry as a vector of new gsGeometry instances.
Definition: gsGeometry.hpp:423
void degreeReduce(int elevationSteps=1)
Reduce the degree of all patches by elevationSteps.
Definition: gsMultiPatch.hpp:301
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition: gsFuncData.h:23
void freeAll(It begin, It end)
Frees all pointers in the range [begin end)
Definition: gsMemory.h:312
std::vector< gsBasis< T > * > basesCopy(bool numeratorOnly=false) const
Makes a deep copy of all bases and puts them in a vector.
Definition: gsMultiPatch.hpp:178
void setId(const size_t i)
Sets the patch index for this patch.
Definition: gsGeometry.h:607
Abstract base class for tensor product bases.
Definition: gsTensorBasis.h:33
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition: gsMultiPatch.h:33
Struct which represents a certain side of a box.
Definition: gsBoundary.h:84
std::vector< std::pair< index_t, index_t > > anyPreImages(index_t comp=0) const
For all global index, this function assigns a pair (patch,dof) that maps to that global index...
Definition: gsDofMapper.cpp:525
short_t parDim() const
Dimension d of the parameter domain (same as domainDim()).
Definition: gsGeometry.hpp:190
unsigned index(unsigned i, unsigned j, unsigned k=0) const
Definition: gsTensorBasis.h:882
void constructBoundaryRep()
Construct the boundary representation.
Definition: gsMultiPatch.hpp:944
uPtr clone()
Clone methode. Produceds a deep copy inside a uPtr.
memory::unique_ptr< gsGeometry > uPtr
Unique pointer for gsGeometry.
Definition: gsGeometry.h:100
virtual gsGeometry::uPtr iface(const boundaryInterface &bi, const gsGeometry &other) const
Computes and returns the interface with other as a new geometry.
Definition: gsGeometry.hpp:232
gsAffineFunction< T > getMapForInterface(const boundaryInterface &bi, T scaling=0) const
construct the affine map that places bi.first() next to bi.second() and identifies the two matching s...
Definition: gsMultiPatch.hpp:697
void closeGaps(T tol=1e-4)
Attempt to close gaps between the interfaces. Assumes that the topology is computed, ie. computeTopology() has been called.
Definition: gsMultiPatch.hpp:566
gsMatrix< T > pointOn(const patchCorner &pc)
Get coordinates of the patchCorner pc in the physical domain.
Definition: gsMultiPatch.hpp:253
std::string detail() const
Prints the object as a string with extended details.
Definition: gsMultiPatch.hpp:137
Vertex_property< T > add_vertex_property(const std::string &name, T t=T())
Definition: gsSurfMesh.h:1342
void preImage(index_t gl, std::vector< std::pair< index_t, index_t > > &result) const
For gl being a global index, this function returns a vector of pairs (patch,dof) that contains all th...
Definition: gsDofMapper.cpp:480
std::vector< T > HausdorffDistance(const gsMultiPatch< T > &other, const index_t nsamples=1000, const T accuracy=1e-6, const bool directed=false)
Construct the interface representation.
Definition: gsMultiPatch.hpp:895
#define GISMO_UNUSED(x)
Definition: gsDebug.h:112
index_t size() const
Returns the total number of dofs (free and eliminated).
Definition: gsDofMapper.h:421
Creates a mapped object or data pointer to a const vector without copying data.
Definition: gsLinearAlgebra.h:130
patchSide & second()
second, returns the second patchSide of this interface
Definition: gsBoundary.h:782
void addBox(index_t i=1)
Add i new boxes.
Definition: gsBoxTopology.h:198
static boxCorner getFirst(short_t)
helper for iterating on corners of an n-dimensional box
Definition: gsBoundary.h:356
Struct which represents an interface between two patches.
Definition: gsBoundary.h:649
~gsMultiPatch()
Destructor.
Definition: gsMultiPatch.hpp:108
Provides declaration of TensorBasis class.
index_t freeSize() const
Returns the number of free (not eliminated) dofs.
Definition: gsDofMapper.h:436
gsMultiPatch()
Default empty constructor.
Definition: gsMultiPatch.h:55
Vertex add_vertex(const Point &p)
add a new vertex with position p
Definition: gsSurfMesh.cpp:272
virtual const gsBasis< T > & basis() const =0
Returns a const reference to the basis of the geometry.
static boxCorner getEnd(short_t dim)
helper for iterating on corners of an n-dimensional box
Definition: gsBoundary.h:372
Defines a topological arrangement of a collection of "boxes" (e.g., parameter domains that map to phy...
Definition: gsBoxTopology.h:38
short_t coDim() const
Co-dimension of the geometry (must match for all patches).
Definition: gsMultiPatch.hpp:156
index_t patch
The index of the patch.
Definition: gsBoundary.h:234
GISMO_DEPRECATED void addInterface(gsGeometry< T > *g1, boxSide s1, gsGeometry< T > *g2, boxSide s2)
Add an interface joint between side s1 of geometry g1 side s2 of geometry g2.
Definition: gsMultiPatch.hpp:244
void degreeIncrease(short_t const elevationSteps=1, short_t const dir=-1)
Increase the degree of all patches by elevationSteps, preserves multiplicity.
Definition: gsMultiPatch.hpp:291
Struct which represents a certain corner of a hyper-cube.
Definition: gsBoundary.h:291
short_t direction() const
Returns the parametric direction orthogonal to this side.
Definition: gsBoundary.h:113
Face add_quad(Vertex v1, Vertex v2, Vertex v3, Vertex v4)
Definition: gsSurfMesh.cpp:365
gsDofMapper getMapper(T tol) const
Used to get a mapper with unique vertices.
Definition: gsMultiPatch.hpp:593
Definition: gsSurfMesh.h:103
A basis represents a family of scalar basis functions defined over a common parameter domain...
Definition: gsBasis.h:78
bool computeTopology(T tol=1e-4, bool cornersOnly=false, bool tjunctions=false)
Attempt to compute interfaces and boundaries automatically.
Definition: gsMultiPatch.hpp:366
void degreeElevate(short_t const elevationSteps=1, short_t const dir=-1)
Elevate the degree of all patches by elevationSteps, preserves smoothness.
Definition: gsMultiPatch.hpp:281
patchSide & first()
first, returns the first patchSide of this interface
Definition: gsBoundary.h:776
gsMultiPatch< T > uniformSplit(index_t dir=-1) const
Splits each patch uniformly in each direction (if dir = -1) into two new patches, giving a total numb...
Definition: gsMultiPatch.hpp:340