Escolar Documentos
Profissional Documentos
Cultura Documentos
• Applying Results
• Contour Plot
• Querying Results
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.
• From the result control object, you can access all other result-related
objects including, contour, iso value, tensor, vector etc…
• To apply any type of results, make sure that you have attached a results
file to the model that’s loaded in the animation client.
• Once you have a result control handle, you can get a handle to the
desired control using GetNameCtrlHandle (i.e.
GetContourCtrlHandle, GetTensorCtrlHandle etc…).
• The methods provided by the various control are almost identical (i.e.
SetDataType, SetDataComponent, etc…).
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.
• Get the contour control handle and work with or without having a contour plot
displayed.
• From the result control, use GetContourCtrlHandle to get the contour control.
• Example: Apply a contour plot (assuming bumper.h3d model and results loaded
in the animation window). In this example, create a contour plot showing Stress
vonMises Max
my_result GetContourCtrlHandle my_contour
# set up request
my_contour SetDataType Stress
my_contour SetDataComponent vonMises
my_contour SetLayer Max
# update graphics
anim Draw
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.
• If you type the code on the previous side in TkCon (use copy/paste), you
would expect to see a contour plot; however, no changes appear on the
screen.
• The reason is you have yet to enable drawing of contour plot. To enable
drawing of contour plot, you need two commands before the “anim
Draw” statement:
# enable drawing of contour plot
my_contour SetEnableState true
anim SetDisplayOptions contour true
# update graphics
anim Draw
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.
• After adding these statements, you will actually see a contour plot, but it
is all “gray” color; this is because we are still at the model step (you can
animate the results by pressing on the traffic light to see the contour plot).
• Depending on use case, you can go to last step, for example, by using
the GetNumberOfSimualations command.
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.
Exercise 5.1
• To get data for different time steps, you need to release the Iterator handle as
you set the current time step
# set the current subcase and get number of simulations
set subcase [my_result GetCurrentSubcase]
set sims [my_result GetNumberOfSimulations $subcase]
# loop through sims and set Iterator Handle
for {set step 0} {$step < $sims} {incr step} {
my_result SetCurrentSimulation $step
my_query GetIteratorHandle my_iter
for {my_iter First} {[my_iter Valid]} {my_iter Next} {
my_iter GetDataList
}
# release Iterator Handle
my_iter ReleaseHandle
}
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.
Exercise 5.2
Exercise 5a
Description:
Handles used
Hints
Find out what rules you can use to add entities to a selection set
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.
Exercise 5b
Description:
Handles used
session, project, page, window, client, model, selection set, query, iterator
Hints
Find out what rules you can use to add entities to a selection set
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.
Exercise 5c (optional)
Description: Assuming you have loaded bumper.h3d, applied any contour plot
(elemental of nodal). Create a namespace named myspace. Using the query
control, get the maximum contour value for every time step in every loadcase and
then the overall maximum value for the loadcase. Output the following to the
console for every time step:
- Time step label - Max value
- Entity ID - Part ID
And at the end:
- loadcase label - Max value - Entity ID
- Part ID - Time step label
Handles used
Hints