35 template<
short_t d,
class T>
39 typedef typename std::vector<std::tuple<index_t,index_t,T>> sparseEntry_t;
44 typedef memory::shared_ptr< gsDPatchBase >
Ptr;
47 typedef memory::unique_ptr< gsDPatchBase >
uPtr;
64 m_topology(m_Bbases.topology()),
117 localBasis = m_bases;
144 GISMO_ASSERT(m_computed,
"The method has not been computed! Call compute().");
146 mbasis.init(m_bases,matrix);
157 gsMappedBasis<d,T> mbasis;
160 mspline.init(mbasis,localCoefs);
168 virtual void update( gsMappedBasis<d,T> & mbasis )
const
170 mbasis.init(m_bases,m_matrix.transpose());
189 GISMO_ASSERT(m_computed,
"The method has not been computed! Call compute().");
192 m_coefs = m_matrix.transpose() * m_coefs;
194 std::vector<gsGeometry<T> *> PatchContainer(patches.
nPatches());
195 for (
size_t p=0; p!=patches.
nPatches(); p++)
203 GISMO_ASSERT(!m_patches.empty(),
"The reference multipatch is empty!");
204 return this->exportToPatches(m_patches);
234 GISMO_ASSERT(m_computed,
"The method has not been computed! Call compute().");
280 gsMatrix<T> preCoefficients() {
return _preCoefficients();};
291 virtual gsMatrix<T> _preCoefficients(
const gsMultiPatch<T> & patches) = 0;
292 virtual gsMatrix<T> _preCoefficients()
294 return _preCoefficients(m_patches);
310 virtual void _computeInterfaceMapper(boundaryInterface iface);
312 virtual void _computeBoundaryMapper(patchSide boundary);
314 virtual void _computeVertexMapper(patchCorner pcorner);
321 void _push(sparseEntry_t entries)
325 for (
typename sparseEntry_t::const_iterator it=entries.begin(); it!=entries.end(); it++)
327 std::tie(rowIdx,colIdx,weight) = *it;
328 m_matrix(rowIdx,colIdx) = weight;
332 void _pushAndCheck(sparseEntry_t entries)
336 for (
typename sparseEntry_t::const_iterator it=entries.begin(); it!=entries.end(); it++)
338 std::tie(rowIdx,colIdx,weight) = *it;
339 m_matrix(rowIdx,colIdx) = weight;
340 m_basisCheck[rowIdx] =
true;
375 virtual void _handleInteriorVertex(patchCorner pcorner,
index_t valence);
409 virtual void _handleRegularBoundaryVertexSmooth(patchCorner pcorner,
index_t valence);
411 virtual void _handleRegularBoundaryVertexNonSmooth(patchCorner pcorner,
index_t valence);
413 virtual void _handleIrregularBoundaryVertexSmooth(patchCorner pcorner,
index_t valence);
415 virtual void _handleIrregularBoundaryVertexNonSmooth(patchCorner pcorner,
index_t valence);
438 virtual void _computeMapperRegularCorner_v1(patchCorner pcorner,
index_t valence);
444 virtual void _computeMapperRegularBoundaryVertexSmooth_v2(patchCorner pcorner,
index_t valence);
450 virtual void _computeMapperRegularBoundaryVertexNonSmooth_v2(patchCorner pcorner,
index_t valence);
456 virtual void _computeMapperIrregularBoundaryVertexSmooth_v(patchCorner pcorner,
index_t valence);
462 virtual void _computeMapperIrregularBoundaryVertexNonSmooth_v(patchCorner pcorner,
index_t valence);
468 virtual void _computeMapperInteriorVertex_v(patchCorner pcorner,
index_t valence);
512 typename util::enable_if<util::is_same<U, const gsHTensorBasis<d,T> *>::value,
const index_t>::type
513 _indexFromVert_impl(U basis,
const index_t index,
const patchCorner corner,
const patchSide side,
const index_t offsets = 0)
const;
516 typename util::enable_if<util::is_same<U, const gsTensorBSplineBasis<d,T> *>::value,
const index_t>::type
517 _indexFromVert_impl(U basis,
const index_t index,
const patchCorner corner,
const patchSide side,
const index_t offsets = 0)
const;
527 virtual const std::pair<index_t,bool>
_vertexData(
const patchCorner corner)
const;
558 {
return 4*patch + bside - 1; }
578 {
return 4*patch + corner -1; }
588 {
return _vertIndex( pcorner.patch , pcorner.corner() ); }
729 mutable std::vector<bool> m_sideCheck;
730 mutable std::vector<bool> m_vertCheck;
731 mutable std::vector<bool> m_basisCheck;
732 mutable std::vector<bool> m_C0s;
738 mutable size_t m_size;
753 #ifndef GISMO_BUILD_LIB
754 #include GISMO_HPP_HEADER(gsDPatchBase.hpp)
virtual gsMultiPatch< T > exportToPatches(const gsMultiPatch< T > &patches)
Exports the modified geometry to a gsMultiPatch object.
Definition: gsDPatchBase.h:187
#define GISMO_NO_IMPLEMENTATION
Definition: gsDebug.h:129
virtual void _computeMapper()
Calculates the mapper.
Definition: gsDPatchBase.hpp:1209
virtual gsGeometry< T > * exportPatch(index_t patch, bool computeCoefs=true)
Exports a single modified patch with index patch.
Definition: gsDPatchBase.hpp:186
Struct which represents a certain side of a patch.
Definition: gsBoundary.h:231
Provides declaration of the BoxTopology class.
virtual void vertexInfo(patchCorner corner) const
Returns information about a vertex.
Definition: gsDPatchBase.hpp:151
gsDPatchBase(const gsMultiBasis< T > &mb, const gsMultiPatch< T > &mp)
Default constructor.
Definition: gsDPatchBase.h:60
memory::unique_ptr< gsDPatchBase > uPtr
Unique pointer for gsDPatchBase.
Definition: gsDPatchBase.h:47
virtual void _computeEVs()=0
Corrects the EVs.
const bContainer & boundaries() const
Return the vector of boundaries.
Definition: gsBoxTopology.h:238
virtual void sideInfo() const
Returns information for all the sides in the topology.
Definition: gsDPatchBase.hpp:165
virtual const gsMultiPatch< T > & getGeometry() const
Returns the multipatch that is used for the D-Patch.
Definition: gsDPatchBase.h:133
virtual const index_t _getValence(patchCorner corner) const
Gets the valence.
Definition: gsDPatchBase.h:536
virtual void _handleInterface(boundaryInterface iface)
Handles an interface in the global matrix.
Definition: gsDPatchBase.hpp:1002
virtual void _handleInterior()
Handles the interior in the global matrix.
Definition: gsDPatchBase.hpp:1155
virtual std::vector< bool > getSharpCorners(T tol=1e-2) const
Checks if corners are sharp or not.
Definition: gsDPatchBase.hpp:47
virtual void _initMatrix()
Initializes the matrix.
Definition: gsDPatchBase.hpp:851
virtual void _initChecks()
Prepares the THB basis if needed.
Definition: gsDPatchBase.hpp:810
S give(S &x)
Definition: gsMemory.h:266
virtual void compute()
Computes the construction.
Definition: gsDPatchBase.hpp:26
#define index_t
Definition: gsConfig.h:32
virtual gsMatrix< T > _preCoefficients(const gsMultiPatch< T > &patches)=0
Computes the C1 coefficients for pre-multiplication to make the multipatch.
memory::shared_ptr< gsDPatchBase > Ptr
Shared pointer for gsDPatchBase.
Definition: gsDPatchBase.h:44
virtual void _computeSmoothMatrix()
Calculates the smooth matrix.
Definition: gsDPatchBase.hpp:1177
virtual void _countDoFs()
Initializes the matrix, the basis and the mappers.
Definition: gsDPatchBase.h:680
Struct which represents a certain corner of a patch.
Definition: gsBoundary.h:392
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
Maintains a mapping from patch-local dofs to global dof indices and allows the elimination of individ...
Definition: gsDofMapper.h:68
virtual void _handleBoundary(patchSide side)
Handles a boundary in the global matrix.
Definition: gsDPatchBase.hpp:1112
virtual const index_t _sideIndex(index_t patch, boxSide bside) const
Computes global index of the side.
Definition: gsDPatchBase.h:557
virtual void mapperInfo() const
Returns for each basis function if it is free or eliminated.
Definition: gsDPatchBase.hpp:134
virtual const bool _isInteriorVertex(patchCorner corner) const
Determines whether the specified corner is interior vertex.
Definition: gsDPatchBase.h:546
Provides a list of labeled parameters/options that can be set and accessed easily.
gsDPatchBase()
Empty constructor.
Definition: gsDPatchBase.h:50
virtual void _removeLowestCorners(std::vector< patchCorner > &pcorners, index_t n=3) const
From a list of patchCorners pcorners, remove all but the lowest n corners.
Definition: gsDPatchBase.hpp:448
virtual void _handleVertex(patchCorner pcorner)
Handles a vertex in the global matrix.
Definition: gsDPatchBase.hpp:970
virtual void _whichHandled()
Prints which DoFs have been handled and which have been eliminated.
Definition: gsDPatchBase.hpp:857
Holds a set of patch-wise bases and their topology information.
Definition: gsMultiBasis.h:36
Provides declaration of Basis abstract interface.
Provides declaration of the MultiPatch class.
virtual const void matrix_into(gsSparseMatrix< T > &matrix) const
Returns the smoothing matrix into matrix.
Definition: gsDPatchBase.h:213
virtual void cornerInfo() const
Returns information for all the corners in the topology.
Definition: gsDPatchBase.hpp:174
size_t nPatches() const
Number of patches.
Definition: gsMultiPatch.h:208
virtual void globalGeometry_into(const gsMultiPatch< T > &patches, gsMappedSpline< d, T > &mspline)
Returns the multipatch that is used for the D-Patch.
Definition: gsDPatchBase.h:154
virtual const index_t _sideIndex(patchSide pside) const
Computes global index of the side.
Definition: gsDPatchBase.h:566
Constructs the D-Patch, from which the transformation matrix can be called.
Definition: gsDPatchBase.h:36
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition: gsMultiPatch.h:33
Struct which represents a certain side of a box.
Definition: gsBoundary.h:84
virtual void _initMappers()
Initializes the matrix, the basis and the mappers.
Definition: gsDPatchBase.hpp:844
Provides declaration of Basis abstract interface.
virtual void _getLowestCorners(std::vector< patchCorner > &pcorners, index_t n=3) const
From a list of patchCorners pcorners, get the lowest n corners.
Definition: gsDPatchBase.hpp:435
virtual void _initialize()
Initializes the class:-.
Definition: gsDPatchBase.hpp:792
virtual void _performChecks(bool basis)
Performs checks on sides, vertices and bases.
Definition: gsDPatchBase.hpp:875
virtual const index_t _vertIndex(index_t patch, boxCorner corner) const
Computes global index of the corner.
Definition: gsDPatchBase.h:577
virtual void _initBasis()
Initializes the basis.
Definition: gsDPatchBase.hpp:839
virtual const gsSparseMatrix< T > & matrix() const
Returns the smoothing matrix.
Definition: gsDPatchBase.h:232
virtual void _makeTHB()=0
Prints which DoFs have been handled and which have been eliminated.
virtual void _getLowestIndices(std::vector< std::pair< index_t, index_t >> &indices, index_t n=3) const
From a list of tuples (patch,index), get the lowest n tuples.
Definition: gsDPatchBase.hpp:463
virtual const index_t _indexFromSides(index_t index1, const patchSide side1, index_t index2, const patchSide side2)
Computes the index of a basis function using sides as reference.
Definition: gsDPatchBase.hpp:227
virtual void _initTHB()
Initializes the matrix, the basis and the mappers.
Definition: gsDPatchBase.hpp:823
virtual void defaultOptions()
Sets the default options.
Definition: gsDPatchBase.hpp:39
virtual const index_t _vertIndex(patchCorner pcorner) const
Computes global index of the corner.
Definition: gsDPatchBase.h:587
virtual void _removeLowestIndices(std::vector< std::pair< index_t, index_t >> &indices, index_t n=3) const
From a list of tuples (patch,index), remove all but the lowest n tuples.
Definition: gsDPatchBase.hpp:484
Class which holds a list of parameters/options, and provides easy access to them. ...
Definition: gsOptionList.h:32
virtual const gsMultiBasis< T > & localBasis() const
Returns the basis that is used for the D-Patch. Could be THB refined.
Definition: gsDPatchBase.h:110
virtual void globalBasis_into(gsMappedBasis< d, T > &mbasis) const
Returns the basis that is used for the D-Patch. Could be THB refined.
Definition: gsDPatchBase.h:142
virtual void localGeometry_into(gsMultiPatch< T > &localGeometry)
Returns the modified geometry corresponding to the local basis.
Definition: gsDPatchBase.h:124
const ifContainer & interfaces() const
Return the vector of interfaces.
Definition: gsBoxTopology.h:252
virtual const std::pair< index_t, bool > _vertexData(const patchCorner corner) const
Returns the valence and whether a corner is interior or boundary.
Definition: gsDPatchBase.hpp:425
Defines a topological arrangement of a collection of "boxes" (e.g., parameter domains that map to phy...
Definition: gsBoxTopology.h:38
gsDPatchBase(const gsMultiPatch< T > &mp)
Default constructor.
Definition: gsDPatchBase.h:80
virtual void _handleRegularCorner(patchCorner pcorner)
Handles a regular corner.
Definition: gsDPatchBase.hpp:1537
virtual const index_t _indexFromVert(const index_t index, const patchCorner corner, const patchSide side, const index_t offsets=0) const
Computes the index of a basis function taking one corner and one side as reference.
Definition: gsDPatchBase.hpp:269
index_t patch
The index of the patch.
Definition: gsBoundary.h:234
Struct which represents a certain corner of a hyper-cube.
Definition: gsBoundary.h:291
bool empty() const
Returns true if gsMultiPatch is empty.
Definition: gsMultiPatch.h:202
virtual void _resetChecks(bool basis)
Resets checks on sides, vertices and bases.
Definition: gsDPatchBase.hpp:890