Skip to content

Cosmic Web

Cosmic Web example Image

Pipeline description

This example computes the so-called cosmic web from a particle dataset (top left inset) modeling dark matter density in large-scale universe formation cosmological simulations. The dataset has been provided by the SciVis contest 2015.

First, a density estimation (with Gaussian kernels) is computed with the filter GaussianResampling, with a modest resolution (64^3, increase for improved details).

Second, the resulting density is slightly smoothed with the filter ScalarFieldSmoother (only 1 iteration).

Third, the density is normalized (in between 0 and 1) with the filter ScalarFieldNormalizer to facilitate the subsequent processing steps.

Next, the data undergoes a first step of simplification with the filter TopologicalSimplificationByPersistence, to remove the least significant extrema (involved in a persistence pair with a persistence smaller than 0.3).

Then, the MorseSmaleComplex is computed and saddle-saddle pairs with a persistence smaller than 0.3 are also simplified.

Finally the geometry of the 1-separatrices and the 2-separatrices are slightly smoothed with the filter GeometrySmoother (10 iterations each). The resulting 1-separatrices are shown before simplification in the top-right inset and after simplification in the bottom-left inset. The bottom-right inset shows the 2-separatrices.

By adjusting the persistence simplification threshold, for the extrema in the filter TopologicalSimplificationByPersistence, for the saddle-saddle pairs in the filter MorseSmaleComplex, the user can explore the patterns of the cosmic web at multiple scales of topological importance.

ParaView

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

paraview states/cosmicWeb.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env python

#### import the simple module from the paraview
from paraview.simple import *

# ----------------------------------------------------------------
# setup the data processing pipelines
# ----------------------------------------------------------------

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

# create a new 'Gaussian Resampling'
gaussianResampling1 = GaussianResampling(Input=ds14_scivis_0128_e4_dt04_10000vtp)
gaussianResampling1.ResampleField = ["POINTS", "DarkMatter_Phi"]
gaussianResampling1.ResamplingGrid = [64, 64, 64]
gaussianResampling1.SplatAccumulationMode = "Max"
gaussianResampling1.GaussianSplatRadius = 0.0125
gaussianResampling1.ScaleSplats = 0

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

# create a new 'TTK ScalarFieldNormalizer'
tTKScalarFieldNormalizer1 = TTKScalarFieldNormalizer(Input=tTKScalarFieldSmoother1)
tTKScalarFieldNormalizer1.ScalarField = ["POINTS", "SplatterValues"]

# create a new 'TTK TopologicalSimplificationByPersistence'
tTKTopologicalSimplificationByPersistence1 = TTKTopologicalSimplificationByPersistence(
    Input=tTKScalarFieldNormalizer1
)
tTKTopologicalSimplificationByPersistence1.InputArray = ["POINTS", "SplatterValues"]
tTKTopologicalSimplificationByPersistence1.PersistenceThreshold = 0.3

# create a new 'TTK MorseSmaleComplex'
tTKMorseSmaleComplex1 = TTKMorseSmaleComplex(
    Input=tTKTopologicalSimplificationByPersistence1
)
tTKMorseSmaleComplex1.ScalarField = ["POINTS", "SplatterValues"]
tTKMorseSmaleComplex1.ReturnSaddleConnectors = 1
tTKMorseSmaleComplex1.SaddleConnectorsPersistenceThreshold = 0.3
tTKMorseSmaleComplex1.Forceloopfreegradient = 0

# create a new 'Threshold'
threshold3 = Threshold(Input=OutputPort(tTKMorseSmaleComplex1, 1))
threshold3.Scalars = ["CELLS", "SeparatrixType"]
threshold3.LowerThreshold = 2.0
threshold3.UpperThreshold = 2.0

# create a new 'TTK GeometrySmoother'
tTKGeometrySmoother2 = TTKGeometrySmoother(
    registrationName="TTKGeometrySmoother2", Input=threshold3
)
tTKGeometrySmoother2.IterationNumber = 10

SaveData("cosmicWeb.vtu", tTKGeometrySmoother2)

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

pvpython python/cosmicWeb.py

Inputs

Outputs

  • cosmicWeb.vtu: skeleton of the cosmic web (1D separatrices connecting 2-saddles to maxima).

C++/Python API

GeometrySmoother

IcospheresFromPoints

MorseSmaleComplex

ScalarFieldNormalizer

ScalarFieldSmoother

TopologicalSimplificationByPersistence