当前位置: 首页>>代码示例>>Python>>正文


Python gd.GravitationalDynamics类代码示例

本文整理汇总了Python中amuse.community.interface.gd.GravitationalDynamics的典型用法代码示例。如果您正苦于以下问题:Python GravitationalDynamics类的具体用法?Python GravitationalDynamics怎么用?Python GravitationalDynamics使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了GravitationalDynamics类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: define_particle_sets

 def define_particle_sets(self, object):
     GravitationalDynamics.define_particle_sets(self, object)
     
     self.stopping_conditions.define_particle_set(object)
     
     object.add_getter('particles', 'get_subset')
     object.add_setter('particles', 'set_subset')
开发者ID:Ingwar,项目名称:amuse,代码行数:7,代码来源:interface.py

示例2: define_methods

 def define_methods(self, object):
     GravitationalDynamics.define_methods(self, object)
     self.stopping_conditions.define_methods(object)
     
     object.add_method("get_eps2", (), (nbody_system.length**2, object.ERROR_CODE))
     object.add_method("set_eps2", (nbody_system.length**2,), (object.ERROR_CODE,))
     object.add_method("get_eps2_fs_fs", (), (nbody_system.length**2, object.ERROR_CODE))
     object.add_method("set_eps2_fs_fs", (nbody_system.length**2,), (object.ERROR_CODE,))
     object.add_method("get_eps2_fs_bh", (), (nbody_system.length**2, object.ERROR_CODE))
     object.add_method("set_eps2_fs_bh", (nbody_system.length**2,), (object.ERROR_CODE,))
     object.add_method("get_eps2_bh_bh", (), (nbody_system.length**2, object.ERROR_CODE))
     object.add_method("set_eps2_bh_bh", (nbody_system.length**2,), (object.ERROR_CODE,))
     
     object.add_method("get_eta_s", (), (object.NO_UNIT, object.ERROR_CODE))
     object.add_method("set_eta_s", (object.NO_UNIT,), (object.ERROR_CODE,))
     object.add_method("get_eta_fs", (), (object.NO_UNIT, object.ERROR_CODE))
     object.add_method("set_eta_fs", (object.NO_UNIT,), (object.ERROR_CODE,))
     object.add_method("get_eta_smbh", (), (object.NO_UNIT, object.ERROR_CODE))
     object.add_method("set_eta_smbh", (object.NO_UNIT,), (object.ERROR_CODE,))
     object.add_method("get_eta_imbh", (), (object.NO_UNIT, object.ERROR_CODE))
     object.add_method("set_eta_imbh", (object.NO_UNIT,), (object.ERROR_CODE,))
     
     object.add_method("get_max_relative_energy_error", (), (object.NO_UNIT, object.ERROR_CODE))
     object.add_method("set_max_relative_energy_error", (object.NO_UNIT,), (object.ERROR_CODE,))
     object.add_method("get_maximum_timestep", (), (nbody_system.time, object.ERROR_CODE))
     object.add_method("set_maximum_timestep", (nbody_system.time,), (object.ERROR_CODE,))
     
     object.add_method("get_smbh_mass", (), (nbody_system.mass, object.ERROR_CODE))
     object.add_method("set_smbh_mass", (nbody_system.mass,), (object.ERROR_CODE,))
     
     object.add_method("get_lightspeed", (), (nbody_system.speed, object.ERROR_CODE))
     object.add_method("set_lightspeed", (nbody_system.speed,), (object.ERROR_CODE,))
开发者ID:Ingwar,项目名称:amuse,代码行数:32,代码来源:interface.py

示例3: __init__

    def __init__(self, convert_nbody = None, **keyword_arguments):
        legacy_interface = HiGPUsInterface(**keyword_arguments)

        GravitationalDynamics.__init__(self,  
                                       legacy_interface,
                                       convert_nbody,
                                       **keyword_arguments)
开发者ID:Ingwar,项目名称:amuse,代码行数:7,代码来源:interface.py

示例4: define_state

 def define_state(self, object):
     GravitationalDynamics.define_state(self, object)
     #GravityFieldCode.define_state(self, object)
     self.stopping_conditions.define_state(object)
     
     object.add_method('EDIT', 'new_subset')
     object.add_method('RUN', 'new_subset')
开发者ID:Ingwar,项目名称:amuse,代码行数:7,代码来源:interface.py

示例5: define_parameters

    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 = "./"
        )
开发者ID:stevemcmillan,项目名称:amuse,代码行数:35,代码来源:interface.py

示例6: __init__

    def __init__(self, convert_nbody=None, **options):
        self.stopping_conditions = StoppingConditions(self)

        legacy_interface = SakuraInterface(**options)
        self.legacy_doc = legacy_interface.__doc__

        GravitationalDynamics.__init__(self, legacy_interface, convert_nbody, **options)
开发者ID:vdhelm,项目名称:amuse,代码行数:7,代码来源:interface.py

示例7: define_parameters

    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="./",
        )
开发者ID:vdhelm,项目名称:amuse,代码行数:29,代码来源:interface.py

示例8: define_state

    def define_state(self, object):
        GravitationalDynamics.define_state(self, object)
        
        object.add_method('RUN', 'get_kinetic_energy')
        object.add_method('RUN', 'get_potential_energy')

        self.stopping_conditions.define_state(object)
开发者ID:jorishanse,项目名称:amuse,代码行数:7,代码来源:interface.py

示例9: define_methods

    def define_methods(self, object):
        GravitationalDynamics.define_methods(self, object)

        object.add_method(
            "get_time",
            (),
            (nbody_system.time, object.ERROR_CODE,)
        )
        
        object.add_method(
            "set_time",
            (nbody_system.time, ),
            (object.ERROR_CODE,)
        )

        object.add_method(
            "get_time_step",
            (),
            (nbody_system.time, object.ERROR_CODE,)
        )

        object.add_method(
            "set_time_step",
            (nbody_system.time, ),
            (object.ERROR_CODE,)
        )
开发者ID:rieder,项目名称:amuse,代码行数:26,代码来源:interface.py

示例10: define_state

 def define_state(self, object):
     GravitationalDynamics.define_state(self, object)
     object.add_method('EDIT', 'new_central_particle')
     object.add_method('EDIT', 'new_orbiter')
     object.add_method('UPDATE', 'new_orbiter')
     object.add_transition('RUN', 'UPDATE', 'new_central_particle', False)
     object.add_transition('RUN', 'UPDATE', 'new_orbiter', False)
     object.add_method('RUN', 'recommit_particles')
开发者ID:anamabo,项目名称:amuse,代码行数:8,代码来源:interface.py

示例11: __init__

    def __init__(self, unit_converter = None, **options):
        self.stopping_conditions = StoppingConditions(self)

        GravitationalDynamics.__init__(
            self,
            StubInterface(**options),
            unit_converter,
            **options
        )
开发者ID:Ingwar,项目名称:amuse,代码行数:9,代码来源:test_sink.py

示例12: __init__

    def __init__(self, convert_nbody = None, **options):

        legacy_interface = self.__interface__(**options)

        GravitationalDynamics.__init__(
                self,
                legacy_interface,
                convert_nbody,
                **options
                )
开发者ID:rieder,项目名称:amuse,代码行数:10,代码来源:interface.py

示例13: define_methods

    def define_methods(self, object):
        GravitationalDynamics.define_methods(self, object)
        
        object.add_method(
            "get_eps2",
            (),
            (nbody_system.length * nbody_system.length, object.ERROR_CODE,)
        )
        
        object.add_method(
            "set_eps2",
            (nbody_system.length * nbody_system.length, ),
            (object.ERROR_CODE,)
        )
        
        object.add_method(
            "get_timestep_parameter",
            (),
            (object.NO_UNIT, object.ERROR_CODE,)
        )
        
        object.add_method(
            "set_timestep_parameter",
            (object.NO_UNIT, ),
            (object.ERROR_CODE,)
        )

        object.add_method(
            "get_timestep",
            (),
            (nbody_system.time, object.ERROR_CODE,)
        )
        
        object.add_method(
            "set_timestep",
            (nbody_system.time, ),
            (object.ERROR_CODE,)
        )

        
        object.add_method(
            "get_inttype_parameter",
            (),
            (object.NO_UNIT, object.ERROR_CODE,)
        )
        
        object.add_method(
            "set_inttype_parameter",
            (object.NO_UNIT, ),
            (object.ERROR_CODE,)
        )
        self.stopping_conditions.define_methods(object)
开发者ID:jorishanse,项目名称:amuse,代码行数:52,代码来源:interface.py

示例14: define_methods

 def define_methods(self, object):
     GravitationalDynamics.define_methods(self, object)
     object.add_method("get_eps2", (), (nbody_system.length * nbody_system.length, object.ERROR_CODE))
     object.add_method("set_eps2", (nbody_system.length * nbody_system.length,), (object.ERROR_CODE,))
     object.add_method(
         "get_gravity_at_point",
         (nbody_system.length, nbody_system.length, nbody_system.length, nbody_system.length),
         (nbody_system.acceleration, nbody_system.acceleration, nbody_system.acceleration),
     )
     object.add_method(
         "get_potential_at_point",
         (nbody_system.length, nbody_system.length, nbody_system.length, nbody_system.length),
         (nbody_system.potential,),
     )
开发者ID:mherkazandjian,项目名称:amuse,代码行数:14,代码来源:interface.py

示例15: define_methods

    def define_methods(self, object):
        GravitationalDynamics.define_methods(self, object)
        self.stopping_conditions.define_methods(object)

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

        object.add_method("get_t_begin", (), (nbody_system.time, object.ERROR_CODE))
        object.add_method("set_t_begin", (nbody_system.time,), (object.ERROR_CODE,))

        object.add_method("get_dt", (), (nbody_system.time, object.ERROR_CODE))
        object.add_method("set_dt", (nbody_system.time,), (object.ERROR_CODE,))

        object.add_method("get_t", (), (nbody_system.time, object.ERROR_CODE))
        object.add_method("set_t", (nbody_system.time,), (object.ERROR_CODE,))
开发者ID:vdhelm,项目名称:amuse,代码行数:14,代码来源:interface.py


注:本文中的amuse.community.interface.gd.GravitationalDynamics类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。