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

Cleanup of the use of divergence and trace #1120

Open
keileg opened this issue Jan 29, 2024 · 0 comments
Open

Cleanup of the use of divergence and trace #1120

keileg opened this issue Jan 29, 2024 · 0 comments
Assignees
Labels
user group Issue to be worked on in the internal user group.

Comments

@keileg
Copy link
Contributor

keileg commented Jan 29, 2024

To map between faces and cells in a grid, we currently have the following functionality:

  • fvutils.scalar_divergence, fvutils.vector_divergence are two separate methods that are not exclusive to finite volume methods. Also, the methods could be parametrized, as is done in pp.ad.GridOperators.Divergence
  • There is occasional usage of a trace operator, see for instance pp.Upwind. There is however no ready functionality to get hold of a discrete trace operator (independent of dimension).

Note that this does not concern the Ad module, where the code is much cleaner (at least in a certain sense).

Suggested improvement:

  1. The current functions fvutils.scalar_divergence, fvutils.vector_divergence are moved to pp.Grid and parametrized with dimension, so that one can write pp.Grid(...).divergence(dim: int=n)
  2. The grid class is further equipped with methods trace(dim:int) and inv_trace(dim: int).
  3. The new methods are taken into use throughout the code. That should be straightforward for the divergence, but searching for usage of trace operators may require some care.
@keileg keileg added the user group Issue to be worked on in the internal user group. label Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user group Issue to be worked on in the internal user group.
Projects
None yet
Development

No branches or pull requests

1 participant