Esempio n. 1
0
    def __init__(self, domain_size):

        # Construct the utility
        self.domain_size = domain_size
        if domain_size == 2:
            self.MappingVariablesUtility = KratosDam.MappingVariables2DUtilities(
            )
        else:
            self.MappingVariablesUtility = KratosDam.MappingVariables3DUtilities(
            )
Esempio n. 2
0
    def Initialize(self):

        if (self.settings["acoustic_solver_settings"]
            ["scheme_type"].GetString() == "Newmark"):
            beta = 0.25
            gamma = 0.5
        else:
            raise Exception(
                "Please use the Newmark Scheme, it is the only one available")

        move_mesh_flag = self.settings["acoustic_solver_settings"][
            "move_mesh_flag"].GetBool()
        max_iterations = self.settings["acoustic_solver_settings"][
            "max_iteration"].GetInt()
        res_rel_tol = self.settings["acoustic_solver_settings"][
            "residual_relative_tolerance"].GetDouble()
        res_abs_tol = self.settings["acoustic_solver_settings"][
            "residual_absolute_tolerance"].GetDouble()

        time_scheme = KratosDam.DamPScheme(beta, gamma)
        conv_criteria = KratosMultiphysics.ResidualCriteria(
            res_rel_tol, res_abs_tol)

        self.solver = KratosMultiphysics.ResidualBasedNewtonRaphsonStrategy(
            self.main_model_part, time_scheme, self.linear_solver,
            conv_criteria, max_iterations, False, False, move_mesh_flag)

        (self.solver).SetEchoLevel(
            self.settings["acoustic_solver_settings"]["echo_level"].GetInt())

        print("Initialization Solver finished")
Esempio n. 3
0
    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
Esempio n. 4
0
    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()

        if(solution_type == "Quasi-Static"):
            if(rayleigh_m<1.0e-20 and rayleigh_k<1.0e-20):
                scheme =  KratosDam.IncrementalUpdateStaticSmoothingScheme()
            else:
                scheme =  KratosDam.IncrementalUpdateStaticDampedSmoothingScheme(rayleigh_m,rayleigh_k)
        else:
            if(scheme_type == "Newmark"):
                damp_factor_m = 0.0
            else:
                damp_factor_m = -0.01
            scheme = KratosDam.BossakDisplacementSmoothingScheme(damp_factor_m,rayleigh_m,rayleigh_k)

        return scheme
    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()  
        
        beta=0.25
        gamma=0.5
        scheme = KratosDam.TrilinosDamUPScheme(beta,gamma,rayleigh_m,rayleigh_k)
        
        return scheme