<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jun 8, 2018 at 8:45 AM, Valerio Barnabei <span dir="ltr"><<a href="mailto:valerio.barnabei@gmail.com" target="_blank">valerio.barnabei@gmail.com</a>></span> wrote:<br><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>Hello,</div><div>I'm trying to import a simple CGNS file representing a simple 3D unstructured box, but i keep getting the same error:</div><div><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>[0]PETSC ERROR: Error in external library<br>[0]PETSC ERROR: CGNS file must have a single section, not 2</div></blockquote></div></blockquote><div><br></div><div>CGNS support stinks because I never used it and no one else has requested it. Also the format is not workable in parallel.</div><div>Here is the code</div><div><br></div><div>  <a href="https://bitbucket.org/petsc/petsc/src/58edc67f565b6826877b6037e2237b6b17930a07/src/dm/impls/plex/plexcgns.c#lines-149">https://bitbucket.org/petsc/petsc/src/58edc67f565b6826877b6037e2237b6b17930a07/src/dm/impls/plex/plexcgns.c#lines-149</a></div><div><br></div><div>You can see I am just asking CGNS how many sections it has in the the zone. I do not really know</div><div>what a section is, so I am limiting it to one section. The files you have must have multiple sections</div><div>for reason that are not clear to me.</div><div><br></div><div>Here are some meshes I can read:</div><div><br></div><div>  <a href="https://bitbucket.org/petsc/petsc/src/master/share/petsc/datafiles/meshes/">https://bitbucket.org/petsc/petsc/src/master/share/petsc/datafiles/meshes/</a></div><div><br></div><div>  Thanks,</div><div><br></div><div>    Matt</div><div><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>I'm using the following script:</div><div><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><br></div><div>#include <petscdmplex.h><br>#include <cgnslib.h><br><br><br>int main(int argc, char **argv){<br>    <br>    char MeshFileName[2048];<br>    MPI_Comm comm;<br>    DM dm;<br>    PetscErrorCode ierr;<br>    PetscBool flg;<br>    <br>    ierr = PetscInitialize(&argc, &argv, NULL,NULL);if (ierr) return ierr;<br>    ierr = PetscOptionsGetString(NULL,<wbr>NULL,"-file",MeshFileName,<wbr>sizeof(MeshFileName),&flg);<wbr>CHKERRQ(ierr);<br>    comm= PETSC_COMM_WORLD;<br>    if(!flg){<br>               SETERRQ(comm,PETSC_ERR_ARG_<wbr>NULL,"please specify a fine mesh file \n");<br>    };<br><br>    ierr = DMPlexCreateCGNSFromFile(comm, MeshFileName, PETSC_FALSE, &dm);CHKERRQ(ierr);<br>   <br>    ierr = DMDestroy(&dm);CHKERRQ(ierr);<br>    ierr = PetscFinalize();CHKERRQ(ierr);<br><br>return ierr;<br>}<br></div></blockquote><div><br></div><div><br></div><div>I'm not using a multiblock mesh, i just created a single unstructured block volume in pointwise, exported as adf (using hdf i got a crash during file opening so i switched). I tried with different exportation options (node to node, cell to cell, face to face) but nothing seems to work.</div><div>I got the same identical error also downloading files from official CGNS site:</div><div><a href="http://cgns.sourceforge.net/CGNSFiles.html" target="_blank">http://cgns.sourceforge.net/<wbr>CGNSFiles.html</a></div><div>It's obvious there's something I'm missing. <br></div><div><br></div><div>-Where is my mistake?</div><div>-Is there any notable limitation in the importation of CGNS file? (e.g. multiblock files can't be imported as dmplex objects)<br></div><div><br></div><div>Thanks in advance for your kind help.</div><span class="gmail-HOEnZb"><font color="#888888"><div><br></div><div>Valerio<br></div></font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><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.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div>
</div></div>