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

Inconsistency between RunR export and VTK #470

Open
shkodm opened this issue Dec 17, 2023 · 1 comment
Open

Inconsistency between RunR export and VTK #470

shkodm opened this issue Dec 17, 2023 · 1 comment

Comments

@shkodm
Copy link
Member

shkodm commented Dec 17, 2023

In VTK export we have , when assigning numerical values for the BOUNDARY export:

for (size_t i=0;i<size;i++) {
	small[i] = (NodeType[i] & it.flag) >> it.shift;
}

So the minimum value would be 0.

Meawhile in cbRunR.cpp we have also for BOUNDARY:

for (size_t i=0;i<size;i++) {
	small[i] = 1 + ((NodeType[i] & it.flag) >> it.shift);
}

So it will start from 1.

This is not a bug I think, just inconsistent behaviour, not sure what to do with this. Occurred to me when passing BOUNDARY values from R to Python and trying to filter by numerical value (which was off by 1, because I was using the value I remember from VTK export).

Not critical, just wanted to document somewhere.

@shkodm shkodm mentioned this issue Dec 18, 2023
@llaniewski
Copy link
Member

@shkodm R has indexing from 1, so there is no way around this for the factor representation in R. But I could easily add an additional class to the array, make the r_to_py convertion for it convert it to numpy array of integers and subtract 1.

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