:py:mod:`obr.OpenFOAM.case` =========================== .. py:module:: obr.OpenFOAM.case Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: obr.OpenFOAM.case.File obr.OpenFOAM.case.OpenFOAMCase Attributes ~~~~~~~~~~ .. autoapisummary:: obr.OpenFOAM.case.logger obr.OpenFOAM.case.OF_HEADER_REGEX .. py:data:: logger .. py:data:: OF_HEADER_REGEX :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """(/\*--------------------------------\*- C\+\+ -\*----------------------------------\*\\ (\||)\s*========= \|(\s*\||) (\||)\s*\\\\ / F ield \| (OpenFOAM:|foam-extend:)\s*[\d\w\W]*\s*(\||) (\||)\s*\\\\ / O peration \| (Version:|Website:)\s*[\d\w\W]*\s*(\||) (\||)\s*\\\\ / A nd \| (Web:|Version:|Website)\s*[\d\w\W]*\s*(\||) (\||)\s*\\\\/ M anipulation \|(\s*\||) \\\*---------------------------------------------------------------------------\*/)""" .. raw:: html
.. py:class:: File(**kwargs) Bases: :py:obj:`Owls.parser.FoamDict.FileParser` Abstraction of OpenFOAMs config files which contain key value pairs or key block pairs .. py:method:: get(name: str) Get a value from an OpenFOAM dictionary file .. py:method:: md5sum(refresh=False) -> str Compute a files md5sum .. py:method:: is_modified() -> bool .. py:method:: set(args: dict) modifies the current controlDict by the given dictionary if the key exists in the controlDict the values are replaced non-existent keys are added .. py:class:: OpenFOAMCase(path, job) Bases: :py:obj:`obr.OpenFOAM.BlockMesh.BlockMesh` A class for simple access to typical OpenFOAM files .. py:property:: path :type: pathlib.Path .. py:property:: system_folder :type: pathlib.Path .. py:property:: constant_folder :type: pathlib.Path .. py:property:: const_polyMesh_folder :type: pathlib.Path .. py:property:: system_include_folder :type: pathlib.Path .. py:property:: zero_folder :type: pathlib.Path TODO check for 0.orig folder .. py:property:: init_p :type: pathlib.Path .. py:property:: init_U :type: pathlib.Path .. py:property:: is_decomposed :type: bool .. py:property:: time_folder :type: list[pathlib.Path] Returns all timestep folder .. py:property:: processor_folder :type: list[pathlib.Path] .. py:property:: current_time :type: float Returns the current timestep of the simulation .. py:property:: progress :type: float Returns the progress of the simulation in percent .. py:property:: latest_solver_log_path :type: pathlib.Path Returns the absolute path to the latest log .. py:property:: latest_log :type: Owls.parser.LogFile.LogFile Returns handle to the latest log .. py:property:: finished :type: bool check if the latest simulation run has finished gracefully .. py:property:: solver .. py:property:: config_file_tree :type: list[str] Iterates through case file tree and returns a list of paths to non-symlinked files. .. py:property:: esi_version :type: bool Check if esi version of OpenFOAM is sourced .. py:attribute:: latest_log_path_ :type: pathlib.Path .. py:method:: config_files_in_folder(folder: pathlib.Path) -> Generator[Tuple[File, str], Any, None] Yields all OF config files in given folder .. py:method:: fetch_logs() -> list[pathlib.Path] .. py:method:: fetch_latest_log() -> None .. py:method:: get(key: str) -> Union[File, None] .. py:method:: has_openfoam_header(path: pathlib.Path) -> bool .. py:method:: _exec_operation(operation) -> pathlib.Path .. py:method:: reset_case() Removes all artifacts after case generation .. py:method:: replaceMesh(args) Replace constant/polyMesh with a given polyMesh .. py:method:: decomposePar(args={}) Sets decomposeParDict and calls decomposePar. If no decomposeParDict exists a new one gets created .. py:method:: setKeyValuePair(args: dict) .. py:method:: run(args: dict) .. py:method:: is_file_modified(file: str) -> bool Checks if a file has been modified by comparing the current md5sum with the previously saved one inside `self.job.dict`. .. py:method:: is_tree_modified() -> list[str] Iterates all files inside the case tree and returns a list of files that were modified, based on their md5sum. .. py:method:: process_latest_time_stats() -> bool This function parses the latest time step log and stores the results in the job document. Return: A boolean indication whether processing was successful .. py:method:: detailed_update() Perform a detailed update on the job doc state .. py:method:: remove_solver_logs() Search for solver logs and deletes them .. py:method:: perform_post_md5sum_calculations() calculates md5sums for all case files. Primarily called from `dispatch_post_hooks` .. py:method:: was_successful() -> bool Returns True, if both its label and the last OBR operation returned successful, False otherwise.