32 index_t numberOfKnotsToBeInserted,
33 index_t multiplicityOfKnotsToBeInserted,
38 result.m_mBases.resize(levels);
39 result.m_transferMatrices.resize(levels-1);
40 result.m_mBases[0] =
give(mBasis);
41 for (
index_t i=1; i<levels; ++i )
43 result.m_mBases[i] = result.m_mBases[i-1];
44 result.m_mBases[i].uniformRefine_withTransfer(
45 result.m_transferMatrices[i-1],
48 numberOfKnotsToBeInserted,
49 multiplicityOfKnotsToBeInserted,
68 result.m_mBases.push_back(
give(mBasis));
70 index_t lastSize = result.m_mBases[0].totalSize();
72 for (
index_t i = 0; i < levels-1 && lastSize > degreesOfFreedom; ++i)
88 if (lastSize <= newSize && degreesOfFreedom > 0)
92 result.m_mBases.push_back(
give(coarseMBasis));
93 result.m_transferMatrices.push_back(
give(transferMatrix));
96 std::reverse( result.m_mBases.begin(), result.m_mBases.end() );
97 std::reverse( result.m_transferMatrices.begin(), result.m_transferMatrices.end() );
Knot vector for B-splines.
static gsGridHierarchy buildByCoarsening(gsMultiBasis< T > mBasis, const gsBoundaryConditions< T > &boundaryConditions, const gsOptionList &assemblerOptions, index_t levels, index_t degreesOfFreedom=0, index_t unk=0)
This function sets up a grid hierarchy by coarsening.
Definition: gsGridHierarchy.hpp:57
size_t totalSize() const
The total number of basis functions in all bases.
Definition: gsMultiBasis.h:246
static gsGridHierarchy buildByRefinement(gsMultiBasis< T > mBasis, const gsBoundaryConditions< T > &boundaryConditions, const gsOptionList &assemblerOptions, index_t levels, index_t numberOfKnotsToBeInserted=1, index_t multiplicityOfKnotsToBeInserted=1, index_t unk=0)
This function sets up a multigrid hierarchy by uniform refinement.
Definition: gsGridHierarchy.hpp:27
Provides declaration of MultiBasis class.
S give(S &x)
Definition: gsMemory.h:266
#define index_t
Definition: gsConfig.h:32
Provides assembler and solver options.
Grid Hierarchy.
Definition: gsGridHierarchy.h:33
Provides a list of labeled parameters/options that can be set and accessed easily.
Holds a set of patch-wise bases and their topology information.
Definition: gsMultiBasis.h:36
Provides declaration of BSplineBasis class.
Class containing a set of boundary conditions.
Definition: gsBoundaryConditions.h:341
Class which holds a list of parameters/options, and provides easy access to them. ...
Definition: gsOptionList.h:32
void uniformCoarsen_withTransfer(gsSparseMatrix< T, RowMajor > &transfer, const gsBoundaryConditions< T > &boundaryConditions, const gsOptionList &assemblerOptions, int numKnots=1, index_t unk=0)
Coarsen every basis uniformly.
Definition: gsMultiBasis.hpp:222
Provides declaration of TensorBSplineBasis abstract interface.