PRISMS-PF Manual v3.0-pre
All Classes Functions Variables Enumerations Pages
solution_handler.h
1// SPDX-FileCopyrightText: © 2025 PRISMS Center at the University of Michigan
2// SPDX-License-Identifier: GNU Lesser General Public Version 2.1
3
4#ifndef solution_handler_h
5#define solution_handler_h
6
7#include <deal.II/lac/la_parallel_vector.h>
8
9#include <prismspf/config.h>
10#include <prismspf/core/matrix_free_handler.h>
11#include <prismspf/core/variable_attributes.h>
12
13#include <unordered_map>
14
15PRISMS_PF_BEGIN_NAMESPACE
16
20template <int dim>
22{
23public:
24 using VectorType = dealii::LinearAlgebra::distributed::Vector<double>;
25
29 explicit solutionHandler(
30 const std::map<unsigned int, variableAttributes> &_attributes_list);
31
36
40 void
41 init(matrixfreeHandler<dim> &matrix_free_handler);
42
46 void
47 update_ghosts() const;
48
53 void
54 update(const fieldSolveType &field_solve_type, const unsigned int &variable_index = 0);
55
60 std::unordered_map<std::pair<unsigned int, dependencyType>, VectorType *, pairHash>
62
68 std::unordered_map<unsigned int, VectorType *> new_solution_set;
69
70private:
74 const std::map<unsigned int, variableAttributes> *attributes_list;
75};
76
77PRISMS_PF_END_NAMESPACE
78
79#endif
This class handlers the management and access of the matrix-free objects.
Definition matrix_free_handler.h:25
Class that manages solution initialization and swapping with old solutions.
Definition solution_handler.h:22
void init(matrixfreeHandler< dim > &matrix_free_handler)
Initialize the solution set.
Definition solution_handler.cc:39
~solutionHandler()
Destructor.
Definition solution_handler.cc:23
void update_ghosts() const
Update the ghost values.
Definition solution_handler.cc:87
std::unordered_map< unsigned int, VectorType * > new_solution_set
The collection of new solution vectors at the current timestep. This is the dst vector that is filled...
Definition solution_handler.h:68
void update(const fieldSolveType &field_solve_type, const unsigned int &variable_index=0)
Update the solution_set with the new_solution_set. This has different variants on which solutions to ...
Definition solution_handler.cc:97
std::unordered_map< std::pair< unsigned int, dependencyType >, VectorType *, pairHash > solution_set
The collection of solution vector at the current timestep. This includes current values and old value...
Definition solution_handler.h:61
Simple hash function for pairs.
Definition variable_attributes.h:24