1 #define PETSCDM_DLL 2 #include <petsc/private/dmpleximpl.h> /*I "petscdmplex.h" I*/ 3 4 /*@C 5 DMPlexCreateCGNS - Create a DMPlex mesh from a CGNS file. 6 7 Collective 8 9 Input Parameters: 10 + comm - The MPI communicator 11 . filename - The name of the CGNS file 12 - interpolate - Create faces and edges in the mesh 13 14 Output Parameter: 15 . dm - The DM object representing the mesh 16 17 Note: https://cgns.github.io 18 19 Level: beginner 20 21 .seealso: `DMPlexCreate()`, `DMPlexCreateCGNS()`, `DMPlexCreateExodus()` 22 @*/ 23 PetscErrorCode DMPlexCreateCGNSFromFile(MPI_Comm comm, const char filename[], PetscBool interpolate, DM *dm) 24 { 25 PetscFunctionBegin; 26 PetscValidCharPointer(filename, 2); 27 #if defined(PETSC_HAVE_CGNS) 28 PetscCall(DMPlexCreateCGNSFromFile_Internal(comm, filename, interpolate, dm)); 29 #else 30 SETERRQ(comm, PETSC_ERR_SUP, "Loading meshes requires CGNS support. Reconfigure using --with-cgns-dir"); 31 #endif 32 PetscFunctionReturn(0); 33 } 34 35 /*@ 36 DMPlexCreateCGNS - Create a DMPlex mesh from a CGNS file ID. 37 38 Collective 39 40 Input Parameters: 41 + comm - The MPI communicator 42 . cgid - The CG id associated with a file and obtained using cg_open 43 - interpolate - Create faces and edges in the mesh 44 45 Output Parameter: 46 . dm - The DM object representing the mesh 47 48 Note: https://cgns.github.io 49 50 Level: beginner 51 52 .seealso: `DMPlexCreate()`, `DMPlexCreateExodus()` 53 @*/ 54 PetscErrorCode DMPlexCreateCGNS(MPI_Comm comm, PetscInt cgid, PetscBool interpolate, DM *dm) 55 { 56 PetscFunctionBegin; 57 #if defined(PETSC_HAVE_CGNS) 58 PetscCall(DMPlexCreateCGNS_Internal(comm, cgid, interpolate, dm)); 59 #else 60 SETERRQ(comm, PETSC_ERR_SUP, "Loading meshes requires CGNS support. Reconfigure using --download-cgns"); 61 #endif 62 PetscFunctionReturn(0); 63 } 64