From 951c9297774d01637c98ad02dfbdc7456a40a43f Mon Sep 17 00:00:00 2001 From: RezaNajian Date: Fri, 30 Jun 2023 11:30:48 +0200 Subject: [PATCH 1/7] initial impls --- .../algorithms/NLOPT_algorithms.py | 155 ++++++++++++++++++ .../standardized_NLOPT_objective.py | 133 +++++++++++++++ 2 files changed, 288 insertions(+) create mode 100644 applications/OptimizationApplication/python_scripts/algorithms/NLOPT_algorithms.py create mode 100644 applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_objective.py diff --git a/applications/OptimizationApplication/python_scripts/algorithms/NLOPT_algorithms.py b/applications/OptimizationApplication/python_scripts/algorithms/NLOPT_algorithms.py new file mode 100644 index 000000000000..4e05413fa62b --- /dev/null +++ b/applications/OptimizationApplication/python_scripts/algorithms/NLOPT_algorithms.py @@ -0,0 +1,155 @@ +try: + import nlopt + import numpy +except ImportError: + raise Exception("NLOPT python library is not available") + +import KratosMultiphysics as Kratos +import KratosMultiphysics.OptimizationApplication as KratosOA +from KratosMultiphysics.OptimizationApplication.utilities.optimization_problem import OptimizationProblem +from KratosMultiphysics.OptimizationApplication.algorithms.standardized_NLOPT_objective import StandardizedNLOPTObjective +from KratosMultiphysics.OptimizationApplication.controls.master_control import MasterControl +from KratosMultiphysics.OptimizationApplication.algorithms.algorithm import Algorithm +from KratosMultiphysics.OptimizationApplication.utilities.component_data_view import ComponentDataView +from KratosMultiphysics.OptimizationApplication.utilities.opt_convergence import CreateConvergenceCriteria +from KratosMultiphysics.OptimizationApplication.utilities.opt_line_search import CreateLineSearch +from KratosMultiphysics.OptimizationApplication.utilities.logger_utilities import TimeLogger +from KratosMultiphysics.OptimizationApplication.utilities.logger_utilities import OptimizationAlgorithmTimeLogger + + +def Factory(model: Kratos.Model, parameters: Kratos.Parameters, optimization_problem: OptimizationProblem): + return NLOPTAlgorithms(model, parameters, optimization_problem) + +class NLOPTAlgorithms(Algorithm): + """ + A classical steepest descent algorithm to solve unconstrainted optimization problems. + """ + + @classmethod + def GetDefaultParameters(cls): + return Kratos.Parameters("""{ + "module" : "KratosMultiphysics.OptimizationApplication.algorithms", + "type" : "PLEASE_PROVIDE_AN_ALGORITHM_CLASS_NAME", + "objective" : {}, + "controls" : [], + "echo_level" : 0, + "settings" : { + "echo_level" : 0, + "line_search" : {}, + "conv_settings" : {} + } + }""") + + def __init__(self, model:Kratos.Model, parameters: Kratos.Parameters, optimization_problem: OptimizationProblem): + self.model = model + self.parameters = parameters + self._optimization_problem = optimization_problem + + parameters.ValidateAndAssignDefaults(self.GetDefaultParameters()) + + self.master_control = MasterControl() # Need to fill it with controls + + for control_name in parameters["controls"].GetStringArray(): + control = optimization_problem.GetControl(control_name) + self.master_control.AddControl(control) + + + settings = parameters["settings"] + settings.ValidateAndAssignDefaults(self.GetDefaultParameters()["settings"]) + + self.echo_level = settings["echo_level"].GetInt() + + ComponentDataView("algorithm", self._optimization_problem).SetDataBuffer(self.GetMinimumBufferSize()) + + self.__convergence_criteria = CreateConvergenceCriteria(settings["conv_settings"], self._optimization_problem) + self.__line_search_method = CreateLineSearch(settings["line_search"], self._optimization_problem) + + self.__objective = StandardizedNLOPTObjective(parameters["objective"], self.master_control, self._optimization_problem) + self.__control_field = None + self.__obj_val = None + + def GetMinimumBufferSize(self) -> int: + return 2 + + def Check(self): + pass + + def Initialize(self): + self.converged = False + self.__obj_val = None + self.__objective.Initialize() + self.__objective.Check() + self.master_control.Initialize() + self.__control_field = self.master_control.GetControlField() + self.algorithm_data = ComponentDataView("algorithm", self._optimization_problem) + + def Finalize(self): + self.__objective.Finalize() + self.master_control.Finalize() + + def ComputeSearchDirection(self, obj_grad) -> KratosOA.CollectiveExpression: + with TimeLogger("NLOPTAlgorithms::ComputeSearchDirection", None, "Finished"): + search_direction = obj_grad * -1.0 + self.algorithm_data.GetBufferedData()["search_direction"] = search_direction + return search_direction + + def ComputeControlUpdate(self, alpha) -> KratosOA.CollectiveExpression: + with TimeLogger("NLOPTAlgorithms::ComputeControlUpdate", None, "Finished"): + update = self.algorithm_data.GetBufferedData()["search_direction"] * alpha + self.algorithm_data.GetBufferedData()["control_field_update"] = update + + def UpdateControl(self) -> KratosOA.CollectiveExpression: + with TimeLogger("NLOPTAlgorithms::UpdateControl", None, "Finished"): + update = self.algorithm_data.GetBufferedData()["control_field_update"] + self.__control_field += update + self.algorithm_data.GetBufferedData()["control_field"] = self.__control_field + + def Output(self) -> KratosOA.CollectiveExpression: + with TimeLogger("NLOPTAlgorithms::Output", None, "Finished"): + self.CallOnAllProcesses(["output_processes"], Kratos.OutputProcess.PrintOutput) + + def GetCurrentObjValue(self) -> float: + return self.__obj_val + + def GetCurrentControlField(self): + return self.__control_field + + def Solve(self): + x0 = self.__control_field.Evaluate() + psudo_gradient = numpy.zeros(x0.size) + self.__objective.CalculateStandardizedValueAndGradients(x0,psudo_gradient) + self.__objective.CalculateStandardizedValueAndGradients(x0,psudo_gradient) + print(psudo_gradient) + hj + # while not self.converged: + # with OptimizationAlgorithmTimeLogger("NLOPTAlgorithms",self._optimization_problem.GetStep()): + # self.__obj_val = self.__objective.CalculateStandardizedValue(self.__control_field) + # obj_info = self.__objective.GetInfo() + # self.algorithm_data.GetBufferedData()["std_obj_value"] = obj_info["value"] + # self.algorithm_data.GetBufferedData()["rel_obj[%]"] = obj_info["rel_change [%]"] + # if "abs_change [%]" in obj_info: + # self.algorithm_data.GetBufferedData()["abs_obj[%]"] = obj_info["abs_change [%]"] + + # obj_grad = self.__objective.CalculateStandardizedGradient() + + # self.ComputeSearchDirection(obj_grad) + + # alpha = self.__line_search_method.ComputeStep() + + # self.ComputeControlUpdate(alpha) + + # self.Output() + + # self.UpdateControl() + + # self.converged = self.__convergence_criteria.IsConverged() + + # self._optimization_problem.AdvanceStep() + + # return self.converged + + def GetOptimizedObjectiveValue(self) -> float: + if self.converged: + return self.__obj_val + else: + raise RuntimeError("Optimization problem hasn't been solved.") diff --git a/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_objective.py b/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_objective.py new file mode 100644 index 000000000000..aacb87b050a3 --- /dev/null +++ b/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_objective.py @@ -0,0 +1,133 @@ +import KratosMultiphysics as Kratos +import KratosMultiphysics.OptimizationApplication as KratosOA +from KratosMultiphysics.OptimizationApplication.utilities.optimization_problem import OptimizationProblem +from KratosMultiphysics.OptimizationApplication.responses.response_routine import ResponseRoutine +from KratosMultiphysics.OptimizationApplication.controls.master_control import MasterControl +from KratosMultiphysics.OptimizationApplication.utilities.component_data_view import ComponentDataView +from KratosMultiphysics.OptimizationApplication.utilities.logger_utilities import DictLogger +from KratosMultiphysics.OptimizationApplication.utilities.logger_utilities import TimeLogger +import numpy + +class StandardizedNLOPTObjective(ResponseRoutine): + """Standardized objective response function + + This class transformed a user-given optimization problem into the standard format. + Supported objective types: + "minimization", + "maximization" + + """ + def __init__(self, parameters: Kratos.Parameters, master_control: MasterControl, optimization_problem: OptimizationProblem, required_buffer_size: int = 2): + default_parameters = Kratos.Parameters("""{ + "response_name": "", + "type" : "", + "scaling" : 1.0 + }""") + parameters.ValidateAndAssignDefaults(default_parameters) + + response = optimization_problem.GetResponse(parameters["response_name"].GetString()) + + super().__init__(master_control, response) + + if required_buffer_size < 2: + raise RuntimeError(f"Standardized objective requires 2 as minimum buffer size. [ response name = {self.GetReponse().GetName()} ]") + + component_data_view = ComponentDataView(response, optimization_problem) + component_data_view.SetDataBuffer(required_buffer_size) + + self.__optimization_problem = optimization_problem + self.__buffered_data = component_data_view.GetBufferedData() + self.__unbuffered_data = component_data_view.GetUnBufferedData() + + scaling = parameters["scaling"].GetDouble() + if scaling < 0.0: + raise RuntimeError(f"Scaling should be always positive [ given scale = {scaling}]") + + self.__objective_type = parameters["type"].GetString() + if self.__objective_type == "minimization": + self.__scaling = scaling + elif self.__objective_type == "maximization": + self.__scaling = -scaling + else: + raise RuntimeError(f"Requesting unsupported type {self.__objective_type} for objective response function. Supported types are: \n\tminimization\n\tmaximization") + + def GetInitialValue(self) -> float: + if self.__unbuffered_data.HasValue("initial_value"): + return self.__unbuffered_data["initial_value"] * self.__scaling + else: + raise RuntimeError(f"Response value for {self.GetReponse().GetName()} is not calculated yet.") + + def CalculateStandardizedValueAndGradients(self, control_field: numpy.ndarray, gradient_field: numpy.ndarray, save_value: bool = True) -> float: + with TimeLogger(f"CalculateStandardizedValueAndGradients {self.GetReponse().GetName()} value", None, "Finished"): + response_value = self.CalculateValue(control_field) + standardized_response_value = response_value * self.__scaling + + if not self.__unbuffered_data.HasValue("initial_value"): + self.__unbuffered_data["initial_value"] = response_value + + if save_value: + if self.__buffered_data.HasValue("value"): del self.__buffered_data["value"] + self.__buffered_data["value"] = response_value + + DictLogger("Objective info",self.GetInfo()) + + if gradient_field.size > 0: + gradient_collective_expression = self.CalculateGradient() + print(gradient_collective_expression.Evaluate()) + hj + gradient_field = gradient_collective_expression.Evaluate().copy() * self.__scaling + + return standardized_response_value + + def GetValue(self, step_index: int = 0) -> float: + return self.__buffered_data.GetValue("value", step_index) + + def GetStandardizedValue(self, step_index: int = 0) -> float: + return self.GetValue(step_index) * self.__scaling + + def CalculateStandardizedGradient(self, save_field: bool = True) -> KratosOA.CollectiveExpression: + + with TimeLogger(f"StandardizedNLOPTObjective::Calculate {self.GetReponse().GetName()} gradients", None, "Finished"): + gradient_collective_expression = self.CalculateGradient() + if save_field: + # save the physical gradients for post processing in unbuffered data container. + for physical_var, physical_gradient in self.GetRequiredPhysicalGradients().items(): + variable_name = f"d{self.GetReponse().GetName()}_d{physical_var.Name()}" + for physical_gradient_expression in physical_gradient.GetContainerExpressions(): + if self.__unbuffered_data.HasValue(variable_name): del self.__unbuffered_data[variable_name] + # cloning is a cheap operation, it only moves underlying pointers + # does not create additional memory. + self.__unbuffered_data[variable_name] = physical_gradient_expression.Clone() + + # save the filtered gradients for post processing in unbuffered data container. + for gradient_container_expression, control in zip(gradient_collective_expression.GetContainerExpressions(), self.GetMasterControl().GetListOfControls()): + variable_name = f"d{self.GetReponse().GetName()}_d{control.GetName()}" + if self.__unbuffered_data.HasValue(variable_name): del self.__unbuffered_data[variable_name] + # cloning is a cheap operation, it only moves underlying pointers + # does not create additional memory. + self.__unbuffered_data[variable_name] = gradient_container_expression.Clone() + + return gradient_collective_expression * self.__scaling + + def GetRelativeChange(self) -> float: + if self.__optimization_problem.GetStep() > 0: + return self.GetStandardizedValue() / self.GetStandardizedValue(1) - 1.0 if abs(self.GetStandardizedValue(1)) > 1e-12 else self.GetStandardizedValue() + else: + return 0.0 + + def GetAbsoluteChange(self) -> float: + return self.GetValue() - self.GetInitialValue() + + def GetInfo(self) -> dict: + info = { + "name": self.GetReponse().GetName(), + "type": self.__objective_type, + "value": self.GetValue(), + "abs_change": self.GetAbsoluteChange(), + "rel_change [%]": self.GetRelativeChange() * 100.0 + } + init_value = self.GetInitialValue() + if init_value: + info["abs_change [%]"] = self.GetAbsoluteChange()/init_value * 100 + + return info \ No newline at end of file From c3071c3e319ddc5c584653a9f2730d76d18f7290 Mon Sep 17 00:00:00 2001 From: RezaNajian Date: Sat, 1 Jul 2023 20:16:08 +0200 Subject: [PATCH 2/7] first clean implementation --- .../algorithms/NLOPT_algorithms.py | 130 +- .../standardized_NLOPT_constraint.py | 157 + .../standardized_NLOPT_objective.py | 62 +- .../python_scripts/controls/master_control.py | 20 +- .../materials_2D.json | 19 + .../optimization_parameters.json | 136 + .../primal_parameters.json | 92 + .../shell-thickness-opt-test/run_test.py | 14 + .../shell-thickness-opt-test/shell.mdpa | 4328 +++++++++++++++++ 9 files changed, 4841 insertions(+), 117 deletions(-) create mode 100644 applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_constraint.py create mode 100644 applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/materials_2D.json create mode 100644 applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/optimization_parameters.json create mode 100644 applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/primal_parameters.json create mode 100644 applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/run_test.py create mode 100644 applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/shell.mdpa diff --git a/applications/OptimizationApplication/python_scripts/algorithms/NLOPT_algorithms.py b/applications/OptimizationApplication/python_scripts/algorithms/NLOPT_algorithms.py index 4e05413fa62b..5ecc718d9a63 100644 --- a/applications/OptimizationApplication/python_scripts/algorithms/NLOPT_algorithms.py +++ b/applications/OptimizationApplication/python_scripts/algorithms/NLOPT_algorithms.py @@ -8,13 +8,10 @@ import KratosMultiphysics.OptimizationApplication as KratosOA from KratosMultiphysics.OptimizationApplication.utilities.optimization_problem import OptimizationProblem from KratosMultiphysics.OptimizationApplication.algorithms.standardized_NLOPT_objective import StandardizedNLOPTObjective +from KratosMultiphysics.OptimizationApplication.algorithms.standardized_NLOPT_constraint import StandardizedNLOPTConstraint from KratosMultiphysics.OptimizationApplication.controls.master_control import MasterControl from KratosMultiphysics.OptimizationApplication.algorithms.algorithm import Algorithm from KratosMultiphysics.OptimizationApplication.utilities.component_data_view import ComponentDataView -from KratosMultiphysics.OptimizationApplication.utilities.opt_convergence import CreateConvergenceCriteria -from KratosMultiphysics.OptimizationApplication.utilities.opt_line_search import CreateLineSearch -from KratosMultiphysics.OptimizationApplication.utilities.logger_utilities import TimeLogger -from KratosMultiphysics.OptimizationApplication.utilities.logger_utilities import OptimizationAlgorithmTimeLogger def Factory(model: Kratos.Model, parameters: Kratos.Parameters, optimization_problem: OptimizationProblem): @@ -31,12 +28,19 @@ def GetDefaultParameters(cls): "module" : "KratosMultiphysics.OptimizationApplication.algorithms", "type" : "PLEASE_PROVIDE_AN_ALGORITHM_CLASS_NAME", "objective" : {}, + "constraints" : [], "controls" : [], "echo_level" : 0, - "settings" : { - "echo_level" : 0, - "line_search" : {}, - "conv_settings" : {} + "NLOPT_settings" : { + "algorithm_name" : "MMA", + "algorithm_settings" : {}, + "stopping_criteria" : { + "objective_rel_tol": "", + "objective_abs_tol": "", + "controls_rel_tol": "", + "controls_abs_tol": "", + "maximum_function_evalualtion": 10 + } } }""") @@ -47,26 +51,30 @@ def __init__(self, model:Kratos.Model, parameters: Kratos.Parameters, optimizati parameters.ValidateAndAssignDefaults(self.GetDefaultParameters()) - self.master_control = MasterControl() # Need to fill it with controls - + # controls + self.master_control = MasterControl() for control_name in parameters["controls"].GetStringArray(): control = optimization_problem.GetControl(control_name) self.master_control.AddControl(control) + self.__control_field = None + # objective & constraints + self.__objective = StandardizedNLOPTObjective(parameters["objective"], self.master_control, self._optimization_problem) + self.__constraints = [] + for constraint_settings in parameters["constraints"]: + self.__constraints.append(StandardizedNLOPTConstraint(constraint_settings, self.master_control, self._optimization_problem)) - settings = parameters["settings"] - settings.ValidateAndAssignDefaults(self.GetDefaultParameters()["settings"]) - - self.echo_level = settings["echo_level"].GetInt() - - ComponentDataView("algorithm", self._optimization_problem).SetDataBuffer(self.GetMinimumBufferSize()) + # nlopt settings + NLOPT_settings = parameters["NLOPT_settings"] + NLOPT_settings.ValidateAndAssignDefaults(self.GetDefaultParameters()["NLOPT_settings"]) - self.__convergence_criteria = CreateConvergenceCriteria(settings["conv_settings"], self._optimization_problem) - self.__line_search_method = CreateLineSearch(settings["line_search"], self._optimization_problem) + # nlopt algorithm settings + self.algorithm_name = NLOPT_settings["algorithm_name"].GetString() + self.algorithm_settings = NLOPT_settings["algorithm_settings"] - self.__objective = StandardizedNLOPTObjective(parameters["objective"], self.master_control, self._optimization_problem) - self.__control_field = None - self.__obj_val = None + # stopping + self.stopping_criteria = NLOPT_settings["stopping_criteria"] + self.stopping_criteria.ValidateAndAssignDefaults(self.GetDefaultParameters()["NLOPT_settings"]["stopping_criteria"]) def GetMinimumBufferSize(self) -> int: return 2 @@ -76,80 +84,30 @@ def Check(self): def Initialize(self): self.converged = False - self.__obj_val = None self.__objective.Initialize() self.__objective.Check() + for constraint in self.__constraints: + constraint.Initialize() + constraint.Check() self.master_control.Initialize() self.__control_field = self.master_control.GetControlField() self.algorithm_data = ComponentDataView("algorithm", self._optimization_problem) def Finalize(self): self.__objective.Finalize() + for constraint in self.__constraints: + constraint.Finalize() self.master_control.Finalize() - def ComputeSearchDirection(self, obj_grad) -> KratosOA.CollectiveExpression: - with TimeLogger("NLOPTAlgorithms::ComputeSearchDirection", None, "Finished"): - search_direction = obj_grad * -1.0 - self.algorithm_data.GetBufferedData()["search_direction"] = search_direction - return search_direction - - def ComputeControlUpdate(self, alpha) -> KratosOA.CollectiveExpression: - with TimeLogger("NLOPTAlgorithms::ComputeControlUpdate", None, "Finished"): - update = self.algorithm_data.GetBufferedData()["search_direction"] * alpha - self.algorithm_data.GetBufferedData()["control_field_update"] = update - - def UpdateControl(self) -> KratosOA.CollectiveExpression: - with TimeLogger("NLOPTAlgorithms::UpdateControl", None, "Finished"): - update = self.algorithm_data.GetBufferedData()["control_field_update"] - self.__control_field += update - self.algorithm_data.GetBufferedData()["control_field"] = self.__control_field - - def Output(self) -> KratosOA.CollectiveExpression: - with TimeLogger("NLOPTAlgorithms::Output", None, "Finished"): - self.CallOnAllProcesses(["output_processes"], Kratos.OutputProcess.PrintOutput) - - def GetCurrentObjValue(self) -> float: - return self.__obj_val - - def GetCurrentControlField(self): - return self.__control_field - def Solve(self): x0 = self.__control_field.Evaluate() - psudo_gradient = numpy.zeros(x0.size) - self.__objective.CalculateStandardizedValueAndGradients(x0,psudo_gradient) - self.__objective.CalculateStandardizedValueAndGradients(x0,psudo_gradient) - print(psudo_gradient) - hj - # while not self.converged: - # with OptimizationAlgorithmTimeLogger("NLOPTAlgorithms",self._optimization_problem.GetStep()): - # self.__obj_val = self.__objective.CalculateStandardizedValue(self.__control_field) - # obj_info = self.__objective.GetInfo() - # self.algorithm_data.GetBufferedData()["std_obj_value"] = obj_info["value"] - # self.algorithm_data.GetBufferedData()["rel_obj[%]"] = obj_info["rel_change [%]"] - # if "abs_change [%]" in obj_info: - # self.algorithm_data.GetBufferedData()["abs_obj[%]"] = obj_info["abs_change [%]"] - - # obj_grad = self.__objective.CalculateStandardizedGradient() - - # self.ComputeSearchDirection(obj_grad) - - # alpha = self.__line_search_method.ComputeStep() - - # self.ComputeControlUpdate(alpha) - - # self.Output() - - # self.UpdateControl() - - # self.converged = self.__convergence_criteria.IsConverged() - - # self._optimization_problem.AdvanceStep() - - # return self.converged - - def GetOptimizedObjectiveValue(self) -> float: - if self.converged: - return self.__obj_val - else: - raise RuntimeError("Optimization problem hasn't been solved.") + opt = nlopt.opt(nlopt.LD_MMA, x0.size) + opt.set_min_objective(self.__objective.CalculateStandardizedValueAndGradients) + for constraint in self.__constraints: + opt.add_inequality_constraint(lambda x,grad: constraint.CalculateStandardizedValueAndGradients(x,grad),1e-8) + opt.set_ftol_rel(1e-4) + # opt.set_xtol_rel(1e-6) + opt.set_maxeval(200) + opt.optimize(x0) + minf = opt.last_optimum_value() + print("minimum value = ", minf) diff --git a/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_constraint.py b/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_constraint.py new file mode 100644 index 000000000000..1661bc449dd6 --- /dev/null +++ b/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_constraint.py @@ -0,0 +1,157 @@ +import KratosMultiphysics as Kratos +import KratosMultiphysics.OptimizationApplication as KratosOA +from KratosMultiphysics.OptimizationApplication.utilities.optimization_problem import OptimizationProblem +from KratosMultiphysics.OptimizationApplication.responses.response_routine import ResponseRoutine +from KratosMultiphysics.OptimizationApplication.controls.master_control import MasterControl +from KratosMultiphysics.OptimizationApplication.utilities.component_data_view import ComponentDataView +from KratosMultiphysics.OptimizationApplication.utilities.logger_utilities import DictLogger +from KratosMultiphysics.OptimizationApplication.utilities.logger_utilities import TimeLogger +from KratosMultiphysics.OptimizationApplication.utilities.helper_utilities import CallOnAll +import numpy +import sys + +class StandardizedNLOPTConstraint(ResponseRoutine): + """Standardized constraint response function + + This class creates instances to standardize any response function for the specified type of the contraint. + Supported contraint types: + "=", + "<", + ">" + + The reference value for the constraint either can be the "initial_value" or a specified value. + + """ + def __init__(self, parameters: Kratos.Parameters, master_control: MasterControl, optimization_problem: OptimizationProblem, required_buffer_size: int = 2): + default_parameters = Kratos.Parameters("""{ + "response_name" : "", + "type" : "", + "ref_value": "initial_value" + }""") + + if parameters.Has("ref_value") and parameters["ref_value"].IsDouble(): + default_parameters["ref_value"].SetDouble(0.0) + + parameters.ValidateAndAssignDefaults(default_parameters) + + response = optimization_problem.GetResponse(parameters["response_name"].GetString()) + + super().__init__(master_control, response) + + if required_buffer_size < 2: + raise RuntimeError(f"Standardized constraint requires 2 as minimum buffer size. [ response name = {self.GetReponse().GetName()} ]") + + component_data_view = ComponentDataView(response, optimization_problem) + component_data_view.SetDataBuffer(required_buffer_size) + + self.__optimization_problem = optimization_problem + self.__buffered_data = component_data_view.GetBufferedData() + self.__unbuffered_data = component_data_view.GetUnBufferedData() + + if parameters["ref_value"].IsDouble(): + self.__ref_type = "specified_value" + self.__reference_value = parameters["ref_value"].GetDouble() + elif parameters["ref_value"].IsString() and parameters["ref_value"].GetString() == "initial_value": + self.__ref_type = "initial_value" + self.__reference_value = None + else: + raise RuntimeError(f"Provided \"reference_type\" = {self.__ref_type} is not supported for constraint response functions. Followings are supported options: \n\tinitial_value\n\tfloat value") + + self.__constraint_type = parameters["type"].GetString() + if self.__constraint_type in ["=", "<"]: + self.__scaling = 1.0 + elif self.__constraint_type in [">"]: + self.__scaling = -1.0 + if not self.__reference_value is None: self.__reference_value *= -1 + else: + raise RuntimeError(f"Provided \"type\" = {self.__constraint_type} is not supported in constraint response functions. Followings are supported options: \n\t=\n\t<\n\t>") + self.__master_control_field = None + self.__zero_threshold = sys.float_info.epsilon + + def IsEqualityType(self) -> str: + return self.__constraint_type == "=" + + def GetReferenceValue(self) -> float: + if self.__reference_value is not None: + return self.__reference_value + else: + if self.__unbuffered_data.HasValue("initial_value"): + self.__reference_value = self.__unbuffered_data["initial_value"] + return self.__reference_value + else: + raise RuntimeError(f"Response value for {self.GetReponse().GetName()} is not calculated yet.") + + def Initialize(self): + super().Initialize() + self.__master_control_field = self.GetMasterControl().GetControlField().Evaluate() + + def CalculateStandardizedValueAndGradients(self, control_field: numpy.ndarray, gradient_field: numpy.ndarray, save_value: bool = True) -> float: + + # if numpy.linalg.norm(control_field-self.__master_control_field) > 1e-9 and gradient_field.size > 0: + # CallOnAll(self.__optimization_problem.GetListOfProcesses("output_processes"), Kratos.OutputProcess.PrintOutput) + # self.__optimization_problem.AdvanceStep() + + with TimeLogger(f"StandardizedNLOPTConstraint::Calculate {self.GetReponse().GetName()} value", None, "Finished"): + self.response_value = self.CalculateValue(control_field) + if not self.__unbuffered_data.HasValue("initial_value"): + self.__unbuffered_data["initial_value"] = self.response_value + + ref_value = self.GetReferenceValue() + standardized_response_value = self.response_value - ref_value + standardization_factor = self.__scaling + if abs(ref_value) > self.__zero_threshold: + standardization_factor /= abs(ref_value) + standardized_response_value *= standardization_factor + + if save_value: + if self.__buffered_data.HasValue("value"): del self.__buffered_data["value"] + self.__buffered_data["value"] = self.response_value + + DictLogger("Constraint info",self.GetInfo()) + + if gradient_field.size > 0: + gradient_collective_expression = self.CalculateGradient() + gradient_field[:] = gradient_collective_expression.Evaluate() * standardization_factor + + if save_value: + # save the physical gradients for post processing in unbuffered data container. + for physical_var, physical_gradient in self.GetRequiredPhysicalGradients().items(): + variable_name = f"d{self.GetReponse().GetName()}_d{physical_var.Name()}" + for physical_gradient_expression in physical_gradient.GetContainerExpressions(): + if self.__unbuffered_data.HasValue(variable_name): del self.__unbuffered_data[variable_name] + # cloning is a cheap operation, it only moves underlying pointers + # does not create additional memory. + self.__unbuffered_data[variable_name] = physical_gradient_expression.Clone() + + # save the filtered gradients for post processing in unbuffered data container. + for gradient_container_expression, control in zip(gradient_collective_expression.GetContainerExpressions(), self.GetMasterControl().GetListOfControls()): + variable_name = f"d{self.GetReponse().GetName()}_d{control.GetName()}" + if self.__unbuffered_data.HasValue(variable_name): del self.__unbuffered_data[variable_name] + # cloning is a cheap operation, it only moves underlying pointers + # does not create additional memory. + self.__unbuffered_data[variable_name] = gradient_container_expression.Clone() + + return standardized_response_value + + def GetValue(self, step_index: int = 0) -> float: + return self.response_value + + def GetAbsoluteViolation(self, step_index: int = 0) -> float: + ref_value = self.GetReferenceValue() + standardized_response_value = self.response_value - ref_value + standardization_factor = self.__scaling + if abs(ref_value) > self.__zero_threshold: + standardization_factor /= abs(ref_value) + standardization_factor *= 100 + standardized_response_value *= standardization_factor + return standardized_response_value + + def GetInfo(self) -> dict: + info = { + "name": self.GetReponse().GetName(), + "value": self.GetValue(), + "type": self.__constraint_type, + "ref_value": self.GetReferenceValue(), + "violation [%]": self.GetAbsoluteViolation() + } + return info \ No newline at end of file diff --git a/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_objective.py b/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_objective.py index aacb87b050a3..c3643618b7aa 100644 --- a/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_objective.py +++ b/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_objective.py @@ -6,6 +6,7 @@ from KratosMultiphysics.OptimizationApplication.utilities.component_data_view import ComponentDataView from KratosMultiphysics.OptimizationApplication.utilities.logger_utilities import DictLogger from KratosMultiphysics.OptimizationApplication.utilities.logger_utilities import TimeLogger +from KratosMultiphysics.OptimizationApplication.utilities.helper_utilities import CallOnAll import numpy class StandardizedNLOPTObjective(ResponseRoutine): @@ -50,6 +51,7 @@ def __init__(self, parameters: Kratos.Parameters, master_control: MasterControl, self.__scaling = -scaling else: raise RuntimeError(f"Requesting unsupported type {self.__objective_type} for objective response function. Supported types are: \n\tminimization\n\tmaximization") + self.__master_control_field = None def GetInitialValue(self) -> float: if self.__unbuffered_data.HasValue("initial_value"): @@ -57,13 +59,25 @@ def GetInitialValue(self) -> float: else: raise RuntimeError(f"Response value for {self.GetReponse().GetName()} is not calculated yet.") + def Initialize(self): + super().Initialize() + self.__master_control_field = self.GetMasterControl().GetControlField().Evaluate() + def CalculateStandardizedValueAndGradients(self, control_field: numpy.ndarray, gradient_field: numpy.ndarray, save_value: bool = True) -> float: + + if numpy.linalg.norm(control_field-self.__master_control_field) > 1e-9 and gradient_field.size > 0: + CallOnAll(self.__optimization_problem.GetListOfProcesses("output_processes"), Kratos.OutputProcess.PrintOutput) + self.__optimization_problem.AdvanceStep() + with TimeLogger(f"CalculateStandardizedValueAndGradients {self.GetReponse().GetName()} value", None, "Finished"): response_value = self.CalculateValue(control_field) standardized_response_value = response_value * self.__scaling if not self.__unbuffered_data.HasValue("initial_value"): self.__unbuffered_data["initial_value"] = response_value + standardized_response_value = 1.0 + else: + standardized_response_value /= self.__unbuffered_data["initial_value"] if save_value: if self.__buffered_data.HasValue("value"): del self.__buffered_data["value"] @@ -73,9 +87,27 @@ def CalculateStandardizedValueAndGradients(self, control_field: numpy.ndarray, g if gradient_field.size > 0: gradient_collective_expression = self.CalculateGradient() - print(gradient_collective_expression.Evaluate()) - hj - gradient_field = gradient_collective_expression.Evaluate().copy() * self.__scaling + gradient_field[:] = gradient_collective_expression.Evaluate() * self.__scaling + + gradient_field[:] /= self.__unbuffered_data["initial_value"] + + if save_value: + # save the physical gradients for post processing in unbuffered data container. + for physical_var, physical_gradient in self.GetRequiredPhysicalGradients().items(): + variable_name = f"d{self.GetReponse().GetName()}_d{physical_var.Name()}" + for physical_gradient_expression in physical_gradient.GetContainerExpressions(): + if self.__unbuffered_data.HasValue(variable_name): del self.__unbuffered_data[variable_name] + # cloning is a cheap operation, it only moves underlying pointers + # does not create additional memory. + self.__unbuffered_data[variable_name] = physical_gradient_expression.Clone() + + # save the filtered gradients for post processing in unbuffered data container. + for gradient_container_expression, control in zip(gradient_collective_expression.GetContainerExpressions(), self.GetMasterControl().GetListOfControls()): + variable_name = f"d{self.GetReponse().GetName()}_d{control.GetName()}" + if self.__unbuffered_data.HasValue(variable_name): del self.__unbuffered_data[variable_name] + # cloning is a cheap operation, it only moves underlying pointers + # does not create additional memory. + self.__unbuffered_data[variable_name] = gradient_container_expression.Clone() return standardized_response_value @@ -85,30 +117,6 @@ def GetValue(self, step_index: int = 0) -> float: def GetStandardizedValue(self, step_index: int = 0) -> float: return self.GetValue(step_index) * self.__scaling - def CalculateStandardizedGradient(self, save_field: bool = True) -> KratosOA.CollectiveExpression: - - with TimeLogger(f"StandardizedNLOPTObjective::Calculate {self.GetReponse().GetName()} gradients", None, "Finished"): - gradient_collective_expression = self.CalculateGradient() - if save_field: - # save the physical gradients for post processing in unbuffered data container. - for physical_var, physical_gradient in self.GetRequiredPhysicalGradients().items(): - variable_name = f"d{self.GetReponse().GetName()}_d{physical_var.Name()}" - for physical_gradient_expression in physical_gradient.GetContainerExpressions(): - if self.__unbuffered_data.HasValue(variable_name): del self.__unbuffered_data[variable_name] - # cloning is a cheap operation, it only moves underlying pointers - # does not create additional memory. - self.__unbuffered_data[variable_name] = physical_gradient_expression.Clone() - - # save the filtered gradients for post processing in unbuffered data container. - for gradient_container_expression, control in zip(gradient_collective_expression.GetContainerExpressions(), self.GetMasterControl().GetListOfControls()): - variable_name = f"d{self.GetReponse().GetName()}_d{control.GetName()}" - if self.__unbuffered_data.HasValue(variable_name): del self.__unbuffered_data[variable_name] - # cloning is a cheap operation, it only moves underlying pointers - # does not create additional memory. - self.__unbuffered_data[variable_name] = gradient_container_expression.Clone() - - return gradient_collective_expression * self.__scaling - def GetRelativeChange(self) -> float: if self.__optimization_problem.GetStep() > 0: return self.GetStandardizedValue() / self.GetStandardizedValue(1) - 1.0 if abs(self.GetStandardizedValue(1)) > 1e-12 else self.GetStandardizedValue() diff --git a/applications/OptimizationApplication/python_scripts/controls/master_control.py b/applications/OptimizationApplication/python_scripts/controls/master_control.py index 5501064d6bbf..40b5f05fa52b 100644 --- a/applications/OptimizationApplication/python_scripts/controls/master_control.py +++ b/applications/OptimizationApplication/python_scripts/controls/master_control.py @@ -4,6 +4,7 @@ from KratosMultiphysics.OptimizationApplication.utilities.helper_utilities import IsSameContainerExpression from KratosMultiphysics.OptimizationApplication.utilities.helper_utilities import HasContainerExpression from KratosMultiphysics.OptimizationApplication.utilities.logger_utilities import TimeLogger +import numpy class MasterControl: """Master control class. @@ -160,11 +161,11 @@ def MapGradient(self, physical_space_gradient_variable_and_collective_expression return mapped_gradients - def Update(self, update_collective_expressions: KratosOA.CollectiveExpression) -> 'dict[Control, bool]': + def Update(self, updated_control_vars: KratosOA.CollectiveExpression or numpy.ndarray) -> 'dict[Control, bool]': """Update each control with given collective expression's respective container expression. Args: - update_collective_expressions (KratosOA.CollectiveExpression): Update + updated_control_vars (KratosOA.CollectiveExpression or numpy.ndarray): Update Raises: RuntimeError: If number of controls and number of container expressions mismatch. @@ -172,12 +173,23 @@ def Update(self, update_collective_expressions: KratosOA.CollectiveExpression) - Returns: dict[Control, bool]: A map with control and a boolean whether the update changed anything in that control. """ - if len(self.__list_of_controls) != len(update_collective_expressions.GetContainerExpressions()): + + if isinstance(updated_control_vars, numpy.ndarray): + aux_field = self.GetEmptyField() + number_of_entities = [] + shapes = [] + for control in self.__list_of_controls: + number_of_entities.append(len(control.GetControlField().GetContainer())) + shapes.append(control.GetControlField().GetItemShape()) + KratosOA.CollectiveExpressionIO.Read(aux_field,updated_control_vars,shapes) + return self.Update(aux_field) + + if len(self.__list_of_controls) != len(updated_control_vars.GetContainerExpressions()): raise RuntimeError(f"Controls size and update size mismatch [ number of controls: {len(self.__list_of_controls)}, number of container expressions: {len(update_collective_expressions.GetContainerExpressions())} ].") with TimeLogger("MasterControl::Update", None, "Finished",False): update_map: 'dict[Control, bool]' = {} - for control, container_expression in zip(self.__list_of_controls, update_collective_expressions.GetContainerExpressions()): + for control, container_expression in zip(self.__list_of_controls, updated_control_vars.GetContainerExpressions()): update_map[control] = control.Update(container_expression) return update_map diff --git a/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/materials_2D.json b/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/materials_2D.json new file mode 100644 index 000000000000..c03115897f86 --- /dev/null +++ b/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/materials_2D.json @@ -0,0 +1,19 @@ +{ + "properties": [{ + "model_part_name": "shell.shell", + "properties_id": 0, + "Material": { + "name": "Shell_Material", + "constitutive_law": { + "name": "LinearElasticPlaneStress2DLaw" + }, + "Variables": { + "DENSITY": 7.85000E+03, + "YOUNG_MODULUS": 2.06900E+11, + "POISSON_RATIO": 2.90000E-01, + "THICKNESS": 8.00000E-2 + }, + "Tables": {} + } + }] +} diff --git a/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/optimization_parameters.json b/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/optimization_parameters.json new file mode 100644 index 000000000000..37e719662c7b --- /dev/null +++ b/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/optimization_parameters.json @@ -0,0 +1,136 @@ +{ + "problem_data": { + "parallel_type": "OpenMP", + "echo_level": 0 + }, + "model_parts": [ + { + "settings": { + "model_part_name": "shell", + "domain_size": 3, + "input_filename": "shell" + } + } + ], + "analyses": [ + { + "name": "shell_static", + "type": "kratos_analysis_execution_policy", + "settings": { + "model_part_names": [ + "shell" + ], + "analysis_module": "KratosMultiphysics.StructuralMechanicsApplication", + "analysis_type": "StructuralMechanicsAnalysis", + "analysis_settings": { + "@include_json": "primal_parameters.json" + }, + "analysis_output_settings": { + "nodal_solution_step_data_variables": ["DISPLACEMENT"] + } + } + } + ], + "responses": [ + { + "name": "mass_shell", + "type": "mass_response_function", + "settings": { + "evaluated_model_part_names": [ + "shell" + ] + } + }, + { + "name": "strain_energy_shell", + "type": "linear_strain_energy_response_function", + "settings": { + "evaluated_model_part_names": [ + "shell" + ], + "primal_analysis_name": "shell_static" + } + } + ], + "controls": [ + { + "name": "thickness_control", + "type": "thickness.shell_thickness_control", + "settings": { + "controlled_model_part_names": [ + "shell" + ], + "filter_settings": { + "type": "implicit", + "radius": 0.2, + "linear_solver_settings": { + "solver_type": "LinearSolversApplication.pardiso_lu" + } + }, + "output_all_fields": false, + "beta_value": 25.0, + "initial_physical_thickness": 0.15, + "physical_thicknesses": [0.1,0.2] + } + } + ], + "algorithm_settings": { + "type": "NLOPT_algorithms", + "NLOPT_settings" : { + "algorithm_name" : "MMA", + "algorithm_settings" : {}, + "stopping_criteria" : { + "objective_rel_tol": "", + "objective_abs_tol": "", + "controls_rel_tol": "", + "controls_abs_tol": "", + "maximum_function_evalualtion": 10 + } + }, + "controls": [ + "thickness_control" + ], + "objective": { + "response_name": "strain_energy_shell", + "type": "minimization", + "scaling": 1.0 + }, + "constraints": [ + { + "response_name" : "mass_shell", + "type" : "<", + "ref_value": "initial_value" + } + ] + }, + "processes": { + "kratos_processes": {}, + "optimization_data_processes": { + "output_processes": [ + { + "type": "optimization_problem_ascii_output_process", + "module": "KratosMultiphysics.OptimizationApplication.processes", + "settings": { + "output_file_name": "summary.csv", + "write_kratos_version": false, + "write_time_stamp": false + } + }, + { + "type": "optimization_problem_vtu_output_process", + "module": "KratosMultiphysics.OptimizationApplication.processes", + "settings": { + "file_format": "binary", + "write_deformed_configuration": false, + "list_of_output_components": [ + "all" + ], + "output_precision": 7, + "output_interval": 1, + "echo_level": 0 + } + } + ] + } + } +} diff --git a/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/primal_parameters.json b/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/primal_parameters.json new file mode 100644 index 000000000000..8f1c1b6e432f --- /dev/null +++ b/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/primal_parameters.json @@ -0,0 +1,92 @@ +{ + "problem_data" : { + "problem_name" : "shell", + "parallel_type" : "OpenMP", + "start_time" : 0.0, + "end_time" : 1.0, + "echo_level" : 0 + }, + "solver_settings" : { + "solver_type" : "static", + "echo_level" : 0, + "analysis_type" : "linear", + "model_part_name" : "shell", + "domain_size" : 3, + "time_stepping" : { + "time_step" : 1.0 + }, + "model_import_settings" : { + "input_type" : "use_input_model_part" + }, + "material_import_settings" :{ + "materials_filename": "materials_2D.json" + }, + "rotation_dofs" : true, + "linear_solver_settings" : { + "solver_type" : "LinearSolversApplication.pardiso_lu" + } + }, + "processes": { + "constraints_process_list" : [{ + "python_module" : "assign_vector_variable_process", + "kratos_module" : "KratosMultiphysics", + "help" : "This process fixes the selected components of a given vector variable", + "process_name" : "AssignVectorVariableProcess", + "Parameters" : { + "mesh_id" : 0, + "model_part_name" : "shell.edge_support", + "variable_name" : "DISPLACEMENT", + "value" : [0.0,0.0,0.0] + } + }], + "loads_process_list" : [{ + "python_module" : "assign_vector_by_direction_to_condition_process", + "kratos_module" : "KratosMultiphysics", + "help" : "This process fixes the selected components of a given vector variable", + "process_name" : "AssignVectorByDirectionToConditionProcess", + "Parameters" : { + "mesh_id" : 0, + "model_part_name" : "shell.surface_load", + "variable_name" : "SURFACE_LOAD", + "modulus" : 1000.0, + "direction" : [0.0,-1.0,0.0] + } + },{ + "python_module" : "assign_vector_by_direction_process", + "kratos_module" : "KratosMultiphysics", + "check" : "DirectorVectorNonZero direction", + "Parameters" : { + "model_part_name" : "shell", + "variable_name" : "VOLUME_ACCELERATION", + "constrained" : false, + "modulus" : 0.0, + "direction" : [0.0,-1.0,0.0], + "interval" : [0.0,"End"] + } + }] + }, + + "output_processes" : { + "vtk_output" : [{ + "python_module" : "vtk_output_process", + "kratos_module" : "KratosMultiphysics", + "process_name" : "VTKOutputProcess", + "Parameters" : { + "model_part_name": "shell", + "file_format": "binary", + "output_precision": 7, + "output_control_type": "step", + "output_frequency": 1.0, + "output_sub_model_parts": false, + "folder_name": "Primal_Results", + "save_output_files_in_folder": true, + "nodal_solution_step_data_variables": ["DISPLACEMENT","REACTION","ROTATION"], + "nodal_data_value_variables": [], + "element_data_value_variables": [], + "condition_data_value_variables": [], + "gauss_point_variables_extrapolated_to_nodes": [], + "gauss_point_variables_in_elements": ["VON_MISES_STRESS","THICKNESS"] + } + }] + } +} diff --git a/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/run_test.py b/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/run_test.py new file mode 100644 index 000000000000..7bb7e394f07d --- /dev/null +++ b/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/run_test.py @@ -0,0 +1,14 @@ +import KratosMultiphysics as Kratos +import KratosMultiphysics.KratosUnittest as kratos_unittest + +from KratosMultiphysics.kratos_utilities import DeleteFileIfExisting +from KratosMultiphysics.OptimizationApplication.optimization_analysis import OptimizationAnalysis +from KratosMultiphysics.compare_two_files_check_process import CompareTwoFilesCheckProcess + + +with kratos_unittest.WorkFolderScope(".", __file__): + with open("optimization_parameters.json", "r") as file_input: + parameters = Kratos.Parameters(file_input.read()) + model = Kratos.Model() + analysis = OptimizationAnalysis(model, parameters) + analysis.Run() diff --git a/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/shell.mdpa b/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/shell.mdpa new file mode 100644 index 000000000000..9dc95257dcea --- /dev/null +++ b/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/shell.mdpa @@ -0,0 +1,4328 @@ +// File created on Mon Nov 7 10:45:25 2022 +// Mesh Information: +// Number of Nodes: 440 +// Number of Elements: 400 +// Number of Conditions: 800 +// Number of Properties: 1 +// Number of SubModelParts: 5 +// SubModelPart: shell +// Number of Nodes: 440 +// Number of Elements: 400 +// Number of Conditions: 0 +// Number of Properties: 1 +// Number of SubModelParts: 0 +// SubModelPart: edge_support +// Number of Nodes: 40 +// Number of Elements: 0 +// Number of Conditions: 0 +// Number of Properties: 0 +// Number of SubModelParts: 0 +// SubModelPart: top_edge +// Number of Nodes: 40 +// Number of Elements: 0 +// Number of Conditions: 0 +// Number of Properties: 0 +// Number of SubModelParts: 0 +// SubModelPart: surface_load +// Number of Nodes: 440 +// Number of Elements: 0 +// Number of Conditions: 400 +// Number of Properties: 1 +// Number of SubModelParts: 0 +// SubModelPart: design +// Number of Nodes: 440 +// Number of Elements: 0 +// Number of Conditions: 400 +// Number of Properties: 1 +// Number of SubModelParts: 0 + +Begin Properties 0 +End Properties // 0 + +Begin Nodes + 1 1.0000000000 0.0000000000 0.0000000000 + 2 0.0000000000 0.0000000000 -1.0000000000 + 3 0.0871632284 0.9961940432 0.0000000000 + 4 0.0000000000 0.9961940432 -0.0871632284 + 5 0.9876883406 0.0000000000 -0.1564344650 + 6 0.9510565163 0.0000000000 -0.3090169944 + 7 0.8910065242 0.0000000000 -0.4539904997 + 8 0.8090169944 0.0000000000 -0.5877852523 + 9 0.7071067812 0.0000000000 -0.7071067812 + 10 0.5877852523 0.0000000000 -0.8090169944 + 11 0.4539904997 0.0000000000 -0.8910065242 + 12 0.3090169944 0.0000000000 -0.9510565163 + 13 0.1564344650 0.0000000000 -0.9876883406 + 14 0.0860901044 0.9961940432 -0.0136353330 + 15 0.0828971564 0.9961940432 -0.0269349189 + 16 0.0776630052 0.9961940432 -0.0395712776 + 17 0.0705165331 0.9961940432 -0.0512332602 + 18 0.0616337099 0.9961940432 -0.0616337099 + 19 0.0512332602 0.9961940432 -0.0705165331 + 20 0.0395712776 0.9961940432 -0.0776630052 + 21 0.0269349189 0.9961940432 -0.0828971564 + 22 0.0136353330 0.9961940432 -0.0860901044 + 23 0.9890159744 0.1478086680 0.0000000000 + 24 0.9563051954 0.2923702675 0.0000000000 + 25 0.9025862548 0.4305090621 0.0000000000 + 26 0.8290392533 0.5591904116 0.0000000000 + 27 0.7372798751 0.6755874376 0.0000000000 + 28 0.6293238949 0.7771431241 0.0000000000 + 29 0.5075428951 0.8616264908 0.0000000000 + 30 0.3746121671 0.9271816026 0.0000000000 + 31 0.2334519398 0.9723683416 0.0000000000 + 32 0.0000000000 0.1478086680 -0.9890159744 + 33 0.0000000000 0.2923702675 -0.9563051954 + 34 0.0000000000 0.4305090621 -0.9025862548 + 35 0.0000000000 0.5591904116 -0.8290392533 + 36 0.0000000000 0.6755874376 -0.7372798751 + 37 0.0000000000 0.7771431241 -0.6293238949 + 38 0.0000000000 0.8616264908 -0.5075428951 + 39 0.0000000000 0.9271816026 -0.3746121671 + 40 0.0000000000 0.9723683416 -0.2334519398 + 41 0.9768395466 0.1478086680 -0.1547161849 + 42 0.9445314915 0.2923702675 -0.1495990917 + 43 0.8914739203 0.4305090621 -0.1411955979 + 44 0.8188324044 0.5591904116 -0.1296903121 + 45 0.7282027364 0.6755874376 -0.1153359828 + 46 0.6215758734 0.7771431241 -0.0984479468 + 47 0.5012941999 0.8616264908 -0.0793972013 + 48 0.3700000697 0.9271816026 -0.0586022540 + 49 0.2305777591 0.9723683416 -0.0365199293 + 50 0.9406100872 0.1478086680 -0.3056227438 + 51 0.9095002876 0.2923702675 -0.2955145572 + 52 0.8584105392 0.4305090621 -0.2789144916 + 53 0.7884631841 0.5591904116 -0.2561872183 + 54 0.7011948295 0.6755874376 -0.2278320110 + 55 0.5985225911 0.7771431241 -0.1944717785 + 56 0.4827019777 0.8616264908 -0.1568393800 + 57 0.3562773426 0.9271816026 -0.1157615259 + 58 0.2220259886 0.9723683416 -0.0721406168 + 59 0.8812196857 0.1478086680 -0.4490038565 + 60 0.8520741682 0.2923702675 -0.4341534735 + 61 0.8042102417 0.4305090621 -0.4097655849 + 62 0.7386793835 0.5591904116 -0.3763759449 + 63 0.6569211789 0.6755874376 -0.3347180589 + 64 0.5607316961 0.7771431241 -0.2857070695 + 65 0.4522240309 0.8616264908 -0.2304196526 + 66 0.3337818849 0.9271816026 -0.1700703649 + 67 0.2080072015 0.9723683416 -0.1059849628 + 68 0.8001307310 0.1478086680 -0.5813290041 + 69 0.7736671549 0.2923702675 -0.5621020905 + 70 0.7302076191 0.4305090621 -0.5305268895 + 71 0.6707068449 0.5591904116 -0.4872970467 + 72 0.5964719486 0.6755874376 -0.4333622374 + 73 0.5091337259 0.7771431241 -0.3699073043 + 74 0.4106108275 0.8616264908 -0.2983262287 + 75 0.3030676095 0.9271816026 -0.2201915071 + 76 0.1888665867 0.9723683416 -0.1372196074 + 77 0.6993399022 0.1478086680 -0.6993399022 + 78 0.6762098885 0.2923702675 -0.6762098885 + 79 0.6382248614 0.4305090621 -0.6382248614 + 80 0.5862192779 0.5591904116 -0.5862192779 + 81 0.5213355993 0.6755874376 -0.5213355993 + 82 0.4449991936 0.7771431241 -0.4449991936 + 83 0.3588870229 0.8616264908 -0.3588870229 + 84 0.2648908037 0.9271816026 -0.2648908037 + 85 0.1650754497 0.9723683416 -0.1650754497 + 86 0.5813290041 0.1478086680 -0.8001307310 + 87 0.5621020905 0.2923702675 -0.7736671549 + 88 0.5305268895 0.4305090621 -0.7302076191 + 89 0.4872970467 0.5591904116 -0.6707068449 + 90 0.4333622374 0.6755874376 -0.5964719486 + 91 0.3699073043 0.7771431241 -0.5091337259 + 92 0.2983262287 0.8616264908 -0.4106108275 + 93 0.2201915071 0.9271816026 -0.3030676095 + 94 0.1372196074 0.9723683416 -0.1888665867 + 95 0.4490038565 0.1478086680 -0.8812196857 + 96 0.4341534735 0.2923702675 -0.8520741682 + 97 0.4097655849 0.4305090621 -0.8042102417 + 98 0.3763759449 0.5591904116 -0.7386793835 + 99 0.3347180589 0.6755874376 -0.6569211789 + 100 0.2857070695 0.7771431241 -0.5607316961 + 101 0.2304196526 0.8616264908 -0.4522240309 + 102 0.1700703649 0.9271816026 -0.3337818849 + 103 0.1059849628 0.9723683416 -0.2080072015 + 104 0.3056227438 0.1478086680 -0.9406100872 + 105 0.2955145572 0.2923702675 -0.9095002876 + 106 0.2789144916 0.4305090621 -0.8584105392 + 107 0.2561872183 0.5591904116 -0.7884631841 + 108 0.2278320110 0.6755874376 -0.7011948295 + 109 0.1944717785 0.7771431241 -0.5985225911 + 110 0.1568393800 0.8616264908 -0.4827019777 + 111 0.1157615259 0.9271816026 -0.3562773426 + 112 0.0721406168 0.9723683416 -0.2220259886 + 113 0.1547161849 0.1478086680 -0.9768395466 + 114 0.1495990917 0.2923702675 -0.9445314915 + 115 0.1411955979 0.4305090621 -0.8914739203 + 116 0.1296903121 0.5591904116 -0.8188324044 + 117 0.1153359828 0.6755874376 -0.7282027364 + 118 0.0984479468 0.7771431241 -0.6215758734 + 119 0.0793972013 0.8616264908 -0.5012941999 + 120 0.0586022540 0.9271816026 -0.3700000697 + 121 0.0365199293 0.9723683416 -0.2305777591 + 122 -0.1564344650 0.0000000000 -0.9876883406 + 123 -0.3090169944 0.0000000000 -0.9510565163 + 124 -0.4539904997 0.0000000000 -0.8910065242 + 125 -0.5877852523 0.0000000000 -0.8090169944 + 126 -0.7071067812 0.0000000000 -0.7071067812 + 127 -0.8090169944 0.0000000000 -0.5877852523 + 128 -0.8910065242 0.0000000000 -0.4539904997 + 129 -0.9510565163 0.0000000000 -0.3090169944 + 130 -0.9876883406 0.0000000000 -0.1564344650 + 131 -1.0000000000 0.0000000000 -0.0000000000 + 132 -0.0136353330 0.9961940432 -0.0860901044 + 133 -0.0269349189 0.9961940432 -0.0828971564 + 134 -0.0395712776 0.9961940432 -0.0776630052 + 135 -0.0512332602 0.9961940432 -0.0705165331 + 136 -0.0616337099 0.9961940432 -0.0616337099 + 137 -0.0705165331 0.9961940432 -0.0512332602 + 138 -0.0776630052 0.9961940432 -0.0395712776 + 139 -0.0828971564 0.9961940432 -0.0269349189 + 140 -0.0860901044 0.9961940432 -0.0136353330 + 141 -0.0871632284 0.9961940432 -0.0000000000 + 142 -0.9890159744 0.1478086680 -0.0000000000 + 143 -0.9563051954 0.2923702675 -0.0000000000 + 144 -0.9025862548 0.4305090621 -0.0000000000 + 145 -0.8290392533 0.5591904116 -0.0000000000 + 146 -0.7372798751 0.6755874376 -0.0000000000 + 147 -0.6293238949 0.7771431241 -0.0000000000 + 148 -0.5075428951 0.8616264908 -0.0000000000 + 149 -0.3746121671 0.9271816026 -0.0000000000 + 150 -0.2334519398 0.9723683416 -0.0000000000 + 151 -0.1547161849 0.1478086680 -0.9768395466 + 152 -0.1495990917 0.2923702675 -0.9445314915 + 153 -0.1411955979 0.4305090621 -0.8914739203 + 154 -0.1296903121 0.5591904116 -0.8188324044 + 155 -0.1153359828 0.6755874376 -0.7282027364 + 156 -0.0984479468 0.7771431241 -0.6215758734 + 157 -0.0793972013 0.8616264908 -0.5012941999 + 158 -0.0586022540 0.9271816026 -0.3700000697 + 159 -0.0365199293 0.9723683416 -0.2305777591 + 160 -0.3056227438 0.1478086680 -0.9406100872 + 161 -0.2955145572 0.2923702675 -0.9095002876 + 162 -0.2789144916 0.4305090621 -0.8584105392 + 163 -0.2561872183 0.5591904116 -0.7884631841 + 164 -0.2278320110 0.6755874376 -0.7011948295 + 165 -0.1944717785 0.7771431241 -0.5985225911 + 166 -0.1568393800 0.8616264908 -0.4827019777 + 167 -0.1157615259 0.9271816026 -0.3562773426 + 168 -0.0721406168 0.9723683416 -0.2220259886 + 169 -0.4490038565 0.1478086680 -0.8812196857 + 170 -0.4341534735 0.2923702675 -0.8520741682 + 171 -0.4097655849 0.4305090621 -0.8042102417 + 172 -0.3763759449 0.5591904116 -0.7386793835 + 173 -0.3347180589 0.6755874376 -0.6569211789 + 174 -0.2857070695 0.7771431241 -0.5607316961 + 175 -0.2304196526 0.8616264908 -0.4522240309 + 176 -0.1700703649 0.9271816026 -0.3337818849 + 177 -0.1059849628 0.9723683416 -0.2080072015 + 178 -0.5813290041 0.1478086680 -0.8001307310 + 179 -0.5621020905 0.2923702675 -0.7736671549 + 180 -0.5305268895 0.4305090621 -0.7302076191 + 181 -0.4872970467 0.5591904116 -0.6707068449 + 182 -0.4333622374 0.6755874376 -0.5964719486 + 183 -0.3699073043 0.7771431241 -0.5091337259 + 184 -0.2983262287 0.8616264908 -0.4106108275 + 185 -0.2201915071 0.9271816026 -0.3030676095 + 186 -0.1372196074 0.9723683416 -0.1888665867 + 187 -0.6993399022 0.1478086680 -0.6993399022 + 188 -0.6762098885 0.2923702675 -0.6762098885 + 189 -0.6382248614 0.4305090621 -0.6382248614 + 190 -0.5862192779 0.5591904116 -0.5862192779 + 191 -0.5213355993 0.6755874376 -0.5213355993 + 192 -0.4449991936 0.7771431241 -0.4449991936 + 193 -0.3588870229 0.8616264908 -0.3588870229 + 194 -0.2648908037 0.9271816026 -0.2648908037 + 195 -0.1650754497 0.9723683416 -0.1650754497 + 196 -0.8001307310 0.1478086680 -0.5813290041 + 197 -0.7736671549 0.2923702675 -0.5621020905 + 198 -0.7302076191 0.4305090621 -0.5305268895 + 199 -0.6707068449 0.5591904116 -0.4872970467 + 200 -0.5964719486 0.6755874376 -0.4333622374 + 201 -0.5091337259 0.7771431241 -0.3699073043 + 202 -0.4106108275 0.8616264908 -0.2983262287 + 203 -0.3030676095 0.9271816026 -0.2201915071 + 204 -0.1888665867 0.9723683416 -0.1372196074 + 205 -0.8812196857 0.1478086680 -0.4490038565 + 206 -0.8520741682 0.2923702675 -0.4341534735 + 207 -0.8042102417 0.4305090621 -0.4097655849 + 208 -0.7386793835 0.5591904116 -0.3763759449 + 209 -0.6569211789 0.6755874376 -0.3347180589 + 210 -0.5607316961 0.7771431241 -0.2857070695 + 211 -0.4522240309 0.8616264908 -0.2304196526 + 212 -0.3337818849 0.9271816026 -0.1700703649 + 213 -0.2080072015 0.9723683416 -0.1059849628 + 214 -0.9406100872 0.1478086680 -0.3056227438 + 215 -0.9095002876 0.2923702675 -0.2955145572 + 216 -0.8584105392 0.4305090621 -0.2789144916 + 217 -0.7884631841 0.5591904116 -0.2561872183 + 218 -0.7011948295 0.6755874376 -0.2278320110 + 219 -0.5985225911 0.7771431241 -0.1944717785 + 220 -0.4827019777 0.8616264908 -0.1568393800 + 221 -0.3562773426 0.9271816026 -0.1157615259 + 222 -0.2220259886 0.9723683416 -0.0721406168 + 223 -0.9768395466 0.1478086680 -0.1547161849 + 224 -0.9445314915 0.2923702675 -0.1495990917 + 225 -0.8914739203 0.4305090621 -0.1411955979 + 226 -0.8188324044 0.5591904116 -0.1296903121 + 227 -0.7282027364 0.6755874376 -0.1153359828 + 228 -0.6215758734 0.7771431241 -0.0984479468 + 229 -0.5012941999 0.8616264908 -0.0793972013 + 230 -0.3700000697 0.9271816026 -0.0586022540 + 231 -0.2305777591 0.9723683416 -0.0365199293 + 232 -0.9876883406 0.0000000000 0.1564344650 + 233 -0.9510565163 0.0000000000 0.3090169944 + 234 -0.8910065242 0.0000000000 0.4539904997 + 235 -0.8090169944 0.0000000000 0.5877852523 + 236 -0.7071067812 0.0000000000 0.7071067812 + 237 -0.5877852523 0.0000000000 0.8090169944 + 238 -0.4539904997 0.0000000000 0.8910065242 + 239 -0.3090169944 0.0000000000 0.9510565163 + 240 -0.1564344650 0.0000000000 0.9876883406 + 241 -0.0000000000 0.0000000000 1.0000000000 + 242 -0.0860901044 0.9961940432 0.0136353330 + 243 -0.0828971564 0.9961940432 0.0269349189 + 244 -0.0776630052 0.9961940432 0.0395712776 + 245 -0.0705165331 0.9961940432 0.0512332602 + 246 -0.0616337099 0.9961940432 0.0616337099 + 247 -0.0512332602 0.9961940432 0.0705165331 + 248 -0.0395712776 0.9961940432 0.0776630052 + 249 -0.0269349189 0.9961940432 0.0828971564 + 250 -0.0136353330 0.9961940432 0.0860901044 + 251 -0.0000000000 0.9961940432 0.0871632284 + 252 -0.0000000000 0.1478086680 0.9890159744 + 253 -0.0000000000 0.2923702675 0.9563051954 + 254 -0.0000000000 0.4305090621 0.9025862548 + 255 -0.0000000000 0.5591904116 0.8290392533 + 256 -0.0000000000 0.6755874376 0.7372798751 + 257 -0.0000000000 0.7771431241 0.6293238949 + 258 -0.0000000000 0.8616264908 0.5075428951 + 259 -0.0000000000 0.9271816026 0.3746121671 + 260 -0.0000000000 0.9723683416 0.2334519398 + 261 -0.9768395466 0.1478086680 0.1547161849 + 262 -0.9445314915 0.2923702675 0.1495990917 + 263 -0.8914739203 0.4305090621 0.1411955979 + 264 -0.8188324044 0.5591904116 0.1296903121 + 265 -0.7282027364 0.6755874376 0.1153359828 + 266 -0.6215758734 0.7771431241 0.0984479468 + 267 -0.5012941999 0.8616264908 0.0793972013 + 268 -0.3700000697 0.9271816026 0.0586022540 + 269 -0.2305777591 0.9723683416 0.0365199293 + 270 -0.9406100872 0.1478086680 0.3056227438 + 271 -0.9095002876 0.2923702675 0.2955145572 + 272 -0.8584105392 0.4305090621 0.2789144916 + 273 -0.7884631841 0.5591904116 0.2561872183 + 274 -0.7011948295 0.6755874376 0.2278320110 + 275 -0.5985225911 0.7771431241 0.1944717785 + 276 -0.4827019777 0.8616264908 0.1568393800 + 277 -0.3562773426 0.9271816026 0.1157615259 + 278 -0.2220259886 0.9723683416 0.0721406168 + 279 -0.8812196857 0.1478086680 0.4490038565 + 280 -0.8520741682 0.2923702675 0.4341534735 + 281 -0.8042102417 0.4305090621 0.4097655849 + 282 -0.7386793835 0.5591904116 0.3763759449 + 283 -0.6569211789 0.6755874376 0.3347180589 + 284 -0.5607316961 0.7771431241 0.2857070695 + 285 -0.4522240309 0.8616264908 0.2304196526 + 286 -0.3337818849 0.9271816026 0.1700703649 + 287 -0.2080072015 0.9723683416 0.1059849628 + 288 -0.8001307310 0.1478086680 0.5813290041 + 289 -0.7736671549 0.2923702675 0.5621020905 + 290 -0.7302076191 0.4305090621 0.5305268895 + 291 -0.6707068449 0.5591904116 0.4872970467 + 292 -0.5964719486 0.6755874376 0.4333622374 + 293 -0.5091337259 0.7771431241 0.3699073043 + 294 -0.4106108275 0.8616264908 0.2983262287 + 295 -0.3030676095 0.9271816026 0.2201915071 + 296 -0.1888665867 0.9723683416 0.1372196074 + 297 -0.6993399022 0.1478086680 0.6993399022 + 298 -0.6762098885 0.2923702675 0.6762098885 + 299 -0.6382248614 0.4305090621 0.6382248614 + 300 -0.5862192779 0.5591904116 0.5862192779 + 301 -0.5213355993 0.6755874376 0.5213355993 + 302 -0.4449991936 0.7771431241 0.4449991936 + 303 -0.3588870229 0.8616264908 0.3588870229 + 304 -0.2648908037 0.9271816026 0.2648908037 + 305 -0.1650754497 0.9723683416 0.1650754497 + 306 -0.5813290041 0.1478086680 0.8001307310 + 307 -0.5621020905 0.2923702675 0.7736671549 + 308 -0.5305268895 0.4305090621 0.7302076191 + 309 -0.4872970467 0.5591904116 0.6707068449 + 310 -0.4333622374 0.6755874376 0.5964719486 + 311 -0.3699073043 0.7771431241 0.5091337259 + 312 -0.2983262287 0.8616264908 0.4106108275 + 313 -0.2201915071 0.9271816026 0.3030676095 + 314 -0.1372196074 0.9723683416 0.1888665867 + 315 -0.4490038565 0.1478086680 0.8812196857 + 316 -0.4341534735 0.2923702675 0.8520741682 + 317 -0.4097655849 0.4305090621 0.8042102417 + 318 -0.3763759449 0.5591904116 0.7386793835 + 319 -0.3347180589 0.6755874376 0.6569211789 + 320 -0.2857070695 0.7771431241 0.5607316961 + 321 -0.2304196526 0.8616264908 0.4522240309 + 322 -0.1700703649 0.9271816026 0.3337818849 + 323 -0.1059849628 0.9723683416 0.2080072015 + 324 -0.3056227438 0.1478086680 0.9406100872 + 325 -0.2955145572 0.2923702675 0.9095002876 + 326 -0.2789144916 0.4305090621 0.8584105392 + 327 -0.2561872183 0.5591904116 0.7884631841 + 328 -0.2278320110 0.6755874376 0.7011948295 + 329 -0.1944717785 0.7771431241 0.5985225911 + 330 -0.1568393800 0.8616264908 0.4827019777 + 331 -0.1157615259 0.9271816026 0.3562773426 + 332 -0.0721406168 0.9723683416 0.2220259886 + 333 -0.1547161849 0.1478086680 0.9768395466 + 334 -0.1495990917 0.2923702675 0.9445314915 + 335 -0.1411955979 0.4305090621 0.8914739203 + 336 -0.1296903121 0.5591904116 0.8188324044 + 337 -0.1153359828 0.6755874376 0.7282027364 + 338 -0.0984479468 0.7771431241 0.6215758734 + 339 -0.0793972013 0.8616264908 0.5012941999 + 340 -0.0586022540 0.9271816026 0.3700000697 + 341 -0.0365199293 0.9723683416 0.2305777591 + 342 0.1564344650 0.0000000000 0.9876883406 + 343 0.3090169944 0.0000000000 0.9510565163 + 344 0.4539904997 0.0000000000 0.8910065242 + 345 0.5877852523 0.0000000000 0.8090169944 + 346 0.7071067812 0.0000000000 0.7071067812 + 347 0.8090169944 0.0000000000 0.5877852523 + 348 0.8910065242 0.0000000000 0.4539904997 + 349 0.9510565163 0.0000000000 0.3090169944 + 350 0.9876883406 0.0000000000 0.1564344650 + 351 0.0136353330 0.9961940432 0.0860901044 + 352 0.0269349189 0.9961940432 0.0828971564 + 353 0.0395712776 0.9961940432 0.0776630052 + 354 0.0512332602 0.9961940432 0.0705165331 + 355 0.0616337099 0.9961940432 0.0616337099 + 356 0.0705165331 0.9961940432 0.0512332602 + 357 0.0776630052 0.9961940432 0.0395712776 + 358 0.0828971564 0.9961940432 0.0269349189 + 359 0.0860901044 0.9961940432 0.0136353330 + 360 0.1547161849 0.1478086680 0.9768395466 + 361 0.1495990917 0.2923702675 0.9445314915 + 362 0.1411955979 0.4305090621 0.8914739203 + 363 0.1296903121 0.5591904116 0.8188324044 + 364 0.1153359828 0.6755874376 0.7282027364 + 365 0.0984479468 0.7771431241 0.6215758734 + 366 0.0793972013 0.8616264908 0.5012941999 + 367 0.0586022540 0.9271816026 0.3700000697 + 368 0.0365199293 0.9723683416 0.2305777591 + 369 0.3056227438 0.1478086680 0.9406100872 + 370 0.2955145572 0.2923702675 0.9095002876 + 371 0.2789144916 0.4305090621 0.8584105392 + 372 0.2561872183 0.5591904116 0.7884631841 + 373 0.2278320110 0.6755874376 0.7011948295 + 374 0.1944717785 0.7771431241 0.5985225911 + 375 0.1568393800 0.8616264908 0.4827019777 + 376 0.1157615259 0.9271816026 0.3562773426 + 377 0.0721406168 0.9723683416 0.2220259886 + 378 0.4490038565 0.1478086680 0.8812196857 + 379 0.4341534735 0.2923702675 0.8520741682 + 380 0.4097655849 0.4305090621 0.8042102417 + 381 0.3763759449 0.5591904116 0.7386793835 + 382 0.3347180589 0.6755874376 0.6569211789 + 383 0.2857070695 0.7771431241 0.5607316961 + 384 0.2304196526 0.8616264908 0.4522240309 + 385 0.1700703649 0.9271816026 0.3337818849 + 386 0.1059849628 0.9723683416 0.2080072015 + 387 0.5813290041 0.1478086680 0.8001307310 + 388 0.5621020905 0.2923702675 0.7736671549 + 389 0.5305268895 0.4305090621 0.7302076191 + 390 0.4872970467 0.5591904116 0.6707068449 + 391 0.4333622374 0.6755874376 0.5964719486 + 392 0.3699073043 0.7771431241 0.5091337259 + 393 0.2983262287 0.8616264908 0.4106108275 + 394 0.2201915071 0.9271816026 0.3030676095 + 395 0.1372196074 0.9723683416 0.1888665867 + 396 0.6993399022 0.1478086680 0.6993399022 + 397 0.6762098885 0.2923702675 0.6762098885 + 398 0.6382248614 0.4305090621 0.6382248614 + 399 0.5862192779 0.5591904116 0.5862192779 + 400 0.5213355993 0.6755874376 0.5213355993 + 401 0.4449991936 0.7771431241 0.4449991936 + 402 0.3588870229 0.8616264908 0.3588870229 + 403 0.2648908037 0.9271816026 0.2648908037 + 404 0.1650754497 0.9723683416 0.1650754497 + 405 0.8001307310 0.1478086680 0.5813290041 + 406 0.7736671549 0.2923702675 0.5621020905 + 407 0.7302076191 0.4305090621 0.5305268895 + 408 0.6707068449 0.5591904116 0.4872970467 + 409 0.5964719486 0.6755874376 0.4333622374 + 410 0.5091337259 0.7771431241 0.3699073043 + 411 0.4106108275 0.8616264908 0.2983262287 + 412 0.3030676095 0.9271816026 0.2201915071 + 413 0.1888665867 0.9723683416 0.1372196074 + 414 0.8812196857 0.1478086680 0.4490038565 + 415 0.8520741682 0.2923702675 0.4341534735 + 416 0.8042102417 0.4305090621 0.4097655849 + 417 0.7386793835 0.5591904116 0.3763759449 + 418 0.6569211789 0.6755874376 0.3347180589 + 419 0.5607316961 0.7771431241 0.2857070695 + 420 0.4522240309 0.8616264908 0.2304196526 + 421 0.3337818849 0.9271816026 0.1700703649 + 422 0.2080072015 0.9723683416 0.1059849628 + 423 0.9406100872 0.1478086680 0.3056227438 + 424 0.9095002876 0.2923702675 0.2955145572 + 425 0.8584105392 0.4305090621 0.2789144916 + 426 0.7884631841 0.5591904116 0.2561872183 + 427 0.7011948295 0.6755874376 0.2278320110 + 428 0.5985225911 0.7771431241 0.1944717785 + 429 0.4827019777 0.8616264908 0.1568393800 + 430 0.3562773426 0.9271816026 0.1157615259 + 431 0.2220259886 0.9723683416 0.0721406168 + 432 0.9768395466 0.1478086680 0.1547161849 + 433 0.9445314915 0.2923702675 0.1495990917 + 434 0.8914739203 0.4305090621 0.1411955979 + 435 0.8188324044 0.5591904116 0.1296903121 + 436 0.7282027364 0.6755874376 0.1153359828 + 437 0.6215758734 0.7771431241 0.0984479468 + 438 0.5012941999 0.8616264908 0.0793972013 + 439 0.3700000697 0.9271816026 0.0586022540 + 440 0.2305777591 0.9723683416 0.0365199293 +End Nodes + +Begin Elements ShellThickElement3D4N + 1 0 1 5 41 23 + 2 0 23 41 42 24 + 3 0 24 42 43 25 + 4 0 25 43 44 26 + 5 0 26 44 45 27 + 6 0 27 45 46 28 + 7 0 28 46 47 29 + 8 0 29 47 48 30 + 9 0 30 48 49 31 + 10 0 31 49 14 3 + 11 0 5 6 50 41 + 12 0 41 50 51 42 + 13 0 42 51 52 43 + 14 0 43 52 53 44 + 15 0 44 53 54 45 + 16 0 45 54 55 46 + 17 0 46 55 56 47 + 18 0 47 56 57 48 + 19 0 48 57 58 49 + 20 0 49 58 15 14 + 21 0 6 7 59 50 + 22 0 50 59 60 51 + 23 0 51 60 61 52 + 24 0 52 61 62 53 + 25 0 53 62 63 54 + 26 0 54 63 64 55 + 27 0 55 64 65 56 + 28 0 56 65 66 57 + 29 0 57 66 67 58 + 30 0 58 67 16 15 + 31 0 7 8 68 59 + 32 0 59 68 69 60 + 33 0 60 69 70 61 + 34 0 61 70 71 62 + 35 0 62 71 72 63 + 36 0 63 72 73 64 + 37 0 64 73 74 65 + 38 0 65 74 75 66 + 39 0 66 75 76 67 + 40 0 67 76 17 16 + 41 0 8 9 77 68 + 42 0 68 77 78 69 + 43 0 69 78 79 70 + 44 0 70 79 80 71 + 45 0 71 80 81 72 + 46 0 72 81 82 73 + 47 0 73 82 83 74 + 48 0 74 83 84 75 + 49 0 75 84 85 76 + 50 0 76 85 18 17 + 51 0 9 10 86 77 + 52 0 77 86 87 78 + 53 0 78 87 88 79 + 54 0 79 88 89 80 + 55 0 80 89 90 81 + 56 0 81 90 91 82 + 57 0 82 91 92 83 + 58 0 83 92 93 84 + 59 0 84 93 94 85 + 60 0 85 94 19 18 + 61 0 10 11 95 86 + 62 0 86 95 96 87 + 63 0 87 96 97 88 + 64 0 88 97 98 89 + 65 0 89 98 99 90 + 66 0 90 99 100 91 + 67 0 91 100 101 92 + 68 0 92 101 102 93 + 69 0 93 102 103 94 + 70 0 94 103 20 19 + 71 0 11 12 104 95 + 72 0 95 104 105 96 + 73 0 96 105 106 97 + 74 0 97 106 107 98 + 75 0 98 107 108 99 + 76 0 99 108 109 100 + 77 0 100 109 110 101 + 78 0 101 110 111 102 + 79 0 102 111 112 103 + 80 0 103 112 21 20 + 81 0 12 13 113 104 + 82 0 104 113 114 105 + 83 0 105 114 115 106 + 84 0 106 115 116 107 + 85 0 107 116 117 108 + 86 0 108 117 118 109 + 87 0 109 118 119 110 + 88 0 110 119 120 111 + 89 0 111 120 121 112 + 90 0 112 121 22 21 + 91 0 13 2 32 113 + 92 0 113 32 33 114 + 93 0 114 33 34 115 + 94 0 115 34 35 116 + 95 0 116 35 36 117 + 96 0 117 36 37 118 + 97 0 118 37 38 119 + 98 0 119 38 39 120 + 99 0 120 39 40 121 + 100 0 121 40 4 22 + 101 0 2 122 151 32 + 102 0 32 151 152 33 + 103 0 33 152 153 34 + 104 0 34 153 154 35 + 105 0 35 154 155 36 + 106 0 36 155 156 37 + 107 0 37 156 157 38 + 108 0 38 157 158 39 + 109 0 39 158 159 40 + 110 0 40 159 132 4 + 111 0 122 123 160 151 + 112 0 151 160 161 152 + 113 0 152 161 162 153 + 114 0 153 162 163 154 + 115 0 154 163 164 155 + 116 0 155 164 165 156 + 117 0 156 165 166 157 + 118 0 157 166 167 158 + 119 0 158 167 168 159 + 120 0 159 168 133 132 + 121 0 123 124 169 160 + 122 0 160 169 170 161 + 123 0 161 170 171 162 + 124 0 162 171 172 163 + 125 0 163 172 173 164 + 126 0 164 173 174 165 + 127 0 165 174 175 166 + 128 0 166 175 176 167 + 129 0 167 176 177 168 + 130 0 168 177 134 133 + 131 0 124 125 178 169 + 132 0 169 178 179 170 + 133 0 170 179 180 171 + 134 0 171 180 181 172 + 135 0 172 181 182 173 + 136 0 173 182 183 174 + 137 0 174 183 184 175 + 138 0 175 184 185 176 + 139 0 176 185 186 177 + 140 0 177 186 135 134 + 141 0 125 126 187 178 + 142 0 178 187 188 179 + 143 0 179 188 189 180 + 144 0 180 189 190 181 + 145 0 181 190 191 182 + 146 0 182 191 192 183 + 147 0 183 192 193 184 + 148 0 184 193 194 185 + 149 0 185 194 195 186 + 150 0 186 195 136 135 + 151 0 126 127 196 187 + 152 0 187 196 197 188 + 153 0 188 197 198 189 + 154 0 189 198 199 190 + 155 0 190 199 200 191 + 156 0 191 200 201 192 + 157 0 192 201 202 193 + 158 0 193 202 203 194 + 159 0 194 203 204 195 + 160 0 195 204 137 136 + 161 0 127 128 205 196 + 162 0 196 205 206 197 + 163 0 197 206 207 198 + 164 0 198 207 208 199 + 165 0 199 208 209 200 + 166 0 200 209 210 201 + 167 0 201 210 211 202 + 168 0 202 211 212 203 + 169 0 203 212 213 204 + 170 0 204 213 138 137 + 171 0 128 129 214 205 + 172 0 205 214 215 206 + 173 0 206 215 216 207 + 174 0 207 216 217 208 + 175 0 208 217 218 209 + 176 0 209 218 219 210 + 177 0 210 219 220 211 + 178 0 211 220 221 212 + 179 0 212 221 222 213 + 180 0 213 222 139 138 + 181 0 129 130 223 214 + 182 0 214 223 224 215 + 183 0 215 224 225 216 + 184 0 216 225 226 217 + 185 0 217 226 227 218 + 186 0 218 227 228 219 + 187 0 219 228 229 220 + 188 0 220 229 230 221 + 189 0 221 230 231 222 + 190 0 222 231 140 139 + 191 0 130 131 142 223 + 192 0 223 142 143 224 + 193 0 224 143 144 225 + 194 0 225 144 145 226 + 195 0 226 145 146 227 + 196 0 227 146 147 228 + 197 0 228 147 148 229 + 198 0 229 148 149 230 + 199 0 230 149 150 231 + 200 0 231 150 141 140 + 201 0 131 232 261 142 + 202 0 142 261 262 143 + 203 0 143 262 263 144 + 204 0 144 263 264 145 + 205 0 145 264 265 146 + 206 0 146 265 266 147 + 207 0 147 266 267 148 + 208 0 148 267 268 149 + 209 0 149 268 269 150 + 210 0 150 269 242 141 + 211 0 232 233 270 261 + 212 0 261 270 271 262 + 213 0 262 271 272 263 + 214 0 263 272 273 264 + 215 0 264 273 274 265 + 216 0 265 274 275 266 + 217 0 266 275 276 267 + 218 0 267 276 277 268 + 219 0 268 277 278 269 + 220 0 269 278 243 242 + 221 0 233 234 279 270 + 222 0 270 279 280 271 + 223 0 271 280 281 272 + 224 0 272 281 282 273 + 225 0 273 282 283 274 + 226 0 274 283 284 275 + 227 0 275 284 285 276 + 228 0 276 285 286 277 + 229 0 277 286 287 278 + 230 0 278 287 244 243 + 231 0 234 235 288 279 + 232 0 279 288 289 280 + 233 0 280 289 290 281 + 234 0 281 290 291 282 + 235 0 282 291 292 283 + 236 0 283 292 293 284 + 237 0 284 293 294 285 + 238 0 285 294 295 286 + 239 0 286 295 296 287 + 240 0 287 296 245 244 + 241 0 235 236 297 288 + 242 0 288 297 298 289 + 243 0 289 298 299 290 + 244 0 290 299 300 291 + 245 0 291 300 301 292 + 246 0 292 301 302 293 + 247 0 293 302 303 294 + 248 0 294 303 304 295 + 249 0 295 304 305 296 + 250 0 296 305 246 245 + 251 0 236 237 306 297 + 252 0 297 306 307 298 + 253 0 298 307 308 299 + 254 0 299 308 309 300 + 255 0 300 309 310 301 + 256 0 301 310 311 302 + 257 0 302 311 312 303 + 258 0 303 312 313 304 + 259 0 304 313 314 305 + 260 0 305 314 247 246 + 261 0 237 238 315 306 + 262 0 306 315 316 307 + 263 0 307 316 317 308 + 264 0 308 317 318 309 + 265 0 309 318 319 310 + 266 0 310 319 320 311 + 267 0 311 320 321 312 + 268 0 312 321 322 313 + 269 0 313 322 323 314 + 270 0 314 323 248 247 + 271 0 238 239 324 315 + 272 0 315 324 325 316 + 273 0 316 325 326 317 + 274 0 317 326 327 318 + 275 0 318 327 328 319 + 276 0 319 328 329 320 + 277 0 320 329 330 321 + 278 0 321 330 331 322 + 279 0 322 331 332 323 + 280 0 323 332 249 248 + 281 0 239 240 333 324 + 282 0 324 333 334 325 + 283 0 325 334 335 326 + 284 0 326 335 336 327 + 285 0 327 336 337 328 + 286 0 328 337 338 329 + 287 0 329 338 339 330 + 288 0 330 339 340 331 + 289 0 331 340 341 332 + 290 0 332 341 250 249 + 291 0 240 241 252 333 + 292 0 333 252 253 334 + 293 0 334 253 254 335 + 294 0 335 254 255 336 + 295 0 336 255 256 337 + 296 0 337 256 257 338 + 297 0 338 257 258 339 + 298 0 339 258 259 340 + 299 0 340 259 260 341 + 300 0 341 260 251 250 + 301 0 241 342 360 252 + 302 0 252 360 361 253 + 303 0 253 361 362 254 + 304 0 254 362 363 255 + 305 0 255 363 364 256 + 306 0 256 364 365 257 + 307 0 257 365 366 258 + 308 0 258 366 367 259 + 309 0 259 367 368 260 + 310 0 260 368 351 251 + 311 0 342 343 369 360 + 312 0 360 369 370 361 + 313 0 361 370 371 362 + 314 0 362 371 372 363 + 315 0 363 372 373 364 + 316 0 364 373 374 365 + 317 0 365 374 375 366 + 318 0 366 375 376 367 + 319 0 367 376 377 368 + 320 0 368 377 352 351 + 321 0 343 344 378 369 + 322 0 369 378 379 370 + 323 0 370 379 380 371 + 324 0 371 380 381 372 + 325 0 372 381 382 373 + 326 0 373 382 383 374 + 327 0 374 383 384 375 + 328 0 375 384 385 376 + 329 0 376 385 386 377 + 330 0 377 386 353 352 + 331 0 344 345 387 378 + 332 0 378 387 388 379 + 333 0 379 388 389 380 + 334 0 380 389 390 381 + 335 0 381 390 391 382 + 336 0 382 391 392 383 + 337 0 383 392 393 384 + 338 0 384 393 394 385 + 339 0 385 394 395 386 + 340 0 386 395 354 353 + 341 0 345 346 396 387 + 342 0 387 396 397 388 + 343 0 388 397 398 389 + 344 0 389 398 399 390 + 345 0 390 399 400 391 + 346 0 391 400 401 392 + 347 0 392 401 402 393 + 348 0 393 402 403 394 + 349 0 394 403 404 395 + 350 0 395 404 355 354 + 351 0 346 347 405 396 + 352 0 396 405 406 397 + 353 0 397 406 407 398 + 354 0 398 407 408 399 + 355 0 399 408 409 400 + 356 0 400 409 410 401 + 357 0 401 410 411 402 + 358 0 402 411 412 403 + 359 0 403 412 413 404 + 360 0 404 413 356 355 + 361 0 347 348 414 405 + 362 0 405 414 415 406 + 363 0 406 415 416 407 + 364 0 407 416 417 408 + 365 0 408 417 418 409 + 366 0 409 418 419 410 + 367 0 410 419 420 411 + 368 0 411 420 421 412 + 369 0 412 421 422 413 + 370 0 413 422 357 356 + 371 0 348 349 423 414 + 372 0 414 423 424 415 + 373 0 415 424 425 416 + 374 0 416 425 426 417 + 375 0 417 426 427 418 + 376 0 418 427 428 419 + 377 0 419 428 429 420 + 378 0 420 429 430 421 + 379 0 421 430 431 422 + 380 0 422 431 358 357 + 381 0 349 350 432 423 + 382 0 423 432 433 424 + 383 0 424 433 434 425 + 384 0 425 434 435 426 + 385 0 426 435 436 427 + 386 0 427 436 437 428 + 387 0 428 437 438 429 + 388 0 429 438 439 430 + 389 0 430 439 440 431 + 390 0 431 440 359 358 + 391 0 350 1 23 432 + 392 0 432 23 24 433 + 393 0 433 24 25 434 + 394 0 434 25 26 435 + 395 0 435 26 27 436 + 396 0 436 27 28 437 + 397 0 437 28 29 438 + 398 0 438 29 30 439 + 399 0 439 30 31 440 + 400 0 440 31 3 359 +End Elements // ShellThickElement3D4N + +Begin Conditions SurfaceLoadCondition3D4N + 1 0 1 5 41 23 + 2 0 23 41 42 24 + 3 0 24 42 43 25 + 4 0 25 43 44 26 + 5 0 26 44 45 27 + 6 0 27 45 46 28 + 7 0 28 46 47 29 + 8 0 29 47 48 30 + 9 0 30 48 49 31 + 10 0 31 49 14 3 + 11 0 5 6 50 41 + 12 0 41 50 51 42 + 13 0 42 51 52 43 + 14 0 43 52 53 44 + 15 0 44 53 54 45 + 16 0 45 54 55 46 + 17 0 46 55 56 47 + 18 0 47 56 57 48 + 19 0 48 57 58 49 + 20 0 49 58 15 14 + 21 0 6 7 59 50 + 22 0 50 59 60 51 + 23 0 51 60 61 52 + 24 0 52 61 62 53 + 25 0 53 62 63 54 + 26 0 54 63 64 55 + 27 0 55 64 65 56 + 28 0 56 65 66 57 + 29 0 57 66 67 58 + 30 0 58 67 16 15 + 31 0 7 8 68 59 + 32 0 59 68 69 60 + 33 0 60 69 70 61 + 34 0 61 70 71 62 + 35 0 62 71 72 63 + 36 0 63 72 73 64 + 37 0 64 73 74 65 + 38 0 65 74 75 66 + 39 0 66 75 76 67 + 40 0 67 76 17 16 + 41 0 8 9 77 68 + 42 0 68 77 78 69 + 43 0 69 78 79 70 + 44 0 70 79 80 71 + 45 0 71 80 81 72 + 46 0 72 81 82 73 + 47 0 73 82 83 74 + 48 0 74 83 84 75 + 49 0 75 84 85 76 + 50 0 76 85 18 17 + 51 0 9 10 86 77 + 52 0 77 86 87 78 + 53 0 78 87 88 79 + 54 0 79 88 89 80 + 55 0 80 89 90 81 + 56 0 81 90 91 82 + 57 0 82 91 92 83 + 58 0 83 92 93 84 + 59 0 84 93 94 85 + 60 0 85 94 19 18 + 61 0 10 11 95 86 + 62 0 86 95 96 87 + 63 0 87 96 97 88 + 64 0 88 97 98 89 + 65 0 89 98 99 90 + 66 0 90 99 100 91 + 67 0 91 100 101 92 + 68 0 92 101 102 93 + 69 0 93 102 103 94 + 70 0 94 103 20 19 + 71 0 11 12 104 95 + 72 0 95 104 105 96 + 73 0 96 105 106 97 + 74 0 97 106 107 98 + 75 0 98 107 108 99 + 76 0 99 108 109 100 + 77 0 100 109 110 101 + 78 0 101 110 111 102 + 79 0 102 111 112 103 + 80 0 103 112 21 20 + 81 0 12 13 113 104 + 82 0 104 113 114 105 + 83 0 105 114 115 106 + 84 0 106 115 116 107 + 85 0 107 116 117 108 + 86 0 108 117 118 109 + 87 0 109 118 119 110 + 88 0 110 119 120 111 + 89 0 111 120 121 112 + 90 0 112 121 22 21 + 91 0 13 2 32 113 + 92 0 113 32 33 114 + 93 0 114 33 34 115 + 94 0 115 34 35 116 + 95 0 116 35 36 117 + 96 0 117 36 37 118 + 97 0 118 37 38 119 + 98 0 119 38 39 120 + 99 0 120 39 40 121 + 100 0 121 40 4 22 + 101 0 2 122 151 32 + 102 0 32 151 152 33 + 103 0 33 152 153 34 + 104 0 34 153 154 35 + 105 0 35 154 155 36 + 106 0 36 155 156 37 + 107 0 37 156 157 38 + 108 0 38 157 158 39 + 109 0 39 158 159 40 + 110 0 40 159 132 4 + 111 0 122 123 160 151 + 112 0 151 160 161 152 + 113 0 152 161 162 153 + 114 0 153 162 163 154 + 115 0 154 163 164 155 + 116 0 155 164 165 156 + 117 0 156 165 166 157 + 118 0 157 166 167 158 + 119 0 158 167 168 159 + 120 0 159 168 133 132 + 121 0 123 124 169 160 + 122 0 160 169 170 161 + 123 0 161 170 171 162 + 124 0 162 171 172 163 + 125 0 163 172 173 164 + 126 0 164 173 174 165 + 127 0 165 174 175 166 + 128 0 166 175 176 167 + 129 0 167 176 177 168 + 130 0 168 177 134 133 + 131 0 124 125 178 169 + 132 0 169 178 179 170 + 133 0 170 179 180 171 + 134 0 171 180 181 172 + 135 0 172 181 182 173 + 136 0 173 182 183 174 + 137 0 174 183 184 175 + 138 0 175 184 185 176 + 139 0 176 185 186 177 + 140 0 177 186 135 134 + 141 0 125 126 187 178 + 142 0 178 187 188 179 + 143 0 179 188 189 180 + 144 0 180 189 190 181 + 145 0 181 190 191 182 + 146 0 182 191 192 183 + 147 0 183 192 193 184 + 148 0 184 193 194 185 + 149 0 185 194 195 186 + 150 0 186 195 136 135 + 151 0 126 127 196 187 + 152 0 187 196 197 188 + 153 0 188 197 198 189 + 154 0 189 198 199 190 + 155 0 190 199 200 191 + 156 0 191 200 201 192 + 157 0 192 201 202 193 + 158 0 193 202 203 194 + 159 0 194 203 204 195 + 160 0 195 204 137 136 + 161 0 127 128 205 196 + 162 0 196 205 206 197 + 163 0 197 206 207 198 + 164 0 198 207 208 199 + 165 0 199 208 209 200 + 166 0 200 209 210 201 + 167 0 201 210 211 202 + 168 0 202 211 212 203 + 169 0 203 212 213 204 + 170 0 204 213 138 137 + 171 0 128 129 214 205 + 172 0 205 214 215 206 + 173 0 206 215 216 207 + 174 0 207 216 217 208 + 175 0 208 217 218 209 + 176 0 209 218 219 210 + 177 0 210 219 220 211 + 178 0 211 220 221 212 + 179 0 212 221 222 213 + 180 0 213 222 139 138 + 181 0 129 130 223 214 + 182 0 214 223 224 215 + 183 0 215 224 225 216 + 184 0 216 225 226 217 + 185 0 217 226 227 218 + 186 0 218 227 228 219 + 187 0 219 228 229 220 + 188 0 220 229 230 221 + 189 0 221 230 231 222 + 190 0 222 231 140 139 + 191 0 130 131 142 223 + 192 0 223 142 143 224 + 193 0 224 143 144 225 + 194 0 225 144 145 226 + 195 0 226 145 146 227 + 196 0 227 146 147 228 + 197 0 228 147 148 229 + 198 0 229 148 149 230 + 199 0 230 149 150 231 + 200 0 231 150 141 140 + 201 0 131 232 261 142 + 202 0 142 261 262 143 + 203 0 143 262 263 144 + 204 0 144 263 264 145 + 205 0 145 264 265 146 + 206 0 146 265 266 147 + 207 0 147 266 267 148 + 208 0 148 267 268 149 + 209 0 149 268 269 150 + 210 0 150 269 242 141 + 211 0 232 233 270 261 + 212 0 261 270 271 262 + 213 0 262 271 272 263 + 214 0 263 272 273 264 + 215 0 264 273 274 265 + 216 0 265 274 275 266 + 217 0 266 275 276 267 + 218 0 267 276 277 268 + 219 0 268 277 278 269 + 220 0 269 278 243 242 + 221 0 233 234 279 270 + 222 0 270 279 280 271 + 223 0 271 280 281 272 + 224 0 272 281 282 273 + 225 0 273 282 283 274 + 226 0 274 283 284 275 + 227 0 275 284 285 276 + 228 0 276 285 286 277 + 229 0 277 286 287 278 + 230 0 278 287 244 243 + 231 0 234 235 288 279 + 232 0 279 288 289 280 + 233 0 280 289 290 281 + 234 0 281 290 291 282 + 235 0 282 291 292 283 + 236 0 283 292 293 284 + 237 0 284 293 294 285 + 238 0 285 294 295 286 + 239 0 286 295 296 287 + 240 0 287 296 245 244 + 241 0 235 236 297 288 + 242 0 288 297 298 289 + 243 0 289 298 299 290 + 244 0 290 299 300 291 + 245 0 291 300 301 292 + 246 0 292 301 302 293 + 247 0 293 302 303 294 + 248 0 294 303 304 295 + 249 0 295 304 305 296 + 250 0 296 305 246 245 + 251 0 236 237 306 297 + 252 0 297 306 307 298 + 253 0 298 307 308 299 + 254 0 299 308 309 300 + 255 0 300 309 310 301 + 256 0 301 310 311 302 + 257 0 302 311 312 303 + 258 0 303 312 313 304 + 259 0 304 313 314 305 + 260 0 305 314 247 246 + 261 0 237 238 315 306 + 262 0 306 315 316 307 + 263 0 307 316 317 308 + 264 0 308 317 318 309 + 265 0 309 318 319 310 + 266 0 310 319 320 311 + 267 0 311 320 321 312 + 268 0 312 321 322 313 + 269 0 313 322 323 314 + 270 0 314 323 248 247 + 271 0 238 239 324 315 + 272 0 315 324 325 316 + 273 0 316 325 326 317 + 274 0 317 326 327 318 + 275 0 318 327 328 319 + 276 0 319 328 329 320 + 277 0 320 329 330 321 + 278 0 321 330 331 322 + 279 0 322 331 332 323 + 280 0 323 332 249 248 + 281 0 239 240 333 324 + 282 0 324 333 334 325 + 283 0 325 334 335 326 + 284 0 326 335 336 327 + 285 0 327 336 337 328 + 286 0 328 337 338 329 + 287 0 329 338 339 330 + 288 0 330 339 340 331 + 289 0 331 340 341 332 + 290 0 332 341 250 249 + 291 0 240 241 252 333 + 292 0 333 252 253 334 + 293 0 334 253 254 335 + 294 0 335 254 255 336 + 295 0 336 255 256 337 + 296 0 337 256 257 338 + 297 0 338 257 258 339 + 298 0 339 258 259 340 + 299 0 340 259 260 341 + 300 0 341 260 251 250 + 301 0 241 342 360 252 + 302 0 252 360 361 253 + 303 0 253 361 362 254 + 304 0 254 362 363 255 + 305 0 255 363 364 256 + 306 0 256 364 365 257 + 307 0 257 365 366 258 + 308 0 258 366 367 259 + 309 0 259 367 368 260 + 310 0 260 368 351 251 + 311 0 342 343 369 360 + 312 0 360 369 370 361 + 313 0 361 370 371 362 + 314 0 362 371 372 363 + 315 0 363 372 373 364 + 316 0 364 373 374 365 + 317 0 365 374 375 366 + 318 0 366 375 376 367 + 319 0 367 376 377 368 + 320 0 368 377 352 351 + 321 0 343 344 378 369 + 322 0 369 378 379 370 + 323 0 370 379 380 371 + 324 0 371 380 381 372 + 325 0 372 381 382 373 + 326 0 373 382 383 374 + 327 0 374 383 384 375 + 328 0 375 384 385 376 + 329 0 376 385 386 377 + 330 0 377 386 353 352 + 331 0 344 345 387 378 + 332 0 378 387 388 379 + 333 0 379 388 389 380 + 334 0 380 389 390 381 + 335 0 381 390 391 382 + 336 0 382 391 392 383 + 337 0 383 392 393 384 + 338 0 384 393 394 385 + 339 0 385 394 395 386 + 340 0 386 395 354 353 + 341 0 345 346 396 387 + 342 0 387 396 397 388 + 343 0 388 397 398 389 + 344 0 389 398 399 390 + 345 0 390 399 400 391 + 346 0 391 400 401 392 + 347 0 392 401 402 393 + 348 0 393 402 403 394 + 349 0 394 403 404 395 + 350 0 395 404 355 354 + 351 0 346 347 405 396 + 352 0 396 405 406 397 + 353 0 397 406 407 398 + 354 0 398 407 408 399 + 355 0 399 408 409 400 + 356 0 400 409 410 401 + 357 0 401 410 411 402 + 358 0 402 411 412 403 + 359 0 403 412 413 404 + 360 0 404 413 356 355 + 361 0 347 348 414 405 + 362 0 405 414 415 406 + 363 0 406 415 416 407 + 364 0 407 416 417 408 + 365 0 408 417 418 409 + 366 0 409 418 419 410 + 367 0 410 419 420 411 + 368 0 411 420 421 412 + 369 0 412 421 422 413 + 370 0 413 422 357 356 + 371 0 348 349 423 414 + 372 0 414 423 424 415 + 373 0 415 424 425 416 + 374 0 416 425 426 417 + 375 0 417 426 427 418 + 376 0 418 427 428 419 + 377 0 419 428 429 420 + 378 0 420 429 430 421 + 379 0 421 430 431 422 + 380 0 422 431 358 357 + 381 0 349 350 432 423 + 382 0 423 432 433 424 + 383 0 424 433 434 425 + 384 0 425 434 435 426 + 385 0 426 435 436 427 + 386 0 427 436 437 428 + 387 0 428 437 438 429 + 388 0 429 438 439 430 + 389 0 430 439 440 431 + 390 0 431 440 359 358 + 391 0 350 1 23 432 + 392 0 432 23 24 433 + 393 0 433 24 25 434 + 394 0 434 25 26 435 + 395 0 435 26 27 436 + 396 0 436 27 28 437 + 397 0 437 28 29 438 + 398 0 438 29 30 439 + 399 0 439 30 31 440 + 400 0 440 31 3 359 +End Conditions // SurfaceLoadCondition3D4N + +Begin Conditions SurfaceCondition3D4N + 401 0 1 5 41 23 + 402 0 23 41 42 24 + 403 0 24 42 43 25 + 404 0 25 43 44 26 + 405 0 26 44 45 27 + 406 0 27 45 46 28 + 407 0 28 46 47 29 + 408 0 29 47 48 30 + 409 0 30 48 49 31 + 410 0 31 49 14 3 + 411 0 5 6 50 41 + 412 0 41 50 51 42 + 413 0 42 51 52 43 + 414 0 43 52 53 44 + 415 0 44 53 54 45 + 416 0 45 54 55 46 + 417 0 46 55 56 47 + 418 0 47 56 57 48 + 419 0 48 57 58 49 + 420 0 49 58 15 14 + 421 0 6 7 59 50 + 422 0 50 59 60 51 + 423 0 51 60 61 52 + 424 0 52 61 62 53 + 425 0 53 62 63 54 + 426 0 54 63 64 55 + 427 0 55 64 65 56 + 428 0 56 65 66 57 + 429 0 57 66 67 58 + 430 0 58 67 16 15 + 431 0 7 8 68 59 + 432 0 59 68 69 60 + 433 0 60 69 70 61 + 434 0 61 70 71 62 + 435 0 62 71 72 63 + 436 0 63 72 73 64 + 437 0 64 73 74 65 + 438 0 65 74 75 66 + 439 0 66 75 76 67 + 440 0 67 76 17 16 + 441 0 8 9 77 68 + 442 0 68 77 78 69 + 443 0 69 78 79 70 + 444 0 70 79 80 71 + 445 0 71 80 81 72 + 446 0 72 81 82 73 + 447 0 73 82 83 74 + 448 0 74 83 84 75 + 449 0 75 84 85 76 + 450 0 76 85 18 17 + 451 0 9 10 86 77 + 452 0 77 86 87 78 + 453 0 78 87 88 79 + 454 0 79 88 89 80 + 455 0 80 89 90 81 + 456 0 81 90 91 82 + 457 0 82 91 92 83 + 458 0 83 92 93 84 + 459 0 84 93 94 85 + 460 0 85 94 19 18 + 461 0 10 11 95 86 + 462 0 86 95 96 87 + 463 0 87 96 97 88 + 464 0 88 97 98 89 + 465 0 89 98 99 90 + 466 0 90 99 100 91 + 467 0 91 100 101 92 + 468 0 92 101 102 93 + 469 0 93 102 103 94 + 470 0 94 103 20 19 + 471 0 11 12 104 95 + 472 0 95 104 105 96 + 473 0 96 105 106 97 + 474 0 97 106 107 98 + 475 0 98 107 108 99 + 476 0 99 108 109 100 + 477 0 100 109 110 101 + 478 0 101 110 111 102 + 479 0 102 111 112 103 + 480 0 103 112 21 20 + 481 0 12 13 113 104 + 482 0 104 113 114 105 + 483 0 105 114 115 106 + 484 0 106 115 116 107 + 485 0 107 116 117 108 + 486 0 108 117 118 109 + 487 0 109 118 119 110 + 488 0 110 119 120 111 + 489 0 111 120 121 112 + 490 0 112 121 22 21 + 491 0 13 2 32 113 + 492 0 113 32 33 114 + 493 0 114 33 34 115 + 494 0 115 34 35 116 + 495 0 116 35 36 117 + 496 0 117 36 37 118 + 497 0 118 37 38 119 + 498 0 119 38 39 120 + 499 0 120 39 40 121 + 500 0 121 40 4 22 + 501 0 2 122 151 32 + 502 0 32 151 152 33 + 503 0 33 152 153 34 + 504 0 34 153 154 35 + 505 0 35 154 155 36 + 506 0 36 155 156 37 + 507 0 37 156 157 38 + 508 0 38 157 158 39 + 509 0 39 158 159 40 + 510 0 40 159 132 4 + 511 0 122 123 160 151 + 512 0 151 160 161 152 + 513 0 152 161 162 153 + 514 0 153 162 163 154 + 515 0 154 163 164 155 + 516 0 155 164 165 156 + 517 0 156 165 166 157 + 518 0 157 166 167 158 + 519 0 158 167 168 159 + 520 0 159 168 133 132 + 521 0 123 124 169 160 + 522 0 160 169 170 161 + 523 0 161 170 171 162 + 524 0 162 171 172 163 + 525 0 163 172 173 164 + 526 0 164 173 174 165 + 527 0 165 174 175 166 + 528 0 166 175 176 167 + 529 0 167 176 177 168 + 530 0 168 177 134 133 + 531 0 124 125 178 169 + 532 0 169 178 179 170 + 533 0 170 179 180 171 + 534 0 171 180 181 172 + 535 0 172 181 182 173 + 536 0 173 182 183 174 + 537 0 174 183 184 175 + 538 0 175 184 185 176 + 539 0 176 185 186 177 + 540 0 177 186 135 134 + 541 0 125 126 187 178 + 542 0 178 187 188 179 + 543 0 179 188 189 180 + 544 0 180 189 190 181 + 545 0 181 190 191 182 + 546 0 182 191 192 183 + 547 0 183 192 193 184 + 548 0 184 193 194 185 + 549 0 185 194 195 186 + 550 0 186 195 136 135 + 551 0 126 127 196 187 + 552 0 187 196 197 188 + 553 0 188 197 198 189 + 554 0 189 198 199 190 + 555 0 190 199 200 191 + 556 0 191 200 201 192 + 557 0 192 201 202 193 + 558 0 193 202 203 194 + 559 0 194 203 204 195 + 560 0 195 204 137 136 + 561 0 127 128 205 196 + 562 0 196 205 206 197 + 563 0 197 206 207 198 + 564 0 198 207 208 199 + 565 0 199 208 209 200 + 566 0 200 209 210 201 + 567 0 201 210 211 202 + 568 0 202 211 212 203 + 569 0 203 212 213 204 + 570 0 204 213 138 137 + 571 0 128 129 214 205 + 572 0 205 214 215 206 + 573 0 206 215 216 207 + 574 0 207 216 217 208 + 575 0 208 217 218 209 + 576 0 209 218 219 210 + 577 0 210 219 220 211 + 578 0 211 220 221 212 + 579 0 212 221 222 213 + 580 0 213 222 139 138 + 581 0 129 130 223 214 + 582 0 214 223 224 215 + 583 0 215 224 225 216 + 584 0 216 225 226 217 + 585 0 217 226 227 218 + 586 0 218 227 228 219 + 587 0 219 228 229 220 + 588 0 220 229 230 221 + 589 0 221 230 231 222 + 590 0 222 231 140 139 + 591 0 130 131 142 223 + 592 0 223 142 143 224 + 593 0 224 143 144 225 + 594 0 225 144 145 226 + 595 0 226 145 146 227 + 596 0 227 146 147 228 + 597 0 228 147 148 229 + 598 0 229 148 149 230 + 599 0 230 149 150 231 + 600 0 231 150 141 140 + 601 0 131 232 261 142 + 602 0 142 261 262 143 + 603 0 143 262 263 144 + 604 0 144 263 264 145 + 605 0 145 264 265 146 + 606 0 146 265 266 147 + 607 0 147 266 267 148 + 608 0 148 267 268 149 + 609 0 149 268 269 150 + 610 0 150 269 242 141 + 611 0 232 233 270 261 + 612 0 261 270 271 262 + 613 0 262 271 272 263 + 614 0 263 272 273 264 + 615 0 264 273 274 265 + 616 0 265 274 275 266 + 617 0 266 275 276 267 + 618 0 267 276 277 268 + 619 0 268 277 278 269 + 620 0 269 278 243 242 + 621 0 233 234 279 270 + 622 0 270 279 280 271 + 623 0 271 280 281 272 + 624 0 272 281 282 273 + 625 0 273 282 283 274 + 626 0 274 283 284 275 + 627 0 275 284 285 276 + 628 0 276 285 286 277 + 629 0 277 286 287 278 + 630 0 278 287 244 243 + 631 0 234 235 288 279 + 632 0 279 288 289 280 + 633 0 280 289 290 281 + 634 0 281 290 291 282 + 635 0 282 291 292 283 + 636 0 283 292 293 284 + 637 0 284 293 294 285 + 638 0 285 294 295 286 + 639 0 286 295 296 287 + 640 0 287 296 245 244 + 641 0 235 236 297 288 + 642 0 288 297 298 289 + 643 0 289 298 299 290 + 644 0 290 299 300 291 + 645 0 291 300 301 292 + 646 0 292 301 302 293 + 647 0 293 302 303 294 + 648 0 294 303 304 295 + 649 0 295 304 305 296 + 650 0 296 305 246 245 + 651 0 236 237 306 297 + 652 0 297 306 307 298 + 653 0 298 307 308 299 + 654 0 299 308 309 300 + 655 0 300 309 310 301 + 656 0 301 310 311 302 + 657 0 302 311 312 303 + 658 0 303 312 313 304 + 659 0 304 313 314 305 + 660 0 305 314 247 246 + 661 0 237 238 315 306 + 662 0 306 315 316 307 + 663 0 307 316 317 308 + 664 0 308 317 318 309 + 665 0 309 318 319 310 + 666 0 310 319 320 311 + 667 0 311 320 321 312 + 668 0 312 321 322 313 + 669 0 313 322 323 314 + 670 0 314 323 248 247 + 671 0 238 239 324 315 + 672 0 315 324 325 316 + 673 0 316 325 326 317 + 674 0 317 326 327 318 + 675 0 318 327 328 319 + 676 0 319 328 329 320 + 677 0 320 329 330 321 + 678 0 321 330 331 322 + 679 0 322 331 332 323 + 680 0 323 332 249 248 + 681 0 239 240 333 324 + 682 0 324 333 334 325 + 683 0 325 334 335 326 + 684 0 326 335 336 327 + 685 0 327 336 337 328 + 686 0 328 337 338 329 + 687 0 329 338 339 330 + 688 0 330 339 340 331 + 689 0 331 340 341 332 + 690 0 332 341 250 249 + 691 0 240 241 252 333 + 692 0 333 252 253 334 + 693 0 334 253 254 335 + 694 0 335 254 255 336 + 695 0 336 255 256 337 + 696 0 337 256 257 338 + 697 0 338 257 258 339 + 698 0 339 258 259 340 + 699 0 340 259 260 341 + 700 0 341 260 251 250 + 701 0 241 342 360 252 + 702 0 252 360 361 253 + 703 0 253 361 362 254 + 704 0 254 362 363 255 + 705 0 255 363 364 256 + 706 0 256 364 365 257 + 707 0 257 365 366 258 + 708 0 258 366 367 259 + 709 0 259 367 368 260 + 710 0 260 368 351 251 + 711 0 342 343 369 360 + 712 0 360 369 370 361 + 713 0 361 370 371 362 + 714 0 362 371 372 363 + 715 0 363 372 373 364 + 716 0 364 373 374 365 + 717 0 365 374 375 366 + 718 0 366 375 376 367 + 719 0 367 376 377 368 + 720 0 368 377 352 351 + 721 0 343 344 378 369 + 722 0 369 378 379 370 + 723 0 370 379 380 371 + 724 0 371 380 381 372 + 725 0 372 381 382 373 + 726 0 373 382 383 374 + 727 0 374 383 384 375 + 728 0 375 384 385 376 + 729 0 376 385 386 377 + 730 0 377 386 353 352 + 731 0 344 345 387 378 + 732 0 378 387 388 379 + 733 0 379 388 389 380 + 734 0 380 389 390 381 + 735 0 381 390 391 382 + 736 0 382 391 392 383 + 737 0 383 392 393 384 + 738 0 384 393 394 385 + 739 0 385 394 395 386 + 740 0 386 395 354 353 + 741 0 345 346 396 387 + 742 0 387 396 397 388 + 743 0 388 397 398 389 + 744 0 389 398 399 390 + 745 0 390 399 400 391 + 746 0 391 400 401 392 + 747 0 392 401 402 393 + 748 0 393 402 403 394 + 749 0 394 403 404 395 + 750 0 395 404 355 354 + 751 0 346 347 405 396 + 752 0 396 405 406 397 + 753 0 397 406 407 398 + 754 0 398 407 408 399 + 755 0 399 408 409 400 + 756 0 400 409 410 401 + 757 0 401 410 411 402 + 758 0 402 411 412 403 + 759 0 403 412 413 404 + 760 0 404 413 356 355 + 761 0 347 348 414 405 + 762 0 405 414 415 406 + 763 0 406 415 416 407 + 764 0 407 416 417 408 + 765 0 408 417 418 409 + 766 0 409 418 419 410 + 767 0 410 419 420 411 + 768 0 411 420 421 412 + 769 0 412 421 422 413 + 770 0 413 422 357 356 + 771 0 348 349 423 414 + 772 0 414 423 424 415 + 773 0 415 424 425 416 + 774 0 416 425 426 417 + 775 0 417 426 427 418 + 776 0 418 427 428 419 + 777 0 419 428 429 420 + 778 0 420 429 430 421 + 779 0 421 430 431 422 + 780 0 422 431 358 357 + 781 0 349 350 432 423 + 782 0 423 432 433 424 + 783 0 424 433 434 425 + 784 0 425 434 435 426 + 785 0 426 435 436 427 + 786 0 427 436 437 428 + 787 0 428 437 438 429 + 788 0 429 438 439 430 + 789 0 430 439 440 431 + 790 0 431 440 359 358 + 791 0 350 1 23 432 + 792 0 432 23 24 433 + 793 0 433 24 25 434 + 794 0 434 25 26 435 + 795 0 435 26 27 436 + 796 0 436 27 28 437 + 797 0 437 28 29 438 + 798 0 438 29 30 439 + 799 0 439 30 31 440 + 800 0 440 31 3 359 +End Conditions // SurfaceCondition3D4N + +Begin SubModelPart shell + Begin SubModelPartProperties + 0 + End SubModelPartProperties + Begin SubModelPartNodes + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + 252 + 253 + 254 + 255 + 256 + 257 + 258 + 259 + 260 + 261 + 262 + 263 + 264 + 265 + 266 + 267 + 268 + 269 + 270 + 271 + 272 + 273 + 274 + 275 + 276 + 277 + 278 + 279 + 280 + 281 + 282 + 283 + 284 + 285 + 286 + 287 + 288 + 289 + 290 + 291 + 292 + 293 + 294 + 295 + 296 + 297 + 298 + 299 + 300 + 301 + 302 + 303 + 304 + 305 + 306 + 307 + 308 + 309 + 310 + 311 + 312 + 313 + 314 + 315 + 316 + 317 + 318 + 319 + 320 + 321 + 322 + 323 + 324 + 325 + 326 + 327 + 328 + 329 + 330 + 331 + 332 + 333 + 334 + 335 + 336 + 337 + 338 + 339 + 340 + 341 + 342 + 343 + 344 + 345 + 346 + 347 + 348 + 349 + 350 + 351 + 352 + 353 + 354 + 355 + 356 + 357 + 358 + 359 + 360 + 361 + 362 + 363 + 364 + 365 + 366 + 367 + 368 + 369 + 370 + 371 + 372 + 373 + 374 + 375 + 376 + 377 + 378 + 379 + 380 + 381 + 382 + 383 + 384 + 385 + 386 + 387 + 388 + 389 + 390 + 391 + 392 + 393 + 394 + 395 + 396 + 397 + 398 + 399 + 400 + 401 + 402 + 403 + 404 + 405 + 406 + 407 + 408 + 409 + 410 + 411 + 412 + 413 + 414 + 415 + 416 + 417 + 418 + 419 + 420 + 421 + 422 + 423 + 424 + 425 + 426 + 427 + 428 + 429 + 430 + 431 + 432 + 433 + 434 + 435 + 436 + 437 + 438 + 439 + 440 + End SubModelPartNodes + Begin SubModelPartElements + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + 252 + 253 + 254 + 255 + 256 + 257 + 258 + 259 + 260 + 261 + 262 + 263 + 264 + 265 + 266 + 267 + 268 + 269 + 270 + 271 + 272 + 273 + 274 + 275 + 276 + 277 + 278 + 279 + 280 + 281 + 282 + 283 + 284 + 285 + 286 + 287 + 288 + 289 + 290 + 291 + 292 + 293 + 294 + 295 + 296 + 297 + 298 + 299 + 300 + 301 + 302 + 303 + 304 + 305 + 306 + 307 + 308 + 309 + 310 + 311 + 312 + 313 + 314 + 315 + 316 + 317 + 318 + 319 + 320 + 321 + 322 + 323 + 324 + 325 + 326 + 327 + 328 + 329 + 330 + 331 + 332 + 333 + 334 + 335 + 336 + 337 + 338 + 339 + 340 + 341 + 342 + 343 + 344 + 345 + 346 + 347 + 348 + 349 + 350 + 351 + 352 + 353 + 354 + 355 + 356 + 357 + 358 + 359 + 360 + 361 + 362 + 363 + 364 + 365 + 366 + 367 + 368 + 369 + 370 + 371 + 372 + 373 + 374 + 375 + 376 + 377 + 378 + 379 + 380 + 381 + 382 + 383 + 384 + 385 + 386 + 387 + 388 + 389 + 390 + 391 + 392 + 393 + 394 + 395 + 396 + 397 + 398 + 399 + 400 + End SubModelPartElements +End SubModelPart // shell +Begin SubModelPart edge_support + Begin SubModelPartNodes + 1 + 2 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 342 + 343 + 344 + 345 + 346 + 347 + 348 + 349 + 350 + End SubModelPartNodes +End SubModelPart // edge_support +Begin SubModelPart top_edge + Begin SubModelPartNodes + 3 + 4 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + 351 + 352 + 353 + 354 + 355 + 356 + 357 + 358 + 359 + End SubModelPartNodes +End SubModelPart // top_edge +Begin SubModelPart surface_load + Begin SubModelPartProperties + 0 + End SubModelPartProperties + Begin SubModelPartNodes + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + 252 + 253 + 254 + 255 + 256 + 257 + 258 + 259 + 260 + 261 + 262 + 263 + 264 + 265 + 266 + 267 + 268 + 269 + 270 + 271 + 272 + 273 + 274 + 275 + 276 + 277 + 278 + 279 + 280 + 281 + 282 + 283 + 284 + 285 + 286 + 287 + 288 + 289 + 290 + 291 + 292 + 293 + 294 + 295 + 296 + 297 + 298 + 299 + 300 + 301 + 302 + 303 + 304 + 305 + 306 + 307 + 308 + 309 + 310 + 311 + 312 + 313 + 314 + 315 + 316 + 317 + 318 + 319 + 320 + 321 + 322 + 323 + 324 + 325 + 326 + 327 + 328 + 329 + 330 + 331 + 332 + 333 + 334 + 335 + 336 + 337 + 338 + 339 + 340 + 341 + 342 + 343 + 344 + 345 + 346 + 347 + 348 + 349 + 350 + 351 + 352 + 353 + 354 + 355 + 356 + 357 + 358 + 359 + 360 + 361 + 362 + 363 + 364 + 365 + 366 + 367 + 368 + 369 + 370 + 371 + 372 + 373 + 374 + 375 + 376 + 377 + 378 + 379 + 380 + 381 + 382 + 383 + 384 + 385 + 386 + 387 + 388 + 389 + 390 + 391 + 392 + 393 + 394 + 395 + 396 + 397 + 398 + 399 + 400 + 401 + 402 + 403 + 404 + 405 + 406 + 407 + 408 + 409 + 410 + 411 + 412 + 413 + 414 + 415 + 416 + 417 + 418 + 419 + 420 + 421 + 422 + 423 + 424 + 425 + 426 + 427 + 428 + 429 + 430 + 431 + 432 + 433 + 434 + 435 + 436 + 437 + 438 + 439 + 440 + End SubModelPartNodes + Begin SubModelPartConditions + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + 252 + 253 + 254 + 255 + 256 + 257 + 258 + 259 + 260 + 261 + 262 + 263 + 264 + 265 + 266 + 267 + 268 + 269 + 270 + 271 + 272 + 273 + 274 + 275 + 276 + 277 + 278 + 279 + 280 + 281 + 282 + 283 + 284 + 285 + 286 + 287 + 288 + 289 + 290 + 291 + 292 + 293 + 294 + 295 + 296 + 297 + 298 + 299 + 300 + 301 + 302 + 303 + 304 + 305 + 306 + 307 + 308 + 309 + 310 + 311 + 312 + 313 + 314 + 315 + 316 + 317 + 318 + 319 + 320 + 321 + 322 + 323 + 324 + 325 + 326 + 327 + 328 + 329 + 330 + 331 + 332 + 333 + 334 + 335 + 336 + 337 + 338 + 339 + 340 + 341 + 342 + 343 + 344 + 345 + 346 + 347 + 348 + 349 + 350 + 351 + 352 + 353 + 354 + 355 + 356 + 357 + 358 + 359 + 360 + 361 + 362 + 363 + 364 + 365 + 366 + 367 + 368 + 369 + 370 + 371 + 372 + 373 + 374 + 375 + 376 + 377 + 378 + 379 + 380 + 381 + 382 + 383 + 384 + 385 + 386 + 387 + 388 + 389 + 390 + 391 + 392 + 393 + 394 + 395 + 396 + 397 + 398 + 399 + 400 + End SubModelPartConditions +End SubModelPart // surface_load +Begin SubModelPart design + Begin SubModelPartProperties + 0 + End SubModelPartProperties + Begin SubModelPartNodes + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + 252 + 253 + 254 + 255 + 256 + 257 + 258 + 259 + 260 + 261 + 262 + 263 + 264 + 265 + 266 + 267 + 268 + 269 + 270 + 271 + 272 + 273 + 274 + 275 + 276 + 277 + 278 + 279 + 280 + 281 + 282 + 283 + 284 + 285 + 286 + 287 + 288 + 289 + 290 + 291 + 292 + 293 + 294 + 295 + 296 + 297 + 298 + 299 + 300 + 301 + 302 + 303 + 304 + 305 + 306 + 307 + 308 + 309 + 310 + 311 + 312 + 313 + 314 + 315 + 316 + 317 + 318 + 319 + 320 + 321 + 322 + 323 + 324 + 325 + 326 + 327 + 328 + 329 + 330 + 331 + 332 + 333 + 334 + 335 + 336 + 337 + 338 + 339 + 340 + 341 + 342 + 343 + 344 + 345 + 346 + 347 + 348 + 349 + 350 + 351 + 352 + 353 + 354 + 355 + 356 + 357 + 358 + 359 + 360 + 361 + 362 + 363 + 364 + 365 + 366 + 367 + 368 + 369 + 370 + 371 + 372 + 373 + 374 + 375 + 376 + 377 + 378 + 379 + 380 + 381 + 382 + 383 + 384 + 385 + 386 + 387 + 388 + 389 + 390 + 391 + 392 + 393 + 394 + 395 + 396 + 397 + 398 + 399 + 400 + 401 + 402 + 403 + 404 + 405 + 406 + 407 + 408 + 409 + 410 + 411 + 412 + 413 + 414 + 415 + 416 + 417 + 418 + 419 + 420 + 421 + 422 + 423 + 424 + 425 + 426 + 427 + 428 + 429 + 430 + 431 + 432 + 433 + 434 + 435 + 436 + 437 + 438 + 439 + 440 + End SubModelPartNodes + Begin SubModelPartConditions + 401 + 402 + 403 + 404 + 405 + 406 + 407 + 408 + 409 + 410 + 411 + 412 + 413 + 414 + 415 + 416 + 417 + 418 + 419 + 420 + 421 + 422 + 423 + 424 + 425 + 426 + 427 + 428 + 429 + 430 + 431 + 432 + 433 + 434 + 435 + 436 + 437 + 438 + 439 + 440 + 441 + 442 + 443 + 444 + 445 + 446 + 447 + 448 + 449 + 450 + 451 + 452 + 453 + 454 + 455 + 456 + 457 + 458 + 459 + 460 + 461 + 462 + 463 + 464 + 465 + 466 + 467 + 468 + 469 + 470 + 471 + 472 + 473 + 474 + 475 + 476 + 477 + 478 + 479 + 480 + 481 + 482 + 483 + 484 + 485 + 486 + 487 + 488 + 489 + 490 + 491 + 492 + 493 + 494 + 495 + 496 + 497 + 498 + 499 + 500 + 501 + 502 + 503 + 504 + 505 + 506 + 507 + 508 + 509 + 510 + 511 + 512 + 513 + 514 + 515 + 516 + 517 + 518 + 519 + 520 + 521 + 522 + 523 + 524 + 525 + 526 + 527 + 528 + 529 + 530 + 531 + 532 + 533 + 534 + 535 + 536 + 537 + 538 + 539 + 540 + 541 + 542 + 543 + 544 + 545 + 546 + 547 + 548 + 549 + 550 + 551 + 552 + 553 + 554 + 555 + 556 + 557 + 558 + 559 + 560 + 561 + 562 + 563 + 564 + 565 + 566 + 567 + 568 + 569 + 570 + 571 + 572 + 573 + 574 + 575 + 576 + 577 + 578 + 579 + 580 + 581 + 582 + 583 + 584 + 585 + 586 + 587 + 588 + 589 + 590 + 591 + 592 + 593 + 594 + 595 + 596 + 597 + 598 + 599 + 600 + 601 + 602 + 603 + 604 + 605 + 606 + 607 + 608 + 609 + 610 + 611 + 612 + 613 + 614 + 615 + 616 + 617 + 618 + 619 + 620 + 621 + 622 + 623 + 624 + 625 + 626 + 627 + 628 + 629 + 630 + 631 + 632 + 633 + 634 + 635 + 636 + 637 + 638 + 639 + 640 + 641 + 642 + 643 + 644 + 645 + 646 + 647 + 648 + 649 + 650 + 651 + 652 + 653 + 654 + 655 + 656 + 657 + 658 + 659 + 660 + 661 + 662 + 663 + 664 + 665 + 666 + 667 + 668 + 669 + 670 + 671 + 672 + 673 + 674 + 675 + 676 + 677 + 678 + 679 + 680 + 681 + 682 + 683 + 684 + 685 + 686 + 687 + 688 + 689 + 690 + 691 + 692 + 693 + 694 + 695 + 696 + 697 + 698 + 699 + 700 + 701 + 702 + 703 + 704 + 705 + 706 + 707 + 708 + 709 + 710 + 711 + 712 + 713 + 714 + 715 + 716 + 717 + 718 + 719 + 720 + 721 + 722 + 723 + 724 + 725 + 726 + 727 + 728 + 729 + 730 + 731 + 732 + 733 + 734 + 735 + 736 + 737 + 738 + 739 + 740 + 741 + 742 + 743 + 744 + 745 + 746 + 747 + 748 + 749 + 750 + 751 + 752 + 753 + 754 + 755 + 756 + 757 + 758 + 759 + 760 + 761 + 762 + 763 + 764 + 765 + 766 + 767 + 768 + 769 + 770 + 771 + 772 + 773 + 774 + 775 + 776 + 777 + 778 + 779 + 780 + 781 + 782 + 783 + 784 + 785 + 786 + 787 + 788 + 789 + 790 + 791 + 792 + 793 + 794 + 795 + 796 + 797 + 798 + 799 + 800 + End SubModelPartConditions +End SubModelPart // design From 5130f13be2d76001652c7fed776f0c1bb711bf3d Mon Sep 17 00:00:00 2001 From: RezaNajian Date: Mon, 3 Jul 2023 12:09:04 +0200 Subject: [PATCH 3/7] some new updates --- .../algorithms/NLOPT_algorithms.py | 4 +-- .../standardized_NLOPT_constraint.py | 31 ++++++++++++------- .../standardized_NLOPT_objective.py | 29 ++++++++++------- .../responses/response_routine.py | 16 +++------- 4 files changed, 43 insertions(+), 37 deletions(-) diff --git a/applications/OptimizationApplication/python_scripts/algorithms/NLOPT_algorithms.py b/applications/OptimizationApplication/python_scripts/algorithms/NLOPT_algorithms.py index 5ecc718d9a63..4043fd335a65 100644 --- a/applications/OptimizationApplication/python_scripts/algorithms/NLOPT_algorithms.py +++ b/applications/OptimizationApplication/python_scripts/algorithms/NLOPT_algorithms.py @@ -105,9 +105,9 @@ def Solve(self): opt.set_min_objective(self.__objective.CalculateStandardizedValueAndGradients) for constraint in self.__constraints: opt.add_inequality_constraint(lambda x,grad: constraint.CalculateStandardizedValueAndGradients(x,grad),1e-8) - opt.set_ftol_rel(1e-4) + opt.set_ftol_rel(1e-2) # opt.set_xtol_rel(1e-6) - opt.set_maxeval(200) + opt.set_maxeval(100) opt.optimize(x0) minf = opt.last_optimum_value() print("minimum value = ", minf) diff --git a/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_constraint.py b/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_constraint.py index 1661bc449dd6..1315b83d9d6a 100644 --- a/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_constraint.py +++ b/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_constraint.py @@ -65,7 +65,7 @@ def __init__(self, parameters: Kratos.Parameters, master_control: MasterControl, if not self.__reference_value is None: self.__reference_value *= -1 else: raise RuntimeError(f"Provided \"type\" = {self.__constraint_type} is not supported in constraint response functions. Followings are supported options: \n\t=\n\t<\n\t>") - self.__master_control_field = None + self.__zero_threshold = sys.float_info.epsilon def IsEqualityType(self) -> str: @@ -83,19 +83,32 @@ def GetReferenceValue(self) -> float: def Initialize(self): super().Initialize() - self.__master_control_field = self.GetMasterControl().GetControlField().Evaluate() def CalculateStandardizedValueAndGradients(self, control_field: numpy.ndarray, gradient_field: numpy.ndarray, save_value: bool = True) -> float: - # if numpy.linalg.norm(control_field-self.__master_control_field) > 1e-9 and gradient_field.size > 0: - # CallOnAll(self.__optimization_problem.GetListOfProcesses("output_processes"), Kratos.OutputProcess.PrintOutput) - # self.__optimization_problem.AdvanceStep() + # update the master control + update_status = self.GetMasterControl().Update(control_field) + master_control_updated = False + for is_updated in update_status.values(): + if is_updated: + master_control_updated = True + break + # output + if master_control_updated and gradient_field.size > 0: + CallOnAll(self.__optimization_problem.GetListOfProcesses("output_processes"), Kratos.OutputProcess.PrintOutput) + self.__optimization_problem.AdvanceStep() with TimeLogger(f"StandardizedNLOPTConstraint::Calculate {self.GetReponse().GetName()} value", None, "Finished"): - self.response_value = self.CalculateValue(control_field) + self.response_value = self.CalculateValue() if not self.__unbuffered_data.HasValue("initial_value"): self.__unbuffered_data["initial_value"] = self.response_value + if save_value: + if self.__buffered_data.HasValue("value"): del self.__buffered_data["value"] + self.__buffered_data["value"] = self.response_value + + DictLogger("Constraint info",self.GetInfo()) + ref_value = self.GetReferenceValue() standardized_response_value = self.response_value - ref_value standardization_factor = self.__scaling @@ -103,12 +116,6 @@ def CalculateStandardizedValueAndGradients(self, control_field: numpy.ndarray, g standardization_factor /= abs(ref_value) standardized_response_value *= standardization_factor - if save_value: - if self.__buffered_data.HasValue("value"): del self.__buffered_data["value"] - self.__buffered_data["value"] = self.response_value - - DictLogger("Constraint info",self.GetInfo()) - if gradient_field.size > 0: gradient_collective_expression = self.CalculateGradient() gradient_field[:] = gradient_collective_expression.Evaluate() * standardization_factor diff --git a/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_objective.py b/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_objective.py index c3643618b7aa..23463c20952e 100644 --- a/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_objective.py +++ b/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_objective.py @@ -51,7 +51,6 @@ def __init__(self, parameters: Kratos.Parameters, master_control: MasterControl, self.__scaling = -scaling else: raise RuntimeError(f"Requesting unsupported type {self.__objective_type} for objective response function. Supported types are: \n\tminimization\n\tmaximization") - self.__master_control_field = None def GetInitialValue(self) -> float: if self.__unbuffered_data.HasValue("initial_value"): @@ -61,35 +60,41 @@ def GetInitialValue(self) -> float: def Initialize(self): super().Initialize() - self.__master_control_field = self.GetMasterControl().GetControlField().Evaluate() def CalculateStandardizedValueAndGradients(self, control_field: numpy.ndarray, gradient_field: numpy.ndarray, save_value: bool = True) -> float: - if numpy.linalg.norm(control_field-self.__master_control_field) > 1e-9 and gradient_field.size > 0: + # update the master control + update_status = self.GetMasterControl().Update(control_field) + master_control_updated = False + for is_updated in update_status.values(): + if is_updated: + master_control_updated = True + break + # output + if master_control_updated and gradient_field.size > 0: CallOnAll(self.__optimization_problem.GetListOfProcesses("output_processes"), Kratos.OutputProcess.PrintOutput) self.__optimization_problem.AdvanceStep() with TimeLogger(f"CalculateStandardizedValueAndGradients {self.GetReponse().GetName()} value", None, "Finished"): - response_value = self.CalculateValue(control_field) - standardized_response_value = response_value * self.__scaling + response_value = self.CalculateValue() if not self.__unbuffered_data.HasValue("initial_value"): self.__unbuffered_data["initial_value"] = response_value - standardized_response_value = 1.0 - else: - standardized_response_value /= self.__unbuffered_data["initial_value"] if save_value: if self.__buffered_data.HasValue("value"): del self.__buffered_data["value"] self.__buffered_data["value"] = response_value + # print the info DictLogger("Objective info",self.GetInfo()) + # compute standardization factor + standardization_factor = self.__scaling / abs(self.__unbuffered_data["initial_value"]) + standardized_response_value = standardization_factor * response_value + if gradient_field.size > 0: gradient_collective_expression = self.CalculateGradient() - gradient_field[:] = gradient_collective_expression.Evaluate() * self.__scaling - - gradient_field[:] /= self.__unbuffered_data["initial_value"] + gradient_field[:] = standardization_factor * gradient_collective_expression.Evaluate() if save_value: # save the physical gradients for post processing in unbuffered data container. @@ -107,7 +112,7 @@ def CalculateStandardizedValueAndGradients(self, control_field: numpy.ndarray, g if self.__unbuffered_data.HasValue(variable_name): del self.__unbuffered_data[variable_name] # cloning is a cheap operation, it only moves underlying pointers # does not create additional memory. - self.__unbuffered_data[variable_name] = gradient_container_expression.Clone() + self.__unbuffered_data[variable_name] = gradient_container_expression.Clone() return standardized_response_value diff --git a/applications/OptimizationApplication/python_scripts/responses/response_routine.py b/applications/OptimizationApplication/python_scripts/responses/response_routine.py index 1f66676aac03..86588893a16b 100644 --- a/applications/OptimizationApplication/python_scripts/responses/response_routine.py +++ b/applications/OptimizationApplication/python_scripts/responses/response_routine.py @@ -70,7 +70,7 @@ def Finalize(self): def GetReponse(self) -> ResponseFunction: return self.__response - def CalculateValue(self, control_field: KratosOA.CollectiveExpression) -> float: + def CalculateValue(self, control_field: KratosOA.CollectiveExpression=None) -> float: """Calculates the value of the response. This method updates the design with the provided control field. If a control field is updated @@ -84,14 +84,8 @@ def CalculateValue(self, control_field: KratosOA.CollectiveExpression) -> float: float: Respone value. """ # update using the master control and get updated states. - update_states = self.__master_control.Update(control_field) - - compute_response_value_flag = False - for control, is_updated in update_states.items(): - if is_updated and control in self.__contributing_controls_list: - compute_response_value_flag = True - - compute_response_value_flag = compute_response_value_flag or self.__response_value is None + if control_field is not None: + self.__master_control.Update(control_field) # TODO: In the case of having two analysis with the same mesh (model parts) for two different # responses, we need to flag all the anayses which are affected by the control update_state @@ -106,8 +100,8 @@ def CalculateValue(self, control_field: KratosOA.CollectiveExpression) -> float: # # in the execution policies which has some intersection with the modified model parts. # ChangeExecutionPolicyStates(modified_model_parts, False, self.__optimization_problem) - if compute_response_value_flag: - self.__response_value = self.__response.CalculateValue() + # if compute_response_value_flag: + self.__response_value = self.__response.CalculateValue() return self.__response_value From 2fdd58a12136329fd0893cdffebff4200c007868 Mon Sep 17 00:00:00 2001 From: RezaNajian Date: Mon, 3 Jul 2023 15:01:24 +0200 Subject: [PATCH 4/7] updated and cleaned --- .../algorithms/NLOPT_algorithms.py | 109 ++++++++++++++---- .../standardized_NLOPT_constraint.py | 20 +++- .../standardized_NLOPT_objective.py | 20 +++- .../thickness/shell_thickness_control.py | 2 +- 4 files changed, 126 insertions(+), 25 deletions(-) diff --git a/applications/OptimizationApplication/python_scripts/algorithms/NLOPT_algorithms.py b/applications/OptimizationApplication/python_scripts/algorithms/NLOPT_algorithms.py index 4043fd335a65..f710a027bb14 100644 --- a/applications/OptimizationApplication/python_scripts/algorithms/NLOPT_algorithms.py +++ b/applications/OptimizationApplication/python_scripts/algorithms/NLOPT_algorithms.py @@ -1,17 +1,16 @@ try: import nlopt - import numpy except ImportError: raise Exception("NLOPT python library is not available") import KratosMultiphysics as Kratos -import KratosMultiphysics.OptimizationApplication as KratosOA from KratosMultiphysics.OptimizationApplication.utilities.optimization_problem import OptimizationProblem from KratosMultiphysics.OptimizationApplication.algorithms.standardized_NLOPT_objective import StandardizedNLOPTObjective from KratosMultiphysics.OptimizationApplication.algorithms.standardized_NLOPT_constraint import StandardizedNLOPTConstraint from KratosMultiphysics.OptimizationApplication.controls.master_control import MasterControl from KratosMultiphysics.OptimizationApplication.algorithms.algorithm import Algorithm from KratosMultiphysics.OptimizationApplication.utilities.component_data_view import ComponentDataView +from KratosMultiphysics.OptimizationApplication.utilities.logger_utilities import DictLogger def Factory(model: Kratos.Model, parameters: Kratos.Parameters, optimization_problem: OptimizationProblem): @@ -33,12 +32,11 @@ def GetDefaultParameters(cls): "echo_level" : 0, "NLOPT_settings" : { "algorithm_name" : "MMA", - "algorithm_settings" : {}, "stopping_criteria" : { - "objective_rel_tol": "", - "objective_abs_tol": "", - "controls_rel_tol": "", - "controls_abs_tol": "", + "objective_rel_tol": 0, + "objective_abs_tol": 0, + "controls_rel_tol": 0, + "controls_abs_tol": 0, "maximum_function_evalualtion": 10 } } @@ -68,9 +66,16 @@ def __init__(self, model:Kratos.Model, parameters: Kratos.Parameters, optimizati NLOPT_settings = parameters["NLOPT_settings"] NLOPT_settings.ValidateAndAssignDefaults(self.GetDefaultParameters()["NLOPT_settings"]) - # nlopt algorithm settings + # nlopt algorithm self.algorithm_name = NLOPT_settings["algorithm_name"].GetString() - self.algorithm_settings = NLOPT_settings["algorithm_settings"] + if(len(self.__constraints)==0): + self.CheckOptimizerSupport(self.algorithm_name,None) + else: + for constraint in self.__constraints: + if constraint.IsEqualityType(): + self.CheckOptimizerSupport(self.algorithm_name,"equality") + else: + self.CheckOptimizerSupport(self.algorithm_name,"inequality") # stopping self.stopping_criteria = NLOPT_settings["stopping_criteria"] @@ -93,6 +98,24 @@ def Initialize(self): self.__control_field = self.master_control.GetControlField() self.algorithm_data = ComponentDataView("algorithm", self._optimization_problem) + # create nlopt optimizer + self.x0 = self.__control_field.Evaluate() + self.nlopt_optimizer = nlopt.opt(self.GetOptimizer(self.algorithm_name), self.x0.size) + + # assign objectives and constarints + self.nlopt_optimizer.set_min_objective(self.__objective.CalculateStandardizedValueAndGradients) + for constraint in self.__constraints: + if constraint.IsEqualityType(): + self.nlopt_optimizer.add_equality_constraint(lambda x,grad: constraint.CalculateStandardizedValueAndGradients(x,grad),1e-8) + else: + self.nlopt_optimizer.add_inequality_constraint(lambda x,grad: constraint.CalculateStandardizedValueAndGradients(x,grad),1e-8) + # now set stopping criteria + self.nlopt_optimizer.set_ftol_rel(self.stopping_criteria["objective_rel_tol"].GetDouble()) + self.nlopt_optimizer.set_ftol_abs(self.stopping_criteria["objective_abs_tol"].GetDouble()) + self.nlopt_optimizer.set_xtol_rel(self.stopping_criteria["controls_rel_tol"].GetDouble()) + self.nlopt_optimizer.set_xtol_abs(self.stopping_criteria["controls_abs_tol"].GetDouble()) + self.nlopt_optimizer.set_maxeval(self.stopping_criteria["maximum_function_evalualtion"].GetInt()) + def Finalize(self): self.__objective.Finalize() for constraint in self.__constraints: @@ -100,14 +123,60 @@ def Finalize(self): self.master_control.Finalize() def Solve(self): - x0 = self.__control_field.Evaluate() - opt = nlopt.opt(nlopt.LD_MMA, x0.size) - opt.set_min_objective(self.__objective.CalculateStandardizedValueAndGradients) - for constraint in self.__constraints: - opt.add_inequality_constraint(lambda x,grad: constraint.CalculateStandardizedValueAndGradients(x,grad),1e-8) - opt.set_ftol_rel(1e-2) - # opt.set_xtol_rel(1e-6) - opt.set_maxeval(100) - opt.optimize(x0) - minf = opt.last_optimum_value() - print("minimum value = ", minf) + self.nlopt_optimizer.optimize(self.x0) + self.LogTermination() + + def LogTermination(self): + stopval = self.nlopt_optimizer.get_stopval() + maxtime = self.nlopt_optimizer.get_maxtime() + nlopt_result_map = { + nlopt.SUCCESS: 'Generic success return value.', + nlopt.STOPVAL_REACHED: f'Optimization stopped because stopval ({stopval}) was reached.', + nlopt.FTOL_REACHED: f'Optimization stopped because ftol_rel ({self.stopping_criteria["objective_rel_tol"].GetDouble()}) or ftol_abs ({self.stopping_criteria["objective_abs_tol"].GetDouble()}) was reached.', + nlopt.XTOL_REACHED: f'Optimization stopped because xtol_rel ({self.stopping_criteria["controls_rel_tol"].GetDouble()}) or xtol_abs ({self.stopping_criteria["controls_abs_tol"].GetDouble()}) was reached.', + nlopt.MAXEVAL_REACHED: f'Optimization stopped because maxeval ({self.stopping_criteria["maximum_function_evalualtion"].GetInt()}) was reached.', + nlopt.MAXTIME_REACHED: f'Optimization stopped because maxtime ({maxtime}) was reached.', + nlopt.FAILURE: 'Generic failure return value.', + nlopt.INVALID_ARGS: 'Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).', + nlopt.OUT_OF_MEMORY: 'Ran out of memory.', + nlopt.ROUNDOFF_LIMITED: 'Halted because roundoff errors limited progress. (In this case, the optimization still typically returns a useful result.)', + nlopt.FORCED_STOP: 'Halted because of a forced termination: the user called nlopt_force_stop(opt) on the optimization’s nlopt_opt object opt from the user’s objective function or constraints.' + } + info = {"Termination":nlopt_result_map[self.nlopt_optimizer.last_optimize_result()]} + DictLogger(f"NLOPT-{self.algorithm_name}",info) + + def CheckOptimizerSupport(self, algorithm_name, constraint_type): + # Unconstrained gradient-based optimizers + unconstrained_optimizers = { + "LBFGS": nlopt.LD_LBFGS + } + + # Constrained gradient-based optimizers with equality constraints + equality_constrained_optimizers = { + "SLSQP": nlopt.LD_SLSQP + } + + # Constrained gradient-based optimizers with inequality constraints + inequality_constrained_optimizers = { + "MMA": nlopt.LD_MMA, + "SLSQP": nlopt.LD_SLSQP + } + + if constraint_type == "equality": + if algorithm_name not in equality_constrained_optimizers.keys(): + raise ValueError(f"The algorithm {algorithm_name} does not support equality constraints, support {equality_constrained_optimizers.keys()}.") + elif constraint_type == "inequality": + if algorithm_name not in inequality_constrained_optimizers.keys(): + raise ValueError(f"The algorithm {algorithm_name} does not support inequality constraints, support {inequality_constrained_optimizers.keys()}.") + else: + if algorithm_name not in unconstrained_optimizers.keys(): + raise ValueError(f"The algorithm {algorithm_name} does not support unconstrained optimization, support {unconstrained_optimizers.keys()}.") + return True + + def GetOptimizer(self,name): + nlopt_algorithm_mapping = { + "MMA": nlopt.LD_MMA, + "SLSQP": nlopt.LD_SLSQP, + "LBFGS": nlopt.LD_LBFGS + } + return nlopt_algorithm_mapping[name] diff --git a/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_constraint.py b/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_constraint.py index 1315b83d9d6a..94e79c85bf9d 100644 --- a/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_constraint.py +++ b/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_constraint.py @@ -9,6 +9,8 @@ from KratosMultiphysics.OptimizationApplication.utilities.helper_utilities import CallOnAll import numpy import sys +import time as timer +import datetime class StandardizedNLOPTConstraint(ResponseRoutine): """Standardized constraint response function @@ -94,8 +96,9 @@ def CalculateStandardizedValueAndGradients(self, control_field: numpy.ndarray, g master_control_updated = True break # output - if master_control_updated and gradient_field.size > 0: + if master_control_updated: CallOnAll(self.__optimization_problem.GetListOfProcesses("output_processes"), Kratos.OutputProcess.PrintOutput) + self.LogOptimizationStep() self.__optimization_problem.AdvanceStep() with TimeLogger(f"StandardizedNLOPTConstraint::Calculate {self.GetReponse().GetName()} value", None, "Finished"): @@ -161,4 +164,17 @@ def GetInfo(self) -> dict: "ref_value": self.GetReferenceValue(), "violation [%]": self.GetAbsoluteViolation() } - return info \ No newline at end of file + return info + + def LogOptimizationStep(self): + + now = datetime.datetime.now() + now_str = now.strftime("%Y-%m-%d %H:%M:%S") + iteration_text = f" EoF Iteration {self.__optimization_problem.GetStep()}" + iteration_output = f"{'#'} {iteration_text} [Time: {now_str}] {'#'}" + + divided_line = len(iteration_output) * '#' + + to_print = f"{divided_line}\n{iteration_output}\n{divided_line}\n" + + Kratos.Logger.PrintInfo(to_print) \ No newline at end of file diff --git a/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_objective.py b/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_objective.py index 23463c20952e..84e960d2cf4e 100644 --- a/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_objective.py +++ b/applications/OptimizationApplication/python_scripts/algorithms/standardized_NLOPT_objective.py @@ -8,6 +8,8 @@ from KratosMultiphysics.OptimizationApplication.utilities.logger_utilities import TimeLogger from KratosMultiphysics.OptimizationApplication.utilities.helper_utilities import CallOnAll import numpy +import time as timer +import datetime class StandardizedNLOPTObjective(ResponseRoutine): """Standardized objective response function @@ -71,8 +73,9 @@ def CalculateStandardizedValueAndGradients(self, control_field: numpy.ndarray, g master_control_updated = True break # output - if master_control_updated and gradient_field.size > 0: + if master_control_updated: CallOnAll(self.__optimization_problem.GetListOfProcesses("output_processes"), Kratos.OutputProcess.PrintOutput) + self.LogOptimizationStep() self.__optimization_problem.AdvanceStep() with TimeLogger(f"CalculateStandardizedValueAndGradients {self.GetReponse().GetName()} value", None, "Finished"): @@ -143,4 +146,17 @@ def GetInfo(self) -> dict: if init_value: info["abs_change [%]"] = self.GetAbsoluteChange()/init_value * 100 - return info \ No newline at end of file + return info + + def LogOptimizationStep(self): + + now = datetime.datetime.now() + now_str = now.strftime("%Y-%m-%d %H:%M:%S") + iteration_text = f" EoF Iteration {self.__optimization_problem.GetStep()}" + iteration_output = f"{'#'} {iteration_text} [Time: {now_str}] {'#'}" + + divided_line = len(iteration_output) * '#' + + to_print = f"{divided_line}\n{iteration_output}\n{divided_line}\n" + + Kratos.Logger.PrintInfo(to_print) \ No newline at end of file diff --git a/applications/OptimizationApplication/python_scripts/controls/thickness/shell_thickness_control.py b/applications/OptimizationApplication/python_scripts/controls/thickness/shell_thickness_control.py index def4f2679591..5dc45183efa9 100644 --- a/applications/OptimizationApplication/python_scripts/controls/thickness/shell_thickness_control.py +++ b/applications/OptimizationApplication/python_scripts/controls/thickness/shell_thickness_control.py @@ -203,7 +203,7 @@ def Update(self, new_control_field: ContainerExpressionTypes) -> bool: if not IsSameContainerExpression(new_control_field, self.GetEmptyField()): raise RuntimeError(f"Updates for the required element container not found for control \"{self.GetName()}\". [ required model part name: {self.model_part.FullName()}, given model part name: {new_control_field.GetModelPart().FullName()} ]") - if KratosOA.ExpressionUtils.NormL2(self.control_field - new_control_field) > 1e-9: + if KratosOA.ExpressionUtils.NormL2(self.control_field - new_control_field) > 1e-15: with TimeLogger(self.__class__.__name__, f"Updating {self.GetName()}...", f"Finished updating of {self.GetName()}.",False): # update the control thickness field self.control_field = new_control_field From 0a36a1b68d0d5f2ccd93bc4c267ee7f5b6266128 Mon Sep 17 00:00:00 2001 From: RezaNajian Date: Mon, 3 Jul 2023 15:11:09 +0200 Subject: [PATCH 5/7] bug fix --- .../python_scripts/algorithms/NLOPT_algorithms.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/applications/OptimizationApplication/python_scripts/algorithms/NLOPT_algorithms.py b/applications/OptimizationApplication/python_scripts/algorithms/NLOPT_algorithms.py index f710a027bb14..85e63df2eb74 100644 --- a/applications/OptimizationApplication/python_scripts/algorithms/NLOPT_algorithms.py +++ b/applications/OptimizationApplication/python_scripts/algorithms/NLOPT_algorithms.py @@ -11,6 +11,7 @@ from KratosMultiphysics.OptimizationApplication.algorithms.algorithm import Algorithm from KratosMultiphysics.OptimizationApplication.utilities.component_data_view import ComponentDataView from KratosMultiphysics.OptimizationApplication.utilities.logger_utilities import DictLogger +from KratosMultiphysics.OptimizationApplication.utilities.helper_utilities import CallOnAll def Factory(model: Kratos.Model, parameters: Kratos.Parameters, optimization_problem: OptimizationProblem): @@ -124,6 +125,7 @@ def Finalize(self): def Solve(self): self.nlopt_optimizer.optimize(self.x0) + CallOnAll(self._optimization_problem.GetListOfProcesses("output_processes"), Kratos.OutputProcess.PrintOutput) self.LogTermination() def LogTermination(self): From 5399b50165369819bf0fa4390ecbd2c8c4482911 Mon Sep 17 00:00:00 2001 From: RezaNajian Date: Mon, 3 Jul 2023 16:36:54 +0200 Subject: [PATCH 6/7] test added and cleaned --- .../materials_2D.json | 0 .../optimization_parameters.json | 32 ++++-------- .../primal_parameters.json | 21 -------- .../shell.mdpa | 0 .../test_NLOP_optimizers.py | 50 +++++++++++++++++++ .../shell-thickness-opt-test/run_test.py | 14 ------ .../tests/test_OptimizationApplication.py | 3 ++ 7 files changed, 63 insertions(+), 57 deletions(-) rename applications/OptimizationApplication/tests/NLOPT_tests/{shell-thickness-opt-test => MMA_shell_thickness_opt}/materials_2D.json (100%) rename applications/OptimizationApplication/tests/NLOPT_tests/{shell-thickness-opt-test => MMA_shell_thickness_opt}/optimization_parameters.json (77%) rename applications/OptimizationApplication/tests/NLOPT_tests/{shell-thickness-opt-test => MMA_shell_thickness_opt}/primal_parameters.json (74%) rename applications/OptimizationApplication/tests/NLOPT_tests/{shell-thickness-opt-test => MMA_shell_thickness_opt}/shell.mdpa (100%) create mode 100644 applications/OptimizationApplication/tests/NLOPT_tests/MMA_shell_thickness_opt/test_NLOP_optimizers.py delete mode 100644 applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/run_test.py diff --git a/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/materials_2D.json b/applications/OptimizationApplication/tests/NLOPT_tests/MMA_shell_thickness_opt/materials_2D.json similarity index 100% rename from applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/materials_2D.json rename to applications/OptimizationApplication/tests/NLOPT_tests/MMA_shell_thickness_opt/materials_2D.json diff --git a/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/optimization_parameters.json b/applications/OptimizationApplication/tests/NLOPT_tests/MMA_shell_thickness_opt/optimization_parameters.json similarity index 77% rename from applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/optimization_parameters.json rename to applications/OptimizationApplication/tests/NLOPT_tests/MMA_shell_thickness_opt/optimization_parameters.json index 37e719662c7b..e10993a69632 100644 --- a/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/optimization_parameters.json +++ b/applications/OptimizationApplication/tests/NLOPT_tests/MMA_shell_thickness_opt/optimization_parameters.json @@ -78,13 +78,8 @@ "type": "NLOPT_algorithms", "NLOPT_settings" : { "algorithm_name" : "MMA", - "algorithm_settings" : {}, "stopping_criteria" : { - "objective_rel_tol": "", - "objective_abs_tol": "", - "controls_rel_tol": "", - "controls_abs_tol": "", - "maximum_function_evalualtion": 10 + "maximum_function_evalualtion": 2 } }, "controls": [ @@ -112,22 +107,15 @@ "module": "KratosMultiphysics.OptimizationApplication.processes", "settings": { "output_file_name": "summary.csv", - "write_kratos_version": false, - "write_time_stamp": false - } - }, - { - "type": "optimization_problem_vtu_output_process", - "module": "KratosMultiphysics.OptimizationApplication.processes", - "settings": { - "file_format": "binary", - "write_deformed_configuration": false, - "list_of_output_components": [ - "all" - ], - "output_precision": 7, - "output_interval": 1, - "echo_level": 0 + "write_kratos_version" : false, + "write_time_stamp" : false, + "list_of_output_components": ["all"], + "format_info": { + "int_length" : 7, + "float_precision": 9, + "bool_values" : ["no", "yes"], + "string_length" : 14 + } } } ] diff --git a/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/primal_parameters.json b/applications/OptimizationApplication/tests/NLOPT_tests/MMA_shell_thickness_opt/primal_parameters.json similarity index 74% rename from applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/primal_parameters.json rename to applications/OptimizationApplication/tests/NLOPT_tests/MMA_shell_thickness_opt/primal_parameters.json index 8f1c1b6e432f..703a08fbedab 100644 --- a/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/primal_parameters.json +++ b/applications/OptimizationApplication/tests/NLOPT_tests/MMA_shell_thickness_opt/primal_parameters.json @@ -67,26 +67,5 @@ }, "output_processes" : { - "vtk_output" : [{ - "python_module" : "vtk_output_process", - "kratos_module" : "KratosMultiphysics", - "process_name" : "VTKOutputProcess", - "Parameters" : { - "model_part_name": "shell", - "file_format": "binary", - "output_precision": 7, - "output_control_type": "step", - "output_frequency": 1.0, - "output_sub_model_parts": false, - "folder_name": "Primal_Results", - "save_output_files_in_folder": true, - "nodal_solution_step_data_variables": ["DISPLACEMENT","REACTION","ROTATION"], - "nodal_data_value_variables": [], - "element_data_value_variables": [], - "condition_data_value_variables": [], - "gauss_point_variables_extrapolated_to_nodes": [], - "gauss_point_variables_in_elements": ["VON_MISES_STRESS","THICKNESS"] - } - }] } } diff --git a/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/shell.mdpa b/applications/OptimizationApplication/tests/NLOPT_tests/MMA_shell_thickness_opt/shell.mdpa similarity index 100% rename from applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/shell.mdpa rename to applications/OptimizationApplication/tests/NLOPT_tests/MMA_shell_thickness_opt/shell.mdpa diff --git a/applications/OptimizationApplication/tests/NLOPT_tests/MMA_shell_thickness_opt/test_NLOP_optimizers.py b/applications/OptimizationApplication/tests/NLOPT_tests/MMA_shell_thickness_opt/test_NLOP_optimizers.py new file mode 100644 index 000000000000..4b5734d685ba --- /dev/null +++ b/applications/OptimizationApplication/tests/NLOPT_tests/MMA_shell_thickness_opt/test_NLOP_optimizers.py @@ -0,0 +1,50 @@ +import KratosMultiphysics as Kratos +import KratosMultiphysics.KratosUnittest as kratos_unittest + +from KratosMultiphysics.kratos_utilities import DeleteFileIfExisting +from KratosMultiphysics.OptimizationApplication.optimization_analysis import OptimizationAnalysis +import csv, os + +try: + import nlopt + nlopt_available = True +except ImportError: + nlopt_available = False + +@kratos_unittest.skipIf(not nlopt_available, "Missing nlopt python libraries ") +class TestNLOPTOptimizers(kratos_unittest.TestCase): + # @classmethod + # def setUpClass(cls): + # with kratos_unittest.WorkFolderScope(".", __file__): + # with open("optimization_parameters.json", "r") as file_input: + # cls.parameters = Kratos.Parameters(file_input.read()) + # cls.model = Kratos.Model() + # cls.analysis = OptimizationAnalysis(cls.model, cls.parameters) + + def test_MMA_optimizer(self): + pass + with kratos_unittest.WorkFolderScope(".", __file__): + with open("optimization_parameters.json", "r") as file_input: + parameters = Kratos.Parameters(file_input.read()) + model = Kratos.Model() + analysis = OptimizationAnalysis(model, parameters) + analysis.Run() + optimization_log_filename = "summary.csv" + # Testing + with open(optimization_log_filename, 'r') as csvfile: + reader = csv.reader(csvfile, delimiter=',') + last_line = None + for i, row in enumerate(reader): + if i == 15: + last_line = row + + resulting_strain_energy = float(last_line[1].strip()) + resulting_mass = float(last_line[2].strip()) + + self.assertAlmostEqual(resulting_mass, 7642.774084393494,2) + self.assertAlmostEqual(resulting_strain_energy, 5.209266637299775e-05,2) + + os.remove(optimization_log_filename) + +if __name__ == "__main__": + kratos_unittest.main() diff --git a/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/run_test.py b/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/run_test.py deleted file mode 100644 index 7bb7e394f07d..000000000000 --- a/applications/OptimizationApplication/tests/NLOPT_tests/shell-thickness-opt-test/run_test.py +++ /dev/null @@ -1,14 +0,0 @@ -import KratosMultiphysics as Kratos -import KratosMultiphysics.KratosUnittest as kratos_unittest - -from KratosMultiphysics.kratos_utilities import DeleteFileIfExisting -from KratosMultiphysics.OptimizationApplication.optimization_analysis import OptimizationAnalysis -from KratosMultiphysics.compare_two_files_check_process import CompareTwoFilesCheckProcess - - -with kratos_unittest.WorkFolderScope(".", __file__): - with open("optimization_parameters.json", "r") as file_input: - parameters = Kratos.Parameters(file_input.read()) - model = Kratos.Model() - analysis = OptimizationAnalysis(model, parameters) - analysis.Run() diff --git a/applications/OptimizationApplication/tests/test_OptimizationApplication.py b/applications/OptimizationApplication/tests/test_OptimizationApplication.py index 172fa054d348..27b97bb782ea 100644 --- a/applications/OptimizationApplication/tests/test_OptimizationApplication.py +++ b/applications/OptimizationApplication/tests/test_OptimizationApplication.py @@ -32,6 +32,7 @@ import control.test_master_control import control.material.test_material_properties_control import control.thickness.test_shell_thickness_control +import NLOPT_tests.MMA_shell_thickness_opt.test_NLOP_optimizers import filtering.implicit_filters_tests import test_component_data_view import process_tests.test_optimization_problem_vtu_output_process @@ -95,6 +96,8 @@ def AssembleTestSuites(): smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([control.material.test_material_properties_control.TestMaterialPropertiesControl])) smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([control.thickness.test_shell_thickness_control.TestShellThicknessControl])) + smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([NLOPT_tests.MMA_shell_thickness_opt.test_NLOP_optimizers.TestNLOPTOptimizers])) + smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([filtering.implicit_filters_tests.HelmholtzAnalysisTest])) smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([process_tests.test_optimization_problem_vtu_output_process.TestOptimizationProblemVtuOutputProcess])) smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([process_tests.test_optimization_problem_ascii_output_process.TestOptimizationProblemAsciiOutputProcess])) From 8ef43669601ca47fdfe761dac6e9a309f2d4ee30 Mon Sep 17 00:00:00 2001 From: RezaNajian Date: Mon, 3 Jul 2023 17:22:55 +0200 Subject: [PATCH 7/7] bug fix in test_standardized_responses --- .../tests/responses_tests/test_standardized_responses.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/applications/OptimizationApplication/tests/responses_tests/test_standardized_responses.py b/applications/OptimizationApplication/tests/responses_tests/test_standardized_responses.py index f6a158a0e50f..f688317f5e26 100644 --- a/applications/OptimizationApplication/tests/responses_tests/test_standardized_responses.py +++ b/applications/OptimizationApplication/tests/responses_tests/test_standardized_responses.py @@ -93,6 +93,7 @@ def test_ObjectiveMinimization(self): }""") standardized_objective = StandardizedObjective(parameters, self.master_control, self.optimization_problem) + standardized_objective.Initialize() self.assertAlmostEqual(standardized_objective.GetStandardizedValue(), self.response_function.CalculateValue() * 2.0) self._CheckSensitivity(standardized_objective, 1e-9, 6) @@ -104,6 +105,7 @@ def test_ObjectiveMaximization(self): }""") standardized_objective = StandardizedObjective(parameters, self.master_control, self.optimization_problem) + standardized_objective.Initialize() self.assertAlmostEqual(standardized_objective.GetStandardizedValue(), self.response_function.CalculateValue() * -2.0) self._CheckSensitivity(standardized_objective, 1e-9, 6) @@ -122,6 +124,7 @@ def setUpClass(cls): }""") cls.standardized_constraint = StandardizedConstraint(parameters, cls.master_control, cls.optimization_problem) + cls.standardized_constraint.Initialize() cls.standardized_constraint.CalculateStandardizedValue(cls.initial_configuration) def test_ConstraintInitialValueEquality(self): @@ -132,6 +135,7 @@ def test_ConstraintInitialValueEquality(self): }""") standardized_constraint = StandardizedConstraint(parameters, self.master_control, self.optimization_problem) + standardized_constraint.Initialize() self.assertAlmostEqual(standardized_constraint.GetStandardizedValue(), 0.0) self._CheckSensitivity(standardized_constraint, 1e-9, 6) @@ -143,6 +147,7 @@ def test_ConstraintInitialValueLessThan(self): }""") standardized_constraint = StandardizedConstraint(parameters, self.master_control, self.optimization_problem) + standardized_constraint.Initialize() self.assertAlmostEqual(standardized_constraint.GetStandardizedValue(), 0.0) self._CheckSensitivity(standardized_constraint, 1e-9, 6) @@ -154,6 +159,7 @@ def test_ConstraintInitialValueGreaterThan(self): }""") standardized_constraint = StandardizedConstraint(parameters, self.master_control, self.optimization_problem) + standardized_constraint.Initialize() self.assertAlmostEqual(standardized_constraint.GetStandardizedValue(), 0.0) self._CheckSensitivity(standardized_constraint, 1e-9, 6) @@ -165,6 +171,7 @@ def test_ConstraintSpecifiedValueEquality(self): }""") standardized_constraint = StandardizedConstraint(parameters, self.master_control, self.optimization_problem) + standardized_constraint.Initialize() self.assertAlmostEqual(standardized_constraint.GetStandardizedValue(), self.response_function.CalculateValue() - 4.0) self._CheckSensitivity(standardized_constraint, 1e-9, 6) @@ -176,6 +183,7 @@ def test_ConstraintSpecifiedValueLessThan(self): }""") standardized_constraint = StandardizedConstraint(parameters, self.master_control, self.optimization_problem) + standardized_constraint.Initialize() self.assertAlmostEqual(standardized_constraint.GetStandardizedValue(), self.response_function.CalculateValue() - 4.0) self._CheckSensitivity(standardized_constraint, 1e-9, 6) @@ -187,6 +195,7 @@ def test_ConstraintSpecifiedValueGreaterThan(self): }""") standardized_constraint = StandardizedConstraint(parameters, self.master_control, self.optimization_problem) + standardized_constraint.Initialize() self.assertAlmostEqual(standardized_constraint.GetStandardizedValue(), -self.response_function.CalculateValue() + 4.0) self._CheckSensitivity(standardized_constraint, 1e-9, 6)