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

Uniformrefine3 unfavorable behavior after update in cubemesh #8

Open
scaomath opened this issue Oct 12, 2021 · 1 comment
Open

Uniformrefine3 unfavorable behavior after update in cubemesh #8

scaomath opened this issue Oct 12, 2021 · 1 comment
Assignees

Comments

@scaomath
Copy link
Collaborator

scaomath commented Oct 12, 2021

Problem

In 842ba40 commit, the loop ordering of the cubemesh is changed such that the elem generated by it will have a nice ascending ordering in both rows and columns. For example

[node, elem] = cubemesh([-1,1,-1,1,-1,1],1);

gives

elem =
     1     4     5    14
     1     2     5    14
     1    10    13    14
     1    10    11    14
     1     4    13    14
     1     2    11    14
     2     5     6    15
     2     3     6    15
     2    11    14    15
     2    11    12    15
     2     5    14    15
     2     3    12    15
     4     7     8    17
     4     5     8    17
     4    13    16    17
     4    13    14    17
     4     7    16    17
     4     5    14    17
     5     8     9    18
     5     6     9    18
     5    14    17    18
     5    14    15    18
     5     8    17    18
     5     6    15    18
    10    13    14    23
    10    11    14    23
    10    19    22    23
    10    19    20    23
    10    13    22    23
    10    11    20    23
    11    14    15    24
    11    12    15    24
    11    20    23    24
    11    20    21    24
    11    14    23    24
    11    12    21    24
    13    16    17    26
    13    14    17    26
    13    22    25    26
    13    22    23    26
    13    16    25    26
    13    14    23    26
    14    17    18    27
    14    15    18    27
    14    23    26    27
    14    23    24    27
    14    17    26    27
    14    15    24    27

Visualizing the elements by a six-element group we will have
mesh1

However, if we do from cubemesh then uniformrefine3, the ascending ordering is gone.

[node,elem] = cubemesh([-1,1,-1,1,-1,1],2);
[node,elem] = uniformrefine3(node,elem);

gives

elem =
     1    10    11    15
     1     9    11    15
     1    12    14    15
     1    12    13    15
     1    10    14    15
     1     9    13    15
    10     3    19    21
     9     2    16    18
    12     5    24    25
    12     5    23    25
    10     3    20    21
     9     2    17    18
    11    19     4    22
    11    16     4    22
    14    24     7    27
    13    23     6    26
    14    20     7    27
    13    17     6    26
    15    21    22     8
    15    18    22     8
    15    25    27     8
    15    25    26     8
    15    21    27     8
    15    18    26     8
    10    11    15    21
     9    11    15    18
    12    14    15    25
    12    13    15    25
    10    14    15    21
     9    13    15    18
    10    11    19    21
     9    11    16    18
    12    14    24    25
    12    13    23    25
    10    14    20    21
     9    13    17    18
    11    15    21    22
    11    15    18    22
    14    15    25    27
    13    15    25    26
    14    15    21    27
    13    15    18    26
    11    19    21    22
    11    16    18    22
    14    24    25    27
    13    23    25    26
    14    20    21    27
    13    17    18    26

and visualizing the refined elements by 6-element groups yields something like the following:
mesh2

Potential solution

  • re-implement uniformrefine3, this is somewhat unwanted from a development pov.
  • add an ordering check pre/post-refining.
@scaomath scaomath self-assigned this Oct 12, 2021
@scaomath
Copy link
Collaborator Author

Assigned myself to fix this.

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

No branches or pull requests

1 participant