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)
 Constructor.
 
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.
 
const BlockVector< number > & get_solution_full_vector (unsigned int relative_level=0) 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, unsigned int relative_level=0)
 Get a solution vector of a given field index.
 
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.
 
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.
 
const BlockVector< number > & get_old_solution_full_vector (unsigned int age, unsigned int relative_level=0) const
 Get the old solution vector set at a given age.
 
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.
 
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.
 
SolutionLevel< dim, number > & get_solution_level (unsigned int relative_level=0)
 Get the solutions object at a level.
 
const SolutionLevel< dim, number > & get_solution_level (unsigned int relative_level=0) const
 Get the solutions object at a level.
 
MatrixFree< dim, number > & get_matrix_free (unsigned int relative_level=0)
 Get the matrix_free object at a level.
 
const MatrixFree< dim, number > & get_matrix_free (unsigned int relative_level=0) const
 Get the matrix_free object at a level.
 
unsigned int get_block_index (unsigned int global_index) const
 Get the block index from the global 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.
 
template<unsigned int degree>
void init (const DoFManager< dim, degree > &dof_manager, const ConstraintManager< dim, degree, number > &constraint_manager, unsigned int num_old_saved)
 Initialize the solution set.
 
template<unsigned int degree>
void reinit (const DoFManager< dim, degree > &dof_manager, const ConstraintManager< dim, degree, number > &constraint_manager)
 Reinitialize the solution set.
 
void update_ghosts (unsigned int relative_level=0) const
 Update the ghost values.
 
void zero_out_ghosts (unsigned int relative_level=0) const
 Zero out the ghost values.
 
void apply_constraints (unsigned int relative_level=0)
 Apply the constraints to the solution vector.
 
void apply_constraints (BlockVector< number > &solution_vector, unsigned int relative_level=0)
 Apply the constraints to another vector.
 
void apply_constraints_to_all (unsigned int relative_level)
 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 (unsigned int relative_level=0)
 Update and propagate the old solutions.
 
void init_solution_transfer ()
 Reinit the solution transfer objections.
 
void prepare_for_solution_transfer ()
 Prepare for solution transfer.
 
void execute_solution_transfer ()
 Transfer solutions.
 

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.
 
std::vector< SolutionLevel< dim, number > > solution_levels
 Solutions and matrix free of each level.
 
std::vector< SolutionTransferblock_solution_transfer
 Utility for solution transfer to different mesh (for AMR). Can only work on one block at a time.
 

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 )

Constructor.

Member Function Documentation

◆ apply_constraints() [1/2]

template<unsigned int dim, typename number>
void GroupSolutionHandler< dim, number >::apply_constraints ( BlockVector< number > & solution_vector,
unsigned int relative_level = 0 )

Apply the constraints to another vector.

◆ apply_constraints() [2/2]

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

Apply the constraints to the solution vector.

◆ apply_constraints_to_all()

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

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 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() [1/2]

template<unsigned int dim, typename number>
auto GroupSolutionHandler< dim, number >::get_matrix_free ( unsigned int relative_level = 0)
nodiscard

Get the matrix_free object at a level.

◆ get_matrix_free() [2/2]

template<unsigned int dim, typename number>
auto GroupSolutionHandler< dim, number >::get_matrix_free ( unsigned int relative_level = 0) const
nodiscard

Get the matrix_free object at a level.

◆ 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,
unsigned int relative_level = 0 )
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,
unsigned int relative_level = 0 ) 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,
unsigned int relative_level = 0 )
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,
unsigned int relative_level = 0 ) const
nodiscard

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

◆ get_solution_full_vector() [1/2]

template<unsigned int dim, typename number>
auto GroupSolutionHandler< dim, number >::get_solution_full_vector ( unsigned int relative_level = 0)
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 ( unsigned int relative_level = 0) 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 = 0)
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 = 0) 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,
unsigned int relative_level = 0 )
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,
unsigned int relative_level = 0 ) const
nodiscard

Get a solution vector of a given field index.

◆ get_solve_block()

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

Get the underlying solve block object.

◆ init()

template<unsigned int dim, typename number>
template<unsigned int degree>
void GroupSolutionHandler< dim, number >::init ( const DoFManager< dim, degree > & dof_manager,
const ConstraintManager< dim, degree, number > & constraint_manager,
unsigned int num_old_saved )

Initialize the solution set.

◆ init_solution_transfer()

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

Reinit the solution transfer objections.

◆ prepare_for_solution_transfer()

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

Prepare for solution transfer.

◆ reinit()

template<unsigned int dim, typename number>
template<unsigned int degree>
void GroupSolutionHandler< dim, number >::reinit ( const DoFManager< dim, degree > & dof_manager,
const ConstraintManager< dim, degree, number > & constraint_manager )

Reinitialize the solution set.

◆ update()

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

Update and propagate the old solutions.

◆ update_ghosts()

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

Update the ghost values.

◆ zero_out_ghosts()

template<unsigned int dim, typename number>
void GroupSolutionHandler< dim, number >::zero_out_ghosts ( unsigned int relative_level = 0) 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.

◆ solution_levels

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

Solutions and matrix free of each level.

◆ 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: