22 template<
short_t d,
class T>
23 class gsG1AuxiliaryPatch
30 gsG1AuxiliaryPatch(
const gsGeometry<T> & singlePatch,
const index_t globalPatchIndex):
31 auxPatch(singlePatch), patchIndex(globalPatchIndex){
37 void setPlusMinus(index_t plus, index_t minus)
43 index_t get_n_plus() {
return m_plus; }
44 index_t get_n_minus() {
return m_minus; }
46 void rotateParamAntiClock(){
55 gsMatrix<T> mpar(dimU * dimV, auxPatch.targetDim());
58 for (index_t j = 0; j < dimU; j++)
60 for (index_t i = 0; i < dimV; i++)
62 mpar.row(i + j * dimV) = auxPatch.patch(0).coefs().row((dimU - 1 - j) + dimU * i);
74 auxPatch.swap(newpatch);
75 auxPatch.computeTopology();
81 void rotateBasisAntiClock(){
83 for(
size_t np = 0; np < G1repBasis.nPatches(); np++)
94 gsMatrix<T> mpar(dimU * dimV, G1repBasis.patch(np).targetDim());
97 for (index_t j = 0; j < dimU; j++)
99 for (index_t i = 0; i < dimV; i++)
101 mpar.row(i + j * dimV) = G1repBasis.patch(np).coefs().row((dimU - 1 - j) + dimU * i);
110 G1repBasis.swap(newpatch);
114 void rotateParamClock(){
123 gsMatrix<T> mpar(dimU * dimV, auxPatch.targetDim());
125 for (index_t j = (dimU - 1 ) ; j >= 0; j--)
127 for (index_t i = 0; i < dimV; i++)
129 mpar.row(i + (dimU - j - 1) * dimV) = auxPatch.patch(0).coefs().row((dimV * dimU -1 - j) - dimU * i);
141 auxPatch.swap(newpatch);
142 auxPatch.computeTopology();
146 this->checkRotation();
150 void rotateBasisClock(){
152 for(
size_t np = 0; np < G1repBasis.nPatches(); np++)
165 gsMatrix<T> mpar(dimU * dimV, G1repBasis.patch(np).targetDim());
167 for (index_t j = (dimU - 1); j >= 0; j--)
169 for (index_t i = 0; i < dimV; i++)
171 mpar.row(i + (dimU - j - 1) * dimV) =
172 G1repBasis.patch(np).coefs().row((dimV * dimU - 1 - j) - dimU * i);
181 G1repBasis = newpatch;
185 void rotateParamAntiClockTwice(){
194 gsMatrix<T> mpar(dimU * dimV, auxPatch.targetDim());
196 for (index_t i = 0; i < ( dimU * dimV ); i++)
198 mpar.row(i) = auxPatch.patch(0).coefs().row((dimU * dimV - 1) - i);
208 auxPatch.swap(newpatch);
209 auxPatch.computeTopology();
213 this->checkRotation();
217 void rotateBasisAntiClockTwice(){
219 for(
size_t np = 0; np < G1repBasis.nPatches(); np++)
230 gsMatrix<T> mpar(dimU * dimV, G1repBasis.patch(np).targetDim());
232 for (index_t i = 0; i < (dimU * dimV); i++)
234 mpar.row(i) = G1repBasis.patch(np).coefs().row((dimU * dimV - 1) - i);
241 G1repBasis = newpatch;
254 gsMatrix<T> mpar(dimU * dimV, auxPatch.targetDim());
256 for (index_t j = 0; j < dimU; j++)
258 for (index_t i = 0; i < dimV; i++)
260 mpar.row(i + j * dimV) = auxPatch.patch(0).coefs().row(j + dimU * i);
272 auxPatch.swap(newpatch);
279 void swapBasisAxis(){
281 for(
size_t np = 0; np < G1repBasis.nPatches(); np++)
291 gsMatrix<T> mpar(dimU * dimV, G1repBasis.patch(np).targetDim());
293 for (index_t j = 0; j < dimU; j++)
295 for (index_t i = 0; i < dimV; i++)
297 mpar.row(i + j * dimV) = G1repBasis.patch(np).coefs().row(j + dimU * i);
306 G1repBasis.swap(newpatch);
312 G1repBasis = g1Basis;
319 this->rotateBasisAntiClockTwice();
322 this->rotateBasisAntiClock();
325 this->rotateBasisClock();
334 this->swapBasisAxis();
344 void computeTopology(){
349 return auxPatch.patch(0);
356 index_t getNumberOfRotatioin(){
361 return axisOrientation;
366 return G1repBasis.patch(i).coefs();
374 void checkRotation(){
379 void checkOrientation(){
380 axisOrientation = ( axisOrientation == 0 ? 1 : 0 );
395 bool axisOrientation;
A univariate B-spline basis.
Definition gsBSplineBasis.h:700
Abstract base class representing a geometry map.
Definition gsGeometry.h:93
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
Holds a set of patch-wise bases and their topology information.
Definition gsMultiBasis.h:37
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition gsMultiPatch.h:100
bool computeTopology(T tol=1e-4, bool cornersOnly=false, bool tjunctions=false)
Attempt to compute interfaces and boundaries automatically.
Definition gsMultiPatch.hpp:377
index_t addPatch(typename gsGeometry< T >::uPtr g)
Add a patch from a gsGeometry<T>::uPtr.
Definition gsMultiPatch.hpp:211
const KnotVectorType & knots(int i=0) const
Returns the knot vector of the basis.
Definition gsBSplineBasis.h:371
A tensor product B-spline basis.
Definition gsTensorBSplineBasis.h:37
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
A tensor product of d B-spline functions, with arbitrary target dimension.
Definition gsTensorBSpline.h:45
index_t size() const
Returns the number of elements in the basis.
Definition gsTensorBasis.h:108
Main header to be included by clients using the G+Smo library.
#define index_t
Definition gsConfig.h:32
Provides declaration of the MultiPatch class.
The G+Smo namespace, containing all definitions for the library.