Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command line option --with-indices not working #7

Closed
phuschke opened this issue Oct 19, 2017 · 2 comments
Closed

Command line option --with-indices not working #7

phuschke opened this issue Oct 19, 2017 · 2 comments
Assignees
Labels

Comments

@phuschke
Copy link
Collaborator

Problem

Neither

gmshreader --with-indices gmshMWE.msh

nor

gmshreader --local-ordering --with-indices gmshMWE.msh

gives the expected result.

MWE

gmshMWE.msh

$MeshFormat
2.2 0 8
$EndMeshFormat
$Nodes
5
1 0 0 0
2 1 0 0
3 1 1 0
4 0 1 0
5 0.5 0.5 0
$EndNodes
$Elements
4
1 2 5 7 6 2 2 -1 1 2 5
2 2 5 7 6 2 1 -2 1 5 4
3 2 5 7 6 2 2 -1 2 3 5
4 2 5 7 6 2 1 -2 3 4 5
$EndElements
@phuschke phuschke added the bug label Oct 19, 2017
@dbeurle dbeurle self-assigned this Oct 19, 2017
@dbeurle
Copy link
Owner

dbeurle commented Oct 19, 2017

Okay thanks for the issue. I get the following:

{
   "Elements" : [
      {
         "Name" : "",
         "NodalConnectivity" : [
            [ 1, 5, 4 ],
            [ 3, 4, 5 ]
         ],
         "Type" : 2
      }
   ],
   "Interface" : [
      {
         "GlobalStartId" : [ 0 ],
         "Master" : [ 1 ],
         "NodeIds" : [
            [ 1, 3, 5 ]
         ],
         "Slave" : [ 2 ],
         "Value" : [ 1 ]
      }
   ],
   "LocalToGlobalMap" : [ 1, 3, 4, 5 ],
   "Nodes" : [
      {
         "Coordinates" : [
            [ 0, 0, 0 ],
            [ 1, 1, 0 ],
            [ 0, 1, 0 ],
            [ 0.5, 0.5, 0 ]
         ]
      }
   ],
   "NumInterfaceNodes" : [ 3 ]
}

for the first, and for the second partition

{
   "Elements" : [
      {
         "Name" : "",
         "NodalConnectivity" : [
            [ 1, 2, 5 ],
            [ 2, 3, 5 ]
         ],
         "Type" : 2
      }
   ],
   "Interface" : [
      {
         "GlobalStartId" : [ 0 ],
         "Master" : [ 1 ],
         "NodeIds" : [
            [ 1, 3, 5 ]
         ],
         "Slave" : [ 2 ],
         "Value" : [ -1 ]
      }
   ],
   "LocalToGlobalMap" : [ 1, 2, 3, 5 ],
   "Nodes" : [
      {
         "Coordinates" : [
            [ 0, 0, 0 ],
            [ 1, 0, 0 ],
            [ 1, 1, 0 ],
            [ 0.5, 0.5, 0 ]
         ]
      }
   ],
   "NumInterfaceNodes" : [ 3 ]
}

With default arguments to the program. When I use --with-indices (with a patch) I get

{
   "Elements" : [
      {
         "Indices" : [ 2, 4 ],
         "Name" : "",
         "NodalConnectivity" : [
            [ 1, 5, 4 ],
            [ 3, 4, 5 ]
         ],
         "Type" : 2
      }
   ],
   "Interface" : [
      {
         "GlobalStartId" : [ 0 ],
         "Master" : [ 1 ],
         "NodeIds" : [
            [ 1, 3, 5 ]
         ],
         "Slave" : [ 2 ],
         "Value" : [ 1 ]
      }
   ],
   "LocalToGlobalMap" : [ 1, 3, 4, 5 ],
   "Nodes" : [
      {
         "Coordinates" : [
            [ 0, 0, 0 ],
            [ 1, 1, 0 ],
            [ 0, 1, 0 ],
            [ 0.5, 0.5, 0 ]
         ],
         "Indices" : [ 1, 3, 4, 5 ]
      }
   ],
   "NumInterfaceNodes" : [ 3 ]
}

and

{
   "Elements" : [
      {
         "Indices" : [ 1, 3 ],
         "Name" : "",
         "NodalConnectivity" : [
            [ 1, 2, 5 ],
            [ 2, 3, 5 ]
         ],
         "Type" : 2
      }
   ],
   "Interface" : [
      {
         "GlobalStartId" : [ 0 ],
         "Master" : [ 1 ],
         "NodeIds" : [
            [ 1, 3, 5 ]
         ],
         "Slave" : [ 2 ],
         "Value" : [ -1 ]
      }
   ],
   "LocalToGlobalMap" : [ 1, 2, 3, 5 ],
   "Nodes" : [
      {
         "Coordinates" : [
            [ 0, 0, 0 ],
            [ 1, 0, 0 ],
            [ 1, 1, 0 ],
            [ 0.5, 0.5, 0 ]
         ],
         "Indices" : [ 1, 2, 3, 5 ]
      }
   ],
   "NumInterfaceNodes" : [ 3 ]
}

Is this now the expected behaviour?

@phuschke
Copy link
Collaborator Author

Perfect 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants