本文整理汇总了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)
示例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,)
)
示例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)
示例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,))
示例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,),
)
示例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,))
示例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))
示例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)
示例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))