Refinement on a parallel distributed triangulation with periodic BC

44 views
Skip to first unread message

maurice rohracker

unread,
Nov 16, 2020, 10:09:14 AM11/16/20
to deal.II User Group
Dear deal.II community,

For a software project at FAU Erlangen-Nuremberg, I implemented a distributed memory parallel version of a homogenization problem.

Since we handle periodicity with an offset value, I implemented the periodic BC in the following manner:

  1. Read mesh
  2. Collect periodic faces (triangulation)
  3. Add periodic faces to triangulation
  4. Collect periodic faces (dofHandler)
  5. Make periodic constraint and set inhomogeneity to periodic DOFs on the boundary.
Next step would be to add a mesh refinement. My first try was adding `triangulation.refine_global(nGlobalRefinement);` after the third step.

Unfortunately, when we try to access cells with `!cell.is_artificial()` from the resulting vector of `collect_periodic_faces()` to get all locally relevant boundary cells to add the inhomogeneity, the following assertion is raised:

The violated condition was:
this->active()
Additional information:
is_artificial() can only be called on active cells!

Looking at the doc of `collect_periodic_faces` (This function will collect periodic face pairs on the coarsest mesh level of the given mesh (a Triangulation or DoFHandler) and add them to the vector matched_pairs leaving the original contents intact.)  the resulting vector will only contain parent cells, on which the call `is_artifiical()` is not possible.

So we thought if we change the `cell_iterator` in `collect_periodic_faces` to `active_cell_iterator` we get a vector containing the child cells (on which `is_artifical()` is allowed)? Because we would assume that child cells are active and therefore, our previous approach would work again. But this did not help either.

If this question might be a bit to complex, I would also prepare a minimal example.

Is there a going round to get a similar results as with `collect_periodic_faces`, i.e. a vector containing all refined periodic cells.

Thanks for your support in advance.

Best, Maurice


Marc Fehling

unread,
Nov 17, 2020, 1:18:28 AM11/17/20
to deal.II User Group
Hi Maurice!

On Monday, November 16, 2020 at 8:09:14 AM UTC-7 maurice....@googlemail.com wrote:
Looking at the doc of `collect_periodic_faces` (This function will collect periodic face pairs on the coarsest mesh level of the given mesh (a Triangulation or DoFHandler) and add them to the vector matched_pairs leaving the original contents intact.)  the resulting vector will only contain parent cells, on which the call `is_artifiical()` is not possible.

It appears to me that `GridTools::get_active_child_cells()` is the function you are looking for (see here). In your case, you would get all active children of the coarsest mesh cells if applied on the results of `GridTools::collect_periodic_faces()`. You can iterate over those and identify which one of them are located at the boundary.

However, I am not sure whether `GridTools::get_active_child_cells()` works with `parallel::distributed::Triangulations`. If it does though, the results may contain locally owned, ghost, and/or artificial cells. As the results will be all active cells, you are able to check for these attributes, i.e., check which ones are locally relevant.

Hope this helps!

Marc

Daniel Arndt

unread,
Nov 17, 2020, 10:50:25 AM11/17/20
to dea...@googlegroups.com
Maurice,

make_periodicity_constraints loops (recursively) over all faces referenced in a PeriodicFacePair and applies constraints. You could copy the implementation in https://www.dealii.org/developer/doxygen/deal.II/dof__tools__constraints_8cc_source.html#l02269 and modify accordingly or set up an empty ConstraintMatrix objects and modify the constraints created by make_periodicity_constraints to your needs.

Best,
Daniel

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/8ba32635-dbf3-41ca-b2f3-b44760702e60n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages