diff --git a/applications/ContactStructuralMechanicsApplication/python_scripts/contact_structural_mechanics_analysis.py b/applications/ContactStructuralMechanicsApplication/python_scripts/contact_structural_mechanics_analysis.py index cb45e8bbad7c..9446e67eabf9 100644 --- a/applications/ContactStructuralMechanicsApplication/python_scripts/contact_structural_mechanics_analysis.py +++ b/applications/ContactStructuralMechanicsApplication/python_scripts/contact_structural_mechanics_analysis.py @@ -47,27 +47,14 @@ def _CreateSolver(self, external_model_part=None): if (self.echo_level == 0): KM.Logger.GetDefaultOutput().SetSeverity(KM.Logger.Severity.WARNING) - ## Structure model part definition - main_model_part_name = self.project_parameters["problem_data"]["model_part_name"].GetString() - if self.model.HasModelPart(main_model_part_name): - self.main_model_part = self.model[main_model_part_name] - self.using_external_model_part = True - else: - self.main_model_part = KratosMultiphysics.ModelPart(main_model_part_name) - self.main_model_part.ProcessInfo.SetValue(KratosMultiphysics.DOMAIN_SIZE, - self.project_parameters["problem_data"]["domain_size"].GetInt()) - self.using_external_model_part = False - ## Solver construction import python_solvers_wrapper_contact_structural - self.solver = python_solvers_wrapper_contact_structural.CreateSolver(self.main_model_part, self.project_parameters) + self.solver = python_solvers_wrapper_contact_structural.CreateSolver(self.model, self.project_parameters) ## Adds the necessary variables to the model_part only if they don't exist self.solver.AddVariables() - if not self.using_external_model_part: - ## Read the model - note that SetBufferSize is done here - self.solver.ReadModelPart() # TODO move to global instance + self.solver.ImportModelPart() # TODO move to global instance def _SetUpListOfProcesses(self): """ Set up the list of processes """ diff --git a/applications/ContactStructuralMechanicsApplication/python_scripts/python_solvers_wrapper_contact_structural.py b/applications/ContactStructuralMechanicsApplication/python_scripts/python_solvers_wrapper_contact_structural.py index 0a2facb13b54..ddbe0cd23db9 100644 --- a/applications/ContactStructuralMechanicsApplication/python_scripts/python_solvers_wrapper_contact_structural.py +++ b/applications/ContactStructuralMechanicsApplication/python_scripts/python_solvers_wrapper_contact_structural.py @@ -2,10 +2,10 @@ import KratosMultiphysics -def CreateSolver(main_model_part, custom_settings): +def CreateSolver(model, custom_settings): - if (type(main_model_part) != KratosMultiphysics.ModelPart): - raise Exception("input is expected to be provided as a Kratos ModelPart object") + if (type(model) != KratosMultiphysics.Model): + raise Exception("input is expected to be provided as a Kratos Model object") if (type(custom_settings) != KratosMultiphysics.Parameters): raise Exception("input is expected to be provided as a Kratos Parameters object") @@ -43,6 +43,6 @@ def CreateSolver(main_model_part, custom_settings): custom_settings["solver_settings"].RemoveValue("time_integration_method") # does not throw even if the value is not existing solver_module = __import__(solver_module_name) - solver = solver_module.CreateSolver(main_model_part, custom_settings["solver_settings"]) + solver = solver_module.CreateSolver(model, custom_settings["solver_settings"]) return solver diff --git a/applications/FSIapplication/python_scripts/partitioned_fsi_base_solver.py b/applications/FSIapplication/python_scripts/partitioned_fsi_base_solver.py index 82b3f0283c90..fdf8e3e0960e 100755 --- a/applications/FSIapplication/python_scripts/partitioned_fsi_base_solver.py +++ b/applications/FSIapplication/python_scripts/partitioned_fsi_base_solver.py @@ -76,7 +76,22 @@ def __init__(self, structure_main_model_part, fluid_main_model_part, project_par coupling_utility_parameters = self.settings["coupling_solver_settings"]["coupling_strategy"] # Construct the structure solver - self.structure_solver = python_solvers_wrapper_structural.CreateSolver(self.structure_main_model_part, + self.structure_model = KratosMultiphysics.Model() + structural_solver_settings = project_parameters["structure_solver_settings"]["solver_settings"] + if not structural_solver_settings.Has("time_stepping"): + KratosMultiphysics.Logger.PrintInfo("PartitionedFSIBaseSolver", "Using the old way to pass the time_step, this will be removed!") + time_stepping_params = KratosMultiphysics.Parameters("{}") + time_stepping_params.AddValue("time_step", project_parameters["structure_solver_settings"]["problem_data"]["time_step"]) + structural_solver_settings.AddValue("time_stepping", time_stepping_params) + if not structural_solver_settings.Has("domain_size"): + KratosMultiphysics.Logger.PrintInfo("PartitionedFSIBaseSolver", "Using the old way to pass the domain_size, this will be removed!") + structural_solver_settings.AddEmptyValue("domain_size") + structural_solver_settings["domain_size"].SetInt(project_parameters["structure_solver_settings"]["problem_data"]["domain_size"].GetInt()) + if not structural_solver_settings.Has("model_part_name"): + KratosMultiphysics.Logger.PrintInfo("PartitionedFSIBaseSolver", "Using the old way to pass the model_part_name, this will be removed!") + structural_solver_settings.AddEmptyValue("model_part_name") + structural_solver_settings["model_part_name"].SetString(project_parameters["structure_solver_settings"]["problem_data"]["model_part_name"].GetString()) + self.structure_solver = python_solvers_wrapper_structural.CreateSolver(self.structure_model, project_parameters["structure_solver_settings"]) print("* Structure solver constructed.") @@ -134,6 +149,7 @@ def AddVariables(self): def ImportModelPart(self): # Import structure model part self.structure_solver.ImportModelPart() + self.structure_solver.PrepareModelPart() # Import fluid model part self.fluid_solver.ImportModelPart() diff --git a/applications/FSIapplication/python_scripts/trilinos_partitioned_fsi_base_solver.py b/applications/FSIapplication/python_scripts/trilinos_partitioned_fsi_base_solver.py index 20a984b80b74..16c86a1bbcaf 100644 --- a/applications/FSIapplication/python_scripts/trilinos_partitioned_fsi_base_solver.py +++ b/applications/FSIapplication/python_scripts/trilinos_partitioned_fsi_base_solver.py @@ -84,7 +84,22 @@ def __init__(self, structure_main_model_part, fluid_main_model_part, project_par self.structure_interface_submodelpart_name = self.settings["coupling_solver_settings"]["structure_interfaces_list"][0].GetString() # Construct the structure solver - self.structure_solver = python_solvers_wrapper_structural.CreateSolver(self.structure_main_model_part, + self.structure_model = KratosMultiphysics.Model() + structural_solver_settings = project_parameters["structure_solver_settings"]["solver_settings"] + if not structural_solver_settings.Has("time_stepping"): + KratosMultiphysics.Logger.PrintInfo("TrilinosPartitionedFSIBaseSolver", "Using the old way to pass the time_step, this will be removed!") + time_stepping_params = KratosMultiphysics.Parameters("{}") + time_stepping_params.AddValue("time_step", project_parameters["problem_data"]["time_step"]) + solver_settings.AddValue("time_stepping", time_stepping_params) + if not structural_solver_settings.Has("domain_size"): + KratosMultiphysics.Logger.PrintInfo("TrilinosPartitionedFSIBaseSolver", "Using the old way to pass the domain_size, this will be removed!") + structural_solver_settings.AddEmptyValue("domain_size") + structural_solver_settings["domain_size"].SetInt(project_parameters["structure_solver_settings"]["problem_data"]["domain_size"].GetInt()) + if not structural_solver_settings.Has("model_part_name"): + KratosMultiphysics.Logger.PrintInfo("TrilinosPartitionedFSIBaseSolver", "Using the old way to pass the model_part_name, this will be removed!") + structural_solver_settings.AddEmptyValue("model_part_name") + structural_solver_settings["model_part_name"].SetString(project_parameters["structure_solver_settings"]["problem_data"]["model_part_name"].GetString()) + self.structure_solver = python_solvers_wrapper_structural.CreateSolver(self.structure_model, project_parameters["structure_solver_settings"]) if (KratosMPI.mpi.rank == 0) : print("* Structure solver constructed.") diff --git a/applications/FSIapplication/tests/FSI_problem_emulator_test.py b/applications/FSIapplication/tests/FSI_problem_emulator_test.py index b1a5278ba214..dfc192f1cc0a 100644 --- a/applications/FSIapplication/tests/FSI_problem_emulator_test.py +++ b/applications/FSIapplication/tests/FSI_problem_emulator_test.py @@ -74,6 +74,8 @@ def RunTestCase(self): "parallel_type" : "OpenMP" }, "solver_settings" : { + "model_part_name" : "Structure", + "domain_size" : 2, "solver_type" : "Dynamic", "echo_level" : 0, "analysis_type" : "linear", @@ -107,17 +109,20 @@ def RunTestCase(self): with WorkFolderScope(self.work_folder): - self.structure_main_model_part = ModelPart("Structure") - self.structure_main_model_part.ProcessInfo.SetValue(DOMAIN_SIZE, 2) + self.model = Model() # Construct the structure solver import python_solvers_wrapper_structural - self.structure_solver = python_solvers_wrapper_structural.CreateSolver(self.structure_main_model_part, StructureSolverSettings) + self.structure_solver = python_solvers_wrapper_structural.CreateSolver(self.model, StructureSolverSettings) self.structure_solver.AddVariables() self.structure_solver.ImportModelPart() + self.structure_solver.PrepareModelPart() + + self.structure_main_model_part = self.model["Structure"] + self.structure_solver.AddDofs() self.SetStructureBoundaryConditions() diff --git a/applications/StructuralMechanicsApplication/python_scripts/structural_mechanics_analysis.py b/applications/StructuralMechanicsApplication/python_scripts/structural_mechanics_analysis.py index 426b72004fc7..e3e343da1057 100644 --- a/applications/StructuralMechanicsApplication/python_scripts/structural_mechanics_analysis.py +++ b/applications/StructuralMechanicsApplication/python_scripts/structural_mechanics_analysis.py @@ -34,15 +34,9 @@ def __init__(self, model, project_parameters): time_stepping_params.AddValue("time_step", project_parameters["problem_data"]["time_step"]) solver_settings.AddValue("time_stepping", time_stepping_params) - # Create the ModelPart - # Note that this in temporary and will be done through the model in the future - main_model_part_name = project_parameters["problem_data"]["model_part_name"].GetString() - if model.HasModelPart(main_model_part_name): - self.main_model_part = model[main_model_part_name] - else: - self.main_model_part = KratosMultiphysics.ModelPart(main_model_part_name) - self.main_model_part.ProcessInfo.SetValue(KratosMultiphysics.DOMAIN_SIZE, - project_parameters["problem_data"]["domain_size"].GetInt()) + ## Get echo level and parallel type + self.echo_level = self.project_parameters["problem_data"]["echo_level"].GetInt() + self.parallel_type = self.project_parameters["problem_data"]["parallel_type"].GetString() super(StructuralMechanicsAnalysis, self).__init__(model, project_parameters) @@ -52,6 +46,28 @@ def __init__(self, model, project_parameters): import KratosMultiphysics.TrilinosApplication as TrilinosApplication + def Initialize(self): + self.ModifyInitialProperties() + self.ModifyInitialGeometry() + self._ExecuteInitialize() + self._SetUpListOfProcesses() + ## Processes initialization + for process in self.list_of_processes: + process.ExecuteInitialize() + + ## Solver initialization + self.solver.Initialize() + + self._ExecuteBeforeSolutionLoop() + + def InitializeSolutionStep(self): + super(StructuralMechanicsAnalysis, self).InitializeSolutionStep() + + if self.is_printing_rank: + KratosMultiphysics.Logger.PrintInfo(self._GetSimulationName(), "STEP: ", self.main_model_part.ProcessInfo[KratosMultiphysics.STEP]) + KratosMultiphysics.Logger.PrintInfo(self._GetSimulationName(), "TIME: ", self.time) + sys.stdout.flush() + def OutputSolutionStep(self): # This function is temporary until restart saving is handled through process super(StructuralMechanicsAnalysis, self).OutputSolutionStep() @@ -73,27 +89,9 @@ def _CreateProcesses(self, parameter_name, initialization_order): """ list_of_processes = super(StructuralMechanicsAnalysis, self)._CreateProcesses(parameter_name, initialization_order) - if parameter_name == "processes": - processes_block_names = ["constraints_process_list", "loads_process_list", "list_other_processes", "json_output_process" - "json_check_process", "check_analytic_results_process", "contact_process_list"] - if len(list_of_processes) == 0: - KratosMultiphysics.Logger.PrintInfo("StructuralMechanicsAnalysis", "Using the old way to create the processes, this will be removed!") - from process_factory import KratosProcessFactory - factory = KratosProcessFactory(self.model) - for process_name in processes_block_names: - if (self.project_parameters.Has(process_name) is True): - list_of_processes += factory.ConstructListOfProcesses(self.project_parameters[process_name]) - else: - for process_name in processes_block_names: - if (self.project_parameters.Has(process_name) is True): - raise Exception("Mixing of process initialization is not alowed!") - elif parameter_name == "output_processes": - if self.project_parameters.Has("output_configuration"): - #KratosMultiphysics.Logger.PrintInfo("StructuralMechanicsAnalysis", "Using the old way to create the gid-output, this will be removed!") - gid_output= self._SetUpGiDOutput() - list_of_processes += [gid_output,] - else: - raise NameError("wrong parameter name") + if not self.using_external_model_part: + ## Read the model - note that SetBufferSize is done here + self.solver.ReadModelPart() # TODO move to global instance return list_of_processes @@ -111,6 +109,65 @@ def _SetUpGiDOutput(self): return gid_output + ## Adds the Dofs if they don't exist + self.solver.AddDofs() + + ## Add the Modelpart to the Model if it is not already there + if not self.using_external_model_part: + self.model.AddModelPart(self.main_model_part) + + def _SetUpListOfProcesses(self): + from process_factory import KratosProcessFactory + factory = KratosProcessFactory(self.model) + self.list_of_processes = factory.ConstructListOfProcesses(self.project_parameters["constraints_process_list"]) + self.list_of_processes += factory.ConstructListOfProcesses(self.project_parameters["loads_process_list"]) + if (self.project_parameters.Has("list_other_processes") is True): + self.list_of_processes += factory.ConstructListOfProcesses(self.project_parameters["list_other_processes"]) + if (self.project_parameters.Has("json_output_process") is True): + self.list_of_processes += factory.ConstructListOfProcesses(self.project_parameters["json_output_process"]) + # Processes for tests + if (self.project_parameters.Has("json_check_process") is True): + self.list_of_processes += factory.ConstructListOfProcesses(self.project_parameters["json_check_process"]) + if (self.project_parameters.Has("check_analytic_results_process") is True): + self.list_of_processes += factory.ConstructListOfProcesses(self.project_parameters["check_analytic_results_process"]) + + #TODO this should be generic + # initialize GiD I/O + self._SetUpGiDOutput() + if self.have_output: + self.list_of_processes += [self.output,] + + if self.is_printing_rank and self.echo_level > 1: + count = 0 + for process in self.list_of_processes: + count += 1 + # KratosMultiphysics.Logger.PrintInfo("Process " + str(count), process) # FIXME + + def _ExecuteBeforeSolutionLoop(self): + """ Perform Operations before the SolutionLoop """ + + for process in self.list_of_processes: + process.ExecuteBeforeSolutionLoop() + + ## Writing the full ProjectParameters file before solving + if self.is_printing_rank and self.echo_level > 1: + f = open("ProjectParametersOutput.json", 'w') + f.write(self.project_parameters.PrettyPrintJsonString()) + f.close() + + ## Stepping and time settings + self.solver.SetDeltaTime(self.project_parameters["problem_data"]["time_step"].GetDouble()) + start_time = self.project_parameters["problem_data"]["start_time"].GetDouble() + self.end_time = self.project_parameters["problem_data"]["end_time"].GetDouble() + + if self.solver.GetComputingModelPart().ProcessInfo[KratosMultiphysics.IS_RESTARTED] is True: + self.time = self.solver.GetComputingModelPart().ProcessInfo[KratosMultiphysics.TIME] + else: + self.time = start_time + + if self.is_printing_rank: + KratosMultiphysics.Logger.PrintInfo(self._GetSimulationName(), "Analysis -START- ") + def _GetSimulationName(self): return "::[KSM Simulation]:: " @@ -149,3 +206,100 @@ def __CheckForDeprecatedGiDSettings(self): model = KratosMultiphysics.Model() simulation = StructuralMechanicsAnalysis(model, parameters) simulation.Run() + + solver_settings = project_parameters["solver_settings"] + if not solver_settings.Has("time_stepping"): + KratosMultiphysics.Logger.PrintInfo("StructuralMechanicsAnalysis", "Using the old way to pass the time_step, this will be removed!") + time_stepping_params = KratosMultiphysics.Parameters("{}") + time_stepping_params.AddValue("time_step", project_parameters["problem_data"]["time_step"]) + solver_settings.AddValue("time_stepping", time_stepping_params) + + if not solver_settings.Has("domain_size"): + KratosMultiphysics.Logger.PrintInfo("StructuralMechanicsAnalysis", "Using the old way to pass the domain_size, this will be removed!") + solver_settings.AddEmptyValue("domain_size") + solver_settings["domain_size"].SetInt(project_parameters["problem_data"]["domain_size"].GetInt()) + + if not solver_settings.Has("model_part_name"): + KratosMultiphysics.Logger.PrintInfo("StructuralMechanicsAnalysis", "Using the old way to pass the model_part_name, this will be removed!") + solver_settings.AddEmptyValue("model_part_name") + solver_settings["model_part_name"].SetString(project_parameters["problem_data"]["model_part_name"].GetString()) + + ## Get echo level and parallel type + self.echo_level = self.project_parameters["problem_data"]["echo_level"].GetInt() + self.parallel_type = self.project_parameters["problem_data"]["parallel_type"].GetString() + def Initialize(self): + self.ModifyInitialProperties() + self.ModifyInitialGeometry() + self._ExecuteInitialize() + self._SetUpListOfProcesses() + ## Processes initialization + for process in self.list_of_processes: + process.ExecuteInitialize() + + ## Solver initialization + self.solver.Initialize() + + self._ExecuteBeforeSolutionLoop() + + def InitializeSolutionStep(self): + super(StructuralMechanicsAnalysis, self).InitializeSolutionStep() + + if self.is_printing_rank: + KratosMultiphysics.Logger.PrintInfo(self._GetSimulationName(), "STEP: ", self.solver.GetComputingModelPart().ProcessInfo[KratosMultiphysics.STEP]) + KratosMultiphysics.Logger.PrintInfo(self._GetSimulationName(), "TIME: ", self.time) + sys.stdout.flush() + + self.solver.ImportModelPart() # TODO move to global instance + ## Adds the Dofs if they don't exist + self.solver.AddDofs() + + def _SetUpListOfProcesses(self): + from process_factory import KratosProcessFactory + factory = KratosProcessFactory(self.model) + self.list_of_processes = factory.ConstructListOfProcesses(self.project_parameters["constraints_process_list"]) + self.list_of_processes += factory.ConstructListOfProcesses(self.project_parameters["loads_process_list"]) + if (self.project_parameters.Has("list_other_processes") is True): + self.list_of_processes += factory.ConstructListOfProcesses(self.project_parameters["list_other_processes"]) + if (self.project_parameters.Has("json_output_process") is True): + self.list_of_processes += factory.ConstructListOfProcesses(self.project_parameters["json_output_process"]) + # Processes for tests + if (self.project_parameters.Has("json_check_process") is True): + self.list_of_processes += factory.ConstructListOfProcesses(self.project_parameters["json_check_process"]) + if (self.project_parameters.Has("check_analytic_results_process") is True): + self.list_of_processes += factory.ConstructListOfProcesses(self.project_parameters["check_analytic_results_process"]) + + #TODO this should be generic + # initialize GiD I/O + self._SetUpGiDOutput() + if self.have_output: + self.list_of_processes += [self.output,] + + if self.is_printing_rank and self.echo_level > 1: + count = 0 + for process in self.list_of_processes: + count += 1 + # KratosMultiphysics.Logger.PrintInfo("Process " + str(count), process) # FIXME + + def _ExecuteBeforeSolutionLoop(self): + """ Perform Operations before the SolutionLoop """ + + for process in self.list_of_processes: + process.ExecuteBeforeSolutionLoop() + + ## Writing the full ProjectParameters file before solving + if self.is_printing_rank and self.echo_level > 1: + f = open("ProjectParametersOutput.json", 'w') + f.write(self.project_parameters.PrettyPrintJsonString()) + f.close() + + ## Stepping and time settings + start_time = self.project_parameters["problem_data"]["start_time"].GetDouble() + self.end_time = self.project_parameters["problem_data"]["end_time"].GetDouble() + + if self.solver.GetComputingModelPart().ProcessInfo[KratosMultiphysics.IS_RESTARTED] is True: + self.time = self.solver.GetComputingModelPart().ProcessInfo[KratosMultiphysics.TIME] + else: + self.time = start_time + + if self.is_printing_rank: + KratosMultiphysics.Logger.PrintInfo(self._GetSimulationName(), "Analysis -START- ") diff --git a/applications/StructuralMechanicsApplication/python_scripts/structural_mechanics_solver.py b/applications/StructuralMechanicsApplication/python_scripts/structural_mechanics_solver.py index 21805e64312c..94d4e8eef545 100755 --- a/applications/StructuralMechanicsApplication/python_scripts/structural_mechanics_solver.py +++ b/applications/StructuralMechanicsApplication/python_scripts/structural_mechanics_solver.py @@ -41,15 +41,16 @@ class MechanicalSolver(PythonSolver): Only the member variables listed below should be accessed directly. Public member variables: - settings -- Kratos parameters containing solver settings. model -- the model containing the modelpart used to construct the solver. + settings -- Kratos parameters containing solver settings. """ def __init__(self, model, custom_settings): super(MechanicalSolver, self).__init__(model, custom_settings) default_settings = KratosMultiphysics.Parameters(""" { - "model_part_name" : "PLEASE_SPECIFY_NAME", + "model_part_name" : "", + "domain_size" : -1, "echo_level": 0, "buffer_size": 2, "analysis_type": "non_linear", @@ -64,6 +65,7 @@ def __init__(self, model, custom_settings): "material_import_settings" :{ "materials_filename": "" }, + "time_stepping" : { }, "rotation_dofs": false, "pressure_dofs": false, "reform_dofs_at_each_step": false, @@ -116,11 +118,20 @@ def __init__(self, model, custom_settings): self.settings.ValidateAndAssignDefaults(default_settings) model_part_name = self.settings["model_part_name"].GetString() + if model_part_name == "": + raise Exception('Please specify a model_part name!') + # This will be changed once the Model is fully supported! if self.model.HasModelPart(model_part_name): self.main_model_part = self.model[model_part_name] + self.solver_imports_model_part = False else: - self.main_model_part = KratosMultiphysics.ModelPart(model_part_name) + self.main_model_part = KratosMultiphysics.ModelPart(model_part_name) # Model.CreateodelPart() + domain_size = self.settings["domain_size"].GetInt() + if domain_size < 0: + raise Exception('Please specify a "domain_size" >= 0!') + self.main_model_part.ProcessInfo.SetValue(KratosMultiphysics.DOMAIN_SIZE, domain_size) + self.solver_imports_model_part = True self.print_on_rank_zero("::[MechanicalSolver]:: ", "Construction finished") @@ -174,10 +185,11 @@ def AddDofs(self): KratosMultiphysics.VariableUtils().AddDof(KratosMultiphysics.PRESSURE, KratosMultiphysics.PRESSURE_REACTION,self.main_model_part) self.print_on_rank_zero("::[MechanicalSolver]:: ", "DOF's ADDED") - def ReadModelPart(self): - """This function reads the ModelPart + def ImportModelPart(self): + """This function imports the ModelPart """ - self._ImportModelPart(self.main_model_part, self.settings["model_import_settings"]) + if self.solver_imports_model_part: + self._ImportModelPart(self.main_model_part, self.settings["model_import_settings"]) def PrepareModelPart(self): if not self.is_restarted(): @@ -185,10 +197,12 @@ def PrepareModelPart(self): self._execute_after_reading() self._set_and_fill_buffer() - # This will be removed once the Model is fully supported! + # This will be removed once the Model is fully supported! => It wont e necessary anymore if not self.model.HasModelPart(self.main_model_part.Name): self.model.AddModelPart(self.main_model_part) + print(self.model) + KratosMultiphysics.Logger.PrintInfo("::[MechanicalSolver]::", "ModelPart prepared for Solver.") def Initialize(self): diff --git a/kratos/python_scripts/python_solver.py b/kratos/python_scripts/python_solver.py index 66a016f469cd..1b90ca9eceff 100644 --- a/kratos/python_scripts/python_solver.py +++ b/kratos/python_scripts/python_solver.py @@ -45,7 +45,7 @@ def AddDofs(self): """ pass - def ReadModelPart(self): + def ImportModelPart(self): """This function reads the ModelPart """ raise Exception("This function has to be implemented in the derived class") @@ -60,13 +60,6 @@ def GetMinimumBufferSize(self): """ raise Exception('Please implement "GetMinimumBufferSize" in your derived solver') - def ImportModelPart(self): - warning_msg = 'Using "ImportModelPart" is deprecated and will be removed in the future!\n' - warning_msg = 'Use "ReadModelPart" + "PrepareModelPart" instead' - KratosMultiphysics.Logger.PrintWarning("::[PythonSolver]::", warning_msg) - self.ReadModelPart() - self.PrepareModelPart() - def ExportModelPart(self): """This function exports the ModelPart to and mdpa-file """