Skip to content

Commit 10e6a3f

Browse files
Add tests for mesh connectivity functions (#160) (#251)
* Update test_bindings_module.py * Fix black formatting
1 parent 3d3ab51 commit 10e6a3f

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

test/test_bindings_module.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,3 +667,54 @@ def test_write_vector_gradient_data_non_contiguous(self):
667667
self.assertTrue(
668668
np.array_equiv(np.array(write_data).flatten(), read_data.flatten())
669669
)
670+
671+
def test_set_mesh_edge(self):
672+
participant = precice.Participant("test", "dummy.xml", 0, 1)
673+
fake_mesh_name = "FakeMesh"
674+
participant.set_mesh_edge(fake_mesh_name, 0, 1)
675+
676+
def test_set_mesh_edges(self):
677+
participant = precice.Participant("test", "dummy.xml", 0, 1)
678+
fake_mesh_name = "FakeMesh"
679+
vertices = np.array([[0, 1], [1, 2]])
680+
participant.set_mesh_edges(fake_mesh_name, vertices)
681+
682+
def test_set_mesh_edges_empty(self):
683+
participant = precice.Participant("test", "dummy.xml", 0, 1)
684+
fake_mesh_name = "FakeMesh"
685+
vertices = np.empty((0, 2), dtype=int)
686+
participant.set_mesh_edges(fake_mesh_name, vertices)
687+
688+
def test_set_mesh_triangle(self):
689+
participant = precice.Participant("test", "dummy.xml", 0, 1)
690+
fake_mesh_name = "FakeMesh"
691+
participant.set_mesh_triangle(fake_mesh_name, 0, 1, 2)
692+
693+
def test_set_mesh_triangles(self):
694+
participant = precice.Participant("test", "dummy.xml", 0, 1)
695+
fake_mesh_name = "FakeMesh"
696+
vertices = np.array([[0, 1, 2], [1, 2, 3]])
697+
participant.set_mesh_triangles(fake_mesh_name, vertices)
698+
699+
def test_set_mesh_triangles_empty(self):
700+
participant = precice.Participant("test", "dummy.xml", 0, 1)
701+
fake_mesh_name = "FakeMesh"
702+
vertices = np.empty((0, 3), dtype=int)
703+
participant.set_mesh_triangles(fake_mesh_name, vertices)
704+
705+
def test_set_mesh_quad(self):
706+
participant = precice.Participant("test", "dummy.xml", 0, 1)
707+
fake_mesh_name = "FakeMesh"
708+
participant.set_mesh_quad(fake_mesh_name, 0, 1, 2, 3)
709+
710+
def test_set_mesh_quads(self):
711+
participant = precice.Participant("test", "dummy.xml", 0, 1)
712+
fake_mesh_name = "FakeMesh"
713+
vertices = np.array([[0, 1, 2, 3], [1, 2, 3, 4]])
714+
participant.set_mesh_quads(fake_mesh_name, vertices)
715+
716+
def test_set_mesh_quads_empty(self):
717+
participant = precice.Participant("test", "dummy.xml", 0, 1)
718+
fake_mesh_name = "FakeMesh"
719+
vertices = np.empty((0, 4), dtype=int)
720+
participant.set_mesh_quads(fake_mesh_name, vertices)

0 commit comments

Comments
 (0)