Groups not detected in .dat file

35 views
Skip to first unread message

Clément Raynaud

unread,
Mar 20, 2024, 8:42:42 AM3/20/24
to FeResPost
Hi Renaud,

Now that FeResPost is running on my computer (and thanks for your help !), I am trying to manipulate SAMCEF .dat files (first with "simple" codes in order to understand what I am doing).

I have managed to use DataBase attributes (like 'NbrNodes', 'NbrElements'...), but also various methods (like 'iter_node', 'getNodesAssociatedToElements' ...). 
But I faced many issues when I tried to used methods on groups. It seems groups are not detected in the .dat file.

You can see, in the attachments, the SAMCEF .dat file I used (I defined 2 groups), the code and the output I got : 0 groups have been detected.

I also tried to use the method 'Post.readGroupsFromSamcefDat()' and the output was '{}', and with the method 'readGroupsFromPatranSession()' the output was '[]'.

Moreover, I also faced this type of error message : "Group not found in dataBase", which means that groups are not actually detected.

This may be a mistake in the .dat file.

Have a nice day,

Clément
dat_file.PNG
code_and_output.PNG

FeResPost

unread,
Mar 20, 2024, 1:22:31 PM3/20/24
to FeResPost
Hi Clément,

I compared your Samcef data with one example that works on my computer. A definition of groups in my Samcef dat file looks as follows:
.SEL
 GROUPE           1 MAILLES NOM "E_BOT"
 I        3948 J        3992 K           1
 I        4043 J        4080 K           1
 I        4123 J        4155 K           1
 I        4193 J        4223 K           1
 I        4256 J        4284 K           1
 I        4313 J        4336 K           1
 I        4362 J        4382 K           1
 I        4405 J        4422 K           1
 I        4486 J        4490 K           1
 AJOUT        4498        4500        4501        4502
 I        4856 J        5095 K           1
 I        5448 J        5703 K           1
 I        5836 J        5931 K           1
 I        6050 J        6069 K           1
...
Lists of entities are defined with "I J K" loops.

My data file has been created with a ".sauve banque ..." command in Bacon. It is the recommended way to import Samcef models.

Are you sure you create your dat file with a ".sauve banque ... " command ?

Regards,

Renaud

Clément Raynaud

unread,
Mar 21, 2024, 5:17:53 AM3/21/24
to FeResPost
Hi Renaud,

Thanks for your response !

I actually had an error in my .dat file (i had forgotten the 'I' character, and hade made errors in elements ID), but it was not due to the "I J K" loop (which is not mandatory, it is used if you want to select a range of nodes/elements).

The issue came from the different syntaxes allowed in SAMCEF :
- 'MAI', 'MAILLE' and 'MAILLES' are all accepted and correct, but FeResPost does not accept 'MAI'
- Same thing with 'NOE', 'NOEUD' and 'NOEUDS', 'NOE' is not accepted
- Groups number are not mandatory if you give them a name, but it seems that FeResPost always wants one.

I hope this may help other users. (for information, my .dat files are exported from NX).

Finally, the method 'readGroupsFromSamcefDat' (from the 'Post' module) still doesn't work. I can iterate over the groups with 'iter_groupName', but the other method always return '{}'. Here is my code :
groups = Post.readGroupsFromSamcefDat('./my_file.dat')
print(groups)

This is not a big issue since I can use 'iter_groupName'.

Regards,

Clément

FeResPost

unread,
Mar 21, 2024, 1:56:49 PM3/21/24
to FeResPost
Hello Clément,

You cannot expect FeResPost to support every command Bacon accepts. To do this I would have to program the whole Bacon interpreter in FeResPost; with the use of variables (abreviations), formulas,... This is the reason why I recommend to read DAT files exported with Bacon ".sauve banque..." command.

But of course FeResPost has somebugs. And you are more likely to find a bug with Samcef than with Nastran. If you find one, please send me a dat file and your Python script and I can have a look and fix what is wrong in FeResPost.

Regards,

Renaud

Clément Raynaud

unread,
Mar 22, 2024, 6:13:20 AM3/22/24
to FeResPost
Hello Renaud,

Of course, I perfectly understand. I will let you know if I find a bug.

The people I work with don't use directly Bacon. That is why there is sometimes a different syntax.
Have you, somewhere in your files, a document with the syntaxes of Samcef you used to code FeResPost ? Or maybe it is what we can find in the documentation of Samcef (but according to my tests, this is not exactly what is written on the doc).

Thank you again for your time and availability !

Regards,

Clément

FeResPost

unread,
Mar 22, 2024, 1:07:14 PM3/22/24
to FeResPost
Hi Clément,

There is no list of Bacon commands supported by FeResPost. Therefore, it is safer to read DAT files exported from Bacon with the ".sauve banque ..." command.

And it is a very bad idea to look in the commands from Samcef documentation :  most of the commands are not supported by FeResPost.

Conclusion :  use the ".sauve banque ..." command.

Regards,

Renaud

Clément Raynaud

unread,
Mar 25, 2024, 9:37:18 AM3/25/24
to FeResPost
Hi Renaud,

Thanks for your response. 

This is indeed a solution that works : import the .dat file into Bacon, then re-export it with the ".sauve banque <name>" command for use with FeResPost.
Therefore, for other users who write some samcef code by hand, you should do this if you want FeResPost to read it.
With this command, only the main samcef commands are kept (the others are transformed) and FeResPost can read them.

Thanks again for your work on the library, with this "manipulation" I will be able to use it.

Have a nice day,

Regards,

Clément

CheckFEM

unread,
Apr 16, 2024, 6:57:52 AM4/16/24
to fere...@googlegroups.com

hi everyone,

 

Just wanted to tell you that there is a standalone tool (free) which can read samcef .dat files and let you check, display or extract any data by scripts .. a brief description on youtube : https://www.youtube.com/watch?v=gjn9XbrRhcE

 

If anyone is interested in testing it, I can send you the standalone directory with .exe.


Regards,

Ma8di E. PhD


--
You received this message because you are subscribed to the Google Groups "FeResPost" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ferespost+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ferespost/38c0b53c-d3a9-44dc-bc82-3d1188abb4acn%40googlegroups.com.

FeResPost

unread,
Apr 17, 2024, 12:16:20 PM4/17/24
to FeResPost
Hello,

For sure, Samcef users are probably interested in testing your software. I myself no longer use much Samcef these days, but I could transfer you program to colleagues.

You can share a download link to the program.

Regards,

Renaud

Fernando Romagnoli

unread,
Apr 17, 2024, 12:21:42 PM4/17/24
to fere...@googlegroups.com
Hi all, 

the www.checkfem.com seems to not contain the scripts anymore, can anyone share it ?

thanks

CheckFEM

unread,
Apr 17, 2024, 6:55:34 PM4/17/24
to fere...@googlegroups.com
Hi Fernando,

indeed I am in the process of changing site host. I will share a download link to get the software, a checklist and a sample samcef model for quick testing.

Regards,
ma8di

CheckFEM

unread,
Apr 17, 2024, 7:09:16 PM4/17/24
to fere...@googlegroups.com
Hello everyone,

this is the download link :

This is an archive comprising 3 elements: the software directory (standalone), the checklist directory and a samcef model (.dat file). Note: once you read a toto.dat file (this may take several minutes), 2 databases will be created in the same directory: toto.dat_F.h2.db and toto.dat_M.h2.db. Next time you can read the toto.dat_M.h2.db file directly to go faster.

Do not hesitate if you have any questions or suggestions.

Regards,
ma8di




FeResPost

unread,
Apr 21, 2024, 10:28:38 AM4/21/24
to FeResPost

Hello ma8di,

I tested the program with your Samcef example. It looks very cool.

If I can give you some advice: you should propose a smaller example. With more than 800000 elements, the program takes some time to run.

Regards,

Renaud

CheckFEM

unread,
Apr 21, 2024, 2:40:47 PM4/21/24
to fere...@googlegroups.com
Hello Renaud,

I full agree with you. A test example should be very light. I will use a smaller example from now on.

Thank you for your feedback.

ma8di

CheckFEM

unread,
Apr 23, 2024, 11:15:41 AM4/23/24
to fere...@googlegroups.com
https://drive.google.com/file/d/19D5fmWTU5rL0yQh3mAwl1PF79NxiF2WG/view?usp=drivesdk

Hello Samcef users.

 

This is the download link to get a lighter example to test CheckFEM. There are also 2 result files (displacement and VM stress) to try post-processing features :

cid:image001.png@01DA9593.5F0FE7E0

 

Deformed shape :

cid:image002.png@01DA9593.5F0FE7E0

 

Do not forget to set the right unit system : S2 :

cid:image003.png@01DA9594.7D676F00

 

Best regards,

Ma8di

LightSamcefModelWithResultFiles (0).zip
Reply all
Reply to author
Forward
0 new messages