예제 #1
0
    def AddDofs(self):
        # this can safely be called also for restarts, it is internally checked if the dofs exist already
        KratosMultiphysics.VariableUtils().AddDof(
            KratosMultiphysics.DISPLACEMENT_X, KratosMultiphysics.REACTION_X,
            self.main_model_part)
        KratosMultiphysics.VariableUtils().AddDof(
            KratosMultiphysics.DISPLACEMENT_Y, KratosMultiphysics.REACTION_Y,
            self.main_model_part)
        KratosMultiphysics.VariableUtils().AddDof(
            KratosMultiphysics.DISPLACEMENT_Z, KratosMultiphysics.REACTION_Z,
            self.main_model_part)
        if self.settings["rotation_dofs"].GetBool():
            KratosMultiphysics.VariableUtils().AddDof(
                KratosMultiphysics.ROTATION_X,
                KratosMultiphysics.REACTION_MOMENT_X, self.main_model_part)
            KratosMultiphysics.VariableUtils().AddDof(
                KratosMultiphysics.ROTATION_Y,
                KratosMultiphysics.REACTION_MOMENT_Y, self.main_model_part)
            KratosMultiphysics.VariableUtils().AddDof(
                KratosMultiphysics.ROTATION_Z,
                KratosMultiphysics.REACTION_MOMENT_Z, self.main_model_part)
        if self.settings["displacement_control"].GetBool():
            KratosMultiphysics.VariableUtils().AddDof(
                StructuralMechanicsApplication.LOAD_FACTOR,
                StructuralMechanicsApplication.PRESCRIBED_DISPLACEMENT,
                self.main_model_part)

        # Add dofs that the user defined in the ProjectParameters
        auxiliary_solver_utilities.AddDofs(
            self.main_model_part, self.settings["auxiliary_dofs_list"],
            self.settings["auxiliary_reaction_list"])
        KratosMultiphysics.Logger.PrintInfo("::[MechanicalSolver]:: ",
                                            "DOF's ADDED")
예제 #2
0
    def _AddDofsToModelPart(self, model_part):
        KratosMultiphysics.VariableUtils().AddDof(
            KratosMultiphysics.DISPLACEMENT_X, KratosMultiphysics.REACTION_X,
            model_part)
        KratosMultiphysics.VariableUtils().AddDof(
            KratosMultiphysics.DISPLACEMENT_Y, KratosMultiphysics.REACTION_Y,
            model_part)
        KratosMultiphysics.VariableUtils().AddDof(
            KratosMultiphysics.DISPLACEMENT_Z, KratosMultiphysics.REACTION_Z,
            model_part)

        if self.settings["pressure_dofs"].GetBool():
            KratosMultiphysics.VariableUtils().AddDof(
                KratosMultiphysics.PRESSURE, KratosParticle.PRESSURE_REACTION,
                model_part)

        # Add dofs that the user defined in the ProjectParameters
        auxiliary_solver_utilities.AddDofs(
            model_part, self.settings["auxiliary_dofs_list"],
            self.settings["auxiliary_reaction_list"])