ForestClaw / forestclaw

Quadtree/octree adaptive PDE solver based based on p4est.
http://www.forestclaw.org
BSD 2-Clause "Simplified" License
58 stars 22 forks source link

Tagging cells #99

Closed donnaaboise closed 6 years ago

donnaaboise commented 9 years ago

Originally reported by: Donna Calhoun (Bitbucket: donnaaboise, GitHub: donnaaboise)


If I tag a family of grids for coarsening, there is no need to then check to see whether any of the four sibling grids should be refined.

Is there a way I can determine whether a grid has been tagged for coarsening? I am thinking of a patch access function that returns 1/0 depending on the state of some internal flag.


donnaaboise commented 8 years ago

Original comment by Donna Calhoun (Bitbucket: donnaaboise, GitHub: donnaaboise):


Good suggestion. My main concern was keeping everything consistent, but with an assertion, this should be easy. Thanks.

donnaaboise commented 8 years ago

Original comment by Carsten Burstedde (Bitbucket: cburstedde, GitHub: cburstedde):


In line with issue #96, this will likely be fastest using forestclaw patch data. Coarsening is called before refinement, and cb_regrid_tag4coarsening gets a pointer to all fine patches where it can set the will_coarsen flag in each one's user data. The subsequent call to cb_fclaw2d_regrid_tag4refinement can query this flag to avoid the virtual tagging function.

Care must be taken to set the flag to zero when a patch is created for the first time. Since patches are destroyed on coarsening, there should be no need to ever reset a flag from true to false (?). A good way to double-check this is to assert that the flag is false just before setting it to true in tag4coarsening.

donnaaboise commented 8 years ago

Original comment by Carsten Burstedde (Bitbucket: cburstedde, GitHub: cburstedde):


I could program this fairly easily actually.

donnaaboise commented 6 years ago

Don't quite remember what the issue was, but assume it is fixed.