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


Python GravitationalDynamics.define_methods方法代码示例

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


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

示例1: define_methods

# 需要导入模块: from amuse.community.interface.gd import GravitationalDynamics [as 别名]
# 或者: from amuse.community.interface.gd.GravitationalDynamics import define_methods [as 别名]
 def define_methods(self, object):
     GravitationalDynamics.define_methods(self, object)
     object.add_method(
         "set_time",
         (nbody_system.time,),
         (object.ERROR_CODE,)
     )
     object.add_method(
         "set_time_step",
         (nbody_system.time,),
         (object.ERROR_CODE,)
     )
     object.add_method(
         "get_eps2",
         (),
         (nbody_system.length**2, object.ERROR_CODE,)
     )
     object.add_method(
         "get_time",
         (),
         (nbody_system.time, object.ERROR_CODE,)
     )
     object.add_method(
         "set_eps2",
         (nbody_system.length**2,),
         (object.ERROR_CODE,)
     )
     self.stopping_conditions.define_methods(object)
开发者ID:Ingwar,项目名称:amuse,代码行数:30,代码来源:interface.py

示例2: define_methods

# 需要导入模块: from amuse.community.interface.gd import GravitationalDynamics [as 别名]
# 或者: from amuse.community.interface.gd.GravitationalDynamics import define_methods [as 别名]
    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,代码行数:28,代码来源:interface.py

示例3: define_methods

# 需要导入模块: from amuse.community.interface.gd import GravitationalDynamics [as 别名]
# 或者: from amuse.community.interface.gd.GravitationalDynamics import define_methods [as 别名]
    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,代码行数:54,代码来源:interface.py

示例4: define_methods

# 需要导入模块: from amuse.community.interface.gd import GravitationalDynamics [as 别名]
# 或者: from amuse.community.interface.gd.GravitationalDynamics import define_methods [as 别名]
    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,代码行数:16,代码来源:interface.py

示例5: define_methods

# 需要导入模块: from amuse.community.interface.gd import GravitationalDynamics [as 别名]
# 或者: from amuse.community.interface.gd.GravitationalDynamics import define_methods [as 别名]
 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,代码行数:16,代码来源:interface.py

示例6: define_methods

# 需要导入模块: from amuse.community.interface.gd import GravitationalDynamics [as 别名]
# 或者: from amuse.community.interface.gd.GravitationalDynamics import define_methods [as 别名]
    def define_methods(self, object):
        GravitationalDynamics.define_methods(self, object)
        self.stopping_conditions.define_methods(object)
        
        object.add_method("get_bs_tolerance", (), (object.NO_UNIT, object.ERROR_CODE,))
        object.add_method("set_bs_tolerance", (object.NO_UNIT, ), (object.ERROR_CODE,))
 
        object.add_method("get_word_length", (), (object.NO_UNIT, object.ERROR_CODE,))
        object.add_method("set_word_length", (object.NO_UNIT, ), (object.ERROR_CODE,))

        object.add_method("get_eta", (), (object.NO_UNIT, object.ERROR_CODE,))
        object.add_method("set_eta", (object.NO_UNIT, ), (object.ERROR_CODE,))
        
        object.add_method("get_brutus_output_directory", (), (object.NO_UNIT, object.ERROR_CODE,))
        object.add_method("set_brutus_output_directory", (object.NO_UNIT, ), (object.ERROR_CODE,))
开发者ID:stevemcmillan,项目名称:amuse,代码行数:17,代码来源:interface.py

示例7: define_methods

# 需要导入模块: from amuse.community.interface.gd import GravitationalDynamics [as 别名]
# 或者: from amuse.community.interface.gd.GravitationalDynamics import define_methods [as 别名]
 def define_methods(self, object):
     GravitationalDynamics.define_methods(self, object)
     # Define some shortcuts for better readability.
     M = nbody_system.mass
     L = nbody_system.length
     V = nbody_system.speed
     T = nbody_system.time
     object.add_method('new_particle', (M,L,L,L,V,V,V,L), (object.INDEX, object.ERROR_CODE))
     object.add_method('set_state', (object.INDEX, M,L,L,L,L,V,V,V), (object.ERROR_CODE))
     object.add_method('get_state', (object.INDEX), (M,L,L,L,L,V,V,V, object.ERROR_CODE))
     object.add_method('set_time_begin', (T), (object.ERROR_CODE))
     object.add_method('get_time_begin', (), (T, object.ERROR_CODE))
     object.add_method('get_number_of_particles', (), (units.none, object.ERROR_CODE))
     object.add_method('get_time_step', (), (T, object.ERROR_CODE))
     object.add_method('set_time_step', (T), (object.ERROR_CODE))
     object.add_method('update_force_potential_arrays', (T), (object.ERROR_CODE))
开发者ID:sahmes,项目名称:etics,代码行数:18,代码来源:interface.py

示例8: define_methods

# 需要导入模块: from amuse.community.interface.gd import GravitationalDynamics [as 别名]
# 或者: from amuse.community.interface.gd.GravitationalDynamics import define_methods [as 别名]
 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_dt_param",
         (),
         (object.NO_UNIT, object.ERROR_CODE,)
     )
     
     object.add_method(
         "set_dt_param",
         (object.NO_UNIT, ),
         (object.ERROR_CODE,)
     )
     
     object.add_method(
         "get_dt_dia",
         (),
         (nbody_system.time, object.ERROR_CODE,)
     )
     
     object.add_method(
         "set_dt_dia",
         (nbody_system.time, ),
         (object.ERROR_CODE,)
     )
     
     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_pair_detect_factor",
         (),
         (object.NO_UNIT, object.ERROR_CODE,)
     )
     
     object.add_method(
         "set_pair_detect_factor",
         (object.NO_UNIT, ),
         (object.ERROR_CODE,)
     )
     
     self.stopping_conditions.define_methods(object)
开发者ID:Ingwar,项目名称:amuse,代码行数:66,代码来源:interface.py

示例9: define_methods

# 需要导入模块: from amuse.community.interface.gd import GravitationalDynamics [as 别名]
# 或者: from amuse.community.interface.gd.GravitationalDynamics import define_methods [as 别名]
 def define_methods(self, object):
     GravitationalDynamics.define_methods(self, object)
     object.add_method("new_gas_particle",
         (nbody_system.mass, nbody_system.length, nbody_system.length, nbody_system.length,
             nbody_system.speed, nbody_system.speed, nbody_system.speed),
         (object.INDEX, object.ERROR_CODE))
开发者ID:Ingwar,项目名称:amuse,代码行数:8,代码来源:test_sink.py


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