<div dir="ltr">Matt is the expert (and he is busy today) but I use:<div><br></div><div>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Menlo;color:rgba(0,0,0,0.85)">ierr = DMLocalizeCoordinates(dm);CHKERRQ(ierr); <span class="gmail-s1" style="color:rgb(93,108,121)">/* needed for periodic */</span></p></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 9, 2021 at 1:26 AM Daniil Svyatsky <<a href="mailto:dasvyat@gmail.com">dasvyat@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr"><br></div><div dir="ltr">Dear petsc developers and users,<div><br></div><div>I'm trying to set up a periodic BC on a mesh obtained by AMR technique.</div><div>I have a problem accessing the real coordinates of nodes on the periodic boundary.</div><div><br></div><div>First, I generated a box mesh and apply periodic BC:</div><div><br></div><div>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>bc_cond[0] = DM_BOUNDARY_PERIODIC;</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>bc_cond[1] = DM_BOUNDARY_PERIODIC;</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>bc_cond[2] = DM_BOUNDARY_PERIODIC;</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195);min-height:14px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>DMPlexCreateBoxMesh(PETSC_COMM_WORLD, dim, PETSC_FALSE,</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>num_faces, lower_cor, top_cor, bc_cond, interpolate, &(dm));</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195);min-height:14px"><span style="font-variant-ligatures:no-common-ligatures"></span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(21,142,13)">DM</span><span style="font-variant-ligatures:no-common-ligatures"> <span> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(183,101,10)">baseParallel</span><span style="font-variant-ligatures:no-common-ligatures">;</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(21,142,13);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)"><span> </span></span><span style="font-variant-ligatures:no-common-ligatures">PetscPartitioner</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(183,101,10)">part</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)">;</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195);min-height:14px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>ierr = DMPlexGetPartitioner(dm,&part);CHKERRQ(ierr);</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>ierr = PetscPartitionerSetFromOptions(part);CHKERRQ(ierr);</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>ierr = DMPlexDistribute(dm,0,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(18,141,141)">NULL</span><span style="font-variant-ligatures:no-common-ligatures">,&baseParallel);CHKERRQ(ierr);</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(185,28,255)">if</span><span style="font-variant-ligatures:no-common-ligatures"> (baseParallel) {</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>ierr = DMDestroy(&(dm));CHKERRQ(ierr);</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>dm = baseParallel;</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>}</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p> After this step I can access coordinates of boundary nodes correctly.</div><div>Then I applied AMR on this mesh:</div><div><br></div><div>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(183,101,10);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(21,142,13)"> DM</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)"> <span> </span></span><span style="font-variant-ligatures:no-common-ligatures">preForest</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)">, </span><span style="font-variant-ligatures:no-common-ligatures">postForest</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)">;</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(183,101,10);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)"><span> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(21,142,13)">DMLabel</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)"> </span><span style="font-variant-ligatures:no-common-ligatures">adaptLabel</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)"> = </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(18,141,141)">NULL</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)">;</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195);min-height:14px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>ierr = DMCreate(PETSC_COMM_SELF, &preForest);CHKERRQ(ierr);</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>ierr = DMSetType(preForest,(dim == 2) ? DMP4EST : DMP8EST);CHKERRQ(ierr);</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>ierr = DMForestSetBaseDM(preForest,env->dstruct->dm);CHKERRQ(ierr);</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>ierr = DMForestSetMinimumRefinement(preForest,0);CHKERRQ(ierr);</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>ierr = DMForestSetInitialRefinement(preForest,0);CHKERRQ(ierr);</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>ierr = DMSetFromOptions(preForest);CHKERRQ(ierr);</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>ierr = DMSetUp(preForest);CHKERRQ(ierr);</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195);min-height:14px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>ierr = CreateAdaptivityLabel(env,preForest,&adaptLabel);CHKERRQ(ierr);</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>ierr = DMForestTemplate(preForest,PETSC_COMM_SELF, &postForest);CHKERRQ(ierr);</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>ierr = DMForestSetAdaptivityLabel(postForest,adaptLabel);CHKERRQ(ierr);</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>ierr = DMLabelDestroy(&adaptLabel);CHKERRQ(ierr);</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>ierr = DMSetUp(postForest);CHKERRQ(ierr);</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195);min-height:14px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(21,142,13)">DM</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(183,101,10)">dmConv</span><span style="font-variant-ligatures:no-common-ligatures">;</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>ierr = DMConvert(postForest,DMPLEX,&dmConv);CHKERRQ(ierr);</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(195,35,15);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"> </span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(185,28,255)">if</span><span style="font-variant-ligatures:no-common-ligatures"> (dmConv){</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>DMDestroy(&dm);</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>dm = dmConv;</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>}</span></p></div><div><br></div><div>In my example, boundary cells were also refined. After AMR I have a problem accessing the coordinates of nodes. </div><div>To access node coordinates I do the following:</div><div><br></div><div>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>DMGetCoordinatesLocal(dm, &coordinates);</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>DMGetCoordinateDM(dm, &cdm);</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>DMGetSection(cdm, &cs);</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p style="margin:0px;font:12px Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(185,28,255)"> for</span><span style="font-variant-ligatures:no-common-ligatures"> (cell = cStart; cell < cEnd; ++cell) {</span></p><p style="margin:0px;font:12px Courier;color:rgb(21,142,13);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"> PetscInt</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(183,101,10)">numFaces</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)">;</span></p><p style="margin:0px;font:12px Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(185,28,255)">const</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(21,142,13)">PetscInt</span><span style="font-variant-ligatures:no-common-ligatures"> *</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(183,101,10)">faces</span><span style="font-variant-ligatures:no-common-ligatures">;</span></p><p style="margin:0px;font:12px Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>ierr = DMPlexGetConeSize(dm, cell, &numFaces);</span></p><p style="margin:0px;font:12px Courier;color:rgb(77,47,45);background-color:rgb(223,219,195);min-height:14px"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures">ierr = DMPlexGetCone(dm, cell, &faces);</span><span style="font-variant-ligatures:no-common-ligatures"></span></p><p style="margin:0px;font:12px Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(185,28,255)"> for</span><span style="font-variant-ligatures:no-common-ligatures"> (</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(21,142,13)">int</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(183,101,10)">f</span><span style="font-variant-ligatures:no-common-ligatures"> = 0; f<numFaces; f++){</span></p><p style="margin:0px;font:12px Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>temp_f = </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(18,141,141)">NULL</span><span style="font-variant-ligatures:no-common-ligatures">;</span></p><p style="margin:0px;font:12px Courier;color:rgb(77,47,45);background-color:rgb(223,219,195);min-height:14px">
</p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>DMPlexVecGetClosure(dm, cs, coordinates, faces[f], &fsize, &temp_f);</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(185,28,255)">for</span><span style="font-variant-ligatures:no-common-ligatures"> (p=0; p<fsize;p+=dim){</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures">DMLocalizeCoordinate(dm, temp_f+p, PETSC_FALSE, coord_p)</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"> }</span></p>
<p style="margin:0px;font:12px Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><span> }</span></span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"> }</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p>coord_p has wrong coordinates either I used PETSC_TRUE or PETSC_FALSE in DMLocalizeCoordinate.</div><div><br></div><div>What am I doing wrong? I'm using petsc-3.14.1 version.</div><div>Thank you for your help in advance.</div><div><br></div><div>Best regards,</div><div>Daniil Svyatsky.</div>
</div>
</div></div>
</blockquote></div>