<div style="color:black;font: 10pt arial;">
<div> <font size="2">Thank you a lot, that works well for Simplex cells when running on one processor. Do you know anything that works for Tensor cells and/or when running in parallel?</font></div>

<div><font size="2">Thanks again for all of your help.</font></div>

<div><font size="2">Daniel</font><br>
</div>

<div> <br>
</div>

<div> <br>
</div>

<div style="font-family:arial,helvetica;font-size:10pt;color:black">-----Original Message-----<br>
From: Lawrence Mitchell <wence@gmx.li><br>
To: Daniel Mckinnell <d_mckinnell@aol.co.uk><br>
CC: petsc-users <petsc-users@mcs.anl.gov><br>
Sent: Thu, 1 Aug 2019 17:36<br>
Subject: Re: [petsc-users] Refine DMPlex with a Refinement Function<br>
<br>

<div id="yiv8776468194">
<div>
<div><br clear="none"></div>

<div><br clear="none">
<div class="yiv8776468194gmail_quote">
<div class="yiv8776468194yqt8233751181" id="yiv8776468194yqtfd74153">
<div class="yiv8776468194gmail_attr" dir="ltr">On Thu, 1 Aug 2019 at 16:59, Daniel Mckinnell via petsc-users <<a rel="noopener noreferrer" shape="rect" ymailto="mailto:petsc-users@mcs.anl.gov" target="_blank" href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:<br clear="none"></div>
<blockquote class="yiv8776468194gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div style="color:black;font:10pt arial;">Hi,
<br clear="none">

<br clear="none">
I have been having some trouble trying to refine a DMPlex object using a 
Refinement Function. I have been working with reference to the code 
discussed here: 
<a rel="noopener noreferrer" shape="rect" class="yiv8776468194m_4722883285617819754moz-txt-link-freetext" target="_blank" href="https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2019-April/038341.html">https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2019-April/038341.html</a> 
including the code from the GitHub directory mentioned. The error I have 
been getting is as follows:
<br clear="none">

<br clear="none">
[0]PETSC ERROR: Argument out of range
<br clear="none">
[0]PETSC ERROR: No grid refiner of dimension 2 registered
<br clear="none">
[0]PETSC ERROR: See <a rel="noopener noreferrer" shape="rect" class="yiv8776468194m_4722883285617819754moz-txt-link-freetext" target="_blank" href="http://www.mcs.anl.gov/petsc/documentation/faq.html">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> 
for trouble shooting.
<br clear="none">
[0]PETSC ERROR: Petsc Release Version 3.11.2, unknown
<br clear="none">
[0]PETSC ERROR: ./fpf on a arch-linux2-c-debug named cromars by daniel 
Thu Aug  1 15:40:18 2019
<br clear="none">
[0]PETSC ERROR: Configure options −−download−f2cblaslapack=yes 
−−with−debugging=1 −−download−metis=yes −−download−parmetis=yes 
−−with−fortran−bindings=0 −−with−python=0 -download-openmpi=1 
−−with−c−support −−with−clanguage=cxx
<br clear="none">
[0]PETSC ERROR: #1 DMPlexRefine_Internal() line 215 in 
/home/daniel/petsc/src/dm/impls/plex/plexadapt.c
<br clear="none">
[0]PETSC ERROR: #2 DMRefine_Plex() line 10381 in 
/home/daniel/petsc/src/dm/impls/plex/plexrefine.c
<br clear="none">
[0]PETSC ERROR: #3 DMRefine() line 1881 in 
/home/daniel/petsc/src/dm/interface/dm</div>
</blockquote></div>

<div><br clear="none"></div>

<div>I suspect you need to configure with --download-triangle? When you mark cells for refinement like this, petsc uses and external package to do the adaptation. </div>

<div><br clear="none"></div>

<div>I'm not sure what options are available as packages, but triangle I think is one. </div>

<div><br clear="none"></div>

<div>Cheers,</div>

<div><br clear="none"></div>

<div>Lawrence</div>

<div class="yiv8776468194yqt8233751181" id="yiv8776468194yqtfd03468"><blockquote class="yiv8776468194gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="color:black;font:10pt arial;"><br clear="none"></div>

</blockquote></div>
</div>
</div>
</div>
</div>
</div>
</div>