Example #1
0
    def __init__(self,
                 original_particles,
                 sink_radius=None,
                 mass=None,
                 position=None,
                 velocity=None,
                 angular_momentum=None,
                 looping_over="sinks"):
        ParticlesOverlay.__init__(self, original_particles)

        self._private.looping_over = looping_over

        self.sink_radius = sink_radius or original_particles.radius

        if not hasattr(original_particles, "mass"):
            self.mass = mass or (([0.] * len(self)) | units.kg)

        if not hasattr(original_particles, "x"):
            self.position = position or (([[0., 0., 0.]] * len(self))
                                         | units.m)

        if not hasattr(original_particles, "vx"):
            self.velocity = velocity or (([[0., 0., 0.]] * len(self))
                                         | units.m / units.s)

        if not hasattr(original_particles, "lx"):
            self.angular_momentum = angular_momentum or (
                ([[0., 0., 0.]] * len(self)) | units.g * units.m**2 / units.s)
Example #2
0
File: sink.py Project: Ingwar/amuse
    def __init__(self, original_particles, sink_radius=None, mass=None, position=None,
                   velocity=None, angular_momentum=None, looping_over="sinks"):
        ParticlesOverlay.__init__(self, original_particles)

        self._private.looping_over=looping_over

        self.sink_radius = sink_radius or original_particles.radius

        if not hasattr(original_particles, "mass"):
            self.mass = mass or (([0.]*len(self)) | units.kg)

        if not hasattr(original_particles, "x"):
            self.position=position  or (([[0.,0.,0.]]*len(self)) | units.m)

        if not hasattr(original_particles, "vx"):
            self.velocity=velocity  or (([[0.,0.,0.]]*len(self)) | units.m/units.s)

        if not hasattr(original_particles, "lx"):
            self.angular_momentum=angular_momentum  or (([[0.,0.,0.]]*len(self)) | units.g*units.m**2/units.s)
Example #3
0
 def __init__(self, *args, **kwargs):
     ParticlesOverlay.__init__(self, *args, **kwargs)