Exemplo n.º 1
0
    def Initialize(self):
        if self.response_settings["model_import_settings"][
                "input_type"].GetString() == "mdpa":
            file_name = self.response_settings["model_import_settings"][
                "input_filename"].GetString()
            model_part_io = KM.ModelPartIO(file_name)
            model_part_io.ReadModelPart(self.model_part)
        else:
            self.model_part = self.model.GetModelPart(self._model_part_name)

        only = self.response_settings["only"].GetString()
        if only != "":
            only_part = self.model.GetModelPart(only)
            if only_part.NumberOfConditions() == 0:
                _AddConditionsFromParent(self.model_part, only_part)
                Logger.PrintWarning(
                    "FaceAngleResponse",
                    "Automatically added {} conditions to model_part '{}'.".
                    format(only_part.NumberOfConditions(), only_part.Name))
        else:
            only_part = self.model_part

        if only_part.NumberOfConditions() == 0:
            raise RuntimeError(
                "The model_part '{}' does not have any surface conditions!".
                format(only_part.Name))

        self.response_function_utility = KSO.FaceAngleResponseFunctionUtility(
            only_part, self.response_settings)

        self.response_function_utility.Initialize()
Exemplo n.º 2
0
    def Initialize(self):
        if self.response_settings["model_import_settings"][
                "input_type"].GetString() == "mdpa":
            file_name = self.response_settings["model_import_settings"][
                "input_filename"].GetString()
            model_part_io = KM.ModelPartIO(file_name)
            model_part_io.ReadModelPart(self.model_part)
        else:
            self.model_part = self.model.GetModelPart(self._model_part_name)

        only = self.response_settings["only"].GetString()
        if only != "":
            only_part = self.model.GetModelPart(only)
        else:
            only_part = self.model_part

        self.response_function_utility = KSO.FaceAngleResponseFunctionUtility(
            only_part, self.response_settings)

        self.response_function_utility.Initialize()