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 | Public Attributes | List of all members
response_routine.ResponseRoutine Class Reference

A class which adds optimization-specific utilities to simplify routines and synchronization between the control field from algorithms and analysis models. More...

Collaboration diagram for response_routine.ResponseRoutine:

Public Member Functions

None __init__ (self, MasterControl master_control, ResponseFunction response)
 
MasterControl GetMasterControl (self)
 
def Initialize (self)
 Initializes the response routine. More...
 
def Check (self)
 
def Finalize (self)
 
def GetResponseName (self)
 
ResponseFunction GetReponse (self)
 
float CalculateValue (self, KratosOA.CollectiveExpression control_field)
 Calculates the value of the response. More...
 
KratosOA.CollectiveExpression CalculateGradient (self)
 Returns Collective expression containing all the control space gradients for all control variable types (fields). More...
 
'dict[SupportedSensitivityFieldVariableTypes, KratosOA.CollectiveExpression]' GetRequiredPhysicalGradients (self)
 Returns required physical gradients by this response. More...
 

Public Attributes

 my_current_control_field
 

Detailed Description

A class which adds optimization-specific utilities to simplify routines and synchronization between the control field from algorithms and analysis models.

Constructor & Destructor Documentation

◆ __init__()

None response_routine.ResponseRoutine.__init__ (   self,
MasterControl  master_control,
ResponseFunction  response 
)

Member Function Documentation

◆ CalculateGradient()

KratosOA.CollectiveExpression response_routine.ResponseRoutine.CalculateGradient (   self)

Returns Collective expression containing all the control space gradients for all control variable types (fields).

    Notes:
        1. It expects that the CalculateValue is called.
        2. The gradients are computed with respect to updates from master control.

    Returns:
        KratosOA.CollectiveExpression: Returns mapped gradients collective expression.

◆ CalculateValue()

float response_routine.ResponseRoutine.CalculateValue (   self,
KratosOA.CollectiveExpression  control_field 
)

Calculates the value of the response.

    This method updates the design with the provided control field. If a control field is updated
    which affects the this response value, then a new value is computed. Otherwise, the previous
    value is returned.

    Args:
        control_field (KratosOA.CollectiveExpression): Control field of the new design.

    Returns:
        float: Respone value.

◆ Check()

def response_routine.ResponseRoutine.Check (   self)

◆ Finalize()

def response_routine.ResponseRoutine.Finalize (   self)

◆ GetMasterControl()

MasterControl response_routine.ResponseRoutine.GetMasterControl (   self)

◆ GetReponse()

ResponseFunction response_routine.ResponseRoutine.GetReponse (   self)

◆ GetRequiredPhysicalGradients()

'dict[SupportedSensitivityFieldVariableTypes, KratosOA.CollectiveExpression]' response_routine.ResponseRoutine.GetRequiredPhysicalGradients (   self)

Returns required physical gradients by this response.

    This method returns required physical gradients. The expressions may or not be empty field
    depending on CalculateGradient is called or not.

    Returns:
        dict[SupportedSensitivityFieldVariableTypes, KratosOA.CollectiveExpression]: Required physical gradients.

◆ GetResponseName()

def response_routine.ResponseRoutine.GetResponseName (   self)

◆ Initialize()

def response_routine.ResponseRoutine.Initialize (   self)

Initializes the response routine.

    Raises:
        RuntimeError: If control domain and response domain does not have any intersection.

Member Data Documentation

◆ my_current_control_field

response_routine.ResponseRoutine.my_current_control_field

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