<div dir="ltr"><div dir="ltr">On Sun, Feb 9, 2020 at 3:23 PM Pierre Jolivet <<a href="mailto:pierre.jolivet@enseeiht.fr">pierre.jolivet@enseeiht.fr</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
I’ve a hard time answering the following DMPlex questions by just looking at some of the examples and manual.<br>
Considering two DMPlex dm and dma, as in petsc/src/dm/impls/plex/examples/tests/ex19.c, I’d like to interpolate a simple P_1 FE function from dm to dma.<br>
The DMCreateInterpolation call gives me:<br>
[0]PETSC ERROR: Invalid argument<br>
[0]PETSC ERROR: Number of fine indices 0 != 4 dual basis vecs<br>
[…]<br></blockquote><div><br></div><div>It looks like your fine grid has no discretization, since 0 is numFIndices from</div><div><br></div><div>  ierr = DMPlexGetClosureIndices(dmf, fsection, globalFSection, cell, &numFIndices, &findices, NULL);CHKERRQ(ierr);</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
[0]PETSC ERROR: #1 DMPlexComputeInterpolatorGeneral() line 2508 in petsc/src/dm/impls/plex/plexfem.c<br>
[0]PETSC ERROR: #2 DMCreateInterpolation_Plex() line 7688 in petsc/src/dm/impls/plex/plex.c<br>
[0]PETSC ERROR: #3 DMCreateInterpolation() line 1139 in petsc/src/dm/interface/dm.c<br>
But the DMs look OK, don’t they, cf. below?<br>
So I have three simple questions:<br>
1) are all tests at the bottom of ex19.c broken because of PRAgMaTIc or because of DMPlex currently not supporting some operations? (I’m not using PRAgMaTIc to do mesh adaptation, so I was hoping to not run into an error)<br></blockquote><div><br></div><div>I don't think its broken.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
2) is DMCreateInterpolation + MatInterpolate the correct way of transferring one Vec from a DMPlex onto another?<br></blockquote><div><br></div><div>That is the intent.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
3) if yes, by looking at the names of the arguments in DMPlexComputeInterpolatorGeneral, dmc and dmf, could you comment on the performance of this function for unrelated meshes, e.g., if both DMs are “fine” and not one coarse and the other fine (albeit non-nested), for simple P_k spaces.<br></blockquote><div><br></div><div>In general, it is going to be horrible. Here is what it does: locate the fine quadrature points in the coarse grid and interpolate to them. This quadrature can have huge errors if it falls across multiple cells. This is why the nested version works perfectly, and also why Patrick Farrell and James Maddison have the Supermesh library, which makes a refinement of the mesh until the quadrature is accurate everywhere. That way they guarantee that at least the zeroth moment is preserved.</div><div><br></div><div>  Thanks,</div><div><br></div><div>    Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Thanks in advance for your help,<br>
Pierre<br>
<br>
$ mpirun -n 1 ./ex19 -msh in.msh -init_dm_view ::ascii_info -adapt_dm_view ::ascii_info -mat_view ::ascii_info -do_L2 -petscspace_degree 1<br>
DM Object: DMinit 1 MPI processes<br>
  type: plex<br>
DMinit in 3 dimensions:<br>
  0-cells: 1331<br>
  1-cells: 7930<br>
  2-cells: 12600<br>
  3-cells: 6000<br>
Labels:<br>
  depth: 4 strata with value/size (0 (1331), 1 (7930), 2 (12600), 3 (6000))<br>
  Face Sets: 6 strata with value/size (4 (200), 1 (200), 5 (200), 2 (200), 3 (200), 6 (200))<br>
  Cell Sets: 1 strata with value/size (0 (6000))<br>
DM Object: DMadapt (adapt_) 1 MPI processes<br>
  type: plex<br>
DMadapt in 3 dimensions:<br>
  0-cells: 2905<br>
  1-cells: 18888<br>
  2-cells: 31368<br>
  3-cells: 15384<br>
Labels:<br>
  depth: 4 strata with value/size (0 (2905), 1 (18888), 2 (31368), 3 (15384))<br>
  Face Sets: 6 strata with value/size (1 (200), 4 (200), 6 (200), 2 (200), 5 (200), 3 (200))<br>
  Cell Sets: 1 strata with value/size (0 (15384))<br>
<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>