Skip to content

Input gacode#3

Merged
bclyons12 merged 12 commits intomasterfrom
input_gacode
Aug 8, 2025
Merged

Input gacode#3
bclyons12 merged 12 commits intomasterfrom
input_gacode

Conversation

@jmcclena
Copy link
Copy Markdown
Contributor

This pull request adds reading and writing of input.gacode files.

Example reading and writing an input.gacode file:

using GACODE
input_gacode = GACODE.expro_read("input.gacode")
GACODE.expro_write(input_gacode,"input.gacode_new")

and small stylistic changes
and fix bug for dd.global_time = 0.0
@TimSlendebroek
Copy link
Copy Markdown
Contributor

@jmcclena

Looks like it works I did some minor bug fixes and made the naming more uniform with the rest of the code base

This is now the API:

using GACODE

input_gacode = GACODE.InputGACODE(dd)
GACODE.save(ip,"<your filename>")
input_gacode = GACODE.load("<your filename>")

@TimSlendebroek
Copy link
Copy Markdown
Contributor

I think we should test once reading an external input.gacode and export one to OMFIT to see if this works @jmcclena and then merge @orso82

TimSlendebroek and others added 7 commits July 1, 2025 12:38
This works now on creating input.gacode and reading one in from profilesgen
@orso82 adding in D and T seperate to input_gacode is probably vital for other people to use it I can't come up with an elegant way to do this can you come up with one? I strongly remember it was your decision to put them lumped :P
@TimSlendebroek
Copy link
Copy Markdown
Contributor

@orso82 or @bclyons12 it looks like I don't have merge rights on this repo can either of you merge this?

@bclyons12 bclyons12 merged commit 2ff9c04 into master Aug 8, 2025
1 check passed
@bclyons12 bclyons12 deleted the input_gacode branch August 8, 2025 19:13
@orso82
Copy link
Copy Markdown
Contributor

orso82 commented Aug 9, 2025

I still don't understand why one would need the special handling of DT in input.gacode

If the dd has a single hydrogenic ion with mass of 2.5 then that's what should also go in the input.gacode that is derived from dd

@jmcclena
Copy link
Copy Markdown
Contributor Author

Are there IMAS functions to bundle and unbundle DT?

@orso82
Copy link
Copy Markdown
Contributor

orso82 commented Aug 11, 2025

@bclyons12 I wish we did not yet merge this, since I don't believe this is the right way of handling DT.

The dd --> input.gacode should not be in the business of modifying the ion species. The translation from one plasma statefile to the other should be done verbatim.

Instead, I see the ability to modify the ion species (like split DT into separate D and T, or combine separate D and T into DT) as functionalities that should be added to IMAS.jl. Consider for example what we do with quasineutrality. We have IMAS.jl functions for those. We don't add a quasineutrality function for different file formats that we could export dd to.

To answer @jmcclena question, IMAS.jl has a lump_ions_as_bulk_and_impurity function, and we could add a bundle_DT and unbundle_DT functions there as well.

@bclyons12
Copy link
Copy Markdown
Collaborator

@orso82 There was no release made, so it should be simple to revert this if desired.

orso82 added a commit to ProjectTorreyPines/IMAS.jl that referenced this pull request Aug 14, 2025
orso82 added a commit to ProjectTorreyPines/IMAS.jl that referenced this pull request Aug 14, 2025
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