-
Notifications
You must be signed in to change notification settings - Fork 145
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
Add dynamic motion for shapes using egs_dynamic_shape #1092
base: develop
Are you sure you want to change the base?
Conversation
@rtownson, I've been running a couple of tests using egs_dynamic_shape to collimate a source and, for some reason, I'm not seeing the evolution of source particles I would expect. I've attached a tutor7pp example in which a parallel beam is collimated using egs_rectangle inside egs_dynamic_shape so that the rectangle rotates 10 degrees about the Z-axis every 1/4*ncase histories, but I don't see evidence of this in egs_view or any rotational smearing in a phase space file scored beneath the source. I feel like there's some issue with my input or with my understanding of what I should be seeing. Could you please take a look when you get the chance? Thanks! |
@blakewalters with that input file you should be seeing this warning (actually causes an infinite loop, I'll fix that):
If you're not, then something hasn't been compiled. Recompile in HEN_HOUSE/egs++, HEN_HOUSE/egs++/view, and egs_home/tutor7pp. My guess is that you didn't recompile tutor7pp. Also make sure that you're using the freshly compiled egs_view, not the one that comes with the installation. Edit: After fixing that issue, you're right that I'm still not seeing any shape motion for this case. |
Thanks, @rtownson! |
Edit2: I had a typo elsewhere in the input file, you can disregard this. Correct me if I'm wrong, but it seems like E.g. the following seems to do nothing:
Edit: In this case you could just use a dynamic_source or source transformation instead. |
@rtownson, oh now I think I see: getPointSourceDirection applies the transformation when a new source particle is chosen. Just looking over the logic for a parallel beam with a rectangular shape, though, we use EGS_BaseShape::getRandomPoint which then applies T to EGS_RectangularRing::getPoint before returning the incident position, so I'm not sure where the chain is breaking down. Let me know if you'd like me to do more digging! |
@blakewalters I believe I fixed the issue, let me know if you can find any other bugs :) |
The RectangleShape derives from SurfaceShape, which derives from BaseShape, and I have transformed rectangle shapes before if I remember correctly. |
Unless I have only transformed the source itself? |
You're right, I just had a typo in my input file! It's all resolved now. |
Looks good, @rtownson! I've run a couple of other tests and source output is consistent with the (albeit simplistic) dynamic motion of their shapes. One lingering questions concerns the viewing of dynamic particle track files (.syncptracks) using egs_view: What is the "Time window" input in the "Particle tracks" window? Does this control the (max.) fraction of the particle tracks displayed in a given time frame? The default value on launching egs_view is 2.0, which doesn't show any evolution of tracks at all, just the cumulative result. |
Thanks @blakewalters, I changed the default time window to be 0.01, instead of defaulting to showing all of the tracks. I also added a new feature to adjust the number of steps to animate, something I was wanting while making videos for a talk. |
cfea556
to
97152f4
Compare
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.
Nice work, @rtownson!
Allow saving time index to the base source for all simulation objects, as well as support to visualize simulations in time in the viewer.
If user pushes the play button while the simulation is playing it will pause the simulation at the current time index. Pushing play again causes the simulation to restart from paused position. Also, simulations will now play from current time index instead of defaulting to starting at zero. If the current time index is the last one it will set time to zero and start from the beginning.
Run astyle (3.4.11) on all files modified .cpp and .h files in this dynamic geometry addition.
ceb3811
to
3bce6df
Compare
Rebased on the new |
Add a shape that handles dynamic motion, synchronized with the motion of geometries and sources.
3bce6df
to
028756e
Compare
Adjusted the commit titles, reordered and squashed a couple. Clean |
Fix flickering that occurred when dragging the time slider with the mouse. Particle tracks would flash on the screen from a longer time range than the selected window.
Change the time window default to 1% of the simulation duration for tracks visualization. Also add a new input in egs_view for the number of time steps to take in the animation. This allows for better control of the visual speed of the motion.
028756e
to
ea32c5e
Compare
Adjusted one commit message, clean |
This builds on PR #1022 by adding similar support of motion for shapes. This is useful if you're using a shape to define a source shape (e.g. a collimated source target shape), and that shape is meant to be aimed at a geometry that's in motion.