G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsDPatch.h
Go to the documentation of this file.
1
14#pragma once
15
17#include <gsCore/gsMultiPatch.h>
18#include <gsIO/gsOptionList.h>
20// #include <gsUnstructuredSplines/src/gsDPatchBase.hpp>
21namespace gismo
22{
23
24
32template<short_t d,class T>
33class gsDPatch : public gsDPatchBase<d,T>
34{
35
36typedef typename std::vector<std::tuple<index_t,index_t,T>> sparseEntry_t;
37
38public:
39 using Base = gsDPatchBase<d,T>;
40
42 typedef memory::shared_ptr< gsDPatch > Ptr;
43
45 typedef memory::unique_ptr< gsDPatch > uPtr;
46
49 { }
50
51 // using Base::compute;
52
58 gsDPatch(const gsMultiBasis<T> & mb) ;
59
60
66 gsDPatch(const gsMultiPatch<T> & mp) ;
67
68 // GISMO_CLONE_FUNCTION(gsDPatch)
69
70 ~gsDPatch();
71
72 void defaultOptions() override;
73
74 // using Base::exportToPatches;
75
76protected:
83 gsMatrix<T> _preCoefficients(const gsMultiPatch<T> & patches) override;
84 using Base::_preCoefficients;
85
86 // using Base::exportPatch;
87
88protected:
89
90 // using Base::_indexFromSides;
91
92 // using Base::_indicesFromVert;
93
94 // using Base::_indexFromVert;
95
96 // using Base::_vertexData;
97
98 // using Base::_sideIndex;
99
100 // using Base::_vertIndex;
101
102 // using Base::_getLowestCorners;
103
104 // using Base::_removeLowestCorners;
105
106 // using Base::_getLowestIndices;
107
108 // using Base::_removeLowestIndices;
109
110 // using Base::_getInterfaceIndices;
111
112 // using Base::_getAllInterfaceIndices;
113
114protected:
115
117 using Base::_resetChecks;
118
119 void _countDoFs() override;
120
121 // void _computeMapper(); // also initialize the mappers!
123
124 // void _computeSmoothMatrix();
126
127 void _initTHB() override;
128
129 void _refBoxes(std::vector<std::vector<index_t>> & patchBoxes);
130
131 void _initBasis() override;
132
133 void _makeTHB() override;
134
135 void _computeEVs() override;
136
146 gsMatrix<T> _makePi(index_t valence);
147
151 using Base::_vertexData;
152 using Base::_sideIndex;
153 using Base::_vertIndex;
158
159 using Base::_push;
160 using Base::_pushAndCheck;
161
162
163
164protected:
165 // void _computeInterfaceMapper(boundaryInterface iface);
166 using Base::_computeInterfaceMapper;
167
168 // void _computeBoundaryMapper(patchSide boundary);
169 using Base::_computeBoundaryMapper;
170
171 void _computeVertexMapper(patchCorner pcorner) override;
172
173
174private:
175 // // Boundary vertex of valence 1
176 // template<bool _boundary, index_t _v> // valence=2
177 // typename std::enable_if< _boundary && _v==1, void>::type
178 // // SAME
179 // _computeVertexMapperBoundary_v1(patchCorner pcorner, index_t valence);
180
181 using Base::_computeMapperRegularCorner_v1;
182
183 // // Boundary vertex of valence 2 with C1 smoothness
184 // template<bool _boundary, index_t _v, bool _smooth> // valence=2
185 // typename std::enable_if< _boundary && _v==2 && _smooth, void>::type
186 // // SAME
187 // _computeVertexMapperBoundarySmooth_v2(patchCorner pcorner, index_t valence);
188 using Base::_computeMapperRegularBoundaryVertexSmooth_v2;
189
190 // // Boundary vertex of valence 2 with C0 smoothness
191 // template<bool _boundary, index_t _v, bool _smooth> // valence=2
192 // typename std::enable_if< _boundary && _v==2 && (!_smooth), void>::type
193 // // DIFFERENT
194 // _computeVertexMapperBoundaryNonSmooth_v2(patchCorner pcorner, index_t valence);
195 using Base::_computeMapperRegularBoundaryVertexNonSmooth_v2;
196
197 // Boundary vertex of valence 3 with C1 smoothness
198 // ONLY DPATCH
199 void _computeMapperIrregularBoundaryVertexSmooth_v3(patchCorner pcorner, index_t valence);
200
201 // Boundary vertex of valence 3 with C0 smoothness
202 // template<bool _boundary, index_t _v, bool _smooth> // valence=2
203 // typename std::enable_if< _boundary && _v==3 && (!_smooth), void>::type
204 // ONLY DPATCH
205 void _computeMapperIrregularBoundaryVertexNonSmooth_v3(patchCorner pcorner, index_t valence);
206
207 // Boundary vertex of valence !(1,2,3) with C1 smoothness
208 // template<bool _boundary, index_t _v, bool _smooth>
209 // typename std::enable_if< _boundary && _v==-1 && _smooth, void>::type
210 // DIFFERENT
211 void _computeMapperIrregularBoundaryVertexSmooth_v(patchCorner pcorner, index_t valence) override;
212
213 // Boundary vertex of valence !(1,2,3) with C0 smoothness
214 // template<bool _boundary, index_t _v, bool _smooth>
215 // typename std::enable_if< _boundary && _v==-1 && (!_smooth), void>::type
216 // DIFFERENT
217 void _computeMapperIrregularBoundaryVertexNonSmooth_v(patchCorner pcorner, index_t valence) override;
218
219 // // Interior vertex
220 // template<bool _boundary, index_t _v>
221 // typename std::enable_if< (!_boundary) && _v==-1, void>::type
222 // // DIFFERENT
223 // _computeVertexMapperInterior_v(patchCorner pcorner, index_t valence);
224 using Base::_computeMapperInteriorVertex_v;
225
226protected:
227
257 // void _handleVertex(patchCorner pcorner);
258 // interior vertices
259 // void _handleInteriorVertex(patchCorner pcorner, index_t valence);
260
269 // void _handleInterface(boundaryInterface iface);
277 // void _handleBoundary(patchSide side);
283 // void _handleInterior();
288private:
294 // void _handleRegularCorner(patchCorner pcorner);
295
296
297 // template<bool _regular, bool _smooth> // valence=2
298 // typename std::enable_if< _regular && _smooth , void>::type
299 // _handleBoundaryVertex(patchCorner pcorner, index_t valence);
300
301 // template<bool _regular, bool _smooth> // valence=2
302 // typename std::enable_if< _regular && (!_smooth) , void>::type
303 // _handleBoundaryVertex(patchCorner pcorner, index_t valence);
304
305 // template<bool _regular, bool _smooth> // valence > 2
306 // typename std::enable_if<(!_regular) && _smooth , void>::type
307 // _handleBoundaryVertex(patchCorner pcorner, index_t valence);
308
309 // template<bool _regular, bool _smooth> // valence > 1
310 // typename std::enable_if<(!_regular) && (!_smooth) , void>::type
311 // _handleBoundaryVertex(patchCorner pcorner, index_t valence);
312
313 // void _handleRegularBoundaryVertexSmooth(patchCorner pcorner, index_t valence);
314
315 void _handleIrregularBoundaryVertexSmooth(patchCorner pcorner, index_t valence) override;
316
317 void _handleIrregularBoundaryVertexNonSmooth(patchCorner pcorner, index_t valence) override;
318
319protected:
321
322protected:
323 using Base::m_computed;
324 using Base::m_topology;
325
326 using Base::m_bases;
327 gsMultiBasis<T> m_bases0;
328 using Base::m_Bbases;
329 using Base::m_tMatrix;
330 std::vector<gsSparseMatrix<T>> m_tMatrices;
331 using Base::m_sideCheck;
332 using Base::m_vertCheck;
333 using Base::m_basisCheck;
334 using Base::m_C0s;
335
336 using Base::m_mapModified;
337 using Base::m_mapOriginal;
338
339 using Base::m_matrix;
340
341 using Base::m_options;
342
343 using Base::m_size;
344
345 using Base::m_coefs;
346
347 using Base::m_nSides;
348 using Base::m_nVerts;
349
350};
351
352
353
354}
355
356#ifndef GISMO_BUILD_LIB
357#include GISMO_HPP_HEADER(gsDPatch.hpp)
358#endif
Constructs the D-Patch, from which the transformation matrix can be called.
Definition gsDPatchBase.h:37
virtual index_t _vertIndex(index_t patch, boxCorner corner) const
Computes global index of the corner.
Definition gsDPatchBase.h:577
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 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 index_t _sideIndex(index_t patch, boxSide bside) const
Computes global index of the side.
Definition gsDPatchBase.h:557
virtual void _computeMapper()
Calculates the mapper.
Definition gsDPatchBase.hpp:1209
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 _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 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 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 void _performChecks(bool basis)
Performs checks on sides, vertices and bases.
Definition gsDPatchBase.hpp:875
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 _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
Constructs the D-Patch, from which the transformation matrix can be called.
Definition gsDPatch.h:34
gsMatrix< T > _makePi(index_t valence)
Makes the Pi matrix.
Definition gsDPatch.hpp:581
memory::unique_ptr< gsDPatch > uPtr
Unique pointer for gsDPatch.
Definition gsDPatch.h:45
void _makeTHB() override
Prints which DoFs have been handled and which have been eliminated.
Definition gsDPatch.hpp:292
gsDPatch()
Empty constructor.
Definition gsDPatch.h:48
void _countDoFs() override
Initializes the matrix, the basis and the mappers.
Definition gsDPatch.hpp:642
void _computeEVs() override
Corrects the EVs.
Definition gsDPatch.hpp:332
void _handleIrregularBoundaryVertexSmooth(patchCorner pcorner, index_t valence) override
Handles a vertex in the global matrix.
Definition gsDPatch.hpp:732
void defaultOptions() override
Sets the default options.
Definition gsDPatch.hpp:51
memory::shared_ptr< gsDPatch > Ptr
Shared pointer for gsDPatch.
Definition gsDPatch.h:42
void _initTHB() override
Initializes the matrix, the basis and the mappers.
Definition gsDPatch.hpp:144
void _initBasis() override
Initializes the basis.
Definition gsDPatch.hpp:271
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
Provides declaration of the BoxTopology class.
#define index_t
Definition gsConfig.h:32
Creates the D-Patch smoothing matrix.
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.
Struct which represents a certain corner of a patch.
Definition gsBoundary.h:393