-
Notifications
You must be signed in to change notification settings - Fork 21
Coupling with an AI model for sheath BC in GK simulations #982
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
Open
Antoinehoff
wants to merge
157
commits into
main
Choose a base branch
from
gk_ai_sheath
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
157 commits
Select commit
Hold shift + click to select a range
fb01668
new argument in the gk sheath bc updater to introduce the mu dependen…
Antoinehoff 08dceb1
Merge remote-tracking branch 'origin/new_gk_bc_sheath_unit_test' into…
Antoinehoff 9a0d39d
This setup includes alpha_mu in the kernel and returns the same resul…
Antoinehoff abb84ee
Had to define a specific basis for the alpha_mu coeff in bc_sheath ob…
Antoinehoff 0c163dd
the sheath bc test is now adapted to check mu-dependent vcut. We avoi…
Antoinehoff f7ffb5d
We remove the function pointer interface to set the alpha_mu array. T…
Antoinehoff b251b92
restore the twist shift unit test (mixed up with the bc sheath one)
Antoinehoff 4503727
update the sheath bc unit test, we can now pass a curve to make vcut …
Antoinehoff 7bf4723
naming refactor, alpha_mu is now vcut_fact
Antoinehoff 2e8ada7
start of a vcut_fact(x,y,mu) version
Antoinehoff 681f76f
New dimensionality for the vcut factor array. It is now a combinaison…
Antoinehoff 13854cf
reduce debug lines and comment print statement
Antoinehoff fe9d6d1
add a new bool to decide if we use the surrogate in bc_sheath updater
Antoinehoff aeee19d
Add new kernels to update the vcut factor and connections to the surr…
Antoinehoff a4207d5
switch commented section, the test of non zero cell avg in fully refl…
Antoinehoff 6409f28
add an assert to forbid the use of the surrogate in 1v case
Antoinehoff f4814fd
made the switch statement more robust
Antoinehoff d990730
add an example of surrogate model
Antoinehoff 31a9cff
add method to choose the surrogate kernel
Antoinehoff 1a8a0e0
reorganize the surrogate kernel choice logic
Antoinehoff 8082dc8
the sheath unit test is now in mksa units and can also test the surro…
Antoinehoff 6f0951d
fix pointer to function logic
Antoinehoff fc54201
The surrogate interface works as expected 🥳Commit details:
Antoinehoff 4c1a5e3
The species can now call the surrogate model for sheath physics, we d…
Antoinehoff b7b85cb
Merge remote-tracking branch 'origin/main' into gk_ai_sheath
Antoinehoff 1ddd30d
Add missing EXTERN_C_END to the gkyl_bc_sheath_gyrokinetic_gyraze_sur…
Antoinehoff bd04693
add the commit ID that generated the sheath ai model interface
Antoinehoff b4fc78d
adapt the surrogate interface for GPU application
Antoinehoff 022fea5
try another way to write the surrogate model to make it work on GPU
Antoinehoff 43dabaa
The ctest passes on GPUs without surrogate, it is valgrind clean. One…
Antoinehoff f3fcb86
uncomment tests and remove write fields
Antoinehoff 85b8eae
the surrogate eval is GPU compatible, also replace M_PI by GKYL_PI
Antoinehoff 6a6d506
the sheath AI surrogate is now ready for GPU, also remove q and m fro…
Antoinehoff 91ed92d
The sheath unit test passes with surrogate now for both cpu and gpu. …
Antoinehoff 4541300
Add the impact angle of the magnetic field with the xy plane and use …
Antoinehoff 095be63
We can now call the projector to project the sheath surrogate eval pa…
Antoinehoff 5b21f89
create a regression test that uses the sheath surrogate.
Antoinehoff 21e6d40
forgot to remove a debugging print statement
Antoinehoff 85aa760
forgot to uncomment some tests
Antoinehoff c0b643e
Merge remote-tracking branch 'origin/main' into gk_ai_sheath
Antoinehoff 0bfea45
Merge remote-tracking branch 'origin/main' into gk_ai_sheath
Antoinehoff 400a606
use surrogate only when GYRAZE is expected to converge
Antoinehoff cfaff40
correct the impact angle calculation
Antoinehoff a2c6588
bug fix: bring back the former version of the impact angle
Antoinehoff ae6d6b2
this commit is not working, it's a transfer
Antoinehoff 98f2ce8
Addition of a input parameter to decide if we check convergence befor…
Antoinehoff 7b821d2
Merge remote-tracking branch 'origin/righthanded_checks' into gk_ai_s…
Antoinehoff c48e248
adapt the rt_gk sheath surrogate to the new geom
Antoinehoff ec39170
Revert "adapt the rt_gk sheath surrogate to the new geom"
Antoinehoff 3452558
Now use a model of GYRAZE that does the projection internally in the …
Antoinehoff 7d31b27
forgot to update the cuda kernel to choose if we ue the convergence c…
Antoinehoff 921d794
Merge branch 'gk_ai_sheath' of https://github.com/ammarhakim/gkeyll i…
Antoinehoff dc9c63b
Merge remote-tracking branch 'origin/main' into gk_ai_sheath
Antoinehoff 9a699b5
Merge branch 'gk_ai_sheath' of https://github.com/ammarhakim/gkeyll i…
Antoinehoff 257828a
update the TCV sheath surrogate regression test with the new geom
Antoinehoff e7afe36
add a regression test for the helical 3x2v case
Antoinehoff d152dd4
Merge branch 'gk_ai_sheath' of https://github.com/ammarhakim/gkeyll i…
Antoinehoff 3e3ec03
the branch is now valgrind clean:
Antoinehoff a611330
use the sheath surrogate in the helical regression test
Antoinehoff ceb7188
use the input table to fix the valgrind uninitialised value error ins…
Antoinehoff e1860a2
use the full_MPE NN model
Antoinehoff 39b3cc6
replace magic number with GKYL_PHI_THRESHOLD and set it to 2
Antoinehoff 1af9179
Merge remote-tracking branch 'origin/main' into gk_ai_sheath
Antoinehoff 6cfc940
update the sheath surrogate model with the one trained on the GYRAZE …
Antoinehoff 2784e6c
Merge branch 'gk_ai_sheath' of https://github.com/ammarhakim/gkeyll i…
Antoinehoff bfd9820
Merge remote-tracking branch 'origin/main' into gk_ai_sheath
Antoinehoff ce17eb5
set the threshold to very small, we don't want to use it anymore
Antoinehoff 5a557d3
Merge remote-tracking branch 'origin/main' into gk_ai_sheath
Antoinehoff 8d82697
Merge remote-tracking branch 'origin/nccl-reorg-periodic-bcs' into gk…
Antoinehoff c61aecf
use the local density and not the polarization density for gamma_gyraze
Antoinehoff a829836
add a fmax to ensure non negative vcut factor
Antoinehoff 3972220
Remove unused surrogate routines and the conv_check option
Antoinehoff 04d8aff
use sheath surrogate in the regression test
Antoinehoff 0ecd079
add a method to test the kann surrogate in the unit test. I guess we'…
Antoinehoff 82efe9b
Update the kernels with `float(expand(` instead of `float(fullratsimp…
Antoinehoff 6025a4e
add temp variable for vcut_fact dimensions and rename acquisition fun…
Antoinehoff cb0234c
try to reduce the size of the interface between kann and the bc sheat…
Antoinehoff 2a0a198
Merge remote-tracking branch 'origin/main' into gk_sheath_vcut_mu_dep
Antoinehoff 4d8fb31
The GPU implementation was done on the sheath_ai branch but not on th…
Antoinehoff b65b451
define and use vcut_fact_dim instead of cdim
Antoinehoff a161441
Merge remote-tracking branch 'origin/gk_sheath_vcut_mu_dep' into gk_a…
Antoinehoff e141508
Merge remote-tracking branch 'origin/main' into gk_ai_sheath
Antoinehoff 0dec7e5
Merge remote-tracking branch 'origin/bimpactangle_surf' into gk_ai_sh…
Antoinehoff 0ca9a04
remove the interior B impact angle from mirror geom
Antoinehoff 025e8e2
use now the surface representation of bimpactangle
Antoinehoff 4778327
remove print statement
Antoinehoff da49cb2
Merge pull request #1034 from ammarhakim/gk_ai_sheath-surf_bimpactangle
Antoinehoff 80879f7
Merge remote-tracking branch 'origin/kann-hack' into gk_ai_sheath_kann
Antoinehoff 03cbc8e
Merge remote-tracking branch 'origin/gk_ai_sheath' into gk_ai_sheath_…
Antoinehoff 9e289bb
Merge remote-tracking branch 'origin/main' into gk_ai_sheath_kann
Antoinehoff 2373817
small merge issue fix
Antoinehoff b81caae
We now pass the pointer to the KANN model to evaluate the BC. This wo…
Antoinehoff 57d0c01
Fix a maxima bug that was not projecting properly the vcut along mu. …
Antoinehoff 9fcc3ba
Merge remote-tracking branch 'origin/main' into gk_ai_sheath
Antoinehoff fdae289
revert residual issue of interior impact angle on dev
Antoinehoff f6abdbf
The CPU surrogate sheath BC program flow now uses the gkyl_kann layer…
Antoinehoff 1f1fd94
a bit of renaming and fix the choosing kernels for GPU, we have to mo…
Antoinehoff 4bae969
The interface looks to work well on CPU now with the kernels filling …
Antoinehoff 4dc395e
Big reorg of the handling of sheath BC. The main change is that we do…
Antoinehoff e2a64f0
The GPU code looks clean for sheath ai KANN bc. Are we done?
Antoinehoff 828fd8f
Remove the direct kann interface (everything goes through gkyl_kann),…
Antoinehoff 69a0af5
compute gamma with fabs(0.0,density) instead of the density alone, si…
Antoinehoff 2fd33c9
Good bye hardcoded NN, you will be remembered 🫡
Antoinehoff 17d6f5f
forgot to move gkyl_const to have access to electron mass and others …
Antoinehoff 918f8d1
add the neural model for the sheath bc
Antoinehoff 7978dc5
Merge remote-tracking branch 'origin/gk_ai_sheath_kann' into gk_ai_sh…
Antoinehoff e888c27
remove the special tcv 2x2v sheath surrogate regression test because …
Antoinehoff be250bc
refactor: rename surrogate variable and function references consisten…
Antoinehoff 41e8f44
remove unused arguments in sheath advance method.
Antoinehoff b6c22ec
adapt the sheath unit test to work with kann. Since it's monday, noth…
Antoinehoff 712aa03
add the surrogate model path to the regression test that use the surr…
Antoinehoff dd5de27
Merge remote-tracking branch 'origin/main' into gk_ai_sheath, need to…
Antoinehoff 0ebec35
Merge remote-tracking branch 'origin/main' into gk_ai_sheath
Antoinehoff e59911d
Restablish the bc_sheath updater new routine call to pass the surroga…
Antoinehoff 5e211c0
Put back a chunk of code that got lost during the merge 😰
Antoinehoff 618a309
add a 2x2v helical reg test with sheath BC
Antoinehoff 1c0ec60
The ai sheath branch is ready I think. The unit test passes on GPU an…
Antoinehoff c9d4dbf
add an assert to make sure that kperpSq parameter is >0 (it was just …
Antoinehoff 28a4a90
put io diag in a more consistent way
Antoinehoff 7fafe76
fix right hand of LTX reg test in 1x2v, the y term in the definition …
Antoinehoff 0903288
add diagnostics for the source in ltx reg test
Antoinehoff 6525d44
Fix an error in the mapping of the surface bimpact angle and the inde…
Antoinehoff 802424d
add the 1x2v version of TCV iwl adapt source stup
Antoinehoff 141d64c
Merge remote-tracking branch 'origin/hot-fix-frame-metadata-bug' into…
Antoinehoff 9985ec8
Add a diagnostic for the cutting velocity of the sheath surrogate BC
Antoinehoff 26dc576
add the call to surrogate in the 1x2v reg test
Antoinehoff 028d91c
fix a indexation bug in the 1x2v sheath kernel
Antoinehoff 4b0a570
add 1x2v version of helical sim and reduce rt tcv iwl 1x2v resolution
Antoinehoff 5cf654a
Merge remote-tracking branch 'origin/dg_binop_sig_change' into aishea…
Antoinehoff 350798f
change app->io_meta_grid to app->io_meta_dg
Antoinehoff 6c36045
add new setups for helical simulation using adapt sources
Antoinehoff bffd4e2
reduce the total number of particles to match ~ the one obtain in the…
Antoinehoff d4d5e88
put non uniform velocity grid
Antoinehoff 939ba3d
replace the ref density from 7e18*10 to 7e19 (the 10 factor comes fro…
Antoinehoff 424413c
apply a hand made scaling of the total density so that it matches the…
Antoinehoff e392780
Merge remote-tracking branch 'origin/dg_binop_sig_change-differentiat…
Antoinehoff 42d97bb
we now integrate the grid associated to the cutting velocity output b…
Antoinehoff 33e19bf
cosmetic changes
Antoinehoff fdc3085
delete the adapt src 1x2v tcv regression test because this dimensiona…
Antoinehoff 2c73a03
simplify 1x2v TCV reg test
Antoinehoff 6272373
Merge remote-tracking branch 'origin/main' into gk_ai_sheath
Antoinehoff af8670a
correct a erroneous comment
Antoinehoff 065483d
clamp the potential to positive value for the surrogate evaluation. T…
Antoinehoff 8889819
remove the adaptive source in helical 1x2x setup because we cannot ha…
Antoinehoff f726bcf
Merge remote-tracking branch 'origin/main' into gk_ai_sheath
Antoinehoff 8f82ab1
change num_cell_ into N and final_time into t_end
Antoinehoff 2c4f470
split GKYL_BC_GK_SPECIES_SHEATH bc type into GKYL_BC_GK_SPECIES_SHEAT…
Antoinehoff a66169f
add a few regression tests to ignore because they don't pass
Antoinehoff a741b13
Change the enum type GKYL_BC_GK_SPECIES_SHEATH_CONDUCTING in the regr…
Antoinehoff 1ea32fd
fix some logic isssue with the enum change. Had also to divide by the…
Antoinehoff dcd4369
add a readme for the .kann NN model.
Antoinehoff bc93810
update vcutsq output file naming
Antoinehoff 472d95d
forgot to remove an obsolete bolean and adapt the release of the kann…
Antoinehoff 630e1f0
change the naming of the vcutsq diag. The code is leak check clean an…
Antoinehoff 3f223b7
Merge remote-tracking branch 'origin/main' into gk_ai_sheath
Antoinehoff 1c07f44
Merge remote-tracking branch 'origin/main' into gk_ai_sheath
Antoinehoff 7b67a9d
Merge remote-tracking branch 'origin/main' into gk_ai_sheath
Antoinehoff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think but i'm not 100% that this should use
io_meta_basicinstead ofio_meta_dg, because the latter has the conf-space basis and poly order, which is not what you want here.Uh oh!
There was an error while loading. Please reload this page.
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.
the vcut_sq is stored in a DG modal representation on a p=1 3D (x,y,mu) serendipity basis. It does not use the gk hybrid one so I think this works like that. I checked the resulting .gkyl output and it matches with what should the cutting velocity look like.