GithubHelp home page GithubHelp logo

dr-bill-c / mystran Goto Github PK

View Code? Open in Web Editor NEW
59.0 4.0 28.0 52.43 MB

MYSTRAN is a general purpose finite element analysis solver

License: MIT License

Fortran 99.95% CMake 0.04% C 0.01%
fortran nastran finite-element-analysis

mystran's People

Contributors

bruno02468 avatar dr-bill-c avatar johndn90 avatar mystransolver avatar stevedoyle2 avatar zchlrnr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mystran's Issues

Build fails under linux: index variable redefined in procedure

Build fails on my system using gfortran 12.1 and cmake 3.23. The error is the following:

[ 39%] Building Fortran object CMakeFiles/LK1.dir/Source/LK1/L1B/CORD_PROC.f90.o
/usr/bin/f95 -DINTEGER_STAR_8 -I/home/miguel/src/MYSTRAN/Source/INCLUDE -I/home/miguel/src/MYSTRAN/superlu-5.2.2/SRC -I/home/miguel/src/MYSTRAN/f2c/include -g -JBinaries/mod -c /home/miguel/src/MYSTRAN/Source/LK1/L1B/CORD_PROC.f90 -o CMakeFiles/LK1.dir/Source/LK1/L1B/CORD_PROC.f90.o
/home/miguel/src/MYSTRAN/Source/LK1/L1B/CORD_PROC.f90:1447:59:

  408 |                               IF (PRTCORD == 2) CALL PARAM_PRTCORD_OUTPUT ( '33' )
      |                                                                                  2
......
 1447 |          WRITE(F06,7302) CID, GA(J), CIDA, (RGA(J,K),K=1,3)
      |                                                           1
Error: Index variable ‘k’ redefined at (1) in procedure ‘param_prtcord_output’ called from within DO loop at (2)
/home/miguel/src/MYSTRAN/Source/LK1/L1B/CORD_PROC.f90:1448:59:

  408 |                               IF (PRTCORD == 2) CALL PARAM_PRTCORD_OUTPUT ( '33' )
      |                                                                                  2
......
 1448 |          WRITE(F06,7302) CID, GB(J), CIDB, (RGB(J,K),K=1,3)
      |                                                           1
Error: Index variable ‘k’ redefined at (1) in procedure ‘param_prtcord_output’ called from within DO loop at (2)
/home/miguel/src/MYSTRAN/Source/LK1/L1B/CORD_PROC.f90:1449:59:

  408 |                               IF (PRTCORD == 2) CALL PARAM_PRTCORD_OUTPUT ( '33' )
      |                                                                                  2
......
 1449 |          WRITE(F06,7302) CID, GC(J), CIDC, (RGC(J,K),K=1,3)
      |                                                           1
Error: Index variable ‘k’ redefined at (1) in procedure ‘param_prtcord_output’ called from within DO loop at (2)
make[2]: *** [CMakeFiles/LK1.dir/build.make:1999: CMakeFiles/LK1.dir/Source/LK1/L1B/CORD_PROC.f90.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:360: CMakeFiles/LK1.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Apparently in fortran index variables cannot be redefined inside the loop, so this code wont compile. I dont know if there are any options available in the compiler to allow this. Maybe the loops should be rewritten as explained here? https://stackoverflow.com/a/64838060

CBUSH non-null length element

I was comparing some results (CBAR and CBUSH only) against NX-NASTRAN and found issues with non-null length CBUSH. Checking `EMG/EMG3/BUSH.f90 (is it the good file?) we can indeed see that CBUSH stiffness matrix is not appropriate for length > 0.

I can provide test-cases and matrix formulation if required.

Thanks

MYSTRAN v13.1: CBUSH Engr Forces outputs are wrong

bulk_model.zip

In the attached archive, you will find:

  • bulk.model.nas
  • bulk_model-NX.f06
  • bulk_model-MYSTRAN.F06

model

Issues are found in both F06 and NEU outputs for CBUSH internal forces.

Displacements and boundary reactions are OK.
Internal forces for BARs are OK.

image

I suspect that the X and Y blocked DOF on the upper node of CBUSHes are interfering with element internal forces calculations.

libf2c.so: undefined reference to `MAIN__

I am following the instructions in the pdf to build on a CentOS 7 system. The compilation gets to 100% but then errors out with this message:

/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/libf2c.so: undefined reference to `MAIN__'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/mystran.dir/build.make:21936: Binaries/mystran] Error 1
make[1]: *** [CMakeFiles/Makefile2:421: CMakeFiles/mystran.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

I have installed f2c and f2c-libs via yum. I downloaded the installation files via:

wget https://github.com/dr-bill-c/MYSTRAN/archive/refs/heads/master.zip

MYSTRAN V13.1 CBAR + offset is wrong

test_case_02.zip
In the attached archive are found:

  • test_case_02.nas
  • test_case_02_NX.f06
  • test_case_02_failures.xlsx

failures are found in SPC forces (reactions) and CBAR Engr Forces

The red values in the XLSX files do not match between "Actual" (MSYTRAN) and "Expected" (NX).

[edit] when offset is the same at both extremities, results are OK

[feature request: introduce K6ROT] Autospc shouldn't be required

[edit] In the current version, with the lack of K6ROT parameter, this is the intended behavior. I turn the bug report to feature request to keep track of it. @dr-bill-c, feel free to close it if you want.
[/edit]

The attached simply-supported 4x4 CQUAD4 plate is constrained on its boundaries (SPC=123).

CQUAD_plate_4x4.zip

MYSTRAN (Version 13.2a - Oct 05 2021) fails to run it when AUTOSPC is deactivated with the following message:

*ERROR  9903: SUPERLU SPARSE SOLVER HAS FAILED WITH INFO =           78 IN SUBR SYM_MAT_DECOMP_SUPRLU CALLED BY SUBR LINK3

When AUTOSPC is activated, F06 reports that MYSTRAN is constraining Axis #6 for all the 25 nodes:

 *INFORMATION: AUTOSPC Summary, Stage 1 after identification of AUTOSPC's at the grid level                                                 

                                     AUTOSPC_RAT = 1.000000E-08

                       Number of DOF's identified for AUTOSPC in component  1         =            0
                       Number of DOF's identified for AUTOSPC in component  2         =            0
                       Number of DOF's identified for AUTOSPC in component  3         =            0
                       Number of DOF's identified for AUTOSPC in component  4         =            0
                       Number of DOF's identified for AUTOSPC in component  5         =            0
                       Number of DOF's identified for AUTOSPC in component  6         =           25
                                                                                        ------------
                       Total number of DOF's identified in this stage                 =           25

cmake 3.18

Is really cmake 3.18 needed for Mystran? On Debian buster only 3.13.4 is installed?

cheers bernd

Improve intel portability in subroutine RESTART_DATA_FOR_L3

In subroutine RESTART_DATA_FOR_L3 the following CALL OUTA_HERE gives a compile error in debug configuration with the intel compiler. To enhance the portability, it is suggested to edit the line to CALL OUTA_HERE ( 'N' ) or in any case passing the intended actual parameter

Memory leaks and uninitialized data reported from Valgrind

We are using mystran as part of a larger framework where we invoke mystran via a system call. To ensure we catch bugs in our code we run our framework through valgrind on a regular basis. However, because mystran does not free all allocated memory before exiting, we are getting false positives of memory leaks that cannot be suppressed. Would it be possible to free all allocated memory at the end of the main routine in mystran? Here is a list of leaks reported by valgrind, which may not be complete:

==1083443==    by 0x1A8C61: allocate_dof_tables_ (ALLOCATE_DOF_TABLES.f90:169)
==1083443==    by 0x38B0FE: link0_ (LINK0.f90:817)
==1083443==    by 0x10B31B: MAIN__ (MYSTRAN.f90:219)
==1083443==    by 0x10CF88: main (MYSTRAN.f90:70)

==1083443==    by 0x1A815B: allocate_dof_tables_ (ALLOCATE_DOF_TABLES.f90:115)
==1083443==    by 0x38B0E1: link0_ (LINK0.f90:816)
==1083443==    by 0x10B31B: MAIN__ (MYSTRAN.f90:219)
==1083443==    by 0x10CF88: main (MYSTRAN.f90:70)

==1083443==    by 0x19A8FC: allocate_col_vec_ (ALLOCATE_COL_VEC.f90:89)
==1083443==    by 0x53DE45: link9_ (LINK9.f90:772)
==1083443==    by 0x10C01C: MAIN__ (MYSTRAN.f90:322)
==1083443==    by 0x10CF88: main (MYSTRAN.f90:70)

==1083443==    by 0x1E5A4F: allocate_model_stuf_ (ALLOCATE_MODEL_STUF.f90:2560)
==1083443==    by 0x38F219: link1_ (LINK1.f90:146)
==1083443==    by 0x10B8C8: MAIN__ (MYSTRAN.f90:256)
==1083443==    by 0x10CF88: main (MYSTRAN.f90:70)

==1083443==    by 0x1C1EDC: allocate_misc_mat_ (ALLOCATE_MISC_MAT.f90:88)
==1083443==    by 0x5235F4: link5_ (LINK5.f90:534)
==1083443==    by 0x10BA24: MAIN__ (MYSTRAN.f90:284)
==1083443==    by 0x10CF88: main (MYSTRAN.f90:70)

==1083443==    by 0x1A86DF: allocate_dof_tables_ (ALLOCATE_DOF_TABLES.f90:143)
==1083443==    by 0x38B11B: link0_ (LINK0.f90:818)
==1083443==    by 0x10B31B: MAIN__ (MYSTRAN.f90:219)
==1083443==    by 0x10CF88: main (MYSTRAN.f90:70)

==1083443==    by 0x1DE46A: allocate_model_stuf_ (ALLOCATE_MODEL_STUF.f90:2039)
==1083443==    by 0x387AB9: link0_ (LINK0.f90:341)
==1083443==    by 0x10B31B: MAIN__ (MYSTRAN.f90:219)
==1083443==    by 0x10CF88: main (MYSTRAN.f90:70)

==1083443==    by 0x1DDE1F: allocate_model_stuf_ (ALLOCATE_MODEL_STUF.f90:2012)
==1083443==    by 0x387AB9: link0_ (LINK0.f90:341)
==1083443==    by 0x10B31B: MAIN__ (MYSTRAN.f90:219)
==1083443==    by 0x10CF88: main (MYSTRAN.f90:70)

==1083443==    by 0x1A7B80: allocate_dof_tables_ (ALLOCATE_DOF_TABLES.f90:87)
==1083443==    by 0x38B0C4: link0_ (LINK0.f90:815)
==1083443==    by 0x10B31B: MAIN__ (MYSTRAN.f90:219)
==1083443==    by 0x10CF88: main (MYSTRAN.f90:70)

==1083443==    by 0x1E2E7E: allocate_model_stuf_ (ALLOCATE_MODEL_STUF.f90:2369)
==1083443==    by 0x38903A: link0_ (LINK0.f90:561)
==1083443==    by 0x10B31B: MAIN__ (MYSTRAN.f90:219)
==1083443==    by 0x10CF88: main (MYSTRAN.f90:70)

==1083443==    by 0x1E28C3: allocate_model_stuf_ (ALLOCATE_MODEL_STUF.f90:2344)
==1083443==    by 0x38903A: link0_ (LINK0.f90:561)
==1083443==    by 0x10B31B: MAIN__ (MYSTRAN.f90:219)
==1083443==    by 0x10CF88: main (MYSTRAN.f90:70)

==1083443==    by 0x1E22DE: allocate_model_stuf_ (ALLOCATE_MODEL_STUF.f90:2317)
==1083443==    by 0x38901D: link0_ (LINK0.f90:560)
==1083443==    by 0x10B31B: MAIN__ (MYSTRAN.f90:219)
==1083443==    by 0x10CF88: main (MYSTRAN.f90:70)

In addition, valgrind reports some use of uninitialized data:

==1083443== Conditional jump or move depends on uninitialised value(s)
==1083443==    at 0x53FB5B: link9_ (LINK9.f90:981)
==1083443==    by 0x10C01C: MAIN__ (MYSTRAN.f90:322)
==1083443==    by 0x10CF88: main (MYSTRAN.f90:70)

I'm happy to help test out updated code designed to free this memory.

Compile error: "Index variable ‘k’ redefined in procedure ‘param_prtcord_output’"

Hi there,
I just tried to compile MYSTRAN on Linux with Cmake / make, and got this error:

$ cmake .
$ make -j 4
Consolidate compiler generated dependencies of target arithchk
[  0%] Building C object CMakeFiles/arithchk.dir/f2c/arithchk.c.o
/tmp/mystran/f2c/arithchk.c: In function ‘ccheck’:
/tmp/mystran/f2c/arithchk.c:127:9: warning: format not a string literal and no format arguments [-Wformat-security]
  127 |         Cray1 = printf(emptyfmt) < 0 ? 0 : 4617762;
      |         ^~~~~
[  0%] Linking C executable f2c/arithchk
[  0%] Built target arithchk
[  0%] Generating f2c/include/arith.h
Consolidate compiler generated dependencies of target f2c
[  0%] Building C object CMakeFiles/f2c.dir/f2c/abort_.c.o
[  0%] Building C object CMakeFiles/f2c.dir/f2c/arithchk.c.o
/tmp/mystran/f2c/arithchk.c: In function ‘ccheck’:
/tmp/mystran/f2c/arithchk.c:127:9: warning: format not a string literal and no format arguments [-Wformat-security]
  127 |         Cray1 = printf(emptyfmt) < 0 ? 0 : 4617762;
      |         ^~~~~
[  0%] Building C object CMakeFiles/f2c.dir/f2c/backspac.c.o
[  0%] Building C object CMakeFiles/f2c.dir/f2c/c_abs.c.o
[  0%] Building C object CMakeFiles/f2c.dir/f2c/c_cos.c.o
[  0%] Building C object CMakeFiles/f2c.dir/f2c/c_div.c.o
[  0%] Building C object CMakeFiles/f2c.dir/f2c/c_exp.c.o
[  0%] Building C object CMakeFiles/f2c.dir/f2c/c_log.c.o
[  0%] Building C object CMakeFiles/f2c.dir/f2c/c_sin.c.o
[  0%] Building C object CMakeFiles/f2c.dir/f2c/c_sqrt.c.o
[  0%] Building C object CMakeFiles/f2c.dir/f2c/cabs.c.o
[  0%] Building C object CMakeFiles/f2c.dir/f2c/close.c.o
[  0%] Building C object CMakeFiles/f2c.dir/f2c/ctype.c.o
[  1%] Building C object CMakeFiles/f2c.dir/f2c/d_abs.c.o
[  1%] Building C object CMakeFiles/f2c.dir/f2c/d_acos.c.o
[  1%] Building C object CMakeFiles/f2c.dir/f2c/d_asin.c.o
[  1%] Building C object CMakeFiles/f2c.dir/f2c/d_atan.c.o
[  1%] Building C object CMakeFiles/f2c.dir/f2c/d_atn2.c.o
[  1%] Building C object CMakeFiles/f2c.dir/f2c/d_cnjg.c.o
[  1%] Building C object CMakeFiles/f2c.dir/f2c/d_cos.c.o
[  1%] Building C object CMakeFiles/f2c.dir/f2c/d_cosh.c.o
[  1%] Building C object CMakeFiles/f2c.dir/f2c/d_dim.c.o
[  1%] Building C object CMakeFiles/f2c.dir/f2c/d_exp.c.o
[  1%] Building C object CMakeFiles/f2c.dir/f2c/d_imag.c.o
[  1%] Building C object CMakeFiles/f2c.dir/f2c/d_int.c.o
[  1%] Building C object CMakeFiles/f2c.dir/f2c/d_lg10.c.o

.
.
.


[ 43%] Building Fortran object CMakeFiles/LK1.dir/Source/LK1/L1B/CORD_PROC.f90.o
/tmp/mystran/Source/LK1/L1B/CORD_PROC.f90:1447:59:

  408 |                               IF (PRTCORD == 2) CALL PARAM_PRTCORD_OUTPUT ( '33' )
      |                                                                                  2
......
 1447 |          WRITE(F06,7302) CID, GA(J), CIDA, (RGA(J,K),K=1,3)
      |                                                           1
Error: Index variable ‘k’ redefined at (1) in procedure ‘param_prtcord_output’ called from within DO loop at (2)
/tmp/mystran/Source/LK1/L1B/CORD_PROC.f90:1448:59:

  408 |                               IF (PRTCORD == 2) CALL PARAM_PRTCORD_OUTPUT ( '33' )
      |                                                                                  2
......
 1448 |          WRITE(F06,7302) CID, GB(J), CIDB, (RGB(J,K),K=1,3)
      |                                                           1
Error: Index variable ‘k’ redefined at (1) in procedure ‘param_prtcord_output’ called from within DO loop at (2)
/tmp/mystran/Source/LK1/L1B/CORD_PROC.f90:1449:59:

  408 |                               IF (PRTCORD == 2) CALL PARAM_PRTCORD_OUTPUT ( '33' )
      |                                                                                  2
......
 1449 |          WRITE(F06,7302) CID, GC(J), CIDC, (RGC(J,K),K=1,3)
      |                                                           1
Error: Index variable ‘k’ redefined at (1) in procedure ‘param_prtcord_output’ called from within DO loop at (2)
make[2]: *** [CMakeFiles/LK1.dir/build.make:1999: CMakeFiles/LK1.dir/Source/LK1/L1B/CORD_PROC.f90.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:360: CMakeFiles/LK1.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Info:

$ gcc --version
gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0

$ cmake --version
cmake version 3.22.1

$ make --version
GNU Make 4.3

$ f2c --version
f2c (Fortran to C Translator) version 20200916.

$ lsb_release -a
Distributor ID:	Linuxmint
Description:	Linux Mint 21
Release:	21
Codename:	vanessa

Thanks!

V12.2a CBUSH ouputs errors

I found some weired issues on CBUSH. Cf. attached test-case with one single cbush loaded under transversal loads :

TC_single_bush.zip

Internal calculations are correct since on more complex models, displacements and reactions are still OK, whereas outpus keep wrong.

One can expect FZ (element)=1000lbf, MY (element)=-5000 lbf.in

F06 Engineering forces renders NULL values:


                          E L E M E N T   E N G I N E E R I N G   F O R C E S
                              F O R   E L E M E N T   T Y P E   B U S H    
  Element      Force         Force         Force        Moment        Moment        Moment
     ID         XE            YE            ZE            XE            YE            ZE
        1  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00
           ------------- ------------- ------------- ------------- ------------- ------------- 
 MAX* :    0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00
 MIN* :    0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00

 ABS* :    0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00
 *for output set

NEU outputs strange results :

BUSH Force ZE                 
    -1.056389E+03,    -1.056389E+03,     1.056389E+03,
       0,       0,       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,       0,       0,
       1,       1,       3,       8,
       0,       0,       1,
       1,    -1.056389E+03,
      -1,     0.          ,
       1,   51204,       1,
[...]
BUSH Moment YE                
     2.500000E+03,     2.500000E+03,     2.500000E+03,
       0,       0,       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,       0,       0,
       1,       1,       3,       8,
       0,       0,       1,
       1,     2.500000E+03,
      -1,     0.          ,
       1,   51206,       1,

*ERROR 9200 on processing a large file

When running the attached bulk file (36 load cases, 1365 nodes, CBARs +CBUSHs) , MYSTRAN terminates with this message:

 *ERROR  9200: PROGRAMMING ERROR IN SUBROUTINE ONE_D_STRESS_OUTPUTS           
               ARRAY OGEL WAS ALLOCATED TO HAVE          424 ROWS. ATTEMPT TO WRITE TO OGEL BEYOND THIS

The error occurs when dumping Load Case 2. However, when running individual load case 1, 2 or 3, no errors happened.

NX-NASTRAN ha no issue with the same file

[EDIT] add model size data + NX feedback

fea.nas.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.