Ejemplo n.º 1
0
    def define_parameters(self, object):
        GravitationalDynamics.define_parameters(self, object)
        self.stopping_conditions.define_parameters(object)

        ####################################################

        object.add_method_parameter("get_t_begin",
                                    "set_t_begin",
                                    "begin_time",
                                    "Time at start of simulation",
                                    default_value=0.0 | nbody_system.time)

        object.add_method_parameter("get_dt",
                                    "set_dt",
                                    "timestep",
                                    "Constant time-step size",
                                    default_value=1e-3 | nbody_system.time)

        object.add_method_parameter("get_t",
                                    "set_t",
                                    "current_time",
                                    "Current time",
                                    default_value=0.0 | nbody_system.time)

        object.add_method_parameter("get_sakura_output_directory",
                                    "set_sakura_output_directory",
                                    "sakura_output_directory",
                                    "Output directory",
                                    default_value="./")
Ejemplo n.º 2
0
    def define_parameters(self, handler):
        GravitationalDynamics.define_parameters(self, handler)

        handler.add_method_parameter("get_time_step",
                                     "set_time_step",
                                     "timestep",
                                     "initial timestep for iteration",
                                     default_value=1.0 | nbody_system.time)
        handler.add_method_parameter("get_lightspeed",
                                     "set_lightspeed",
                                     "lightspeed",
                                     "lightspeed used in the code",
                                     default_value=1.0
                                     | nbody_system.length / nbody_system.time)
        handler.add_method_parameter("get_tolerance",
                                     "set_tolerance",
                                     "tolerance",
                                     "tolerance used in the code",
                                     default_value=1e-13)
        handler.add_method_parameter(
            "get_maximum_number_of_particles",
            "set_maximum_number_of_particles",
            "maximum_number_of_particles",
            "the code will evolve this number of particles, please be sure to account for mergers",
            default_value=100)
        handler.add_boolean_parameter(
            "get_evolve_to_exact_time", "set_evolve_to_exact_time",
            "evolve_to_exact_time",
            "the code will evolve the model to the exact time given in evolve_model",
            True)
Ejemplo n.º 3
0
    def define_parameters(self, handler):
        GravitationalDynamics.define_parameters(self, handler)
        self.stopping_conditions.define_parameters(handler)
        
        handler.add_method_parameter(
            "get_bs_tolerance", 
            "set_bs_tolerance",
            "bs_tolerance", 
            "Error tolerance of the Bulirsch-Stoer integrator", 
            default_value = 1.0e-8
        )

        handler.add_method_parameter(
            "get_word_length", 
            "set_word_length",
            "word_length", 
            "The word length, or number of bits for the mantissa, used for the arbitrary precision calculations (#digits = log10(2**# bits) ", 
            default_value = 72
        )
                
        handler.add_method_parameter(
            "get_eta", 
            "set_eta",
            "dt_param", 
            "dt_param, the time-step parameter for the adaptive time-step criterion", 
            default_value = 0.24
        )
            
        handler.add_method_parameter(
            "get_brutus_output_directory", 
            "set_brutus_output_directory",
            "brutus_output_directory", 
            "Path to the directory where Brutus stores its output", 
            default_value = "./"
        )
Ejemplo n.º 4
0
    def define_parameters(self, object):
        GravitationalDynamics.define_parameters(self, object)
        self.stopping_conditions.define_parameters(object)
        
        object.add_method_parameter(
            "get_bs_tolerance", 
            "set_bs_tolerance",
            "bs_tolerance", 
            "Error tolerance of the Bulirsch-Stoer integrator", 
            default_value = 1.0e-8
        )

        object.add_method_parameter(
            "get_word_length", 
            "set_word_length",
            "word_length", 
            "The word length, or number of bits for the mantissa, used for the arbitrary precision calculations (#digits = log10(2**# bits) ", 
            default_value = 72
        )
                
        object.add_method_parameter(
            "get_eta", 
            "set_eta",
            "dt_param", 
            "dt_param, the time-step parameter for the adaptive time-step criterion", 
            default_value = 0.24
        )
            
        object.add_method_parameter(
            "get_brutus_output_directory", 
            "set_brutus_output_directory",
            "brutus_output_directory", 
            "Path to the directory where Brutus stores its output", 
            default_value = "./"
        )
Ejemplo n.º 5
0
    def define_parameters(self, object):
        GravitationalDynamics.define_parameters(self, object)
        self.stopping_conditions.define_parameters(object)

        ####################################################

        object.add_method_parameter(
            "get_t_begin",
            "set_t_begin",
            "begin_time",
            "Time at start of simulation",
            default_value=0.0 | nbody_system.time,
        )

        object.add_method_parameter(
            "get_dt", "set_dt", "timestep", "Constant time-step size", default_value=1e-3 | nbody_system.time
        )

        object.add_method_parameter(
            "get_t", "set_t", "current_time", "Current time", default_value=0.0 | nbody_system.time
        )

        object.add_method_parameter(
            "get_sakura_output_directory",
            "set_sakura_output_directory",
            "sakura_output_directory",
            "Output directory",
            default_value="./",
        )
Ejemplo n.º 6
0
    def define_parameters(self, handler):
        GravitationalDynamics.define_parameters(self, handler)
        self.stopping_conditions.define_parameters(handler)

        handler.add_method_parameter(
            "get_eps2",
            "set_eps2",
            "epsilon_squared",
            "smoothing  parameter for gravity calculations",
            default_value=0.0 | nbody_system.length * nbody_system.length)

        handler.add_method_parameter(
            "get_changeover_rout",
            "set_changeover_rout",
            "r_out",
            ("changeover radius outer boundary reference for switching"
             " long/short-range interactions (if zero, auto-determine)"),
            default_value=0.0 | nbody_system.length)

        handler.add_method_parameter(
            "get_changeover_ratio",
            "set_changeover_ratio",
            "ratio_r_cut",
            "Changeover radius ratio between the inner and outer boundaries",
            default_value=0.1)

        handler.add_method_parameter(
            "get_group_radius",
            "set_group_radius",
            "r_bin",
            ("Group detection maximum radius to switch on AR (if zero,"
             " auto-determine)"),
            default_value=0.0 | nbody_system.length)

        handler.add_method_parameter(
            "get_rsearch_min",
            "set_rsearch_min",
            "r_search_min",
            "Minimum neighbor searching radius (if zero, auto-determine)",
            default_value=0.0 | nbody_system.length)

        handler.add_method_parameter("get_theta",
                                     "set_theta",
                                     "theta",
                                     "Tree opening angle",
                                     default_value=0.3)

        handler.add_method_parameter("get_gravitational_constant",
                                     "set_gravitational_constant",
                                     "gravitational_constant",
                                     "Gravitational constant",
                                     default_value=0.3)

        handler.add_method_parameter(
            "get_tree_step",
            "set_tree_step",
            "dt_soft",
            "Tree time step (if zero, auto-determine)",
            default_value=0.0 | nbody_system.time)
Ejemplo n.º 7
0
    def define_parameters(self, handler):
        self.stopping_conditions.define_parameters(handler)
        GravitationalDynamics.define_parameters(self, handler)

        handler.add_method_parameter("get_time_step",
                                     "set_time_step",
                                     "timestep",
                                     "constant timestep for iteration",
                                     default_value=0.0001 | nbody_system.time)

        handler.add_method_parameter(
            "get_integrator",
            "set_integrator",
            "integrator",
            "name of the integrator to use ({0})".format(
                sorted(self.INTEGRATORS.keys())),
            default_value="ias15")

        handler.add_method_parameter(
            "get_solver",
            "set_solver",
            "solver",
            "name of the gravity solver to use ({0})".format(
                sorted(self.SOLVERS.keys())),
            default_value="compensated")

        handler.add_method_parameter(
            "get_eps2",
            "set_eps2",
            "epsilon_squared",
            "smoothing parameter for gravity calculations",
            default_value=0.0 | nbody_system.length * nbody_system.length)

        handler.add_method_parameter(
            "get_opening_angle2",
            "set_opening_angle2",
            "opening_angle2",
            "opening angle, theta, for building the tree in case of tree solver: between 0 and 1",
            default_value=0.5)

        handler.add_method_parameter(
            "get_boundary",
            "set_boundary",
            "boundary",
            "name of the boundary type to use ({0}) (required for tree solver)"
            .format(sorted(self.BOUNDARIES.keys())),
            default_value="none")

        handler.add_method_parameter(
            "get_boundary_size",
            "set_boundary_size",
            "boundary_size",
            "size of the boundaries, if the type is not none",
            default_value=1.0 | nbody_system.length)
Ejemplo n.º 8
0
 def define_parameters(self, object):
     GravitationalDynamics.define_parameters(self, object)
     self.stopping_conditions.define_parameters(object)
     
     object.add_method_parameter(
         "get_bs_tolerance_float64", 
         "set_bs_tolerance_float64",
         "bs_tolerance", 
         "Error tolerance of the Bulirsch-Stoer integrator", 
         default_value = 1.0e-6
     )
     
     object.add_method_parameter(
         "get_eps2", 
         "set_eps2",
         "epsilon_squared", 
         "smoothing parameter for gravity calculations, usage is not recommended for Adaptb", 
         default_value = 0.0 | nbody_system.length**2
     )
     
     object.add_method_parameter(
         "get_dt_print", 
         "set_dt_print",
         "dt_print", 
         "dt_print, regular print interval to show status (% complete) of evolve_model", 
         default_value = 0.1 | nbody_system.time
     )
 
     object.add_method_parameter(
         "get_word_length", 
         "set_word_length",
         "word_length", 
         "The word length, or number of bits, used for the arbitrary precision calculations", 
         default_value = 64
     )
     
     object.add_method_parameter(
         "get_adaptb_output_directory", 
         "set_adaptb_output_directory",
         "adaptb_output_directory", 
         "Path to the directory where Adaptb stores its output", 
         default_value = "./"
     )
     
     object.add_method_parameter(
         "get_max_cpu_time", 
         "set_max_cpu_time",
         "time_limit_cpu", 
         "The cpu-time limit, the maximum amount of time Adaptb is allowed to run for.", 
         default_value = 3600.0 | units.s
     )
Ejemplo n.º 9
0
    def define_parameters(self, handler):
        GravitationalDynamics.define_parameters(self, handler)
        self.stopping_conditions.define_parameters(handler)

        handler.add_method_parameter(
            "get_word_length",
            "set_word_length",
            "word_length",
            "The word length, or number of bits for the mantissa, used for the arbitrary precision calculations (#digits = log10(2**# bits) ",
            default_value=53)

        handler.add_method_parameter("get_const_time_step",
                                     "set_const_time_step",
                                     "const_timestep",
                                     "constant timestep for iteration",
                                     default_value=0.7 | nbody_system.time)
Ejemplo n.º 10
0
    def define_parameters(self, handler):
        GravitationalDynamics.define_parameters(self, handler)
        self.stopping_conditions.define_parameters(handler)

        handler.add_method_parameter(
            "get_bs_tolerance_float64",
            "set_bs_tolerance_float64",
            "bs_tolerance",
            "Error tolerance of the Bulirsch-Stoer integrator",
            default_value=1.0e-6)

        handler.add_method_parameter(
            "get_eps2",
            "set_eps2",
            "epsilon_squared",
            "smoothing parameter for gravity calculations, usage is not recommended for Adaptb",
            default_value=0.0 | nbody_system.length**2)

        handler.add_method_parameter(
            "get_dt_print",
            "set_dt_print",
            "dt_print",
            "dt_print, regular print interval to show status (% complete) of evolve_model",
            default_value=0.1 | nbody_system.time)

        handler.add_method_parameter(
            "get_word_length",
            "set_word_length",
            "word_length",
            "The word length, or number of bits, used for the arbitrary precision calculations",
            default_value=64)

        handler.add_method_parameter(
            "get_adaptb_output_directory",
            "set_adaptb_output_directory",
            "adaptb_output_directory",
            "Path to the directory where Adaptb stores its output",
            default_value="./")

        handler.add_method_parameter(
            "get_max_cpu_time",
            "set_max_cpu_time",
            "time_limit_cpu",
            "The cpu-time limit, the maximum amount of time Adaptb is allowed to run for.",
            default_value=3600.0 | units.s)
Ejemplo n.º 11
0
    def define_parameters(self, object):
        self.stopping_conditions.define_parameters(object)
        GravitationalDynamics.define_parameters(self, object)
        
        object.add_method_parameter(
            "get_time_step",
            "set_time_step",
            "timestep",
            "constant timestep for iteration", 
            default_value = 0.0001 | nbody_system.time
        )


        object.add_method_parameter(
            "get_integrator",
            "set_integrator",
            "integrator",
            "name of the integrator to use ({0})".format(sorted(self.INTEGRATORS.keys())), 
            default_value = "ias15"
        )


        object.add_method_parameter(
            "get_solver",
            "set_solver",
            "solver",
            "name of the gravity solver to use ({0})".format(sorted(self.SOLVERS.keys())), 
            default_value = "compensated"
        )


        object.add_method_parameter(
            "get_opening_angle2",
            "set_opening_angle2",
            "opening_angle2",
            "opening angle, theta, for building the tree in case of tree solver: between 0 and 1", 
            default_value = 0.5
        )
Ejemplo n.º 12
0
 def define_parameters(self, object):
     GravitationalDynamics.define_parameters(self, object)
     
     object.add_method_parameter(
         "get_time_step",
         "set_time_step",
         "timestep",
         "initial timestep for iteration", 
         default_value = 1.0 | nbody_system.time
     )
     object.add_method_parameter(
         "get_lightspeed", 
         "set_lightspeed",
         "lightspeed", 
         "lightspeed used in the code", 
         default_value = 1.0 | nbody_system.length / nbody_system.time
     )
     object.add_method_parameter(
         "get_tolerance", 
         "set_tolerance",
         "tolerance", 
         "tolerance used in the code", 
         default_value = 1e-13
     )
     object.add_method_parameter(
         "get_maximum_number_of_particles", 
         "set_maximum_number_of_particles",
         "maximum_number_of_particles", 
         "the code will evolve this number of particles, please be sure to account for mergers", 
         default_value = 100
     )
     object.add_boolean_parameter(
         "get_evolve_to_exact_time", 
         "set_evolve_to_exact_time",
         "evolve_to_exact_time", 
         "the code will evolve the model to the exact time given in evolve_model", 
         True
     )
Ejemplo n.º 13
0
    def define_parameters(self, object):
        self.stopping_conditions.define_parameters(object)
        GravitationalDynamics.define_parameters(self, object)
        
        object.add_method_parameter(
            "get_time_step",
            "set_time_step",
            "timestep",
            "constant timestep for iteration", 
            default_value = 0.0001 | nbody_system.time
        )


        object.add_method_parameter(
            "get_integrator",
            "set_integrator",
            "integrator",
            "name of the integrator to use ({0})".format(sorted(self.INTEGRATORS.keys())), 
            default_value = "ias15"
        )


        object.add_method_parameter(
            "get_solver",
            "set_solver",
            "solver",
            "name of the gravity solver to use ({0})".format(sorted(self.SOLVERS.keys())), 
            default_value = "compensated"
        )


        object.add_method_parameter(
            "get_eps2",
            "set_eps2",
            "epsilon_squared",
            "smoothing parameter for gravity calculations", 
            default_value = 0.0 | nbody_system.length * nbody_system.length
        )


        object.add_method_parameter(
            "get_opening_angle2",
            "set_opening_angle2",
            "opening_angle2",
            "opening angle, theta, for building the tree in case of tree solver: between 0 and 1", 
            default_value = 0.5
        )

        object.add_method_parameter(
            "get_boundary",
            "set_boundary",
            "boundary",
            "name of the boundary type to use ({0}) (required for tree solver)".format(sorted(self.BOUNDARIES.keys())), 
            default_value = "none"
        )

        object.add_method_parameter(
            "get_boundary_size",
            "set_boundary_size",
            "boundary_size",
            "size of the boundaries, if the type is not none", 
            default_value = 1.0 | nbody_system.length
        )
Ejemplo n.º 14
0
 def define_parameters(self, handler):
     GravitationalDynamics.define_parameters(self, handler)
     self.stopping_conditions.define_parameters(handler)
     handler.add_alias_parameter(
         "epsilon_squared", 
         "epsilon_squared_star_star", 
         "smoothing parameter for gravity calculations - star-star interactions only (alias for epsilon_squared_star_star)"
     )
     handler.add_method_parameter(
         "get_eps2_fs_fs",
         "set_eps2_fs_fs", 
         "epsilon_squared_star_star", 
         "smoothing parameter for gravity calculations - star-star interactions only", 
         default_value = 0.0 | nbody_system.length * nbody_system.length
     )
     handler.add_method_parameter(
         "get_eps2_fs_bh",
         "set_eps2_fs_bh", 
         "epsilon_squared_star_blackhole", 
         "smoothing parameter for gravity calculations - star-blackhole interactions only", 
         default_value = 0.0 | nbody_system.length * nbody_system.length
     )
     handler.add_method_parameter(
         "get_eps2_bh_bh",
         "set_eps2_bh_bh", 
         "epsilon_squared_blackhole_blackhole", 
         "smoothing parameter for gravity calculations - blackhole-blackhole interactions only", 
         default_value = 0.0 | nbody_system.length * nbody_system.length
     )
     handler.add_method_parameter(
         "get_eta_s",
         "set_eta_s", 
         "initial_timestep_parameter", 
         "initial timestep parameter (eta)", 
         default_value = 1.0e-4
     )
     handler.add_method_parameter(
         "get_eta_fs",
         "set_eta_fs", 
         "timestep_parameter", 
         "timestep parameter (eta) for field stars (alias for timestep_parameter_stars)", 
         default_value = 0.1
     )
     handler.add_method_parameter(
         "get_eta_fs",
         "set_eta_fs", 
         "timestep_parameter_stars", 
         "timestep parameter (eta) for field stars", 
         default_value = 0.1
     )
     handler.add_method_parameter(
         "get_eta_smbh",
         "set_eta_smbh", 
         "timestep_parameter_supermassive_black_holes", 
         "timestep parameter (eta) for supermassive black holes", 
         default_value = 0.4
     )
     handler.add_method_parameter(
         "get_eta_imbh",
         "set_eta_imbh", 
         "timestep_parameter_intermediate_mass_black_holes", 
         "timestep parameter (eta) for intermediate mass black holes", 
         default_value = 0.4
     )
     handler.add_method_parameter(
         "get_drink",
         None, 
         "drink", 
         "Order a drink at MI6", 
         default_value = ""
     )
     handler.add_method_parameter(
         "get_max_relative_energy_error",
         "set_max_relative_energy_error", 
         "max_relative_energy_error", 
         "the maximum relative energy error per full step", 
         default_value = 5e-5 # or nbody_system.time**-1 ??? why /dt_max ???
     )
     handler.add_method_parameter(
         "get_maximum_timestep",
         "set_maximum_timestep", 
         "maximum_timestep", 
         "the maximum timestep a particle may take", 
         default_value = 1.0/1024.0 | nbody_system.time
     )
     handler.add_method_parameter(
         "get_smbh_mass",
         "set_smbh_mass", 
         "smbh_mass", 
         "the mass of the supermassive black hole at the center", 
         default_value = 1.0 | nbody_system.mass
     )
     handler.add_boolean_parameter(
         "get_include_smbh_flag",
         "set_include_smbh_flag",
         "include_smbh",
         "Flag that specifies whether to include a supermassive black hole at the center",
         False
     )
     handler.add_boolean_parameter(
         "get_calculate_postnewtonian",
         "set_calculate_postnewtonian",
         "calculate_postnewtonian",
         "Flag that specifies whether post-newtonian corrections are calculated for the "
             "supermassive black hole at the center (has no effect when include_smbh is False)",
         True
     )
     handler.add_boolean_parameter(
         "get_calculate_postnewtonian_only_first_order",
         "set_calculate_postnewtonian_only_first_order",
         "calculate_postnewtonian_only_first_order",
         "Flag that specifies whether (only!) first order post-newtonian corrections are calculated for the "
             "supermassive black hole at the center (has no effect when include_smbh is False)",
         False
     )
     handler.add_method_parameter(
         "get_lightspeed", 
         "set_lightspeed",
         "lightspeed", 
         "lightspeed used in the code", 
         default_value = 1.0 | nbody_system.speed
     )
Ejemplo n.º 15
0
 def define_parameters(self, object):
     GravitationalDynamics.define_parameters(self, object)
     self.stopping_conditions.define_parameters(object)
     object.add_method_parameter(
         "get_kernel_directory", 
         "set_kernel_directory",
         "kernel_directory", 
         "Name of the Sequoia kernel directory", 
         default_value = self.default_kernel_directory
     )
     object.add_alias_parameter(
         "epsilon_squared", 
         "epsilon_squared_star_star", 
         "smoothing parameter for gravity calculations - star-star interactions only (alias for epsilon_squared_star_star)"
     )
     object.add_method_parameter(
         "get_eps2_fs_fs",
         "set_eps2_fs_fs", 
         "epsilon_squared_star_star", 
         "smoothing parameter for gravity calculations - star-star interactions only", 
         default_value = 1.0e-8 | nbody_system.length * nbody_system.length
     )
     object.add_method_parameter(
         "get_eps2_fs_bh",
         "set_eps2_fs_bh", 
         "epsilon_squared_star_blackhole", 
         "smoothing parameter for gravity calculations - star-blackhole interactions only", 
         default_value = 1.0e-8 | nbody_system.length * nbody_system.length
     )
     object.add_method_parameter(
         "get_eps2_bh_bh",
         "set_eps2_bh_bh", 
         "epsilon_squared_blackhole_blackhole", 
         "smoothing parameter for gravity calculations - blackhole-blackhole interactions only", 
         default_value = 0.0 | nbody_system.length * nbody_system.length
     )
     object.add_method_parameter(
         "get_eta_s",
         "set_eta_s", 
         "initial_timestep_parameter", 
         "initial timestep parameter (eta)", 
         default_value = 0.005
     )
     object.add_alias_parameter(
         "timestep_parameter", 
         "timestep_parameter_stars", 
         "timestep parameter (eta) for field stars (alias for timestep_parameter_stars)"
     )
     object.add_method_parameter(
         "get_eta_fs",
         "set_eta_fs", 
         "timestep_parameter_stars", 
         "timestep parameter (eta) for field stars", 
         default_value = 0.025
     )
     object.add_method_parameter(
         "get_eta_smbh",
         "set_eta_smbh", 
         "timestep_parameter_black_holes", 
         "timestep parameter (eta) for black holes", 
         default_value = 0.025
     )
     object.add_method_parameter(
         "get_time_step",
         "set_time_step",
         "timestep",
         "global timestep for iteration", 
         default_value = 1.0 / 2048.0 | nbody_system.time
     )
     object.add_method_parameter(
         "get_theta_for_tree",
         "set_theta_for_tree",
         "opening_angle", 
         "opening angle, theta, for building the tree: between 0 and 1", 
         default_value = 0.4
     )
     object.add_method_parameter(
         "get_search_factor",
         "set_search_factor",
         "search_factor", 
         "search factor, if positive, determines rsearch = rcut_out + search_factor * velocity_dispersion * timestep", 
         default_value = 3.0
     )
     object.add_method_parameter(
         "get_vel_disp",
         "set_vel_disp",
         "velocity_dispersion", 
         "velocity dispersion assumed when calculating rsearch", 
         default_value = 0.707106781 | nbody_system.speed
     )
     object.add_method_parameter(
         "get_rcut_out_FS_FS",
         "set_rcut_out_FS_FS",
         "rcut_out_star_star", 
         "cut-off radius beyond which direct force calculations smoothly transition into tree approximations", 
         default_value = 2.0e-3 | nbody_system.length
     )
     object.add_method_parameter(
         "get_rcut_out_FS_BH",
         "set_rcut_out_FS_BH",
         "rcut_out_star_blackhole", 
         "cut-off radius beyond which direct force calculations smoothly transition into tree approximations", 
         default_value = 2.0e-2 | nbody_system.length
     )
     object.add_method_parameter(
         "get_rcut_out_BH_BH",
         "set_rcut_out_BH_BH",
         "rcut_out_blackhole_blackhole", 
         "cut-off radius beyond which direct force calculations smoothly transition into tree approximations", 
         default_value = 1.0e5 | nbody_system.length
     )
     object.add_method_parameter(
         "get_rsearch_FS_FS",
         "set_rsearch_FS_FS",
         "rsearch_star_star", 
         "maximum radius for neighbour search, must be larger than rcut_out to "
         "provide a buffer for particles moving into rcut_out during a time step, "
         "only effective if search_factor <= 0", 
         default_value = 0.0 | nbody_system.length
     )
     object.add_method_parameter(
         "get_rsearch_FS_BH",
         "set_rsearch_FS_BH",
         "rsearch_star_blackhole", 
         "maximum radius for neighbour search, must be larger than rcut_out to "
         "provide a buffer for particles moving into rcut_out during a time step, "
         "only effective if search_factor <= 0", 
         default_value = 0.0 | nbody_system.length
     )
     object.add_method_parameter(
         "get_rsearch_BH_BH",
         "set_rsearch_BH_BH",
         "rsearch_blackhole_blackhole", 
         "maximum radius for neighbour search, must be larger than rcut_out to "
         "provide a buffer for particles moving into rcut_out during a time step, "
         "only effective if search_factor <= 0", 
         default_value = 0.0 | nbody_system.length
     )
     object.add_boolean_parameter(
         "get_calculate_quadrupole_moments",
         "set_calculate_quadrupole_moments",
         "calculate_quadrupole_moments",
         "Flag that specifies whether quadrupole moments are calculated for the tree",
         False
     )
Ejemplo n.º 16
0
 def define_parameters(self, handler):
     GravitationalDynamics.define_parameters(self, handler)
     self.stopping_conditions.define_parameters(handler)
     handler.add_method_parameter(
         "get_kernel_directory",
         "set_kernel_directory",
         "kernel_directory",
         "Name of the Sequoia kernel directory",
         default_value=self.default_kernel_directory)
     handler.add_alias_parameter(
         "epsilon_squared", "epsilon_squared_star_star",
         "smoothing parameter for gravity calculations - star-star interactions only (alias for epsilon_squared_star_star)"
     )
     handler.add_method_parameter(
         "get_eps2_fs_fs",
         "set_eps2_fs_fs",
         "epsilon_squared_star_star",
         "smoothing parameter for gravity calculations - star-star interactions only",
         default_value=1.0e-8 | nbody_system.length * nbody_system.length)
     handler.add_method_parameter(
         "get_eps2_fs_bh",
         "set_eps2_fs_bh",
         "epsilon_squared_star_blackhole",
         "smoothing parameter for gravity calculations - star-blackhole interactions only",
         default_value=1.0e-8 | nbody_system.length * nbody_system.length)
     handler.add_method_parameter(
         "get_eps2_bh_bh",
         "set_eps2_bh_bh",
         "epsilon_squared_blackhole_blackhole",
         "smoothing parameter for gravity calculations - blackhole-blackhole interactions only",
         default_value=0.0 | nbody_system.length * nbody_system.length)
     handler.add_method_parameter("get_eta_s",
                                  "set_eta_s",
                                  "initial_timestep_parameter",
                                  "initial timestep parameter (eta)",
                                  default_value=0.005)
     handler.add_alias_parameter(
         "timestep_parameter", "timestep_parameter_stars",
         "timestep parameter (eta) for field stars (alias for timestep_parameter_stars)"
     )
     handler.add_method_parameter(
         "get_eta_fs",
         "set_eta_fs",
         "timestep_parameter_stars",
         "timestep parameter (eta) for field stars",
         default_value=0.025)
     handler.add_method_parameter(
         "get_eta_smbh",
         "set_eta_smbh",
         "timestep_parameter_black_holes",
         "timestep parameter (eta) for black holes",
         default_value=0.025)
     handler.add_method_parameter("get_time_step",
                                  "set_time_step",
                                  "timestep",
                                  "global timestep for iteration",
                                  default_value=1.0 / 2048.0
                                  | nbody_system.time)
     handler.add_method_parameter(
         "get_theta_for_tree",
         "set_theta_for_tree",
         "opening_angle",
         "opening angle, theta, for building the tree: between 0 and 1",
         default_value=0.4)
     handler.add_method_parameter(
         "get_search_factor",
         "set_search_factor",
         "search_factor",
         "search factor, if positive, determines rsearch = rcut_out + search_factor * velocity_dispersion * timestep",
         default_value=3.0)
     handler.add_method_parameter(
         "get_vel_disp",
         "set_vel_disp",
         "velocity_dispersion",
         "velocity dispersion assumed when calculating rsearch",
         default_value=0.707106781 | nbody_system.speed)
     handler.add_method_parameter(
         "get_rcut_out_FS_FS",
         "set_rcut_out_FS_FS",
         "rcut_out_star_star",
         "cut-off radius beyond which direct force calculations smoothly transition into tree approximations",
         default_value=2.0e-3 | nbody_system.length)
     handler.add_method_parameter(
         "get_rcut_out_FS_BH",
         "set_rcut_out_FS_BH",
         "rcut_out_star_blackhole",
         "cut-off radius beyond which direct force calculations smoothly transition into tree approximations",
         default_value=2.0e-2 | nbody_system.length)
     handler.add_method_parameter(
         "get_rcut_out_BH_BH",
         "set_rcut_out_BH_BH",
         "rcut_out_blackhole_blackhole",
         "cut-off radius beyond which direct force calculations smoothly transition into tree approximations",
         default_value=1.0e5 | nbody_system.length)
     handler.add_method_parameter(
         "get_rsearch_FS_FS",
         "set_rsearch_FS_FS",
         "rsearch_star_star",
         "maximum radius for neighbour search, must be larger than rcut_out to "
         "provide a buffer for particles moving into rcut_out during a time step, "
         "only effective if search_factor <= 0",
         default_value=0.0 | nbody_system.length)
     handler.add_method_parameter(
         "get_rsearch_FS_BH",
         "set_rsearch_FS_BH",
         "rsearch_star_blackhole",
         "maximum radius for neighbour search, must be larger than rcut_out to "
         "provide a buffer for particles moving into rcut_out during a time step, "
         "only effective if search_factor <= 0",
         default_value=0.0 | nbody_system.length)
     handler.add_method_parameter(
         "get_rsearch_BH_BH",
         "set_rsearch_BH_BH",
         "rsearch_blackhole_blackhole",
         "maximum radius for neighbour search, must be larger than rcut_out to "
         "provide a buffer for particles moving into rcut_out during a time step, "
         "only effective if search_factor <= 0",
         default_value=0.0 | nbody_system.length)
     handler.add_boolean_parameter(
         "get_calculate_quadrupole_moments",
         "set_calculate_quadrupole_moments", "calculate_quadrupole_moments",
         "Flag that specifies whether quadrupole moments are calculated for the tree",
         False)
Ejemplo n.º 17
0
 def define_parameters(self, object):
     GravitationalDynamics.define_parameters(self, object)
     self.stopping_conditions.define_parameters(object)
     object.add_alias_parameter(
         "epsilon_squared", 
         "epsilon_squared_star_star", 
         "smoothing parameter for gravity calculations - star-star interactions only (alias for epsilon_squared_star_star)"
     )
     object.add_method_parameter(
         "get_eps2_fs_fs",
         "set_eps2_fs_fs", 
         "epsilon_squared_star_star", 
         "smoothing parameter for gravity calculations - star-star interactions only", 
         default_value = 0.0 | nbody_system.length * nbody_system.length
     )
     object.add_method_parameter(
         "get_eps2_fs_bh",
         "set_eps2_fs_bh", 
         "epsilon_squared_star_blackhole", 
         "smoothing parameter for gravity calculations - star-blackhole interactions only", 
         default_value = 0.0 | nbody_system.length * nbody_system.length
     )
     object.add_method_parameter(
         "get_eps2_bh_bh",
         "set_eps2_bh_bh", 
         "epsilon_squared_blackhole_blackhole", 
         "smoothing parameter for gravity calculations - blackhole-blackhole interactions only", 
         default_value = 0.0 | nbody_system.length * nbody_system.length
     )
     object.add_method_parameter(
         "get_eta_s",
         "set_eta_s", 
         "initial_timestep_parameter", 
         "initial timestep parameter (eta)", 
         default_value = 1.0e-4
     )
     object.add_method_parameter(
         "get_eta_fs",
         "set_eta_fs", 
         "timestep_parameter", 
         "timestep parameter (eta) for field stars (alias for timestep_parameter_stars)", 
         default_value = 0.1
     )
     object.add_method_parameter(
         "get_eta_fs",
         "set_eta_fs", 
         "timestep_parameter_stars", 
         "timestep parameter (eta) for field stars", 
         default_value = 0.1
     )
     object.add_method_parameter(
         "get_eta_smbh",
         "set_eta_smbh", 
         "timestep_parameter_supermassive_black_holes", 
         "timestep parameter (eta) for supermassive black holes", 
         default_value = 0.4
     )
     object.add_method_parameter(
         "get_eta_imbh",
         "set_eta_imbh", 
         "timestep_parameter_intermediate_mass_black_holes", 
         "timestep parameter (eta) for intermediate mass black holes", 
         default_value = 0.4
     )
     object.add_method_parameter(
         "get_drink",
         None, 
         "drink", 
         "Order a drink at MI6", 
         default_value = ""
     )
     object.add_method_parameter(
         "get_max_relative_energy_error",
         "set_max_relative_energy_error", 
         "max_relative_energy_error", 
         "the maximum relative energy error per full step", 
         default_value = 5e-5 # or nbody_system.time**-1 ??? why /dt_max ???
     )
     object.add_method_parameter(
         "get_maximum_timestep",
         "set_maximum_timestep", 
         "maximum_timestep", 
         "the maximum timestep a particle may take", 
         default_value = 1.0/1024.0 | nbody_system.time
     )
     object.add_method_parameter(
         "get_smbh_mass",
         "set_smbh_mass", 
         "smbh_mass", 
         "the mass of the supermassive black hole at the center", 
         default_value = 1.0 | nbody_system.mass
     )
     object.add_boolean_parameter(
         "get_include_smbh_flag",
         "set_include_smbh_flag",
         "include_smbh",
         "Flag that specifies whether to include a supermassive black hole at the center",
         False
     )
     object.add_boolean_parameter(
         "get_calculate_postnewtonian",
         "set_calculate_postnewtonian",
         "calculate_postnewtonian",
         "Flag that specifies whether post-newtonian corrections are calculated for the "
             "supermassive black hole at the center (has no effect when include_smbh is False)",
         True
     )
     object.add_boolean_parameter(
         "get_calculate_postnewtonian_only_first_order",
         "set_calculate_postnewtonian_only_first_order",
         "calculate_postnewtonian_only_first_order",
         "Flag that specifies whether (only!) first order post-newtonian corrections are calculated for the "
             "supermassive black hole at the center (has no effect when include_smbh is False)",
         False
     )
     object.add_method_parameter(
         "get_lightspeed", 
         "set_lightspeed",
         "lightspeed", 
         "lightspeed used in the code", 
         default_value = 1.0 | nbody_system.speed
     )