[petsc-users] DMPlex CGNS import

Valerio Barnabei valerio.barnabei at gmail.com
Fri Jun 8 07:45:02 CDT 2018


Hello,
I'm trying to import a simple CGNS file representing a simple 3D
unstructured box, but i keep getting the same error:

[0]PETSC ERROR: Error in external library
> [0]PETSC ERROR: CGNS file must have a single section, not 2
>

I'm using the following script:


> #include <petscdmplex.h>
> #include <cgnslib.h>
>
>
> int main(int argc, char **argv){
>
>     char MeshFileName[2048];
>     MPI_Comm comm;
>     DM dm;
>     PetscErrorCode ierr;
>     PetscBool flg;
>
>     ierr = PetscInitialize(&argc, &argv, NULL,NULL);if (ierr) return ierr;
>     ierr =
> PetscOptionsGetString(NULL,NULL,"-file",MeshFileName,sizeof(MeshFileName),&flg);CHKERRQ(ierr);
>     comm= PETSC_COMM_WORLD;
>     if(!flg){
>                SETERRQ(comm,PETSC_ERR_ARG_NULL,"please specify a fine mesh
> file \n");
>     };
>
>     ierr = DMPlexCreateCGNSFromFile(comm, MeshFileName, PETSC_FALSE,
> &dm);CHKERRQ(ierr);
>
>     ierr = DMDestroy(&dm);CHKERRQ(ierr);
>     ierr = PetscFinalize();CHKERRQ(ierr);
>
> return ierr;
> }
>


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.
I got the same identical error also downloading files from official CGNS
site:
http://cgns.sourceforge.net/CGNSFiles.html
It's obvious there's something I'm missing.

-Where is my mistake?
-Is there any notable limitation in the importation of CGNS file? (e.g.
multiblock files can't be imported as dmplex objects)

Thanks in advance for your kind help.

Valerio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180608/596ab7e0/attachment.html>


More information about the petsc-users mailing list