Jump to content
Sign in to follow this  
Joao

Extract element volume

Recommended Posts

Dear all,

 

I need to carry out some calculations and for that, I need to know the volume of each element separately.

 

Is there an easy way I can extract these values from hypermesh or even hyperview?

Share this post


Link to post
Share on other sites
On 2/12/2020 at 9:13 PM, Q.Nguyen-Dai said:

Try:


hm_getvalue elems id=<Elem-ID> dataname=volume

 

How would I apply this command line? Scripting?

Share this post


Link to post
Share on other sites
On 2/15/2020 at 4:10 AM, Q.Nguyen-Dai said:

You can execute this command directly within command window (below of graphical area) or write it into a TCL script.

 

I applied this command but it seems to extract the volume from single elements. I have a component with 1 million + elements so what I need is to extract the volume of every element and save it into a file.

Is there a way to adapt this command to automatically do it? Or is there another way?

Share this post


Link to post
Share on other sites
On 2/24/2020 at 5:23 PM, Joao said:

Thank you!

 

Btw, I also found that you can easily plot and extract it from Hyperview by using derived results

Hey, friend. I'm also trying to extract the volume of all elements in a model. Could you tell me how did you make it in Hyperview? T

Share this post


Link to post
Share on other sites

You could perform this in HV using Result Math. You need to load your result files and choose 'Advance' in Math Template.

image.png.b2425b4209842ad980372fda1b86eca5.png

 

Then, go to 'Derived Results' tab, and create a new expression, giving it a name.

This lets you created derived expressions based on some results, math, etc.

You will edit the expression using the command' Volume()' and save it.

After that, you will have a new result with the name you gave. Contour this result in 'Contour' tab and then use query to request all the elements, then export it as a CSV.

image.thumb.png.4e9d8bb0f76ec3daec1a0e4c7eb06e05.png

 

 

In HM you can use the command line mentioned in above replies with a few changes.

 

#user selects elements and stores in a variable elems_list

*createmarkpanel elems 1 "select elements to calculate volume from:"

set elems_list [hm_getmark elems 1]

*clearmark elem 1

 

$retrieves the volume of all the elements stored in mark 1

eval "*createmark elems 1 $elems_list"

set volume_list [hm_getvalue elems mark=1 dataname=volume] 

*clearmark elems 1

 

#writes the data to a CSV file

set fo [open "dir/filename.csv" w]  ; ### CHANGE THIS ###

foreach elemo $elems_list volo $volume_list {

     puts $fo "$elemo $volo"

}

close $fo

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...