Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

swh:1:snp:5c760c247cec42eef2064c5ff8a2fde4e71dfb7a
  • Code
  • Branches (1)
  • Releases (1)
    • Branches
    • Releases
    • HEAD
    • refs/heads/main
    • v1.0.0
  • 60be01a
  • /
  • docs
  • /
  • scripts
  • /
  • separation_boundaries.py
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
content badge
swh:1:cnt:19dcb46315a822edbaf1eb1480f810a588eee94a
directory badge
swh:1:dir:08ef0cf7b60fda093cbbc11510ff1ce9206202c8
revision badge
swh:1:rev:e0203c82702b3dce63effdda1606d58181e829a0
snapshot badge
swh:1:snp:5c760c247cec42eef2064c5ff8a2fde4e71dfb7a

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: e0203c82702b3dce63effdda1606d58181e829a0 authored by Moritz Heinemann on 12 November 2024, 19:30:39 UTC
VofFlow 1.0
Tip revision: e0203c8
separation_boundaries.py
import os
from paraview.simple import *

# Config
dataset = '~/vofflow/data/jet-collision-ds2/jet-collision-ds2.pvd'
plugin_path = '~/vofflow/install/lib/paraview-5.12/plugins/VofFlow/VofFlow.so'
output_path = '~/vofflow/output/result'

init_timestep = 68  # The time steps used in the paper (fig. 14) are: 68, 82, 96, 110, 124, 138, 152.
ghost_cells = 10  # MPI ghost cells, use 36 for full dataset, 20 for "ds1", and 10 for "ds2".

# Load plugin
LoadPlugin(os.path.expanduser(plugin_path), ns=globals())

# Read dataset
reader = PVDReader(registrationName='dataset', FileName=os.path.expanduser(dataset))
reader.CellArrays = ['vof-function[-]', 'velocity[cm/s]', 'f3-function[-]', 'n_c_3ph[1]']
time_steps = reader.TimestepValues

# Configure VofTracking
vofTracking1 = VofTracking(registrationName='VofTracking1', InputGrid=reader)
vofTracking1.UseThreePhase = 1
vofTracking1.VoF = ['CELLS', 'vof-function[-]']
vofTracking1.VoF3 = ['CELLS', 'f3-function[-]']
vofTracking1.VoFNorm = ['CELLS', 'n_c_3ph[1]']
vofTracking1.Velocity = ['CELLS', 'velocity[cm/s]']
vofTracking1.UseComponents = 0
vofTracking1.ComponentsVoF = ['CELLS', 'None']
vofTracking1.ComponentsVoF3 = ['CELLS', 'None']
vofTracking1.UseTargetTimeStep = 1
vofTracking1.InitTimeStep = init_timestep
vofTracking1.TargetTimeStep = 152
vofTracking1.Refinement = 2
vofTracking1.NeighborCorrection = 1
vofTracking1.CellCorrection = 1
vofTracking1.PLICCorrection = 1
vofTracking1.IntegrationMethod = 'RK4'  # 'Euler'
vofTracking1.IntegrationSubSteps = 8
vofTracking1.Epsilon = 1e-05
vofTracking1.NumIterations = 15
vofTracking1.GhostCells = ghost_cells
vofTracking1.CutLabels = 0
vofTracking1.LabelCutType = 'Plane'
vofTracking1.BoundaryMethod = 'DiscreteFlyingEdges3D'  # 'DiscreteMarchingCubes'
vofTracking1.OutputDataType = 'vtkImageData'  # 'vtkRectilinearGrid'
vofTracking1.OutputState = 1
vofTracking1.OutputTimeMeasure = 1
vofTracking1.MirrorXMin = 0
vofTracking1.MirrorXMax = 0
vofTracking1.MirrorYMin = 0
vofTracking1.MirrorYMax = 0
vofTracking1.MirrorZMin = 1
vofTracking1.MirrorZMax = 0

# Check output dir
output_path = os.path.expanduser(output_path)
os.makedirs(output_path, exist_ok=True)

# Save output
SaveData(os.path.join(output_path, 'grid.pvd'), proxy=OutputPort(vofTracking1, 0), CompressorType='ZLib', CompressionLevel='1')
SaveData(os.path.join(output_path, 'seeds.pvd'), proxy=OutputPort(vofTracking1, 1), CompressorType='ZLib', CompressionLevel='1')
SaveData(os.path.join(output_path, 'part.pvd'), proxy=OutputPort(vofTracking1, 2), CompressorType='ZLib', CompressionLevel='1')
SaveData(os.path.join(output_path, 'bound.pvd'), proxy=OutputPort(vofTracking1, 3), CompressorType='ZLib', CompressionLevel='1')

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API