Skip to content

Write metadata to a dedicated JSON file #737

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

marcelschurer
Copy link
Contributor

@marcelschurer marcelschurer commented Mar 24, 2025

This PR adds the new function trixi2json, which exports simulation metadata to a dedicated JSON file at the start of the simulation. Previously, metadata was stored within the VTK output files. The structure and design of write_json.jl closely follow the existing implementation in write_vtk.jl for consistency.

This is what the JSON files looks like for the hydrostatic_water_comun_2d.jl example:

boundary_1_metadata.json:

{
  "state_equation": "StateEquationCole",
  "julia_version": "1.11.5",
  "boundary_model": "BoundaryModelDummyParticles",
  "density_calculator": "AdamiPressureExtrapolation",
  "viscosity_model": "Nothing",
  "solver_version": {
    "x": "v0.2.6-27-g7825eb968"
  },
  "smoothing_length": 0.06,
  "solver_name": "TrixiParticles.jl",
  "smoothing_kernel": "SchoenbergCubicSplineKernel"
}

fluid_1_metadata.json:

{
  "viscosity_alpha": 0.02,
  "smoothing_kernel": "SchoenbergCubicSplineKernel",
  "acceleration": [
    0.0,
    -9.81
  ],
  "julia_version": "1.11.5",
  "state_equation": "StateEquationCole",
  "density_calculator": "ContinuityDensity",
  "state_equation_rho0": 1000.0,
  "viscosity": "ArtificialViscosityMonaghan",
  "solver": "WCSPH",
  "viscosity_epsilon": 0.01,
  "state_equation_c": 10.0,
  "smoothing_length_factor": 0.8333333333333334,
  "correction_method": "Nothing",
  "state_equation_exponent": 7.0,
  "solver_version": {
    "x": "v0.2.6-27-g7825eb968"
  },
  "solver_name": "TrixiParticles.jl",
  "viscosity_beta": 0.0,
  "state_equation_pa": 0.0
}

Remark: Unit tests for this function will be added in a follow-up PR. In that upcoming PR, I will implement the functionality to read meta_data alongside the simulation data in read_vtk.jl.

@marcelschurer marcelschurer changed the title write2json Write metadata to a dedicated JSON file Mar 24, 2025
Copy link

codecov bot commented May 19, 2025

Codecov Report

Attention: Patch coverage is 4.71698% with 101 lines in your changes missing coverage. Please review.

Project coverage is 70.00%. Comparing base (618bba5) to head (45940d9).

Files with missing lines Patch % Lines
src/io/io.jl 0.00% 85 Missing ⚠️
src/io/write_vtk.jl 35.71% 9 Missing ⚠️
src/preprocessing/particle_packing/system.jl 0.00% 4 Missing ⚠️
src/callbacks/solution_saving.jl 0.00% 2 Missing ⚠️
src/callbacks/post_process.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #737      +/-   ##
==========================================
- Coverage   70.74%   70.00%   -0.75%     
==========================================
  Files         106      107       +1     
  Lines        6710     6750      +40     
==========================================
- Hits         4747     4725      -22     
- Misses       1963     2025      +62     
Flag Coverage Δ
unit 70.00% <4.71%> (-0.75%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LasNikas LasNikas marked this pull request as ready for review May 21, 2025 08:47
@marcelschurer marcelschurer requested a review from LasNikas June 4, 2025 07:38
@LasNikas LasNikas requested review from efaulhaber and svchb June 4, 2025 07:53
@LasNikas
Copy link
Collaborator

LasNikas commented Jun 4, 2025

/run-gpu-tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants