[Dune] Local Refinement in a DUNE Grid

Jö Fahlke jorrit at jorrit.de
Sun Dec 26 12:36:53 CET 2010


Am Sun, 26. Dec 2010, 06:18:46 +0100 schrieb S. Swayamjyoti:
> I am using DUNE for creating a grid over which I will apply Finite Element
> Methods. I have created a structured 3D grid of cubes. Now, I want to refine
> the cubes at the center of the domain. I require fine meshing for cubes at
> the center while course meshing is OK as we go outward from the center.
> Course meshing away from the center will also save me computational cost.
> 
> Could someone please suggest how to refine the grids at the center - if
> there is a local refinement class? Please also suggest the header file to
> include for the same.

You have to iterate over the elements (the codim-0 entities) of the
LeafGridView.  For each element that you want to refine, call grid.mark(1,
elem).  Once Iteration is done, call grid.preAdapt(), grid.adapt(), and
grid.postAdapt().  Repeat until you are satisfied with the grid.

If you know a priori that a certain element can be refined n times uniformly,
you can also tell that to grid.mark() by calling grid.mark(n, element)
instead.

Bye,
Jö.

-- 
Sie können die Unversität jetzt ausschalten.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20101226/346e9faf/attachment.sig>


More information about the Dune mailing list