Error attaching/reading samcef FAC/DES files with version 4.5.2

38 views
Skip to first unread message

Olivier De Smet

unread,
Oct 23, 2019, 8:11:42 AM10/23/19
to FeResPost
Using version 4.5.2 linux IA64 version with python3.7, it seems that the following header of the DES file leads to an error :

Head = 0 400 0 6 1 

--------------------------
Attaching "XXXXXXXX_dy.fac"...Head =      0   400     0     6     1
Error in function void postLib::samcef::fac::desFacStream::getNextValueTypes(int&, int&) const (SAMCEF/desFac/desFacStream.cpp:223) :
   unexpected header
Error caught in :  SAMCEF/desFac/desFacStream.cpp:226
    in function :  void postLib::samcef::fac::desFacStream::getNextValueTypes(int&, int&) const
    with message :  
Error caught in :  SAMCEF/desFac/desFacStream.cpp:871
    in function :  bool postLib::samcef::fac::desFacStream::readNextBlocks(bool)
    with message :  
Error caught in :  SAMCEF/desFac/desFacStream.cpp:1007
    in function :  void postLib::samcef::fac::desFacStream::readNextTables(bool, int)
    with message :  
Error has occured in fac::attach.
   Last value of resCode is 850
Error in function void postLib::samcef::fac::attachToDb(postLib::samcef::dataBase&, std::string, std::string, const std::vector<int>&, const std::vector<std::basic_string<char> >&) (SAMCEF/desFac/fac.cpp:541) :
   rethrowing
Error caught in :  SAMCEF/desFac/fac.cpp:662
    in function :  void postLib::samcef::fac::attachToDb(postLib::samcef::dataBase&, std::string, std::string, const std::vector<int>&, const std::vector<std::basic_string<char> >&)
    with message :  
Error caught in :  SAMCEF/dataBase/attachments.cpp:48
    in function :  void postLib::samcef::dataBase::attachDesFac(std::string, std::string, const std::vector<int>&, const std::vector<std::basic_string<char> >&)
    with message :  
Error caught in :  SAMCEF/PYTHON/SamcefDb.cpp:282
   in function :  SamcefDb_attachDesFac
   with message :  

.../...

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/olivier/.vscode/extensions/ms-python.python-2019.10.41019/pythonFiles/ptvsd_launcher.py", line 43, in <module>
    main(ptvsdArgs)
  File "/home/olivier/.vscode/extensions/ms-python.python-2019.10.41019/pythonFiles/lib/python/old_ptvsd/ptvsd/__main__.py", line 432, in main
    run()
  File "/home/olivier/.vscode/extensions/ms-python.python-2019.10.41019/pythonFiles/lib/python/old_ptvsd/ptvsd/__main__.py", line 316, in run_file
    runpy.run_path(target, run_name='__main__')
  File "/usr/local/lib/python3.7/runpy.py", line 263, in run_path
    pkg_name=pkg_name, script_name=fname)
  File "/usr/local/lib/python3.7/runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/olivier/Documents/VsCode/FEA/src/ZZZZZZZZ/post.py", line 33, in <module>
    meca.attachDesFac(BaseDir+Samcef+'.des', BaseDir+Samcef+'.fac')
SystemError: <built-in method attachDesFac of SamcefDb object at 0x7f62ebcb0e70> returned a result with an error set
Delete Attachment "../../data/XXXXXXXX_dy.fac"...    Closing file "../../data/XXXXXXXX_dy.fac".
--------------------------

Looking at the source code, there is no match to take care of this kind of header

in the DES file the line is looking like
--------------------------
   20    0
    0  400    0    6    1  1850  0  4  6  4  0
    0  104    0    9    1 ...
--------------------------

Using attachDesFac or readDesFac method leads to the same error.

Regards,

Olivier

FeResPost

unread,
Oct 23, 2019, 11:30:49 AM10/23/19
to FeResPost

Hello Olivier,

I'm sorry to hear that there is a problem in reading Samcef results.

The problem is related to the fact that your result files contain information the reading of which is not supported by FeResPost. The offending number is the "400" that appears in the lines you have extracted from the DES file. It might also be related to new outputs produced by Samcef. (I do not update my Samcef test files very frequently.)

Actually, I never found this code in the Samcef examples I have used for FeResPost development. Could you tell me:
  • Which kind of analysis you have performed?
  • Which version of Samcef you are using?
  • Have you been using "special features" of Samcef?
  • Is it the first time you are using FeResPost to read Samcef results?
  • And if not, did you already read Samcef results successfully?
Could you send me your data (DAT, DES and FAC files) to help me debug FeResPost? (I think, if I have an example with the bug, I can fix the problem this weekend.)

I will send you an E-mail adress so that you can send me your files...

Regards,

Renaud

Olivier De Smet

unread,
Oct 24, 2019, 4:59:23 AM10/24/19
to FeResPost
I do not use samcef myself, the files came from an industrial partner (so are confidentials)

What I can give from the .dat file is
--------------
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
S S
S .................................. S
S . . S A M C E F 2 0 1 3 S
S . D Y N A M . S
S . . Rev 15-SL2 (15.1-03) S
S .................................. ENTIERS COURTS 19-Sep-13 S
S S
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
.DYNAM &
!
! NATURAL FREQUENCY (DYNAM)
!
MODE I 0 LECT 132 M 1 ECHO 1
!---------------------------------------

!---------------------------------------
! Miscellaneous
!---------------------------------------
.SAM NOP1 -2 NOP2 0 NOP3 0 NOP4 0 NOP5 -1 NOP6 -1
.SAM DEGRE 2 MF 1
.GEL TEMP 20
.OPT METHODE 3
.SAM NALG 3 NVAL 20
.SAM ISTO 8
!---------------------------------------
! Results Selection
!---------------------------------------
.SAI ARCHIVE STRUCTURE $
STYPE -3310 -3331 -3332 -3320 3411 3431 -3435 -3436 $
-3437 -3438 -3439 -3440 -3450 1320 1411 1431 -1435 $
-1436 -1439 -1440 -1450 -1441 -1442 -1443 -1451 $
-1452 -1453 -1407 -1408 -1409 -1417 -1418 -1419 $
-1447 -1448 -1449 -1457 -1458 -1459 -1477 -1478 $
-1479 -1487 -1488 -1489 3452 3381 3448 221 163
!---------------------------------------
--------------
so the following data are requested :
3452 3-D tensor/element : Natural strain tensor
3381 scalar/element : Equivalent plastic strain (mid. GP)
3448 2-D tensor/element : 2D Cauchy stress tensor (middle GP)
221 vector/node : Nodal reaction
163 nodal displacement : Nodal displacements (DX,DY,DZ)

I hope this information could help

FeResPost

unread,
Oct 25, 2019, 3:29:24 AM10/25/19
to FeResPost

Olivier,

Thank you for your answer. So I understand you are performing a modal analysis. In principle, FeResPost can read modal analysis results but it has been tested on one example only with outputs limited to displacements and reaction forces. So the problem might result from the result codes that you archive and which are not supported by FeResPost.

Most users, including myself, use FeResPost to post-process Nastran results and I spent more time developing and debugging the support of Nastran than Samcef. This is why you are more likely to find bugs in Samcef part.

At the moment, I am not ready to spend time to produce Samcef examples and test them. Therefore, I suggest this deal:
  • You provide me examples.
  • I test and debug FeResPost.
If you cannot send me the initial example, then I will ask you a simple model that leads to the same bug.

Regards,

Renaud

FeResPost

unread,
Nov 11, 2019, 2:34:27 AM11/11/19
to FeResPost

Olivier,

I managed to reproduce your bug by inserting your result code requests into an existing Samcef modal analysis data file.

I made a few modifications in the source code and, at least in my case, fixed the problem. The new source code and compiled binaries are available in the download section of FeResPost (LATEST_DEV --> VERSION_452_20191110/*).

I expect it will work with your example as well. Would you be so kind as to test the new version and tell me if it solves your problem?

Thanks in advance,

Renaud
Reply all
Reply to author
Forward
0 new messages