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

Add coarsening in 2D for newest vertex bisection #1018

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

aerappa
Copy link
Contributor

@aerappa aerappa commented Aug 2, 2024

@JordiManyer, @amartinhuertas :

@wangzuodong1997 and I have been working on implementing coarsening in the case of 2D refinement. Specifically, we have only implemented modifying the Topology directly without bothering with the infrastructure of rrules etc. currently implemented for refinement that (if I understand correctly) allow interpolation and projection between parent and children meshes.

Our refinement algorithm closely resembles the one here and has the attractive feature that it doesn't not require any mesh history to perform local coarsening that preserves mesh continuity. At a high level, the user selects a set of cells to coarsen, and our algorithm identifies if any of these cells contain a "good node" which can be removed with some of it's edges without generating any hanging nodes.

From your point of view, what are the next steps? Can AdaptivityGlue be reused for coarsening? It seems rather specific to refinement at the moment.

Please find a small example below demonstrating the coarsening.

Before:
before
After:
after

@aerappa aerappa marked this pull request as draft August 2, 2024 13:52
@JordiManyer
Copy link
Member

JordiManyer commented Aug 3, 2024

@aerappa Thanks for the contribution!

From your point of view, what are the next steps? Can AdaptivityGlue be reused for coarsening? It seems rather specific to refinement at the moment.

We are currently already using what we have for coarsening in GridapP4est, so nothing new needs to be added. The mixed glue should be ok for mixed refining/coarseningm (i.e the adapt function). If you only have coarsening, the refinement glue does the job just fine (since coarsening is basically refining in reverse). Simply put the coarsened model as the parent, not the child.

Straight from the documentation:

Glue containing the map between two nested triangulations. The contained datastructures will 
depend on the type of glue. There are two types of `AdaptivityGlue`: 

- `RefinementGlue` :: All cells in the new mesh are children of cells in the old mesh. I.e given 
  a new cell, it is possible to find a single old cell containing it (the new cell might be exactly
  the old cell if no refinement).
- `MixedGlue` :: Some cells in the new mesh are children of cells in the old mesh, while others are
  parents of cells in the old mesh. 

Contains: 

- `n2o_faces_map` :: Given a new face gid, returns
  - if fine, the gid of the old face containing it.
  - if coarse, the gids of its children (in child order)
- `n2o_cell_to_child_id` :: Given a new cell gid, returns 
  - if fine, the local child id within the (old) coarse cell containing it.
  - if coarse, a list of local child ids of the (old) cells containing it.
- `refinement_rules` :: Array conatining the `RefinementRule` used for each coarse cell.

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

Successfully merging this pull request may close these issues.

2 participants