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

Reimplement *_satisfying in a more generic fashion #51

Closed
kinnala opened this issue Sep 19, 2018 · 4 comments
Closed

Reimplement *_satisfying in a more generic fashion #51

kinnala opened this issue Sep 19, 2018 · 4 comments

Comments

@kinnala
Copy link
Owner

kinnala commented Sep 19, 2018

The methods named:

  • Mesh3D.nodes_satisfying
  • Mesh3D.facets_satisfying
  • Mesh3D.elements_satisfying

could be implemented in a generic fashion for both 2D and 3D meshes and moved to Mesh superclass. They already look very similar: the tuple unpack notation via * could be used to make the implementation equivalent.

@gdmcbain
Copy link
Contributor

Oh, another idea: if a point in the line, plane, or space were represented by a single grouped entity rather than the separated Cartesian coordinates. ndarray is the obvious choice here as this correspondence to the columns of Mesh.p. Would thus be another way of achieving dimension-independent code?

@kinnala
Copy link
Owner Author

kinnala commented Sep 20, 2018

I'm sorry I missed your idea. The reason why columns of p correspond to points is mostly historical but also in assembly we require efficient slicing of all x-coordinates, all y-coordinates, etc. Default memory ordering of NumPy makes the current approach more efficient in terms of processor-level caching. NumPy supports changing this but I haven't seen a reason to rewrite everything.

@gdmcbain
Copy link
Contributor

gdmcbain commented Sep 20, 2018 via email

@kinnala
Copy link
Owner Author

kinnala commented Sep 22, 2018

This would also be consistent with how it's done in the bilinear and linear forms.

It's a good idea but requires some rewriting of examples and tests and other code. Mesh.submesh must be modified accordingly.

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

2 participants