Skip to content

Physical location of basis functions #2354

Discussion options

You must be logged in to vote

For any space with a nodal basis, can't you just interpolate the spatial coordinates onto that basis? Something like

(x,y) = SpatialCoordinate(mesh)
V = FunctionSpace(mesh,"DG",2)
xfunc = Function(V).interpolate(x)
yfunc = Function(V).interpolate(y)

Then you can look at xfunc.dat.data and yfunc.dat.data to get the coordinates. I don't know how robust that is, but I've done this before with CG spaces and gotten what I needed from it.

Replies: 3 comments 11 replies

Comment options

You must be logged in to vote
5 replies
@bensworth
Comment options

@wence-
Comment options

@wence-
Comment options

@bensworth
Comment options

@wence-
Comment options

Answer selected by bensworth
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@wence-
Comment options

@wence-
Comment options

@wence-
Comment options

@bensworth
Comment options

@wence-
Comment options

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