48 Base(incrSmoothnessDegree,topol,basis)
55 using Base::m_incrSmoothnessDegree;
59 using Base::_setTensorMappingOfPatch;
60 using Base::_getPatch;
61 using Base::_getPatchIndex;
62 using Base::_getLocalIndex;
69 bool _checkMapping()
const
74 void _finalize()
const
76 m_level = _getMaxLevel();
78 mat.conservativeResize(mat.rows(),m_global);
80 m_mapper=
new gsWeightMapper<T>(mat);
81 m_mapper->optimize(gsWeightMapper<T>::optTargetToSource);
84 void _setMappingOfPatch(
index_t const patch)
const
87 for(
index_t i = 0;i<=_getMaxLevel();i++)
89 if(m_level<=_getMaxLevel(patch))
90 _setTensorMappingOfPatch(patch);
98 for (
size_t i = 0; i < m_basis->nPatches(); i++)
100 level = std::max(level, _getMaxLevel(i));
107 return TO_HTENSOR(&(m_basis->getBase(patch)))->maxLevel();
113 std::vector<T> endpoints;
114 T parametricDistance = m_basis->getParametricDistanceOfVertex(pc,ps);
115 if(math::almostEqual<T>(parametricDistance,0.0))
125 for(
size_t i = deg+1;i<knots.
size();i++)
126 endpoints.push_back(knots.
at(i));
127 std::sort(endpoints.begin(),endpoints.end());
129 for(;nr<(
index_t)(endpoints.size());nr++)
130 if(math::almostEqual<T>(endpoints[nr],parametricDistance)||endpoints[nr]>=parametricDistance)
142 gsKnotVector<T> kvComp = TO_HTENSOR(&(m_basis->getBase(patch)))->getBases()[m_level]->knots(par);
148 return TO_HTENSOR(&(m_basis->getBase(patch)))->getBases()[m_level]->size(par)-1;
159 index_t patchIndex = _getPatchIndex(patch,u,v);
160 localIndex=_getLocalIndex(patch,patchIndex);
169 return _getLocalIndex(patch,_getPatchIndex(patch,u,v));
180 if(level>(
index_t)(TO_HTENSOR(&(m_basis->getBase(patch)))->maxLevel()))
183 const index_t u_amount=TO_HTENSOR(&(m_basis->getBase(patch)))->tensorLevel(level).size(0);
184 const index_t v_amount=TO_HTENSOR(&(m_basis->getBase(patch)))->tensorLevel(level).size(1);
188 u=flag ? (u_amount-1) : 0;
193 u=flag ? (u_amount-1) :0;
200 v=flag ? (v_amount-1) : 0;
205 v=flag ? (v_amount-1) : 0;
208 index=TO_HTENSOR(&(m_basis->getBase(patch)))->getBases()[level]->index(vec);
209 patchindex=TO_HTENSOR(&(m_basis->getBase(patch)))->flatTensorIndexToHierachicalIndex(index,level);
211 }
while(-1==patchindex);
217 index_t index=_getTensorIndex(patch,u,v);
218 return TO_HTENSOR(&(m_basis->getBase(patch)))->flatTensorIndexToHierachicalIndex(index,m_level);
226 return TO_HTENSOR(&(m_basis->getBase(patch)))->getBases()[m_level]->index(vec);
231 index_t combIndex = TO_HTENSOR(&(m_basis->getBase(patch)))->flatTensorIndexOf(patchIndex,m_level);
239 index_t patch = _getPatch(localIndex);
240 index_t patchIndex = _getPatchIndex(localIndex);
241 return _getPar(patch,_getTensorIndex(patch,patchIndex),par);
246 gsVector<index_t,d> vec = TO_HTENSOR(&(m_basis->getBase(patch)))->getBases()[m_level]->tensorIndex(tensorIndex);
247 GISMO_ASSERT(
static_cast<index_t>(vec(par))<TO_HTENSOR(&(m_basis->getBase(patch)))->getBases()[m_level]->size(par),
"wrong tensorIndex");
248 GISMO_ASSERT(
static_cast<index_t>(vec(!par))<TO_HTENSOR(&(m_basis->getBase(patch)))->getBases()[m_level]->size(!par),
"wrong tensorIndex");