simulation_writer
SimulationWriter
The SimulationWriter is the writer object for a single simulation. It inherits all reading methods from :class:`Simulation`.
SimulationWriter (
uid: str,
path: str,
comm: mpi4py.MPI.Comm = <mpi4py.MPI.Intracomm object>
)
- uid :
<class 'str'>
The identifier of the simulation
- path :
<class 'str'>
The (parent) database path
- comm :
<class 'mpi4py.MPI.Comm'>
An MPI communicator (Default: `MPI.COMM_WORLD`)
- bamboost.simulation.Simulation
uid
path_database
path
h5file
xdmffile
meshes
data
userdata
links
fromUID
__getitem__
parameters
metadata
files
show_files
open_in_file_explorer
get_full_uid
change_status
update_metadata
update_parameters
create_xdmf_file
create_batch_script
submit
change_note
open
mesh
get_mesh
globals
data_info
git
get_data_interpolator
show_h5tree
- step :
: int
initialize
initialize (self) -> bamboost.simulation_writer.SimulationWriter
Create a new file for this simlation. This deletes an existing h5 file of the simulation and creates an empty new one
- self :
Any
add_metadata
add_metadata (self) -> None
Add metadata to h5 file.
- self :
Any
None
add_parameters
add_parameters (self, parameters: dict) -> None
Add parameters to simulation.
- self :
Any
- parameters :
<class 'dict'>
Dictionary with parameters.
None
add_mesh
add_mesh (
self,
coordinates: numpy.ndarray,
connectivity: numpy.ndarray,
mesh_name: str = None
) -> None
Add the mesh to file. Currently only 2d meshes.
- self :
Any
- coordinates :
<class 'numpy.ndarray'>
Coordinates as array (nb_nodes, dim)
- connectivity :
<class 'numpy.ndarray'>
Connectivity matrix (nb_cells, nb nodes per cell)
- mesh_name :
<class 'str'>
name for mesh (default = `mesh`)
None
add_field
add_field (
self,
name: str,
vector: <built-in function array>,
time: float = None,
mesh: str = None,
dtype: str = None
) -> None
Add a dataset to the file. The data is stored at `data/`.
- self :
Any
- name :
<class 'str'>
Name for the dataset
- vector :
<built-in function array>
Dataset
- time :
<class 'float'>
Optional. time
- mesh :
<class 'str'>
Optional. Linked mesh for this data
- dtype :
<class 'str'>
Optional. Numpy style datatype, see h5py documentation, defaults to the dtype of
None
add_global_field
add_global_field (self, name: str, value: Union[float, int], dtype: str = None) -> None
Add a gobal field. These are stored at `globals/` as an array in a single dataset.
- self :
Any
- name :
<class 'str'>
Name for the data
- value :
typing.Union[float, int]
Data
- dtype :
<class 'str'>
None
add_additional
add_additional (self, name: str, file: str) -> None
Add an additional file stored elsewhere or in database directory.
- self :
Any
- name :
<class 'str'>
Name of data
- file :
<class 'str'>
filename of file
None
finish_step
finish_step (self) -> None
Finish step. Adds 1 to the step counter.
- self :
Any
None
finish_sim
finish_sim (self, status: str = 'Finished') -> None
None
- self :
Any
- status :
<class 'str'>
None
register_git_attributes
register_git_attributes (self, repo_path: str = './') -> None
Register git information for given repo.
- self :
Any
- repo_path :
<class 'str'>
path to git repository
None
copy_executable
copy_executable (self, script_path: str) -> None
WILL BE REMOVED. USE COPY_FILE. Copy an executable to directory for reproducability.
- self :
Any
- script_path :
<class 'str'>
path to script
None
copy_file
copy_file (self, source: Union[str, list], destination: str = '') -> None
Copy a file to the datafolder.
- self :
Any
- source :
typing.Union[str, list]
path to file, or list of files
- destination :
<class 'str'>
destination (will create intermediatory directories)
None