Skip to content

Persistent Generators DarkSky

Persistent Generators DarkSky example Image

Pipeline description

This example computes the most persistent one-dimensional generators of the opposite of the density of dark matter in an astrophysics simulation. These generators characterize prominent loops in the cosmic web.

The data is originally a point cloud. It is processed into a scalar field defined on a regular grid using Gaussian resampling.

Generators are then computed using PersistentGenerators, and thresholded in order to keep the most persistent ones..

For context, the one-dimensional separatrices of the MorseSmale complex are computed using MorseSmaleComplex after some topological simplification using TopologicalSimplificationand shown in the ParaView example.

The python script simply computes the most persistent generators and saves the result as a .vtu file.

ParaView

To reproduce the above screenshot, go to your ttk-data directory and enter the following command:

paraview states/persistentGenerators_darkSky.pvsm

Python code

 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
#!/usr/bin/env python

from paraview.simple import *

# create a new 'XML PolyData Reader'
ds14_scivis_0128_e4_dt04_06800vtp = XMLPolyDataReader(
    FileName=["ds14_scivis_0128_e4_dt04_1.0000.vtp"]
)

# create a new 'Gaussian Resampling'
gaussianResampling1 = GaussianResampling(Input=ds14_scivis_0128_e4_dt04_06800vtp)
gaussianResampling1.ResampleField = ["POINTS", "DarkMatter_Phi"]
gaussianResampling1.ResamplingGrid = [200, 200, 200]
gaussianResampling1.GaussianSplatRadius = 0.008
gaussianResampling1.ScaleSplats = 0
gaussianResampling1.EllipticalSplats = 0
gaussianResampling1.FillVolumeBoundary = 0

# create a new 'TTK ScalarFieldSmoother'
tTKScalarFieldSmoother1 = TTKScalarFieldSmoother(Input=gaussianResampling1)
tTKScalarFieldSmoother1.ScalarField = ["POINTS", "SplatterValues"]
tTKScalarFieldSmoother1.IterationNumber = 7

# create a new 'Calculator'
calculator1 = Calculator(Input=tTKScalarFieldSmoother1)
calculator1.ResultArrayName = "SplatterValues"
calculator1.Function = "-SplatterValues"

# create a new 'TTK PersistentGenerators'
tTKPersistentGenerators1 = TTKPersistentGenerators(Input=calculator1)
tTKPersistentGenerators1.ScalarField = ["POINTS", "SplatterValues"]

# create a new 'Threshold'
threshold1 = Threshold(Input=tTKPersistentGenerators1)
threshold1.Scalars = ["CELLS", "Persistence"]
threshold1.LowerThreshold = 0.24
threshold1.UpperThreshold = 0.2863966089734687

SaveData("PersistentGeneratorsDarkSky.vtu", threshold1)

To run the above Python script, go to your ttk-data directory and enter the following command:

pvpython python/persistentGenerators_darkSky.py

Inputs

Outputs

  • PersistentGeneratorsDarkSky.vtu: the raw one-dimensional most persistent generators of the field.

C++/Python API

MorseSmaleComplex

PersistentGenerators

ScalarFieldSmoother