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::DofUpdater< TSparseSpace > Class Template Reference

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

#include <dof_updater.h>

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

Public Member Functions

Life Cycle
 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...
 
Operations
virtual DofUpdater::UniquePointer Create () const
 Create a new instance of this class. More...
 
virtual void Initialize (const DofsArrayType &rDofSet, const SystemVectorType &rDx)
 Initialize the DofUpdater in preparation for a subsequent UpdateDofs call. More...
 
virtual void Clear ()
 Free internal storage to reset the instance and/or optimize memory consumption. More...
 
virtual void UpdateDofs (DofsArrayType &rDofSet, const SystemVectorType &rDx)
 Calculate new values for the problem's degrees of freedom using the update vector rDx. More...
 
virtual void AssignDofs (DofsArrayType &rDofSet, const SystemVectorType &rX)
 Assign new values for the problem's degrees of freedom using the vector rX. More...
 
Input and output
virtual std::string Info () const
 Turn back information as a string. More...
 
virtual void PrintInfo (std::ostream &rOStream) const
 Print information about this object. More...
 
virtual void PrintData (std::ostream &rOStream) const
 Print object's data. More...
 

Type Definitions

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

Detailed Description

template<class TSparseSpace>
class Kratos::DofUpdater< 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. DofUpdater takes care of both the operation and the eventual auxiliary infrastructure.

See also
TrilinosDofUpdater for the trilinos version.

Member Typedef Documentation

◆ DofsArrayType

template<class TSparseSpace >
using Kratos::DofUpdater< TSparseSpace >::DofsArrayType = PointerVectorSet<DofType>

◆ DofType

template<class TSparseSpace >
using Kratos::DofUpdater< TSparseSpace >::DofType = Dof<typename TSparseSpace::DataType>

◆ SystemVectorType

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

Constructor & Destructor Documentation

◆ DofUpdater() [1/2]

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

Default constructor.

◆ DofUpdater() [2/2]

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

Deleted copy constructor.

◆ ~DofUpdater()

template<class TSparseSpace >
virtual Kratos::DofUpdater< TSparseSpace >::~DofUpdater ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ AssignDofs()

template<class TSparseSpace >
virtual void Kratos::DofUpdater< TSparseSpace >::AssignDofs ( DofsArrayType rDofSet,
const SystemVectorType rX 
)
inlinevirtual

Assign new values for the problem's degrees of freedom using the vector rX.

For each Dof in rDofSet, this function assigns the value for the corresponding variable as value = rX[dof.EquationId()].

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

◆ Clear()

template<class TSparseSpace >
virtual void Kratos::DofUpdater< TSparseSpace >::Clear ( )
inlinevirtual

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 in Kratos::TrilinosDofUpdater< TSparseSpace >, Kratos::RelaxedDofUpdater< TSparseSpace >, Kratos::RelaxedDofUpdater< TSparseSpace >, and Kratos::RelaxedDofUpdater< TSparseSpace >.

◆ Create()

template<class TSparseSpace >
virtual DofUpdater::UniquePointer Kratos::DofUpdater< TSparseSpace >::Create ( ) const
inlinevirtual

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.
See also
UblasSpace::CreateDofUpdater(), TrilinosSpace::CreateDofUpdater().

Reimplemented in Kratos::TrilinosDofUpdater< TSparseSpace >, and Kratos::RelaxedDofUpdater< TSparseSpace >.

◆ Info()

template<class TSparseSpace >
virtual std::string Kratos::DofUpdater< TSparseSpace >::Info ( ) const
inlinevirtual

◆ Initialize()

template<class TSparseSpace >
virtual void Kratos::DofUpdater< TSparseSpace >::Initialize ( const DofsArrayType rDofSet,
const SystemVectorType rDx 
)
inlinevirtual

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 in Kratos::TrilinosDofUpdater< TSparseSpace >, Kratos::RelaxedDofUpdater< TSparseSpace >, Kratos::RelaxedDofUpdater< TSparseSpace >, and Kratos::RelaxedDofUpdater< TSparseSpace >.

◆ KRATOS_CLASS_POINTER_DEFINITION()

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

Pointer definition of DofUpdater.

◆ operator=()

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

Deleted assignment operator.

◆ PrintData()

template<class TSparseSpace >
virtual void Kratos::DofUpdater< TSparseSpace >::PrintData ( std::ostream &  rOStream) const
inlinevirtual

◆ PrintInfo()

template<class TSparseSpace >
virtual void Kratos::DofUpdater< TSparseSpace >::PrintInfo ( std::ostream &  rOStream) const
inlinevirtual

Print information about this object.

Reimplemented in Kratos::TrilinosDofUpdater< TSparseSpace >, and Kratos::RelaxedDofUpdater< TSparseSpace >.

◆ UpdateDofs()

template<class TSparseSpace >
virtual void Kratos::DofUpdater< TSparseSpace >::UpdateDofs ( DofsArrayType rDofSet,
const SystemVectorType rDx 
)
inlinevirtual

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 in Kratos::TrilinosDofUpdater< TSparseSpace >, Kratos::RelaxedDofUpdater< TSparseSpace >, Kratos::RelaxedDofUpdater< TSparseSpace >, and Kratos::RelaxedDofUpdater< TSparseSpace >.


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