def solve(self, component_id=1) -> bool: cid = c_int(component_id) has_converged = c_int(0) with cd(self.working_directory): self.execute_function(self.lib.solve, byref(cid), byref(has_converged)) return has_converged.value == 1
def finalize(self) -> None: if self._state == State.INITIALIZED: with cd(self.working_directory): self.execute_function(self.lib.finalize) self._state = State.UNINITIALIZED else: raise InputError("The library is not initialized yet")
def initialize(self, config_file: str = "") -> None: if self._state == State.UNINITIALIZED: with cd(self.working_directory): self.execute_function(self.lib.initialize, config_file) self._state = State.INITIALIZED else: raise InputError("The library is already initialized")
def finalize_solve(self, component_id=1) -> None: cid = c_int(component_id) with cd(self.working_directory): self.execute_function(self.lib.finalize_solve, byref(cid))
def finalize_time_step(self) -> None: with cd(self.working_directory): self.execute_function(self.lib.finalize_time_step)
def prepare_time_step(self, dt) -> None: with cd(self.working_directory): dt = c_double(dt) self.execute_function(self.lib.prepare_time_step, byref(dt))
def update(self) -> None: with cd(self.working_directory): self.execute_function(self.lib.update)