-
Notifications
You must be signed in to change notification settings - Fork 33
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
Divergence-free reconstruction of B field #141
base: master
Are you sure you want to change the base?
Conversation
Suggested improvements:
|
Still needs testing, might have discrepancies with single cell calculation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lkotipal could you post some metric or figure to "convince" us that this works?
More generally, how do we want to verify this, is someone taking the paper in one hand and this script in the other, do we trust a comparison to e.g. Bvol, other ideas?
import numpy as np | ||
from scipy.special import legendre | ||
from time import perf_counter | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest adding a comment near the top to shortly explain what this does including the paper's reference, so that someone looking at this code knows where it comes from.
I've only managed to do simple tests so far to check that the field is in the right ballpark. I suppose the best metric would be to integrate the field over the cell to check that the volumetric average matches? |
Sure, you can do that. You could check that it converges if you take 1 centre value, the corners, 3³, 4³ etc. Sounds like a good idea, but probably not worth the hassle of doing a more proper integration scheme just for this test. |
This will require an interface to chunk production-size FSGrid variables at least when calculating abc, otherwise there will be OOMs. |
How general should that be? We're bound to hit OOM elsewhere in future fsgrid data processing I'm pretty sure. And/or do you already have sth up your sleeve? |
I have a dumb decomposition that has ugly boundary effects.. and this is a case where neighbor information is also used, so this case even needs a bit of a halo. Numpy.split also only does 1D split for now.. manual 3D numpy views to be used here? |
from time import perf_counter | ||
# Code for testing divergenceless_resconstruction.py | ||
|
||
f = pt.vlsvfile.VlsvReader('/wrk/users/lkotipal/TEST/bulk.0000057.vlsv') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this is now outdated, of course
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uses argv[1] now
…nce for EGI fsgrid ops ~quadrupled. Still to encapsulate this into a reconstructor class.
@lkotipal wanna implement the requested changes and deprecated directory stuff here? Perhaps we could even get this merged at some point. |
Divergence free reconstruction
I suggest moving the reconstruction part to Have you Leo done a diff wrt. |
Implements reconstruction and interpolation of magnetic field from face-average values in Analysator. Based on Balsara's paper.
Not thoroughly tested or ready to merge yet.