[petsc-dev] GMSH reader and vertex sets

Matthew Knepley knepley at gmail.com
Thu Mar 9 18:42:10 CST 2023


On Thu, Mar 9, 2023 at 3:38 PM Blaise Bourdin <bourdin at mcmaster.ca> wrote:

> Hi,
>
> I am encountering an issue with the GMSH reader which seems to ignore
> vertex sets. I am attaching a small c example, as well as two meshes, both
> contain cell, face, and vertex sets, but somehow the vertex sets are not
> read by the GMSH reader.
> I am particularly confused since the plexgmsh.c seems to have code to
> handle vertex sets.
>

I will run this, but could you quickly test
whether -dm_plex_gmsh_mark_vertices fixes this? The old behavior was to
ignore vertex
sets (for reasons I do not understand but Lisandro might). I put this in to
keep them.

  Thanks,

     Matt


> Regards,
> Blaise
>
>
>
>
> For reference, I am attaching the .geo file for the GMSH file and  a dump
> of the exodus version:
> bblaptop:Tests (dmplex)$ ncdump ../TestMeshes/SquareFaceSet.gen
> netcdf SquareFaceSet {
> dimensions:
> len_name = 256 ;
> time_step = UNLIMITED ; // (0 currently)
> num_dim = 2 ;
> num_nodes = 9 ;
> num_elem = 8 ;
> num_el_blk = 1 ;
> num_node_sets = 2 ;
> num_side_sets = 3 ;
> num_el_in_blk1 = 8 ;
> num_nod_per_el1 = 3 ;
> num_side_ss1 = 2 ;
> num_df_ss1 = 4 ;
> num_side_ss2 = 2 ;
> num_df_ss2 = 4 ;
> num_side_ss3 = 4 ;
> num_df_ss3 = 8 ;
> num_qa_rec = 1 ;
> four = 4 ;
> len_string = 33 ;
> num_nod_ns1 = 3 ;
> num_nod_ns2 = 3 ;
> variables:
> double time_whole(time_step) ;
> int eb_status(num_el_blk) ;
> int eb_prop1(num_el_blk) ;
> eb_prop1:name = "ID" ;
> int ns_status(num_node_sets) ;
> int ns_prop1(num_node_sets) ;
> ns_prop1:name = "ID" ;
> int ss_status(num_side_sets) ;
> int ss_prop1(num_side_sets) ;
> ss_prop1:name = "ID" ;
> double coordx(num_nodes) ;
> double coordy(num_nodes) ;
> char eb_names(num_el_blk, len_name) ;
> char ns_names(num_node_sets, len_name) ;
> char ss_names(num_side_sets, len_name) ;
> char coor_names(num_dim, len_name) ;
> int connect1(num_el_in_blk1, num_nod_per_el1) ;
> connect1:elem_type = "TRI3" ;
> int elem_ss1(num_side_ss1) ;
> int side_ss1(num_side_ss1) ;
> double dist_fact_ss1(num_df_ss1) ;
> int elem_ss2(num_side_ss2) ;
> int side_ss2(num_side_ss2) ;
> double dist_fact_ss2(num_df_ss2) ;
> int elem_ss3(num_side_ss3) ;
> int side_ss3(num_side_ss3) ;
> double dist_fact_ss3(num_df_ss3) ;
> char qa_records(num_qa_rec, four, len_string) ;
> int elem_map(num_elem) ;
> int elem_num_map(num_elem) ;
> int node_num_map(num_nodes) ;
> int node_ns1(num_nod_ns1) ;
> double dist_fact_ns1(num_nod_ns1) ;
> int node_ns2(num_nod_ns2) ;
> double dist_fact_ns2(num_nod_ns2) ;
>
> // global attributes:
> :api_version = 8.03f ;
> :version = 8.03f ;
> :floating_point_word_size = 8 ;
> :file_size = 1 ;
> :maximum_name_length = 32 ;
> :int64_status = 0 ;
> :title = "cubit(SquareFaceSet.gen): 07/22/2022: 16:01:07" ;
> data:
>
>  eb_status = 1 ;
>
>  eb_prop1 = 1 ;
>
>  ns_status = 1, 1 ;
>
>  ns_prop1 = 10, 20 ;
>
>  ss_status = 1, 1, 1 ;
>
>  ss_prop1 = 20, 21, 22 ;
>
>  coordx = 0, 0.5, -0.166666666666667, 0, 0.5, -0.5, -0.5, -0.5, 0.5 ;
>
>  coordy = -0.5, 0, 0, 0.5, 0.5, 0, 0.5, -0.5, -0.5 ;
>
>  eb_names =
>   "" ;
>
>  ns_names =
>   "",
>   "" ;
>
>  ss_names =
>   "",
>   "",
>   "" ;
>
>  coor_names =
>   "x",
>   "y" ;
>
>  connect1 =
>   1, 2, 3,
>   2, 4, 3,
>   5, 4, 2,
>   6, 3, 7,
>   1, 3, 8,
>   9, 2, 1,
>   3, 6, 8,
>   3, 4, 7 ;
>
>  elem_ss1 = 5, 6 ;
>
>  side_ss1 = 3, 3 ;
>
>  dist_fact_ss1 = 1, 1, 1, 1 ;
>
>  elem_ss2 = 3, 8 ;
>
>  side_ss2 = 1, 2 ;
>
>  dist_fact_ss2 = 1, 1, 1, 1 ;
>
>  elem_ss3 = 6, 3, 4, 7 ;
>
>  side_ss3 = 1, 3, 3, 2 ;
>
>  dist_fact_ss3 = 1, 1, 1, 1, 1, 1, 1, 1 ;
>
>  qa_records =
>   "CUBIT",
>   "2021.11",
>   "07/22/2022",
>   "16:01:07" ;
>
>  elem_map = 1, 2, 3, 4, 5, 6, 7, 8 ;
>
>  elem_num_map = 1, 2, 3, 4, 5, 6, 7, 8 ;
>
>  node_num_map = 8, 3, 9, 5, 2, 7, 4, 6, 1 ;
>
>  node_ns1 = 5, 7, 4 ;
>
>  dist_fact_ns1 = 1, 1, 1 ;
>
>  node_ns2 = 8, 9, 1 ;
>
>  dist_fact_ns2 = 1, 1, 1 ;
> }
>
>> Canada Research Chair in Mathematical and Computational Aspects of Solid
> Mechanics (Tier 1)
> Professor, Department of Mathematics & Statistics
> Hamilton Hall room 409A, McMaster University
> 1280 Main Street West, Hamilton, Ontario L8S 4K1, Canada
> https://www.math.mcmaster.ca/bourdin | +1 (905) 525 9140 ext. 27243
>
>

-- 
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.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20230309/33d2adf3/attachment-0001.html>


More information about the petsc-dev mailing list