libICEpost.src.base.Functions.functionsForOF ============================================ .. py:module:: libICEpost.src.base.Functions.functionsForOF .. autoapi-nested-parse:: @author: F. Ramognino Last update: 12/06/2023 Functions used to handle OpenFOAM files Functions --------- .. autoapisummary:: libICEpost.src.base.Functions.functionsForOF.readOFscalarList libICEpost.src.base.Functions.functionsForOF.writeOFscalarList Module Contents --------------- .. py:function:: readOFscalarList(fileName: str) -> Iterable[float] Reads an OpenFOAM file storing a scalarList. Automatically detects if the file is binary or not. :param fileName: Name of the OpenFOAM file. :type fileName: str :raises IOError: If the file does not exist or if it does not store a scalarList :returns: The data stored in the file. :rtype: Iterable[float] .. py:function:: writeOFscalarList(values: Iterable[float], path: str, *, overwrite: bool = False, binary: bool = False) -> None Write an OpenFOAM file storing a scalarList. :param values: The data to store. :type values: Iterable[float] :param path: The location where to file the scalarList. :type path: str :param overwrite: Overwrite if found? Defaults to False. :type overwrite: bool, optional :param binary: Write in binary? Defaults to False. :type binary: bool, optional :raises IOError: If the file exists and overwrite is False.