KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
Public Member Functions | List of all members
Kratos::RelaxedDofUpdater< TSparseSpace > Class Template Reference

Utility class to update the values of degree of freedom (Dof) variables after solving the system. More...

#include <relaxed_dof_updater.h>

Inheritance diagram for Kratos::RelaxedDofUpdater< TSparseSpace >:
Collaboration diagram for Kratos::RelaxedDofUpdater< TSparseSpace >:

Public Member Functions

void Initialize (const DofsArrayType &rDofSet, const SystemVectorType &rDx)
 Initialize the DofUpdater in preparation for a subsequent UpdateDofs call. More...
 
void Clear ()
 Free internal storage to reset the instance and/or optimize memory consumption. More...
 
void UpdateDofs (DofsArrayType &rDofSet, const SystemVectorType &rDx)
 Calculate new values for the problem's degrees of freedom using the update vector rDx. More...
 
std::string Info () const
 Turn back information as a string. More...
 
void Initialize (const DofsArrayType &rDofSet, const SystemVectorType &rDx)
 Initialize the DofUpdater in preparation for a subsequent UpdateDofs call. More...
 
void Clear ()
 Free internal storage to reset the instance and/or optimize memory consumption. More...
 
void UpdateDofs (DofsArrayType &rDofSet, const SystemVectorType &rDx)
 Calculate new values for the problem's degrees of freedom using the update vector rDx. More...
 
std::string Info () const
 Turn back information as a string. More...
 
Life Cycle
 RelaxedDofUpdater (const double RelaxationFactor)
 Default constructor. More...
 
 RelaxedDofUpdater (RelaxedDofUpdater const &rOther)=delete
 Deleted copy constructor. More...
 
virtual ~RelaxedDofUpdater ()=default
 Destructor. More...
 
RelaxedDofUpdateroperator= (RelaxedDofUpdater const &rOther)=delete
 Deleted assignment operator. More...
 
Operations
BaseType::UniquePointer Create () const override
 Create a new instance of this class. More...
 
void Initialize (const DofsArrayType &rDofSet, const SystemVectorType &rDx) override
 Initialize the RelaxedDofUpdater in preparation for a subsequent UpdateDofs call. More...
 
void Clear () override
 Free internal storage to reset the instance and/or optimize memory consumption. More...
 
void UpdateDofs (DofsArrayType &rDofSet, const SystemVectorType &rDx) override
 Calculate new values for the problem's degrees of freedom using the update vector rDx. More...
 
Input and output
std::string Info () const override
 Turn back information as a string. More...
 
void PrintInfo (std::ostream &rOStream) const override
 Print information about this object. More...
 
void PrintData (std::ostream &rOStream) const override
 Print object's data. More...
 
- Public Member Functions inherited from Kratos::DofUpdater< TSparseSpace >
 DofUpdater ()
 Default constructor. More...
 
 DofUpdater (DofUpdater const &rOther)=delete
 Deleted copy constructor. More...
 
virtual ~DofUpdater ()
 Destructor. More...
 
DofUpdateroperator= (DofUpdater const &rOther)=delete
 Deleted assignment operator. More...
 
virtual void AssignDofs (DofsArrayType &rDofSet, const SystemVectorType &rX)
 Assign new values for the problem's degrees of freedom using the vector rX. More...
 
 KRATOS_CLASS_POINTER_DEFINITION (DofUpdater)
 Pointer definition of DofUpdater. More...
 

Type Definitions

using BaseType = DofUpdater< TSparseSpace >
 
using DofType = typename BaseType::DofType
 
using DofsArrayType = typename BaseType::DofsArrayType
 
using SystemVectorType = typename TSparseSpace::VectorType
 
 KRATOS_CLASS_POINTER_DEFINITION (RelaxedDofUpdater)
 Pointer definition of RelaxedDofUpdater. More...
 

Additional Inherited Members

- Public Types inherited from Kratos::DofUpdater< TSparseSpace >
using DofType = Dof< typename TSparseSpace::DataType >
 
using DofsArrayType = PointerVectorSet< DofType >
 
using SystemVectorType = typename TSparseSpace::VectorType
 

Detailed Description

template<class TSparseSpace>
class Kratos::RelaxedDofUpdater< TSparseSpace >

Utility class to update the values of degree of freedom (Dof) variables after solving the system.

This class encapsulates the operation of updating nodal degrees of freedom after a system solution. In pseudo-code, the operation to be performed is for each dof: dof.variable += dx[dof.equation_id] * Relaxation This operation is a simple loop in shared memory, but requires additional infrastructure in MPI, to obtain out-of-process update data. RelaxedDofUpdater takes care of both the operation and the eventual auxiliary infrastructure.

Member Typedef Documentation

◆ BaseType

template<class TSparseSpace >
using Kratos::RelaxedDofUpdater< TSparseSpace >::BaseType = DofUpdater<TSparseSpace>

◆ DofsArrayType

template<class TSparseSpace >
using Kratos::RelaxedDofUpdater< TSparseSpace >::DofsArrayType = typename BaseType::DofsArrayType

◆ DofType

template<class TSparseSpace >
using Kratos::RelaxedDofUpdater< TSparseSpace >::DofType = typename BaseType::DofType

◆ SystemVectorType

template<class TSparseSpace >
using Kratos::RelaxedDofUpdater< TSparseSpace >::SystemVectorType = typename TSparseSpace::VectorType

Constructor & Destructor Documentation

◆ RelaxedDofUpdater() [1/2]

template<class TSparseSpace >
Kratos::RelaxedDofUpdater< TSparseSpace >::RelaxedDofUpdater ( const double  RelaxationFactor)
inline

Default constructor.

◆ RelaxedDofUpdater() [2/2]

template<class TSparseSpace >
Kratos::RelaxedDofUpdater< TSparseSpace >::RelaxedDofUpdater ( RelaxedDofUpdater< TSparseSpace > const &  rOther)
delete

Deleted copy constructor.

◆ ~RelaxedDofUpdater()

template<class TSparseSpace >
virtual Kratos::RelaxedDofUpdater< TSparseSpace >::~RelaxedDofUpdater ( )
virtualdefault

Destructor.

Member Function Documentation

◆ Clear() [1/3]

Free internal storage to reset the instance and/or optimize memory consumption.

Note that the base DofUpdater does not have internal data, so this does nothing.

Reimplemented from Kratos::DofUpdater< TSparseSpace >.

◆ Clear() [2/3]

void Kratos::RelaxedDofUpdater< TrilinosSpace< Epetra_FECrsMatrix, Epetra_FEVector > >::Clear ( )
virtual

Free internal storage to reset the instance and/or optimize memory consumption.

Note that the base DofUpdater does not have internal data, so this does nothing.

Reimplemented from Kratos::DofUpdater< TSparseSpace >.

◆ Clear() [3/3]

template<class TSparseSpace >
void Kratos::RelaxedDofUpdater< TSparseSpace >::Clear ( )
overridevirtual

Free internal storage to reset the instance and/or optimize memory consumption.

Note that the base RelaxedDofUpdater does not have internal data, so this does nothing.

Reimplemented from Kratos::DofUpdater< TSparseSpace >.

◆ Create()

template<class TSparseSpace >
BaseType::UniquePointer Kratos::RelaxedDofUpdater< TSparseSpace >::Create ( ) const
inlineoverridevirtual

Create a new instance of this class.

This function is used by the SparseSpace class to create new RelaxedDofUpdater instances of the appropriate type.

Returns
a std::unique_pointer to the new instance.
See also
UblasSpace::CreateRelaxedDofUpdater(), TrilinosSpace::CreateRelaxedDofUpdater().

Reimplemented from Kratos::DofUpdater< TSparseSpace >.

◆ Info() [1/3]

std::string Kratos::RelaxedDofUpdater< UblasSpace< double, CompressedMatrix, Vector > >::Info ( ) const
virtual

Turn back information as a string.

Reimplemented from Kratos::DofUpdater< TSparseSpace >.

◆ Info() [2/3]

std::string Kratos::RelaxedDofUpdater< TrilinosSpace< Epetra_FECrsMatrix, Epetra_FEVector > >::Info ( ) const
virtual

Turn back information as a string.

Reimplemented from Kratos::DofUpdater< TSparseSpace >.

◆ Info() [3/3]

template<class TSparseSpace >
std::string Kratos::RelaxedDofUpdater< TSparseSpace >::Info ( ) const
overridevirtual

Turn back information as a string.

Reimplemented from Kratos::DofUpdater< TSparseSpace >.

◆ Initialize() [1/3]

void Kratos::RelaxedDofUpdater< UblasSpace< double, CompressedMatrix, Vector > >::Initialize ( const DofsArrayType rDofSet,
const SystemVectorType rDx 
)
virtual

Initialize the DofUpdater in preparation for a subsequent UpdateDofs call.

Note that the base DofUpdater does not have internal data, so this does nothing.

Parameters
[in]rDofSetThe list of degrees of freedom.
[in]rDxThe update vector.

Reimplemented from Kratos::DofUpdater< TSparseSpace >.

◆ Initialize() [2/3]

void Kratos::RelaxedDofUpdater< TrilinosSpace< Epetra_FECrsMatrix, Epetra_FEVector > >::Initialize ( const DofsArrayType rDofSet,
const SystemVectorType rDx 
)
virtual

Initialize the DofUpdater in preparation for a subsequent UpdateDofs call.

Note that the base DofUpdater does not have internal data, so this does nothing.

Parameters
[in]rDofSetThe list of degrees of freedom.
[in]rDxThe update vector.

Reimplemented from Kratos::DofUpdater< TSparseSpace >.

◆ Initialize() [3/3]

template<class TSparseSpace >
void Kratos::RelaxedDofUpdater< TSparseSpace >::Initialize ( const DofsArrayType rDofSet,
const SystemVectorType rDx 
)
overridevirtual

Initialize the RelaxedDofUpdater in preparation for a subsequent UpdateDofs call.

Note that the base RelaxedDofUpdater does not have internal data, so this does nothing.

Parameters
[in]rDofSetThe list of degrees of freedom.
[in]rDxThe update vector.

Reimplemented from Kratos::DofUpdater< TSparseSpace >.

◆ KRATOS_CLASS_POINTER_DEFINITION()

template<class TSparseSpace >
Kratos::RelaxedDofUpdater< TSparseSpace >::KRATOS_CLASS_POINTER_DEFINITION ( RelaxedDofUpdater< TSparseSpace >  )

Pointer definition of RelaxedDofUpdater.

◆ operator=()

template<class TSparseSpace >
RelaxedDofUpdater& Kratos::RelaxedDofUpdater< TSparseSpace >::operator= ( RelaxedDofUpdater< TSparseSpace > const &  rOther)
delete

Deleted assignment operator.

◆ PrintData()

template<class TSparseSpace >
void Kratos::RelaxedDofUpdater< TSparseSpace >::PrintData ( std::ostream &  rOStream) const
inlineoverridevirtual

Print object's data.

Reimplemented from Kratos::DofUpdater< TSparseSpace >.

◆ PrintInfo()

template<class TSparseSpace >
void Kratos::RelaxedDofUpdater< TSparseSpace >::PrintInfo ( std::ostream &  rOStream) const
inlineoverridevirtual

Print information about this object.

Reimplemented from Kratos::DofUpdater< TSparseSpace >.

◆ UpdateDofs() [1/3]

void Kratos::RelaxedDofUpdater< UblasSpace< double, CompressedMatrix, Vector > >::UpdateDofs ( DofsArrayType rDofSet,
const SystemVectorType rDx 
)
virtual

Calculate new values for the problem's degrees of freedom using the update vector rDx.

For each Dof in rDofSet, this function calculates the updated value for the corresponding variable as value += rDx[dof.EquationId()].

Parameters
[in/out]rDofSet The list of degrees of freedom.
[in]rDxThe update vector. This method will check if Initialize() was called before and call it if necessary.

Reimplemented from Kratos::DofUpdater< TSparseSpace >.

◆ UpdateDofs() [2/3]

void Kratos::RelaxedDofUpdater< TrilinosSpace< Epetra_FECrsMatrix, Epetra_FEVector > >::UpdateDofs ( DofsArrayType rDofSet,
const SystemVectorType rDx 
)
virtual

Calculate new values for the problem's degrees of freedom using the update vector rDx.

For each Dof in rDofSet, this function calculates the updated value for the corresponding variable as value += rDx[dof.EquationId()].

Parameters
[in/out]rDofSet The list of degrees of freedom.
[in]rDxThe update vector. This method will check if Initialize() was called before and call it if necessary.

Reimplemented from Kratos::DofUpdater< TSparseSpace >.

◆ UpdateDofs() [3/3]

template<class TSparseSpace >
void Kratos::RelaxedDofUpdater< TSparseSpace >::UpdateDofs ( DofsArrayType rDofSet,
const SystemVectorType rDx 
)
overridevirtual

Calculate new values for the problem's degrees of freedom using the update vector rDx.

For each Dof in rDofSet, this function calculates the updated value for the corresponding variable as value += rDx[dof.EquationId()].

Parameters
[in/out]rDofSet The list of degrees of freedom.
[in]rDxThe update vector.
[in]RelaxationFactorRelaxation factor This method will check if Initialize() was called before and call it if necessary.

Reimplemented from Kratos::DofUpdater< TSparseSpace >.


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