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::SensitivityBuilderScheme Class Reference

Scheme used in the Sensitivity Builder. More...

#include <sensitivity_builder_scheme.h>

Inheritance diagram for Kratos::SensitivityBuilderScheme:
Collaboration diagram for Kratos::SensitivityBuilderScheme:

Public Member Functions

Life Cycle
 SensitivityBuilderScheme ()
 Constructor. More...
 
virtual ~SensitivityBuilderScheme ()=default
 Destructor. More...
 
Operations
virtual int Check (const ModelPart &rModelPart, const ModelPart &rSensitivityModelPart) const
 
virtual void Initialize (ModelPart &rModelPart, ModelPart &rSensitivityModelPart, AdjointResponseFunction &rResponseFunction)
 
virtual void InitializeSolutionStep (ModelPart &rModelPart, ModelPart &rSensitivityModelPart, AdjointResponseFunction &rResponseFunction)
 
virtual void FinalizeSolutionStep (ModelPart &rModelPart, ModelPart &rSensitivityModelPart, AdjointResponseFunction &rResponseFunction)
 
virtual void Finalize (ModelPart &rModelPart, ModelPart &rSensitivityModelPart, AdjointResponseFunction &rResponseFunction)
 
virtual void Update (ModelPart &rModelPart, ModelPart &rSensitivityModelPart, AdjointResponseFunction &rResponseFunction)
 
virtual void Clear ()
 
virtual void CalculateSensitivity (ElementType &rCurrentElement, AdjointResponseFunction &rResponseFunction, Vector &rSensitivity, GlobalPointersVector< NodeType > &rGPSensitivityVector, const Variable< double > &rVariable, const ProcessInfo &rCurrentProcessInfo)
 Calculates sensitivity from a given element. More...
 
virtual void CalculateSensitivity (ElementType &rCurrentElement, AdjointResponseFunction &rResponseFunction, Vector &rSensitivity, GlobalPointersVector< ConditionType > &rGPSensitivityVector, const Variable< double > &rVariable, const ProcessInfo &rCurrentProcessInfo)
 Calculates sensitivity from a given element. More...
 
virtual void CalculateSensitivity (ElementType &rCurrentElement, AdjointResponseFunction &rResponseFunction, Vector &rSensitivity, GlobalPointersVector< ElementType > &rGPSensitivityVector, const Variable< double > &rVariable, const ProcessInfo &rCurrentProcessInfo)
 Calculates sensitivity from a given element. More...
 
virtual void CalculateSensitivity (ConditionType &rCurrentCondition, AdjointResponseFunction &rResponseFunction, Vector &rSensitivity, GlobalPointersVector< NodeType > &rGPSensitivityVector, const Variable< double > &rVariable, const ProcessInfo &rCurrentProcessInfo)
 Calculates sensitivity from a given condition. More...
 
virtual void CalculateSensitivity (ConditionType &rCurrentCondition, AdjointResponseFunction &rResponseFunction, Vector &rSensitivity, GlobalPointersVector< ConditionType > &rGPSensitivityVector, const Variable< double > &rVariable, const ProcessInfo &rCurrentProcessInfo)
 Calculates sensitivity from a given condition. More...
 
virtual void CalculateSensitivity (ConditionType &rCurrentCondition, AdjointResponseFunction &rResponseFunction, Vector &rSensitivity, GlobalPointersVector< ElementType > &rGPSensitivityVector, const Variable< double > &rVariable, const ProcessInfo &rCurrentProcessInfo)
 Calculates sensitivity from a given condition. More...
 
virtual void CalculateSensitivity (ElementType &rCurrentElement, AdjointResponseFunction &rResponseFunction, Vector &rSensitivity, GlobalPointersVector< NodeType > &rGPSensitivityVector, const Variable< array_1d< double, 3 >> &rVariable, const ProcessInfo &rCurrentProcessInfo)
 Calculates sensitivity from a given element. More...
 
virtual void CalculateSensitivity (ElementType &rCurrentElement, AdjointResponseFunction &rResponseFunction, Vector &rSensitivity, GlobalPointersVector< ConditionType > &rGPSensitivityVector, const Variable< array_1d< double, 3 >> &rVariable, const ProcessInfo &rCurrentProcessInfo)
 Calculates sensitivity from a given element. More...
 
virtual void CalculateSensitivity (ElementType &rCurrentElement, AdjointResponseFunction &rResponseFunction, Vector &rSensitivity, GlobalPointersVector< ElementType > &rGPSensitivityVector, const Variable< array_1d< double, 3 >> &rVariable, const ProcessInfo &rCurrentProcessInfo)
 Calculates sensitivity from a given element. More...
 
virtual void CalculateSensitivity (ConditionType &rCurrentCondition, AdjointResponseFunction &rResponseFunction, Vector &rSensitivity, GlobalPointersVector< NodeType > &rGPSensitivityVector, const Variable< array_1d< double, 3 >> &rVariable, const ProcessInfo &rCurrentProcessInfo)
 Calculates sensitivity from a given condition. More...
 
virtual void CalculateSensitivity (ConditionType &rCurrentCondition, AdjointResponseFunction &rResponseFunction, Vector &rSensitivity, GlobalPointersVector< ConditionType > &rGPSensitivityVector, const Variable< array_1d< double, 3 >> &rVariable, const ProcessInfo &rCurrentProcessInfo)
 Calculates sensitivity from a given condition. More...
 
virtual void CalculateSensitivity (ConditionType &rCurrentCondition, AdjointResponseFunction &rResponseFunction, Vector &rSensitivity, GlobalPointersVector< ElementType > &rGPSensitivityVector, const Variable< array_1d< double, 3 >> &rVariable, const ProcessInfo &rCurrentProcessInfo)
 Calculates sensitivity from a given condition. 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...
 

Protected Attributes

Protected Member Variables
std::vector< MatrixmSensitivityMatrices
 
std::vector< VectormAdjointVectors
 
std::vector< VectormPartialSensitivity
 
std::unordered_map< int, GlobalPointer< ModelPart::NodeType > > mGlobalPointerNodalMap
 
const int mRank
 

Type Definitions

using NodeType = ModelPart::NodeType
 
using ConditionType = ModelPart::ConditionType
 
using ElementType = ModelPart::ElementType
 
 KRATOS_CLASS_POINTER_DEFINITION (SensitivityBuilderScheme)
 

Detailed Description

Scheme used in the Sensitivity Builder.

This scheme calculates sensitivities according to following equation

[ \frac{dJ}{d\underline{x}} = \frac{\partial J}{\partial \underline{x}}

Where $J$ is the response function, $\underline{R}$ are the discrete residuals, and $\underline{x}$ are the parameter w.r.t. the sensitivities are computed.

See also
SensitivityBuilder

Member Typedef Documentation

◆ ConditionType

◆ ElementType

◆ NodeType

Constructor & Destructor Documentation

◆ SensitivityBuilderScheme()

Kratos::SensitivityBuilderScheme::SensitivityBuilderScheme ( )
inline

Constructor.

◆ ~SensitivityBuilderScheme()

virtual Kratos::SensitivityBuilderScheme::~SensitivityBuilderScheme ( )
virtualdefault

Destructor.

Member Function Documentation

◆ CalculateSensitivity() [1/12]

virtual void Kratos::SensitivityBuilderScheme::CalculateSensitivity ( ConditionType rCurrentCondition,
AdjointResponseFunction rResponseFunction,
Vector rSensitivity,
GlobalPointersVector< ConditionType > &  rGPSensitivityVector,
const Variable< array_1d< double, 3 >> &  rVariable,
const ProcessInfo rCurrentProcessInfo 
)
inlinevirtual

Calculates sensitivity from a given condition.

This method needs to be implemented in the derived class if sensitivity calculation is based on condition quantities, and conditions has a contribution towards that.

rSensitivity vector should have sensitivities in the order matching rGPSensitivity vector. rGPSensitivityVector holds GlobalPointers indicating where these sensitivities need to be stored accordingly.

Parameters
rCurrentConditionCondition being passed
rResponseFunctionResponse function used
rSensitivitySensitivity vector
rGPSensitivityVectorGlobal pointer vector
rVariableDesign variable
rCurrentProcessInfoCurrent process info

Reimplemented in Kratos::SimpleSteadySensitivityBuilderScheme.

◆ CalculateSensitivity() [2/12]

virtual void Kratos::SensitivityBuilderScheme::CalculateSensitivity ( ConditionType rCurrentCondition,
AdjointResponseFunction rResponseFunction,
Vector rSensitivity,
GlobalPointersVector< ConditionType > &  rGPSensitivityVector,
const Variable< double > &  rVariable,
const ProcessInfo rCurrentProcessInfo 
)
inlinevirtual

Calculates sensitivity from a given condition.

This method needs to be implemented in the derived class if sensitivity calculation is based on condition quantities, and conditions has a contribution towards that.

rSensitivity vector should have sensitivities in the order matching rGPSensitivity vector. rGPSensitivityVector holds GlobalPointers indicating where these sensitivities need to be stored accordingly.

Parameters
rCurrentConditionCondition being passed
rResponseFunctionResponse function used
rSensitivitySensitivity vector
rGPSensitivityVectorGlobal pointer vector
rVariableDesign variable
rCurrentProcessInfoCurrent process info

Reimplemented in Kratos::SimpleSteadySensitivityBuilderScheme.

◆ CalculateSensitivity() [3/12]

virtual void Kratos::SensitivityBuilderScheme::CalculateSensitivity ( ConditionType rCurrentCondition,
AdjointResponseFunction rResponseFunction,
Vector rSensitivity,
GlobalPointersVector< ElementType > &  rGPSensitivityVector,
const Variable< array_1d< double, 3 >> &  rVariable,
const ProcessInfo rCurrentProcessInfo 
)
inlinevirtual

Calculates sensitivity from a given condition.

This method needs to be implemented in the derived class if sensitivity calculation is based on element quantities, and conditions has a contribution towards that.

rSensitivity vector should have sensitivities in the order matching rGPSensitivity vector. rGPSensitivityVector holds GlobalPointers indicating where these sensitivities need to be stored accordingly.

Parameters
rCurrentConditionCondition being passed
rResponseFunctionResponse function used
rSensitivitySensitivity vector
rGPSensitivityVectorGlobal pointer vector
rVariableDesign variable
rCurrentProcessInfoCurrent process info

◆ CalculateSensitivity() [4/12]

virtual void Kratos::SensitivityBuilderScheme::CalculateSensitivity ( ConditionType rCurrentCondition,
AdjointResponseFunction rResponseFunction,
Vector rSensitivity,
GlobalPointersVector< ElementType > &  rGPSensitivityVector,
const Variable< double > &  rVariable,
const ProcessInfo rCurrentProcessInfo 
)
inlinevirtual

Calculates sensitivity from a given condition.

This method needs to be implemented in the derived class if sensitivity calculation is based on element quantities, and conditions has a contribution towards that.

rSensitivity vector should have sensitivities in the order matching rGPSensitivity vector. rGPSensitivityVector holds GlobalPointers indicating where these sensitivities need to be stored accordingly.

Parameters
rCurrentConditionCondition being passed
rResponseFunctionResponse function used
rSensitivitySensitivity vector
rGPSensitivityVectorGlobal pointer vector
rVariableDesign variable
rCurrentProcessInfoCurrent process info

◆ CalculateSensitivity() [5/12]

virtual void Kratos::SensitivityBuilderScheme::CalculateSensitivity ( ConditionType rCurrentCondition,
AdjointResponseFunction rResponseFunction,
Vector rSensitivity,
GlobalPointersVector< NodeType > &  rGPSensitivityVector,
const Variable< array_1d< double, 3 >> &  rVariable,
const ProcessInfo rCurrentProcessInfo 
)
inlinevirtual

Calculates sensitivity from a given condition.

This method needs to be implemented in the derived class if sensitivity calculation is based on nodal quantities, and conditions has a contribution towards that.

rSensitivity vector should have sensitivities in the order matching rGPSensitivity vector. rGPSensitivityVector holds GlobalPointers indicating where these sensitivities need to be stored accordingly.

Parameters
rCurrentConditionCondition being passed
rResponseFunctionResponse function used
rSensitivitySensitivity vector
rGPSensitivityVectorGlobal pointer vector
rVariableDesign variable
rCurrentProcessInfoCurrent process info

Reimplemented in Kratos::SimpleSteadySensitivityBuilderScheme.

◆ CalculateSensitivity() [6/12]

virtual void Kratos::SensitivityBuilderScheme::CalculateSensitivity ( ConditionType rCurrentCondition,
AdjointResponseFunction rResponseFunction,
Vector rSensitivity,
GlobalPointersVector< NodeType > &  rGPSensitivityVector,
const Variable< double > &  rVariable,
const ProcessInfo rCurrentProcessInfo 
)
inlinevirtual

Calculates sensitivity from a given condition.

This method needs to be implemented in the derived class if sensitivity calculation is based on nodal quantities, and conditions has a contribution towards that.

rSensitivity vector should have sensitivities in the order matching rGPSensitivity vector. rGPSensitivityVector holds GlobalPointers indicating where these sensitivities need to be stored accordingly.

Parameters
rCurrentConditionCondition being passed
rResponseFunctionResponse function used
rSensitivitySensitivity vector
rGPSensitivityVectorGlobal pointer vector
rVariableDesign variable
rCurrentProcessInfoCurrent process info

Reimplemented in Kratos::SimpleSteadySensitivityBuilderScheme.

◆ CalculateSensitivity() [7/12]

virtual void Kratos::SensitivityBuilderScheme::CalculateSensitivity ( ElementType rCurrentElement,
AdjointResponseFunction rResponseFunction,
Vector rSensitivity,
GlobalPointersVector< ConditionType > &  rGPSensitivityVector,
const Variable< array_1d< double, 3 >> &  rVariable,
const ProcessInfo rCurrentProcessInfo 
)
inlinevirtual

Calculates sensitivity from a given element.

This method needs to be implemented in the derived class if sensitivity calculation is based on condition quantities, and elements has a contribution towards that.

rSensitivity vector should have sensitivities in the order matching rGPSensitivity vector. rGPSensitivityVector holds GlobalPointers indicating where these sensitivities need to be stored accordingly.

Parameters
rCurrentElementElement being passed
rResponseFunctionResponse function used
rSensitivitySensitivity vector
rGPSensitivityVectorGlobal pointer vector
rVariableDesign variable
rCurrentProcessInfoCurrent process info

◆ CalculateSensitivity() [8/12]

virtual void Kratos::SensitivityBuilderScheme::CalculateSensitivity ( ElementType rCurrentElement,
AdjointResponseFunction rResponseFunction,
Vector rSensitivity,
GlobalPointersVector< ConditionType > &  rGPSensitivityVector,
const Variable< double > &  rVariable,
const ProcessInfo rCurrentProcessInfo 
)
inlinevirtual

Calculates sensitivity from a given element.

This method needs to be implemented in the derived class if sensitivity calculation is based on condition quantities, and elements has a contribution towards that.

rSensitivity vector should have sensitivities in the order matching rGPSensitivity vector. rGPSensitivityVector holds GlobalPointers indicating where these sensitivities need to be stored accordingly.

Parameters
rCurrentElementElement being passed
rResponseFunctionResponse function used
rSensitivitySensitivity vector
rGPSensitivityVectorGlobal pointer vector
rVariableDesign variable
rCurrentProcessInfoCurrent process info

◆ CalculateSensitivity() [9/12]

virtual void Kratos::SensitivityBuilderScheme::CalculateSensitivity ( ElementType rCurrentElement,
AdjointResponseFunction rResponseFunction,
Vector rSensitivity,
GlobalPointersVector< ElementType > &  rGPSensitivityVector,
const Variable< array_1d< double, 3 >> &  rVariable,
const ProcessInfo rCurrentProcessInfo 
)
inlinevirtual

Calculates sensitivity from a given element.

This method needs to be implemented in the derived class if sensitivity calculation is based on element quantities, and elements has a contribution towards that.

rSensitivity vector should have sensitivities in the order matching rGPSensitivity vector. rGPSensitivityVector holds GlobalPointers indicating where these sensitivities need to be stored accordingly.

Parameters
rCurrentElementElement being passed
rResponseFunctionResponse function used
rSensitivitySensitivity vector
rGPSensitivityVectorGlobal pointer vector
rVariableDesign variable
rCurrentProcessInfoCurrent process info

Reimplemented in Kratos::SimpleSteadySensitivityBuilderScheme.

◆ CalculateSensitivity() [10/12]

virtual void Kratos::SensitivityBuilderScheme::CalculateSensitivity ( ElementType rCurrentElement,
AdjointResponseFunction rResponseFunction,
Vector rSensitivity,
GlobalPointersVector< ElementType > &  rGPSensitivityVector,
const Variable< double > &  rVariable,
const ProcessInfo rCurrentProcessInfo 
)
inlinevirtual

Calculates sensitivity from a given element.

This method needs to be implemented in the derived class if sensitivity calculation is based on element quantities, and elements has a contribution towards that.

rSensitivity vector should have sensitivities in the order matching rGPSensitivity vector. rGPSensitivityVector holds GlobalPointers indicating where these sensitivities need to be stored accordingly.

Parameters
rCurrentElementElement being passed
rResponseFunctionResponse function used
rSensitivitySensitivity vector
rGPSensitivityVectorGlobal pointer vector
rVariableDesign variable
rCurrentProcessInfoCurrent process info

Reimplemented in Kratos::SimpleSteadySensitivityBuilderScheme.

◆ CalculateSensitivity() [11/12]

virtual void Kratos::SensitivityBuilderScheme::CalculateSensitivity ( ElementType rCurrentElement,
AdjointResponseFunction rResponseFunction,
Vector rSensitivity,
GlobalPointersVector< NodeType > &  rGPSensitivityVector,
const Variable< array_1d< double, 3 >> &  rVariable,
const ProcessInfo rCurrentProcessInfo 
)
inlinevirtual

Calculates sensitivity from a given element.

This method needs to be implemented in the derived class if sensitivity calculation is based on nodal quantities, and elements has a contribution towards that.

rSensitivity vector should have sensitivities in the order matching rGPSensitivity vector. rGPSensitivityVector holds GlobalPointers indicating where these sensitivities need to be stored accordingly.

Parameters
rCurrentElementElement being passed
rResponseFunctionResponse function used
rSensitivitySensitivity vector
rGPSensitivityVectorGlobal pointer vector
rVariableDesign variable
rCurrentProcessInfoCurrent process info

Reimplemented in Kratos::SimpleSteadySensitivityBuilderScheme.

◆ CalculateSensitivity() [12/12]

virtual void Kratos::SensitivityBuilderScheme::CalculateSensitivity ( ElementType rCurrentElement,
AdjointResponseFunction rResponseFunction,
Vector rSensitivity,
GlobalPointersVector< NodeType > &  rGPSensitivityVector,
const Variable< double > &  rVariable,
const ProcessInfo rCurrentProcessInfo 
)
inlinevirtual

Calculates sensitivity from a given element.

This method needs to be implemented in the derived class if sensitivity calculation is based on nodal quantities, and elements has a contribution towards that.

rSensitivity vector should have sensitivities in the order matching rGPSensitivity vector. rGPSensitivityVector holds GlobalPointers indicating where these sensitivities need to be stored accordingly.

Parameters
rCurrentElementElement being passed
rResponseFunctionResponse function used
rSensitivitySensitivity vector
rGPSensitivityVectorGlobal pointer vector
rVariableDesign variable
rCurrentProcessInfoCurrent process info

Reimplemented in Kratos::SimpleSteadySensitivityBuilderScheme.

◆ Check()

virtual int Kratos::SensitivityBuilderScheme::Check ( const ModelPart rModelPart,
const ModelPart rSensitivityModelPart 
) const
inlinevirtual

◆ Clear()

virtual void Kratos::SensitivityBuilderScheme::Clear ( )
inlinevirtual

◆ Finalize()

virtual void Kratos::SensitivityBuilderScheme::Finalize ( ModelPart rModelPart,
ModelPart rSensitivityModelPart,
AdjointResponseFunction rResponseFunction 
)
inlinevirtual

◆ FinalizeSolutionStep()

virtual void Kratos::SensitivityBuilderScheme::FinalizeSolutionStep ( ModelPart rModelPart,
ModelPart rSensitivityModelPart,
AdjointResponseFunction rResponseFunction 
)
inlinevirtual

◆ Info()

virtual std::string Kratos::SensitivityBuilderScheme::Info ( ) const
inlinevirtual

Turn back information as a string.

Reimplemented in Kratos::VelocityBossakSensitivityBuilderScheme, and Kratos::SimpleSteadySensitivityBuilderScheme.

◆ Initialize()

virtual void Kratos::SensitivityBuilderScheme::Initialize ( ModelPart rModelPart,
ModelPart rSensitivityModelPart,
AdjointResponseFunction rResponseFunction 
)
inlinevirtual

◆ InitializeSolutionStep()

virtual void Kratos::SensitivityBuilderScheme::InitializeSolutionStep ( ModelPart rModelPart,
ModelPart rSensitivityModelPart,
AdjointResponseFunction rResponseFunction 
)
inlinevirtual

◆ KRATOS_CLASS_POINTER_DEFINITION()

Kratos::SensitivityBuilderScheme::KRATOS_CLASS_POINTER_DEFINITION ( SensitivityBuilderScheme  )

◆ PrintData()

virtual void Kratos::SensitivityBuilderScheme::PrintData ( std::ostream &  rOStream) const
inlinevirtual

Print object's data.

◆ PrintInfo()

virtual void Kratos::SensitivityBuilderScheme::PrintInfo ( std::ostream &  rOStream) const
inlinevirtual

Print information about this object.

◆ Update()

virtual void Kratos::SensitivityBuilderScheme::Update ( ModelPart rModelPart,
ModelPart rSensitivityModelPart,
AdjointResponseFunction rResponseFunction 
)
inlinevirtual

Member Data Documentation

◆ mAdjointVectors

std::vector<Vector> Kratos::SensitivityBuilderScheme::mAdjointVectors
protected

◆ mGlobalPointerNodalMap

std::unordered_map<int, GlobalPointer<ModelPart::NodeType> > Kratos::SensitivityBuilderScheme::mGlobalPointerNodalMap
protected

◆ mPartialSensitivity

std::vector<Vector> Kratos::SensitivityBuilderScheme::mPartialSensitivity
protected

◆ mRank

const int Kratos::SensitivityBuilderScheme::mRank
protected

◆ mSensitivityMatrices

std::vector<Matrix> Kratos::SensitivityBuilderScheme::mSensitivityMatrices
protected

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