From 0be2607160a6e6be236d62038a9d8cb73d06bf2c Mon Sep 17 00:00:00 2001 From: Suneth Warnakulasuriya Date: Tue, 15 Oct 2024 16:37:42 +0200 Subject: [PATCH] name change --- .../utilities/opt_projection.py | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/applications/OptimizationApplication/python_scripts/utilities/opt_projection.py b/applications/OptimizationApplication/python_scripts/utilities/opt_projection.py index bb2e5c8b9438..1dfbe74d8224 100644 --- a/applications/OptimizationApplication/python_scripts/utilities/opt_projection.py +++ b/applications/OptimizationApplication/python_scripts/utilities/opt_projection.py @@ -6,10 +6,10 @@ from KratosMultiphysics.OptimizationApplication.utilities.optimization_problem import OptimizationProblem from KratosMultiphysics.OptimizationApplication.utilities.union_utilities import ContainerExpressionTypes -class Projection(ABC): - """Projection methods to convert given x space values to given y space values +class DesignVariableProjection(ABC): + """Design variable projection methods to convert given x space values to given y space values - This is the interface class which can be used to implement projection classes + This is the interface class which can be used to implement design variable projection classes which project forward and backward given x space values to y space. The projection spaces should be scalar spaces. @@ -66,7 +66,7 @@ def Update(self) -> None: """Updates the projection method """ -class IdentityProjection(Projection): +class IdentityDesignVariableProjection(DesignVariableProjection): def __init__(self, parameters: Kratos.Parameters, _): default_settings = Kratos.Parameters("""{ "type" : "identity_projection", @@ -96,7 +96,7 @@ def ForwardProjectionGradient(self, x_values: ContainerExpressionTypes) -> Conta def Update(self) -> None: pass -class SigmoidalProjection(Projection): +class SigmoidalDesignVariableProjection(DesignVariableProjection): def __init__(self, parameters: Kratos.Parameters, _): default_parameters = Kratos.Parameters("""{ "type" : "sigmoidal_projection", @@ -127,7 +127,7 @@ def ForwardProjectionGradient(self, x_values: ContainerExpressionTypes) -> Conta def Update(self) -> None: pass -class AdaptiveSigmoidalProjection(Projection): +class AdaptiveSigmoidalDesignVariableProjection(DesignVariableProjection): def __init__(self, parameters: Kratos.Parameters, optimization_problem: OptimizationProblem): default_parameters = Kratos.Parameters("""{ "type" : "adaptive_sigmoidal_projection", @@ -172,16 +172,16 @@ def Update(self) -> None: Kratos.Logger.PrintInfo(self.__class__.__name__, f"Increased beta to {self.beta}.") -def CreateProjection(parameters: Kratos.Parameters, optimization_problem: OptimizationProblem) -> Projection: +def CreateProjection(parameters: Kratos.Parameters, optimization_problem: OptimizationProblem) -> DesignVariableProjection: if not parameters.Has("type"): - raise RuntimeError("Projection \"type\" is not present in following parameters:\n" + str(parameters)) + raise RuntimeError("DesignVariableProjection \"type\" is not present in following parameters:\n" + str(parameters)) projection_type = parameters["type"].GetString() - projection_types_map: 'dict[str, type[Projection]]' = { - "identity_projection" : IdentityProjection, - "sigmoidal_projection" : SigmoidalProjection, - "adaptive_sigmoidal_projection": AdaptiveSigmoidalProjection + projection_types_map: 'dict[str, type[DesignVariableProjection]]' = { + "identity_projection" : IdentityDesignVariableProjection, + "sigmoidal_projection" : SigmoidalDesignVariableProjection, + "adaptive_sigmoidal_projection": AdaptiveSigmoidalDesignVariableProjection } if projection_type in projection_types_map.keys():