Skip to content

Calculate interpolation weight matrix#40

Open
bendudson wants to merge 7 commits intomasterfrom
calculate-weights
Open

Calculate interpolation weight matrix#40
bendudson wants to merge 7 commits intomasterfrom
calculate-weights

Conversation

@bendudson
Copy link
Copy Markdown
Collaborator

Define a matrix operation to calculate the forward and backward interpolation.
This enables matrices to be constructed that represent operators such as Grad_par and Div_par.

bendudson and others added 2 commits May 30, 2025 15:20
Create matrix representation of interpolation, saved in CSR format
in the BOUT++ grid file.
Copy link
Copy Markdown
Collaborator

@dschwoerer dschwoerer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, however that would require quite significant changes on the BOUT++ side as well.

Comment thread zoidberg/weights.py Outdated
Needed to enable correct calculation of divergence operator.
Renaming, some refactoring, more documentation, standard CSR output.
@bendudson
Copy link
Copy Markdown
Collaborator Author

Thanks @dschwoerer . BOUT++ changes in this PR: boutproject/BOUT-dev#3330 .
Still a work in progress.

In addition to following a field-line from cell center,
follow a set of points distributed over each cell.

Using Gauss-Legendre points to perform averaging over each cell.
Adds an option to trace multiple field lines per cell (default is 1).
Uses Gauss-Legendre points. The resulting maps are used to calculate
forward & backward matrices.
@dschwoerer
Copy link
Copy Markdown
Collaborator

I think it might make sense to allow for multiple target BCs for one cell. That might also help with numerical stability, as you do not get such sharp transitions from "sees a target" to "does not see a target". boutproject/BOUT-dev#3308 would allow to implement this in BOUT++, without having to touch the physics code, if they use the new interface.

I am also not sure that boutproject/BOUT-dev#3320 makes sense, if we start computing parallel slices on demand.

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

Successfully merging this pull request may close these issues.

2 participants