CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   EnSight (https://www.cfd-online.com/Forums/ensight/)
-   -   Retrieve query point coordonate to create a plane passing through this point. (https://www.cfd-online.com/Forums/ensight/169003-retrieve-query-point-coordonate-create-plane-passing-through-point.html)

potofus April 1, 2016 08:57

Retrieve query point coordonate to create a plane passing through this point.
 
Hi everyone,

I am creating a script in shell to modify a command journal from ensight.
The goal is simple, i have created "bricks" of Ensight ' journals that i modify in order to change its display.

example
__________________________
ADD_CASE

case: create_viewport ON
case: apply_context OFF
case: reflect_model_in 'none'

# "case: add Case X"
flag__casenum

#"case: select Case X"
flag__caseselect

part: select_default
part: modify_begin
part: elt_representation 3D_border_2D_full
part: modify_end
data: binary_files_are native
data: format Xdmf2
data: reader_option 'Verbose mode' OFF
data: reader_option 'Enable data freeing' ON
data: shift_time 1.000000 0.000000 0.000000

# "case: select Case X data: replace /myfiles/... "
flag__path
______________________________

By only modifying the "flags" i can make a customised brick of ensight journal that i will add to some other to make everything i want just from input in shell script. ( i don't use Python on purpose ).

but with this you can only input data you want and display it.

I created a query point to show me the maximum point of pressure in a cylinder, and i would like to retrieve the coordinates of this point so that i can use it to create a plane passing through this point ( through the maximum of pressure to visualize).
Is there an Ensight function that can retieve those data and store it in a variable ?

thank you in andvance for your answer :)

Marina G April 5, 2016 11:11

Hi,

It isn't possible to extract the value of the position of a query, and use it for setting the plane tool position with the command language in EnSight. The command language has been designed as a way to register the operations that have been performed in EnSight so that you can play them back easily, not as a way to create complex scripts that include decision-making loops or sections that depend on the outcome of the analysis.

The python API is designed for the latter scope, and indeed what you're asking for can easily be achieved with a python script. I can help you create such a script, if you want

Is there any particular reason why you don't want to use the python API?

Best Regards,

Marina Galvagni
CEI Software Support Engineer

potofus April 6, 2016 07:26

Hi Marina, and thank you for your answer.
I was afraid of that answer, but i realised it slowly after posting my message : the command language is not a programming one :).

My goal is to create a kind of "template" for a frequent use of Ensight in a specific configuration ( 3 viewports, fixed and determined camera angle, fixed color, fixed clips, etc.). In this template, only a few line would change ( the PATH of the data for instance).

Since the manipulation of this template was simple, i thought about using text editor instead of Python. Moreover, this work is for people who are using Ensight without using Python and with few changes in the output => the ratio (time saved by the method)/(time spend learning the code) seemed more interesting with Ensight command than Python.... but now it is different.

In the meantime, i created another small command program that execute Ensight in Batch mode only to retrieve the query point coordonate and save them. In this case i have the coordonate before executing my Main command program... but it takes time.

I will start learning Python before coming back to you on that matter. I thank you a lot for your time and wish you a good day :)

Potofus


All times are GMT -4. The time now is 01:52.