Beispiel #1
0
    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)
Beispiel #2
0
 def __init__(self, convert_nbody=None, **options):
     GravitationalDynamics.__init__(
         self, 
         MikkolaInterface(**options),
         convert_nbody,
         **options
     )
Beispiel #3
0
    def __init__(self, convert_nbody=None, **keyword_arguments):
        legacy_interface = ph4Interface(**keyword_arguments)

        self.stopping_conditions = StoppingConditions(self)

        GravitationalDynamics.__init__(self, legacy_interface, convert_nbody,
                                       **keyword_arguments)
Beispiel #4
0
    def __init__(self, convert_nbody = None, **keyword_arguments):
        legacy_interface = HiGPUsInterface(**keyword_arguments)

        GravitationalDynamics.__init__(self,  
                                       legacy_interface,
                                       convert_nbody,
                                       **keyword_arguments)
Beispiel #5
0
    def __init__(self, convert_nbody=None, **options):
        self.stopping_conditions = StoppingConditions(self)

        legacy_interface = self.__interface__(**options)

        GravitationalDynamics.__init__(self, legacy_interface, convert_nbody,
                                       **options)
Beispiel #6
0
    def __init__(self, convert_nbody=None, **options):
        if not options.has_key("processor"):
            options["processor"] = None

        nbody_interface = YaraviInterface(**options)

        GravitationalDynamics.__init__(self, nbody_interface, convert_nbody,
                                       **options)
Beispiel #7
0
    def __init__(self, convert_nbody=None, **options):
        self.stopping_conditions = StoppingConditions(self)

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

        GravitationalDynamics.__init__(self, legacy_interface, convert_nbody,
                                       **options)
Beispiel #8
0
    def __init__(self, convert_nbody=None, **keyword_arguments):
        self.stopping_conditions = StoppingConditions(self)

        GravitationalDynamics.__init__(
            self,
            petarInterface(**keyword_arguments),
            convert_nbody,
            **keyword_arguments)
Beispiel #9
0
    def __init__(self, unit_converter = None, **options):
        self.stopping_conditions = StoppingConditions(self)

        GravitationalDynamics.__init__(
            self,
            StubInterface(**options),
            unit_converter,
            **options
        )
Beispiel #10
0
    def __init__(self, convert_nbody=None, **options):
        nbody_interface = TupanInterface(**options)

        GravitationalDynamics.__init__(
            self,
            nbody_interface,
            convert_nbody,
            **options
        )
Beispiel #11
0
    def __init__(self, convert_nbody = None, **keyword_arguments):
        legacy_interface = ph4Interface(**keyword_arguments)

        self.stopping_conditions = StoppingConditions(self)
        
        GravitationalDynamics.__init__(self,
                                       legacy_interface,
                                       convert_nbody,
                                       **keyword_arguments)
Beispiel #12
0
    def __init__(self, unit_converter = None, **options):
        self.stopping_conditions = StoppingConditions(self)

        GravitationalDynamics.__init__(
            self,
            StubInterface(**options),
            unit_converter,
            **options
        )
Beispiel #13
0
    def __init__(self, convert_nbody = None, **options):
        legacy_interface = HuaynoInterface(**options)
#        self.legacy_doc = legacy_interface.__doc__

        GravitationalDynamics.__init__(
            self,
            legacy_interface,
            convert_nbody,
            **options
        )
Beispiel #14
0
    def __init__(self, convert_nbody = None, **options):

        legacy_interface = self.__interface__(**options)

        GravitationalDynamics.__init__(
                self,
                legacy_interface,
                convert_nbody,
                **options
                )
Beispiel #15
0
    def __init__(self, convert_nbody = None, **options):
        legacy_interface = OctgravInterface(**options)
        self.stopping_conditions = StoppingConditions(self)

        GravitationalDynamics.__init__(
            self,
            legacy_interface,
            convert_nbody,
            **options
        )
Beispiel #16
0
 def __init__(self, unit_converter = None, **options):
     self.stopping_conditions = StoppingConditions(self)
     
     
     legacy_interface = BonsaiInterface(**options)
     GravitationalDynamics.__init__(
         self,
         legacy_interface,
         unit_converter,
         **options
     )
Beispiel #17
0
 def __init__(self, unit_converter = None, **options):
     self.stopping_conditions = StoppingConditions(self)
     
     
     legacy_interface = BonsaiInterface2(**options)
     GravitationalDynamics.__init__(
         self,
         legacy_interface,
         unit_converter,
         **options
     )
Beispiel #18
0
    def __init__(self, convert_nbody=None, **options):
        self.stopping_conditions = StoppingConditions(self)

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

        GravitationalDynamics.__init__(self, legacy_interface, convert_nbody,
                                       **options)
        self.convert_nbody = convert_nbody
        if HAS_MPMATH:
            self.adjust_prec()
Beispiel #19
0
    def __init__(self, convert_nbody=None, **options):
        #        print("gpuhermite8")
        self.stopping_conditions = StoppingConditions(self)

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

        GravitationalDynamics.__init__(self, legacy_interface, convert_nbody,
                                       **options)
        self.convert_nbody = convert_nbody
        self.not_adjusted = True
        if HAS_MPMATH:
            self.adjust_prec()
Beispiel #20
0
    def __init__(self, convert_nbody = None, mode = PhiGRAPEInterface.MODE_G6LIB, use_gl = False, **options):
        nbody_interface = None
        if use_gl:
            nbody_interface = PhiGRAPEInterfaceGL(mode, **options)
        else:
            nbody_interface = PhiGRAPEInterface(mode, **options)

        self.stopping_conditions = StoppingConditions(self)

        GravitationalDynamics.__init__(
            self,
            nbody_interface,
            convert_nbody,
            **options
        )
Beispiel #21
0
    def __init__(self, convert_nbody = None, mode = PhiGRAPEInterface.MODE_G6LIB, use_gl = False, **options):
        nbody_interface = None
        if use_gl:
            nbody_interface = PhiGRAPEInterfaceGL(mode, **options)
        else:
            nbody_interface = PhiGRAPEInterface(mode, **options)

        self.stopping_conditions = StoppingConditions(self)

        GravitationalDynamics.__init__(
            self,
            nbody_interface,
            convert_nbody,
            **options
        )
Beispiel #22
0
    def __init__(self, convert_nbody=None, **options):

        self.stopping_conditions = StoppingConditions(self)
        GravitationalDynamics.__init__(self, MikkolaInterface(**options),
                                       convert_nbody, **options)
 def __init__(self, unit_converter=None, number_of_workers=None, **options):
     GravitationalDynamics.__init__(self, AgamaInterface(**options),
                                    unit_converter, **options)
     self.unit_converter = unit_converter
     if number_of_workers is not None:
         self.overridden().set_num_threads(number_of_workers)
     dimensional_params = {
         'mass': nbody_system.mass,
         'rscale': nbody_system.length,
         'scaleradius': nbody_system.length,
         'scaleradius2': nbody_system.length,
         'scaleheight': nbody_system.length,
         'innercutoffradius': nbody_system.length,
         'outercutoffradius': nbody_system.length,
         'rmin': nbody_system.length,
         'rmax': nbody_system.length,
         'zmin': nbody_system.length,
         'zmax': nbody_system.length,
         'densitynorm': nbody_system.mass / nbody_system.length**3,
         'rho0': nbody_system.mass / nbody_system.length**3,
         'surfacedensity': nbody_system.mass / nbody_system.length**2,
         'sigma0': nbody_system.mass / nbody_system.length**2,
         'v0': nbody_system.speed,
         'omega': nbody_system.time**-1,
         'mbh': nbody_system.mass,
         'binary_sma': nbody_system.length,
         'timetotal': nbody_system.time,
         'timeinit': nbody_system.time,
         'episodelength': nbody_system.time,
         'outputinterval': nbody_system.time,
         'captureradius': nbody_system.length,
         'captureradius1': nbody_system.length,
         'captureradius2': nbody_system.length,
         'speedoflight': nbody_system.speed,
     }
     params = []
     # check if speed of light was provided by user, if not then put the universally accepted value
     speed_of_light_provided = False
     black_hole_provided = False
     for k, v in options.items():
         param_name = str(k)
         if param_name.lower() in dimensional_params.keys():
             if unit_converter is not None:
                 v = unit_converter.as_converter_from_si_to_nbody(
                 ).from_source_to_target(v)
             params.append(
                 param_name + '=' +
                 str(v.value_in(dimensional_params[param_name.lower()])))
             if param_name.lower() == 'speedoflight':
                 speed_of_light_provided = True
             if param_name.lower() == 'mbh': black_hole_provided = True
         elif param_name == 'particles':
             self.particles.add_particles(v)
             #print('added %i particles'%len(v))
         else:
             params.append(param_name + '=' + str(v))
     if black_hole_provided and not speed_of_light_provided and unit_converter is not None:
         params.append('speedOfLight=' + str(
             unit_converter.to_nbody(constants.c).value_in(
                 nbody_system.speed)))
     #print('setting params')
     self.overridden().set_params(params)
     handler = self.get_handler('PARTICLES')
     handler.add_setter('particles',
                        'set_gravitating_mass',
                        names=('gravitating_mass', ))
     handler.add_getter('particles',
                        'get_gravitating_mass',
                        names=('gravitating_mass', ))
Beispiel #24
0
 def __init__(self, convert_nbody=None, **options):
     GravitationalDynamics.__init__(self, MikkolaInterface(**options),
                                    convert_nbody, **options)
Beispiel #25
0
 def __init__(self, convert_nbody=None, **kargs):
     GravitationalDynamics.__init__(self, H5nb6xxInterface(**kargs),
                                    convert_nbody, **kargs)
Beispiel #26
0
 def __init__(self, convert_nbody = None, **kargs):
     GravitationalDynamics.__init__(self,  Nbody6xxInterface(**kargs), convert_nbody, **kargs)