PRISMS-PF Manual
Loading...
Searching...
No Matches
solution_indexer.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2025 PRISMS Center at the University of Michigan
2// SPDX-License-Identifier: GNU Lesser General Public Version 2.1
3
4#pragma once
5
7
8#include <prismspf/config.h>
9
10#include <vector>
11
13
18template <unsigned int dim, typename number>
20{
21public:
25 SolutionIndexer(unsigned int num_fields, // attributes_list.size()
26 std::vector<GroupSolutionHandler<dim, number> *> solution_handlers);
27
31 [[nodiscard]] const SolutionVector<number> &
32 get_solution_vector(unsigned int global_index, unsigned int relative_level = 0) const;
36 [[nodiscard]] SolutionVector<number> &
37 get_solution_vector(unsigned int global_index, unsigned int relative_level = 0);
38
42 [[nodiscard]] const SolutionVector<number> &
43 get_old_solution_vector(unsigned int age,
44 unsigned int global_index,
45 unsigned int relative_level = 0) const;
49 [[nodiscard]] SolutionVector<number> &
50 get_old_solution_vector(unsigned int age,
51 unsigned int global_index,
52 unsigned int relative_level = 0);
53
57 [[nodiscard]] const MatrixFree<dim, number> &
58 get_matrix_free(unsigned int index, unsigned int relative_level = 0) const;
62 [[nodiscard]] MatrixFree<dim, number> &
63 get_matrix_free(unsigned int index, unsigned int relative_level = 0);
64
68 [[nodiscard]] const SolveBlock &
69 get_solve_block(unsigned int index) const;
70
74 [[nodiscard]] std::pair<const SolutionLevel<dim, number> *, unsigned int>
75 get_solution_level_and_block_index(unsigned int index,
76 unsigned int relative_level = 0) const;
77
81 [[nodiscard]] unsigned int
82 get_block_index(unsigned int global_index) const;
83
84private:
85 std::vector<GroupSolutionHandler<dim, number> *> solutions;
86};
87
88PRISMS_PF_END_NAMESPACE
Class that manages solution initialization and swapping with old solutions.
Definition group_solution_handler.h:72
std::vector< GroupSolutionHandler< dim, number > * > solutions
Definition solution_indexer.h:85
const MatrixFree< dim, number > & get_matrix_free(unsigned int index, unsigned int relative_level=0) const
Get the matrixfree object of the group a given field index.
Definition solution_indexer.cc:73
unsigned int get_block_index(unsigned int global_index) const
Get the block index of a field within its solve group.
Definition solution_indexer.cc:109
SolutionIndexer(unsigned int num_fields, std::vector< GroupSolutionHandler< dim, number > * > solution_handlers)
Constructor.
Definition solution_indexer.cc:14
const SolveBlock & get_solve_block(unsigned int index) const
Get the solve group of a given field index.
Definition solution_indexer.cc:91
std::pair< const SolutionLevel< dim, number > *, unsigned int > get_solution_level_and_block_index(unsigned int index, unsigned int relative_level=0) const
Get the matrixfree object of the group a given field index.
Definition solution_indexer.cc:98
const SolutionVector< number > & get_old_solution_vector(unsigned int age, unsigned int global_index, unsigned int relative_level=0) const
Get a solution vector of a given field index at a given age.
Definition solution_indexer.cc:49
const SolutionVector< number > & get_solution_vector(unsigned int global_index, unsigned int relative_level=0) const
Get a solution vector of a given field index.
Definition solution_indexer.cc:31
Structure to hold the attributes of a solve-block.
Definition solve_block.h:56
typename BlockVector< number >::BlockType SolutionVector
Typedef for solution vector.
Definition group_solution_handler.h:35
Definition conditional_ostreams.cc:20