Celeritas 0.7+28f01d9
Loading...
Searching...
No Matches
Functions
VolumeParamsIO.json.hh File Reference
#include <iosfwd>
#include <nlohmann/json.hpp>
#include "geocel/inp/Model.hh"
#include "VolumeParams.hh"

Functions

void celeritas::to_json (nlohmann::json &j, VolumeParams const &vp)
 Write volume hierarchy data to JSON.
 
std::ostream & celeritas::operator<< (std::ostream &os, VolumeParams const &vp)
 

Function Documentation

◆ to_json()

void celeritas::to_json ( nlohmann::json &  j,
VolumeParams const vp 
)

Write volume hierarchy data to JSON.

The output object has:

  • volumes : array of volume labels (indexed by VolumeId)
  • volume_instances : array of volume instance labels (indexed by VolumeInstanceId)
  • world : integer VolumeId of the root, or null if empty
  • children : array of arrays; children[v] lists the VolumeInstanceId integers of the direct children placed inside volume v
  • instance_to_volume : array; instance_to_volume[vi] is the integer VolumeId that instance vi instantiates, or null if vi is a null instance