Skip to content

Commit

Permalink
rename tolerance status options
Browse files Browse the repository at this point in the history
  • Loading branch information
otvam committed Jan 31, 2025
1 parent ae9adab commit 5d3c463
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions examples/config/tolerance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ parallel_sweep:
# - "segregated" is iterating between the electric and magnetic equations
"coupling": "direct"

# tolerance for checking the solution residuum on the final solution
"tolerance_options":
# options for determining the solver return status
"status_options":
"ignore_status": false # ignore the solver status
"ignore_res": true # ignore the residuum convergence
"rel_tol": 1.0e-3 # relative tolerance for the residuum convergence
Expand Down
6 changes: 3 additions & 3 deletions pypeec/data/schema_tolerance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"iter_magnetic_options": *iter_options

#############################################################################
"tolerance_options": &tolerance_options
"status_options": &status_options
"type": "object"
"required":
- "ignore_status"
Expand Down Expand Up @@ -228,7 +228,7 @@
"type": "object"
"required":
- "coupling"
- "tolerance_options"
- "status_options"
- "power_options"
- "direct_options"
- "segregated_options"
Expand All @@ -238,7 +238,7 @@
"enum":
- "direct"
- "segregated"
"tolerance_options": *tolerance_options
"status_options": *status_options
"power_options": *power_options
"direct_options": *iter_options
"segregated_options": *segregated_options
Expand Down
14 changes: 7 additions & 7 deletions pypeec/lib_solver/equation_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,16 +410,16 @@ def _get_solver_segregated(sol_init, fct_cpl, fct_sys, fct_pcd, rhs, segregated_
return status, sol_all


def _get_status(status, sol_all, rhs, fct_cpl, fct_sys, tolerance_options):
def _get_status(status, sol_all, rhs, fct_cpl, fct_sys, status_options):
"""
Compute the residuum and the solver convergence status.
"""

# extract
ignore_status = tolerance_options["ignore_status"]
ignore_res = tolerance_options["ignore_res"]
rel_tol = tolerance_options["rel_tol"]
abs_tol = tolerance_options["abs_tol"]
ignore_status = status_options["ignore_status"]
ignore_res = status_options["ignore_res"]
rel_tol = status_options["rel_tol"]
abs_tol = status_options["abs_tol"]

# extract
(rhs_c, rhs_m) = rhs
Expand Down Expand Up @@ -459,7 +459,7 @@ def get_solver(sol_init, fct_cpl, fct_sys, fct_pcd, rhs, fct_conv, solver_option

# get the condition options
coupling = solver_options["coupling"]
tolerance_options = solver_options["tolerance_options"]
status_options = solver_options["status_options"]
power_options = solver_options["power_options"]
segregated_options = solver_options["segregated_options"]
direct_options = solver_options["direct_options"]
Expand Down Expand Up @@ -529,7 +529,7 @@ def get_solver(sol_init, fct_cpl, fct_sys, fct_pcd, rhs, fct_conv, solver_option
iter_obj.get_callback_final(sol)

# get convergence status
(status, res, res_val, res_thr) = _get_status(status, sol, rhs, fct_cpl, fct_sys, tolerance_options)
(status, res, res_val, res_thr) = _get_status(status, sol, rhs, fct_cpl, fct_sys, status_options)

# extract alg results
n_sys_eval = op_obj.get_n_sys_eval()
Expand Down

0 comments on commit 5d3c463

Please sign in to comment.