18 #include <gsUnstructuredSplines/src/gsC1SurfBasisVertex.h>
22 template<
short_t d,
class T>
26 typedef memory::shared_ptr<gsC1SurfVertex> Ptr;
29 typedef memory::unique_ptr<gsC1SurfVertex> uPtr;
36 gsC1SurfVertex(
gsMultiPatch<T> & mp,
const std::vector<index_t > patchesAroundVertex,
const std::vector<index_t > vertexIndices) : m_mp(mp)
38 for(
size_t i = 0; i < patchesAroundVertex.size(); i++)
40 auxGeom.push_back(gsG1AuxiliaryPatch<d,T>(mp.
patch(patchesAroundVertex[i]), patchesAroundVertex[i]));
41 auxVertexIndices.push_back(vertexIndices[i]);
42 checkBoundary(mp, patchesAroundVertex[i], vertexIndices[i]);
49 for(
size_t i = 0; i < auxGeom.size(); i++)
51 auxTop.
addPatch(auxGeom[i].getPatch());
57 void reparametrizeG1Vertex()
59 for(
size_t i = 0; i < auxGeom.size(); i++)
63 switch (auxVertexIndices[i])
68 auxGeom[i].rotateParamAntiClockTwice();
71 auxGeom[i].rotateParamAntiClock();
74 auxGeom[i].rotateParamClock();
82 if(auxGeom.size() == 1)
86 index_t nInt = top.interfaces().size();
87 if((
index_t)auxGeom.size() == nInt)
93 void checkOrientation(
index_t i)
95 if (auxGeom[i].getPatch().orientation() == -1)
97 auxGeom[i].swapAxis();
101 if(auxVertexIndices[i] == 2)
102 auxVertexIndices[i] = 3;
104 if(auxVertexIndices[i] == 3)
105 auxVertexIndices[i] = 2;
113 for(
size_t i = 0; i < auxGeom.size(); i++)
117 p = (p < p_temp ? p_temp : p);
119 for(
index_t j = 0; j < auxGeom[i].getPatch().parDim(); j++)
121 T h_geo_temp = bsp_temp.
component(j).knots().at(p + 2);
122 h_geo = (h_geo < h_geo_temp ? h_geo_temp : h_geo);
125 T val = auxGeom.size();
129 for (
index_t i = 0; i < val; i++)
130 sigma += auxGeom[i].getPatch().deriv(zero).template lpNorm<gsEigen::Infinity>();
131 sigma *= h_geo/(val*p);
137 std::vector<bool> tmp;
140 case 1: tmp.push_back(mpTmp.
isBoundary(patchInd,3));
143 case 2: tmp.push_back(mpTmp.
isBoundary(patchInd, 2));
146 case 3: tmp.push_back(mpTmp.
isBoundary(patchInd, 1));
149 case 4: tmp.push_back(mpTmp.
isBoundary(patchInd, 4));
155 isBdy.push_back(tmp);
160 bool tmp = isBdy[i][0];
161 isBdy[i][0] = isBdy[i][1];
173 BigMatrix.setZero( 2 * (dimU + dimV - 2),auxGeom[np].getG1Basis().nPatches());
175 for(
index_t bf = 0; bf < auxGeom[np].getG1Basis().nPatches(); bf++)
177 for (
index_t i = 0; i < 2 * dimU; i++)
179 if (auxGeom[np].getG1BasisCoefs(bf).at(i) * auxGeom[np].getG1BasisCoefs(bf).at(i) > m_zero*m_zero)
180 BigMatrix(i, bf) = auxGeom[np].getG1BasisCoefs(bf).
at(i);
183 for (
index_t i = 1; i < dimV - 1; i++)
185 for(
index_t j = i; j < i + 2; j++)
187 if (auxGeom[np].getG1BasisCoefs(bf).at((i + 1) * dimU + j - i) * auxGeom[np].getG1BasisCoefs(bf).at((i + 1) * dimU + j - i) > m_zero*m_zero)
188 BigMatrix(i + j + (2 * dimU ) - 2, bf) = auxGeom[np].getG1BasisCoefs(bf).
at((i + 1) * dimU + j - i);
203 SmallMatrix.setZero((dimU + dimV - 1),auxGeom[np].getG1Basis().nPatches());
205 for(
index_t bf = 0; bf < auxGeom[np].getG1Basis().nPatches(); bf++)
207 for (
index_t i = 0; i < dimU; i++)
209 if (auxGeom[np].getG1BasisCoefs(bf).at(i) * auxGeom[np].getG1BasisCoefs(bf).at(i) > m_zero*m_zero)
210 SmallMatrix(i, bf) = auxGeom[np].getG1BasisCoefs(bf).
at(i);
213 for (
index_t i = 1; i < dimV; i++)
215 if (auxGeom[np].getG1BasisCoefs(bf).at(i * dimU) * auxGeom[np].getG1BasisCoefs(bf).at(i * dimU) > m_zero*m_zero)
216 SmallMatrix(i + dimU -1, bf) = auxGeom[np].getG1BasisCoefs(bf).
at(i * dimU);
230 BigMatrix.setZero( 2 * dimV,6);
232 for(
index_t bf = 0; bf < 6; bf++)
234 for (
index_t i = 0; i < dimV ; i++)
236 for(
index_t j = i; j < i + 2; j++)
238 if (auxGeom[np].getG1BasisCoefs(bf).at(i * dimU + j - i) * auxGeom[np].getG1BasisCoefs(bf).at(i * dimU + j - i) > m_zero*m_zero)
239 BigMatrix(i + j, bf) = auxGeom[np].getG1BasisCoefs(bf).
at(i * dimU + j - i);
241 auxGeom[np].getG1BasisCoefs(bf).at(i) *= 0;
255 BigMatrix.setZero( 2 * dimU ,6);
257 for(
index_t bf = 0; bf < 6; bf++)
259 for (
index_t i = 0; i < 2 * dimU; i++)
261 if (auxGeom[np].getG1BasisCoefs(bf).at(i) * auxGeom[np].getG1BasisCoefs(bf).at(i) > m_zero*m_zero)
262 BigMatrix(i, bf) = auxGeom[np].getG1BasisCoefs(bf).
at(i);
264 auxGeom[np].getG1BasisCoefs(bf).at(i) *= 0;
278 SmallMatrix.setZero(dimV,6);
280 for(
index_t bf = 0; bf < 6; bf++)
282 for (
index_t i = 0; i < dimV; i++)
284 if (auxGeom[np].getG1BasisCoefs(bf).at(i * dimU) * auxGeom[np].getG1BasisCoefs(bf).at(i * dimU) > m_zero*m_zero)
285 SmallMatrix(i, bf) = auxGeom[np].getG1BasisCoefs(bf).
at(i * dimU);
287 auxGeom[np].getG1BasisCoefs(bf).at(i * dimU) *= 0;
300 SmallMatrix.setZero( dimU, 6);
302 for(
index_t bf = 0; bf < 6; bf++)
304 for (
index_t i = 0; i < dimU; i++)
306 if (auxGeom[np].getG1BasisCoefs(bf).at(i ) * auxGeom[np].getG1BasisCoefs(bf).at(i ) > m_zero*m_zero)
307 SmallMatrix(i, bf) = auxGeom[np].getG1BasisCoefs(bf).
at(i);
309 auxGeom[np].getG1BasisCoefs(bf).at(i) *= 0;
322 Matrix.setZero( 3 ,6);
324 for(
index_t bf = 0; bf < 6; bf++)
326 Matrix(0, bf) = auxGeom[np].getG1BasisCoefs(bf).
at(0);
327 Matrix(1, bf) = auxGeom[np].getG1BasisCoefs(bf).
at(1);
328 Matrix(2, bf) = auxGeom[np].getG1BasisCoefs(bf).
at(dimU);
337 Matrix.setZero( 1 ,6);
339 for(
index_t bf = 0; bf < 6; bf++)
341 Matrix(0, bf) = auxGeom[np].getG1BasisCoefs(bf).
at(0);
348 if(isBdy[np][1] == 1)
349 return std::make_pair(leftBoundaryBigSystem(np), leftBoundarySmallSystem(np));
352 if (isBdy[np][0] == 1)
353 return std::make_pair(rightBoundaryBigSystem(np), rightBoundarySmallSystem(np));
355 return std::make_pair(bigInternalBoundaryPatchSystem(np), smallInternalBoundaryPatchSystem(np));
361 for(
index_t bk = 0; bk < mat.cols(); bk++ )
363 for(
index_t r=0; r < mat.rows(); r++)
365 if(
abs( mat(r, bk) * mat(r, bk) ) < (m_zero*m_zero) )
374 vertBas.setIdentity(auxGeom[0].getG1Basis().nPatches(), auxGeom[0].getG1Basis().nPatches());
376 index_t numBF = auxGeom[0].getG1Basis().nPatches();
377 while (basisV.cols() < numBF)
379 basisV.conservativeResize(basisV.rows(), basisV.cols() + 1);
380 basisV.col(basisV.cols() - 1) = vertBas.col(count);
382 gsEigen::FullPivLU<gsMatrix<T>> ker(basisV);
383 ker.setThreshold(1e-10);
384 if (ker.dimensionOfKernel() != 0)
386 basisV = basisV.block(0, 0, basisV.rows(), basisV.cols() - 1);
394 for(
index_t i=0; i < smallKDim; i++)
396 basisV.conservativeResize(basisV.rows(), basisV.cols() + 1);
397 basisV.col(basisV.cols()-1) = smallK.col(i);
399 gsEigen::FullPivLU<gsMatrix<T>> ker(basisV);
400 ker.setThreshold(1e-10);
401 if(ker.dimensionOfKernel() != 0)
403 basisV = basisV.block(0, 0, basisV.rows(), basisV.cols()-1);
412 std::vector<index_t> numberPerType;
414 numberPerType.push_back(bigKerDim);
415 numberPerType.push_back(smallKerDim - bigKerDim);
416 numberPerType.push_back(bigKernel.cols() - smallKerDim);
420 checkValues(bigKernel);
421 checkValues(smallKernel);
423 basisVect = bigKernel;
424 addSmallKerBasis(basisVect, smallKernel, smallKerDim);
425 addVertexBasis(basisVect);
429 if (smallKerDim != 0)
431 checkValues(smallKernel);
433 basisVect = smallKernel;
434 addVertexBasis(basisVect);
439 vertBas.setIdentity(auxGeom[0].getG1Basis().nPatches(), auxGeom[0].getG1Basis().nPatches());
443 return std::make_pair(basisVect, numberPerType);
450 if( kindOfVertex() == 1 )
453 for(
auto iter : tmp.interfaces())
455 if( i == iter.first().patch || i == iter.second().patch )
458 if( iter.first().index() == 1 )
460 aux.
addPatch(tmp.patch(iter.first().patch));
461 aux.
addPatch(tmp.patch(iter.second().patch));
465 aux.
addPatch(tmp.patch(iter.second().patch));
466 aux.
addPatch(tmp.patch(iter.first().patch));
471 gsC1SurfGluingData<T> ret(aux, auxB);
475 if( (isBdy[i][0] == 0) && (isBdy[i][1] == 0))
477 if ( (i == iter.first().patch && iter.first().index() == 3)
478 || (i == iter.second().patch && iter.second().index() == 3) )
480 coefs(0, 0) = sol(2, 0);
481 coefs(1, 0) = sol(3, 0);
482 coefs(2, 0) = solBeta(2, 0);
483 coefs(3, 0) = solBeta(3, 0);
486 if ( (i == iter.first().patch && iter.first().index() == 1)
487 || (i == iter.second().patch && iter.second().index() == 1))
489 coefs(0, 1) = sol(0, 0);
490 coefs(1, 1) = sol(1, 0);
491 coefs(2, 1) = solBeta(0, 0);
492 coefs(3, 1) = solBeta(1, 0);
497 if ((i == iter.first().patch && iter.first().index() == 3)
498 || (i == iter.second().patch && iter.second().index() == 3))
500 coefs(0, 0) = sol(2, 0);
502 coefs(1, 0) = sol(3, 0);
504 coefs(2, 0) = solBeta(2, 0);
506 coefs(3, 0) = solBeta(3, 0);
509 else if ((i == iter.first().patch && iter.first().index() == 1)
510 || (i == iter.second().patch && iter.second().index() == 1))
513 coefs(0, 1) = sol(0, 0);
515 coefs(1, 1) = sol(1, 0);
517 coefs(2, 1) = solBeta(0, 0);
519 coefs(3, 1) = solBeta(1, 0);
526 if( kindOfVertex() == -1 )
536 if( kindOfVertex() == 0 )
539 for(
auto iter : tmp.interfaces())
541 if( (i == iter.first().patch) || (i == iter.second().patch) )
544 if( iter.first().index() == 1 )
546 aux.
addPatch(tmp.patch(iter.first().patch));
547 aux.
addPatch(tmp.patch(iter.second().patch));
551 aux.
addPatch(tmp.patch(iter.second().patch));
552 aux.
addPatch(tmp.patch(iter.first().patch));
557 gsC1SurfGluingData<T> ret(aux, auxB);
561 if ( (i == iter.first().patch && iter.first().index() == 3)
562 || (i == iter.second().patch && iter.second().index() == 3) )
564 coefs(0, 0) = sol(2, 0);
565 coefs(1, 0) = sol(3, 0);
566 coefs(2, 0) = solBeta(2, 0);
567 coefs(3, 0) = solBeta(3, 0);
570 if ( (i == iter.first().patch && iter.first().index() == 1)
571 || (i == iter.second().patch && iter.second().index() == 1))
573 coefs(0, 1) = sol(0, 0);
574 coefs(1, 1) = sol(1, 0);
575 coefs(2, 1) = solBeta(0, 0);
576 coefs(3, 1) = solBeta(1, 0);
584 void computeG1InternalVertexBasis()
589 this->reparametrizeG1Vertex();
590 this->computeSigma();
592 std::vector<gsMultiPatch<T>> g1BasisVector;
593 std::pair<gsMatrix<T>, std::vector<index_t>> vertexBoundaryBasis;
600 Phi.col(3) *= sigma * sigma;
601 Phi.col(4) *= sigma * sigma;
602 Phi.col(5) *= sigma * sigma;
606 if (auxGeom[0].getPatch().parDim() + 1 == auxGeom[0].getPatch().targetDim())
610 gsMatrix<T> Jk = auxGeom[0].getPatch().jacobian(zero);
638 n(0) = Jk(1,0)*Jk(2,1)-Jk(2,0)*Jk(1,1);
639 n(1) = Jk(2,0)*Jk(0,1)-Jk(0,0)*Jk(2,1);
640 n(2) = Jk(0,0)*Jk(1,1)-Jk(1,0)*Jk(0,1);
648 rotVec(0) = n(1,0)*z(2,0)-n(2,0)*z(1,0);
649 rotVec(1) = n(2,0)*z(0,0)-n(0,0)*z(2,0);
650 rotVec(2) = n(0,0)*z(1,0)-n(1,0)*z(0,0);
652 T cos_t = (n.dot(z))/ (n.norm() * z.norm());
653 T sin_t = rotVec.norm() / (n.norm() * z.norm());
659 R(0, 0) = cos_t + rotVec.x() * rotVec.x() * (1 - cos_t);
660 R(0, 1) = rotVec.x() * rotVec.y() * (1 - cos_t) - rotVec.z() * sin_t;
661 R(0, 2) = rotVec.x() * rotVec.z() * (1 - cos_t) + rotVec.y() * sin_t;
663 R(1, 0) = rotVec.x() * rotVec.y() * (1 - cos_t) + rotVec.z() * sin_t;
664 R(1, 1) = cos_t + rotVec.y() * rotVec.y() * (1 - cos_t);
665 R(1, 2) = rotVec.y() * rotVec.z() * (1 - cos_t) - rotVec.x() * sin_t;
667 R(2, 0) = rotVec.x() * rotVec.z() * (1 - cos_t) - rotVec.y() * sin_t;
668 R(2, 1) = rotVec.y() * rotVec.z() * (1 - cos_t) + rotVec.x() * sin_t;
669 R(2, 2) = cos_t + rotVec.z() * rotVec.z() * (1 - cos_t);
671 for (
size_t np = 0; np < auxGeom.size(); np++)
673 gsMatrix<T> coeffPatch = auxGeom[np].getPatch().coefs();
675 for (
index_t i = 0; i < coeffPatch.rows(); i++)
678 (coeffPatch.row(i) - coeffPatch.row(0)) * R.transpose() + coeffPatch.row(0);
681 rotPatch.
addPatch(auxGeom[np].getPatch());
682 rotPatch.
patch(np).setCoefs(coeffPatch);
690 Phi(4, 3) = sigma * sigma;
691 Phi(5, 4) = sigma * sigma;
692 Phi(7, 4) = sigma * sigma;
693 Phi(8, 5) = sigma * sigma;
695 for (
size_t i = 0; i < auxGeom.size(); i++)
700 gsC1SurfBasisVertex<T> g1BasisVertex_0(rotPatch.
patch(i), rotPatch.
patch(i).basis(), isBdy[i], Phi, gdCoefs);
702 g1BasisVertex_0.setG1BasisVertex(g1Basis);
704 g1BasisVector.push_back(g1Basis);
705 auxGeom[i].setG1Basis(g1Basis);
710 for (
size_t i = 0; i < auxGeom.size(); i++)
715 gsC1SurfBasisVertex<T> g1BasisVertex_0(auxGeom[i].getPatch(), auxGeom[i].getPatch().basis(), isBdy[i], Phi, gdCoefs);
717 g1BasisVertex_0.setG1BasisVertex(g1Basis);
719 g1BasisVector.push_back(g1Basis);
720 auxGeom[i].setG1Basis(g1Basis);
794 if (this->kindOfVertex() != 0)
795 computeKernel(g1BasisVector);
797 for (
size_t i = 0; i < auxGeom.size(); i++)
798 auxGeom[i].parametrizeBasisBack(g1BasisVector[i]);
801 for (
size_t i = 0; i < auxGeom.size(); i++)
803 for (
size_t ii = 0; ii < auxGeom[i].getG1Basis().nPatches(); ii++)
806 coefs_temp.setZero(auxGeom[i].getG1Basis().patch(ii).coefs().rows(),1);
807 for (
index_t j = 0; j < auxGeom[i].getG1Basis().patch(ii).coefs().rows(); j++)
809 if (!math::almostEqual(auxGeom[i].getG1Basis().patch(ii).coefs().at(j)*auxGeom[i].getG1Basis().patch(ii).coefs().at(j),T(0)))
810 coefs_temp(j,0) = auxGeom[i].getG1Basis().patch(ii).coefs()(j,0);
812 auxGeom[i].getG1Basis().patch(ii).setCoefs(coefs_temp);
814 basisVertexResult.push_back(auxGeom[i].getG1Basis());
838 gsG1AuxiliaryPatch<d,T> & getSinglePatch(
const index_t i){
return auxGeom[i]; }
840 std::vector<gsMultiPatch<T>> getBasis()
841 {
return basisVertexResult; }
850 for(
size_t i = 0; i < auxGeom.size(); i++)
851 mp_vertex.
addPatch(auxGeom[i].getPatch());
856 std::vector<index_t> dim_u, dim_v, side;
857 std::vector<index_t> dim_u_iFace;
858 std::vector<size_t> patchID, patchID_iFace;
859 gsMatrix<T> matrix_det(m_mp.targetDim(), m_mp.targetDim()), points(m_mp.parDim(),1);
861 for(
size_t np = 0; np < mp_vertex.
nPatches(); np++)
866 patchID.push_back(np);
867 dim_u.push_back(auxGeom[np].getG1Basis().basis(0).component(0).size());
868 dim_v.push_back(auxGeom[np].getG1Basis().basis(0).component(1).size());
869 dim_mat += auxGeom[np].getG1Basis().basis(0).component(0).size();
870 dim_mat += auxGeom[np].getG1Basis().basis(0).component(0).size();
872 if(m_mp.parDim() == m_mp.targetDim())
873 matrix_det.col(0) = auxGeom[np].getPatch().jacobian(points).col(0);
874 else if(m_mp.parDim() + 1 == m_mp.targetDim())
877 auxGeom[np].getPatch().jacobian_into(points, ev);
879 N(0,0) = ev(1,0)*ev(2,1)-ev(2,0)*ev(1,1);
880 N(1,0) = ev(2,0)*ev(0,1)-ev(0,0)*ev(2,1);
881 N(2,0) = ev(0,0)*ev(1,1)-ev(1,0)*ev(0,1);
882 matrix_det.col(0) = ev.col(0);
883 matrix_det.col(2) = N;
889 patchID.push_back(np);
890 dim_u.push_back(auxGeom[np].getG1Basis().basis(0).component(0).size());
891 dim_v.push_back(auxGeom[np].getG1Basis().basis(0).component(1).size());
892 dim_mat += auxGeom[np].getG1Basis().basis(0).component(1).size();
893 dim_mat += auxGeom[np].getG1Basis().basis(0).component(1).size();
895 if(m_mp.parDim() == m_mp.targetDim())
896 matrix_det.col(1) = auxGeom[np].getPatch().jacobian(points).col(1);
897 else if(m_mp.parDim() + 1 == m_mp.targetDim())
900 auxGeom[np].getPatch().jacobian_into(points, ev);
902 N(0,0) = ev(1,0)*ev(2,1)-ev(2,0)*ev(1,1);
903 N(1,0) = ev(2,0)*ev(0,1)-ev(0,0)*ev(2,1);
904 N(2,0) = ev(0,0)*ev(1,1)-ev(1,0)*ev(0,1);
905 matrix_det.col(1) = ev.col(1);
912 patchID_iFace.push_back(np);
913 dim_u_iFace.push_back(auxGeom[np].getG1Basis().basis(0).component(0).size());
920 if (matrix_det.determinant()*matrix_det.determinant() > 1e-15)
928 coefs_corner.setZero();
931 for (
size_t bdy_index = 0; bdy_index < patchID.size(); ++bdy_index)
933 if (side[bdy_index] < 3)
935 index_t shift_row_neumann = dim_v[bdy_index];
936 for (
index_t i = 0; i < dim_v[bdy_index]; ++i)
938 for (
index_t j = 0; j < 6; ++j)
940 T coef_temp = auxGeom[patchID[bdy_index]].getG1Basis().patch(j).coef(i*dim_u[bdy_index], 0);
941 if (!math::almostEqual(coef_temp * coef_temp,T(0)))
942 coefs_corner(shift_row+i, j) = coef_temp;
944 coef_temp = auxGeom[patchID[bdy_index]].getG1Basis().patch(j).coef(i*dim_u[bdy_index] +1, 0);
945 if (!math::almostEqual(coef_temp * coef_temp,T(0)))
946 coefs_corner(shift_row_neumann + shift_row+i, j) = coef_temp;
950 shift_row += dim_v[bdy_index];
951 shift_row += dim_v[bdy_index];
955 index_t shift_row_neumann = dim_u[bdy_index];
956 for (
index_t i = 0; i < dim_u[bdy_index]; ++i)
958 for (
index_t j = 0; j < 6; ++j)
960 T coef_temp = auxGeom[patchID[bdy_index]].getG1Basis().patch(j).coef(i, 0);
961 if (!math::almostEqual(coef_temp * coef_temp,T(0)))
962 coefs_corner(shift_row+i, j) = coef_temp;
964 coef_temp = auxGeom[patchID[bdy_index]].getG1Basis().patch(j).coef(i+dim_u[bdy_index], 0);
965 if (!math::almostEqual(coef_temp * coef_temp,T(0)))
966 coefs_corner(shift_row_neumann + shift_row+i, j) = coef_temp;
970 shift_row += dim_u[bdy_index];
971 shift_row += dim_u[bdy_index];
974 for (
size_t iFace_index = 0; iFace_index < patchID_iFace.size(); ++iFace_index)
976 for (
index_t i = 0; i < 2; ++i)
978 for (
index_t j = 0; j < 6; ++j)
980 T coef_temp = auxGeom[patchID_iFace[iFace_index]].getG1Basis().patch(j).coef(i, 0);
981 if (!math::almostEqual(coef_temp * coef_temp,T(0)))
982 coefs_corner(shift_row + i, j) = coef_temp;
983 coef_temp = auxGeom[patchID_iFace[iFace_index]].getG1Basis().patch(j).coef(i + dim_u_iFace[iFace_index],
985 if (!math::almostEqual(coef_temp * coef_temp,T(0)))
986 coefs_corner(shift_row + 2 + i, j) = coef_temp;
996 gsEigen::FullPivLU<gsMatrix<T>> KernelCorner(coefs_corner);
997 KernelCorner.setThreshold(threshold);
999 while (KernelCorner.dimensionOfKernel() < dofsCorner) {
1001 KernelCorner.setThreshold(threshold);
1006 vertBas.setIdentity(6, 6);
1008 kernel = KernelCorner.kernel();
1011 while (kernel.cols() < 6) {
1012 kernel.conservativeResize(kernel.rows(), kernel.cols() + 1);
1013 kernel.col(kernel.cols() - 1) = vertBas.col(count);
1015 gsEigen::FullPivLU<gsMatrix<T>> ker_temp(kernel);
1016 ker_temp.setThreshold(1e-6);
1017 if (ker_temp.dimensionOfKernel() != 0) {
1018 kernel = kernel.block(0, 0, kernel.rows(), kernel.cols() - 1);
1024 kernel.setIdentity(6, 6);
1028 for(
size_t np = 0; np < auxGeom.size(); np++)
1032 for (
index_t j = 0; j < 6; ++j)
1036 coef_bf.setZero(dim_uv, 1);
1037 for (
index_t i = 0; i < 6; ++i)
1038 if (!math::almostEqual(kernel(i, j) * kernel(i, j),T(0)))
1039 coef_bf += temp_result_0.
patch(i).coefs() * kernel(i, j);
1042 g1BasisVector[np].patch(j).setCoefs(coef_bf);
1051 std::vector<gsG1AuxiliaryPatch<d,T>> auxGeom;
1052 std::vector<index_t > auxVertexIndices;
1053 std::vector< std::vector<bool>> isBdy;
1061 std::vector<gsMultiPatch<T>> basisVertexResult;
index_t addPatch(typename gsGeometry< T >::uPtr g)
Add a patch from a gsGeometry<T>::uPtr.
Definition: gsMultiPatch.hpp:210
Struct which represents a certain side of a patch.
Definition: gsBoundary.h:231
index_t size() const
Returns the number of elements in the basis.
Definition: gsTensorBasis.h:108
gsBasis< T > & basis(const size_t i) const
Return the basis of the i-th patch.
Definition: gsMultiPatch.hpp:171
bool isBoundary(const patchSide &ps) const
Is the given patch side ps set to a boundary?
Definition: gsBoxTopology.h:223
#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
short_t maxDegree() const
If the basis is of polynomial or piecewise polynomial type, then this function returns the maximum po...
Definition: gsTensorBasis.h:470
T at(index_t i) const
Returns the i-th element of the vectorization of the matrix.
Definition: gsMatrix.h:211
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
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition: gsMultiPatch.h:33
EIGEN_STRONG_INLINE abs_expr< E > abs(const E &u)
Absolute value.
Definition: gsExpressions.h:4486
const Basis_t & component(short_t dir) const
For a tensor product basis, return the (const) 1-d basis for the i-th parameter component.
Definition: gsTensorBSplineBasis.h:202
bool isInterface(const patchSide &ps) const
Is the given patch side ps set to an interface?
Definition: gsBoxTopology.cpp:103
bool computeTopology(T tol=1e-4, bool cornersOnly=false, bool tjunctions=false)
Attempt to compute interfaces and boundaries automatically.
Definition: gsMultiPatch.hpp:366