Modal analysis using substructuring strategy

  • Quentin
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 10 months ago - 8 years 10 months ago #8140 by Quentin
Hi Richard,

I should have thank you earlier ! But it's never too late, so thank you for your answer ! My three previous points are now not a problem anymore, and this is awesome. I worked on very simple problem, but now I'm trying to write the big code !

I do have all the geometries I need to construct the whole model. But now the only thing which will be annoying is to get the local coordinates of each interface (coordinates of the group of nodes in each substructure). My objective right now, is to extract coordinates (maybe using a function like CREA_TABLE ???), then extract the right values and create the exact coordinates (global base) of all the interfaces by using a python script.

I do not know if I'm quite clear, so I advise you to take a look at the little graphic I made about the general idea.

Best,
Quentin

Scheme
Last edit: 8 years 10 months ago by Quentin. Reason: Attachments

Please Log in or Create an account to join the conversation.

More
8 years 10 months ago #8142 by RichardS
Hello Quentin,
nice that you advance that fast with your project!

If you want to get coordinates from groups of nodes or nodes directly, I think there are better ways of doing that then with crea table.
There is a dedicated method which allows you to access the whole mesh data structure as a python object. Here's an example code snippet:
    from Utilitai.partition import MAIL_PY
    from Utilitai.Table import Table

    # read the mesh as usual
    MESH = LIRE_MAILLAGE(...)

    meshPY = MAIL_PY()

    # now meshPY is a python mesh object which is easily accessable and manipulatible
    meshPY.FromAster(MESH)

   # access some data
    nb_elem = meshPY.dime_maillage[2] # number of elements
    nb_nodes = meshPY.dime_maillage[0] # number of nodes
    elementCons = meshPy.co # element connectivity
    nodeCoords = meshPy.cn # node coordionates
    elementGroups = meshPy.gma # element groups dict
    nodeGroups = meshPy.gno # node groups dict

You will find a detailed description of the available options in the Utilitai/partition.py source code.
You can also manipulate the mesh and transform it back into a Code_Aster mesh object to run your calculation on it.

Concerning your method, I'm not really confident to judge it since I never worked with substructures, but it seems perfectly reasonable.

Best,
Richard

SimScale - Engineering Simulation in your browser!

Please Log in or Create an account to join the conversation.

  • Quentin
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 10 months ago - 8 years 10 months ago #8143 by Quentin
Hi Richard,

That's what I was thinking about, using python must be the right choice. But It's been a long time I did not use it. Do you know a good reader/writer of python script for linux, It might help a bit more than the gedit app I'm using right now^^. I don't really have the time to do the things "correctly" (doing tutorials for baby users etc...).

What I really need, is the nature of each OBJECT : dimension, type, etc... of "meshPY.gno".
For now, all I have succeeded in, is extract mesh, and write the number of nodes in a ".txt"

I don't get how I can have the help of such functions :
"You will find a detailed description of the available options in the Utilitai/partition.py source code. "
What does it mean ? May you explain me as if I had 2 years old, like click there, then there. I was unable to get any information on the majestic google. Should I use a command window typing "python", then using help after loading the library ?
Last edit: 8 years 10 months ago by Quentin. Reason: Correct grammar

Please Log in or Create an account to join the conversation.

More
8 years 10 months ago - 8 years 10 months ago #8144 by RichardS
Hello,
sure:
- go to the directory where you installed Code_Aster
- got to ASTERVERS/lib/aster/Utilitai and open the file partition.py (for me ASTERVERS=11.6)
- read it (especially the "EXEMPLE D'UTILISATION" of the MAIL_PA class)

Best,
Richard

SimScale - Engineering Simulation in your browser!
Last edit: 8 years 10 months ago by RichardS.

Please Log in or Create an account to join the conversation.

  • Quentin
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 10 months ago - 8 years 10 months ago #8145 by Quentin
I think I have a problem, the computer can't find anywhere (in the whole computer) a folder named "Utilitai" or a file named "partition.py".

The command I used "find /home partition.py" and "find /home Utilitai"

Any idea where it can be hidden ? My salome_meca installation is in /home/qmercier/salome_meca

Plus, it's kinda weird because aster works correctly, and the library as well. I have succeeded writing a file with the number of nodes, and nodes group coordinates.

Last question, is there any object that contain the name of the group ? Something like "mesh.gno.name"
Last edit: 8 years 10 months ago by Quentin.

Please Log in or Create an account to join the conversation.

More
8 years 10 months ago #8146 by RichardS

Gavroche wrote: The command I used "find /home partition.py" and "find /home Utilitai"

Try:
locate partition.py

Gavroche wrote: Last question, is there any object that contain the name of the group ? Something like "mesh.gno.name"

I think its a dictionary where the key is the group name and the value is the list with the nodes belonging to the group.
So mesh.gno.keys() would return the list with all node group names and mesh.gno.get("specific_group_name")
would return the list of nodes that are in that group (if the node group with name "specific_group_name" exists, otherwise it would return None).

Best,
Richard

Best,
Richard

SimScale - Engineering Simulation in your browser!

Please Log in or Create an account to join the conversation.

Moderators: catux
Time to create page: 0.171 seconds
Powered by Kunena Forum