prisms-center / phaseField

PRISMS-PF: An Open-Source Phase-Field Modeling Framework
https://prisms-center.github.io/phaseField/
Other
229 stars 119 forks source link

Switching to `dealii::EvaluationFlags` for deal.II 9.6.0 Compatibility #226

Closed landinjm closed 2 months ago

landinjm commented 2 months ago

In deal.II 9.6.0 only EvaluationFlags::EvaluationFlags are support for the evaluate() and integrate() functions.

Previously, we used a vector of bools for the values, gradients, hessians, etc... Switching to evaluation flags reduces the bulkiness and repetitiveness of the code. For example it was:

if (split_dependency_list.at(dep) == var_name.at(var))
  {
    need_value.at(var)        = true;
    dependency_entry_assigned = true;

    if ((var_eq_type[var_index] != EXPLICIT_TIME_DEPENDENT) &&
        (var_index != var) && (var_eq_type[var] != EXPLICIT_TIME_DEPENDENT))
    {
      is_nonlinear = true;
    }
  }

Using evaluation flags it becomes:

// Case if the dependency is x
if (dependency == variable)
  {
    evaluation_flags[dependency_variable_index] |=
      dealii::EvaluationFlags::values;
    dependency_entry_assigned = true;
  }

I also cleaned up EquationDependencyParser.cc while I was at it.

With this, PRISMS-PF is now compatible with deal.II 9.6.0