Preconditioner< dim, VectorType, number > Class Template Reference

Developer Documentation: MeltPoolDG::Preconditioner< dim, VectorType, number > Class Template Reference
Developer Documentation
MeltPoolDG::Preconditioner< dim, VectorType, number > Class Template Reference

#include <preconditioner.hpp>

Classes

struct  PreconditionerConcept
 
struct  PreconditionerModel
 

Public Member Functions

 Preconditioner ()=default
 
template<typename PreconditionerType >
 Preconditioner (PreconditionerType &&preconditioner)
 
void vmult (VectorType &dst, const VectorType &src) const
 
void update (const std::any &external_setup=std::any())
 
void reinit ()
 
bool is_initialized () const
 
void clear ()
 
void set_do_update_preconditioner (const bool do_update, const bool do_overwrite=false)
 

Private Types

enum  { always_update , update_once , do_not_update }
 

Private Attributes

std::unique_ptr< PreconditionerConceptpreconditioner_pimpl
 
enum MeltPoolDG::Preconditioner:: { ... }  always_update
 

Member Enumeration Documentation

◆ anonymous enum

template<unsigned int dim, typename VectorType , typename number >
anonymous enum
private

Enum indicating whether the preconditioner shall be updated the next time update() is called. Defaults to alway_update until changed by set_do_update_preconditioner().

Enumerator
always_update 

always update the preconditioner when calling update()

update_once 

update the precondioner only when calling update() for the next time

do_not_update 

do nothing when calling update()

Constructor & Destructor Documentation

◆ Preconditioner() [1/2]

template<unsigned int dim, typename VectorType , typename number >
MeltPoolDG::Preconditioner< dim, VectorType, number >::Preconditioner ( )
default

◆ Preconditioner() [2/2]

template<unsigned int dim, typename VectorType , typename number >
template<typename PreconditionerType >
MeltPoolDG::Preconditioner< dim, VectorType, number >::Preconditioner ( PreconditionerType &&  preconditioner)
inlineexplicit

Constructor, stores the passed specifc preconditioner object internally.

Parameters
preconditionerPreconditioner object for a specific type of preconditioner.

Member Function Documentation

◆ clear()

template<unsigned int dim, typename VectorType , typename number >
void MeltPoolDG::Preconditioner< dim, VectorType, number >::clear ( )
inline

Delete the preconditioner object stored in this class.

◆ is_initialized()

template<unsigned int dim, typename VectorType , typename number >
bool MeltPoolDG::Preconditioner< dim, VectorType, number >::is_initialized ( ) const
inline

Check if the preconditioner is initialized, i.e. that the current object holds a valid pointer to any preconditioner object.

Returns
True if object holds a valid preconditoner object.

◆ reinit()

template<unsigned int dim, typename VectorType , typename number >
void MeltPoolDG::Preconditioner< dim, VectorType, number >::reinit ( )
inline

Initiliaze the preconditioner and its internal data structures. For details see the specific preconditioner classes.

◆ set_do_update_preconditioner()

template<unsigned int dim, typename VectorType , typename number >
void MeltPoolDG::Preconditioner< dim, VectorType, number >::set_do_update_preconditioner ( const bool  do_update,
const bool  do_overwrite = false 
)
inline

Sets a flag to determine whether the preconditioner should be updated during the next call to update(). If this function is called with do_update = 'true', the internal flag is set to request an update, and this state persists until update() is called. Once update() is executed, the flag resets automatically.

The optional parameter do_overwrite allows overriding the flag's current state. If set to 'true', the flag is explicitly set according to do_update, even if it was previously set to trigger an update.

This function can be used when multiple conditions need to be checked before deciding whether to update the preconditioner.

Parameters
do_updateIf 'true', the preconditioner is marked for an update during the next call to update(). If 'false', it is not updated unless previously marked.
do_overwriteIf 'true', forces the flag to be set based on do_update, ignoring previous states.
Note
By default, the preconditioner is set to update on every update() call, i.e. if this function is never called, the preconditioner will always be updated during update().

◆ update()

template<unsigned int dim, typename VectorType , typename number >
void MeltPoolDG::Preconditioner< dim, VectorType, number >::update ( const std::any &  external_setup = std::any())
inline

Update the preconditioner. For details see the specific preconditioner classes.

◆ vmult()

template<unsigned int dim, typename VectorType , typename number >
void MeltPoolDG::Preconditioner< dim, VectorType, number >::vmult ( VectorType &  dst,
const VectorType &  src 
) const
inline

Apply the preconditioner to the given src vector and store the result in the dst vector.

Parameters
dstVector in which the result is stored.
srcSource vector to which the preconditioner is applied.

Member Data Documentation

◆ []

enum { ... } MeltPoolDG::Preconditioner< dim, VectorType, number >::always_update

Enum indicating whether the preconditioner shall be updated the next time update() is called. Defaults to alway_update until changed by set_do_update_preconditioner().

◆ preconditioner_pimpl

template<unsigned int dim, typename VectorType , typename number >
std::unique_ptr<PreconditionerConcept> MeltPoolDG::Preconditioner< dim, VectorType, number >::preconditioner_pimpl
private

dealii::Pointer to the actual preconditioner object to which the function calls are forwarded.


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