[petsc-users] DMPlex CGNS import

Valerio Barnabei valerio.barnabei at gmail.com
Fri Jun 8 14:01:44 CDT 2018


Thank you Matt for your advice, i will let you know if something pops out
from the mist.


Il 08 giu 2018 20:49, "Matthew Knepley" <knepley at gmail.com> ha scritto:

On Fri, Jun 8, 2018 at 8:45 AM, Valerio Barnabei <valerio.barnabei at gmail.com
> wrote:

> 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
>>
>
CGNS support stinks because I never used it and no one else has requested
it. Also the format is not workable in parallel.
Here is the code


https://bitbucket.org/petsc/petsc/src/58edc67f565b6826877b6037e2237b6b17930a07/src/dm/impls/plex/plexcgns.c#lines-149

You can see I am just asking CGNS how many sections it has in the the zone.
I do not really know
what a section is, so I am limiting it to one section. The files you have
must have multiple sections
for reason that are not clear to me.

Here are some meshes I can read:

  https://bitbucket.org/petsc/petsc/src/master/share/petsc/datafiles/meshes/

  Thanks,

    Matt

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
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.caam.rice.edu/~mk51/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180608/f82279b1/attachment-0001.html>


More information about the petsc-users mailing list