35template<
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()),
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();};
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);
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);
512 typename util::enable_if<util::is_same<U, const gsHTensorBasis<d,T> *>::value,
const index_t>::type
516 typename util::enable_if<util::is_same<U, const gsTensorBSplineBasis<d,T> *>::value,
const index_t>::type
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)
Struct which represents a certain side of a box.
Definition gsBoundary.h:85
A basis represents a family of scalar basis functions defined over a common parameter domain.
Definition gsBasis.h:79
Defines a topological arrangement of a collection of "boxes" (e.g., parameter domains that map to phy...
Definition gsBoxTopology.h:39
const ifContainer & interfaces() const
Return the vector of interfaces.
Definition gsBoxTopology.h:252
const bContainer & boundaries() const
Return the vector of boundaries.
Definition gsBoxTopology.h:238
Constructs the D-Patch, from which the transformation matrix can be called.
Definition gsDPatchBase.h:37
virtual void _handleVertex(patchCorner pcorner)
Handles a vertex in the global matrix.
Definition gsDPatchBase.hpp:970
virtual index_t _vertIndex(index_t patch, boxCorner corner) const
Computes global index of the corner.
Definition gsDPatchBase.h:577
virtual void localGeometry_into(gsMultiPatch< T > &localGeometry)
Returns the modified geometry corresponding to the local basis.
Definition gsDPatchBase.h:124
virtual void mapperInfo() const
Returns for each basis function if it is free or eliminated.
Definition gsDPatchBase.hpp:134
virtual gsGeometry< T > * exportPatch(index_t patch, bool computeCoefs=true)
Exports a single modified patch with index patch.
Definition gsDPatchBase.hpp:186
virtual void defaultOptions()
Sets the default options.
Definition gsDPatchBase.hpp:39
virtual void _computeEVs()=0
Corrects the EVs.
virtual index_t _vertIndex(patchCorner pcorner) const
Computes global index of the corner.
Definition gsDPatchBase.h:587
virtual 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 const gsSparseMatrix< T > & matrix() const
Returns the smoothing matrix.
Definition gsDPatchBase.h:232
gsDPatchBase(const gsMultiPatch< T > &mp)
Default constructor.
Definition gsDPatchBase.h:80
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 matrix_into(gsSparseMatrix< T > &matrix) const
Returns the smoothing matrix into matrix.
Definition gsDPatchBase.h:213
virtual void vertexInfo(patchCorner corner) const
Returns information about a vertex.
Definition gsDPatchBase.hpp:151
virtual void sideInfo() const
Returns information for all the sides in the topology.
Definition gsDPatchBase.hpp:165
virtual index_t _sideIndex(index_t patch, boxSide bside) const
Computes global index of the side.
Definition gsDPatchBase.h:557
virtual void _initialize()
Initializes the class:-.
Definition gsDPatchBase.hpp:792
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 bool _isInteriorVertex(patchCorner corner) const
Determines whether the specified corner is interior vertex.
Definition gsDPatchBase.h:546
virtual void _initTHB()
Initializes the matrix, the basis and the mappers.
Definition gsDPatchBase.hpp:823
virtual void compute()
Computes the construction.
Definition gsDPatchBase.hpp:26
virtual void _initChecks()
Initializes the matrix, the basis and the mappers.
Definition gsDPatchBase.hpp:810
virtual void _handleRegularCorner(patchCorner pcorner)
Handles a regular corner.
Definition gsDPatchBase.hpp:1548
virtual gsMatrix< T > _preCoefficients(const gsMultiPatch< T > &patches)=0
Computes the C1 coefficients for pre-multiplication to make the multipatch.
virtual index_t _sideIndex(patchSide pside) const
Computes global index of the side.
Definition gsDPatchBase.h:566
virtual void _handleInterior()
Handles the interior in the global matrix.
Definition gsDPatchBase.hpp:1155
gsDPatchBase(const gsMultiBasis< T > &mb, const gsMultiPatch< T > &mp)
Default constructor.
Definition gsDPatchBase.h:60
virtual gsMultiPatch< T > exportToPatches(const gsMultiPatch< T > &patches)
Exports the modified geometry to a gsMultiPatch object.
Definition gsDPatchBase.h:187
virtual void _computeMapper()
Calculates the mapper.
Definition gsDPatchBase.hpp:1209
memory::shared_ptr< gsDPatchBase > Ptr
Shared pointer for gsDPatchBase.
Definition gsDPatchBase.h:44
virtual void _countDoFs()
Initializes the matrix, the basis and the mappers.
Definition gsDPatchBase.h:680
virtual void _initBasis()
Initializes the basis.
Definition gsDPatchBase.hpp:839
virtual void _computeSmoothMatrix()
Calculates the smooth matrix.
Definition gsDPatchBase.hpp:1177
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
virtual void _initMatrix()
Initializes the matrix.
Definition gsDPatchBase.hpp:851
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 _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
gsDPatchBase()
Empty constructor.
Definition gsDPatchBase.h:50
virtual 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
virtual index_t _getValence(patchCorner corner) const
Gets the valence.
Definition gsDPatchBase.h:536
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
memory::unique_ptr< gsDPatchBase > uPtr
Unique pointer for gsDPatchBase.
Definition gsDPatchBase.h:47
virtual void cornerInfo() const
Returns information for all the corners in the topology.
Definition gsDPatchBase.hpp:174
virtual void _initMappers()
Initializes the matrix, the basis and the mappers.
Definition gsDPatchBase.hpp:844
virtual void _performChecks(bool basis)
Performs checks on sides, vertices and bases.
Definition gsDPatchBase.hpp:875
virtual const gsMultiPatch< T > & getGeometry() const
Returns the multipatch that is used for the D-Patch.
Definition gsDPatchBase.h:133
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 void _whichHandled()
Prints which DoFs have been handled and which have been eliminated.
Definition gsDPatchBase.hpp:857
virtual std::vector< bool > getSharpCorners(T tol=1e-2) const
Checks if corners are sharp or not.
Definition gsDPatchBase.hpp:47
virtual void _handleBoundary(patchSide side)
Handles a boundary in the global matrix.
Definition gsDPatchBase.hpp:1112
virtual void _handleInterface(boundaryInterface iface)
Handles an interface in the global matrix.
Definition gsDPatchBase.hpp:1002
virtual void _resetChecks(bool basis)
Resets checks on sides, vertices and bases.
Definition gsDPatchBase.hpp:890
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
virtual void _makeTHB()=0
Prints which DoFs have been handled and which have been eliminated.
Maintains a mapping from patch-local dofs to global dof indices and allows the elimination of individ...
Definition gsDofMapper.h:69
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 empty() const
Returns true if gsMultiPatch is empty.
Definition gsMultiPatch.h:268
size_t nPatches() const
Number of patches.
Definition gsMultiPatch.h:274
Class which holds a list of parameters/options, and provides easy access to them.
Definition gsOptionList.h:33
Sparse matrix class, based on gsEigen::SparseMatrix.
Definition gsSparseMatrix.h:139
Provides declaration of the BoxTopology class.
#define index_t
Definition gsConfig.h:32
#define GISMO_NO_IMPLEMENTATION
Definition gsDebug.h:129
#define GISMO_ASSERT(cond, message)
Definition gsDebug.h:89
Provides declaration of Basis abstract interface.
Provides declaration of Basis abstract interface.
Provides declaration of the MultiPatch class.
Provides a list of labeled parameters/options that can be set and accessed easily.
The G+Smo namespace, containing all definitions for the library.
S give(S &x)
Definition gsMemory.h:266
Struct which represents an interface between two patches.
Definition gsBoundary.h:650
Struct that defines the boundary sides and corners and types of a geometric object.
Definition gsBoundary.h:56
Struct which represents a certain corner of a hyper-cube.
Definition gsBoundary.h:292
Struct which represents a certain corner of a patch.
Definition gsBoundary.h:393
Struct which represents a certain side of a patch.
Definition gsBoundary.h:232
index_t patch
The index of the patch.
Definition gsBoundary.h:234