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

CoarsenRefStatus possibly reporting wrong time index #18

Open
jcc242 opened this issue Dec 20, 2018 · 5 comments
Open

CoarsenRefStatus possibly reporting wrong time index #18

jcc242 opened this issue Dec 20, 2018 · 5 comments

Comments

@jcc242
Copy link
Contributor

jcc242 commented Dec 20, 2018

I set up a simple time domain with 5 points on the coarse time grid and uniformly tag the entire coarse time domain for refinement by some factor. I am doing spatial refinement as well.

During my spatial refinement function, the time index I get from braid_CoarsenRefStatusGetTIndex() appears to be giving me values that are wrong or invalid. It appears I am getting the following correspondence between time points and indices:

(Point, Index): (T0,3) (T1,0) (T2,1) (T3,2) (T4,3)

That is, the time index 3 is associated with the first time point of my coarse time domain, then counting up starts at T1.

Is this because the time index is not set by _braid_CoarsenRefStatusInit like it is in _braid_StepStatusInit, and so just using (or reusing) whatever value was set last into the struct? This theory corresponds to the order of calling refinement, T1, T2, T3, T4 then lastly T0.

Note that I am deducing what time point I am at by looking at the value returned from time, and the values of my state vector match the time so I feel comfortable with assuming the time is correct.

@jcc242
Copy link
Contributor Author

jcc242 commented Dec 20, 2018

These changes seem to fix the issue:

a2b2eae

I'm not sure what the consequences are of calling

_braid_StatusElt(status, idx) = c_index;

in _braid_CoarsenRefStatusInit. Does _braid_FRefine or another function expect the idx to be at a certain value later on in the routine, and now I've changed it?

@rfalgout
Copy link
Collaborator

I would not use 'idx' for the coarse point. It looks as though it would make sense to provide both the fine and corresponding coarse indexes in CoarsenRefStatus. So, I would add a 'c_idx' variable to the core in the CoarsenRefStatus section and add a braid_StatusGetCTIndex routine. Does that make sense?

@jbschroder
Copy link
Member

jbschroder commented Dec 20, 2018 via email

@jcc242
Copy link
Contributor Author

jcc242 commented Dec 20, 2018

That makes sense, I'll look into it.

@jbschroder
Copy link
Member

@jcc242
Hi Joshua, did we fix this bug? I think so, but I wanted to check before I close this ticket.

Thanks!

Jacob

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

3 participants