-
Notifications
You must be signed in to change notification settings - Fork 11
/
docsMeshing.html
612 lines (473 loc) · 39.2 KB
/
docsMeshing.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
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>SimVascular Docs</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="css/shop-item.css" rel="stylesheet" type="text/css" />
<link href="css/codestyle.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="font-awesome-4.1.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/1.5.2/css/ionicons.min.css">
<link rel="shortcut icon" href="img/favicon.ico">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse">
<i class="fa fa-bars" id="barIcon"></i>
</button>
<a class="navbar-brand" id="brandName" href="index.html">
<img src="img/svlogo/svLogoSmallText.png" alt="...">
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right navbar-main-collapse">
<ul class="nav navbar-nav">
<!-- USER GUIDES -->
<li>
<a href="#" id="dropdownMenu1" data-toggle="dropdown">
<b><span class="fa fa-user"></span> User Guides</b>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation" class="divider"></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsQuickGuide.html"><b><span class="icon ion-ios7-bolt"></span> Getting Started</b></a></li>
<li role="presentation" class="divider"></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsModelGuide.html"><b><span class="icon ion-settings"></span> Modeling</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsMeshing.html"><b><span class="icon ion-ios7-keypad"></span> Meshing</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsFlowSolver.html"><b><span class="icon ion-play"></span> Simulation</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docssvFSI.html"><b><span class="icon ion-plus-round"></span> svFSI</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsSimCardio.html"><b><span class="icon ion-plus-round"></span> SimCardio</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsROMSimulation.html"><b><span class="icon ion-plus-round"></span> ROM Simulation</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsGenBC.html"><b><span class="icon ion-refresh"></span> GenBC</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsPythonInterface.html"><b><span class="icon ion-refresh"></span> Python Interface</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsReferences.html"><b><span class="icon ion-refresh"></span> References </b></a></li>
</ul>
</li>
<!-- CLINCAL CASES -->
<li>
<a href="#" id="dropdownMenu1" data-toggle="dropdown">
<b><i class="fa fa-stethoscope"></i> Clinical Cases</b>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation"><a role="menuitem" tabindex="-1" href="clinicalCase3.html"><b><span class="fa fa-user-md"></span> Coronary Normal</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="clinicalCase1.html"><b><span class="fa fa-user-md"></span> Aortofemoral Normal - 1</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="clinicalCase2.html"><b><span class="fa fa-user-md"></span> Aortofemoral Normal - 2</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="clinicalCase4.html"><b><span class="fa fa-user-md"></span> Healthy Pulmonary</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://simtk.org/projects/sv_tests"><b><span class="fa fa-user-md"></span> All demo projects</b></a></li>
</ul>
</li>
<!-- DEVELOPER GUIDES -->
<li>
<a href="#" id="dropdownMenu1" data-toggle="dropdown">
<b><span class="fa fa-caret-square-o-right"></span> Developer Guides</b>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://github.com/SimVascular/SimVascular/wiki/wiki_for_developers"><b><span class="fa fa-file-text-o"></span> Compile Source Code</b></a></li>
</ul>
</li>
<!-- svCOMMUNITY -->
<li>
<a href="#" id="dropdownMenu1" data-toggle="dropdown">
<b><i class="fa fa-users"></i> svCommunity</b>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://simtk.org/forums/viewforum.php?f=188"><b><span class="fa fa-users"></span> Public Forum</b></a></li>
<li role="presentation" class="divider"></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://github.com/SimVascular/SimVascular/wiki/"><b><span class="fa fa-file-text-o"></span> Wiki</b></a></li>
<li role="presentation" class="divider"></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://simtk.org/mailman/listinfo/simvascular-news"><b><span class="fa fa-sign-in"></span> Join News Mailing List</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://simtk.org/pipermail/simvascular-news/"><b><span class="fa fa-pencil-square-o"></span> News Mailing List Archive</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://github.com/SimVascular/SimVascular/issues"><b><span class="fa fa-bug"></span> Report bugs and request features</b></a></li>
</ul>
</li>
<!-- REFERENCES -->
<li>
<a href="docsRefs.html" id="dropdownMenu1" >
<b><span class="icon ion-document-text"></span>References</b>
</a>
</li>
<!-- Archives -->
<li>
<a href="#" id="dropdownMenu1" data-toggle="dropdown">
<b> Archives</b>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation"><a role="menuitem" tabindex="-1" href="archiveQuickGuideSV2.html"><b>SimVascular 2.0</b></a></li>
</ul>
</li>
<!-- <li><a href="docsQuickGuide.html" id="btnQuickGuide"><b><span class="icon ion-ios7-bolt"></span> Quick Guide</b></a></li>
<li><a href="docsModelGuide.html" id="btnModelGuide"><b><span class="icon ion-settings"></span> Modeling</b></a></li>
<li><a href="docsMeshing.html" id="btnMeshing"><b><span class="icon ion-ios7-keypad"></span> Meshing</b></a></li>
<li><a href="docsPresolver.html" id="btnPresolver"><b><span class="icon ion-log-in"></span> svPre</b></a></li>
<li><a href="docsFlowSolver.html" id="btnFlowSolver"><b><span class="icon ion-play"></span> svSolver</b></a></li>
<li><a href="docsRefs.html" id="btnRefs"><b><span class="icon ion-document-text"></span> References</b></a></li>
<li><a href="clinicalCase1.html" id="btnRefs"><b>Case Studies</b></a></li> -->
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<!-- Page Content -->
<!--Nav Bar -->
<div class="row">
<div class="col-xs-1 col-sm-1 hidden-md hidden-lg">
</div>
<!-- ONE COLUMN OF SPACE -->
<nav class="hidden-xs hidden-sm col-md-2 col-lg-2 bs-docs-sidebar">
<ul id="sidebar" class="nav nav-stacked fixed manMeshing"> <p><h3>Meshing Guide</h3></p>
<li><a href="#intro">Introduction</a></li>
<li><a href="#tetgenoverview">TetGen Meshing</a>
<ul class="nav nav-stacked">
<li><a href="#tetgencreatemesh">Create Mesh</a></li>
<li><a href="#tetgeniso">Isotropic Meshing</a></li>
<li><a href="#tetgenboundarylayer">Boundary Layer Meshing</a></li>
<li><a href="#tetgetnradiusbased">Radius-Based Meshing</a></li>
<li><a href="#tetgenlocalmeshing">Local Mesh Size Application</a></li>
<li><a href="#tetgensphericalrefinement">Spherical Refinement</a></li>
<li><a href="#tetgenflags">Advanced Flags</a></li>
<li><a href="#tetgenadapt">Adaptive Meshing</a></li>
<li><a href="#loadingmesh">Unloading/Loading <br>Mesh Data</a></li>
<li><a href="#exportingmesh">Exporting Mesh</a></li>
<li><a href="#tetgenerrors">TetGen Errors</a></li>
</ul>
</li>
<li><a href="#inspectingmehses">Inspecting Meshes</a></li>
<h3>Download</h3>
<a href="https://simtk.org/frs/download_confirm.php/file/5113/DemoProject.zip?group_id=930">Demo Project</a></ul>
</nav>
<!--Main Content -->
<div class="col-xs-10 col-sm-10 col-md-9 col-lg-9" id="manualContent">
<!-- ACTUAL CONTENT -->
<div class="manMeshing"> <section id="intro" class="group"><h2>Introduction</h2>
<h3>Mesh Generation</h3>
<p>Discretization, also known as grid or mesh generation, is defined as the process of breaking up a physical domain into smaller sub-domains (usually called elements). Discretization is necessary in order to facilitate the numerical solution of partial differential equations. In other words, there are few analytic solutions for geometries of engineering interest thus the geometry must be divided into an aggregate of simpler pieces for analysis. </p>
<p>Automatic mesh generation has been an area of intense research for decades, and a tremendous amount of literature and numerous algorithms have been developed. There are three fundamental challenges in the field: robustness, mesh quality, and computational efficiency in generating the mesh. A recent survey indicated there were over 80 commercial and academic meshing products available, of which 39 automatically generated tetrahedral (“tet”) elements compared to 20 that performed unstructured hexahedral (“brick”) mesh generation. The current dominance of tetrahedral meshing can be attributed most notably to its ability to robustly mesh arbitrary, complex geometries. In addition, the use of tetrahedral elements often simplifies the process of adapting the mesh during simulation.</p>
<p>Once we have a geometric (solid) model representing a device of interest, we need to discretize the flow domain into little pieces (called elements) for simulation. This process is known as mesh generation. </p>
<p>We will review several important concepts prior to discussing mesh generation:</p>
<ol>
<li><p>For the applications discussed herein, a geometric model representing each energy domain of interest (fluid, mechanical, thermal, etc.) must exist. That is, if you are simulating the mechanical forces of a balloon expandable stent deployed in air, you need a geometric model representing at a minimum the stent geometry. However, if you want to simulate flow around a stent deployed in a vessel, you need a geometric model of the flow lumen (i.e. flow domain) not of the stent itself.</p></li>
<li><p>There are multiple sources of geometric models. The most common source of geometry in the device community is likely from commercial CAD packages (SDRC I-deas, SolidEdge, SolidWorks, Pro-E, etc.). A second potential source of geometric models is digitized data (imaging data, etc.). Finally, a less common (but increasingly important) source of data is the results of a previous simulation. For example, if one simulated the deployment of a stent into a diseased artery, the results of this analysis (i.e. displacements) could be used for the initial geometry for a subsequent blood flow analysis around the deployed stent.</p></li>
<li><p>As will be shown using a beam example, a simple geometry allows for great flexibility in choice of element type (e.g. tetrahedral vs. hexahedral elements). However, for many geometries of engineering interest, the complex geometry motivates the need for automatic mesh generation and often restricts the user to tetrahedral or possibly hex-dominate meshing. Pure hexahedral mesh generation for complex geometries is an area of active research.</p></li>
</ol>
<p>In this manual, a finite-octree based tetrahedral mesh generator is used. The basic idea behind finite-octree methods is to decompose a complex geometry into simpler pieces and then mesh the individual pieces using a mesh generation technique (e.g. templates, Delaunay triangulation (see Figure 1), etc.). An example quadtree decomposition (the 2-D analog of finite-octree) is shown in Figure 2. A structured (i.e. tensor-product) quadtree grid that completely fills the space occupied by the geometric model (i.e. bounding box) is initially created based on a user-defined mesh density. Subdivision of the octants is then performed to reach a desired complexity of the geometry contained therein. Restricting the “level difference” or gradation between adjacent octants is essential to preserve mesh quality. After the geometry is decomposed, surface meshing is performed using projected 2-D Delaunay surface triangulation. Templates are used to create the interior volume mesh (i.e. octants contained completely inside of the geometric model), and 3-D Delaunay triangulation is used in the boundary octants (i.e. octants containing part of the geometric model boundary) to finish the meshing process.</p>
<p>Finally, we note that there are several techniques to evaluate the quality of a given discretization. For the exterior surface mesh, a visual inspection may provide useful information. However, it is impractical to visualize the individual tetrahedral elements for large meshes, so geometric-based mesh quality indicators are used. Specifically, three mesh quality indicators will be discussed (see Figure 3): </p>
<ul>
<li>Minimum solid angle</li>
<li>Radius ratio</li>
<li>Aspect ratio </li>
</ul>
<p>In the present work, a combination of these quality indicators is used by an iterative mesh optimization algorithm to improve the overall quality of the mesh. It should be noted that there is current research interest in generating error estimators that include both solution and geometric information that may lead to more accurate solutions while requiring ewer elements.</p>
<figure>
<img class="svImg svImgLg" src="documentation/meshing/img/Delaunay_Criterion.png">
<figcaption class="svCaption" >
Figure 1. Delaunay criterion. The Delaunay criterion states that no other point in the triangulation can fall within the circumscribing sphere (circle in 2-D) of the points defining a simplex in the triangulation. Figure (a) shows a valid Delaunay triangulation of four points in $\mathbb{R}^2$ while (b) shows a non-Delaunay triangulation of the same four points. In 2-D, the Delaunay criterion minimizes the maximum interior angle producing an optimal triangulation for a given set of points.
</figcaption>
</figure>
<figure>
<img class="svImg svImgLg" src="documentation/meshing/img/Quadtree.png">
<figcaption class="svCaption" >
Figure 2. Quadtree decomposition. The figure shows an example quadtree decomposition (directly analogous to octree decomposition in 3-D) that is used to divide the geometry into less complex individual pieces for automatic mesh generation.
</figcaption>
</figure>
<figure>
<img class="svImg svImgLg" src="documentation/meshing/img/Quality_Measures.png">
<figcaption class="svCaption" >
Figure 3. Geometric mesh quality measures. Shown are 2-D geometric mesh quality measures with direct analogies in 3-D. The radius ratio (a) is the ratio of the radius of the maximum inscribed circle (sphere in 3-D) over the radius of the circumscribed circle (sphere in 3-D). The aspect ratio (b) is a ratio of the minimum height to the maximum base length. The maximum/minimum interior (dihedral in 3-D) angle is shown in ©. In this lab we will construct meshes automatically for two different geometries. The first example is that of an idealized vessel (i.e. cylinder). The second example will be an idealized stent, deployed in an idealized stenotic vessel with incomplete apposition.
</figcaption>
</figure>
<h3>SimVascular Meshers</h3>
<p>This document describes how to use the Meshing software for discrete and continuous solids. SimVascular meshing includes both open source and commercial options. The open source meshing includes the open source libraries of TetGen and the Vascular Modeling Tool Kit(VMTK). These tools are combined to provide boundary layer, mesh refinement, and isotropic adaptive meshing. The commercial mesher in SimVascular is MeshSim and provides boundary layer, mesh refinement, and isotropic/anisotropic adaptive meshing. MeshSim is a very powerful tool and can provide high quality meshes for irregular and complicated domains.</p>
</section>
<section id="tetgenoverview" class="group"><h2>TetGen Meshing</h2>
<p>TetGen is an open source mesh generation software developed by Hang Si through WIAS in Berlin. TetGen is a tetrahedral mesh generator that uses 3D Delaunay Triangulation.
Learn more about <a href="http://wias-berlin.de/software/tetgen/">TetGen</a> here.</p>
</section>
<section id="tetgencreatemesh" class="group"><h3>Creating a TetGen Mesh from a Solid Model</h3>
<p>This exercise will assume that you have created segmentations down the aorta and common iliac artery that you can now use to create a solid model.</p>
<p><strong>To create a TetGen mesh (empty):</strong></p>
<pre class="highlight plaintext"><code>Right click the data node "Meshes" in the SV project in Data Manager
Click "Create Mesh" in the popup menu
Select Model: demo
Mesh Type: TetGen
Mesh Name: (use model name by default)
Click "OK"
</code></pre>
<figure>
<img class="svImg svImgSm" src="documentation/meshing/img/tetgen/createemptymesh.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<figure>
<img class="svImg svImgSm" src="documentation/meshing/img/tetgen/createmeshdialog.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>Now a new data node “demo” for the mesh is created under the data node “Meshes” in Data Manager. Double click the data node “demo" and the tool “SV Meshing” automatically shows up. The new mesh is empty and has no data so far. </p>
<figure>
<img class="svImg svImgXl" src="documentation/meshing/img/tetgen/emptymesh.png">
<figcaption class="svCaption" ></figcaption>
</figure>
</section>
<section id="tetgeniso" class="group"><h2>Isotropic Meshing</h2>
<p>To generate an isotropic mesh, we either need to specify a desired number of elements or some property (e.g. maximum edge length for each element) of the mesh. In our case, we will specify the maximum allowable edge length for a given element for the entire mesh. We have the ability to specify our own mesh size or have SimVascular calculate a size for us. </p>
<pre class="highlight plaintext"><code>Global Max Edge Size: click the button "Estimate" to let SimVascular to provide a value
Click the button "Run Mesher"
Click "Yes" to continue
</code></pre>
<p>It may take a while for meshing, which depends on the size of model and the estimated global max edge size. When your mesh has completed, the mesh shows in the 3D-view window of Display and a dialog pops up to show some mesh info (like the number of points, elements, faces, etc.). To see the mesh easier, hide the model temporarily.</p>
<p><font color="red"><strong>HELPFUL HINT:</strong> </font> The estimated edge size is about half of the radius of the smallest cap in the model.</p>
<figure>
<img class="svImg svImgXl" src="documentation/meshing/img/tetgen/tetgenisomesh.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>If you zoom in, you will be able to see the individual mesh elements.</p>
<figure>
<img class="svImg svImgSm" src="documentation/meshing/img/tetgen/tetgenisomesh2.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>Now try to change the “Global Max Edge Size” value to generate a mesh with more elements. Note that as you specify lower global max edge size values, SimVascular will take longer to generate the mesh. The software might appear as not responding, but should still be working. </p>
<p><font color="red"><strong>HELPFUL HINT:</strong> </font> There is an option for faster meshing, to use it:</p>
<pre class="highlight plaintext"><code>Toggle on "Fast Meshing"
</code></pre>
<p>It speeds up meshing with the same wall mesh, while cap mesh may not be desirable sometimes. Fast Meshing is automatically disabled if you turn on “Boundary Layer Meshing” or “Radius-Based Meshing”.</p>
</section>
<section id="tetgenboundarylayer" class="group"><h2>Boundary Layer Meshing</h2>
<p>When simulating blood flow, interesting phenomenon can occur near the vessel walls. Under laminar flow, for example, boundary layers can form with large velocity and pressure gradients near the wall. It is advantageous to have increased mesh density in the areas of high gradients. If a preferential flow direction is known, you can often “elongate” elements in the direction of the flow without loss of accuracy to reduce computational costs. In the area of mesh generation applied to fluid flow, this is often referred to as boundary layer meshing. Let’s explain a few parameters used in boundary layer meshing.</p>
<pre class="highlight plaintext"><code>* Portion of Edge Size: the portion of the edge size to use as the size for the initial boundary layer (typically this is a value between zero and one.
* Num Layers: the number of layers desired. Too many layers can cause self intersections on smaller vessels, so be careful.
* Layer Decreasing Ratio: the amount of the size decrease between successive boundary layers. This gradation factor is multiplied by the previous layer to get the thickness of the new layer. In order to decrease the layers by a factor of 2, apply a decreasing ratio of 0.5.
</code></pre>
<p>We will now generate a boundary layer mesh from a solid model.</p>
<pre class="highlight plaintext"><code>Make sure the model has correct types (wall,cap) assigned for all its faces
Go to Advance Options
Toggle on the checkbox "Boundary Layer Meshing"
Portion of Edge Size: in this case, we use 0.5.
Make sure Volume Meshing and Surface Meshing are on
Number of Layers: in this case, we use 4 layers.
Layer Decreasing Ratio: in this case, we would like each layer to be 0.6 of the previous layer.
Make sure Volume Meshing and Surface Meshing are on
Click the button "Run Mesher"
</code></pre>
<figure>
<img class="svImg svImgLg" src="documentation/meshing/img/tetgen/tetgenboundarylayer.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p><font color="red"><strong>WARNING:</strong> </font> Fast Meshing is automatically disabled if using boundary layer meshing. </p>
<p>The mesh generated will have the boundary layer mesh on the specified region. Zooming in, you can see that the number of layers in the volumetric mesh is four. The boundary layer extends all the way down the length of the surface named wall, and each layer is 0.8 of the previous layer.</p>
<p>It is important to note, once again, that you have generated a volumetric mesh. That is, the entire volume of the geometry has been filled with tetrahedral elements. Thus, the boundary layer meshing pattern that you see on the surface continues up the entire volume of the aorta. It is difficult to visualize thousands of elements at one time, so we only visualize this refinement on the exterior surface mesh.</p>
</section>
<section id="tetgetnradiusbased" class="group"><h2>Radius Based Meshing</h2>
<p>When models contain surfaces of very different size scales, it is often desirable to scale the size of the mesh with the size of the vessel of the model. Radius-based meshing will compute the centerlines and find the distance to these centerlines prior to meshing. These values will be normalized by the smallest value and then multiplied by the global max edge size given.</p>
<pre class="highlight plaintext"><code>Toggle on the checkbox "Radius-Based Meshing".
Click the button "Run Mesher".
</code></pre>
<p><font color="red"><strong>WARNING:</strong> </font> Fast Meshing is automatically disabled if using radius based meshing. </p>
<p>Note that a majority of our model has vessels of very similar size. In this case, a radius-based mesh does not do much; however, there are other models where this is a very desirable feature. The operation takes a bit long, so you can also try to change local meshing size introduced in the following section to reach the same goal. If you don’t use this operation, remember to turn it off before running mesher.</p>
</section>
<section id="tetgenlocalmeshing" class="group"><h2>Local Mesh Size Application</h2>
<p>Often, a designer may have insight into locations of interest or regions of complex behavior and may want to locally increase the mesh density in those regions to improve the quality of the given finite element analysis results for a given number of nodes. In this example, we will assume the ends of a model are areas of interest and want to locally increase the mesh density near these faces. In SimVascular you can specify different mesh densities on a local geometric model face. </p>
<p>In this example, we are interested more in the flow in the right iliac of this model. we specify a mesh edge size of 0.1 on the right_iliac wall. We leave the global edge size unchanged.</p>
<pre class="highlight plaintext"><code>Toggle off "Radius-Based Meshing"
Go to "Local Size"
All the faces are listed in the table.
Set local size 0.1 for wall\_right_iliac
Or you can use table menu to set if there are many faces to set
Click the button "Run Mesher"
</code></pre>
<figure>
<img class="svImg svImgLg" src="documentation/meshing/img/tetgen/tetgenlocalmeshing.png">
<figcaption class="svCaption" ></figcaption>
</figure>
</section>
<section id="tetgensphericalrefinement" class="group"><h2>Spherical Refinement</h2>
<p>When simulating blood flow, interesting phenomenon can occur around the site of vessel bifurcations. It is advantageous to have increased mesh density at and around bifurcations. In this section we will refine the mesh at the abdominal aorta and common iliac artery bifurcation using sphere refinement:</p>
<p>We will now refine a region with a sphere from a model of an Aorta.</p>
<pre class="highlight plaintext"><code>Clear local size for wall\_right_iliac in "Local Size"
Go to "Regional Refinement"
Toggle on "Sphere" and an sphere appears in the 3D-view window.
Move the sphere and change its size to make sure the bifurcation is include inside the sphere.
Click the button "Add" to add this region to the table
Provide a local size for it. Here we use 0.1
Click the button "Run Mesher"
</code></pre>
<figure>
<img class="svImg svImgLg" src="documentation/meshing/img/tetgen/tetgensphericalmeshing.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p><font color="red"><strong>HELPFUL HINT:</strong> </font>
If you have multiple regions of interest for mesh refinement, you can move the sphere to another region, then add it to the table. If you want to adjust a sphere which is already added in the table, just select the sphere in the table. A red sphere will appear in its corresponding region in the 3D-view window. You can also set size or delete spheres from the table menu.</p>
<p>You can combine boundary layer, spherical refinement and local size to create a full mesh again.</p>
<p><strong>When you are satisfied with the mesh, click the tool button “Save SV Project ” to save the mesh.</strong></p>
</section>
<section id="tetgenflags" class="group"><h2>Advanced Flags</h2>
<p>TetGen provide more advanced flags to operate meshing. These flags apply ONLY to the volumetric meshing operation. </p>
<figure>
<img class="svImg svImgSm" src="documentation/meshing/img/tetgen/tetgenflags.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<pre class="highlight plaintext"><code> - O: Specity the number of times to optomize the mesh. This moves nodes to reach a better quality mesh.
- q: Specify a quality measure for the mesh. This number corresponds to the ratio between the radius of the circumsphere of an element and the maximum edge size (See below for figure). This number can be anywhere from 2.0 to 1.1, and a lower number corresponds to a higher quality element. A mesh with a quality ratio 1.0 is not attainable and the mesher will run infinitely.
- T: Apply a tolerance to check whether a point lies on the surface or not (Default is $10^{-8}$).
- Y: Preserve the exact surface mesh. If this parameter is used without a surface remeshing, make sure a mesh size that corresponds to the surface mesh is applied.
- M: Do not merge facets that are coplanar or have very close vertices.
- d: Detect for intersecting facets. This can be helpful if there are regions with close facets.
- C: Check the consistency of the final mesh.
- Q: Output nothing to the terminal except for errors.
- V: Print out more detailed information from TetGen. This information is viewable in the terminal.
- Specify other mesh tags: The full TetGen documentation indicates other possible mesh flags. This is where those can be specified.
</code></pre>
</section>
<section id="tetgenadapt" class="group"><h2>Adaptive Meshing</h2>
<p>Adaptive meshing is used to create an adaptive mesh based on a simulation result. </p>
<figure>
<img class="svImg svImgMd" src="documentation/meshing/img/tetgen/tetgenadapt.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>Use simulation result from one single time step:</p>
<pre class="highlight plaintext"><code>Go to Adapt
Options: Use One Step
Result File(vtu): all_results.vtu, from a previous simulation. It is created as you convert previous simulation results when "As Single File" is on.
Step Number: Give a specific time step number of the previous simulation
Error Reduction Factor: (0~1)Value multiplied by the average interpolation error in order to get a target uniform local error distribution. This should be a value between zero and one. A smaller factor will attempt to achieve a mesh with smaller error.
Global Min Edge Size: Specify a minimum target edge size. No edge size will be smaller than this size, even if the adaptor identifies that solution needs a edge length smaller than this.
Global Max Edge Size: Specify a maximum target edge size. No edge size will be larger than this size, even if the adaptor identifies that the solution does not require an edge length this small.
Click "Create Adapted Mesh"
Provide a name for the adapted mesh
</code></pre>
<p>Use simulation results from multiple time steps:</p>
<pre class="highlight plaintext"><code>Go to Adapt
Options: Use Multiple Steps
Result File(vtu): all_results.vtu
Start Step Number:
End Step Number:
Step Increment:
Click "Create Adapted Mesh"
Provide a name for the adapted mesh
</code></pre>
<p>In the end, a new adapted mesh is created under the “Meshes” in Data Manager. Also the new adapted solution is create in [proj-path]/Meshes with a name “adapted-restart.[step number].1”. You can use the adapted mesh and the adapted solution as IC file to create a new job to run simulation.</p>
</section>
<section id="loadingmesh" class="group"><h2>Unloading/Loading Mesh Data</h2>
<p>Sometimes a created mesh (especially volume mesh) occupies very large amount of computer memory. In this case, after you save the mesh, you can unload the mesh data from a mesh to save memory while the mesh node is still in Data Manager.</p>
<p>With the same concern, when you open an existing SV project, mesh nodes are listed in Data Manager while the mesh data are not loaded for them.</p>
<p>To unload or load mesh data:</p>
<pre class="highlight plaintext"><code>Right click a mesh node in Data Manager
Click "Load/Unload Surface Mesh" : load surface mesh if it has no mesh data; or unload both surface/volume mesh if it already has mesh data
Click "Load/Unload Volume Mesh" : load both volume/surface mesh if it has no mesh data; or unload volume mesh if it already has volume mesh
</code></pre>
</section>
<section id="exportingmesh" class="group"><h3>Exporting Mesh</h3>
<p>To export a mesh to vtp/vtu files: a vtu file for the volume mesh, multiple vtp files for surface mesh, the whole wall surface, and individual faces:</p>
<pre class="highlight plaintext"><code>Right click the mesh node "demo" in the SV project in Data Manager
Click "Export Mesh-Complete" in the popup menu
Select a directory and Click "Choose"
</code></pre>
<p>A new directory “demo-mesh-complete” is created and all the mesh files are saved to this folder.</p>
</section>
<section id="tetgenerrors" class="group"><h2>TetGen Errors</h2>
<p>It may be the case where TetGen cannot mesh the given PolyData and it will crash. This could be for a number of reasons including an open surface or intersecting facets.
In most cases, TetGen is able to detect the error, and it outputs information about the event to the terminal. If you have built SimVascular from source, look for the error code in the output to the terminal.
If you have not built from source, the best option is to try a smaller mesh edge size. It is likely that the edge size specified is too large for certain parts of the model.</p>
<table><thead>
<tr>
<th>Code</th>
<th>Message</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>1</td>
<td>Error: Out of Memory</td>
<td>Not enough memory available to complete the mesh. Try increasing the mesh size</td>
</tr>
<tr>
<td>2</td>
<td>Please report this bug to [email protected]. Include the message above, your input data set, and the exact command line you used to run this program, thank you</td>
<td>This error was caused by an unknown bug to TetGen</td>
</tr>
<tr>
<td>3</td>
<td>A self-intersection was detected. Program stopped. Hint: use -d option to detect all self-intersections.</td>
<td>This failure was caused by an input error.</td>
</tr>
<tr>
<td>4</td>
<td>A very small input feature size was detected. Program stopped. Hint: use -T option to set a smaller tolerance.</td>
<td>This failure was caused by a possible input error. For example, there are two segments nearly intersecting each. other. If you want to ignore this possible error, set a smaller tolerance by the -T switch, default is $10^−8$.</td>
</tr>
</tbody></table>
<p>If the error code given is error code 2, please contact Hang Si at [email protected]. Otherwise, contact the SimVascular supporters or report a bug on the SimVascular website.</p>
</section>
<section id="inspectingmehses" class="group"><h3>Inspecting Meshes</h3>
<p>After creating a mesh in SimVascular, you can view the surface and make a visual inspection of the surface of the mesh. However, this is based purely on your idea of a “quality” mesh, and you can only see the surface of a volume mesh. In order to inspect a mesh more closely, we use open source software ParaView. ParaView contains filters to identify multiple quality measure such as volume and aspect ration. </p>
<p>To visualize and inspect a mesh in ParaView, follow the steps below:</p>
<p>1) Download, Install, and Run ParaView. Go to File->Open->Choose the vtu file generated when saving the mesh.</p>
<p>2) Using the dropdown menus, select Filters->Mesh Quality. </p>
<figure>
<img class="svImg svImgLg" src="documentation/meshing/img/Mesh_Filters.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>3) Adjust the parameters of the Filter in the Properties tab on the left hand side of the ParaView screen.</p>
<p>4) Change Tet Quality Measure to the new desired mesh. Here we select Volume:</p>
<p>5) To visualize the metric, select the Representation to be “Volume”, and select the Array under Coloring to be “Quality”.</p>
<figure>
<img class="svImg svImgLg" src="documentation/meshing/img/Mesh_Volume_Quality.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>6) We can similarly do the same thing for many other metrics such as Minimum Dihedral Angle.</p>
<figure>
<img class="svImg svImgLg" src="documentation/meshing/img/Mesh_Dihedral_Quality.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>7) Apply any other quality type to visualize the range and values of the corresponding metric.
<br>
<br>
<br>
<br></p>
</section>
</div>
</div>
</div>
<!-- /.container -->
<nav class="navbar navbar-default navbar-fixed-bottom">
<div class="container-fluid text-center">
<ul class="nav navbar-nav">
<li><a>Copyright © SimVascular Development Team - 2017</a></li>
</ul>
</div>
<!-- /.container -->
</nav>
<script src="js/jquery-1.11.0.js" type="text/javascript"></script><script src="js/bootstrap.min.js" type="text/javascript"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
$('body').scrollspy({
target: '.bs-docs-sidebar',
offset: 40
});
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-55333921-1', 'auto');
ga('send', 'pageview');
</script>
<script type="text/javascript"
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
</body>
</html>