6#include <deal.II/distributed/solution_transfer.h>
7#include <deal.II/lac/affine_constraints.h>
8#include <deal.II/lac/la_parallel_block_vector.h>
9#include <deal.II/lac/la_parallel_vector.h>
10#include <deal.II/matrix_free/matrix_free.h>
19#include <prismspf/config.h>
28template <
typename number>
29using BlockVector = dealii::LinearAlgebra::distributed::BlockVector<number>;
34template <
typename number>
40using dealii::MatrixFree;
56template <
unsigned int dim,
typename number>
66template <
unsigned int dim,
typename number>
70#if DEAL_II_VERSION_MAJOR >= 9 && DEAL_II_VERSION_MINOR >= 7
71 using SolutionTransfer = dealii::SolutionTransfer<dim, SolutionVector<number>>;
74 dealii::parallel::distributed::SolutionTransfer<dim, SolutionVector<number>>;
81 const std::vector<FieldAttributes> &_attributes_list,
82 const std::vector<MatrixFree<dim, number>> &_matrix_free_levels);
127 unsigned int global_index,
128 unsigned int relative_level = 0);
135 unsigned int global_index,
136 unsigned int relative_level = 0)
const;
153 const std::vector<MatrixFree<dim, number>> &
159 [[nodiscard]]
unsigned int
171 [[nodiscard]]
const std::vector<unsigned int> &
177 [[nodiscard]]
const std::vector<unsigned int> &
185 init(
unsigned int num_old_saved);
217 unsigned int relative_level = 0);
236 update(
unsigned int relative_level = 0);
299PRISMS_PF_END_NAMESPACE
void init(unsigned int num_old_saved)
Initialize the solution set.
Definition group_solution_handler.cc:168
const std::vector< MatrixFree< dim, number > > * matrix_free_levels
Pointer to MatrixFree of each level.
Definition group_solution_handler.h:286
void apply_constraints_to_all(unsigned int relative_level)
Apply the given constraints to all the solution vectors, including old.
Definition group_solution_handler.cc:306
SolutionVector< number > & get_solution_vector(unsigned int global_index, unsigned int relative_level=0)
Get a solution vector of a given field index.
Definition group_solution_handler.cc:56
BlockVector< number > & get_old_solution_full_vector(unsigned int age, unsigned int relative_level=0)
Get the old solution vector set at a given age.
Definition group_solution_handler.cc:76
void reinit()
Reinitialize the solution set.
Definition group_solution_handler.cc:197
void update(unsigned int relative_level=0)
Update and propagate the old solutions.
Definition group_solution_handler.cc:364
std::vector< SolutionLevel< dim, number > > solution_levels
Solutions of each level.
Definition group_solution_handler.h:281
std::vector< unsigned int > block_to_global_index
Mapping from block index to global field index.
Definition group_solution_handler.h:271
SolutionLevel< dim, number > & get_solution_level(unsigned int relative_level=0)
Get the solutions object at a level.
Definition group_solution_handler.cc:116
std::vector< unsigned int > global_to_block_index
Mapping from global field index to block index.
Definition group_solution_handler.h:276
const SolveBlock & get_solve_block() const
Get the underlying solve block object.
Definition group_solution_handler.cc:145
void update_ghosts(unsigned int relative_level=0) const
Update the ghost values.
Definition group_solution_handler.cc:287
void prepare_for_solution_transfer()
Prepare for solution transfer.
Definition group_solution_handler.cc:244
const std::vector< unsigned int > & get_block_to_global_index() const
Get the global index from the block index.
Definition group_solution_handler.cc:159
const std::vector< MatrixFree< dim, number > > & get_matrix_free_levels() const
Get the underlying matrix_free objects.
Definition group_solution_handler.cc:130
void apply_initial_condition_for_old_fields()
Apply initial condition to the old fields. For now, this simply copies the values in the normal field...
Definition group_solution_handler.cc:348
BlockVector< number > & get_solution_full_vector(unsigned int relative_level=0)
Get the solution vector set. This contains all the normal fields and is typically used for output.
Definition group_solution_handler.cc:40
void zero_out_ghosts(unsigned int relative_level=0) const
Zero out the ghost values.
Definition group_solution_handler.cc:299
void execute_solution_transfer()
Transfer solutions.
Definition group_solution_handler.cc:264
void apply_constraints(unsigned int relative_level=0)
Apply the constraints to the solution vector.
Definition group_solution_handler.cc:325
void init_solution_transfer()
Reinit the solution transfer objections.
Definition group_solution_handler.cc:230
SolveBlock solve_block
Information about the solve block this handler is responsible for.
Definition group_solution_handler.h:266
dealii::parallel::distributed::SolutionTransfer< dim, SolutionVector< number > > SolutionTransfer
Definition group_solution_handler.h:73
SolutionVector< number > & get_old_solution_vector(unsigned int age, unsigned int global_index, unsigned int relative_level=0)
Get a solution vector of a given field index at a given age.
Definition group_solution_handler.cc:94
GroupSolutionHandler(SolveBlock _solve_block, const std::vector< FieldAttributes > &_attributes_list, const std::vector< MatrixFree< dim, number > > &_matrix_free_levels)
Constructor.
Definition group_solution_handler.cc:21
void print_solution_full_vector(std::ostream &out, unsigned int relative_level=0) const
Print the solution vector set.
Definition group_solution_handler.cc:385
std::vector< SolutionTransfer > block_solution_transfer
Utility for solution transfer to different mesh (for AMR). Can only work on one block at a time.
Definition group_solution_handler.h:296
const std::vector< unsigned int > & get_global_to_block_index() const
Get the block index from the global index.
Definition group_solution_handler.cc:152
unsigned int get_block_index(unsigned int global_index) const
Get the block index from the global field index.
Definition group_solution_handler.cc:138
Structure to hold the attributes of a solve-block.
Definition solve_block.h:59
typename BlockVector< number >::BlockType SolutionVector
Typedef for solution vector.
Definition group_solution_handler.h:35
dealii::LinearAlgebra::distributed::BlockVector< number > BlockVector
Typedef for solution block vector.
Definition group_solution_handler.h:29
Definition conditional_ostreams.cc:20
The solution vectors with respect to on some multigrid level.
Definition group_solution_handler.h:58
std::vector< BlockVector< number > > old_solutions
Definition group_solution_handler.h:60
BlockVector< number > solutions
Definition group_solution_handler.h:59