×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

count the number of nodes or elements in a group (PCL)

count the number of nodes or elements in a group (PCL)

count the number of nodes or elements in a group (PCL)

(OP)
Hi,

I would like to use a PCL to count the number of the nodes or elements in a specific group or current group display with a PCL.

May be a function exists ?

Thanks

RE: count the number of nodes or elements in a group (PCL)

If I remember correct, there was a Patran Utility Menu function for this. Try checking all the functions for groups in Patran.

If you can't find any, Patran has 3 main PCL references, and from these, you can find relevant functions to call these elements and nodes after searching for it some time.
I've written a whole Patran menu function before that calls all the nodes and elements in a group and uses these to extract freebody loads. So below I'll put which functions they are and you can try to get them to work according to your needs:


Function for NODEs: db_count_nodes_in_group(group_id_sized(my_numbers),group_node_count(my_numbers))
Function for ELEMENTs: db_count_elems_in_group(group_id_sized(my_numbers),group_elem_count(my_numbers))


As you may figure, "group_id_sized(my_numbers)" & "group_node_count(my_numbers)" are the arrays I used in my own PCL Utility Menu Function Compilation.
So, your "group_id_sized(my_numbers)" will actually be your "input" GROUP ID in Patran - which is assigned by Patran when you create a group (1,2,3...etc).
"group_node_count(my_numbers)" will be the output you will get from this function.
Likewise, "group_elem_count(my_numbers)" will be the other output you will get from the other element count function.

I used "my_numbers" variable to be able to work with 1000-10000 groups at once for the Utility function I was compiling. So, this is the reason why you are seeing it in this format.
If you spend some time (ie. 1-2 weeks) with PCL references, I can assure you that you will figure out how the whole Patran system works and how to customize anything you want not only for PCL session file creations, but also for whole Patran Functions Programming..

Spaceship!!
Aerospace Engineer, M.Sc. / Aircraft Stress Engineer

RE: count the number of nodes or elements in a group (PCL)

(OP)
Hi aerostress82,

Thanks a lot for your answer.

But what do you mean about Patran Functions Programming ? Patran is write with PCL, so what is the difference beetween PCL en Patran Functions Programming ?

RE: count the number of nodes or elements in a group (PCL)

Patran has an interface such as the menu buttons you use on the right and the Utility Menus that are in the top menu buttons.
Patran functions programming is programming a Patran Utility menu like the ones you see when you check the Utilities.

The difference between Patran session files and Patran Utility menu is that, Utility Menu is a function button (compiled by you) built into Patran menus/utilities/or to the right of the screen(at some "sub menu" of Patran) - you can further advance the already compiled menus & icons if you feel the need.

Patran is so customizable and easy to understand (thanks to the Fortran + C coding) that once you feel that you are missing a function that would help you, you could build that function and embed it into Patran.


I did something like this before for a major supplier of Airbus (while doing structural sizing for a primary structure too) and that function alone enabled us to reduce the whole process to 2-3 days instead of 10-15 days (time deducted by %80!!). I'm not working for MSC Software, I just plain love Patran. I also use 3 more FEA pre-processors too. Comparing to all other Patran is a winner to me with someone who knows how to work it..


I would automate most tasks there and spare more time for research in all my projects thanks to Patran again :) (I might have got too excited after the 2nd line-sorry for the long text, just wanted you to know its perks better since you are already using session files)

Spaceship!!
Aerospace Engineer, M.Sc. / Aircraft Stress Engineer

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources