How to use the amuse.test.amusetest.TestWithMPI function in amuse

To help you get started, we’ve selected a few amuse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GalacticDynamics-Oxford / Agama / py / test_amuse.py View on Github external
#!/usr/bin/python

from amuse.community.agama.interface import Agama
from amuse.units import *
from amuse.test.amusetest import TestWithMPI
from amuse.ic.plummer import new_plummer_model

class AgamaInterfaceTests(TestWithMPI):

    def test1(self):
        M=10.
        a=2.
        x=1.
        y=2.
        z=3.
        r=(x*x+y*y+z*z)**0.5
        instance = Agama(type="Dehnen",
            mass=M|generic_unit_system.mass, scaleRadius=a|generic_unit_system.length)
        result=instance.get_potential_at_point(
            0.|generic_unit_system.length,
            x |generic_unit_system.length,
            y |generic_unit_system.length,
            z |generic_unit_system.length)
        self.assertAlmostEqual(result.value_in(