Replies: 1 comment 3 replies
-
The closest to this that we have in egs++ so far are Personally, I just use a python script to do this. Instead of a .egsinp file I create a file that's a template, e.g. a .template file. Inside I use python keys for variable replacement (e.g. %(myVariableName)s would be for a string replacement), then write out the result to .egsinp file(s). This allows me to create many .egsinp files where one or several parameters are changing. Something like this:
where |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm curious if there is any way to replace the values like the ones that show up when defining geometry with variables that I can define all in one spot somewhere else in the .egsinp file. Since many of the values in my geometry definition are relative to the lengths of other geometric objects it would be much more convenient if I could replace x values of planes with something like 'x_1' and somewhere else define 'x_1 = 2.70 + x_0' and such so that I can change the thickness of something in one spot without having to go adjust values for 8 different spots. I tried looking around already and found something like :start key: which allowed me to make 'keys' and assign them values (basically defining variables except they all need to be named in a specific way, I think), but that didn't work at all and the geometry threw me an error that was basically saying my input is not accepted. I saw that a contributor suggested adding this feature in 2017, has it ever been added? (that was issue #697)
Beta Was this translation helpful? Give feedback.
All reactions