-
Notifications
You must be signed in to change notification settings - Fork 17
/
catalyst.html
881 lines (706 loc) · 30.3 KB
/
catalyst.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
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
<!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="The Topology ToolKit">
<meta name="author" content="The Topology ToolKit">
<meta name="keywords" content="TTK, Topology ToolKit, Topological Data
Analysis, Visualization, Reeb graph, Reeb Space, Morse-Smale complex, contour
tree, persistence diagram, persistence curve, continuous scatterplot, fiber
surface, contour forests, jacobi set, mandatory critical points, topological
simplification, VTK, ParaView, Python" />
<title>TTK - the Topology ToolKit - Topological Data Analysis and
Visualization</title>
<!-- Bootstrap Core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Theme CSS -->
<link href="css/clean-blog.min.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="manifest" href="site.webmanifest">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
<!-- 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]-->
<!-- Google Analytics -->
<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','https://www.google-analytics.com/analytics.js','ga'
);
ga('create', 'UA-88087813-1', 'auto');
ga('send', 'pageview');
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
var pluginUrl =
'//www.google-analytics.com/plugins/ga/inpage_linkid.js';
_gaq.push(['_require', 'inpage_linkid', pluginUrl]);
_gaq.push(['_setAccount', 'UA-88087813-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type =
'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl'
: 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
<!-- End Google Analytics -->
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header page-scroll">
<button type="button" class="navbar-toggle"
data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
Menu <i class="fa fa-bars"></i>
</button>
<a class="navbar-brand" href="index.html">
TTK Home</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling
-->
<div class="collapse navbar-collapse"
id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="gallery.html">Gallery</a>
</li>
<li>
<a href="downloads.html">Downloads</a>
</li>
<li>
<a href="installation.html">Installation</a>
</li>
<li>
<a href="tutorials.html">Tutorials</a>
</li>
<li>
<a href="documentation.html">Documentation</a>
</li>
<li>
<a href="events.html">Events</a>
</li>
<li>
<a href="contribute.html">Contribute</a>
</li>
<li>
<a href="contact.html">Contact</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<!-- Page Header -->
<!-- Set your background image for this header on the line below. -->
<header class="intro-header"
style="background-image: url('img/builtinExample.png'">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="page-heading">
<h1>Topology ToolKit</h1>
<hr class="small">
<span class="subheading">Tutorials</span>
</div>
</div>
</div>
</div>
</header>
<!-- Main Content -->
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<p></p>
<iframe width="100%" height="420"
src="https://www.youtube.com/embed/CQrXCw1YJHY" frameborder="0"
allowfullscreen></iframe>
<em>Disclaimer:</em> this video tutorial uses an older version of our
software stack. Apart from updated software (as of February 2019), a
few instructions have been modified. These modifications mostly occur
when exporting a ParaView pipeline as a Catalyst Python script
(c.f. <a href="#catalyst_usecase">section 6</a>).
<h3>TTK in-situ with Catalyst</h3>
These notes describe the installation procedure of TTK for an in-situ usage with
<a href="https://www.paraview.org/in-situ/" target="new">Catalyst</a>.
In particular, this specific version of the notes describe the procedure for a
<a target="new"
href="http://releases.ubuntu.com/18.04/ubuntu-18.04.1-desktop-amd64.iso">Ubuntu
Linux 18.04.1</a> operating system.
<br>
<br>
Users of older versions of TTK or ParaView can also check the previous
version of this tutorial:
<ul>
<li> <a href="catalyst-0.9.2.html">TTK 0.9.2 in-situ with
ParaView/Catalyst 5.4.0</a> (September 2017) </li>
</ul>
<br>
Note that for an in-situ usage with Catalyst, TTK must be installed <b>twice</b>
(<b>same</b> version, 0.9.7):
<ul>
<li> In an interactive client mode, on a system dedicated to the
interactive design of the data analysis and visualization
pipeline, typically a workstation. For this purpose, see
the <a href="installation.html">main installation of TTK</a> and add
<code>PARAVIEW_USE_MPI=ON</code> at the step 5.a. </li>
<li> In a batch server mode, on a system dedicated to the actual
execution of the simulation code, typically a high-performance system.
The remainder of these notes describe the installation for this batch
server mode. </li>
</ul>
<br>
For illustration purposes, the in-situ features of TTK will be
showcased from within an existing computational fluid dynamic
simulation code, <a href="https://code-saturne.org/cms/"
target="new">Code_Saturne</a>, which already implements Catalyst
interfacing features. See the <a target="new"
href="https://www.paraview.org/files/catalyst/docs/ParaViewCatalystUsersGuide_v2.pdf">
Catalyst documentation</a> to interface your own simulation code with
Catalyst.
<p></p>
<h4><a name="catalyst_downloads">1.</a> Downloads</h4>
The in-situ usage of TTK requires the installation of several
third-party packages, <b>from source</b>:
<ul>
<li> <a target="new" href="ftp://ftp.freedesktop.org/pub/mesa/mesa-18.3.3.tar.gz">
Mesa version 18.3.3</a> (January 2019), </li>
<li> <a target="new"
href="https://www.paraview.org/paraview-downloads/download.php?submit=Download&version=v5.6&type=source&os=all&downloadFile=ParaView-v5.6.0.tar.gz">
ParaView version 5.6.0</a> (November 2018) </li>
<li> and obviously <a target="new"
href="https://codeload.github.com/topology-tool-kit/ttk/tar.gz/v0.9.7">TTK
version 0.9.7</a> (November 2018). </li>
</ul>
<p></p>
<h4><a name="catalyst_dependencies">2.</a> Installing the dependencies</h4>
Several dependencies will need to be installed in order to compile the
packages from source. Please enter the following command (omit
the <code>$</code> character) in a terminal to install them (please
see the documentation of your package manager if your operating system
is not Ubuntu Linux 18.04.1):<br>
<br>
<pre><code>$ sudo apt install build-essential cmake-curses-gui llvm \
mpich libboost-all-dev</code></pre>
<p></p>
<h4><a name="catalyst_sources">3.</a> Preparing the sources</h4>
Move the tarballs to a working directory (for instance
called <code>~/ttk/</code>) and decompress them by entering the
following commands in a terminal (this assumes that you downloaded the
tarballs to the <code>~/Downloads/</code> directory):
<pre><code>
$ mkdir ~/ttk
$ mv ~/Downloads/mesa-18.3.3.tar.gz ~/ttk/
$ mv ~/Downloads/ParaView-v5.6.0.tar.gz ~/ttk/
$ mv ~/Downloads/ttk-0.9.7.tar.gz ~/ttk/
$ cd ~/ttk/
$ tar xvzf mesa-18.3.3.tar.gz
$ tar xvzf ParaView-v5.6.0.tar.gz
$ tar xvzf ttk-0.9.7.tar.gz
</code></pre>
Now , you can delete the tarballs after the source trees have been
decompressed.
<pre><code>
$ rm mesa-18.3.3.tar.gz
$ rm ParaView-v5.6.0.tar.gz
$ rm ttk-0.9.7.tar.gz
</code></pre>
<p></p>
<h4><a name="catalyst_patching">4.</a> Patching ParaView source tree</h4>
In order to enjoy the complete set of TTK features, we recommend at
this stage to patch the ParaView source tree. This step is
optional. To proceed, go to the patch directory and apply it as
follows:
<pre><code>
$ cd ~/ttk/ttk-0.9.7/paraview/patch/
$ ./patch-paraview-5.6.0.sh ~/ttk/ParaView-v5.6.0/
</code></pre>
<p></p>
<h4><a name="catalyst_installing">5.</a> Configuring, building and installing</h4>
<b>a) Mesa</b><br>
To configure Mesa’s source tree, enter the following command (for more
details about the compilation flags, see this <a target="new"
href="https://blog.kitware.com/messing-with-mesa-for-paraview-5-0vtk-7-0/">
blog entry</a>) :
<pre><code>
$ cd ~/ttk/mesa-18.3.3/
$ mkdir build
$ cd build/
$ ../configure \
--enable-opengl --disable-gles1 --disable-gles2 \
--disable-va --disable-xvmc --disable-vdpau \
--enable-shared-glapi \
--with-gallium-drivers=swrast \
--disable-dri --with-dri-drivers= \
--disable-egl --with-egl-platforms= --disable-gbm \
--disable-glx \
--disable-osmesa --enable-gallium-osmesa \
--enable-texture-float
</code></pre>
Now you can start the compilation process by entering the following
command, where <code><N></code> is the number of available cores
on your system:
<pre><code>$ make -j<N></code></pre>
Once the build is finished, enter the following command to install
your build of ParaView on your system:
<pre><code>$ sudo make install</code></pre>
<b>b) ParaView</b><br>
To configure ParaView's build and generate build commands, enter the
following commands:
<pre><code>
$ cd ~/ttk/ParaView-v5.6.0/
$ mkdir build
$ cd build/
$ cmake \
-DCMAKE_BUILD_TYPE=Release \
-DPARAVIEW_INSTALL_DEVELOPMENT_FILES=ON \
-DPARAVIEW_ENABLE_PYTHON=ON \
-DVTK_PYTHON_VERSION=3 \
-DPARAVIEW_BUILD_QT_GUI=OFF \
-DPARAVIEW_USE_MPI=ON \
-DPARAVIEW_ENABLE_CATALYST=ON \
-DVTK_USE_X=OFF \
-DVTK_OPENGL_HAS_OSMESA=ON \
-DVTK_USE_OFFSCREEN=OFF \
-DOSMESA_INCLUDE_DIR=/usr/local/include \
-DOSMESA_LIBRARY=/usr/local/lib/libOSMesa.so \
-DPYTHON_INCLUDE_DIR=/usr/include/python3.6 \
-DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.6m.so \
..
</code></pre>
The previous <code>cmake</code> options are either required by TTK or
used to enable in-situ computation for ParaView. (for further details,
see this <a target="new"
href="https://www.paraview.org/Wiki/ParaView/ParaView_And_Mesa_3D#Configuring_ParaView_for_use_with_OSMesa">documentation</a>).
Now you can start the compilation process by entering the following
command, where <code><N></code> is the number of available cores
on your system (this will take a LONG time):
<pre><code>$ make -j<N></code></pre>
Once the build is finished, enter the following command to install
your build of ParaView on your system:
<pre><code>$ sudo make install</code></pre>
<b><a name="catalyst_ttk_cmake">c) TTK</a></b><br>
To enter the configuration menu of TTK's build, enter the following
commands:
<pre><code>
$ cd ~/ttk/ttk-0.9.7/
$ mkdir build
$ cd build/
$ cmake \
-DCMAKE_PREFIX_PATH=/usr/local/lib/cmake/paraview-5.6 \
..
</code></pre>
At this stage, under Linux, TTK's build should be automatically and
correctly configured, and generate build commands directly. Once the
generation is completed, start the compilation process by entering the
following command, where <code><N></code> is the number of
available cores on your system (this will take a LONG time):
<pre><code>$ make -j<N></code></pre>
If the build process exhausts your system memory, reduce the number of
cores used with a lower <code><N></code>.
<br><br>
Once the build is finished, enter the following command to install
your build of TTK on your system:
<pre><code>$ sudo make install</code></pre>
<p></p>
<h4><a name="catalyst_usecase">6.</a> A computational fluid dynamics use-case: Code_Saturne</h4>
In the remainder of this tutorial, we will switch to a concrete
use-case of in-situ usage of TTK with Catalyst. For this, we will
focus on a computational fluid dynamics simulation code, Code_Saturne,
which already implements interfacing features with Catalyst.<br>
<br>
In particular, we will go through the following steps:
<ol>
<li> install all the required software packages [client and server] </li>
<li> generate a first representative data set with Code_Saturne [client] </li>
<li> create an analysis and visualization pipeline for the
representative data set with TTK [client] </li>
<li> export the analysis and visualization pipeline with Catalyst [client] </li>
<li> integrate the Catalyst/TTK script into Code_Saturne [client, then server] </li>
</ol>
<b>a) Downloads (both systems, client and server)</b><br>
The Code_Saturne source tree (version 5.0.9, released in September
2018) can be downloaded <a target="new"
href="https://code-saturne.org/cms/sites/default/files/releases/code_saturne-5.0.9.tar.gz">here</a>.
<br>
The Code_Saturne tutorial example that we will use in the remainder
can be downloaded <a target="new"
href="https://code-saturne.org/cms/sites/default/files/file_attach/Tutorial/version-5.0/01_simple_junction.pdf">there</a>.
<br>
<br>
<b>b) Installing the dependencies (both systems, client and server)</b><br>
Several dependencies will need to be installed in order to compile the
packages from source. Please enter the following command (omit
the <code>$</code> character) in a terminal to install them (please
see the documentation of your package manager if your operating system
is not Ubuntu Linux):
<pre><code>$ sudo apt install pyqt5-dev-tools libxml2-dev</code></pre>
<b>c) Preparing the sources (both systems, client and server)</b><br>
Move the tarballs to a working directory (for instance
called <code>~/ttk/</code>) and decompress them by entering the
following commands in a terminal (this assumes that you downloaded the
tarballs to the <code>~/Downloads/</code> directory):
<pre><code>
$ mv ~/Downloads/code_saturne-5.0.9.tar.gz ~/ttk/
$ cd ~/ttk/
$ tar xvzf code_saturne-5.0.9.tar.gz
$ rm code_saturne-5.0.9.tar.gz
</code></pre>
<b>d) Configuring, building and installing Code_Saturne (both systems, client and server)</b><br>
To configure Code_Saturne’s source tree, enter the following
commands:
<pre><code>
$ cd ~/ttk/code_saturne-5.0.9/
$ mkdir build
$ cd build/
$ PYTHON=/usr/bin/python3 \
../configure \
--with-catalyst=/usr/local \
--disable-catalyst-as-plugin
</code></pre>
Now you can start the compilation process by entering the following
command, where <code><N></code> is the number of available cores
on your system (this will take a LONG time):
<pre><code>$ make -j<N></code></pre>
Once the build is finished, enter the following command to install
your build of Code_Saturne on your system:
<pre><code>$ sudo make install</code></pre>
<b>e) Post-installation configuration (both systems, client and server)</b><br>
Once Code_Saturne is installed, use the following command to set
environment variables in the <code>~/.bashrc</code> configuration file:
<pre><code>
$ cat >> ~/.bashrc <<"EOF"
# ParaView Catalyst environnment variables
# (ParaView version 5.6)
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/lib/paraview-5.6:$LD_LIBRARY_PATH
EOF
</code></pre>
And to apply these modifications on the current shell, enter:
<pre><code>$ source ~/.bashrc</code></pre>
<b>f) Creating the representative Code_Saturne data set (client system)</b><br>
Now, following the <a target="new"
href="https://code-saturne.org/cms/sites/default/files/file_attach/Tutorial/version-5.0/01_simple_junction.pdf">Code_Saturne
tutorial example</a>, we will prepare the computation
directories.Create the study <code>simple_junction</code> and the
calculation directory <code>case1</code> by entering the commands:
<pre><code>
$ cd ~/ttk/
$ code_saturne create -s simple_junction -c case1
</code></pre>
More details on how to change the parameters of the study can be found
in the tutorial. In the following, we will use the pre-configured
study located in Code_Saturne source
files <code>~/ttk/code_saturne-5.0.9/examples/simple_junction/</code>
and launch the simulation.
<pre><code>
$ cp ~/ttk/code_saturne-5.0.9/examples/1-simple_junction/case1/case1.xml \
~/ttk/simple_junction/case1/DATA/
$ cp ~/ttk/code_saturne-5.0.9/examples/1-simple_junction/mesh/downcomer.des \
~/ttk/simple_junction/MESH/
$ cd ~/ttk/simple_junction/case1/
$ code_saturne run --param case1.xml
</code></pre>
Once this step is finished, a representative Code_Saturne data set is
generated. We will use this data set next to design our analysis and
visualization pipeline with TTK.<br> To visualize the representative
data set, open in ParaView the file <code>RESULTS_ENSIGHT.case</code>
in the
directory <code>~/ttk/simple_junction/case1/RESU/<date-time>/postprocessing/</code><br>
<br>
<b>g) Generating the Catalyst script (client system)</b><br>
We will describe here the general procedure to generate automatically
a ParaView Catalyst pipeline, applied to a simple junction testcase.
<br>
<br>
The first step is to start the interactive ParaView <b>on the client
system</b> (typically a workstation). In order to create an analysis
and visualization pipeline, we provide a ParaView state file that
reproduces the first default built-in example of TTK (critical points,
warped view, persistence curve and persistence diagram). Download it
<a href="stuff/paraview_pipeline.pvsm">here</a>. In ParaView, click on
the <code>Load State…</code> entry in the <code>File</code>
menu. Select <code>Choose Files Names</code> in the drop-down menu,
then modify the <code>Case File Name</code> to match the location of
the file <code>RESULTS_ENSIGHT.case</code>. Click on
the <code>OK</code> button to confirm.<br>
<br>
<div class=caption>
<a href="img/paraview_load_state.png">
<img width="70%" src="img/paraview_load_state.png">
</a>
</div>
<br>
ParaView will apply the visualization pipeline on the dataset and you
should obtain something similar to the screenshot below:<br>
<br>
<div class=caption>
<a href="img/paraview_pipeline.png">
<img width="100%" src="img/paraview_pipeline.png">
</a>
</div>
<br>
Once the full pipeline has been created, a Python script must be
exported from ParaView. This is done by choosing the <code>Generate
Script -deprecated</code> entry in the <code>Catalyst</code> menu.
Exporting Catalyst scripts should be done in a different way in newer
versions of ParaView, but some options are only available by using this
deprecated way.<br>
<br>
In the form, you must first select the sources (i.e. pipeline objects
without any input connections, in this example:
<code>RESULTS_ENSIGHT.case</code>) by <code>Add</code>ing them to the
right column, before confirming by using <code>Next</code>.
<br>
In the next page, the simulation name should be rename
from <code>RESULTS_ENSIGHT.case</code> to <code>input</code>. This
particular name is expected by Code_Saturne to correctly call any
ParaView pipeline. Double-click on the text field to modify it.<br>
<br>
<div class="caption">
<a href="img/paraview_export0.png">
<img class="flex-item" src="img/paraview_export0.png">
</a>
</div><br>
The next page in the wizard offers several rendering options, select
<code>Output rendering components i.e. views</code>, you will be able
to modify a few other options such as the type and the name of the
output images or the write frequency, etc.
<br>
You can iterate through the rendering views with the
buttons <code>Previous View</code> and <code>Next View</code>.
<pre><code>
Image Type: png
Write Frequency: 1
Magnification: 1
</code></pre>
For the rendering views, use the following parameters (screenshot below):<br>
<br>
<div class="flex-container">
<a href="img/paraview_export1.png">
<img class="flex-item" src="img/paraview_export1.png">
</a>
<a href="img/paraview_export2.png">
<img class="flex-item" src="img/paraview_export2.png">
</a>
</div><br>
For the rendering views of the persistence diagram and curve, check also the parameter
<code>Fit the Screen</code> as shown by the images below:<br>
<br>
<div class="flex-container">
<a href="img/paraview_export3.png">
<img class="flex-item" src="img/paraview_export3.png">
</a>
<a href="img/paraview_export4.png">
<img class="flex-item" src="img/paraview_export4.png">
</a>
</div><br>
The persistence diagram itself is configured to be written every 10
time-steps in the <code>Properties</code> panel of
the <code>ParallelUnstructuredGridWriter1</code> filter in the
pipeline (screenshot below).<br>
<br>
<div class="caption">
<a href="img/paraview_parallel_writer.png">
<img width="60%" src="img/paraview_parallel_writer.png">
</a>
</div>
<br>
Finally, click on the <code>Finish</code> button to create the Python script and name it
<b>ttk_pipeline.py</b>.<br>
<br>
<b>h) Patching the Catalyst script (client system)</b><br>
To automatically load the TTK plugins, add these lines of code
just <em>below</em> the two Python
<code>from paraview[] import []</code> lines in the pre-configured
script <code>ttk_pipeline.py</code> like in the image below:
<pre><code>
# --------------------------------------------------------------
# The following loads TTK's plugins.
# Topology Toolkit 0.9.7
# --------------------------------------------------------------
import glob
import os
from os.path import join as ttk_path_join
ttk_plugins_path = "/usr/local/lib/plugins/"
for x in glob.glob(
ttk_path_join(ttk_plugins_path, "*.so" if os.name == "posix" else "*.dll")
):
LoadPlugin(x, ns=globals())
</code></pre>
<div class=caption>
<a href="img/catalyst_script_patch.png">
<img width="90%" src="img/catalyst_script_patch.png">
</a>
</div>
<br>
Note that <code>/usr/local/lib/plugins/</code> is the default location
where TTK plugins are installed.<br>
<br>
<b>i) Integrating the Catalyst script in the Code_Saturne project (client system)</b><br>
To configure the project to use Catalyst and execute the script
in-situ, enter the commands:
<pre><code>
$ cd ~/ttk/simple_junction/case1/DATA/
$ ./SaturneGUI case1.xml
</code></pre>
The study configuration tool of Code_Saturne opens. In the left panel,
click on <code>Calculation control</code> then in the drop-down menu
on <code>Output control</code>. This will update the central part of
the window and show the options related to the generation of the
results. Select the <code>Writer</code> tab and click on
the <code>+</code> button at the bottom to add a new writer
module. Configure the writer module with the following parameters (as
shown by the screenshot image below):
<pre><code>
Name: ttk_pipeline
Id: 1
Format: Catalyst
Directory: postprocessing
</code></pre>
Then modify the writing frequency to suit your needs, here is an example:
<pre><code>
Frequency:
· Output every ‘n’ time steps
· 1
· Output at end of calculation
</code></pre>
<div class=caption>
<a href="img/code_saturne_writer.png">
<img width="100%" src="img/code_saturne_writer.png">
</a>
</div>
<br>
Now to associate the Catalyst writer with the mesh, click on
the <code>Mesh</code> tab and select the mesh part named Fluid
domain. Then click on the <code>+</code> button in the
section <code>Associated writers</code>, normally ttk_pipeline will
appear as the new one. You should obtain something like the screenshot
image below:<br>
<br>
<div class=caption>
<a href="img/code_saturne_mesh.png">
<img width="100%" src="img/code_saturne_mesh.png">
</a>
</div>
<br>
If you want more details about the configuration of a Code_Saturne
study with Catalyst, you can follow this <a target="new"
href="https://www.youtube.com/watch?v=G-D0SbORutU&feature=youtu.be">video
tutorial</a>.<br>
<br>
Finally, save the parameters by clicking on the <code>Save</code>
entry in the <code>File</code> menu.<br>
<br>
<b>j) Running TTK in-situ (server system)</b><br>
In the following, we describe how to configure a Code_Saturne /
Catalyst project on the server side. Alternatively, jump to
this <a href="#catalyst_package">paragraph</a> to directly download a
preconfigured mirror package.<br>
<br>
First, create a “mirror” project on the server system with the
commands:
<pre><code>
$ cd ~/ttk/
$ code_saturne create -s simple_junction -c case1
</code></pre>
Now, copy the Catalyst script <code>ttk_pipeline.py</code> (section
6.f) and the parameters file <code>case1.xml</code> from the client
system (see the
directory <code>~/ttk/simple_junction/case1/DATA/</code>) to
the <b>same</b> mirror directory on the server system (same absolute
path). Copy also the mesh <code>downcomer.des</code> located
in <code>~/ttk/simple_junction/MESH/</code> the same way. Here, please
choose the appropriate transfer method between your client and server
systems based on the nature of their connection (for instance, on a
TCP/IP network, the command scp may be recommended).<br>
<br>
<a name="catalyst_package">Alternatively</a>, you can also simply
download the
following <a href="stuff/simple_junction.tar.gz">tarball</a>, which
already contains a mirror of the client’s project. To decompress this
tarball, enter the following commands (this assumes that you
downloaded the tarballs to the <code>~/Downloads/</code> directory):
<pre><code>
$ mv ~/Downloads/simple_junction.tar.gz ~/ttk/
$ cd ~/ttk/
$ tar xvzf simple_junction.tar.gz
$ rm simple_junction.tar.gz
</code></pre>
You are now ready to run your Code_Saturne simulation with an in-situ
usage of TTK. For this, enter the following commands:
<pre><code>
$ cd ~/ttk/simple_junction/case1/
$ code_saturne run --param case1.xml
</code></pre>
<b>k) In-situ outputs (on the server system)</b><br>
The calculation results are stored
in <code>~/ttk/simple_junction/case1/RESU/<date-time>/</code><br>
<br>
Once the simulation has finished, you should have a sequence of image
files (*.png), for each view configured in the Catalyst script, as
well as persistence diagrams (*.vtu), computed every 10 iterations.
To generate videos out of these image sequences, please see
the <a target="new" href="https://ffmpeg.org/"> ffmpeg</a>
documentation.<br>
<br>
<div class="flex-container">
<iframe width="100%" height="420" src="https://www.youtube.com/embed/97xpyJRVQtg"
frameborder="0" allowfullscreen></iframe>
<iframe width="100%" height="420" src="https://www.youtube.com/embed/5fdK_rcPERI"
frameborder="0" allowfullscreen></iframe>
</div>
<div class="flex-container">
<iframe width="100%" height="420" src="https://www.youtube.com/embed/qfDhN60AxGo"
frameborder="0" allowfullscreen></iframe>
<iframe width="100%" height="420" src="https://www.youtube.com/embed/B3UYuejmOvs"
frameborder="0" allowfullscreen></iframe>
</div>
<p></p>
</div>
</div>
</div>
<hr>
<!-- Footer -->
<footer>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<p class="copyright text-muted">
Contact: <a href="mailto:[email protected]">
[email protected]</a><br>
Updated on February 11, 2019.</p>
</div>
</div>
</div>
</footer>
<!-- jQuery -->
<script src="vendor/jquery/jquery.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<!-- Contact Form JavaScript -->
<script src="js/jqBootstrapValidation.js"></script>
<script src="js/contact_me.js"></script>
<!-- Theme JavaScript -->
<script src="js/clean-blog.min.js"></script>
</body>
</html>