VTK Export API Reference

Mera does not render volumes itself. It writes VTK files, and you open those in ParaView — the narrative guides are Intro, Hydro and Particles, which cover the ParaView side: colormaps, lighting and camera work all happen there, not in Julia.

Export

Mera.export_vtkFunction

Export particle data to VTK format for visualization in tools like ParaView.

  • export data that is present in your database and can be processed by getvar() (done internally)
  • select scalar(s) and their unit(s)
  • select a vector and its unit (like velocity)
  • export data in log10
  • creates binary files with optional compression
  • supports multi-threading

-> generates VTU files; each particle is represented as a vertex point with associated scalar and vector data.

export_vtk(
    dataobject::PartDataType, outprefix::String;
    scalars::Vector{Symbol} = [:mass],
    scalars_unit::Vector{Symbol} = [:Msol],
    scalars_log10::Bool=false,
    vector::Array{<:Any,1}=[missing, missing, missing],
    vector_unit::Symbol = :km_s,
    vector_name::String = "velocity",
    vector_log10::Bool=false,
    positions_unit::Symbol = :standard,
    chunk_size::Int = 50000,
    compress::Bool = false,
    max_particles::Int = 100_000_000,
    verbose::Bool = true,
    myargs::ArgumentsType=ArgumentsType()
)

Arguments

Required:

  • **dataobject::PartDataType:*** needs to be of type "PartDataType"
  • outprefix: The base path and prefix for output file (e.g., "foldername/particles" will create "foldername/particles.vtu").

Predefined/Optional Keywords:

  • scalars: List of scalar variables to export (default is particle mass); from the database or a predefined quantity (see field: info, function getvar(), dataobject.data)
  • scalars_unit: Sets the unit for the list of scalars (default is :Msol).
  • scalars_log10: Apply log10 to the scalars (default false).
  • vector: List of vector component variables to export (default is missing).
  • vector_unit: Sets the unit for the vector components (default is km/s).
  • vector_name: The name of the vector field in the VTK file (default: "velocity").
  • vector_log10: Apply log10 to the vector components (default: false).
  • positions_unit: Sets the unit of the particle positions (default: code units); usefull in paraview to select regions
  • chunk_size::Int = 50000: Size of data chunks for processing (reserved for future optimizations).
  • compress: If false (default), disable compression.
  • max_particles: Maximum number of particles to export (caps output if exceeded), (default: 100000000)
  • verbose: If true (default), print detailed progress and diagnostic messages.

For maps you can display directly in Julia, see the Projections API and Off-axis Projection API. Mera's Makie support activates automatically once a Makie backend such as CairoMakie is loaded.


Every docstring in the package is also on the Complete API Reference.