Angle in plots of vertical sections

New ideas for code development
Post Reply
gtardini
Posts: 7
Joined: Mon Dec 18, 2017 4:52 pm
Security question 1: No
Security question 2: 72

Angle in plots of vertical sections

Post by gtardini » Fri Feb 21, 2020 3:52 pm

I wonder whether we could have an option to plot vertical sections not just as 'xz' or 'yz', but also allowing for angles. Say, I'd like to plot the section at 45 deg between the x and y axes, going through x=0, y=0.
I am not interested in rotating the whole universe, i.e. the whole calculation, but if that's the easiest workaround I'd be content with that solution.
I am posting it here because I think the option does not exist yet, if I am wrong please point me to the relevant forum thread or wiki.

Giovanni

Ville Valtavirta
Posts: 450
Joined: Fri Sep 07, 2012 1:43 pm
Security question 1: No
Security question 2: 92

Re: Angle in plots of vertical sections

Post by Ville Valtavirta » Mon Feb 24, 2020 11:22 am

Hi,

you are correct in that this feature does not exist yet. The easiest way to do this is, as you note, to apply a transformation for the whole geometry before plotting.

I imagine a general way to implement such a thing would be to have a possibility to link a trans card into a plot card so that the transformation will be applied only for that plot, but the current workaround seems to be not too tricky and applicable for most of the cases.

-Ville

gtardini
Posts: 7
Joined: Mon Dec 18, 2017 4:52 pm
Security question 1: No
Security question 2: 72

Re: Angle in plots of vertical sections

Post by gtardini » Mon Feb 24, 2020 12:09 pm

I see. I would apply the rotation myself, but the slicing happens rather deep in Serpent2. I am intercepting the geometry in a python wrapper, using the c funtion "getGeometryPlotMatrix" from pythonplotter.c , and that's already cut (2D). Either there's a way to fetch the whole 3D geometry (it does not seem to be the case), or I'd have to write a "double" of geometryplotter.c with the option of an angle (plus a "pivot" axis for rotation).
Last edited by gtardini on Mon Feb 24, 2020 4:45 pm, edited 1 time in total.

gtardini
Posts: 7
Joined: Mon Dec 18, 2017 4:52 pm
Security question 1: No
Security question 2: 72

Re: Angle in plots of vertical sections

Post by gtardini » Mon Feb 24, 2020 4:45 pm

I took the solution (within a python script):
1) duplicate the serpent input file into a temporary one, inserting all the files pointed by "includes" (it should be done recursively at some point)
2) parse the solids' names
3) append to the temporary file a line like

Code: Select all

trans U <solid_name> 0. 0. 0. 0. 0. 1. <angle>
for each solid

I am not sure it's a complete work-around, it works for my cases.

Post Reply