Example #1
0
UpdateErrorVectorsThread::UpdateErrorVectorsThread(
    FEProblemBase & fe_problem,
    const std::map<std::string, std::unique_ptr<ErrorVector>> & indicator_field_to_error_vector)
  : ThreadedElementLoop<ConstElemRange>(fe_problem),
    _indicator_field_to_error_vector(indicator_field_to_error_vector),
    _aux_sys(fe_problem.getAuxiliarySystem()),
    _system_number(_aux_sys.number()),
    _adaptivity(fe_problem.adaptivity()),
    _solution(_aux_sys.solution())
{
  // Build up this map once so we don't have to do these lookups over and over again
  for (const auto & it : _indicator_field_to_error_vector)
  {
    unsigned int var_num = _aux_sys.getVariable(0, it.first).number();
    _indicator_field_number_to_error_vector.emplace(var_num, it.second.get());
  }
}