[petsc-users] Semi-coarsening for GMG using DMDA?

Joe Alexandersen joal at sdu.dk
Mon Apr 7 02:15:05 CDT 2025


Dear all,

Our initial testings indicates that indeed this works as it should using DMDAs, DMDASetRefinementFactor and DMDARefine. Thanks for your insights!

Sincerely,
Joe Alexandersen
Associate Professor
DFF Sapere Aude Research Leader
The Faculty of Engineering
Institute of Mechanical and Electrical Engineering
SDU Mechanical Engineering
T
+45 65 50 74 65 <tel:+4565507465>
M
+45 93 50 72 44 <tel:+4593507244>
joal at sdu.dk <mailto:joal at sdu.dk>
https://urldefense.us/v3/__http://www.sdu.dk/ansat/joal__;!!G_uCfscf7eWS!dCmFZnVLqfD57VRiFZfer9P6Zv6XgPOnTO9eUH3h9e6d2X1XtNmoK8SyFrMhoCM0rkiFDpCq8KLJ8XaqNQ$  <https://urldefense.us/v3/__http://www.sdu.dk/ansat/joal__;!!G_uCfscf7eWS!dCmFZnVLqfD57VRiFZfer9P6Zv6XgPOnTO9eUH3h9e6d2X1XtNmoK8SyFrMhoCM0rkiFDpCq8KLJ8XaqNQ$ >
University of Southern Denmark
Campusvej 55
DK-5230 Odense M
https://urldefense.us/v3/__http://www.sdu.dk__;!!G_uCfscf7eWS!dCmFZnVLqfD57VRiFZfer9P6Zv6XgPOnTO9eUH3h9e6d2X1XtNmoK8SyFrMhoCM0rkiFDpCq8KLZfAMdWA$  <https://urldefense.us/v3/__https://www.sdu.dk/__;!!G_uCfscf7eWS!dCmFZnVLqfD57VRiFZfer9P6Zv6XgPOnTO9eUH3h9e6d2X1XtNmoK8SyFrMhoCM0rkiFDpCq8KL_EEYz7A$ >
[https://urldefense.us/v3/__https://cdn.sdu.dk/img/sdulogos/SDU_BLACK_signatur.png__;!!G_uCfscf7eWS!dCmFZnVLqfD57VRiFZfer9P6Zv6XgPOnTO9eUH3h9e6d2X1XtNmoK8SyFrMhoCM0rkiFDpCq8KLP942N2Q$ ]


From: Matthew Knepley <knepley at gmail.com>
Sent: 22 March 2025 15:31
To: Joe Alexandersen <joal at sdu.dk>
Cc: Mark Adams <mfadams at lbl.gov>; Barry Smith <bsmith at petsc.dev>; petsc-users at mcs.anl.gov
Subject: Re: [petsc-users] Semi-coarsening for GMG using DMDA?

You don't often get email from knepley at gmail.com. Learn why this is important<https://urldefense.us/v3/__https://aka.ms/LearnAboutSenderIdentification__;!!G_uCfscf7eWS!dCmFZnVLqfD57VRiFZfer9P6Zv6XgPOnTO9eUH3h9e6d2X1XtNmoK8SyFrMhoCM0rkiFDpCq8KLmxMYkbA$ >
On Thu, Mar 20, 2025 at 12:09 PM Joe Alexandersen via petsc-users <petsc-users at mcs.anl.gov<mailto:petsc-users at mcs.anl.gov>> wrote:
Great, thanks for the input so far. We will wait for Matt's response soonish.

Looking at the code, as Barry says, it should work. Please let us know if it does not.

You can also do this with Plex, as Mark says. The drawback here is that I do not have code
to determine that this kind of refinement is nested. Therefore it will fall back to the slow code
for constructing arbitrary interpolators. If you really wanted this, we could improve the interpolator
code to be fast for this kind of nesting.

  Thanks,

     Matt

Sincerely,

Joe Alexandersen
Associate Professor
DFF Sapere Aude Research Leader

The Faculty of Engineering
Institute of Mechanical and Electrical Engineering
SDU Mechanical Engineering

T +45 65 50 74 65
M +45 93 50 72 44

joal at sdu.dk<mailto:joal at sdu.dk>
https://urldefense.us/v3/__http://www.sdu.dk/ansat/joal__;!!G_uCfscf7eWS!dCmFZnVLqfD57VRiFZfer9P6Zv6XgPOnTO9eUH3h9e6d2X1XtNmoK8SyFrMhoCM0rkiFDpCq8KLJ8XaqNQ$ <https://urldefense.us/v3/__http://www.sdu.dk/ansat/joal__;!!G_uCfscf7eWS!aMq_eBTTAvLdy-GtpWdAVq8zqDaObi_eL0EKi7yFbh6VUSQCx-pDonMSd9Rejkpr3DBMyE15NaaOKv14zQ$>

University of Southern Denmark
Campusvej 55
DK-5230 Odense M
https://urldefense.us/v3/__http://www.sdu.dk__;!!G_uCfscf7eWS!dCmFZnVLqfD57VRiFZfer9P6Zv6XgPOnTO9eUH3h9e6d2X1XtNmoK8SyFrMhoCM0rkiFDpCq8KLZfAMdWA$ <https://urldefense.us/v3/__http://www.sdu.dk__;!!G_uCfscf7eWS!aMq_eBTTAvLdy-GtpWdAVq8zqDaObi_eL0EKi7yFbh6VUSQCx-pDonMSd9Rejkpr3DBMyE15NaYjcKBeNw$>

Sent from Outlook for Android<https://urldefense.us/v3/__https://aka.ms/AAb9ysg__;!!G_uCfscf7eWS!aMq_eBTTAvLdy-GtpWdAVq8zqDaObi_eL0EKi7yFbh6VUSQCx-pDonMSd9Rejkpr3DBMyE15NaYUzarulQ$>

________________________________
From: Mark Adams <mfadams at lbl.gov<mailto:mfadams at lbl.gov>>
Sent: Thursday, March 20, 2025 5:00:31 pm
To: Barry Smith <bsmith at petsc.dev<mailto:bsmith at petsc.dev>>
Cc: Joe Alexandersen <joal at sdu.dk<mailto:joal at sdu.dk>>; petsc-users at mcs.anl.gov<mailto:petsc-users at mcs.anl.gov> <petsc-users at mcs.anl.gov<mailto:petsc-users at mcs.anl.gov>>
Subject: Re: [petsc-users] Semi-coarsening for GMG using DMDA?

You don't often get email from mfadams at lbl.gov<mailto:mfadams at lbl.gov>. Learn why this is important<https://urldefense.us/v3/__https://aka.ms/LearnAboutSenderIdentification__;!!G_uCfscf7eWS!aMq_eBTTAvLdy-GtpWdAVq8zqDaObi_eL0EKi7yFbh6VUSQCx-pDonMSd9Rejkpr3DBMyE15NaasFl50jQ$>
We have worked on semi coarsening in DMPlex, but it is not finished and we are not working on it now.

I'm not sure about how easy it would be in DMDA, but Barry is suggesting that it is doable.

We need to wait for Matt and he is on travel so his response may be delayed.

Mark

On Thu, Mar 20, 2025 at 11:34 AM Barry Smith <bsmith at petsc.dev<mailto:bsmith at petsc.dev>> wrote:

   In theory you can do as you propose. In the context below uniform refinement" only means that the coordinates of the DMDA are ignored so each refinement. The interpolation is fine woth different refinements in the different coordinate directions.

  Barry



On Mar 20, 2025, at 5:56 AM, Joe Alexandersen via petsc-users <petsc-users at mcs.anl.gov<mailto:petsc-users at mcs.anl.gov>> wrote:

Dear PETSc developers,

We are working with a code that uses regular meshes (DMDA) and geometric multigrid. We would like to go from uniform coarsening/refinement to semi-coarsening/refinement, due to anisotropy in our underlying equations. We have tried to figure out if we can do this using built-in functions of PETSc, but it is unclear to us whether we can get it done relatively easily.

It seems that we can go from the coarsest grid and refine differently in each direction using DMDASetRefinementFactor and then use DMRefine to define the finer levels. However, from the doc page for DMCreateInterpolation, it states that it only works for "uniform refinement" which to me seems to indicate it will not work with different refinement in each direction. But on the other hand, it states that it should work if using DMRefine, which I assume used the information from DMDASetRefinementFactor upon creation?

So our questions are: is there are feasible and relatively simple way to do semi-coarsening/refinement of DMDAs for geometric multigrid hierarchies? Would the above work?

Thanks in advance!

Sincerely,
Joe Alexandersen
University of Southern Denmark




--
What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
-- Norbert Wiener

https://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!dCmFZnVLqfD57VRiFZfer9P6Zv6XgPOnTO9eUH3h9e6d2X1XtNmoK8SyFrMhoCM0rkiFDpCq8KIFQyyAig$ <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!dCmFZnVLqfD57VRiFZfer9P6Zv6XgPOnTO9eUH3h9e6d2X1XtNmoK8SyFrMhoCM0rkiFDpCq8KI4RWhpmA$ >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250407/8f35b4a1/attachment-0001.html>


More information about the petsc-users mailing list