Extracting certain items of element values from result files #2477
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I see no red box... but whatever it is not relevant. == Update == Regarding getting the arrays using mask. You are right, but you are missing one last step. As you correctly did, you first need to create your masking array ( mapdl.esel('S', 'CENT', 'X', 0, 0.5)
e_mx = mapdl.mesh.n_elem
mapdl.dim('emask' , 'ARRAY' , e_mx , '1')
mapdl.starvget('emask(1)' , 'ELEM' , '1' , 'ESEL') Then you can proceed to retrieve the results into a new array.
Because the The >>> mapdl.allsel()
>>> mapdl.etable("UX", "U", "Z")
>>> mapdl.vmask("emask")
>>> UX = mapdl.get_array('ELEM', item1='ETAB', it1num='UX')
>>> UX[:50]
array([[61.10726809],
[52.17670105],
[49.92137412],
[49.29690002],
[49.09603702],
[ 0. ],
[ 0. ],
[ 0. ],
[ 0. ],
[ 0. ],
[52.17670105],
[42.9878871 ],
[40.6360634 ],
[39.92410881],
[39.6757068 ],
[ 0. ],
[ 0. ],
[ 0. ],
[ 0. ],
[ 0. ]]) If you want to get a condensed array and get rid of the zeros, you need to have some changes in the above code:
Also I would recommend you to run everything in
Interesting question by the way. Thank a lot! |
Beta Was this translation helpful? Give feedback.
I see no red box... but whatever it is not relevant.
== Update ==
Regarding getting the arrays using mask. You are right, but you are missing one last step.
As you correctly did, you first need to create your masking array (
emask
):Then you can proceed to retrieve the results into a new array.
Because the
mapdl.vmask
command does not affect themapdl.etable
command, your table has all the elements.The
mapdl.sta…