@@ -0,0 +1,2464 @@
+from numpy import array, prod%0A%0Afrom hypothesis.strategies import sampled_from%0Afrom simphony.core.data_container import DataContainer%0Afrom simphony.core.cuba import CUBA%0Afrom simphony.cuds import (%0A    Mesh, Point, Cell, Edge, Face, Particles, Particle, Bond)%0Afrom simphony.cuds.lattice import make_cubic_lattice%0A%0A%0Adef create_example_lattice():%0A    lattice = make_cubic_lattice('test', 0.1, (5, 10, 12))%0A%0A    def work_on_nodes(nodes):%0A        for node in nodes:%0A            index = array(node.index) + 1.0%0A            node.data%5BCUBA.TEMPERATURE%5D = prod(index)%0A            yield node%0A%0A    lattice.update_nodes(work_on_nodes(lattice.iter_nodes()))%0A    return lattice%0A%0A%0Adef create_example_mesh():%0A    points = array(%5B%0A        %5B0, 0, 0%5D, %5B1, 0, 0%5D, %5B0, 1, 0%5D, %5B0, 0, 1%5D,%0A        %5B2, 0, 0%5D, %5B3, 0, 0%5D, %5B3, 1, 0%5D, %5B2, 1, 0%5D,%0A        %5B2, 0, 1%5D, %5B3, 0, 1%5D, %5B3, 1, 1%5D, %5B2, 1, 1%5D%5D,%0A        'f')%0A%0A    cells = %5B%0A        %5B0, 1, 2, 3%5D,  # tetra%0A        %5B4, 5, 6, 7, 8, 9, 10, 11%5D%5D  # hex%0A%0A    faces = %5B%5B2, 7, 11%5D%5D%0A    edges = %5B%5B1, 4%5D, %5B3, 8%5D%5D%0A%0A    mesh = Mesh('example')%0A%0A    # add points%0A    uids = mesh.add_points(%0A        Point(coordinates=point, data=DataContainer(TEMPERATURE=index))%0A        for index, point in enumerate(points))%0A%0A    # add edges%0A    mesh.add_edges(%0A        Edge(points=%5Buids%5Bindex%5D for index in element%5D)%0A        for index, element in enumerate(edges))%0A%0A    # add faces%0A    mesh.add_faces(%0A        Face(points=%5Buids%5Bindex%5D for index in element%5D)%0A        for index, element in enumerate(faces))%0A%0A    # add cells%0A    mesh.add_cells(%0A        Cell(points=%5Buids%5Bindex%5D for index in element%5D)%0A        for index, element in enumerate(cells))%0A%0A    return mesh%0A%0A%0Adef create_example_particles():%0A    points = array(%5B%5B0, 0, 0%5D, %5B1, 0, 0%5D, %5B0, 1, 0%5D, %5B0, 0, 1%5D%5D, 'f')%0A    bonds = array(%5B%5B0, 1%5D, %5B0, 3%5D, %5B1, 3, 2%5D%5D)%0A    temperature = array(%5B10., 20., 30., 40.%5D)%0A%0A    particles = Particles('test')%0A    uids = particles.add_particles(%0A        Particle(%0A            coordinates=point,%0A            data=DataContainer(TEMPERATURE=temperature%5Bindex%5D))%0A        for index, point in enumerate(points))%0A%0A    particles.add_bonds(%0A        Bond(particles=%5Buids%5Bindex%5D for index in indices%5D)%0A        for indices in bonds)%0A%0A    return particles%0A%0A%0Acuds_containers = sampled_from(%5B%0A    (create_example_mesh(array_name='TEMPERATURE'), 'mesh'),%0A    (create_example_lattice(array_name='TEMPERATURE'), 'lattice-3d'),%0A    (create_example_particles(array_name='TEMPERATURE'), 'particles')%5D)%0A

add a hepler testing module