26 const short_t dim = m_boundary.dim();
57 this->preparePatch(resultBasis, coefs);
63 if ( (stride.array() < 3).all() )
65 gsWarn<<
"There where no interior control points.\n";
74 const int sz = resultBasis.
size();
75 gsDofMapper mapper(resultBasis);
78 mapper.markBoundary(0,bnd);
82 gsSparseMatrix<T> A(mapper.freeSize(), mapper.freeSize() );
83 gsMatrix<T> b(mapper.freeSize(), coefs.cols() );
84 A.reserve( gsVector<int>::Constant(A.cols(), 2*d) );
92 for (
int i = 0; i<sz ; i++ )
94 const index_t ii = mapper.index(i,0);
96 if ( !mapper.is_free_index(ii))
101 for (
unsigned k = 0; k<d; k++ )
103 for (
int s = -1; s<2; s+=2 )
105 const unsigned j = i + s * stride[k];
106 const index_t jj = mapper.index(j,0);
108 if ( mapper.is_free_index(jj) )
111 b.row(ii) += coefs.row(j);
121 typename gsSparseSolver<T>::LU solver(A);
122 gsMatrix<T> solution = solver.solve ( b );
125 for (
int i = 0; i<sz; i++ )
127 const index_t ii = mapper.index(i,0);
129 if ( mapper.is_free_index(ii) )
131 coefs.row(i) = solution.row(ii);
Abstract base class representing a geometry map.
Definition: gsGeometry.h:92
index_t size() const
Returns the number of elements in the basis.
Definition: gsTensorBasis.h:108
#define short_t
Definition: gsConfig.h:35
S give(S &x)
Definition: gsMemory.h:266
Provides spring patch construction from boundary data.
#define index_t
Definition: gsConfig.h:32
const gsGeometry< T > & compute()
Main routine that performs the computation.
Definition: gsSpringPatch.hpp:24
Computes a parametrization based on the spring patch technique, given a set of boundary geometries...
Definition: gsSpringPatch.h:26
void size_cwise(gsVector< index_t, s > &result) const
The number of basis functions in the direction of the k-th parameter component.
Definition: gsTensorBasis.h:441
A tensor product B-spline basis.
Definition: gsTensorBSplineBasis.h:36
#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.
Represents a B-spline curve/function with one parameter.
void stride_cwise(gsVector< index_t, d > &result) const
Returns the strides for all dimensions.
Definition: gsTensorBasis.h:512
gsMatrix< index_t > allBoundary() const
Definition: gsTensorBasis.hpp:283
#define GISMO_ERROR(message)
Definition: gsDebug.h:118
Provides iteration over integer or numeric points in a (hyper-)cube.
Provides declaration of TensorBSplineBasis abstract interface.