def __init__(self, settings, model, solver_name):
        super().__init__(settings, model, solver_name)

        model_part_utilities.CreateModelPartsFromCouplingDataSettings(
            self.settings["data"], self.model, self.name)
        model_part_utilities.AllocateHistoricalVariablesFromCouplingDataSettings(
            self.settings["data"], self.model, self.name)
    def __init__(self, settings, model, solver_name):
        super(ExternalSolverWrapper, self).__init__(settings, model, solver_name)

        settings_defaults = KM.Parameters("""{
            "import_meshes"    : [ ],
            "export_data"      : [ ],
            "import_data"      : [ ]
        }""")

        self.settings["solver_wrapper_settings"].ValidateAndAssignDefaults(settings_defaults)

        model_part_utilities.CreateModelPartsFromCouplingDataSettings(self.settings["data"], self.model, self.name)
        model_part_utilities.AllocateHistoricalVariablesFromCouplingDataSettings(self.settings["data"], self.model, self.name)
Beispiel #3
0
    def __init__(self, settings, model, solver_name):
        super().__init__(settings, model, solver_name)

        self.time_step = self.settings["solver_wrapper_settings"][
            "time_step"].GetDouble()
        self.model_part = self.model.CreateModelPart(
            self.settings["solver_wrapper_settings"]
            ["main_model_part_name"].GetString())

        self.model_part.ProcessInfo[KM.DOMAIN_SIZE] = self.settings[
            "solver_wrapper_settings"]["domain_size"].GetInt()

        model_part_utilities.AllocateHistoricalVariablesFromCouplingDataSettings(
            self.settings["data"], self.model, self.name)
Beispiel #4
0
    def __init__(self, settings, model, solver_name):
        super().__init__(settings, model, solver_name)

        settings_defaults = KM.Parameters("""{
            "model_parts_read" : { },
            "model_parts_send" : { },
            "model_parts_recv" : { }
        }""")

        self.settings["solver_wrapper_settings"].ValidateAndAssignDefaults(
            settings_defaults)

        model_part_utilities.CreateMainModelPartsFromCouplingDataSettings(
            self.settings["data"], self.model, self.name)
        model_part_utilities.AllocateHistoricalVariablesFromCouplingDataSettings(
            self.settings["data"], self.model, self.name)
    def test_AllocateHistoricalVariablesFromCouplingDataSettings(self):
        mp_structure = self.model.CreateModelPart("Structure")
        mp_aux = self.model.CreateModelPart("aux_model_part")

        model_part_utilities.AllocateHistoricalVariablesFromCouplingDataSettings(self.data_settings, self.model, "dummy_solver_name")

        # make sure the original settings are not modified
        self.assertFalse(self.data_settings["disp"].Has("location"))

        self.assertTrue(mp_structure.HasNodalSolutionStepVariable(KM.DISPLACEMENT))
        self.assertTrue(mp_structure.HasNodalSolutionStepVariable(KM.FORCE))
        self.assertTrue(mp_structure.HasNodalSolutionStepVariable(KM.REACTION))
        self.assertFalse(mp_structure.HasNodalSolutionStepVariable(KM.VELOCITY_X))

        self.assertTrue(mp_aux.HasNodalSolutionStepVariable(KM.VELOCITY_X))
        self.assertFalse(mp_aux.HasNodalSolutionStepVariable(KM.DISPLACEMENT))
        self.assertFalse(mp_aux.HasNodalSolutionStepVariable(KM.FORCE))
        self.assertFalse(mp_aux.HasNodalSolutionStepVariable(KM.REACTION))
Beispiel #6
0
    def __init__(self, settings, model, solver_name):
        super().__init__(settings, model, solver_name)

        settings_defaults = KM.Parameters("""{
            "main_model_part_name" : "",
            "domain_size" : 2,
            "executable_name"  : ""
        }""")

        self.settings["solver_wrapper_settings"].ValidateAndAssignDefaults(
            settings_defaults)
        model_part_name = self.settings["solver_wrapper_settings"][
            "main_model_part_name"].GetString()
        model_part_utilities.CreateMainModelPartsFromCouplingDataSettings(
            self.settings["data"], self.model, self.name)
        model_part_utilities.AllocateHistoricalVariablesFromCouplingDataSettings(
            self.settings["data"], self.model, self.name)
        self.mp = self.model[model_part_name]
        self.mp.CreateNewNode(1, 0, 0, 0)