![]() |
Peano
|
Reads in particle fields from a single .vtu file, or all .vtu at a given snapshot time specified in the provided .pvd file. More...
Public Member Functions | |
__init__ (self, Union[str, None] vtufile=None, Union[float, None] snapshot_time=None, Union[str, None] pvdfile=None, bool verbose=False) | |
At initialization, either the vtufile argument needs to be provided, or both the snapshot_time and pvdfile arguments in order to specify what data to read. | |
load (self) | |
Actually read in the data. | |
get_snapshot_time (self) | |
Return the time/timestep information of the read snapshot. | |
get_all_vtufiles (self) | |
Read in and return all .vtu file names from the .pvd file provided by pvdfilename at initialisation. | |
read_single_vtu_file (self, str vtufilename) | |
Read in particle data from a single .vtu file, and return the filled out VTUParticleSet object containing the particle data. | |
Protected Member Functions | |
_get_full_vtufile_path (self, str vtufile) | |
The .pvd file will provide relative path names to its own file path for the .vtu files. | |
_get_snapshot_vtu_files_from_pvd (self, str pvdfilename, float time) | |
Read in data from the .pvd file provided by pvdfilename. | |
Protected Attributes | |
_verbose | |
_mode | |
_vtufile | |
_pvdfile | |
_snapshot_time | |
_read_time | |
_snapshot_time_read | |
Reads in particle fields from a single .vtu file, or all .vtu at a given snapshot time specified in the provided .pvd file.
get_all_vtufiles(self): Read in and return all .vtu file names from the .pvd file provided by pvdfilename at initialisation.
load(self): actually read in the data, and return the particle data as a VTUParticleSet object.
read_single_vtu_file(self, vtufilename: str): Read in particle data from a single .vtu file, and return the filled out VTUParticleSet object containing the particle data.
Definition at line 137 of file ParticleVTUReader.py.
peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader.__init__ | ( | self, | |
Union[str, None] | vtufile = None, | ||
Union[float, None] | snapshot_time = None, | ||
Union[str, None] | pvdfile = None, | ||
bool | verbose = False ) |
At initialization, either the vtufile
argument needs to be provided, or both the snapshot_time
and pvdfile
arguments in order to specify what data to read.
If vtufile
is given, the ParticleVTUReader will read in a single .vtu file.
If snapshot_time
and pvdfile
arguments are given, the ParticleVTUReader will read in all .vtu files corresponding to the snapshot at the provided snapshot_time
.
vtufile: str path to .vtu file to be read in
snapshot_time: float time of the snapshot to extract
pvdfile: str path to .pvd file to be read in
verbose: bool how talkative the reading process should be
Definition at line 159 of file ParticleVTUReader.py.
|
protected |
The .pvd file will provide relative path names to its own file path for the .vtu files.
This function returns the full path of the .vtu file.
Definition at line 299 of file ParticleVTUReader.py.
References peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader._pvdfile.
Referenced by peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader.get_all_vtufiles(), and peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader.load().
|
protected |
Read in data from the .pvd file provided by pvdfilename.
pvdfilename: str filename to read in from
time: float snapshot time to read in
vtufilenames: list list of .vtu filenames to read from
Definition at line 317 of file ParticleVTUReader.py.
References peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader._read_time, peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader._snapshot_time, peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader._snapshot_time_read, and peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader._verbose.
Referenced by peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader.load().
peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader.get_all_vtufiles | ( | self | ) |
Read in and return all .vtu file names from the .pvd file provided by pvdfilename at initialisation.
vtufilenames: list list of .vtu filenames in the .pvd file, with their full path.
Definition at line 271 of file ParticleVTUReader.py.
References peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader._get_full_vtufile_path(), and peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader._pvdfile.
peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader.get_snapshot_time | ( | self | ) |
Return the time/timestep information of the read snapshot.
This is only available if you read in the .pvd file, not the .vtu file. If the .vtu file has been read, this method returns None
. Otherwise, it returns the time of the snapshot, which may vary (slightly) from the snapshot time you specified with when loading the data.
Definition at line 256 of file ParticleVTUReader.py.
References peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader._read_time, and peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader._snapshot_time_read.
peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader.load | ( | self | ) |
Actually read in the data.
particleData: VTUParticleSet object containing all read-in particle data as attributes.
Definition at line 223 of file ParticleVTUReader.py.
References peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader._get_full_vtufile_path(), peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader._get_snapshot_vtu_files_from_pvd(), peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader._mode, exahype2::LoadBalancingConfiguration._mode, peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader._pvdfile, peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader._snapshot_time, peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader._vtufile, and peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader.read_single_vtu_file().
peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader.read_single_vtu_file | ( | self, | |
str | vtufilename ) |
Read in particle data from a single .vtu file, and return the filled out VTUParticleSet object containing the particle data.
vtufilename: str .vtu filename to read in from.
particleData: VTUParticleSet object containing all read-in particle data as attributes.
Definition at line 396 of file ParticleVTUReader.py.
References peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader._verbose.
Referenced by peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader.load().
|
protected |
Definition at line 196 of file ParticleVTUReader.py.
Referenced by peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader.load().
|
protected |
Definition at line 198 of file ParticleVTUReader.py.
Referenced by peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader._get_full_vtufile_path(), peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader.get_all_vtufiles(), and peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader.load().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Definition at line 197 of file ParticleVTUReader.py.
Referenced by peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader.load().