Re: [petsc-users] GMSH entities

2024-05-14 Thread Adrian Croucher

hi Matt,

On 15/05/24 6:05 am, Matthew Knepley wrote:

On Tue, May 14, 2024 at 9:07 AM Matthew Knepley  wrote:

On Mon, May 13, 2024 at 10:04 PM Adrian Croucher
 wrote:

On 14/05/24 1:44 pm, Matthew Knepley wrote:


I wish GMsh was clearer about what is optional:
https://urldefense.us/v3/__https://gmsh.info/doc/texinfo/gmsh.html*MSH-file-format__;Iw!!G_uCfscf7eWS!dbZ8R9PicaYRx4Y2IkPxvCoLlJ4lpsMbIAFBKbKZK5h5-2OTX5Ne-AwgOBHv2mJaHqg9uo5orDQYs2PaoAcpDmS65Au1g9uw$ 



They do talk about it, but not exhaustively. GMsh always
writes and $Entities block from what I can tell.
I can make it optional, it just might take until after the
PETSc Meeting.


Looks like $Entities are optional:

https://urldefense.us/v3/__https://gitlab.onelab.info/gmsh/gmsh/-/commit/b5feba2af57181ffa946d3f0c494b014603c6efa__;!!G_uCfscf7eWS!dbZ8R9PicaYRx4Y2IkPxvCoLlJ4lpsMbIAFBKbKZK5h5-2OTX5Ne-AwgOBHv2mJaHqg9uo5orDQYs2PaoAcpDmS65ISaNx6E$ 



I can also load a GMSH 4.1 file without $Entities into GMSH
itself and it doesn't complain, suggesting that they are
indeed optional.

Yes, but they are not careful to specify when a file can be
inconsistent. For instance, omitting the $Entities, but then
specifying entity numbers in the $Nodes block. I think they also
thought this was inconsistent, but then got user complaints. The
minimal example they show does exactly this.

If the $Entities aren't strictly needed for anything in DMPlex
(which I'm guessing they aren't, as the GMSH file format 2.2
doesn't even have them) then it would be useful not to require
them.

I put in some code for this:
https://urldefense.us/v3/__https://gitlab.com/petsc/petsc/-/merge_requests/7546__;!!G_uCfscf7eWS!dbZ8R9PicaYRx4Y2IkPxvCoLlJ4lpsMbIAFBKbKZK5h5-2OTX5Ne-AwgOBHv2mJaHqg9uo5orDQYs2PaoAcpDmS65MnfH9Hr$ 



It just ignores entity numbers when there is no section.


This merged, so now it should be fixed for you.


Thanks, that seems to fix the problem. Great!

Cheers, Adrian

--
Dr Adrian Croucher
Senior Research Fellow
Department of Engineering Science
Waipapa Taumata Rau / University of Auckland, New Zealand
email:a.crouc...@auckland.ac.nz
tel: +64 (0)9 923 4611


Re: [petsc-users] GMSH entities

2024-05-14 Thread Matthew Knepley
On Tue, May 14, 2024 at 9:07 AM Matthew Knepley  wrote:

> On Mon, May 13, 2024 at 10:04 PM Adrian Croucher <
> a.crouc...@auckland.ac.nz> wrote:
>
>> On 14/05/24 1:44 pm, Matthew Knepley wrote:
>>
>> I wish GMsh was clearer about what is optional:
>> https://urldefense.us/v3/__https://gmsh.info/doc/texinfo/gmsh.html*MSH-file-format__;Iw!!G_uCfscf7eWS!fewn3DodeIVBmUE15mfIIEWSAHMhFjmoORD8nz_G4QnsaxhItWNFYbe4Lm0noV3Fuzj8ep504ww-M4Z0oroq$
>>  
>> They do talk about it, but not exhaustively. GMsh always writes and
>> $Entities block from what I can tell.
>> I can make it optional, it just might take until after the PETSc Meeting.
>>
>> Looks like $Entities are optional:
>>
>>
>> https://urldefense.us/v3/__https://gitlab.onelab.info/gmsh/gmsh/-/commit/b5feba2af57181ffa946d3f0c494b014603c6efa__;!!G_uCfscf7eWS!fewn3DodeIVBmUE15mfIIEWSAHMhFjmoORD8nz_G4QnsaxhItWNFYbe4Lm0noV3Fuzj8ep504ww-M57ksfou$
>>  
>>
>> I can also load a GMSH 4.1 file without $Entities into GMSH itself and it
>> doesn't complain, suggesting that they are indeed optional.
>>
>> Yes, but they are not careful to specify when a file can be inconsistent.
> For instance, omitting the $Entities, but then specifying entity numbers in
> the $Nodes block. I think they also thought this was inconsistent, but then
> got user complaints. The minimal example they show does exactly this.
>
>> If the $Entities aren't strictly needed for anything in DMPlex (which I'm
>> guessing they aren't, as the GMSH file format 2.2 doesn't even have them)
>> then it would be useful not to require them.
>>
> I put in some code for this:
> https://urldefense.us/v3/__https://gitlab.com/petsc/petsc/-/merge_requests/7546__;!!G_uCfscf7eWS!fewn3DodeIVBmUE15mfIIEWSAHMhFjmoORD8nz_G4QnsaxhItWNFYbe4Lm0noV3Fuzj8ep504ww-M-tMQE24$
>  
>
> It just ignores entity numbers when there is no section.
>

This merged, so now it should be fixed for you.

  Thanks,

 Matt


>   Thanks,
>
>  Matt
>
>> - Adrian
>>
>> --
>> Dr Adrian Croucher
>> Senior Research Fellow
>> Department of Engineering Science
>> Waipapa Taumata Rau / University of Auckland, New Zealand
>> email: a.crouc...@auckland.ac.nz
>> tel: +64 (0)9 923 4611
>>
>>
>
> --
> 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://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!fewn3DodeIVBmUE15mfIIEWSAHMhFjmoORD8nz_G4QnsaxhItWNFYbe4Lm0noV3Fuzj8ep504ww-M7SPCKFm$
>  
>   >
>


-- 
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://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!fewn3DodeIVBmUE15mfIIEWSAHMhFjmoORD8nz_G4QnsaxhItWNFYbe4Lm0noV3Fuzj8ep504ww-M7SPCKFm$
  



Re: [petsc-users] GMSH entities

2024-05-14 Thread Matthew Knepley
On Mon, May 13, 2024 at 10:04 PM Adrian Croucher 
wrote:

> On 14/05/24 1:44 pm, Matthew Knepley wrote:
>
> I wish GMsh was clearer about what is optional:
> https://urldefense.us/v3/__https://gmsh.info/doc/texinfo/gmsh.html*MSH-file-format__;Iw!!G_uCfscf7eWS!YJN5how37EbmfjwDvfPAsVSCQdWejJn8symxZ83hj94omk6Mh9imh2qOrFqZbsZRM_3W3G5YIn5lZK2KzQlj$
>  
> They do talk about it, but not exhaustively. GMsh always writes and
> $Entities block from what I can tell.
> I can make it optional, it just might take until after the PETSc Meeting.
>
> Looks like $Entities are optional:
>
>
> https://urldefense.us/v3/__https://gitlab.onelab.info/gmsh/gmsh/-/commit/b5feba2af57181ffa946d3f0c494b014603c6efa__;!!G_uCfscf7eWS!YJN5how37EbmfjwDvfPAsVSCQdWejJn8symxZ83hj94omk6Mh9imh2qOrFqZbsZRM_3W3G5YIn5lZMbTrLlQ$
>  
>
> I can also load a GMSH 4.1 file without $Entities into GMSH itself and it
> doesn't complain, suggesting that they are indeed optional.
>
> Yes, but they are not careful to specify when a file can be inconsistent.
For instance, omitting the $Entities, but then specifying entity numbers in
the $Nodes block. I think they also thought this was inconsistent, but then
got user complaints. The minimal example they show does exactly this.

> If the $Entities aren't strictly needed for anything in DMPlex (which I'm
> guessing they aren't, as the GMSH file format 2.2 doesn't even have them)
> then it would be useful not to require them.
>
I put in some code for this:
https://urldefense.us/v3/__https://gitlab.com/petsc/petsc/-/merge_requests/7546__;!!G_uCfscf7eWS!YJN5how37EbmfjwDvfPAsVSCQdWejJn8symxZ83hj94omk6Mh9imh2qOrFqZbsZRM_3W3G5YIn5lZHVFZ3e3$
 

It just ignores entity numbers when there is no section.

  Thanks,

 Matt

> - Adrian
>
> --
> Dr Adrian Croucher
> Senior Research Fellow
> Department of Engineering Science
> Waipapa Taumata Rau / University of Auckland, New Zealand
> email: a.crouc...@auckland.ac.nz
> tel: +64 (0)9 923 4611
>
>

-- 
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://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!YJN5how37EbmfjwDvfPAsVSCQdWejJn8symxZ83hj94omk6Mh9imh2qOrFqZbsZRM_3W3G5YIn5lZFEALcjs$
  



Re: [petsc-users] GMSH entities

2024-05-13 Thread Adrian Croucher

On 14/05/24 1:44 pm, Matthew Knepley wrote:

I wish GMsh was clearer about what is optional: 
https://urldefense.us/v3/__https://gmsh.info/doc/texinfo/gmsh.html*MSH-file-format__;Iw!!G_uCfscf7eWS!aCypJMAzwWHAJLXGNJmSthDjbHcU-8_MdsaXZ4d1r1RKyL0bqIv5ZuLmQtV6ve4XcTjapf38-bsdDOLEDAlhWoaaGpmjDCYs$  
 

They do talk about it, but not exhaustively. GMsh always writes and 
$Entities block from what I can tell.

I can make it optional, it just might take until after the PETSc Meeting.


Looks like $Entities are optional:

https://urldefense.us/v3/__https://gitlab.onelab.info/gmsh/gmsh/-/commit/b5feba2af57181ffa946d3f0c494b014603c6efa__;!!G_uCfscf7eWS!aCypJMAzwWHAJLXGNJmSthDjbHcU-8_MdsaXZ4d1r1RKyL0bqIv5ZuLmQtV6ve4XcTjapf38-bsdDOLEDAlhWoaaGjNKbSSU$ 

I can also load a GMSH 4.1 file without $Entities into GMSH itself and 
it doesn't complain, suggesting that they are indeed optional.


If the $Entities aren't strictly needed for anything in DMPlex (which 
I'm guessing they aren't, as the GMSH file format 2.2 doesn't even have 
them) then it would be useful not to require them.


- Adrian

--
Dr Adrian Croucher
Senior Research Fellow
Department of Engineering Science
Waipapa Taumata Rau / University of Auckland, New Zealand
email:a.crouc...@auckland.ac.nz
tel: +64 (0)9 923 4611


Re: [petsc-users] GMSH entities

2024-05-13 Thread Matthew Knepley
On Mon, May 13, 2024 at 9:33 PM Adrian Croucher 
wrote:

> hi, We often create meshes in GMSH format using the meshio library. This
> works OK if we stick to GMSH file format 2. 2. If we use GMSH file format
> 4. 1, DMPlex can't read them because it expects the "Entities" section to
> be present: [0]PETSC
> ZjQcmQRYFpfptBannerStart
> This Message Is From an External Sender
> This message came from outside your organization.
>
> ZjQcmQRYFpfptBannerEnd
>
> hi,
>
> We often create meshes in GMSH format using the meshio library. This
> works OK if we stick to GMSH file format 2.2.
>
> If we use GMSH file format 4.1, DMPlex can't read them because it
> expects the "Entities" section to be present:
>
> [0]PETSC ERROR: Unexpected data in file
> [0]PETSC ERROR: File is not a valid Gmsh file, expecting $Entities, not
> $Nodes
> [0]PETSC ERROR: See 
> https://urldefense.us/v3/__https://petsc.org/release/faq/__;!!G_uCfscf7eWS!ZfBS1KM5EBZ7ZJIu6lBKFcclVMmXteXsW8m9HBEZ5tIf0u_3duEFt9eXKF7FcorQSAQqD5SbJrYh4C8rX676S_IMI_sp6naX$
>  for trouble shooting.
> [0]PETSC ERROR: Petsc Development GIT revision:
> v3.21.1-124-g2d06e2faec8  GIT Date: 2024-05-08 19:31:33 +
> [0]PETSC ERROR: waiwera on a main-debug named EN438880 by acro018 Tue
> May 14 11:25:54 2024
> [0]PETSC ERROR: Configure options --with-x --download-hdf5
> --download-zlib --download-netcdf --download-pnetcdf --download-exodusii
> --download-triangle --download-ptscotch --download-chaco --download-hypre
> [0]PETSC ERROR: #1 GmshExpect() at
> /home/acro018/software/PETSc/code/src/dm/impls/plex/plexgmsh.c:270
> [0]PETSC ERROR: #2 DMPlexCreateGmsh() at
> /home/acro018/software/PETSc/code/src/dm/impls/plex/plexgmsh.c:1608
> [0]PETSC ERROR: #3 DMPlexCreateGmshFromFile() at
> /home/acro018/software/PETSc/code/src/dm/impls/plex/plexgmsh.c:1469
> [0]PETSC ERROR: #4 DMPlexCreateFromFile() at
> /home/acro018/software/PETSc/code/src/dm/impls/plex/plexcreate.c:5804
>
> By default meshio doesn't seem to write the Entities section. From what
> I can gather, it is optional.
>
> Am I right that this section is not optional in DMPlex?
>
>
I wish GMsh was clearer about what is optional:
https://urldefense.us/v3/__https://gmsh.info/doc/texinfo/gmsh.html*MSH-file-format__;Iw!!G_uCfscf7eWS!fS2tI8aC3rUnGOv-LbLPj1PRyijAPB-EO54CwUBP6pNFD-VKeGE98pOHepNMSTP_krHBKTZNk92Bx01NrC-T$
 
They do talk about it, but not exhaustively. GMsh always writes and
$Entities block from what I can tell.
I can make it optional, it just might take until after the PETSc Meeting.

  Thanks,

Matt

- Adrian
>
> --
> Dr Adrian Croucher
> Senior Research Fellow
> Department of Engineering Science
> Waipapa Taumata Rau / University of Auckland, New Zealand
> email: a.crouc...@auckland.ac.nz
> tel: +64 (0)9 923 4611
>
>
>

-- 
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://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!fS2tI8aC3rUnGOv-LbLPj1PRyijAPB-EO54CwUBP6pNFD-VKeGE98pOHepNMSTP_krHBKTZNk92Bx1gj7y2J$