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

fix simplex boundary #838

Merged
merged 4 commits into from
Nov 28, 2023
Merged

fix simplex boundary #838

merged 4 commits into from
Nov 28, 2023

Commits on Nov 28, 2023

  1. fix basis of SimplexTopology

    The implementations of the degree one std and the bubble bases for the
    `SimplexTopology` incorrectly assume that the `simplices` array contains
    vertex in `range(nverts)` without holes, and use this array as is as
    dofs, thereby introducing zeros in the basis for every dof in
    `set(range(simplices.max() + 1)) - set(simplices.flat)`. The boundary of
    a `SimplexTopology`, however, simply returns a subset of the volume
    `simplices` array, without renumbering.
    
    This bug was introduced by 7e29a28, which removes `_renumber` as
    preprocessor for the `simplices` parameter of
    the `SimplexTopology` constructor.
    
    To fix this problem this patch adds a `contiguous_simplices` property
    and uses thses as dofs. The alternative, requiring constructing a
    `SimplexTopology` with contiguous `simplices`, was rejected because this
    puts a computational burden on every boundary of a `SimplexTopology`,
    even if we don't create a basis.
    joostvanzwieten committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    9b9fb80 View commit details
    Browse the repository at this point in the history
  2. add connectivity to EmptyTopology

    This patch adds the `connectivity` attribute to `EmptyTopology` for
    completeness.
    joostvanzwieten committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    43c857f View commit details
    Browse the repository at this point in the history
  3. add EmptyTopology.boundary,interfaces

    This patch implements the `boundary` and `interfaces` attributes for the
    `EmptyTopology`, which is needed by a subsequent patch fixing empty
    boundaries of a `SimplexTopology`.
    joostvanzwieten committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    2c6c3e7 View commit details
    Browse the repository at this point in the history
  4. fix empty boundary of SimplexTopology

    The constructor of `SimplexTopology` trips over
    
        assert numpy.greater(self.simplices[:, 1:], self.simplices[:, :-1]).all()
    
    if there are no simplices. This is triggered when taking the boundary of
    a fully periodic mesh.
    
    This patch fixes the problem by returning an `EmptyTopology` when the
    boundary is empty. In addition this patch adds a slightly improved error
    message when trying to create an empty `SimplexTopology.
    joostvanzwieten committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    41090cc View commit details
    Browse the repository at this point in the history