From d55f403841714505a53b8bd96300f3373fc86cc4 Mon Sep 17 00:00:00 2001 From: Xander <102053371+fractalsbyx@users.noreply.github.com> Date: Mon, 9 Dec 2024 12:34:19 -0500 Subject: [PATCH] fixed nonlinearity criterion Determine whether other_variable is nonlinear (2): LHS has any nonexplicit dependency. Added some comments. --- src/variableAttributes/variableAttributes.cc | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/variableAttributes/variableAttributes.cc b/src/variableAttributes/variableAttributes.cc index 1b62d650..add5445e 100644 --- a/src/variableAttributes/variableAttributes.cc +++ b/src/variableAttributes/variableAttributes.cc @@ -116,6 +116,8 @@ variableAttributes::parse_dependencies( } else { + // `other_variable` refers to the variable with a dependency on `this`. + // `this` is the dependency variable. for (auto &[other_index, other_variable] : other_var_attributes) { if (other_variable.dependency_set.find(possible_dependency) != @@ -125,10 +127,21 @@ variableAttributes::parse_dependencies( { *eval_flag |= relevant_flag.at(variation); } + // Determine whether other_variable is nonlinear (1): RHS or LHS has + // nonexplicit dependency other than the guess term. + // This is required because PRISMS-PF does not do concurrent solves. other_variable.is_nonlinear |= - (eq_type != EXPLICIT_TIME_DEPENDENT) && (other_variable.eq_type != EXPLICIT_TIME_DEPENDENT) && - (&other_variable != this); + (eq_type != EXPLICIT_TIME_DEPENDENT) && (&other_variable != this); + // Determine whether other_variable is nonlinear (2): LHS has any + // nonexplicit dependency. + if (other_variable.dependencies_LHS.find(possible_dependency) != + other_variable.dependencies_LHS.end()) + { + other_variable.is_nonlinear |= + (other_variable.eq_type != EXPLICIT_TIME_DEPENDENT) && + (eq_type != EXPLICIT_TIME_DEPENDENT); + } } } }