XANSYS Forum Index
    Register    

FAQ    Search    Memberlist    Usergroups    SmartFeedSmartFeed    Profile    Log in
[APDL] Determining Element Shape/Dimensionality
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    XANSYS Forum Index -> XANSYS
Author Message
daniel.diaz
User


Joined: 21 Apr 2015
Posts: 11

PostPosted: Sat Apr 25, 2015 4:33 pm  Reply with quote

Hello Denizens of XANSYS,

I am currently writing an APDL script which would be able to determine what shape an element is and put all selected elements of a certain shape into an element component. Shapes I plan to identify are: 1st and 2nd order bricks, prisms, pyramids, tets, quads, triangles, lines, and points. (15 types total)

In order to do this, I believe I need two types of data for a given element: the number of nodes attached to the element, and its dimensionality. Getting the number of nodes is easy, but the dimensionality, not so much. My current idea is to try and coat an element with different types of mesh200 elements (determined by key option 1) and see what sticks.

Does anyone else have an idea on how to get the dimensionality information more gracefully (perhaps an undocumented ANSYS *get command)? Or is there perhaps another set of data besides dimensionality that I could use to achieve my goal?

Cheers,
_________________
Dan Diaz
Belcan Engineeering
Back to top
View user's profile Send private message Send e-mail
jose.galan
User


Joined: 21 Oct 2008
Posts: 140

PostPosted: Sat Apr 25, 2015 4:55 pm  Reply with quote

Dear Mr. Diaz,

The dimensionality of an element is associated to the element number.

You can obtain the element type with the following command:

*GET, Par, ETYP, element_number, ATTR,ENAM,

For example, for a BEAM3 element, the command returns a 3.

Best regards,

Jose M. Galan

Assistant Prof.

Constr. Eng. Dept.

Universidad de Sevilla

Spain

El 26/04/2015 01:33, daniel.diaz escribió:

Quote:
Hello Denizens of XANSYS,

I am currently writing an APDL script which would be able to determine what shape an element is and put all selected elements of a certain shape into an element component. Shapes I plan to identify are: 1st and 2nd order bricks, prisms, pyramids, tets, quads, triangles, lines, and points. (15 types total)

In order to do this, I believe I need two types of data for a given element: the number of nodes attached to the element, and its dimensionality. Getting the number of nodes is easy, but the dimensionality, not so much. My current idea is to try and coat an element with different types of mesh200 elements (determined by key option 1) and see what sticks.

Does anyone else have an idea on how to get the dimensionality information more gracefully (perhaps an undocumented ANSYS *get command)? Or is there perhaps another set of data besides dimensionality that I could use to achieve my goal?

Cheers,

------------------------
Dan Diaz
Finite Element Analyst
Belcan Engineeering
10200 Anderson Way
Blue Ash, OH 45242


+-------------------------------------------------------------+
| XANSYS web - www.xansys.org/forum [3] |
| The Online Community for users of ANSYS, Inc. Software |
| Hosted by PADT - www.padtinc.com [4] |
| Send administrative requests to xansys-mod@tynecomp.co.uk |
+-------------------------------------------------------------+


Links:
------
[1] http://www.mail2forum.com
[2] http://xansys.org/forum/viewtopic.php?p=97831#97831
[3] http://www.xansys.org/forum
[4] http://www.padtinc.com
+-------------------------------------------------------------+
| XANSYS web - www.xansys.org/forum |
| The Online Community for users of ANSYS, Inc. Software |
| Hosted by PADT - www.padtinc.com |
| Send administrative requests to xansys-mod@tynecomp.co.uk |
+-------------------------------------------------------------+

Post generated using Mail2Forum (http://www.mail2forum.com)
Back to top
View user's profile Send private message
daniel.diaz
User


Joined: 21 Apr 2015
Posts: 11

PostPosted: Sat Apr 25, 2015 6:22 pm  Reply with quote

Dear Mr. Galan,

Thank you for your reply. By the element name method, I would have to hard code into the macro the dimensionality associated with each element type that ANSYS has unless I am missing something and the element name number is more than just a reference number. This was something I was hoping to avoid, unfortunately.

Also, say ANSYS decides to add/replace/remove element types. The macro would then not work for these new element types and so the hard coded list would have to be updated, that is, if someone in the future would remember/take the time to update it.

Cheers,
_________________
Dan Diaz
Belcan Engineeering
Back to top
View user's profile Send private message Send e-mail
jose.galan
User


Joined: 21 Oct 2008
Posts: 140

PostPosted: Sun Apr 26, 2015 11:10 am  Reply with quote

Dear Mr. Diaz,

A 1D array is a simple way of hard coding the element dimensionality
information. This array would have as many rows as element name numbers
in ansys, and it would contain the element dimensionality for each
element name number.

I agree with you that it is not the most elegant way, and it has the
drawbacks that you mention.

Perhaps you may find some more useful information in the following
discussion in xansys from sep 2007:

AW: [Xansys] [APDL] Element dimensionality [1]

http://xansys.org/forum/viewtopic.php?p=66436&sid=dea03f07b377b5e3b60f7d29447b36dd


Best regards,

Jose M. Galan

Assistant Professor

Constr. Eng. Dept.

Univ. Sevilla

Spain



Links:
------
[1]
http://xansys.org/forum/viewtopic.php?t=17495&start=0&postdays=0&postorder=asc&highlight=
+-------------------------------------------------------------+
| XANSYS web - www.xansys.org/forum |
| The Online Community for users of ANSYS, Inc. Software |
| Hosted by PADT - www.padtinc.com |
| Send administrative requests to xansys-mod@tynecomp.co.uk |
+-------------------------------------------------------------+

Post generated using Mail2Forum (http://www.mail2forum.com)
Back to top
View user's profile Send private message
daniel.diaz
User


Joined: 21 Apr 2015
Posts: 11

PostPosted: Sun Apr 26, 2015 5:17 pm  Reply with quote

Dear Mr. Galan,

That was an interesting thread. I hadn't thought of *get-ing the corner angle and warping factor for the elements. After reading up on element warping factors, one part of the thread caught my eye.
Quote:
! 4noded element can be a linear TETRAEDER or a quad SHELL/PLANE element
! to disctinct, we again can use the Shape checking, this time for warpage.
! A SHELL/PLANE has no warpage defined, a TET has

In reality, a 1st order quad shell element could have warpage with not all of its 4 nodes on the same plane while a 1st order tetrahedron does not have warpage in the sense that its warpage is 0 due to all of its faces being triangles. In ANSYS reality, the warpage information of shells/planes may just be un-*get-able. However, the thread is also 8 years old and things could have changed between then and now. Unfortunately, it is the weekend and I cannot test this out immediately.

If the warpage of shell/plane element is now obtainable, we have a problem with all plane elements and also all shell elements that have their 4 nodes are in the same plane.

Cheers,
_________________
Dan Diaz
Belcan Engineeering
Back to top
View user's profile Send private message Send e-mail
peter.attar
User


Joined: 21 Oct 2008
Posts: 67

PostPosted: Sun Apr 26, 2015 5:53 pm  Reply with quote

Just a guess, but there may be a common block variable which holds this information. You would likely have to dig through the common blocks (in the customize/include directory) to find out and then search for
how to use APDL to retrieve it ( I think Sheldon't site has this on it).

Peter

Peter Attar
Associate Professor
The University of Oklahoma
School of Aerospace and Mechanical Engineering
865 Asp Ave.
Felgar Hall Room 212
Norman, OK 73019-1052
phone:405-325-1749
fax:405-325-1088

________________________________________
From: Xansys [xansys-bounces@xansys.org] on behalf of daniel.diaz [ddiaz@belcan.com]
Sent: Sunday, April 26, 2015 7:17 PM
To: xansys@xansys.org
Subject: Re: [Xansys] [APDL] Determining Element Shape/Dimensionality

Dear Mr. Galan,

That was an interesting thread. I hadn't thought of *get-ing the corner angle and warping factor for the elements. After reading up on element warping factors, one part of the thread caught my eye.

Quote:
! 4noded element can be a linear TETRAEDER or a quad SHELL/PLANE element
! to disctinct, we again can use the Shape checking, this time for warpage.
! A SHELL/PLANE has no warpage defined, a TET has


In reality, a 1st order quad shell element could have warpage with not all of its 4 nodes on the same plane while a 1st order tetrahedron does not have warpage in the sense that its warpage is 0 due to all of its faces being triangles. In ANSYS reality, the warpage information of shells/planes may just be un-*get-able. However, the thread is also 8 years old and things could have changed between then and now. Unfortunately, it is the weekend and I cannot test this out immediately.

If the warpage of shell/plane element is now obtainable, we have a problem with all plane elements and also all shell elements that have their 4 nodes are in the same plane.

Cheers,

------------------------
Dan Diaz
Finite Element Analyst
Belcan Engineeering
10200 Anderson Way
Blue Ash, OH 45242






+-------------------------------------------------------------+
| XANSYS web - www.xansys.org/forum |
| The Online Community for users of ANSYS, Inc. Software |
| Hosted by PADT - www.padtinc.com |
| Send administrative requests to xansys-mod@tynecomp.co.uk |
+-------------------------------------------------------------+
+-------------------------------------------------------------+
| XANSYS web - www.xansys.org/forum |
| The Online Community for users of ANSYS, Inc. Software |
| Hosted by PADT - www.padtinc.com |
| Send administrative requests to xansys-mod@tynecomp.co.uk |
+-------------------------------------------------------------+

Post generated using Mail2Forum (http://www.mail2forum.com)
Back to top
View user's profile Send private message
daniel.diaz
User


Joined: 21 Apr 2015
Posts: 11

PostPosted: Mon Apr 27, 2015 7:35 pm  Reply with quote

Dear Mr. Galan and Mr. Attar,

I have good news and bad news. Bad news first. It turns out that my original method of coating the elements with MESH200 elements does not work for all element types. For example, I could not coat SURF154 element nor TARGE170 elements with MESH200 elements. In addition, ANSYS does indeed not report warpage for certain elements like TARGE170 elements. So, coating the elements and getting the warpage are not completely viable options.

Now for the good news. As I was messing around with the *get,ParR,elem,n,shpar,test function, I noticed the PARA option for the test input. As described by ANSYS, PARA is: deviation from parallelism of opposite edges. This is useful because triangle faces do not have opposite edges. Testing the function in ANSYS confirmed this. A tet yielded no results while a first order quad did yield results.

2D elements that I tested were SHELL181, MESH200, PLANE42, SURF154, and TARGE170 and they each gave results if the element in question was not a triangle.

I'm not 100% for sure, but I believe we may have found an option that is quite viable.

Code:

*do,I,1,ecount     !ecount is the length of emin_list
  esel,s,elem,emin_list(I)  !a list of single element numbers for each selected element type
  nsle,s,corner        !bascially collapses 2nd order elements into 1st order elements so we don't have to deal "extra" elements
  *get,ncount(I),node,,count   !total number of corner nodes
  *if,ncount,eq,1,then   !elements with 1 node are points
    dimen(I)=0
  *elseif,ncount,eq,2,then    !elements with 2 corner nodes are lines
    dimen(I)=1
  *elseif,ncount,eq,3,then   !checking whether a tria or something else
    !we could be dealing with, for example, pretension elements for beam modeled bolts.
    !These types of pretension elements have 3 nodes, therefore we need to be able to distinguish them from tria elements.
    e_maxa=
    *get,e_maxa,elem,emin_list(I),shpar,maxa   !getting the max corner angle
    *get,e_maxa_defchk,parm,e_maxa,type   !checking if e_maxa is defined
    *if,e_maxa_defchk,ne,-1,then     !the corner angle is defined, therefore we have a tria element
      dimen(I)=2
    *else
      dimen(I)=-1
    *endif
  *elseif,ncount,eq,4,then   !determining whether a tet or a quad
    e_para=
    *get,e_para,elem,emin_list(I),shpar,para   !getting parallelism deviation
    *get,e_para_defchk,parm,e_para,type    !checking if e_para is defined
    *if,e_para_defchk,eq,-1,then    !e_para is not defined, therefore we have a tet
      dimen(I)=3
    *else         !e_para is defined, therefore we have a quad
      dimen(I)=2
    *endif
  *elseif,ncount,ge,5,then   
  !elements with greater than or equal to 5 nodes are solid elements
  !(not exactly true for pretension elements for solid modeled bolts)
    dimen(I)=3
  *endif
*enddo


Thank you for your help. If you have anything to add, any corrections, or any other ideas, let me know.

Cheers,
_________________
Dan Diaz
Belcan Engineeering
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    XANSYS Forum Index -> XANSYS
All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

sleek template created by Andrew Charron