Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support VertexOnlyMesh in 1D mesh #1792

Closed
ReubenHill opened this issue Jul 22, 2020 · 1 comment
Closed

Support VertexOnlyMesh in 1D mesh #1792

ReubenHill opened this issue Jul 22, 2020 · 1 comment
Assignees

Comments

@ReubenHill
Copy link
Contributor

At present creating a VertexOnlyMesh within an interval mesh causes a NotImplementedError. If this is removed then,

with test.py containing

from firedrake import *
m = UnitIntervalMesh(1)
vertices = [(0.,), (0.1,), (0.9,), (1.0,)]
vm = VertexOnlyMesh(m, vertices)

I get

Traceback (most recent call last):
  File "test.py", line 4, in <module>
    vm = VertexOnlyMesh(m, vertices)
  File "/Users/rwh10/firedrake/src/firedrake/firedrake/mesh.py", line 1733, in VertexOnlyMesh
    swarm = _pic_swarm_in_plex(mesh.topology._plex, vertexcoords, fields=[("parentcellnum", 1, IntType)])
  File "/Users/rwh10/firedrake/src/firedrake/firedrake/mesh.py", line 1846, in _pic_swarm_in_plex
    swarm.setPointCoordinates(coords, redundant=False, mode=PETSc.InsertMode.INSERT_VALUES)
  File "PETSc/DMSwarm.pyx", line 200, in petsc4py.PETSc.DMSwarm.setPointCoordinates
petsc4py.PETSc.Error: error code 63
[0] DMSwarmSetPointCoordinates() line 305 in /Users/rwh10/firedrake/src/petsc/src/dm/impls/swarm/swarmpic.c
[0] DMLocatePoints() line 6550 in /Users/rwh10/firedrake/src/petsc/src/dm/interface/dm.c
[0] DMLocatePoints_Plex() line 738 in /Users/rwh10/firedrake/src/petsc/src/dm/impls/plex/plexgeometry.c
[0] DMPlexLocatePoint_Internal() line 460 in /Users/rwh10/firedrake/src/petsc/src/dm/impls/plex/plexgeometry.c
[0] Argument out of range
[0] No point location for cell 0 with type segment

Originally posted by @ReubenHill in #1638 (comment)

Suggested solution:

OK, so if you wanted to support this you could implement DMPlexLocatePoint_Simplex_1D_Internal and hook it up in DMPlexLocatePoint_Internal

Originally posted by @wence- in #1638 (comment)

@ReubenHill
Copy link
Contributor Author

Resolved by #2175

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant