ogstools.logparser.log module#
- class ogstools.logparser.log.Log[source]#
Bases:
objectParser and analyzer for OGS simulation log files.
Parses OGS log files and provides methods to extract and analyze simulation data including convergence behavior, time step information, and simulation status.
Initialize a Log parser.
- convergence_coupling_iteration()[source]#
Extract coupling iteration convergence data.
- Return type:
- Returns:
DataFrame with coupling iteration convergence information.
- convergence_newton_iteration()[source]#
Extract Newton iteration convergence data.
- Return type:
- Returns:
DataFrame with Newton iteration convergence metrics (errors, residuals, convergence order).
- simulation()[source]#
Extract overall simulation information.
- Return type:
- Returns:
DataFrame with simulation-level data.
- simulation_termination()[source]#
Extract simulation termination information.
- Return type:
- Returns:
DataFrame with termination status and final state.
- time_step()[source]#
Extract time step information.
- Return type:
- Returns:
DataFrame with time step data (model time, clock time, etc.).
- plot_convergence(metric='dx', x_metric='time_step', **kwargs)[source]#
Create a heatmap of the nonlinear solver convergence data.
Visualizes convergence behavior across time steps and iterations. Per default uses logarithmic scaling.
- Parameters:
metric (
Literal['dx','dx_x','x']) – Which metric to plot. Options: - “dx”: absolute error - “dx_x”: relative error - “x”: residualx_metric (
Literal['time_step','model_time']) – x_axis representation: - “time_step”: timestep number - “model_time”: simulation timekwargs (
Any) – Additional arguments passed to heatmap function (seeheatmap()).
- Return type:
- Returns:
A matplotlib Figure with the convergence heatmap.
- plot_convergence_order(n=3, x_metric='time_step', **kwargs)[source]#
Create a heatmap of the nonlinear solver convergence order.
Estimates and visualizes the convergence order across iterations. Only iterations i >= n are assigned a convergence order.
- Parameters:
n (
Literal[3,4]) – Number of error values to use for estimating convergence order (3 or 4).x_metric (
Literal['time_step','model_time']) – x_axis representation: - “time_step”: timestep number - “model_time”: simulation timekwargs (
Any) – Additional arguments passed to heatmap function. Default scale is limited to 0-2 for meaningful data.
- Return type:
- Returns:
A matplotlib Figure with the convergence order heatmap.