def _create_solution_scheme(self): import schemes_factory Schemes = schemes_factory.SolutionScheme( self.settings["time_integration_settings"], self.settings["dofs"]) solution_scheme = Schemes.GetSolutionScheme() solution_scheme.SetProcessVector(self._get_scheme_custom_processes()) return solution_scheme
def _get_time_integration_methods(self): # set solution scheme import schemes_factory Schemes = schemes_factory.SolutionScheme(self.settings["time_integration_settings"],self.settings["dofs"]) # set integration method dictionary for scalars scalar_integration_methods = Schemes.GetScalarIntegrationMethods() # set integration method dictionary for components component_integration_methods = Schemes.GetComponentIntegrationMethods() #print(scalar_integration_methods) #print(component_integration_methods) # set time order self.process_info[KratosSolid.TIME_INTEGRATION_ORDER] = Schemes.GetTimeIntegrationOrder() # set scheme parameters to process_info self._set_scheme_process_info_parameters() # first: calculate parameters (only once permitted for each monolithic dof set "components + scalar") dofs_list = self.settings["dofs"] dofs = [] for i in range(0, dofs_list.size() ): dofs.append(dofs_list[i].GetString()) # add default DISPLACEMENT dof if( len(dofs) == 0 or (len(dofs) == 1 and dofs[0] =="ROTATION") ): dofs.append('DISPLACEMENT') #print(" DOFS ",dofs) scalar_dof_method_set = False vector_dof_method_set = False for dof in dofs: kratos_variable = KratosMultiphysics.KratosGlobals.GetVariable(dof) if( isinstance(kratos_variable,KratosMultiphysics.DoubleVariable) and (not scalar_dof_method_set) ): scalar_integration_methods[dof].CalculateParameters(self.process_info) scalar_dof_method_set = True print("::[----Integration----]::",scalar_integration_methods[dof],"("+dof+")") if( isinstance(kratos_variable,KratosMultiphysics.Array1DVariable3) and (not vector_dof_method_set) ): component_integration_methods[dof+"_X"].CalculateParameters(self.process_info) vector_dof_method_set = True print("::[----Integration----]::",component_integration_methods[dof+"_X"],"("+dof+")") return scalar_integration_methods, component_integration_methods
def _get_dofs(self): import schemes_factory Schemes = schemes_factory.SolutionScheme(self.settings["time_integration_settings"],self.settings["dofs"]) return Schemes.GetDofsAndReactions()
def GetVariables(self): import schemes_factory Schemes = schemes_factory.SolutionScheme(self.settings["time_integration_settings"],self.settings["dofs"]) return Schemes.GetVariables()
def _create_solution_scheme(self): import schemes_factory Schemes = schemes_factory.SolutionScheme(self.settings["time_integration_settings"],self.settings["dofs"]) mechanical_scheme = Schemes.GetSolutionScheme() return mechanical_scheme