def AddVariables(self): # this can safely be called also for restarts, it is internally checked if the variables exist already # Add displacements. self.main_model_part.AddNodalSolutionStepVariable(KratosMultiphysics.DISPLACEMENT) self.main_model_part.AddNodalSolutionStepVariable(KratosMultiphysics.REACTION) # Add specific variables for the problem conditions. self.main_model_part.AddNodalSolutionStepVariable(KratosMultiphysics.POSITIVE_FACE_PRESSURE) self.main_model_part.AddNodalSolutionStepVariable(KratosMultiphysics.NEGATIVE_FACE_PRESSURE) self.main_model_part.AddNodalSolutionStepVariable(StructuralMechanicsApplication.POINT_LOAD) self.main_model_part.AddNodalSolutionStepVariable(StructuralMechanicsApplication.LINE_LOAD) self.main_model_part.AddNodalSolutionStepVariable(StructuralMechanicsApplication.SURFACE_LOAD) self.main_model_part.AddNodalSolutionStepVariable(KratosMultiphysics.VOLUME_ACCELERATION) if self.settings["rotation_dofs"].GetBool(): # Add specific variables for the problem (rotation dofs). self.main_model_part.AddNodalSolutionStepVariable(KratosMultiphysics.ROTATION) self.main_model_part.AddNodalSolutionStepVariable(KratosMultiphysics.REACTION_MOMENT) self.main_model_part.AddNodalSolutionStepVariable(StructuralMechanicsApplication.POINT_MOMENT) if self.settings["volumetric_strain_dofs"].GetBool(): # Add specific variables for the problem (rotation dofs). self.main_model_part.AddNodalSolutionStepVariable(KratosMultiphysics.VOLUMETRIC_STRAIN) self.main_model_part.AddNodalSolutionStepVariable(StructuralMechanicsApplication.REACTION_STRAIN) if self.settings["displacement_control"].GetBool(): # Add displacement-control variables self.main_model_part.AddNodalSolutionStepVariable(StructuralMechanicsApplication.LOAD_FACTOR) self.main_model_part.AddNodalSolutionStepVariable(StructuralMechanicsApplication.PRESCRIBED_DISPLACEMENT) # Add variables that the user defined in the ProjectParameters auxiliary_solver_utilities.AddVariables(self.main_model_part, self.settings["auxiliary_variables_list"]) KratosMultiphysics.Logger.PrintInfo("::[MechanicalSolver]:: ", "Variables ADDED")
def _AddVariablesToModelPart(self, model_part): # Add displacements and reaction model_part.AddNodalSolutionStepVariable( KratosMultiphysics.DISPLACEMENT) model_part.AddNodalSolutionStepVariable(KratosMultiphysics.REACTION) # Add specific variables for the problem conditions model_part.AddNodalSolutionStepVariable(KratosMultiphysics.PRESSURE) model_part.AddNodalSolutionStepVariable( KratosMultiphysics.POSITIVE_FACE_PRESSURE) model_part.AddNodalSolutionStepVariable( KratosMultiphysics.VOLUME_ACCELERATION) # MPM specific nodal variables model_part.AddNodalSolutionStepVariable(KratosMultiphysics.NODAL_MASS) model_part.AddNodalSolutionStepVariable(KratosParticle.NODAL_MOMENTUM) model_part.AddNodalSolutionStepVariable(KratosParticle.NODAL_INERTIA) # Add variables that the user defined in the ProjectParameters auxiliary_solver_utilities.AddVariables( model_part, self.settings["auxiliary_variables_list"]) # Add variables for specific cases if self.settings["pressure_dofs"].GetBool(): # add specific variables for the problem (pressure dofs) model_part.AddNodalSolutionStepVariable( KratosParticle.PRESSURE_REACTION) model_part.AddNodalSolutionStepVariable( KratosParticle.NODAL_MPRESSURE)
def AddVariables(self): # this can safely be called also for restarts, it is internally checked if the variables exist already # Add displacements. self.main_model_part.AddNodalSolutionStepVariable(KratosMultiphysics.DISPLACEMENT) self.main_model_part.AddNodalSolutionStepVariable(KratosMultiphysics.REACTION) if self.settings["rotation_dofs"].GetBool(): # Add specific variables for the problem (rotation dofs). self.main_model_part.AddNodalSolutionStepVariable(KratosMultiphysics.ROTATION) self.main_model_part.AddNodalSolutionStepVariable(KratosMultiphysics.REACTION_MOMENT) # Add variables that the user defined in the ProjectParameters auxiliary_solver_utilities.AddVariables(self.main_model_part, self.settings["auxiliary_variables_list"]) KratosMultiphysics.Logger.PrintInfo("::[IgaSolver]:: ", "Variables ADDED")