fedoo.ProblemDataSet.save
- ProblemDataSet.save(filename: str, save_mesh: bool = False, compressed: bool | None = None, *, fdh5_options=None) None
Save data to a file. File type is inferred from the extension of the filename.
- The available file types are:
‘fdz’: A zipped archive containing the mesh using the ‘vtk’ format named ‘_mesh_.vtk’, and data from several iterations named ‘iter_x.npz’ where x is the iteration number (x=0 for the 1st iteration).
‘vtk’: The vtk format contains the mesh and the data in a single files. The gauss points data are not included in the file. This format is efficient for a linear problem when we need only one time iteration. In case of multiple saved iterations, a directory is created and one vtk file is saved per iteration. The mesh is included in every file which is not memory efficient.
‘msh’: Format associated to gmsh. Have the same drawback as the vtk format for time depend results and missing gauss points data. The vtk format should be prefered.
‘npz’: Save data in a numpy file npz which doesn’t include the mesh. The mesh is generally saved beside in a raw vtk files without results.
‘csv’: Save DataSet that contains only one type of data (ie Node, Element or Gauss point data) in a csv file (need the library pandas installed). The mesh is not included and may be saved beside in a vtk file.
‘xlsx’: Same as csv but with the excel format.
‘fdh5’: HDF5 format for Fedoo meshes and results, including MultiMesh element and Gauss point fields.
- Parameters:
filename (str) – Name of the file including the path.
save_mesh (bool, default = False) – If True, the mesh is also saved in a vtk file using the same filename with a ‘.vtk’ extention. For vtk and msh file, the mesh is always included in the file and save_mesh have no effect.
compressed (bool or None, default=None) – For FDH5, None uses configured defaults; False disables compression; True uses the configured codec, falling back to gzip level 4 when it is None. For other formats, enables supported compression.
fdh5_options (dict, optional) – Per-output overrides of
fedoo.get_fdh5_options(): compression, compression_level, float_dtype, coordinate_dtype, integer_min_bits, and local_frame. Default result fields use float32; coordinates, scalar outputs and metadata preserve precision. Set float_dtype=None to preserve field precision. Cannot specify compression entries together with compressed. Conversions affect saved arrays only.