PRISMS-PF Manual
Loading...
Searching...
No Matches
GroupSolutionHandler< dim, number > Class Template Reference

Class that manages solution initialization and swapping with old solutions. More...

#include <group_solution_handler.h>

Collaboration diagram for GroupSolutionHandler< dim, number >:
[legend]

Public Types

using SolutionTransfer
 

Public Member Functions

 GroupSolutionHandler (SolveBlock _solve_block, const std::vector< FieldAttributes > &_attributes_list, const MatrixFreeManager< dim, number > &_matrix_free_manager)
 Constructor.
 
BlockVector< number > & get_solution_full_vector ()
 Get the solution vector set. This contains all the normal fields and is typically used for output.
 
const BlockVector< number > & get_solution_full_vector () const
 Get the const solution vector set. This contains all the normal fields and is typically used for output.
 
SolutionVector< number > & get_solution_vector (unsigned int global_index)
 Get a solution vector of a given field index.
 
const SolutionVector< number > & get_solution_vector (unsigned int global_index) const
 Get a solution vector of a given field index.
 
BlockVector< number > & get_old_solution_full_vector (unsigned int age)
 Get the old solution vector set at a given age.
 
const BlockVector< number > & get_old_solution_full_vector (unsigned int age) const
 Get the old solution vector set at a given age.
 
SolutionVector< number > & get_old_solution_vector (unsigned int age, unsigned int global_index)
 Get a solution vector of a given field index at a given age.
 
const SolutionVector< number > & get_old_solution_vector (unsigned int age, unsigned int global_index) const
 Get a solution vector of a given field index at a given age.
 
SolutionLevel< dim, number > & get_primary_solutions ()
 Get the solutions object at a level.
 
const SolutionLevel< dim, number > & get_primary_solutions () const
 Get the solutions object at a level.
 
SolutionLevel< dim, number > & get_solution_level (unsigned int relative_level=-1)
 Get the solutions object at a level.
 
const SolutionLevel< dim, number > & get_solution_level (unsigned int relative_level=-1) const
 Get the solutions object at a level.
 
const std::vector< MatrixFree< dim, number > > & get_matrix_free_levels () const
 Get the underlying matrix_free objects.
 
unsigned int get_block_index (unsigned int global_index) const
 Get the block index from the global field index.
 
const SolveBlockget_solve_block () const
 Get the underlying solve block object.
 
const std::vector< unsigned int > & get_global_to_block_index () const
 Get the block index from the global index.
 
const std::vector< unsigned int > & get_block_to_global_index () const
 Get the global index from the block index.
 
void init (const NewDependencyExtents &extents)
 Initialize the solution set.
 
void reinit ()
 Reinitialize the solution set.
 
void update_ghosts () const
 Update the ghost values.
 
void zero_out_ghosts () const
 Zero out the ghost values.
 
void apply_constraints ()
 Apply the constraints to the solution vector.
 
void apply_constraints (BlockVector< number > &solution_vectors)
 Apply the constraints to another vector.
 
void apply_constraints_to_all ()
 Apply the given constraints to all the solution vectors, including old.
 
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 to the old.
 
void update ()
 Update and propagate the old solutions.
 
void init_solution_transfer ()
 Reinit the solution transfer objects.
 
void prepare_for_solution_transfer ()
 Prepare for solution transfer.
 
void execute_solution_transfer ()
 Transfer solutions.
 
template<unsigned int degree>
void reinit_mg_transfer (const DoFManager< dim, degree > &dof_manager)
 Reinit the solution transfer objects.
 
template<unsigned int degree>
void mg_transfer_down (const DoFManager< dim, degree > &dof_manager, unsigned int finest_level, bool transfer_old_solutions=false)
 Transfer solutions to mg levels.
 
unsigned int num_levels ()
 Number of refinement levels that will be tracked.
 
void print_solution_full_vector (std::ostream &out) const
 Print the solution vector set.
 

Private Attributes

SolveBlock solve_block
 Information about the solve block this handler is responsible for.
 
std::vector< unsigned int > block_to_global_index
 Mapping from block index to global field index.
 
std::vector< unsigned int > global_to_block_index
 Mapping from global field index to block index.
 
SolutionLevel< dim, number > primary_solutions
 Primary solutions.
 
std::vector< SolutionLevel< dim, number > > solution_levels
 Solutions projected to each mg level as dependencies.
 
const MatrixFreeManager< dim, number > * matrix_free_manager = nullptr
 Pointer to MatrixFree manager.
 
std::vector< SolutionTransferblock_solution_transfer
 Utility for solution transfer to different mesh (for AMR). Can only work on one block at a time.
 
std::vector< dealii::MGConstrainedDoFs > mg_constraints
 Constraints needed for mg transfer object.
 
std::vector< dealii::MGTransferMatrixFree< dim, number > > mg_transfer
 Utility object to transfer solutions between multigrid levels.
 

Detailed Description

template<unsigned int dim, typename number>
class GroupSolutionHandler< dim, number >

Class that manages solution initialization and swapping with old solutions.

Member Typedef Documentation

◆ SolutionTransfer

template<unsigned int dim, typename number>
using GroupSolutionHandler< dim, number >::SolutionTransfer
Initial value:
dealii::parallel::distributed::SolutionTransfer<dim, SolutionVector<number>>

Constructor & Destructor Documentation

◆ GroupSolutionHandler()

template<unsigned int dim, typename number>
PRISMS_PF_BEGIN_NAMESPACE GroupSolutionHandler< dim, number >::GroupSolutionHandler ( SolveBlock _solve_block,
const std::vector< FieldAttributes > & _attributes_list,
const MatrixFreeManager< dim, number > & _matrix_free_manager )

Constructor.

Member Function Documentation

◆ apply_constraints() [1/2]

template<unsigned int dim, typename number>
void GroupSolutionHandler< dim, number >::apply_constraints ( )

Apply the constraints to the solution vector.

◆ apply_constraints() [2/2]

template<unsigned int dim, typename number>
void GroupSolutionHandler< dim, number >::apply_constraints ( BlockVector< number > & solution_vectors)

Apply the constraints to another vector.

◆ apply_constraints_to_all()

template<unsigned int dim, typename number>
void GroupSolutionHandler< dim, number >::apply_constraints_to_all ( )

Apply the given constraints to all the solution vectors, including old.

◆ apply_initial_condition_for_old_fields()

template<unsigned int dim, typename number>
void GroupSolutionHandler< dim, number >::apply_initial_condition_for_old_fields ( )

Apply initial condition to the old fields. For now, this simply copies the values in the normal field to the old.

◆ execute_solution_transfer()

template<unsigned int dim, typename number>
void GroupSolutionHandler< dim, number >::execute_solution_transfer ( )

Transfer solutions.

◆ get_block_index()

template<unsigned int dim, typename number>
unsigned int GroupSolutionHandler< dim, number >::get_block_index ( unsigned int global_index) const
nodiscard

Get the block index from the global field index.

◆ get_block_to_global_index()

template<unsigned int dim, typename number>
const std::vector< unsigned int > & GroupSolutionHandler< dim, number >::get_block_to_global_index ( ) const
nodiscard

Get the global index from the block index.

◆ get_global_to_block_index()

template<unsigned int dim, typename number>
const std::vector< unsigned int > & GroupSolutionHandler< dim, number >::get_global_to_block_index ( ) const
nodiscard

Get the block index from the global index.

◆ get_matrix_free_levels()

template<unsigned int dim, typename number>
const std::vector< MatrixFree< dim, number > > & GroupSolutionHandler< dim, number >::get_matrix_free_levels ( ) const

Get the underlying matrix_free objects.

◆ get_old_solution_full_vector() [1/2]

template<unsigned int dim, typename number>
auto GroupSolutionHandler< dim, number >::get_old_solution_full_vector ( unsigned int age)
nodiscard

Get the old solution vector set at a given age.

◆ get_old_solution_full_vector() [2/2]

template<unsigned int dim, typename number>
auto GroupSolutionHandler< dim, number >::get_old_solution_full_vector ( unsigned int age) const
nodiscard

Get the old solution vector set at a given age.

◆ get_old_solution_vector() [1/2]

template<unsigned int dim, typename number>
auto GroupSolutionHandler< dim, number >::get_old_solution_vector ( unsigned int age,
unsigned int global_index )
nodiscard

Get a solution vector of a given field index at a given age.

◆ get_old_solution_vector() [2/2]

template<unsigned int dim, typename number>
auto GroupSolutionHandler< dim, number >::get_old_solution_vector ( unsigned int age,
unsigned int global_index ) const
nodiscard

Get a solution vector of a given field index at a given age.

◆ get_primary_solutions() [1/2]

template<unsigned int dim, typename number>
SolutionLevel< dim, number > & GroupSolutionHandler< dim, number >::get_primary_solutions ( )
nodiscard

Get the solutions object at a level.

◆ get_primary_solutions() [2/2]

template<unsigned int dim, typename number>
const SolutionLevel< dim, number > & GroupSolutionHandler< dim, number >::get_primary_solutions ( ) const
nodiscard

Get the solutions object at a level.

◆ get_solution_full_vector() [1/2]

template<unsigned int dim, typename number>
auto GroupSolutionHandler< dim, number >::get_solution_full_vector ( )
nodiscard

Get the solution vector set. This contains all the normal fields and is typically used for output.

◆ get_solution_full_vector() [2/2]

template<unsigned int dim, typename number>
auto GroupSolutionHandler< dim, number >::get_solution_full_vector ( ) const
nodiscard

Get the const solution vector set. This contains all the normal fields and is typically used for output.

◆ get_solution_level() [1/2]

template<unsigned int dim, typename number>
SolutionLevel< dim, number > & GroupSolutionHandler< dim, number >::get_solution_level ( unsigned int relative_level = -1)
nodiscard

Get the solutions object at a level.

◆ get_solution_level() [2/2]

template<unsigned int dim, typename number>
const SolutionLevel< dim, number > & GroupSolutionHandler< dim, number >::get_solution_level ( unsigned int relative_level = -1) const
nodiscard

Get the solutions object at a level.

◆ get_solution_vector() [1/2]

template<unsigned int dim, typename number>
auto GroupSolutionHandler< dim, number >::get_solution_vector ( unsigned int global_index)
nodiscard

Get a solution vector of a given field index.

◆ get_solution_vector() [2/2]

template<unsigned int dim, typename number>
auto GroupSolutionHandler< dim, number >::get_solution_vector ( unsigned int global_index) const
nodiscard

Get a solution vector of a given field index.

◆ get_solve_block()

template<unsigned int dim, typename number>
const SolveBlock & GroupSolutionHandler< dim, number >::get_solve_block ( ) const
nodiscard

Get the underlying solve block object.

◆ init()

template<unsigned int dim, typename number>
void GroupSolutionHandler< dim, number >::init ( const NewDependencyExtents & extents)

Initialize the solution set.

Precondition
MatrixFree is already reinit.

◆ init_solution_transfer()

template<unsigned int dim, typename number>
void GroupSolutionHandler< dim, number >::init_solution_transfer ( )

Reinit the solution transfer objects.

◆ mg_transfer_down()

template<unsigned int dim, typename number>
template<unsigned int degree>
void GroupSolutionHandler< dim, number >::mg_transfer_down ( const DoFManager< dim, degree > & dof_manager,
unsigned int finest_level,
bool transfer_old_solutions = false )
inline

Transfer solutions to mg levels.

◆ num_levels()

template<unsigned int dim, typename number>
unsigned int GroupSolutionHandler< dim, number >::num_levels ( )
nodiscard

Number of refinement levels that will be tracked.

◆ prepare_for_solution_transfer()

template<unsigned int dim, typename number>
void GroupSolutionHandler< dim, number >::prepare_for_solution_transfer ( )

Prepare for solution transfer.

◆ print_solution_full_vector()

template<unsigned int dim, typename number>
void GroupSolutionHandler< dim, number >::print_solution_full_vector ( std::ostream & out) const

Print the solution vector set.

◆ reinit()

template<unsigned int dim, typename number>
void GroupSolutionHandler< dim, number >::reinit ( )

Reinitialize the solution set.

Precondition
MatrixFree is already reinit.

◆ reinit_mg_transfer()

template<unsigned int dim, typename number>
template<unsigned int degree>
void GroupSolutionHandler< dim, number >::reinit_mg_transfer ( const DoFManager< dim, degree > & dof_manager)
inline

Reinit the solution transfer objects.

◆ update()

template<unsigned int dim, typename number>
void GroupSolutionHandler< dim, number >::update ( )

Update and propagate the old solutions.

◆ update_ghosts()

template<unsigned int dim, typename number>
void GroupSolutionHandler< dim, number >::update_ghosts ( ) const

Update the ghost values.

◆ zero_out_ghosts()

template<unsigned int dim, typename number>
void GroupSolutionHandler< dim, number >::zero_out_ghosts ( ) const

Zero out the ghost values.

Member Data Documentation

◆ block_solution_transfer

template<unsigned int dim, typename number>
std::vector<SolutionTransfer> GroupSolutionHandler< dim, number >::block_solution_transfer
private

Utility for solution transfer to different mesh (for AMR). Can only work on one block at a time.

Note
solution transfers can work on multiple solutions as long as they are using the same underlying dof numbering. All of our scalars and vectors have identical dof handlers, so we may be able to take advantage of this instead of creating several solution transfers as we do here. I don't know if this affects performance. todo

◆ block_to_global_index

template<unsigned int dim, typename number>
std::vector<unsigned int> GroupSolutionHandler< dim, number >::block_to_global_index
private

Mapping from block index to global field index.

◆ global_to_block_index

template<unsigned int dim, typename number>
std::vector<unsigned int> GroupSolutionHandler< dim, number >::global_to_block_index
private

Mapping from global field index to block index.

◆ matrix_free_manager

template<unsigned int dim, typename number>
const MatrixFreeManager<dim, number>* GroupSolutionHandler< dim, number >::matrix_free_manager = nullptr
private

Pointer to MatrixFree manager.

◆ mg_constraints

template<unsigned int dim, typename number>
std::vector<dealii::MGConstrainedDoFs> GroupSolutionHandler< dim, number >::mg_constraints
private

Constraints needed for mg transfer object.

◆ mg_transfer

template<unsigned int dim, typename number>
std::vector<dealii::MGTransferMatrixFree<dim, number> > GroupSolutionHandler< dim, number >::mg_transfer
private

Utility object to transfer solutions between multigrid levels.

◆ primary_solutions

template<unsigned int dim, typename number>
SolutionLevel<dim, number> GroupSolutionHandler< dim, number >::primary_solutions
private

Primary solutions.

◆ solution_levels

template<unsigned int dim, typename number>
std::vector<SolutionLevel<dim, number> > GroupSolutionHandler< dim, number >::solution_levels
private

Solutions projected to each mg level as dependencies.

◆ solve_block

template<unsigned int dim, typename number>
SolveBlock GroupSolutionHandler< dim, number >::solve_block
private

Information about the solve block this handler is responsible for.


The documentation for this class was generated from the following files: