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.
List of all members
Kratos::TrilinosDofUpdater< TSparseSpace > Class Template Reference

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

#include <trilinos_dof_updater.h>

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

Public Member Functions

Life Cycle
 TrilinosDofUpdater ()
 Default constructor. More...
 
 TrilinosDofUpdater (TrilinosDofUpdater const &rOther)=delete
 Deleted copy constructor. More...
 
 ~TrilinosDofUpdater () override
 Destructor. More...
 
TrilinosDofUpdateroperator= (TrilinosDofUpdater 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 DofUpdater 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 DofsArrayType = typename BaseType::DofsArrayType
 
using SystemVectorType = typename BaseType::SystemVectorType
 
 KRATOS_CLASS_POINTER_DEFINITION (TrilinosDofUpdater)
 Pointer definition of TrilinosDofUpdater. 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::TrilinosDofUpdater< 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] This operation is a simple loop in shared memory, but requires additional infrastructure in MPI, to obtain out-of-process update data. TrilinosDofUpdater manages both the update operation and the auxiliary infrastructure.

Member Typedef Documentation

◆ BaseType

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

◆ DofsArrayType

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

◆ SystemVectorType

template<class TSparseSpace >
using Kratos::TrilinosDofUpdater< TSparseSpace >::SystemVectorType = typename BaseType::SystemVectorType

Constructor & Destructor Documentation

◆ TrilinosDofUpdater() [1/2]

template<class TSparseSpace >
Kratos::TrilinosDofUpdater< TSparseSpace >::TrilinosDofUpdater ( )
inline

Default constructor.

◆ TrilinosDofUpdater() [2/2]

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

Deleted copy constructor.

◆ ~TrilinosDofUpdater()

template<class TSparseSpace >
Kratos::TrilinosDofUpdater< TSparseSpace >::~TrilinosDofUpdater ( )
inlineoverride

Destructor.

Member Function Documentation

◆ Clear()

template<class TSparseSpace >
void Kratos::TrilinosDofUpdater< TSparseSpace >::Clear ( )
inlineoverridevirtual

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

Reimplemented from Kratos::DofUpdater< TSparseSpace >.

◆ Create()

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

Create a new instance of this class.

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

Returns
a std::unique_pointer to the new instance. Note that the pointer is actually a pointer to the base class type.
See also
UblasSpace::CreateDofUpdater(), TrilinosSpace::CreateDofUpdater().

Reimplemented from Kratos::DofUpdater< TSparseSpace >.

◆ Info()

template<class TSparseSpace >
std::string Kratos::TrilinosDofUpdater< TSparseSpace >::Info ( ) const
inlineoverridevirtual

Turn back information as a string.

Reimplemented from Kratos::DofUpdater< TSparseSpace >.

◆ Initialize()

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

Initialize the DofUpdater in preparation for a subsequent UpdateDofs call.

Parameters
[in]rDofSetThe list of degrees of freedom.
[in]rDxThe update vector. The DofUpdater needs to be initialized only if the dofset changes. If the problem does not require creating/destroying nodes or changing the mesh graph, it is in general enough to intialize this tool once at the begining of the problem. If the dofset only changes under certain conditions (for example because the domain is remeshed every N iterations), it is enough to call the Clear method to let this class know that its auxiliary data has to be re-generated and Initialize will be called as part of the next UpdateDofs call.

Reimplemented from Kratos::DofUpdater< TSparseSpace >.

◆ KRATOS_CLASS_POINTER_DEFINITION()

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

Pointer definition of TrilinosDofUpdater.

◆ operator=()

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

Deleted assignment operator.

◆ PrintData()

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

Print object's data.

Reimplemented from Kratos::DofUpdater< TSparseSpace >.

◆ PrintInfo()

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

Print information about this object.

Reimplemented from Kratos::DofUpdater< TSparseSpace >.

◆ UpdateDofs()

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

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 >.


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