Skip to content

Commit

Permalink
fixed nonlinearity criterion
Browse files Browse the repository at this point in the history
Determine whether other_variable is nonlinear (2): LHS has any nonexplicit dependency.
Added some comments.
  • Loading branch information
fractalsbyx committed Dec 9, 2024
1 parent 428102c commit d55f403
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/variableAttributes/variableAttributes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) !=
Expand All @@ -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);
}
}
}
}
Expand Down

0 comments on commit d55f403

Please sign in to comment.