fedoo.DataSet.save
- DataSet.save(filename: str, save_mesh: bool = False, compressed: bool = False) 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.
- 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, default = False) – If True, the file is compressed if available (only for npz and fdz files)