bluemira.codes.plasmod.api._teardown ==================================== .. py:module:: bluemira.codes.plasmod.api._teardown .. autoapi-nested-parse:: Defines the 'Teardown' stage for the plasmod solver. Classes ------- .. autoapisummary:: bluemira.codes.plasmod.api._teardown.Teardown Module Contents --------------- .. py:class:: Teardown(params: bluemira.codes.plasmod.params.PlasmodSolverParams, output_file: str, profiles_file: str, run_directory: str, read_directory: str) Bases: :py:obj:`bluemira.codes.interface.CodesTeardown` .. autoapi-inheritance-diagram:: bluemira.codes.plasmod.api._teardown.Teardown :parts: 1 :private-bases: Plasmod teardown task. In "RUN" and "READ" mode, this loads in plasmod results files and updates :code:`params` with the values. :param params: The bluemira parameters for the task. Note that this task does not apply any mappings to the ParameterFrame, so they should already be set. Most likely by a solver. :param output_file: The path to the plasmod output file. :param profiles_file: The path to the plasmod profiles file. .. py:attribute:: params :type: bluemira.codes.plasmod.params.PlasmodSolverParams .. py:attribute:: MOCK_JSON_NAME :value: 'mockPLASMOD.json' .. py:attribute:: read_directory .. py:attribute:: run_directory .. py:attribute:: output_file .. py:attribute:: profiles_file .. py:method:: run() Load the plasmod results files and update this object's params with the read values. .. py:method:: mock() Update this object's plasmod params with default values. .. py:method:: read() Load the plasmod results files and update this object's params with the read values. :raises CodesError: If any of the plasmod files cannot be opened. .. py:method:: _get_data(output_file: str | pathlib.Path, profiles_file: str | pathlib.Path) Get data for read or run modes :raises CodesError: Cannot read output file .. py:method:: _raise_on_plasmod_error_code(exit_code: int) :staticmethod: Check the returned exit code of plasmod. 1: PLASMOD converged successfully: -1: Max number of iterations achieved: Equilibrium oscillating, pressure too high, reduce H 0: transport solver crashed: Abnormal parameters or too large dtmin and/or dtmin -2: Equilibrium solver crashed: Pressure too high :raises CodesError: If the exit flag is an error code, or its value is not a known code.