Re: [petsc-users] DMPlex and CGNS

2023-01-17 Thread Jed Brown
Copying my private reply that appeared off-list. If you have one base with 
different element types, that's in scope for what I plan to develop soon.

Congrats, you crashed cgnsview.

$ cgnsview dl/HybridGrid.cgns
Error in startup script: file was not found
while executing
"CGNSfile $ProgData(file)"
(procedure "file_stats" line 4)
invoked from within
"file_stats"
(procedure "file_load" line 53)
invoked from within
"file_load $fname"
invoked from within
"if {$argc} {
  set fname [lindex $argv [expr $argc - 1]]
  if {[file isfile $fname] && [file readable $fname]} {
file_load $fname
  }
}"
(file "/usr/share/cgnstools/cgnsview.tcl" line 3013)

This file looks okay in cgnscheck and paraview, but I don't have a need for 
multi-block and I'm stretched really thin so probably won't make it work any 
time soon. But if
you make a single block with HexElements alongside PyramidElements and 
TetElements, I should be able to read it. If you don't mind prepping such a 
file (this size or
smaller), it would help me test.


"Engblom, William A."  writes:

> Jesus,
>
> The CGNS files we get from Pointwise have only one base, so that should not 
> be an issue.  However, sections are needed to contain each cell type, the 
> BCs, and zonal boundaries. So, there are always several sections.  The grid 
> that Spencer made for you must have multiple sections.  We have to be able to 
> deal with grids like Spencer's example or else it's not useful.
>
> B.
>
>
>
>
>
>
> 
> From: Ferrand, Jesus A. 
> Sent: Monday, January 16, 2023 5:41 PM
> To: petsc-users@mcs.anl.gov 
> Subject: DMPlex and CGNS
>
> Dear PETSc team:
>
> I would like to use DMPlex to partition a mesh stored as a CGNS file. I 
> configured my installation with --download_cgns = 1, got me a .cgns file and 
> called DMPlexCreateCGNSFromFile() on it. Doing so got me this error:
>
> [0]PETSC ERROR: - Error Message 
> --
> [0]PETSC ERROR: Error in external library
> [0]PETSC ERROR: CGNS file must have a single section, not 4
> [0]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting.
> [0]PETSC ERROR: Petsc Release Version 3.18.3, unknown
> [0]PETSC ERROR: ./program.exe on a arch-linux-c-debug named F86 by jesus Mon 
> Jan 16 17:25:11 2023
> [0]PETSC ERROR: Configure options --download-mpich=yes --download-hdf5=yes 
> --download-cgns=yes --download-metis=yes --download-parmetis=yes 
> --download-ptscotch=yes --download-chaco=yes --with-32bits-pci-domain=1
> [0]PETSC ERROR: #1 DMPlexCreateCGNS_Internal() at 
> /home/jesus/Desktop/JAF_NML/3rd_Party/PETSc/petsc/src/dm/impls/plex/cgns/plexcgns2.c:104
> [0]PETSC ERROR: #2 DMPlexCreateCGNS() at 
> /home/jesus/Desktop/JAF_NML/3rd_Party/PETSc/petsc/src/dm/impls/plex/plexcgns.c:60
> [0]PETSC ERROR: #3 DMPlexCreateCGNSFromFile_Internal() at 
> /home/jesus/Desktop/JAF_NML/3rd_Party/PETSc/petsc/src/dm/impls/plex/cgns/plexcgns2.c:27
> [0]PETSC ERROR: #4 DMPlexCreateCGNSFromFile() at 
> /home/jesus/Desktop/JAF_NML/3rd_Party/PETSc/petsc/src/dm/impls/plex/plexcgns.c:29
>
> I looked around mail archives for clused and found this one 
> (https://lists.mcs.anl.gov/pipermail/petsc-users/2018-June/035544.html). 
> There, Matt provides a link to the source code for DMPlexCreateCGNSFromFile() 
> and another (seemingly broken) link to CGNS files that can be opened with the 
> former.  After reading the source code I now understand that it is hardcoded 
> for CGNS files that feature a single "base" and a single "section", whatever 
> those are.
>
> After navigating the CGNS documentation, I can sympathize with the comments 
> in the source code.
>
> Anyhow, I wanted to ask if I could be furnished with one such CGNS file that 
> is compatible with DMPlexCreateCGNSFromFile() to see if I can modify my CGNS 
> files to conform to it. If not, I will look into building the DAG myself 
> using DMPlex APIs.
>
>
> Sincerely:
>
> J.A. Ferrand
>
> Embry-Riddle Aeronautical University - Daytona Beach FL
>
> M.Sc. Aerospace Engineering
>
> B.Sc. Aerospace Engineering
>
> B.Sc. Computational Mathematics
>
>
> Phone: (386)-843-1829
>
> Email(s): ferra...@my.erau.edu
>
> jesus.ferr...@gmail.com


Re: [petsc-users] DMPlex and CGNS

2023-01-17 Thread Engblom, William A.
Jesus,

The CGNS files we get from Pointwise have only one base, so that should not be 
an issue.  However, sections are needed to contain each cell type, the BCs, and 
zonal boundaries. So, there are always several sections.  The grid that Spencer 
made for you must have multiple sections.  We have to be able to deal with 
grids like Spencer's example or else it's not useful.

B.







From: Ferrand, Jesus A. 
Sent: Monday, January 16, 2023 5:41 PM
To: petsc-users@mcs.anl.gov 
Subject: DMPlex and CGNS

Dear PETSc team:

I would like to use DMPlex to partition a mesh stored as a CGNS file. I 
configured my installation with --download_cgns = 1, got me a .cgns file and 
called DMPlexCreateCGNSFromFile() on it. Doing so got me this error:

[0]PETSC ERROR: - Error Message 
--
[0]PETSC ERROR: Error in external library
[0]PETSC ERROR: CGNS file must have a single section, not 4
[0]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting.
[0]PETSC ERROR: Petsc Release Version 3.18.3, unknown
[0]PETSC ERROR: ./program.exe on a arch-linux-c-debug named F86 by jesus Mon 
Jan 16 17:25:11 2023
[0]PETSC ERROR: Configure options --download-mpich=yes --download-hdf5=yes 
--download-cgns=yes --download-metis=yes --download-parmetis=yes 
--download-ptscotch=yes --download-chaco=yes --with-32bits-pci-domain=1
[0]PETSC ERROR: #1 DMPlexCreateCGNS_Internal() at 
/home/jesus/Desktop/JAF_NML/3rd_Party/PETSc/petsc/src/dm/impls/plex/cgns/plexcgns2.c:104
[0]PETSC ERROR: #2 DMPlexCreateCGNS() at 
/home/jesus/Desktop/JAF_NML/3rd_Party/PETSc/petsc/src/dm/impls/plex/plexcgns.c:60
[0]PETSC ERROR: #3 DMPlexCreateCGNSFromFile_Internal() at 
/home/jesus/Desktop/JAF_NML/3rd_Party/PETSc/petsc/src/dm/impls/plex/cgns/plexcgns2.c:27
[0]PETSC ERROR: #4 DMPlexCreateCGNSFromFile() at 
/home/jesus/Desktop/JAF_NML/3rd_Party/PETSc/petsc/src/dm/impls/plex/plexcgns.c:29

I looked around mail archives for clused and found this one 
(https://lists.mcs.anl.gov/pipermail/petsc-users/2018-June/035544.html). There, 
Matt provides a link to the source code for DMPlexCreateCGNSFromFile() and 
another (seemingly broken) link to CGNS files that can be opened with the 
former.  After reading the source code I now understand that it is hardcoded 
for CGNS files that feature a single "base" and a single "section", whatever 
those are.

After navigating the CGNS documentation, I can sympathize with the comments in 
the source code.

Anyhow, I wanted to ask if I could be furnished with one such CGNS file that is 
compatible with DMPlexCreateCGNSFromFile() to see if I can modify my CGNS files 
to conform to it. If not, I will look into building the DAG myself using DMPlex 
APIs.


Sincerely:

J.A. Ferrand

Embry-Riddle Aeronautical University - Daytona Beach FL

M.Sc. Aerospace Engineering

B.Sc. Aerospace Engineering

B.Sc. Computational Mathematics


Phone: (386)-843-1829

Email(s): ferra...@my.erau.edu

jesus.ferr...@gmail.com


Re: [petsc-users] DMPlex and CGNS

2023-01-16 Thread Jed Brown
Matthew Knepley  writes:

> On Mon, Jan 16, 2023 at 6:15 PM Jed Brown  wrote:
>
>> How soon do you need this? I understand the grumbling about CGNS, but it's
>> easy to build, uses HDF5 parallel IO in a friendly way, supports high order
>> elements, and is generally pretty expressive. I wrote a parallel writer
>> (with some limitations that I'll remove) and plan to replace the current
>> reader with a parallel reader because I have need to read big CGNS meshes.
>> Alas, my semester is starting so it's hard to make promises, but this is a
>> high priority for my research group and if you share your mesh file, I hope
>> to be able to make the parallel reader work in the next couple weeks.
>>
>
> The biggest hurdle for me is understanding the CGNS format. If you can tell
> me what is going on, I can help write the Plex code that
> interprets it.

I wrote the parallel writer and I'm pretty familiar with the data model. Let's 
connect in chat.


Re: [petsc-users] DMPlex and CGNS

2023-01-16 Thread Matthew Knepley
On Mon, Jan 16, 2023 at 6:15 PM Jed Brown  wrote:

> How soon do you need this? I understand the grumbling about CGNS, but it's
> easy to build, uses HDF5 parallel IO in a friendly way, supports high order
> elements, and is generally pretty expressive. I wrote a parallel writer
> (with some limitations that I'll remove) and plan to replace the current
> reader with a parallel reader because I have need to read big CGNS meshes.
> Alas, my semester is starting so it's hard to make promises, but this is a
> high priority for my research group and if you share your mesh file, I hope
> to be able to make the parallel reader work in the next couple weeks.
>

The biggest hurdle for me is understanding the CGNS format. If you can tell
me what is going on, I can help write the Plex code that
interprets it.

  Thanks,

Matt


> "Ferrand, Jesus A."  writes:
>
> > Dear PETSc team:
> >
> > I would like to use DMPlex to partition a mesh stored as a CGNS file. I
> configured my installation with --download_cgns = 1, got me a .cgns file
> and called DMPlexCreateCGNSFromFile() on it. Doing so got me this error:
> >
> > [0]PETSC ERROR: - Error Message
> --
> > [0]PETSC ERROR: Error in external library
> > [0]PETSC ERROR: CGNS file must have a single section, not 4
> > [0]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting.
> > [0]PETSC ERROR: Petsc Release Version 3.18.3, unknown
> > [0]PETSC ERROR: ./program.exe on a arch-linux-c-debug named F86 by jesus
> Mon Jan 16 17:25:11 2023
> > [0]PETSC ERROR: Configure options --download-mpich=yes
> --download-hdf5=yes --download-cgns=yes --download-metis=yes
> --download-parmetis=yes --download-ptscotch=yes --download-chaco=yes
> --with-32bits-pci-domain=1
> > [0]PETSC ERROR: #1 DMPlexCreateCGNS_Internal() at
> /home/jesus/Desktop/JAF_NML/3rd_Party/PETSc/petsc/src/dm/impls/plex/cgns/plexcgns2.c:104
> > [0]PETSC ERROR: #2 DMPlexCreateCGNS() at
> /home/jesus/Desktop/JAF_NML/3rd_Party/PETSc/petsc/src/dm/impls/plex/plexcgns.c:60
> > [0]PETSC ERROR: #3 DMPlexCreateCGNSFromFile_Internal() at
> /home/jesus/Desktop/JAF_NML/3rd_Party/PETSc/petsc/src/dm/impls/plex/cgns/plexcgns2.c:27
> > [0]PETSC ERROR: #4 DMPlexCreateCGNSFromFile() at
> /home/jesus/Desktop/JAF_NML/3rd_Party/PETSc/petsc/src/dm/impls/plex/plexcgns.c:29
> >
> > I looked around mail archives for clused and found this one (
> https://lists.mcs.anl.gov/pipermail/petsc-users/2018-June/035544.html).
> There, Matt provides a link to the source code for
> DMPlexCreateCGNSFromFile() and another (seemingly broken) link to CGNS
> files that can be opened with the former.  After reading the source code I
> now understand that it is hardcoded for CGNS files that feature a single
> "base" and a single "section", whatever those are.
> >
> > After navigating the CGNS documentation, I can sympathize with the
> comments in the source code.
> >
> > Anyhow, I wanted to ask if I could be furnished with one such CGNS file
> that is compatible with DMPlexCreateCGNSFromFile() to see if I can modify
> my CGNS files to conform to it. If not, I will look into building the DAG
> myself using DMPlex APIs.
> >
> >
> > Sincerely:
> >
> > J.A. Ferrand
> >
> > Embry-Riddle Aeronautical University - Daytona Beach FL
> >
> > M.Sc. Aerospace Engineering
> >
> > B.Sc. Aerospace Engineering
> >
> > B.Sc. Computational Mathematics
> >
> >
> > Phone: (386)-843-1829
> >
> > Email(s): ferra...@my.erau.edu
> >
> > jesus.ferr...@gmail.com
>


-- 
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/ 


Re: [petsc-users] DMPlex and CGNS

2023-01-16 Thread Jed Brown
How soon do you need this? I understand the grumbling about CGNS, but it's easy 
to build, uses HDF5 parallel IO in a friendly way, supports high order 
elements, and is generally pretty expressive. I wrote a parallel writer (with 
some limitations that I'll remove) and plan to replace the current reader with 
a parallel reader because I have need to read big CGNS meshes. Alas, my 
semester is starting so it's hard to make promises, but this is a high priority 
for my research group and if you share your mesh file, I hope to be able to 
make the parallel reader work in the next couple weeks.

"Ferrand, Jesus A."  writes:

> Dear PETSc team:
>
> I would like to use DMPlex to partition a mesh stored as a CGNS file. I 
> configured my installation with --download_cgns = 1, got me a .cgns file and 
> called DMPlexCreateCGNSFromFile() on it. Doing so got me this error:
>
> [0]PETSC ERROR: - Error Message 
> --
> [0]PETSC ERROR: Error in external library
> [0]PETSC ERROR: CGNS file must have a single section, not 4
> [0]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting.
> [0]PETSC ERROR: Petsc Release Version 3.18.3, unknown
> [0]PETSC ERROR: ./program.exe on a arch-linux-c-debug named F86 by jesus Mon 
> Jan 16 17:25:11 2023
> [0]PETSC ERROR: Configure options --download-mpich=yes --download-hdf5=yes 
> --download-cgns=yes --download-metis=yes --download-parmetis=yes 
> --download-ptscotch=yes --download-chaco=yes --with-32bits-pci-domain=1
> [0]PETSC ERROR: #1 DMPlexCreateCGNS_Internal() at 
> /home/jesus/Desktop/JAF_NML/3rd_Party/PETSc/petsc/src/dm/impls/plex/cgns/plexcgns2.c:104
> [0]PETSC ERROR: #2 DMPlexCreateCGNS() at 
> /home/jesus/Desktop/JAF_NML/3rd_Party/PETSc/petsc/src/dm/impls/plex/plexcgns.c:60
> [0]PETSC ERROR: #3 DMPlexCreateCGNSFromFile_Internal() at 
> /home/jesus/Desktop/JAF_NML/3rd_Party/PETSc/petsc/src/dm/impls/plex/cgns/plexcgns2.c:27
> [0]PETSC ERROR: #4 DMPlexCreateCGNSFromFile() at 
> /home/jesus/Desktop/JAF_NML/3rd_Party/PETSc/petsc/src/dm/impls/plex/plexcgns.c:29
>
> I looked around mail archives for clused and found this one 
> (https://lists.mcs.anl.gov/pipermail/petsc-users/2018-June/035544.html). 
> There, Matt provides a link to the source code for DMPlexCreateCGNSFromFile() 
> and another (seemingly broken) link to CGNS files that can be opened with the 
> former.  After reading the source code I now understand that it is hardcoded 
> for CGNS files that feature a single "base" and a single "section", whatever 
> those are.
>
> After navigating the CGNS documentation, I can sympathize with the comments 
> in the source code.
>
> Anyhow, I wanted to ask if I could be furnished with one such CGNS file that 
> is compatible with DMPlexCreateCGNSFromFile() to see if I can modify my CGNS 
> files to conform to it. If not, I will look into building the DAG myself 
> using DMPlex APIs.
>
>
> Sincerely:
>
> J.A. Ferrand
>
> Embry-Riddle Aeronautical University - Daytona Beach FL
>
> M.Sc. Aerospace Engineering
>
> B.Sc. Aerospace Engineering
>
> B.Sc. Computational Mathematics
>
>
> Phone: (386)-843-1829
>
> Email(s): ferra...@my.erau.edu
>
> jesus.ferr...@gmail.com


[petsc-users] DMPlex and CGNS

2023-01-16 Thread Ferrand, Jesus A.
Dear PETSc team:

I would like to use DMPlex to partition a mesh stored as a CGNS file. I 
configured my installation with --download_cgns = 1, got me a .cgns file and 
called DMPlexCreateCGNSFromFile() on it. Doing so got me this error:

[0]PETSC ERROR: - Error Message 
--
[0]PETSC ERROR: Error in external library
[0]PETSC ERROR: CGNS file must have a single section, not 4
[0]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting.
[0]PETSC ERROR: Petsc Release Version 3.18.3, unknown
[0]PETSC ERROR: ./program.exe on a arch-linux-c-debug named F86 by jesus Mon 
Jan 16 17:25:11 2023
[0]PETSC ERROR: Configure options --download-mpich=yes --download-hdf5=yes 
--download-cgns=yes --download-metis=yes --download-parmetis=yes 
--download-ptscotch=yes --download-chaco=yes --with-32bits-pci-domain=1
[0]PETSC ERROR: #1 DMPlexCreateCGNS_Internal() at 
/home/jesus/Desktop/JAF_NML/3rd_Party/PETSc/petsc/src/dm/impls/plex/cgns/plexcgns2.c:104
[0]PETSC ERROR: #2 DMPlexCreateCGNS() at 
/home/jesus/Desktop/JAF_NML/3rd_Party/PETSc/petsc/src/dm/impls/plex/plexcgns.c:60
[0]PETSC ERROR: #3 DMPlexCreateCGNSFromFile_Internal() at 
/home/jesus/Desktop/JAF_NML/3rd_Party/PETSc/petsc/src/dm/impls/plex/cgns/plexcgns2.c:27
[0]PETSC ERROR: #4 DMPlexCreateCGNSFromFile() at 
/home/jesus/Desktop/JAF_NML/3rd_Party/PETSc/petsc/src/dm/impls/plex/plexcgns.c:29

I looked around mail archives for clused and found this one 
(https://lists.mcs.anl.gov/pipermail/petsc-users/2018-June/035544.html). There, 
Matt provides a link to the source code for DMPlexCreateCGNSFromFile() and 
another (seemingly broken) link to CGNS files that can be opened with the 
former.  After reading the source code I now understand that it is hardcoded 
for CGNS files that feature a single "base" and a single "section", whatever 
those are.

After navigating the CGNS documentation, I can sympathize with the comments in 
the source code.

Anyhow, I wanted to ask if I could be furnished with one such CGNS file that is 
compatible with DMPlexCreateCGNSFromFile() to see if I can modify my CGNS files 
to conform to it. If not, I will look into building the DAG myself using DMPlex 
APIs.


Sincerely:

J.A. Ferrand

Embry-Riddle Aeronautical University - Daytona Beach FL

M.Sc. Aerospace Engineering

B.Sc. Aerospace Engineering

B.Sc. Computational Mathematics


Phone: (386)-843-1829

Email(s): ferra...@my.erau.edu

jesus.ferr...@gmail.com