def _ConstructScheme(self, scheme_type, solution_type): rayleigh_m = self.settings["mechanical_solver_settings"][ "rayleigh_m"].GetDouble() rayleigh_k = self.settings["mechanical_solver_settings"][ "rayleigh_k"].GetDouble() self.main_model_part.ProcessInfo.SetValue(KratosSolid.RAYLEIGH_ALPHA, rayleigh_m) self.main_model_part.ProcessInfo.SetValue(KratosSolid.RAYLEIGH_BETA, rayleigh_k) if (solution_type == "Quasi-Static"): if (rayleigh_m < 1.0e-20 and rayleigh_k < 1.0e-20): scheme = TrilinosApplication.TrilinosResidualBasedIncrementalUpdateStaticScheme( ) else: scheme = KratosDam.TrilinosIncrementalUpdateStaticDampedScheme( ) else: if (scheme_type == "Newmark"): damp_factor_m = 0.0 else: damp_factor_m = -0.01 scheme = TrilinosApplication.TrilinosResidualBasedBossakDisplacementScheme( damp_factor_m) return scheme
def _create_solution_scheme(self): return TrilinosApplication.TrilinosResidualBasedIncrementalUpdateStaticScheme( )
def Initialize(self): # Construct the communicator self.EpetraCommunicator = TrilinosApplication.CreateCommunicator() # Set ProcessInfo variables self.main_model_part.ProcessInfo.SetValue( KratosMultiphysics.REFERENCE_TEMPERATURE, self.settings["reference_temperature"].GetDouble()) self.main_model_part.ProcessInfo.SetValue( KratosMultiphysics.TIME_INTEGRATION_THETA, self.settings["thermal_solver_settings"] ["theta_scheme"].GetDouble()) # Get the computing model parts self.thermal_computing_model_part = self.main_model_part.GetSubModelPart( self.thermal_model_part_name) self.mechanical_computing_model_part = self.GetComputingModelPart() # Builder and solver creation thermal_builder_and_solver = self._ConstructBuilderAndSolver( self.settings["thermal_solver_settings"] ["block_builder"].GetBool(), self.thermal_linear_solver) mechanical_builder_and_solver = self._ConstructBuilderAndSolver( self.settings["mechanical_solver_settings"] ["block_builder"].GetBool(), self.mechanical_linear_solver) # Solution scheme creation thermal_scheme = TrilinosApplication.TrilinosResidualBasedIncrementalUpdateStaticScheme( ) mechanical_scheme = self._ConstructScheme( self.settings["mechanical_solver_settings"] ["scheme_type"].GetString(), self.settings["mechanical_solver_settings"] ["solution_type"].GetString()) # Get the convergence criterion convergence_criterion = self._ConstructConvergenceCriterion( self.settings["mechanical_solver_settings"] ["convergence_criterion"].GetString()) # Solver creation (Note: this could be TrilinosResidualBasedLinearStrategy, but there is no such strategy) self.Thermal_Solver = TrilinosApplication.TrilinosNewtonRaphsonStrategy( self.thermal_computing_model_part, thermal_scheme, convergence_criterion, thermal_builder_and_solver, self.settings["mechanical_solver_settings"] ["max_iteration"].GetInt(), self.settings["thermal_solver_settings"] ["compute_reactions"].GetBool(), self.settings["thermal_solver_settings"] ["reform_dofs_at_each_step"].GetBool(), self.settings["thermal_solver_settings"] ["move_mesh_flag"].GetBool()) self.Mechanical_Solver = self._ConstructSolver( mechanical_builder_and_solver, mechanical_scheme, convergence_criterion, self.settings["mechanical_solver_settings"] ["strategy_type"].GetString()) # Set echo_level self.Thermal_Solver.SetEchoLevel( self.settings["thermal_solver_settings"]["echo_level"].GetInt()) self.Mechanical_Solver.SetEchoLevel( self.settings["mechanical_solver_settings"]["echo_level"].GetInt()) # Check if everything is assigned correctly self.Thermal_Solver.Check() self.Mechanical_Solver.Check() print("Initialization MPI DamThermoMechanicSolver finished")
def _GetSolutionScheme(self, analysis_type, component_wise, compute_contact_forces): mechanical_scheme = TrilinosApplication.TrilinosResidualBasedIncrementalUpdateStaticScheme( ) return mechanical_scheme