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

definition of 2D / 3D grid #200

Open
lnw opened this issue Oct 9, 2018 · 3 comments
Open

definition of 2D / 3D grid #200

lnw opened this issue Oct 9, 2018 · 3 comments

Comments

@lnw
Copy link
Contributor

lnw commented Oct 9, 2018

Another case where the input file is evaluated differently from what I would expect: For an std grid, the basis vectors i, j, and k are not on an equal footing.

Specifically, if I define:
Grid(std) {
type=even
origin=[18.0, 0.0, 0.0]
ivec=[1.0, 0.0, 0.0]
jvec=[0.0, 1.0, 0.0]
lengths=[26.0, 12.0, 0.0]
spacing=[0.5, 0.5, 0.5]
}

I get a 2D grid in the xy plane as I would have expected. However, if I choose

Grid(std) {
type=even
origin=[18.0, 0.0, 0.0]
ivec=[1.0, 0.0, 0.0]
jvec=[0.0, 1.0, 0.0]
lengths=[26.0, 0.0, 12.0]
spacing=[0.5, 0.5, 0.5]
}

in order to get a 2D grid in the xz plane, then I get a 3D grid, defined by 8 points (which consists of four pairs of equal points).

This might not be a bug, but it's very unexpected and hard to understand to the uninitiated ...

@heikef
Copy link
Contributor

heikef commented Oct 9, 2018

You define ivec as x and jvec as y but you want an xz plane. This is not working. Try to define jvec as z (0 0 1) and see if this solves your problem.

@lnw
Copy link
Contributor Author

lnw commented Oct 9, 2018

Yes, that works, but it would be natural to assume that the above settings work as well. Is there an implicit rule, that a 2D grid must be spanned by i and j, while k is the third vector that spans the cuboid?
I would suggest to either silently assume that when one length is zero, the other two vectors are spanning a plane, independently of which two they are, or return an error when one length of a cuboid is zero.
While I'm at it: When you chose a non-zero number of points in a direction with zero-length, we need an error message :)

@heikef
Copy link
Contributor

heikef commented Oct 11, 2018

You are welcome to add improvements. It is an open source project. :)

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

No branches or pull requests

2 participants