|
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. | |
| get_snapshot_times (str pvdfilename) | |
| Read in available snapshot times from the .pvd file provided by pvdfilename. | |
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.
get_snapshot_time(self): Returns the simulation time of the read-in snapshot
get_snapshot_times(pvdfile): Returns all simulation times stored in pvd file
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 165 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 305 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 323 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, peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader._verbose, and OutputFile.OutputFile._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 277 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 262 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.get_snapshot_times | ( | str | pvdfilename | ) |
Read in available snapshot times from the .pvd file provided by pvdfilename.
pvdfilename: str filename to read in from
times: np.array np.array of available snapshot times
Definition at line 457 of file ParticleVTUReader.py.
| 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 229 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 402 of file ParticleVTUReader.py.
References peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader._verbose, and OutputFile.OutputFile._verbose.
Referenced by peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader.load().

|
protected |
Definition at line 202 of file ParticleVTUReader.py.
Referenced by peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader.load().
|
protected |
Definition at line 204 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 |
Definition at line 201 of file ParticleVTUReader.py.
Referenced by peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader._get_snapshot_vtu_files_from_pvd(), OutputFile.OutputFile.parse(), and peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader.read_single_vtu_file().
|
protected |
Definition at line 203 of file ParticleVTUReader.py.
Referenced by peano4.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader.load().