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

[FIELDLINES] allow start from plasma boundary given in VMEC INDATA, not only wout #241

Open
wants to merge 112 commits into
base: develop
Choose a base branch
from

Conversation

jonathanschilling
Copy link
Collaborator

These changes allow to provide the command-line argument -edge to FIELDLINES not only in combination with tracing over a VMEC equilibrium, but also in vacuum (-vac).
The plasma boundary geometry is then read from the VMEC INDATA namelist using RBC and ZBS (and in case of lasym, also RBS and ZBC). Furthermore, nfp, mpol and ntor are needed.

Additional input parameters (in the FIELDLINES_INPUT namelist) named nstart_pol and nstart_tor are provided to specify how many grid points over the plasma boundary are to be used in each of the tangential directions. They default to 0, in which case (as if they are not specified in the FIELDLINES_INPUT namelist) operation defaults to int(floor(sqrt(maxlines))) per direction, as previously implemented.

@jonathanschilling
Copy link
Collaborator Author

Note: Assuming one has an existing wout file, but only wants to use the plasma boundary geometry from there, one can copy that plasma boundary geometry into a new VMEC indata namelist using the wout2indata tool from #245.

lazersos and others added 26 commits June 4, 2024 16:57
… This one also checks that no errornous mystart, myend are created if more ranks are tried to be assigned than work items (e.g. loop iterations, field lines to be traced, ...) are available
@jons-pf
Copy link
Contributor

jons-pf commented Jun 4, 2024

@lazersos FYI, I think this should now be compatible again with the recently merged py_stel update.

@@ -176,6 +185,8 @@ SUBROUTINE write_fieldlines_namelist(iunit_out, istat)
WRITE(iunit_out,outflt) 'FOLLOW_TOL',follow_tol
WRITE(iunit_out,outint) 'NPOINC',npoinc
WRITE(iunit_out,outflt) 'MU',mu
WRITE(iunit_out,outint) 'NSTART_POL',nstart_pol
Copy link
Collaborator

Choose a reason for hiding this comment

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

These should only be written out if they're >0.

Copy link
Collaborator

@lazersos lazersos left a comment

Choose a reason for hiding this comment

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

The modifications in FIELDLINES_INIT_MGRID and COIL (All the BCASTS) shouldn't be there. When you call init_edgestart, you should re-read the INDATA namelist. This better compartmentalizes the code. Also mylocalmaster doesn't need to be broadcast.

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.

4 participants