Skip to content

Unclear AssertionError when providing points of wrong dimensions #74

@MakisH

Description

@MakisH

When providing e.g. an array of 2D points:

vertices = numpy.array([[0,0]])
vertex_ids = Interface.set_mesh_vertices(mesh_id, vertices)

to a 3D mesh:

<solver-interface dimensions="3" >

the python bindings will catch this, but throw only a generic error:

  File "mysolver.py", line 75, in main
    vertex_ids = Interface.set_mesh_vertices(mesh_id, vertices)
  File "precice.pyx", line 525, in precice.Interface.set_mesh_vertices
AssertionError

preCICE itself should already catch this (and it give a clear error), so this raises the question whether we really need this duplicate error checking.

I understand that there is probably a good for having this assertion here (I vaguely remember a long discussion about it), but we need then an informative error message.

I am using preCICE v2.1.1 and the python bindings v2.1.1.1.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions