38 using VectorType = dealii::LinearAlgebra::distributed::Vector<double>;
50 const dealii::MappingQ1<dim> &_mapping,
77 std::unordered_map<std::pair<unsigned int, dependencyType>,
unsigned int,
pairHash>>
78 global_to_local_solution;
83 std::map<unsigned int, std::vector<VectorType *>> solution_subset;
88 std::map<unsigned int, std::vector<VectorType *>> new_solution_subset;
93 std::vector<std::map<unsigned int, variableAttributes>> subset_attributes_list;
122 this->compute_subset_attributes(fieldSolveType::NONEXPLICIT_AUXILIARY);
125 if (this->subset_attributes.empty())
130 for (
const auto &[index, variable] : this->subset_attributes)
133 std::map<unsigned int, variableAttributes> temp;
134 temp.emplace(index, variable);
135 subset_attributes_list.push_back(temp);
138 this->system_matrix[index] =
139 std::make_unique<SystemMatrixType>(this->user_inputs,
141 subset_attributes_list.back());
144 this->system_matrix.at(index)->clear();
145 this->system_matrix.at(index)->initialize(
146 this->matrix_free_handler.get_matrix_free());
149 new_solution_subset[index].push_back(
150 this->solution_handler.new_solution_set.at(index));
151 solution_subset[index].push_back(this->solution_handler.solution_set.at(
152 std::make_pair(index, dependencyType::NORMAL)));
153 global_to_local_solution[index].emplace(std::make_pair(index,
154 dependencyType::NORMAL),
156 for (
const auto &[variable_index, map] :
157 subset_attributes_list.back().begin()->second.dependency_set_RHS)
159 for (
const auto &[dependency_type, field_type] : map)
161 const auto pair = std::make_pair(variable_index, dependency_type);
163 Assert(this->solution_handler.solution_set.find(pair) !=
164 this->solution_handler.solution_set.end(),
166 "There is no solution vector for the given index = " +
167 std::to_string(variable_index) +
168 " and type = " + to_string(dependency_type)));
170 Assert(this->solution_handler.new_solution_set.find(variable_index) !=
171 this->solution_handler.new_solution_set.end(),
173 "There is no new solution vector for the given index = " +
174 std::to_string(variable_index)));
176 solution_subset[index].push_back(
177 this->solution_handler.solution_set.at(pair));
178 global_to_local_solution[index].emplace(pair,
179 solution_subset.at(index).size() -
183 this->system_matrix.at(index)->add_global_to_local_mapping(
184 global_to_local_solution.at(index));
193 if (this->subset_attributes.empty())
198 for (
const auto &[index, variable] : this->subset_attributes)
201 this->system_matrix.at(index)->compute_nonexplicit_auxiliary_update(
202 new_solution_subset.at(index),
203 solution_subset.at(index));
206 new_solution_subset.at(index).at(0)->scale(this->invm_handler.get_invm(index));
209 this->solution_handler.update(fieldSolveType::NONEXPLICIT_AUXILIARY, index);
212 this->constraint_handler.get_constraint(index).distribute(
213 *(this->solution_handler.solution_set.at(
214 std::make_pair(index, dependencyType::NORMAL))));
nonexplicitAuxiliarySolver(const userInputParameters< dim > &_user_inputs, const matrixfreeHandler< dim > &_matrix_free_handler, const triangulationHandler< dim > &_triangulation_handler, const invmHandler< dim, degree > &_invm_handler, const constraintHandler< dim > &_constraint_handler, const dofHandler< dim > &_dof_handler, const dealii::MappingQ1< dim > &_mapping, dealii::MGLevelObject< matrixfreeHandler< dim, float > > &_mg_matrix_free_handler, solutionHandler< dim > &_solution_handler)
Constructor.
Definition nonexplicit_auxiliary_solver.h:97