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

Can I fill only the ghost cells with some Fillpatch functions? #4278

Open
pkufourier opened this issue Dec 24, 2024 · 1 comment
Open

Can I fill only the ghost cells with some Fillpatch functions? #4278

pkufourier opened this issue Dec 24, 2024 · 1 comment

Comments

@pkufourier
Copy link

pkufourier commented Dec 24, 2024

As described by the document, the "Fillpatch operations fill all cells, valid and ghost, from actual valid data at that level, space-time interpolated data from the next-coarser level, neighboring grids at the same level, and domain boundary conditions". However, in multi-level grids computations, the inner-cells (i.e. the valid cells) of the fine level should not be overwritten by the Fillpatch process.

Therefore, if I want to fill only the ghost cells with interpolation from coarse level, one possible solution is to Fillpatch to a temp Fab, then copy the ghost cell values to the destined fine level Fab (or swap the temp Fab and the dst fine level fab). This leads to a waste of copy operation on the inner cells of the fine level.

So is there anyway to avoid this inner cells' copy when calling Fillpatch?

@WeiqunZhang
Copy link
Member

However, in multi-level grids computations, the inner-cells (i.e. the valid cells) of the fine level should not be overwritten by the Fillpatch process.

That's not always true. One might also need to do interpolation in time. In that case, the valid cells of the output mulitfab will be overwritten. If you don't need interpolation in time, all you need to do is provide the same mulitfab as both the input and output, and make sure the times are consistent. Then we will not touch the valid cells.

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