-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTutorial02.html
373 lines (368 loc) · 31.5 KB
/
Tutorial02.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<title>G+Smo: Tutorial 02: Geometry</title>
<link href="gismodoxy_tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function() { init_search(); });
/* @license-end */
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://people.ricam.oeaw.ac.at/gismo/mj/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="gismodoxy.css" rel="stylesheet" type="text/css">
<!-- -->
<!-- <script type="text/javascript"> -->
<!-- </script> -->
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<!-- <a name="top"></a> -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="gslogo-doxy.jpg"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname"><a href="index.html"><font style="font-variant:small-caps;">G+S</font><font style="font-variant:small-caps;"
color="#000000">mo</font></a>
 <span id="projectnumber">25.01.0</span>
</div>
<div id="projectbrief">Geometry + Simulation Modules</div>
</td>
<td> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()"> </span>
<input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function(){initNavTree('Tutorial02.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div><div class="header">
<div class="headertitle"><div class="title">Tutorial 02: Geometry</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>In this tutorial you will get to know the main geometric objects and operations available in the library. Since all parametric curves, surfaces or volumes are geometric objects, all these derive from <a class="el" href="classgismo_1_1gsGeometry.html" title="Abstract base class representing a geometry map.">gsGeometry</a>, which in turn derives from <a class="el" href="classgismo_1_1gsFunction.html" title="A function from a n-dimensional domain to an m-dimensional image.">gsFunction</a>.</p>
<h1><a class="anchor" id="bsp02"></a>
Univariate B-splines</h1>
<ul>
<li><a class="el" href="classgismo_1_1gsKnotVector.html" title="Class for representing a knot vector.">gsKnotVector</a> The main ingredient for constructing a B-spline basis is a knot vector. See <a class="el" href="knotVector_example.html">knotVector_example.cpp</a>.</li>
<li><p class="startli"><a class="el" href="classgismo_1_1gsBSplineBasis.html" title="A univariate B-spline basis.">gsBSplineBasis</a></p>
<p class="startli">This class derives from <a class="el" href="classgismo_1_1gsBasis.html" title="A basis represents a family of scalar basis functions defined over a common parameter domain.">gsBasis</a>, representing a set of B-spline basis functions. These are polynomial functions, i.e. there are no weights (the weights if we regard them as NURBS are all equal to 1, therefore not stored). <br />
</p>
<p class="startli">Here is an example of how to create a knot vector and a B-spline basis, followed by uniform refinement.</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include <<a class="code" href="gismo_8h.html">gismo.h</a>></span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">using namespace </span><a class="code hl_namespace" href="namespacegismo.html">gismo</a>;</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span>, <span class="keywordtype">char</span>**)</div>
<div class="line">{</div>
<div class="line"> <a class="code hl_class" href="classgismo_1_1gsTHBSplineBasis.html">gsKnotVector<></a> kv (-1, 0, 3, 3, 1 );</div>
<div class="line"> <a class="code hl_class" href="classgismo_1_1gsTHBSplineBasis.html">gsBSplineBasis<></a> basis(kv);</div>
<div class="line"> <a class="code hl_define" href="gsDebug_8h.html#af6177e1e282640c3cb9175565f84a432">gsInfo</a> << basis.detail() << <span class="stringliteral">"\n"</span>;</div>
<div class="line"> </div>
<div class="line"> basis.uniformRefine();</div>
<div class="line"> <a class="code hl_define" href="gsDebug_8h.html#af6177e1e282640c3cb9175565f84a432">gsInfo</a> << basis.detail() << <span class="stringliteral">"\n"</span>;</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
<div class="ttc" id="aclassgismo_1_1gsTHBSplineBasis_html"><div class="ttname"><a href="classgismo_1_1gsTHBSplineBasis.html">gismo::gsTHBSplineBasis</a></div><div class="ttdoc">Truncated hierarchical B-spline basis.</div><div class="ttdef"><b>Definition</b> gsTHBSplineBasis.h:36</div></div>
<div class="ttc" id="agismo_8h_html"><div class="ttname"><a href="gismo_8h.html">gismo.h</a></div><div class="ttdoc">Main header to be included by clients using the G+Smo library.</div></div>
<div class="ttc" id="agsDebug_8h_html_af6177e1e282640c3cb9175565f84a432"><div class="ttname"><a href="gsDebug_8h.html#af6177e1e282640c3cb9175565f84a432">gsInfo</a></div><div class="ttdeci">#define gsInfo</div><div class="ttdef"><b>Definition</b> gsDebug.h:43</div></div>
<div class="ttc" id="anamespacegismo_html"><div class="ttname"><a href="namespacegismo.html">gismo</a></div><div class="ttdoc">The G+Smo namespace, containing all definitions for the library.</div></div>
</div><!-- fragment --><p> Output: </p><pre class="fragment">BSplineBasis: deg=2, size=6, knot vector:
[ -1 -0.75 -0.5 -0.25 0 ] ~ ( 3 1 1 1 3 )
deg=2, size=9, uSize=5, minSpan=0.25, maxSpan=0.25
BSplineBasis: deg=2, size=10, knot vector:
[ -1 -0.875 -0.75 -0.625 -0.5 -0.375 -0.25 -0.125 0 ] ~ ( 3 1 1 1 1 1 1 1 3 )
deg=2, size=13, uSize=9, minSpan=0.125, maxSpan=0.125
</pre><p class="startli">Here is an example of how to get basis functions active on one point, and their corresponding values.</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include <<a class="code" href="gismo_8h.html">gismo.h</a>></span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">using namespace </span><a class="code hl_namespace" href="namespacegismo.html">gismo</a>;</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span>, <span class="keywordtype">char</span>**)</div>
<div class="line">{</div>
<div class="line"> <a class="code hl_class" href="classgismo_1_1gsTHBSplineBasis.html">gsKnotVector<></a> kv (-1, 0, 3, 3, 1 );</div>
<div class="line"> <a class="code hl_class" href="classgismo_1_1gsTHBSplineBasis.html">gsBSplineBasis<></a> basis(kv);</div>
<div class="line"> <a class="code hl_define" href="gsDebug_8h.html#af6177e1e282640c3cb9175565f84a432">gsInfo</a> << basis.detail() << <span class="stringliteral">"\n"</span>;</div>
<div class="line"> </div>
<div class="line"> <a class="code hl_class" href="classgismo_1_1gsTHBSplineBasis.html">gsMatrix<></a> pt(1,1);</div>
<div class="line"> pt << 0;</div>
<div class="line"> </div>
<div class="line"> <a class="code hl_class" href="classgismo_1_1gsTHBSplineBasis.html">gsMatrix<index_t></a> act;</div>
<div class="line"> <a class="code hl_class" href="classgismo_1_1gsTHBSplineBasis.html">gsMatrix<></a> val;</div>
<div class="line"> basis.active_into(pt, act);</div>
<div class="line"> basis.eval_into(pt, val);</div>
<div class="line"> <a class="code hl_define" href="gsDebug_8h.html#af6177e1e282640c3cb9175565f84a432">gsInfo</a> << <span class="stringliteral">"Active basis functions on "</span> << pt << <span class="stringliteral">":\n"</span> << act << <span class="stringliteral">"\n"</span>;</div>
<div class="line"> <a class="code hl_define" href="gsDebug_8h.html#af6177e1e282640c3cb9175565f84a432">gsInfo</a> << <span class="stringliteral">"And their values:\n"</span> << val << <span class="stringliteral">"\n"</span>;</div>
<div class="line"> <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
</div><!-- fragment --><p> Output: </p><pre class="fragment">BSplineBasis: deg=2, size=6, knot vector:
[ -1 -0.75 -0.5 -0.25 0 ] ~ ( 3 1 1 1 3 )
deg=2, size=9, uSize=5, minSpan=0.25, maxSpan=0.25
Active basis functions on 0:
3
4
5
And their values:
0
0
1
</pre><p class="startli">And similarly here is an example of how to compute the Greville abscissae, determine the basis functions active on them, and compute their values.</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include <<a class="code" href="gismo_8h.html">gismo.h</a>></span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">using namespace </span><a class="code hl_namespace" href="namespacegismo.html">gismo</a>;</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span>, <span class="keywordtype">char</span>**)</div>
<div class="line">{</div>
<div class="line"> <a class="code hl_class" href="classgismo_1_1gsTHBSplineBasis.html">gsKnotVector<></a> kv (-1, 0, 3, 3, 1 );</div>
<div class="line"> <a class="code hl_class" href="classgismo_1_1gsTHBSplineBasis.html">gsBSplineBasis<></a> basis(kv);</div>
<div class="line"> </div>
<div class="line"> <a class="code hl_class" href="classgismo_1_1gsTHBSplineBasis.html">gsMatrix<></a> greville = basis.anchors();</div>
<div class="line"> <a class="code hl_define" href="gsDebug_8h.html#af6177e1e282640c3cb9175565f84a432">gsInfo</a> << greville << <span class="stringliteral">"\n\n"</span>;</div>
<div class="line"> </div>
<div class="line"> <a class="code hl_class" href="classgismo_1_1gsTHBSplineBasis.html">gsMatrix<index_t></a> actmat;</div>
<div class="line"> basis.active_into( greville, actmat );</div>
<div class="line"> <a class="code hl_define" href="gsDebug_8h.html#af6177e1e282640c3cb9175565f84a432">gsInfo</a> << actmat << <span class="stringliteral">"\n\n"</span>;</div>
<div class="line"> </div>
<div class="line"> <a class="code hl_class" href="classgismo_1_1gsTHBSplineBasis.html">gsMatrix<></a> evaluate = basis.eval( greville );</div>
<div class="line"> <a class="code hl_define" href="gsDebug_8h.html#af6177e1e282640c3cb9175565f84a432">gsInfo</a> << evaluate << <span class="stringliteral">"\n\n"</span>;</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
</div><!-- fragment --><p> Output: </p><pre class="fragment"> -1 -0.875 -0.625 -0.375 -0.125 0
1 0.25 0.125 0.125 0.125 0
0 0.625 0.75 0.75 0.625 0
0 0.125 0.125 0.125 0.25 1
</pre><p class="startli">Several basic operations are available: degree elevation, knot insertion, uniform refinement, interpolation, and so on, see <a class="el" href="bSplineBasis_example.html">bSplineBasis_example.cpp</a> for a few of them.</p>
</li>
</ul>
<p>Contrusction of a B-spline curve.</p><ul>
<li><p class="startli"><a class="el" href="classgismo_1_1gsBSpline.html" title="A B-spline function of one argument, with arbitrary target dimension.">gsBSpline</a> This class derives from <a class="el" href="classgismo_1_1gsCurve.html" title="Abstract base class representing a curve.">gsCurve</a> and consists of a <a class="el" href="classgismo_1_1gsBSplineBasis.html" title="A univariate B-spline basis.">gsBSplineBasis</a> plus a matrix which represents the coefficients in the basis. Therefore, the matrix contains the control points of the B-spline curve.</p>
<p class="startli">Here is an example of how to create a B-spline curve, by declaring its basis and coefficients. </p><div class="fragment"><div class="line"> <span class="comment">// Make a BSpline curve</span></div>
<div class="line"> <a class="code hl_class" href="classgismo_1_1gsTHBSplineBasis.html">gsKnotVector<></a> kv(0, 1, 1, 3);<span class="comment">//start,end,interior knots, start/end multiplicites of knots</span></div>
<div class="line"> <a class="code hl_class" href="classgismo_1_1gsTHBSplineBasis.html">gsMatrix<></a> coefs(4, 3);</div>
<div class="line"> coefs << 0, 0, 0,</div>
<div class="line"> 1, 2, 3,</div>
<div class="line"> 2, 1, 4,</div>
<div class="line"> 4, 4, 4;</div>
<div class="line"> </div>
<div class="line"> <a class="code hl_class" href="classgismo_1_1gsTHBSplineBasis.html">gsBSpline<></a> curve(kv, coefs);</div>
</div><!-- fragment --></li>
</ul>
<p>These B-spline related classes are implemented in the <a class="el" href="group__Nurbs.html">Nurbs module</a>.</p>
<h1><a class="anchor" id="bsp03"></a>
Multi-variate B-splines</h1>
<p>The extantion to multi dimentional space is based on tensor-product constructions.</p>
<ul>
<li><p class="startli"><a class="el" href="classgismo_1_1gsTensorBSplineBasis.html" title="A tensor product B-spline basis.">gsTensorBSplineBasis</a><d></p>
<p class="startli">The tensor-product basis of dimension d where the coordinates are <a class="el" href="classgismo_1_1gsBSplineBasis.html" title="A univariate B-spline basis.">gsBSplineBasis</a>. This class derives from <a class="el" href="classgismo_1_1gsBasis.html" title="A basis represents a family of scalar basis functions defined over a common parameter domain.">gsBasis</a>, representing a set of tensor-product B-spline basis functions.</p>
<p class="startli">Here is an example how to construct a bivariate tensor product BSpline basis, compute the domain tesselations (meshes) and visualize these elements in paraview. </p><div class="fragment"><div class="line"><span class="preprocessor">#include <<a class="code" href="gismo_8h.html">gismo.h</a>></span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">using namespace </span><a class="code hl_namespace" href="namespacegismo.html">gismo</a>;</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span>, <span class="keywordtype">char</span>**)</div>
<div class="line">{</div>
<div class="line"> <a class="code hl_class" href="classgismo_1_1gsTHBSplineBasis.html">gsKnotVector<></a> ku (-1, 1, 3, 4); <span class="comment">// fist, last, interior, multEnd</span></div>
<div class="line"> <a class="code hl_class" href="classgismo_1_1gsTHBSplineBasis.html">gsKnotVector<></a> kv (-1, 1, 1, 4); <span class="comment">// fist, last, interior, multEnd</span></div>
<div class="line"> </div>
<div class="line"> <a class="code hl_class" href="classgismo_1_1gsTHBSplineBasis.html">gsTensorBSplineBasis<2></a> basis( ku, kv );</div>
<div class="line"> </div>
<div class="line"> <a class="code hl_class" href="classgismo_1_1gsTHBSplineBasis.html">gsMesh<></a> mesh(basis);</div>
<div class="line"> </div>
<div class="line"> gsWriteParaview( basis, <span class="stringliteral">"basis"</span>, 1000); <span class="comment">// object, name, number of plotting samples</span></div>
<div class="line"> gsWriteParaview( mesh, <span class="stringliteral">"mesh"</span>);</div>
<div class="line"> <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
</div><!-- fragment --><p class="startli">For additional properites and operations, e.g. basis size, basis support, evaluation, derivation, refinement, etc., see <a class="el" href="basis_example.html">basis_example.cpp</a>.</p>
</li>
<li><p class="startli"><a class="el" href="classgismo_1_1gsTensorBSpline.html" title="A tensor product of d B-spline functions, with arbitrary target dimension.">gsTensorBSpline</a><d></p>
<p class="startli">A function defined by a <a class="el" href="classgismo_1_1gsTensorBSplineBasis.html" title="A tensor product B-spline basis.">gsTensorBSplineBasis</a> plus a coefficient vector. As before, the number <em>d</em> stands for the dimension. For d=2 we have a <a class="el" href="classgismo_1_1gsSurface.html" title="Abstract base class representing a surface.">gsSurface</a>, for d=3 we have a <a class="el" href="classgismo_1_1gsVolume.html" title="Provides declaration of Volume abstract interface.">gsVolume</a> and for d=4 a <a class="el" href="classgismo_1_1gsBulk.html" title="Abstract base class representing a 4D bulk.">gsBulk</a>.</p>
</li>
</ul>
<p>Similarly, <a class="el" href="classgismo_1_1gsNurbsBasis.html" title="A univariate NURBS basis.">gsNurbsBasis</a>, <a class="el" href="classgismo_1_1gsNurbs.html" title="A NURBS function of one argument, with arbitrary target dimension.">gsNurbs</a>, <a class="el" href="classgismo_1_1gsTensorNurbsBasis.html" title="A tensor product Non-Uniform Rational B-spline (NURBS) basis.">gsTensorNurbsBasis</a> and <a class="el" href="classgismo_1_1gsTensorNurbs.html" title="A tensor product Non-Uniform Rational B-spline function (NURBS) of parametric dimension d,...">gsTensorNurbs</a> refer to Non-uniform rational B-spline bases patches (functions) of dimension one, or more, respectively.</p>
<h1><a class="anchor" id="bsp04"></a>
Hierarchical B-splines</h1>
<p><a class="el" href="classgismo_1_1gsHBSplineBasis.html" title="A hierarchical B-spline basis of parametric dimension d.">gsHBSplineBasis</a> and <a class="el" href="classgismo_1_1gsTHBSplineBasis.html" title="Truncated hierarchical B-spline basis.">gsTHBSplineBasis</a> defines the hierarchical B-spline and the truncated hierarchical B-spline basis, respectively. Note that both are derived from <a class="el" href="classgismo_1_1gsHTensorBasis.html" title="Class representing a (scalar) hierarchical tensor basis of functions .">gsHTensorBasis</a>.</p>
<p>The corresponding geometric objects are gsHBSpline<d, T> and gsTHBSpline<d, T>, where <em>d</em> stands for the dimension and <em>T</em> templates the type.</p>
<p><a class="el" href="thbSplineBasis_example.html">thbSplineBasis_example.cpp</a> contains a brief introduction and overview to <a class="el" href="classgismo_1_1gsTHBSplineBasis.html" title="Truncated hierarchical B-spline basis.">gsTHBSplineBasis</a>. Additional examples can be found in <a class="el" href="thbRefinement_example.html">thbRefinement_example.cpp</a> for standard refinement operations, as well as in gsHBox_example, and <a class="el" href="classgismo_1_1gsAdaptiveMeshing.html">gsAdaptiveMeshing</a> for admissible refinement and coarsening operations.</p>
<h1><a class="anchor" id="geometry01"></a>
gsGeometry example</h1>
<p>All parametric objects (curves, surfaces or volumes) derive from the class <a class="el" href="classgismo_1_1gsGeometry.html" title="Abstract base class representing a geometry map.">gsGeometry</a>. <a class="el" href="geometry_example.html">geometry_example.cpp</a> illustrates a more generic example to create an analysis any given geometric object.</p>
<h2><a class="anchor" id="crgeo02"></a>
Creating simple geometries</h2>
<ul>
<li>The class <a class="el" href="structgismo_1_1gsNurbsCreator.html" title="Class gsNurbsCreator provides some simple examples of Nurbs Geometries.">gsNurbsCreator</a> has several functions that allow us to create (compute) the B-spline basis and the control points of some standard geometries.</li>
</ul>
<h2><a class="anchor" id="crgeo03"></a>
Re-constructing geometries</h2>
<ul>
<li>The <a class="el" href="fitting_example.html">fitting_example.cpp</a> shows how we can fit data points with B-splines.</li>
</ul>
<h1><a class="anchor" id="multipatch02"></a>
Multi-patch</h1>
<p>A <a class="el" href="classgismo_1_1gsMultiPatch.html" title="Container class for a set of geometry patches and their topology, that is, the interface connections ...">gsMultiPatch</a> object consists of a collection of patches with topological information. The topology is given by the boundaries and the adjacency graph, defining the connections between patches along boundaries.</p>
<p>Here is an XML file defining a simple 2-patch rectangle (two_patches.xml):</p>
<div class="fragment"><div class="line"><?<span class="keyword">xml</span> <span class="keyword">version</span>=<span class="stringliteral">"1.0"</span> <span class="keyword">encoding</span>=<span class="stringliteral">"UTF-8"</span>?></div>
<div class="line"><span class="comment"><!--</span></div>
<div class="line"><span class="comment">This is a simple example of two squares, parametrized by linear </span></div>
<div class="line"><span class="comment">B-splines meeting along one side</span></div>
<div class="line"><span class="comment">--></span></div>
<div class="line"><<span class="keywordtype">xml</span>></div>
<div class="line"> <span class="comment"><!-- Patch 0 --></span></div>
<div class="line"> <<span class="keywordtype">Geometry</span> <span class="keyword">type</span>=<span class="stringliteral">"TensorBSpline2"</span> <span class="keyword">id</span>=<span class="stringliteral">"0"</span>></div>
<div class="line"> <<span class="keywordtype">Basis</span> <span class="keyword">type</span>=<span class="stringliteral">"TensorBSplineBasis2"</span>></div>
<div class="line"> <<span class="keywordtype">Basis</span> <span class="keyword">type</span>=<span class="stringliteral">"BSplineBasis"</span> <span class="keyword">index</span>=<span class="stringliteral">"0"</span>></div>
<div class="line"> <<span class="keywordtype">KnotVector</span> <span class="keyword">degree</span>=<span class="stringliteral">"1"</span>>0 0 1 1 </<span class="keywordtype">KnotVector</span>></div>
<div class="line"> </<span class="keywordtype">Basis</span>></div>
<div class="line"> <<span class="keywordtype">Basis</span> <span class="keyword">type</span>=<span class="stringliteral">"BSplineBasis"</span> <span class="keyword">index</span>=<span class="stringliteral">"1"</span>></div>
<div class="line"> <<span class="keywordtype">KnotVector</span> <span class="keyword">degree</span>=<span class="stringliteral">"1"</span>>0 0 1 1 </<span class="keywordtype">KnotVector</span>></div>
<div class="line"> </<span class="keywordtype">Basis</span>></div>
<div class="line"> </<span class="keywordtype">Basis</span>></div>
<div class="line"> <<span class="keywordtype">coefs</span> <span class="keyword">geoDim</span>=<span class="stringliteral">"2"</span>></div>
<div class="line"> 0.0 0.0 </div>
<div class="line"> 1.0 0.0 </div>
<div class="line"> 0.0 1.0 </div>
<div class="line"> 1.0 1.0 </div>
<div class="line"> </<span class="keywordtype">coefs</span>></div>
<div class="line"> </<span class="keywordtype">Geometry</span>></div>
<div class="line"> </div>
<div class="line"> <span class="comment"><!-- Patch 1 --></span></div>
<div class="line"> <<span class="keywordtype">Geometry</span> <span class="keyword">type</span>=<span class="stringliteral">"TensorBSpline2"</span> <span class="keyword">id</span>=<span class="stringliteral">"1"</span>></div>
<div class="line"> <<span class="keywordtype">Basis</span> <span class="keyword">type</span>=<span class="stringliteral">"TensorBSplineBasis2"</span>></div>
<div class="line"> <<span class="keywordtype">Basis</span> <span class="keyword">type</span>=<span class="stringliteral">"BSplineBasis"</span> <span class="keyword">index</span>=<span class="stringliteral">"0"</span>></div>
<div class="line"> <<span class="keywordtype">KnotVector</span> <span class="keyword">degree</span>=<span class="stringliteral">"1"</span>>0 0 1 1 </<span class="keywordtype">KnotVector</span>></div>
<div class="line"> </<span class="keywordtype">Basis</span>></div>
<div class="line"> <<span class="keywordtype">Basis</span> <span class="keyword">type</span>=<span class="stringliteral">"BSplineBasis"</span> <span class="keyword">index</span>=<span class="stringliteral">"1"</span>></div>
<div class="line"> <<span class="keywordtype">KnotVector</span> <span class="keyword">degree</span>=<span class="stringliteral">"1"</span>>0 0 1 1 </<span class="keywordtype">KnotVector</span>></div>
<div class="line"> </<span class="keywordtype">Basis</span>></div>
<div class="line"> </<span class="keywordtype">Basis</span>></div>
<div class="line"> <<span class="keywordtype">coefs</span> <span class="keyword">geoDim</span>=<span class="stringliteral">"2"</span>></div>
<div class="line"> -1.0 0.0 </div>
<div class="line"> 0.0 0.0 </div>
<div class="line"> -1.0 1.0 </div>
<div class="line"> 0.0 1.0 </div>
<div class="line"> </<span class="keywordtype">coefs</span>></div>
<div class="line"> </<span class="keywordtype">Geometry</span>></div>
<div class="line"> </div>
<div class="line"> <span class="comment"><!-- A multipatch section describes the configuration</span></div>
<div class="line"><span class="comment"> of the two patches above --></span></div>
<div class="line"> <<span class="keywordtype">MultiPatch</span> <span class="keyword">parDim</span>=<span class="stringliteral">"2"</span> <span class="keyword">id</span>=<span class="stringliteral">"2"</span>></div>
<div class="line"> <<span class="keywordtype">patches</span> <span class="keyword">type</span>=<span class="stringliteral">"id_range"</span>>0 1</<span class="keywordtype">patches</span>></div>
<div class="line"> <<span class="keywordtype">interfaces</span>>1 2 0 1 0 1 1 1</div>
<div class="line"> </<span class="keywordtype">interfaces</span>></div>
<div class="line"> <<span class="keywordtype">boundary</span>>1 4</div>
<div class="line"> 1 3</div>
<div class="line"> 0 4</div>
<div class="line"> 0 3</div>
<div class="line"> 0 2</div>
<div class="line"> 1 1</div>
<div class="line"> </<span class="keywordtype">boundary</span>></div>
<div class="line"> </<span class="keywordtype">MultiPatch</span>></div>
<div class="line"> </div>
<div class="line"></<span class="keywordtype">xml</span>></div>
</div><!-- fragment --><p>The file contains the patches plus information on the boundaries and interfaces between them. A boundary is a side that does not meet with another side. An interface consists of two sides that meet plus orientation information. The following illustration describes the data:</p>
<div class="image">
<img src="mp.png" alt=""/>
<div class="caption">
Illustration of file two_patches.xml</div></div>
<p>See also <a class="el" href="structgismo_1_1boundary.html" title="Struct that defines the boundary sides and corners and types of a geometric object.">gismo::boundary</a> and <a class="el" href="structgismo_1_1boundaryInterface.html" title="Struct which represents an interface between two patches.">gismo::boundaryInterface</a> for more information on the meaning of the multipatch data.</p>
<p>Analogously to multipatch objects, a <a class="el" href="classgismo_1_1gsMultiBasis.html" title="Holds a set of patch-wise bases and their topology information.">gsMultiBasis</a> object is a collection of <a class="el" href="classgismo_1_1gsBasis.html" title="A basis represents a family of scalar basis functions defined over a common parameter domain.">gsBasis</a> classes together with topological information such as boundaries and interfaces. </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated on Mon Feb 10 2025 09:21:44 for G+Smo by Doxygen v1.10.0 </li>
</ul>
</div>
<!-- Piwik -->
<!--
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://stats.sylphide-consulting.com/piwik/" : "http://stats.sylphide-consulting.com/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 20);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://stats.sylphide-consulting.com/piwik/piwik.php?idsite=20" style="border:0" alt="" /></p></noscript>
-->
<!-- End Piwik Tracking Code -->
</body>
</html>