예제 #1
0
    def __init__(self, custom_settings):

        # Set defaults and validate custom settings.
        ##TODO : solving_strategy_settings must be time_integration_settings (GiD interface changes needed)
        implicit_solver_settings = KratosMultiphysics.Parameters("""
        {
            "solving_strategy_settings":{
                "bossak_factor" :-0.3,
                "dynamic_factor": 1.0,
                "lumped_mass_matrix" : true,
                "consistent_mass_matrix" : false,
                "rayleigh_damping": false,
                "rayleigh_alpha": 0.0,
                "rayleigh_beta" : 0.0
            }
        }
        """)

        # Validate and transfer settings
        if (custom_settings.Has("solving_strategy_settings")):
            from json_settings_utility import JsonSettingsUtility
            JsonSettingsUtility.TransferMatchingSettingsToDestination(
                custom_settings["solving_strategy_settings"],
                implicit_solver_settings["solving_strategy_settings"])

        self.implicit_solver_settings = implicit_solver_settings[
            "solving_strategy_settings"]

        # Construct the base solver.
        super(ImplicitMonolithicSolver, self).__init__(custom_settings)
예제 #2
0
    def __init__(self, custom_settings):

        # Set defaults and validate custom settings.
        ##TODO : solving_strategy_settings must be time_integration_settings (GiD interface changes needed)
        explicit_solver_settings = KratosMultiphysics.Parameters("""
        {
           "solving_strategy_settings":{
               "time_step_prediction_level": 0,
               "max_delta_time": 1.0e-5,
               "fraction_delta_time": 0.9,
               "rayleigh_damping": false,
               "rayleigh_alpha": 0.0,
               "rayleigh_beta" : 0.0
           }

        }
        """)

        # Validate and transfer settings
        if( custom_settings.Has("solving_strategy_settings") ):
            from json_settings_utility import JsonSettingsUtility
            JsonSettingsUtility.TransferMatchingSettingsToDestination(custom_settings["solving_strategy_settings"], explicit_solver_settings["solving_strategy_settings"])
        self.explicit_solver_settings = explicit_solver_settings["solving_strategy_settings"]

        # Validate the remaining settings in the base class.
        if not custom_settings["solving_strategy_settings"].Has("integration_method"): # Override defaults in the base class.
            custom_settings["solving_strategy_settings"].AddEmptyValue("integration_method")
            custom_settings["solving_strategy_settings"]["integration_method"].SetString("CentralDifferences")

        # Construct the base solver.
        super(ExplicitMonolithicSolver, self).__init__(custom_settings)

        print("::[Explicit_Scheme]:: "+self.settings["time_integration_settings"]["integration_method"].GetString()+" Scheme Ready")
    def __init__(self, custom_settings):
        # Set defaults and validate custom settings.
        eigensolver_settings = KratosMultiphysics.Parameters("""
        {
            "eigensolver_settings" : {
                "solver_type": "FEAST",
                "print_feast_output": true,
                "perform_stochastic_estimate": true,
                "solve_eigenvalue_problem": true,
                "compute_modal_contribution": false,
                "lambda_min": 0.0,
                "lambda_max": 1.0,
                "search_dimension": 10,
                "linear_solver_settings": {
                    "solver_type": "complex_skyline_lu_solver"
                }
            }
        }
        """)

        # Validate and transfer settings
        from json_settings_utility import JsonSettingsUtility
        JsonSettingsUtility.TransferMatchingSettingsToDestination(custom_settings, eigensolver_settings)
        self.eigensolver_settings = eigensolver_settings["eigensolver_settings"]

        # Correction for the eigen solver parameters input
        self.compute_modal_contribution = self.eigensolver_settings["compute_modal_contribution"].GetBool()
        self.eigensolver_settings.RemoveValue("compute_modal_contribution")

        # Construct the base solver.
        super(EigenSolver, self).__init__(custom_settings)

        print("::[Eigen_Scheme]:: "+self.settings["time_integration_settings"]["integration_method"].GetString()+" Scheme Ready")
예제 #4
0
    def __init__(self, Model, custom_settings):

        # Set defaults and validate custom settings.
        static_settings = KratosMultiphysics.Parameters("""
        {

        }
        """)

        # Validate and transfer settings
        from json_settings_utility import JsonSettingsUtility
        JsonSettingsUtility.TransferMatchingSettingsToDestination(
            custom_settings, static_settings)
        time_integration_settings = custom_settings[
            "time_integration_settings"]

        # Validate the remaining settings in the base class.
        if not time_integration_settings.Has("integration_method"):
            time_integration_settings.AddEmptyValue("integration_method")
            time_integration_settings["integration_method"].SetString(
                "Static")  # Override defaults in the base class.

        # Construct the base solver.
        # Calling base class of ImplicitMonolithicSolver it is ok.
        super(BaseSolver.ImplicitMonolithicSolver,
              self).__init__(Model, custom_settings)