├── debian ├── dirs ├── compat ├── frame3dd.install ├── changelog ├── control ├── frame3dd-config.man ├── copyright └── rules ├── doc ├── FrameEd.zip ├── img │ ├── CSV1.png │ ├── CSV2.png │ ├── CSV3.png │ ├── CSV4.png │ ├── CSV5.png │ ├── j1j2.png │ ├── psoe.jpg │ ├── tors.jpg │ ├── coords.png │ ├── Isection.png │ ├── Tsections.png │ ├── citicorp.jpg │ ├── IntForceSign.png │ ├── InternalForces.png │ ├── Newton-Raphson1.png │ ├── Sketchup-Frame1.jpg │ ├── exp_ansys_gavin.png │ ├── googlewebmaster1.png │ ├── googlewebmaster2.png │ ├── googlewebmaster3.png │ ├── googlewebmaster4.png │ ├── googlewebmaster5.png │ ├── sign_convention.png │ ├── Sketchup-Trailer1.jpg │ ├── Isection.fig │ ├── j1j2.fig │ ├── coords.fig │ ├── IntForceSign.fig │ ├── Tsections.fig │ └── sign_convention.fig ├── SConscript ├── version.html ├── version.html.in └── save.plt ├── src ├── microstran │ ├── CharactersInDouble.h │ ├── types.h │ ├── README.txt │ ├── defaultpaths.h │ ├── print.h │ ├── defaultpaths.c │ ├── print.c │ ├── modelparser.h │ ├── config.h │ ├── sectionsparser.h │ ├── displacementparser.h │ ├── new.h │ ├── new.c │ ├── SConscript │ ├── error.c │ ├── forceparser.h │ ├── error.h │ ├── dumpsections.c │ ├── dumpforces.c │ ├── dumpcases.c │ ├── array.h │ ├── displacements.h │ ├── vec3.h │ ├── array.c │ ├── forces.c │ ├── displacements.c │ ├── vec3.c │ ├── main.c │ ├── ctrans.h │ ├── case.h │ ├── CharactersInDouble.c │ └── forces.h ├── viewer │ ├── test1.arc │ ├── test2.arc │ ├── SConscript │ └── render.h ├── Makefile ├── common.h ├── SConscript ├── coordtrans.h ├── eig.h └── HPGutil.h ├── .travis.yml ├── test ├── test.h ├── SConscript ├── lateral-column.arc ├── lateral-column-rev.arc ├── lateral-column-x.arc ├── lateral-column-y.arc ├── bent-cantilever.arc ├── main.cpp ├── testcase3.arc ├── truss.arc ├── testvec3.cpp ├── lateral-column-x.p1 ├── lateral-column-y.p1 └── lateral-column-rev.p1 ├── examples ├── run_all_examples ├── saveplot_osx ├── saveplot_w32 ├── saveplot ├── exJ.csv ├── exD.csv └── exE.csv ├── checkmoments.py ├── .gitignore ├── nbproject └── project.xml ├── nsis └── registerExtension.nsh ├── frame3dd.spec.in ├── PACKAGING.txt ├── scons ├── soqt.py ├── substinfile.py └── disttar.py ├── matlab ├── IOdata.plt ├── exA.m └── IOdata_out.m ├── TODO.txt ├── README-win32.txt ├── README.txt └── zipdist.sh /debian/dirs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 5 2 | -------------------------------------------------------------------------------- /debian/frame3dd.install: -------------------------------------------------------------------------------- 1 | usr/bin 2 | usr/lib 3 | usr/include 4 | usr/share 5 | 6 | -------------------------------------------------------------------------------- /doc/FrameEd.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/FrameEd.zip -------------------------------------------------------------------------------- /doc/img/CSV1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/CSV1.png -------------------------------------------------------------------------------- /doc/img/CSV2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/CSV2.png -------------------------------------------------------------------------------- /doc/img/CSV3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/CSV3.png -------------------------------------------------------------------------------- /doc/img/CSV4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/CSV4.png -------------------------------------------------------------------------------- /doc/img/CSV5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/CSV5.png -------------------------------------------------------------------------------- /doc/img/j1j2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/j1j2.png -------------------------------------------------------------------------------- /doc/img/psoe.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/psoe.jpg -------------------------------------------------------------------------------- /doc/img/tors.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/tors.jpg -------------------------------------------------------------------------------- /src/microstran/CharactersInDouble.h: -------------------------------------------------------------------------------- 1 | int CharactersInDouble(const char p[]); 2 | -------------------------------------------------------------------------------- /doc/img/coords.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/coords.png -------------------------------------------------------------------------------- /doc/img/Isection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/Isection.png -------------------------------------------------------------------------------- /doc/img/Tsections.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/Tsections.png -------------------------------------------------------------------------------- /doc/img/citicorp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/citicorp.jpg -------------------------------------------------------------------------------- /doc/img/IntForceSign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/IntForceSign.png -------------------------------------------------------------------------------- /doc/img/InternalForces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/InternalForces.png -------------------------------------------------------------------------------- /doc/img/Newton-Raphson1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/Newton-Raphson1.png -------------------------------------------------------------------------------- /doc/img/Sketchup-Frame1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/Sketchup-Frame1.jpg -------------------------------------------------------------------------------- /doc/img/exp_ansys_gavin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/exp_ansys_gavin.png -------------------------------------------------------------------------------- /doc/img/googlewebmaster1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/googlewebmaster1.png -------------------------------------------------------------------------------- /doc/img/googlewebmaster2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/googlewebmaster2.png -------------------------------------------------------------------------------- /doc/img/googlewebmaster3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/googlewebmaster3.png -------------------------------------------------------------------------------- /doc/img/googlewebmaster4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/googlewebmaster4.png -------------------------------------------------------------------------------- /doc/img/googlewebmaster5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/googlewebmaster5.png -------------------------------------------------------------------------------- /doc/img/sign_convention.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/sign_convention.png -------------------------------------------------------------------------------- /doc/img/Sketchup-Trailer1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pslack/frame3dd/HEAD/doc/img/Sketchup-Trailer1.jpg -------------------------------------------------------------------------------- /doc/SConscript: -------------------------------------------------------------------------------- 1 | Import('env') 2 | 3 | specfile = env.SubstInFile('version.html.in') 4 | 5 | env.Precious('version.html') 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | 2 | 3 | language: cpp 4 | 5 | before_script: 6 | - sudo apt-get install libcppunit-dev 7 | - sudo apt-get install libsoqt4-dev 8 | script: scons 9 | compiler: gcc 10 | 11 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | frame3dd (0.20091020) jaunty; urgency=low 2 | 3 | * First packaging of frame3dd as .deb 4 | * See also ChangeLog.txt file included within package. 5 | 6 | -- John Pye (Aug 08) Tue, 20 Oct 2009 11:05:00 +1100 7 | 8 | -------------------------------------------------------------------------------- /src/microstran/types.h: -------------------------------------------------------------------------------- 1 | #ifndef TYPES_H 2 | #define TYPES_H 3 | 4 | typedef int cbool; 5 | 6 | #define false 0 7 | #define true 1 8 | 9 | /* variant */ 10 | 11 | typedef int variant; 12 | 13 | #define NIL ((variant)0) 14 | 15 | #endif /* TYPES_H */ 16 | -------------------------------------------------------------------------------- /test/test.h: -------------------------------------------------------------------------------- 1 | #ifndef FRAME_TEST_H 2 | #define FRAME_TEST_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /doc/version.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 |
Version 0.20140514+
9 | 10 | -------------------------------------------------------------------------------- /doc/version.html.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 |
Version @VERSION@
9 | 10 | -------------------------------------------------------------------------------- /src/viewer/test1.arc: -------------------------------------------------------------------------------- 1 | * Model of a single member for use in checking orientation commands 2 | VERS 5 3 | TYPE 5 4 | VERT 3 5 | UNIT 1 m kN T C 6 | 7 | NODE 1 2 2 1 000000 8 | NODE 2 -1 -0.5 -1 000000 9 | 10 | MEMB 1 1 2 +Z 1 1 000000 000000 11 | 12 | PROP 1 PRIS LH80603010x1.2 Lipped Hat G350 13 | 2.9180E-04 0.000 0.000 0.000 2.8270E-07 4.0540E-07 14 | 15 | END 16 | 17 | -------------------------------------------------------------------------------- /test/SConscript: -------------------------------------------------------------------------------- 1 | Import('env') 2 | 3 | if env.get('HAVE_CPPUNIT'): 4 | print "HAVE CPPUNIT" 5 | 6 | test_env = env.Clone() 7 | test_env.Append( 8 | LIBS=env["CPPUNIT_LIBS"] 9 | ,LIBPATH=env["CPPUNIT_LIBPATH"] 10 | ,CPPPATH=env["CPPUNIT_CPPPATH"] 11 | ) 12 | 13 | test_env.Append( 14 | LIBS = ['microstranparser'] 15 | ,LIBPATH = ['..'] 16 | ,CPPPATH = ['..'] 17 | ) 18 | 19 | tests = Split(""" 20 | testvec3.cpp 21 | testctrans.cpp 22 | """) 23 | 24 | test_env.Program("runtest",["main.cpp"] + tests) 25 | -------------------------------------------------------------------------------- /src/viewer/test2.arc: -------------------------------------------------------------------------------- 1 | * Model of a single member for use in checking orientation commands 2 | VERS 5 3 | TYPE 5 4 | VERT 3 5 | UNIT 1 m kN T C 6 | 7 | NODE 1 -1 0.1 0 000000 8 | NODE 2 -2 0.6 0.4 000000 9 | NODE 3 -1 0.1 0 000000 10 | NODE 4 -3 0.9 0.6 000000 11 | 12 | MEMB 1 1 2 +Z 1 1 000000 000000 13 | MEMB 2 3 4 +Z 1 1 000000 000000 14 | 15 | MOFF 1 LO 0.1 0.1 0.1 0.1 0.1 0.1 16 | 17 | PROP 1 PRIS LH80603010x1.2 Lipped Hat G350 18 | 2.9180E-04 0.000 0.000 0.000 2.8270E-07 4.0540E-07 19 | 20 | END 21 | 22 | -------------------------------------------------------------------------------- /src/microstran/README.txt: -------------------------------------------------------------------------------- 1 | This folder contains a parser for Microstran .arc files. This is a text-file 2 | export format supported by the commercial programs Microstran, Space Gass and 3 | Multiframe. 4 | 5 | TODO need documentation of this file format, if possible. 6 | 7 | The parser is implemented using a pretty low-level pure-C method described here: 8 | http://www.math.chalmers.se/~koen/ParserComboC/parser-combo-c.html 9 | 10 | At this point, the parser code has been tested but hasn't yet been connected 11 | to FRAME to build up an actual model structure that can be calculated. 12 | 13 | -------------------------------------------------------------------------------- /src/microstran/defaultpaths.h: -------------------------------------------------------------------------------- 1 | #ifndef FRAME3DD_DEFAULTPATH_H 2 | #define FRAME3DD_DEFAULTPATH_H 3 | 4 | #include "config.h" 5 | 6 | 7 | #ifdef __cplusplus 8 | extern "C"{ 9 | #endif 10 | 11 | /** 12 | Get a file-system-specific location for data files associated with 13 | the microstran parser (specifically, 'properties.txt'). 14 | 15 | You do not own the returned string, and you can not depend 16 | on it remaining unmodified. You should copy the returned 17 | string to somewhere safe. 18 | */ 19 | MSTRANP_API const char *get_default_data_path(); 20 | 21 | 22 | #ifdef __cplusplus 23 | }; 24 | #endif 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /test/lateral-column.arc: -------------------------------------------------------------------------------- 1 | * Lateral column 2 | * Simple test case for demonstrating Microstran parser in Frame3d 3 | 4 | VERS 5 5 | TYPE 5 6 | VERT 3 7 | UNIT 1 m kN T C 8 | 9 | NODE 1 0.0000 0.0000 0.0000 111111 10 | NODE 2 0.0000 0.0000 1.0000 000000 11 | 12 | MEMB 1 1 2 X 1 1 000000 000000 13 | 14 | PROP 1 LIBR asw 65X35X2.0RHS Y comment 15 | 3.7400E-04 0.000 0.000 1.8400E-07 7.7800E-08 2.0400E-07 16 | 17 | MATL 1 2.000E+08 2.500E-01 7.850E+00 1.170E-05 18 | 19 | CASE 1 Horizontal load 1kN 20 | NDLD 2 5.000 3.000 0.000 0.000 0.000 0.000 21 | 22 | END 23 | -------------------------------------------------------------------------------- /test/lateral-column-rev.arc: -------------------------------------------------------------------------------- 1 | * Lateral column 2 | * Simple test case for demonstrating Microstran parser in Frame3d 3 | 4 | VERS 5 5 | TYPE 5 6 | VERT 3 7 | UNIT 1 m kN T C 8 | 9 | NODE 2 0.0000 0.0000 0.0000 111111 10 | NODE 1 0.0000 0.0000 1.0000 000000 11 | 12 | MEMB 1 2 1 X 1 1 000000 000000 13 | 14 | PROP 1 LIBR asw 65X35X2.0RHS Y comment 15 | 3.7400E-04 0.000 0.000 1.8400E-07 7.7800E-08 2.0400E-07 16 | 17 | MATL 1 2.000E+08 2.500E-01 7.850E+00 1.170E-05 18 | 19 | CASE 1 Horizontal load 1kN 20 | NDLD 1 5.000 3.000 0.000 0.000 0.000 0.000 21 | 22 | END 23 | -------------------------------------------------------------------------------- /test/lateral-column-x.arc: -------------------------------------------------------------------------------- 1 | * Lateral column 2 | * Simple test case for demonstrating Microstran parser in Frame3d 3 | 4 | VERS 5 5 | TYPE 5 6 | VERT 3 7 | UNIT 1 m kN T C 8 | 9 | NODE 1 0.0000 0.0000 0.0000 111111 10 | NODE 2 -1.0000 0.0000 0.0000 000000 11 | 12 | MEMB 1 1 2 -Z 1 1 000000 000000 13 | 14 | PROP 1 LIBR asw 65X35X2.0RHS Y comment 15 | 3.7400E-04 0.000 0.000 1.8400E-07 7.7800E-08 2.0400E-07 16 | 17 | MATL 1 2.000E+08 2.500E-01 7.850E+00 1.170E-05 18 | 19 | CASE 1 Horizontal load 1kN 20 | NDLD 2 -3.000 -3.000 5.000 0.000 0.000 0.000 21 | 22 | END 23 | -------------------------------------------------------------------------------- /test/lateral-column-y.arc: -------------------------------------------------------------------------------- 1 | * Lateral column 2 | * Simple test case for demonstrating Microstran parser in Frame3d 3 | 4 | VERS 5 5 | TYPE 5 6 | VERT 3 7 | UNIT 1 m kN T C 8 | 9 | NODE 1 0.0000 0.0000 0.0000 111111 10 | NODE 2 0.0000 1.0000 0.0000 000000 11 | 12 | MEMB 1 1 2 X 1 1 000000 000000 13 | 14 | PROP 1 LIBR asw 65X35X2.0RHS Y comment 15 | 3.7400E-04 0.000 0.000 1.8400E-07 7.7800E-08 2.0400E-07 16 | 17 | MATL 1 2.000E+08 2.500E-01 7.850E+00 1.170E-05 18 | 19 | CASE 1 Horizontal load 1kN 20 | NDLD 2 -3.000 0.000 -5.000 0.000 0.000 0.000 21 | 22 | END 23 | -------------------------------------------------------------------------------- /src/microstran/print.h: -------------------------------------------------------------------------------- 1 | #ifndef PRINT_H 2 | #define PRINT_H 3 | 4 | #include 5 | #include 6 | #include "types.h" 7 | 8 | /* global variables */ 9 | 10 | extern FILE *printGlobalStdOut; 11 | 12 | /* macros */ 13 | 14 | #define printFormat(p,args) \ 15 | ( printGlobalStdOut = p->file \ 16 | , printFormatted args \ 17 | , fflush( printGlobalStdOut ) \ 18 | ) 19 | 20 | /* types */ 21 | 22 | typedef struct 23 | { 24 | FILE *file; 25 | cbool close; 26 | } print; 27 | 28 | /* functions */ 29 | 30 | print *printCreateFile( FILE *file ); 31 | print *printCreateFileName( char *name ); 32 | print *printCreateFileNameAppend( char *name ); 33 | void printFormatted( char *s, ... ); 34 | void printDispose( print *p ); 35 | 36 | #endif /* PRINT_H */ 37 | -------------------------------------------------------------------------------- /src/viewer/SConscript: -------------------------------------------------------------------------------- 1 | Import('env') 2 | 3 | if env.get('HAVE_SOQT'): 4 | v_env = env.Clone() 5 | 6 | v_env.AppendUnique( 7 | LIBS = ['microstranparser'] + env.get('SOQT_LIBS') 8 | ,LIBPATH = ['..'] + env.get('SOQT_LIBPATH') 9 | ,CPPPATH = ['..'] + env.get('SOQT_CPPPATH') 10 | ,CPPDEFINES = env.get('SOQT_CPPDEFINES') 11 | ) 12 | 13 | srcs = Split(""" 14 | render.cpp 15 | arc2iv.cpp 16 | """) 17 | 18 | arc2iv = v_env.Program("../arc2iv",srcs) 19 | env['PROGS'].append(arc2iv) 20 | 21 | #env['PROGS'].append( 22 | # v_env.Program("../iv2vrml",['iv2vrml.cpp']) 23 | #) 24 | 25 | env['PROGS'].append( 26 | v_env.Program("../forcebalance",['forcebalance.cpp','render.cpp']) 27 | ) 28 | 29 | bindir=Dir(env.subst("$INSTALL_ROOT$INSTALL_BIN")) 30 | env.Install(bindir,arc2iv) 31 | 32 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: frame3dd 2 | Section: contrib/science 3 | Priority: extra 4 | Maintainer: John Pye 5 | Build-Depends: scons, gcc 6 | Standards-Version: 3.7.2 7 | 8 | Package: frame3dd 9 | Architecture: any 10 | Depends: ${shlibs:Depends} 11 | Description:Structural analysis of frames and trusses 12 | Free software for static and dynamic structural analysis of 2D and 3D frames 13 | and trusses with elastic and geometric stiffness. Computes the static 14 | deflections, reactions, internal element forces, natural frequencies, mode 15 | shapes and modal participation factors of two- and three- dimensional elastic 16 | structures using direct stiffness and mass assembly. Graphical output and 17 | mode shape animation via Gnuplot version 4.0 18 | 19 | # vim: sw=4:et:ai 20 | -------------------------------------------------------------------------------- /src/microstran/defaultpaths.c: -------------------------------------------------------------------------------- 1 | #define MSTRANP_BUILD 2 | #include "defaultpaths.h" 3 | 4 | #ifdef WIN32 5 | #include 6 | #endif 7 | 8 | #define FRAME3DD_REGKEY_ROOT HKEY_LOCAL_MACHINE 9 | #define FRAME3DD_REGKEY_MAIN "SOFTWARE\\FRAME3DD" 10 | 11 | const char *get_default_data_path(){ 12 | #ifdef WIN32 13 | # define MAXLEN 3000 14 | HKEY key; 15 | DWORD datatype, len = MAXLEN; 16 | long res; 17 | static char value[MAXLEN]; 18 | res = RegOpenKeyEx(FRAME3DD_REGKEY_ROOT, FRAME3DD_REGKEY_MAIN, 0L, KEY_QUERY_VALUE, &key); 19 | if(res==ERROR_SUCCESS){ 20 | res = RegQueryValueEx(key, "Install_Dir", NULL, &datatype, value, &len); 21 | if(res==ERROR_SUCCESS){ 22 | RegCloseKey(key); 23 | return value; 24 | } 25 | } 26 | #endif 27 | return FRAME3DD_DEFAULT_DATA_DIR; 28 | } 29 | -------------------------------------------------------------------------------- /examples/run_all_examples: -------------------------------------------------------------------------------- 1 | rm ex*.out 2 | rm ex*_out.CSV 3 | rm *.if* 4 | 5 | frame3dd -i exA.csv -o exA.out 6 | frame3dd -i exB.csv -o exB.out 7 | frame3dd -i exC.csv -o exC.out 8 | frame3dd -i exD.csv -o exD.out 9 | frame3dd -i exE.csv -o exE.out 10 | frame3dd -i exF.csv -o exF.out 11 | frame3dd -i exG.csv -o exG.out 12 | frame3dd -i exH.csv -o exH.out 13 | frame3dd -i exI.csv -o exI.out 14 | frame3dd -i exJ.csv -o exJ.out 15 | 16 | rm ex*.out 17 | 18 | frame3dd -i exA.3dd -o exA.out 19 | frame3dd -i exB.3dd -o exB.out 20 | frame3dd -i exC.3dd -o exC.out 21 | frame3dd -i exD.3dd -o exD.out 22 | frame3dd -i exE.3dd -o exE.out 23 | frame3dd -i exF.3dd -o exF.out 24 | frame3dd -i exG.3dd -o exG.out 25 | frame3dd -i exH.3dd -o exH.out 26 | frame3dd -i exI.3dd -o exI.out 27 | frame3dd -i exJ.3dd -o exJ.out 28 | -------------------------------------------------------------------------------- /test/bent-cantilever.arc: -------------------------------------------------------------------------------- 1 | * Bent cantilever 2 | * Model created as test case for Microstran Parser in FRAME3DD 3 | 4 | VERS 5 5 | TYPE 5 6 | VERT 3 7 | UNIT 1 m kN T C 8 | 9 | NODE 1 0.0000 0.0000 0.0000 111111 10 | NODE 2 0.0000 0.0000 1.0000 000000 11 | NODE 3 0.0000 0.5000 1.5000 000000 12 | 13 | MEMB 2 1 2 X 1 1 000000 000000 14 | MEMB 3 3 2 X 1 1 000000 000000 15 | 16 | PROP 1 LIBR asw 150UB14.0 Y default 17 | 1.7800E-03 0.000 0.000 2.8100E-08 4.9500E-07 6.6600E-06 18 | 19 | MATL 1 2.000E+08 2.500E-01 7.850E+00 1.170E-05 20 | 21 | CASE 1 Lateral loading 22 | NDLD 3 1.000 0.000 -1.000 0.000 0.000 0.000 23 | 24 | END 25 | -------------------------------------------------------------------------------- /checkmoments.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import subprocess, sys 4 | 5 | modelfile = sys.argv[1] 6 | forcefile = None 7 | node = None 8 | 9 | if len(sys.argv)>2: 10 | forcefile = sys.argv[2] 11 | 12 | if len(sys.argv)>3: 13 | node = sys.argv[3] 14 | 15 | sys.stderr.write("READING FORCE BALANCE...\n") 16 | 17 | cmd = ['build/forcebalance','-m',modelfile,'-MFo'] 18 | 19 | if forcefile: 20 | cmd += ['-f',forcefile] 21 | 22 | if node: 23 | cmd += ['-n',node] 24 | 25 | sys.stderr.write("CMD ="+str(cmd)) 26 | sys.stderr.flush() 27 | 28 | p = subprocess.Popen(cmd) 29 | p.communicate() 30 | if p.returncode: 31 | sys.exit(1) 32 | 33 | sys.stderr.write("CONVERTING MODEL TO GRAPHICAL FORMAT...\n") 34 | 35 | subprocess.Popen(['build/arc2iv',modelfile,'-o']).communicate() 36 | 37 | sys.stderr.write("RENDERING...\n") 38 | 39 | subprocess.Popen(['../optx/viewer','-ht','forcebalance.iv','microstranmodel.iv']).communicate() 40 | 41 | 42 | -------------------------------------------------------------------------------- /debian/frame3dd-config.man: -------------------------------------------------------------------------------- 1 | .TH frame3dd-config 1 "April 21, 2007" frame3dd "User's Manual" 2 | .SH NAME 3 | frame3dd-config \- Output configuration data for frame3dd 4 | 5 | .SH SYNOPSIS 6 | .B Usage: frame3dd-config [--help,...] 7 | 8 | Options: 9 | --version show program's version number and exit 10 | -h, --help show this help message and exit 11 | --libs show linker flags (for frame3dd libraries) 12 | --cppflags show C pre-processor flags (for frame3dd header files) 13 | 14 | .SH DESCRIPTION 15 | 16 | \fBframe3dd-config\fR can be used when building packages that depend 17 | on frame3dd, ensuring that you are using the correct C preprocessor or 18 | library linking flags for the particular system you're on. 19 | 20 | \fBframe3dd\fR is a program for calculating the performance of 21 | structural frames and trusses in 2D and 3D. For more information see 22 | the frame3dd website at 23 | 24 | http://frame3dd.sourceforge.net/ 25 | 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | *.ko 4 | *.obj 5 | *.elf 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Libraries 12 | *.lib 13 | *.a 14 | *.la 15 | *.lo 16 | 17 | # Shared objects (inc. Windows DLLs) 18 | *.dll 19 | *.so 20 | *.so.* 21 | *.dylib 22 | 23 | # Executables 24 | *.exe 25 | *.out 26 | *.app 27 | *.i*86 28 | *.x86_64 29 | *.hex 30 | 31 | # Debug files 32 | *.dSYM/ 33 | *.su 34 | 35 | 36 | 37 | 38 | #scons stuff 39 | .sconsign.dblite 40 | 41 | #Python files 42 | 43 | # Byte-compiled / optimized / DLL files 44 | __pycache__/ 45 | *.py[cod] 46 | *$py.class 47 | 48 | # Distribution / packaging 49 | .Python 50 | build/ 51 | 52 | 53 | #ant specific 54 | dist/ 55 | 56 | 57 | #netbeans specific 58 | core 59 | nbproject/* 60 | !nbproject/project.properties 61 | !nbproject/project.xml 62 | 63 | #java specific 64 | *.class 65 | 66 | #general swap/backup files 67 | *.so 68 | *.log 69 | *.out 70 | *~ 71 | *.swp 72 | *.DS_Store 73 | *.lock 74 | 75 | .sconf_temp 76 | options.cache 77 | 78 | 79 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by John Pye 2 | Sun Apr 26 16:44:00 EST 2009 3 | 4 | The source code can be obtained from 5 | http://freesteam.sourceforge.net 6 | 7 | Authors: John Pye 8 | 9 | License: /usr/share/common-licenses/GPL-2 10 | 11 | -------------------------------------------------------------------------------- 12 | 13 | This software is Copyright (c) 2004-2009 John Pye 14 | 15 | This program is free software; you can redistribute it and/or modify 16 | it under the terms of the GNU General Public License as published by 17 | the Free Software Foundation; either version 2, or (at your option) 18 | any later version. 19 | 20 | This program is distributed in the hope that it will be useful, 21 | but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | GNU General Public License for more details. 24 | 25 | You should have received a copy of the GNU General Public License 26 | along with this program; if not, write to the Free Software 27 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 28 | 02110-1301 USA 29 | 30 | -------------------------------------------------------------------------------- /src/microstran/print.c: -------------------------------------------------------------------------------- 1 | /* print.c */ 2 | 3 | #include "print.h" 4 | #include "types.h" 5 | #include "new.h" 6 | #include 7 | #include 8 | 9 | /* global variables */ 10 | 11 | FILE *printGlobalStdOut; 12 | 13 | /* functions */ 14 | 15 | print *printCreateFile( FILE *file ) 16 | { 17 | print *p = NEW( print ); 18 | p->file = file; 19 | p->close = false; 20 | return p; 21 | } 22 | 23 | print *printCreateFileName( char *name ) 24 | { 25 | print *p = NEW( print ); 26 | if ( !(p->file = fopen( name, "w" )) ) 27 | { 28 | free( p ); 29 | return NULL; 30 | } 31 | p->close = true; 32 | return p; 33 | } 34 | 35 | print *printCreateFileNameAppend( char *name ) 36 | { 37 | print *p = NEW( print ); 38 | if ( !(p->file = fopen( name, "a" )) ) 39 | { 40 | free( p ); 41 | return NULL; 42 | } 43 | p->close = true; 44 | return p; 45 | } 46 | 47 | void printFormatted( char *s, ... ) 48 | { 49 | va_list ap; 50 | va_start( ap, s ); 51 | vfprintf( printGlobalStdOut, s, ap ); 52 | va_end( ap ); 53 | } 54 | 55 | void printDispose( print *p ) 56 | { 57 | if ( p->close ) 58 | fclose( p->file ); 59 | free( p ); 60 | } 61 | 62 | /* end print.c */ 63 | -------------------------------------------------------------------------------- /src/microstran/modelparser.h: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | *//** @file 17 | Parser for microstran .arc files 18 | */ 19 | 20 | #ifndef MODELPARSER_H 21 | #define MODELPARSER_H 22 | 23 | #include "config.h" 24 | #include "model.h" 25 | #include "parse.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C"{ 29 | #endif 30 | 31 | MSTRANP_API cbool parseModelMicrostran(parse *p, model **m); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.cnd.makeproject 4 | 5 | 6 | frame3dd 7 | c,m 8 | cpp 9 | h 10 | UTF-8 11 | 12 | 13 | . 14 | 15 | 16 | 17 | Default 18 | 0 19 | 20 | 21 | NewConfiguration 22 | 0 23 | 24 | 25 | 26 | false 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/microstran/config.h: -------------------------------------------------------------------------------- 1 | #ifndef MICROSTRAN_CONFIG_H 2 | #define MICROSTRAN_CONFIG_H 3 | 4 | #ifdef __WIN32__ 5 | # define MSTRANP_EXPORT __declspec(dllexport) 6 | # define MSTRANP_IMPORT __declspec(dllimport) 7 | #else 8 | # ifdef HAVE_GCCVISIBILITY 9 | # define MSTRANP_EXPORT __attribute__ ((visibility("default"))) 10 | # define MSTRANP_IMPORT 11 | # else 12 | # define MSTRANP_EXPORT 13 | # define MSTRANP_IMPORT 14 | # endif 15 | #endif 16 | 17 | #ifdef HAVE_GCCVISIBILITY 18 | # define MSTRANP_LOCAL __attribute__ ((visibility("hidden"))) 19 | #else 20 | # define MSTRANP_LOCAL 21 | #endif 22 | 23 | #ifdef MSTRANP_BUILD 24 | # define MSTRANP_API extern MSTRANP_EXPORT 25 | # define MSTRANP_DLL MSTRANP_EXPORT 26 | #else 27 | # define MSTRANP_API extern MSTRANP_IMPORT 28 | # define MSTRANP_DLL MSTRANP_IMPORT 29 | #endif 30 | 31 | #if !defined(MSTRANP_API) || !defined(MSTRANP_EXPORT) || !defined(MSTRANP_IMPORT) 32 | # error "NO MSTRANP_API, MSTRANP_EXPORT, MSTRANP_IMPORT DEFINED" 33 | #endif 34 | 35 | #ifdef WIN32 36 | # define FRAME3DD_PATHSEP "\\" 37 | # define FRAME3DD_DEFAULT_DATA_DIR "c:\\Program Files\\FRAME3DD" 38 | #else 39 | # define FRAME3DD_DEFAULT_DATA_DIR "/home/john/frame3dd/src/microstran" 40 | # define FRAME3DD_PATHSEP "/" 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/microstran/sectionsparser.h: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | *//** @file 17 | Parser for microstran properties.txt files 18 | */ 19 | 20 | #ifndef SECTIONSPARSER_H 21 | #define SECTIONSPARSER_H 22 | 23 | #include "config.h" 24 | #include "sections.h" 25 | #include "parse.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C"{ 29 | #endif 30 | 31 | MSTRANP_API cbool parseSections(parse *p, section_library *a); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /src/microstran/displacementparser.h: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | *//** @file 17 | Parser for microstran .p1 displacement data files 18 | */ 19 | #ifndef DISPLACEMENTPARSER_H 20 | #define DISPLACEMENTPARSER_H 21 | 22 | #include "config.h" 23 | #include "displacements.h" 24 | #include "parse.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C"{ 28 | #endif 29 | 30 | MSTRANP_API cbool parseMicrostranDisplacements(parse *p, modeldisplacements **m); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/microstran/new.h: -------------------------------------------------------------------------------- 1 | #ifndef NEW_H 2 | #define NEW_H 3 | 4 | /** @file 5 | Memory allocation functions used by parse.c. 6 | @todo May need to review this stuff. 7 | */ 8 | 9 | #include 10 | #include "types.h" 11 | 12 | /* macros */ 13 | 14 | #define NEW(type) \ 15 | (type*)newAllocLocation(sizeof(type),__FILE__,__LINE__) 16 | 17 | #define newMaybe(type) \ 18 | (type*)malloc(sizeof(type)) 19 | 20 | #define array(type,n) \ 21 | (type*)newAllocLocation((n)*sizeof(type),__FILE__,__LINE__) 22 | 23 | #define rearray(type,arr,n) \ 24 | (type*)newReAllocLocation(arr,(n)*sizeof(type),__FILE__,__LINE__) 25 | 26 | #define arrayMaybe(type,n) \ 27 | (type*)malloc((n)*sizeof(type)) 28 | 29 | #define rearrayMaybe(type,arr,n) \ 30 | (type*)realloc(arr,(n)*sizeof(type)) 31 | 32 | #define copy(type,obj) \ 33 | (type*)newCopyLocation(obj,sizeof(type),__FILE__,__LINE__) 34 | 35 | #define copyMaybe(type,obj) \ 36 | (type*)newCopy(obj,sizeof(type)) 37 | 38 | /* functions */ 39 | 40 | void *newAllocLocation( int n, char *file, int line ); 41 | void *newReAllocLocation( void *arr, int n, char *file, int line ); 42 | void *newCopy( void *obj, int n ); 43 | void *newCopyLocation( void *obj, int n, char *file, int line ); 44 | void newReportsError( cbool error ); 45 | 46 | #endif /* NEW_H */ 47 | -------------------------------------------------------------------------------- /src/microstran/new.c: -------------------------------------------------------------------------------- 1 | /* new.c */ 2 | 3 | #include 4 | #include "error.h" 5 | #include "new.h" 6 | 7 | /* global variables */ 8 | 9 | static cbool newGlobalReportsError = true; 10 | 11 | /* functions */ 12 | 13 | void *newAllocLocation( int n, char *file, int line ) 14 | { 15 | void *ptr = malloc( n ); 16 | 17 | if ( !ptr && newGlobalReportsError ) 18 | errorReportLocationWith( 1, file, line, ("Object allocation failed.\n") ); 19 | 20 | return ptr; 21 | } 22 | 23 | void *newReAllocLocation( void *arr, int n, char *file, int line ) 24 | { 25 | void *ptr = realloc( arr, n ); 26 | 27 | if ( !ptr && newGlobalReportsError ) 28 | errorReportLocationWith( 1, file, line, ("Object reallocation failed.\n") ); 29 | 30 | return ptr; 31 | } 32 | 33 | void *newCopy( void *obj, int n ) 34 | { 35 | void *obj1 = malloc( n ); 36 | if ( obj1 ) 37 | memcpy( obj1, obj, n ); 38 | return obj1; 39 | } 40 | 41 | void *newCopyLocation( void *obj, int n, char *file, int line ) 42 | { 43 | void *obj1 = malloc( n ); 44 | 45 | if ( obj1 ) 46 | memcpy( obj1, obj, n ); 47 | else if ( newGlobalReportsError ) 48 | errorReportLocationWith( 1, file, line, ("Object copy failed.\n") ); 49 | 50 | return obj1; 51 | } 52 | 53 | void newReportsError( cbool report ) 54 | { 55 | newGlobalReportsError = report; 56 | } 57 | 58 | /* end new.c */ 59 | -------------------------------------------------------------------------------- /src/microstran/SConscript: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | Import('env') 4 | 5 | srcs = Split(""" 6 | new.c 7 | parse.c 8 | print.c 9 | CharactersInDouble.c 10 | error.c 11 | array.c 12 | case.c 13 | model.c 14 | modelparser.c 15 | displacements.c 16 | displacementparser.c 17 | sections.c 18 | sectionsparser.c 19 | vec3.c 20 | ctrans.c 21 | forces.c 22 | forceparser.c 23 | defaultpaths.c 24 | """) 25 | # bdd.c row.c table.c print.c iter.c list.c 26 | 27 | libenv = env.Clone() 28 | libenv.AppendUnique(LIBS = ['m']) 29 | 30 | lib = libenv.SharedLibrary("../microstranparser",srcs) 31 | 32 | microst = env.Program('microst',['main.c'],LIBS=["microstranparser"],LIBPATH=[".."]) 33 | 34 | dumpsections = env.Program('dumpsections',['dumpsections.c'],LIBS=["microstranparser"],LIBPATH=[".."]) 35 | 36 | dumpforces = env.Program('dumpforces',['dumpforces.c'],LIBS=["microstranparser"],LIBPATH=[".."]) 37 | 38 | dumpcases = env.Program('dumpcases',['dumpcases.c'],LIBS=["microstranparser"],LIBPATH=[".."]) 39 | 40 | env['PROGS'] += [microst, dumpsections, dumpforces, dumpcases, lib] 41 | 42 | incdir=Dir(env.subst("$INSTALL_ROOT$INSTALL_INCLUDE/microstran")) 43 | env.Install(incdir,libenv.Glob("*.h")) 44 | 45 | libdir=Dir(env.subst("$INSTALL_ROOT$INSTALL_LIB")) 46 | env.Install(libdir,lib) 47 | 48 | datadir=Dir(env.subst("$INSTALL_ROOT$INSTALL_FRAMEDATA")) 49 | env.Install(datadir,"properties.txt") 50 | -------------------------------------------------------------------------------- /doc/save.plt: -------------------------------------------------------------------------------- 1 | # File name: saveplot - creates a PostScript file using Gnuplot version 3.8 2 | # to save the current plot as a postscript file issue the commands: 3 | # gnuplot> set out 'plotfile.ps' 4 | # gnuplot> load 'saveplot' 5 | set size 1.0 , 0.6 6 | set terminal postscript portrait enhanced color solid lw 2 "Helvetica" 14 7 | set output "my-plot.ps" 8 | replot 9 | set terminal x11 10 | set size 1,1 11 | 12 | # set terminal postscript {} {enhanced | noenhanced} 13 | # {color | colour | monochrome} 14 | # {blacktext | colortext | colourtext} 15 | # {solid | dashed} {dashlength | dl
} 16 | # {linewidth | lw } 17 | # {} 18 | # {""} {} 19 | 20 | 21 | # set terminal gif {transparent} {interlace} 22 | # {tiny | small | medium | large | giant} 23 | # {size ,} 24 | # { ...} 25 | 26 | # set terminal png 27 | # {{no}transparent} {{no}interlace} 28 | # {tiny | small | medium | large | giant} 29 | # {font {}} 30 | # {size ,} {{no}crop} 31 | # {{no}enhanced} 32 | # { ...} 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/microstran/error.c: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | *//* @FILE 17 | error.c 18 | */ 19 | 20 | #include "types.h" 21 | #include "print.h" 22 | #include "error.h" 23 | 24 | /* global variables */ 25 | 26 | print *errorGlobalPrint = NULL; 27 | 28 | /* functions */ 29 | 30 | void errorInitPrint( void ) 31 | { 32 | if ( !errorGlobalPrint ) 33 | errorGlobalPrint = printCreateFile( stderr ); 34 | } 35 | 36 | void errorSetPrint( print *p, cbool dispose ) 37 | { 38 | if ( dispose && errorGlobalPrint ) 39 | printDispose( errorGlobalPrint ); 40 | errorGlobalPrint = p; 41 | } 42 | 43 | print *errorGetPrint( void ) 44 | { 45 | return errorGlobalPrint; 46 | } 47 | 48 | /* end error.c */ 49 | -------------------------------------------------------------------------------- /src/microstran/forceparser.h: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | *//** @file 17 | Parser for microstran .p1 member forces output files. 18 | 19 | @note there are important differences between the axes and sign conventions 20 | used here and those specified by the Microstran .arc format. See 21 | forces.h for details. @endnote 22 | */ 23 | #ifndef MSTRANP_FORCEPARSER_H 24 | #define MSTRANP_FORCEPARSER_H 25 | 26 | #include "config.h" 27 | #include "forces.h" 28 | #include "parse.h" 29 | 30 | #ifdef __cplusplus 31 | extern "C"{ 32 | #endif 33 | 34 | MSTRANP_API cbool parseMicrostranForces(parse *p, modelforces **m); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif /* MSTRANP_FORCEPARSER_H */ 41 | -------------------------------------------------------------------------------- /doc/img/Isection.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2 11 | 0 0 1.00 60.00 120.00 12 | 0 0 1.00 60.00 120.00 13 | 3600 5400 3600 3600 14 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2 15 | 0 0 1.00 60.00 120.00 16 | 0 0 1.00 60.00 120.00 17 | 3825 5625 5625 5625 18 | 2 1 0 1 0 7 20 -1 -1 0.000 0 0 -1 1 0 2 19 | 0 0 1.00 60.00 120.00 20 | 4275 3150 4275 3600 21 | 2 1 0 1 0 7 20 -1 -1 0.000 0 0 -1 1 0 2 22 | 0 0 1.00 60.00 120.00 23 | 4275 4320 4275 3870 24 | 2 1 0 1 0 7 20 -1 -1 0.000 0 0 -1 1 0 2 25 | 0 0 1.00 60.00 120.00 26 | 4185 4950 4635 4950 27 | 2 1 0 1 0 7 20 -1 -1 0.000 0 0 -1 1 0 2 28 | 0 0 1.00 60.00 120.00 29 | 5265 4950 4815 4950 30 | 2 3 0 1 0 7 50 -1 41 0.000 0 0 -1 0 0 13 31 | 3825 3600 5625 3600 5625 3870 4815 3870 4815 5130 5625 5130 32 | 5625 5400 3825 5400 3825 5130 4635 5130 4635 3870 3825 3870 33 | 3825 3600 34 | 2 1 0 1 0 7 20 -1 -1 0.000 0 0 -1 1 0 2 35 | 0 0 1.00 60.00 120.00 36 | 4725 3465 4725 2700 37 | 2 1 0 1 0 7 20 -1 -1 0.000 0 0 -1 1 0 2 38 | 0 0 1.00 60.00 120.00 39 | 5130 4500 6345 4500 40 | 4 0 0 50 -1 19 12 0.0000 4 150 120 4635 5850 b\001 41 | 4 0 0 50 -1 19 12 0.0000 4 135 60 4140 3330 t\001 42 | 4 0 0 50 -1 19 12 0.0000 4 105 150 5130 4860 w\001 43 | 4 0 0 50 -1 19 12 0.0000 4 150 120 3375 4500 d\001 44 | 4 0 0 50 -1 19 16 0.0000 4 150 135 4815 3105 z\001 45 | 4 0 0 50 -1 19 16 0.0000 4 210 135 6075 4725 y\001 46 | -------------------------------------------------------------------------------- /test/main.cpp: -------------------------------------------------------------------------------- 1 | #include "test.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | int main( int argc, char* argv[] ) { 13 | 14 | // Retreive test path from command line first argument. Default to "" which resolve 15 | // to the top level suite. 16 | std::string testPath = (argc > 1) ? std::string(argv[1]) : std::string(""); 17 | 18 | // Create the event manager and test controller 19 | CppUnit::TestResult controller; 20 | 21 | // Add a listener that colllects test result 22 | CppUnit::TestResultCollector result; 23 | controller.addListener( &result ); 24 | 25 | // Add a listener that print dots as test run. 26 | CppUnit::BriefTestProgressListener progress; 27 | controller.addListener( &progress ); 28 | 29 | // Add the top suite to the test runner 30 | CppUnit::TestRunner runner; 31 | runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() ); 32 | 33 | try{ 34 | std::cerr << "Running " << testPath; 35 | 36 | runner.run( controller, testPath ); 37 | 38 | std::cerr << std::endl; 39 | 40 | // Print test in a compiler compatible format. 41 | CppUnit::CompilerOutputter outputter( &result, std::cerr ); 42 | outputter.write(); 43 | 44 | }catch( std::invalid_argument &e ){ // Test path not resolved 45 | 46 | std::cerr << std::endl << "ERROR: " << e.what() << std::endl; 47 | return 0; 48 | } 49 | 50 | return result.wasSuccessful() ? 0 : 1; 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/Makefile: -------------------------------------------------------------------------------- 1 | # FRAME3DD: 2 | # Static and dynamic structural analysis of 2D & 3D frames and trusses 3 | # with elastic and geometric stiffness. 4 | # --------------------------------------------------------------------------- 5 | # http://frame3dd.sourceforge.net/ 6 | # --------------------------------------------------------------------------- 7 | # Copyright (C) 1992-2009 Henri P. Gavin 8 | # 9 | # FRAME3DD is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, or 12 | # (at your option) any later version. 13 | # 14 | # FRAME3DD is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with FRAME3DD. If not, see . 21 | ## 22 | # @file 23 | # a simple Makefile for Frame3DD 24 | ## 25 | 26 | SHELL = /bin/sh 27 | 28 | CC = gcc 29 | # CFLAGS = -Wall -c -O 30 | CFLAGS = -c -O 31 | LDFLAGS = -lm 32 | SOURCES = main.c frame3dd.c frame3dd_io.c coordtrans.c eig.c HPGmatrix.c HPGutil.c NRutil.c 33 | OBJECTS = $(SOURCES:.c=.o) 34 | EXECUTEABLE = frame3dd 35 | 36 | all : $(SOURCES) $(EXECUTEABLE) 37 | 38 | $(EXECUTEABLE) : $(OBJECTS) 39 | $(CC) $(OBJECTS) $(LDFLAGS) -o $@ 40 | 41 | .c.o : 42 | $(CC) $(CFLAGS) $< -o $@ 43 | 44 | clean : 45 | rm -rf *.o 46 | 47 | install : 48 | mv frame3dd /usr/local/bin/. 49 | 50 | 51 | -------------------------------------------------------------------------------- /src/common.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of FRAME3DD: 3 | Static and dynamic structural analysis of 2D & 3D frames and trusses 4 | with elastic and geometric stiffness. 5 | --------------------------------------------------------------------------- 6 | http://frame3dd.sourceforge.net/ 7 | --------------------------------------------------------------------------- 8 | Copyright (C) 1992-2014 Henri P. Gavin 9 | 10 | FRAME3DD is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | FRAME3DD is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with FRAME3DD. If not, see . 22 | *//** @file 23 | */ 24 | 25 | #ifndef FRAME_COMMON_H 26 | #define FRAME_COMMON_H 27 | 28 | #define FRAME3DD_PATHMAX 512 29 | #ifndef MAXL 30 | #define MAXL 512 31 | #endif 32 | 33 | #define FILENMAX 128 34 | 35 | #ifndef VERSION 36 | #define VERSION "20140514+" 37 | #endif 38 | 39 | #ifndef PI 40 | #define PI 3.14159265358979323846264338327950288419716939937510 41 | #endif 42 | 43 | // Zvert=1: Z axis is vertical... rotate about Y-axis, then rotate about Z-axis 44 | // Zvert=0: Y axis is vertical... rotate about Z-axis, then rotate about Y-axis 45 | #define Zvert 1 46 | 47 | #endif /* FRAME_COMMON_H */ 48 | 49 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | 4 | CFLAGS = -Wall -g 5 | 6 | SCONS_OPTIONS = CC="gcc" \ 7 | CXX="g++" \ 8 | INSTALL_PREFIX=/usr 9 | 10 | SCONS= scons $(SCONS_OPTIONS) 11 | 12 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) 13 | CFLAGS += -O0 14 | else 15 | CFLAGS += -O2 16 | endif 17 | 18 | ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) 19 | INSTALL_PROGRAM += -s 20 | endif 21 | 22 | # shared library versions, option 1 23 | major=1 24 | 25 | INSTALLROOT=$(CURDIR)/debian/tmp 26 | DATADIR=$(INSTALLROOT)/usr/share 27 | 28 | build: build-stamp 29 | build-stamp: 30 | dh_testdir 31 | cd $(CURDIR) && $(SCONS) INSTALL_PREFIX=/usr 32 | touch build-stamp 33 | 34 | clean: 35 | dh_testdir 36 | rm -f build-stamp 37 | dh_clean 38 | $(SCONS) -c 39 | rm -rf .scon* 40 | rm scons/*.pyc 41 | 42 | install: build 43 | dh_testdir 44 | # dh_testroot 45 | dh_clean -k 46 | dh_installdirs 47 | mkdir -p $(INSTALLROOT)/usr 48 | cd $(CURDIR) && $(SCONS) INSTALL_PREFIX=/usr INSTALL_ROOT=$(INSTALLROOT) install 49 | # 50 | dh_install --sourcedir=$(INSTALLROOT) 51 | # dh_desktop 52 | dh_installman 53 | 54 | # Build architecture-independent files here. 55 | binary-indep: 56 | dh_testdir 57 | dh_testroot 58 | 59 | # Build architecture-dependent files here. 60 | binary-arch: build install 61 | dh_testdir 62 | dh_testroot 63 | dh_installchangelogs ChangeLog.txt 64 | dh_installdocs 65 | dh_installexamples 66 | dh_installman 67 | dh_link 68 | dh_strip 69 | dh_compress 70 | dh_fixperms 71 | dh_makeshlibs 72 | dh_installdeb 73 | dh_shlibdeps 74 | dh_gencontrol 75 | dh_md5sums 76 | dh_builddeb 77 | 78 | binary: binary-indep binary-arch 79 | .PHONY: build clean binary-indep binary-arch binary install configure 80 | 81 | -------------------------------------------------------------------------------- /src/microstran/error.h: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | *//** @file 17 | Error reporting functions for use with parser (little-used at the moment) 18 | */ 19 | #ifndef ERROR_H 20 | #define ERROR_H 21 | 22 | #include "types.h" 23 | #include "print.h" 24 | 25 | /* global variables */ 26 | 27 | extern print *errorGlobalPrint; 28 | 29 | /* macros */ 30 | 31 | #define errorReport(args) errorReportLocationWith(1,__FILE__, __LINE__,args) 32 | #define errorReportWith(ex,args) errorReportLocationWith(ex,__FILE__, __LINE__,args) 33 | #define errorReportLocationWith(ex,file,line,args) \ 34 | ( errorInitPrint() \ 35 | , printFormat( errorGlobalPrint, ("error in %s, line %d: ", file, line) ) \ 36 | , printFormat( errorGlobalPrint, args ) \ 37 | , exit( ex ) \ 38 | ) 39 | 40 | #define errorReportExt(args) errorReportExtWith(1,args) 41 | #define errorReportExtWith(ex,args) \ 42 | ( errorInitPrint() \ 43 | , printFormat( errorGlobalPrint, ("error: ") ) \ 44 | , printFormat( errorGlobalPrint, args ) \ 45 | , exit( ex ) \ 46 | ) 47 | 48 | /* functions */ 49 | 50 | void errorInitPrint( void ); 51 | void errorSetPrint( print *p, cbool dispose ); 52 | print *errorGetPrint( void ); 53 | 54 | #endif /* ERROR_H */ 55 | 56 | -------------------------------------------------------------------------------- /test/testcase3.arc: -------------------------------------------------------------------------------- 1 | * Set up frame 2 | * test node forces for balance 3 | 4 | VERS 5 5 | TYPE 5 6 | VERT 3 7 | UNIT 1 m kN T C 8 | 9 | NODE 1 1.0000 0.5774 1.6334 000000 10 | NODE 2 1.0000 1.7334 0.0000 111000 11 | NODE 3 0.0000 0.0000 0.0000 111111 12 | NODE 4 2.0000 0.0000 0.0000 111111 13 | 14 | MEMB 2 2 3 Z 1 1 000000 000000 15 | MEMB 3 3 4 Z 1 1 000000 000000 16 | MEMB 4 4 2 Z 1 1 000000 000000 17 | MEMB 5 1 3 Z 1 1 000000 000000 18 | MEMB 6 1 4 Z 1 1 000000 000000 19 | 20 | PROP 1 LIBR asw 60.3X2.3CHS Y default 21 | 4.1900E-04 0.000 0.000 3.5300E-07 1.7700E-07 1.7700E-07 22 | 23 | MATL 1 2.000E+08 2.500E-01 7.850E+00 1.170E-05 24 | 25 | CASE 1 Gravity 26 | GRAV 0.000 0.000 -9.810 27 | 28 | CASE 2 Nodal load 29 | NDLD 1 10.000 40.000 20.000 0.000 0.000 0.000 30 | 31 | CASE 3 Case 1 + Case2 32 | COMB 1 1.000 33 | COMB 2 1.000 34 | 35 | END 36 | 37 | $ design data 38 | SMEM 2 CODE AS4100 DSEC CHS GR C350 MAXSL 180 DMAX 9999.0 39 | OFFS 0.000 TF L BF L LH S KX 1.000 KY 1.000 40 | OFFS L TF L BF L LH S 41 | SMEM 3 CODE AS4100 DSEC CHS GR C350 MAXSL 180 DMAX 9999.0 42 | OFFS 0.000 TF L BF L LH S KX 1.000 KY 1.000 43 | OFFS L TF L BF L LH S 44 | SMEM 4 CODE AS4100 DSEC CHS GR C350 MAXSL 180 DMAX 9999.0 45 | OFFS 0.000 TF L BF L LH S KX 1.000 KY 1.000 46 | OFFS L TF L BF L LH S 47 | SMEM 5 CODE AS4100 DSEC CHS GR C350 MAXSL 180 DMAX 9999.0 48 | OFFS 0.000 TF L BF L LH S KX 1.000 KY 1.000 49 | OFFS L TF L BF L LH S 50 | SMEM 6 CODE AS4100 DSEC CHS GR C350 MAXSL 180 DMAX 9999.0 51 | OFFS 0.000 TF L BF L LH S KX 1.000 KY 1.000 52 | OFFS L TF L BF L LH S 53 | END 54 | -------------------------------------------------------------------------------- /doc/img/j1j2.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 2 1 0 4 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 11 | 5310 3780 3780 2835 12 | 2 1 0 4 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 13 | 6120 2925 5580 4725 14 | 2 1 0 4 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 15 | 7065 5490 7965 7020 16 | 2 1 0 4 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 17 | 6210 5175 7965 4725 18 | 2 1 0 4 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 19 | 8055 3330 9765 2115 20 | 2 1 0 4 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 21 | 7200 2655 7200 855 22 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 23 | 0 0 1.00 60.00 120.00 24 | 6300 4500 6300 945 25 | 2 1 0 4 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 26 | 6930 2925 8145 4050 27 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 3 28 | 0 0 1.00 60.00 120.00 29 | 0 0 1.00 60.00 120.00 30 | 3870 6975 6300 4500 9900 4500 31 | 2 1 0 4 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 32 | 8100 5400 9900 5400 33 | 2 1 0 4 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 34 | 3823 5803 4862 4773 35 | 4 0 0 50 -1 3 18 0.0000 4 195 165 9675 4860 Y\001 36 | 4 0 0 50 -1 3 18 0.0000 4 195 165 6435 1260 Z\001 37 | 4 0 0 50 -1 3 18 0.0000 4 195 195 3780 6705 X\001 38 | 4 0 0 50 -1 18 18 0.0000 4 210 300 8010 5715 N1\001 39 | 4 0 0 50 -1 18 18 0.0000 4 210 300 7335 1080 N2\001 40 | 4 0 0 50 -1 18 18 0.0000 4 210 300 7335 2700 N1\001 41 | 4 0 0 50 -1 18 18 0.0000 4 210 300 9720 5715 N2\001 42 | 4 0 0 50 -1 18 18 0.0000 4 210 300 5175 3600 N1\001 43 | 4 0 0 50 -1 18 18 0.0000 4 210 300 3825 2790 N2\001 44 | 4 0 0 50 -1 18 18 0.0000 4 210 300 3600 5625 N2\001 45 | 4 0 0 50 -1 18 18 0.0000 4 210 300 6705 5760 N1\001 46 | 4 0 0 50 -1 18 18 0.0000 4 210 300 8145 4275 N2\001 47 | 4 0 0 50 -1 18 18 0.0000 4 210 300 5310 5040 N2\001 48 | 4 0 0 50 -1 18 18 0.0000 4 210 300 5940 2835 N1\001 49 | 4 0 0 50 -1 18 18 0.0000 4 210 300 6615 2835 N1\001 50 | 4 0 0 50 -1 18 18 0.0000 4 210 300 9720 2475 N2\001 51 | 4 0 0 50 -1 18 18 0.0000 4 210 300 8190 3555 N1\001 52 | 4 0 0 50 -1 18 18 0.0000 4 210 300 4500 4815 N1\001 53 | 4 0 0 50 -1 18 18 0.0000 4 210 300 7515 7200 N2\001 54 | 4 0 0 50 -1 18 18 0.0000 4 210 300 5850 5355 N2\001 55 | 4 0 0 50 -1 18 18 0.0000 4 210 300 8010 4860 N1\001 56 | -------------------------------------------------------------------------------- /nsis/registerExtension.nsh: -------------------------------------------------------------------------------- 1 | !define registerExtension "!insertmacro registerExtension" 2 | !define unregisterExtension "!insertmacro unregisterExtension" 3 | 4 | !macro registerExtension executable extension description 5 | Push "${executable}" ; "full path to my.exe" 6 | Push "${extension}" ; ".mkv" 7 | Push "${description}" ; "MKV File" 8 | Call registerExtension 9 | !macroend 10 | 11 | ; back up old value of .opt 12 | Function registerExtension 13 | !define Index "Line${__LINE__}" 14 | pop $R0 ; ext name 15 | pop $R1 16 | pop $R2 17 | push $1 18 | push $0 19 | ReadRegStr $1 HKCR $R1 "" 20 | StrCmp $1 "" "${Index}-NoBackup" 21 | StrCmp $1 "OptionsFile" "${Index}-NoBackup" 22 | WriteRegStr HKCR $R1 "backup_val" $1 23 | "${Index}-NoBackup:" 24 | WriteRegStr HKCR $R1 "" $R0 25 | ReadRegStr $0 HKCR $R0 "" 26 | StrCmp $0 "" 0 "${Index}-Skip" 27 | WriteRegStr HKCR $R0 "" $R0 28 | WriteRegStr HKCR "$R0\shell" "" "open" 29 | WriteRegStr HKCR "$R0\DefaultIcon" "" "$R2,0" 30 | "${Index}-Skip:" 31 | WriteRegStr HKCR "$R0\shell\open\command" "" '$R2 "%1"' 32 | WriteRegStr HKCR "$R0\shell\edit" "" "Edit $R0" 33 | WriteRegStr HKCR "$R0\shell\edit\command" "" '$R2 "%1"' 34 | pop $0 35 | pop $1 36 | !undef Index 37 | FunctionEnd 38 | 39 | !macro unregisterExtension extension description 40 | Push "${extension}" ; ".mkv" 41 | Push "${description}" ; "MKV File" 42 | Call un.unregisterExtension 43 | !macroend 44 | 45 | Function un.unregisterExtension 46 | pop $R1 ; description 47 | pop $R0 ; extension 48 | !define Index "Line${__LINE__}" 49 | ReadRegStr $1 HKCR $R0 "" 50 | StrCmp $1 $R1 0 "${Index}-NoOwn" ; only do this if we own it 51 | ReadRegStr $1 HKCR $R0 "backup_val" 52 | StrCmp $1 "" 0 "${Index}-Restore" ; if backup="" then delete the whole key 53 | DeleteRegKey HKCR $R0 54 | Goto "${Index}-NoOwn" 55 | "${Index}-Restore:" 56 | WriteRegStr HKCR $R0 "" $1 57 | DeleteRegValue HKCR $R0 "backup_val" 58 | DeleteRegKey HKCR $R1 ;Delete key with association name settings 59 | "${Index}-NoOwn:" 60 | !undef Index 61 | FunctionEnd 62 | -------------------------------------------------------------------------------- /examples/saveplot_osx: -------------------------------------------------------------------------------- 1 | # File name: saveplot_osx 2 | # creates a PDF file using Gnuplot version 4.2 on OS X 3 | # to save the current plot as a postscript file issue the commands: 4 | # gnuplot> load 'saveplot_osx' 5 | # gnuplot> !cp my-plot.ps plotfileA.ps 6 | 7 | # set size 1.0, 1.0 8 | 9 | set terminal pdf color enhanced fname "Helvetica,6" lw 2 solid 10 | set output "my-plot.pdf" 11 | 12 | replot 13 | set terminal x11 14 | set size 1,1 15 | 16 | # set terminal pdf {color | colour | monochrome} 17 | # {enhanced | noenhanced} 18 | # {fname ""{,}"} 19 | # {linewidth } {rounded | butt} 20 | # {solid | dashed} {dl } 21 | # {size {unit},{unit}} 22 | 23 | 24 | # set terminal postscript {landscape | portrait | eps} 25 | # {enhanced | noenhanced} 26 | # {defaultplex | simplex | duplex} 27 | # {level1 | leveldefault} 28 | # {color | colour | monochrome} 29 | # {solid | dashed} 30 | # {dashlength | dl
} 31 | # {linewidth | lw } 32 | # {rounded | butt} 33 | # {palfuncparam {,}} 34 | # {size {unit},{unit}} 35 | # {blacktext | colortext | colourtext} 36 | # {{font} "fontname{,fontsize}" {}} 37 | 38 | 39 | # set terminal gif {transparent} {interlace} 40 | # {tiny | small | medium | large | giant} 41 | # {size ,} 42 | # { ...} 43 | 44 | # set terminal png 45 | # {{no}transparent} {{no}interlace} 46 | # {tiny | small | medium | large | giant} 47 | # {font {}} 48 | # {size ,} {{no}crop} 49 | # {{no}enhanced} 50 | # { ...} 51 | 52 | 53 | -------------------------------------------------------------------------------- /frame3dd.spec.in: -------------------------------------------------------------------------------- 1 | Name: frame3dd 2 | Summary: Structural analysis of 2D/3D frames 3 | 4 | # NOTE: IF THIS FILE IS NAMED 'frame3dd.spec' THEN DO NOT EDIT IT AS 5 | # YOUR CHANGES WILL BE OVERWRITTEN. The 'frame3dd.spec' file is auto-generated 6 | # from the 'frame3dd.spec.in' file; you should make your changes to this latter 7 | # file instead. 8 | 9 | # This version number is filled in automatically when you run 'scons dist'. 10 | # You should update it in the 'SConstruct' file, rather than here. 11 | Version: @VERSION@ 12 | 13 | # Use release 0.* so that other users can do patch releases with a higher number 14 | # and still have the update occur automatically. 15 | Release: 0%{?dist} 16 | 17 | License: GPL 18 | Group: Applications/Engineering 19 | Source: %{name}-%{version}.tar.bz2 20 | URL: http://frame3dd.sourceforge.net/index.html 21 | 22 | Prefix: %{_prefix} 23 | Packager: John Pye 24 | Vendor: Henri Gavin 25 | BuildRoot: %{_tmppath}/%{name}-%{version}-root 26 | 27 | BuildRequires: gcc-c++ 28 | BuildRequires: scons >= 0.96.92 29 | BuildRequires: SoQt-devel, Coin2-devel 30 | 31 | %description 32 | Free software for static and dynamic structural analysis of 2D and 3D frames 33 | and trusses with elastic and geometric stiffness. Computes the static 34 | deflections, reactions, internal element forces, natural frequencies, mode 35 | shapes and modal participation factors of two- and three- dimensional elastic 36 | structures using direct stiffness and mass assembly. Graphical output and 37 | mode shape animation via Gnuplot version 4.0. 38 | 39 | Requires: gnuplot, SoQT, Coin2. 40 | 41 | %prep 42 | %setup -q 43 | 44 | %build 45 | rm -rf %{buildroot} 46 | scons %{?_smp_mflags} CXX="%{?ccache} g++" CC="%{?ccache} gcc" \ 47 | INSTALL_ROOT=%{buildroot} \ 48 | INSTALL_PREFIX=%{_prefix} 49 | 50 | %install 51 | scons %{?_smp_mflags} install \ 52 | INSTALL_ROOT=%{buildroot} \ 53 | INSTALL_PREFIX=%{_prefix} 54 | 55 | %clean 56 | rm -rf %{buildroot} 57 | 58 | %files 59 | %defattr(-, root, root) 60 | %doc doc/* 61 | %{_bindir} 62 | %{_libdir}/lib*.so* 63 | %{_datadir}/%{name} 64 | 65 | %changelog 66 | # 67 | # ChangeLog is now maintained in ChangeLog.txt. Make your changes there. 68 | # 69 | @CHANGELOG@ 70 | 71 | -------------------------------------------------------------------------------- /src/SConscript: -------------------------------------------------------------------------------- 1 | """ 2 | FRAME3DD: 3 | Static and dynamic structural analysis of 2D and 3D frames and trusses with 4 | elastic and geometric stiffness. 5 | --------------------------------------------------------------------------- 6 | http://www.duke.edu/~hpgavin/frame/ 7 | --------------------------------------------------------------------------- 8 | Copyright (C) 1992-2008 Henri P. Gavin 9 | 10 | FRAME3DD is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | FRAME3DD is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with FRAME3DD. If not, see . 22 | """ 23 | Import('env') 24 | 25 | srcs = [ 26 | 'frame3dd.c','eig.c','HPGmatrix.c','HPGutil.c','NRutil.c' 27 | ,'frame3dd_io.c', 'coordtrans.c' 28 | ] 29 | 30 | prog_env = env.Clone() 31 | 32 | obj_env = env.Clone() 33 | if env.get('HAVE_ITOA'): 34 | obj_env.Append(CPPDEFINES=['HAVE_ITOA']) 35 | 36 | objs = [] 37 | for s in srcs: 38 | objs.append( obj_env.Object(s) ) 39 | 40 | if env.get('VERSION'): 41 | prog_env.Append( 42 | CPPDEFINES=['VERSION=\\"%s\\"' % env['VERSION']] 43 | ) 44 | 45 | frame3dd = prog_env.Program('frame3dd',objs + ['main.c'], LIBS=['m']) 46 | 47 | env['PROGS'].append(frame3dd) 48 | 49 | # proceed into subdirectory to create libmicrostranparser 50 | env.SConscript('microstran/SConscript','env') 51 | 52 | # proceed into directory to create frame viewer program 53 | env.SConscript('viewer/SConscript','env') 54 | 55 | bindir=Dir(env.subst("$INSTALL_ROOT$INSTALL_BIN")) 56 | env.Install(bindir,frame3dd); 57 | 58 | #libdir=Dir(env.subst("$INSTALL_ROOT$INSTALL_LIB")) 59 | #env.Install(bindir,lib); 60 | 61 | env['installdirs'] += [bindir] 62 | 63 | print "CCFLAGS =",env['CCFLAGS'] 64 | 65 | # vim: set syntax=python 66 | -------------------------------------------------------------------------------- /src/viewer/render.h: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | #ifndef FRAME_RENDER_H 18 | #define FRAME_RENDER_H 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | extern const SbColor WHITE; 29 | extern const SbColor RED; 30 | extern const SbColor GREEN; 31 | extern const SbColor YELLOW; 32 | extern const SbColor BLUE; 33 | extern const SbColor ORANGE; 34 | extern const SbColor PURPLE; 35 | extern const SbColor MAGENTA; 36 | extern const SbColor CYAN; 37 | extern const SbColor LIME; 38 | 39 | SoSeparator *text(const SbVec3f &left, const char *str, const SbColor &c=WHITE); 40 | SoSeparator *sphere(const SbVec3f &C, const double &r=0.1, const SbColor &c=YELLOW); 41 | SoSeparator *cylinder(const SbVec3f &A, const SbVec3f &B, const double &radius=0.1, const SbColor &c=YELLOW); 42 | SoSeparator *cone(const SbVec3f &A, const SbVec3f &B, const double &r, const SbColor &c = YELLOW); 43 | SoSeparator *axes(const double &size=1.0, double thickness=0.0, bool labelled=true); 44 | SoSeparator *arrow(const SbVec3f &A, const SbVec3f &B, const SbColor &c=YELLOW, const char *label=NULL, double thickness=0.05); 45 | SoSeparator *face(const SbVec3f &n, const std::vector &vertices, const SbColor &c=YELLOW); 46 | 47 | SoSeparator *prism(const SbVec3f &A, const SbVec3f &B, const section_outline &outline, const SbColor &c, const SbVec3f &O); 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /PACKAGING.txt: -------------------------------------------------------------------------------- 1 | 2 | Information for packaging FRAME3DD 3 | ================================== 4 | 5 | Source tarball 6 | -------------- 7 | 8 | To build the source tarball from subversion: 9 | 10 | scons dist 11 | 12 | 13 | RPM package 14 | ----------- 15 | 16 | To build an RPM: 17 | 18 | scons dist 19 | rpmbuild -ta dist/frame3dd-*.tar.bz2 20 | 21 | (Some values in ~/.rpmmacros may need to be set first) 22 | 23 | Last tested with Fedora 9. 24 | 25 | 26 | .DEB package 27 | ------------ 28 | 29 | To build a Debian package (e.g. suitable for Ubuntu), first get hold of the 30 | 'dtar' tool: 31 | 32 | http://ascend4.org/Dtar 33 | 34 | Install the debhelper package and the fakeroot package 35 | 36 | sudo apt-get install fakeroot debhelper 37 | 38 | Then, assuming you installed dtar somewhere on your path, (change below 39 | according to current version number): 40 | 41 | cd ~/frame3dd 42 | scons dist 43 | dtar dist/frame3dd-0.20091020.tar.bz2 dist/debian.tar.gz 44 | 45 | You should then have a .deb file in your ~/frame3dd directory. You can check 46 | its contents using dpkg --contents *.deb. You can then install the package 47 | using dpkg -i *.deb. 48 | 49 | Note that this package includes the microstran parser and rendering/viewer 50 | program, and as such, the package has numerous dependencies. We plan to 51 | separate this viewer into a subpackage, to allow the dependencies to be 52 | minimised, but this has not been done just yet. 53 | 54 | 55 | Windows installer 56 | ----------------- 57 | 58 | To build a Windows installer (from MinGW/MSYS console): 59 | 60 | scons installer 61 | 62 | You will need to have NSIS installed on your system. This is the program that 63 | actually generates the installer -- SCons just 'oversees' the process. 64 | 65 | 66 | Mac OS X package 67 | ---------------- 68 | 69 | Mac OS X package are not yet implemented. Hopefully coming soon. For now, use 70 | the source tarball and build for yourself. SCons should first be installed using 71 | 'easy_install' using standard Mac Python (not Fink/MacPorts). 72 | 73 | 74 | Releasing the files 75 | ------------------- 76 | 77 | To upload files to Sourceforge.net for distribution: 78 | 79 | https://sourceforge.net/apps/trac/sourceforge/wiki/Release%20files%20for%20download 80 | 81 | 82 | -- 83 | John Pye 84 | 18 Mar 2013 85 | -------------------------------------------------------------------------------- /src/microstran/dumpsections.c: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | *//**@FILE 17 | little program to demonstrate that we can meaninfully parse the 'properties.txt' file 18 | */ 19 | 20 | #include "sections.h" 21 | #include "sectionsparser.h" 22 | 23 | #include 24 | 25 | int main(int argc, char **argv){ 26 | const char *filename = "src/microstran/properties.txt"; 27 | if(argc>=2){ 28 | filename = argv[1]; 29 | } 30 | 31 | FILE *f; 32 | f = fopen(filename,"r"); 33 | if(f==NULL){ 34 | fprintf(stderr,"Unable to open section library '%s'",filename); 35 | exit(1); 36 | } 37 | 38 | const char *sn = "12ROD"; 39 | if(argc >=3){ 40 | sn = argv[2]; 41 | } 42 | 43 | parse *p; 44 | p = parseCreateFileName(filename); 45 | 46 | section_library *l = NULL; 47 | l = section_library_create(); 48 | parseSections(p,l); 49 | 50 | fprintf(stderr,"\n\nLooking up section '%s'...\n",sn); 51 | const section *s; 52 | s = section_find(l,sn); 53 | if(s==NULL){ 54 | fprintf(stderr,"SECTION NOT FOUND\n"); 55 | return 1; 56 | }else{ 57 | fprintf(stderr,"SECTION FOUND\n"); 58 | 59 | section_print(stderr,s); 60 | 61 | if(section_is_chs(s)){ 62 | fprintf(stderr,"CHS\n"); 63 | fprintf(stderr,"outside diameter = %f\n", section_chs_outside_diameter(s)); 64 | fprintf(stderr,"thickness = %f\n\n", section_chs_thickness(s)); 65 | } 66 | 67 | section_outline *o; 68 | o = section_get_outline(s); 69 | if(o){ 70 | fprintf(stderr,"\nOutline:\n"); 71 | section_outline_print(stderr,o); 72 | } 73 | } 74 | return 0; 75 | } 76 | 77 | -------------------------------------------------------------------------------- /scons/soqt.py: -------------------------------------------------------------------------------- 1 | import os, platform 2 | from SCons.Script import * 3 | 4 | def generate(env): 5 | """ 6 | Detect SOQT settings and add them to the environment. 7 | """ 8 | try: 9 | if platform.system()=="Windows": 10 | import _winreg 11 | x=_winreg.ConnectRegistry(None,_winreg.HKEY_LOCAL_MACHINE) 12 | y= _winreg.OpenKey(x,r"SOFTWARE\soqt") 13 | LIB,t = _winreg.QueryValueEx(y,"INSTALL_LIB") 14 | BIN,t = _winreg.QueryValueEx(y,"INSTALL_BIN") 15 | INCLUDE,t = _winreg.QueryValueEx(y,"INSTALL_INCLUDE") 16 | 17 | env['SOQT_CPPPATH'] = [INCLUDE] 18 | env['SOQT_LIBPATH'] = [LIB] 19 | env['SOQT_LIBS'] = ['SoQt'] 20 | env['SOQT_CPPDEFINES'] = ['SOQT_DLL'] 21 | 22 | x=_winreg.ConnectRegistry(None,_winreg.HKEY_LOCAL_MACHINE) 23 | y= _winreg.OpenKey(x,r"SOFTWARE\coin3d") 24 | LIB,t = _winreg.QueryValueEx(y,"INSTALL_LIB") 25 | BIN,t = _winreg.QueryValueEx(y,"INSTALL_BIN") 26 | INCLUDE,t = _winreg.QueryValueEx(y,"INSTALL_INCLUDE") 27 | 28 | env.AppendUnique( 29 | SOQT_CPPPATH = [INCLUDE] 30 | ,SOQT_LIBPATH = [LIB] 31 | ,SOQT_LIBS = ['Coin'] 32 | ,SOQT_CPPDEFINES = ['COIN_DLL'] 33 | ) 34 | 35 | env.AppendUnique( 36 | QT_PREFIX = r'c:/Qt/4.3.3' 37 | ,SOQT_CPPPATH = ["$QT_PREFIX/include","$QT_PREFIX/include/Qt"] 38 | ,SOQT_LIBPATH = ["$QT_PREFIX/lib"] 39 | ) 40 | 41 | else: 42 | cmd = ['soqt-config','--cppflags','--ldflags','--libs'] 43 | env1 = env.Clone() 44 | env1.ParseConfig(cmd) 45 | env['SOQT_CPPPATH'] = env1.get('CPPPATH') 46 | env['SOQT_LIBPATH'] = env1.get('LIBPATH') 47 | env['SOQT_LIBS'] = env1.get('LIBS') 48 | env['SOQT_CPPDEFINES'] = env1.get('CPPDEFINES') 49 | 50 | print "SOQT_LIBS =",env.get('SOQT_LIBS') 51 | print "SOQT_LIBPATH =",env.get('SOQT_LIBPATH') 52 | print "SOQT_CPPPATH =",env.get('SOQT_CPPPATH') 53 | print "SOQT_CPPDEFINES =",env.get('SOQT_CPPDEFINES') 54 | 55 | except: 56 | print "FAILED TO SET UP SOQT" 57 | pass 58 | 59 | def exists(env): 60 | """ 61 | Make sure this tool exists. 62 | """ 63 | if platform.system()=="Windows": 64 | try: 65 | import _winreg 66 | x=_winreg.ConnectRegistry(None,_winreg.HKEY_LOCAL_MACHINE) 67 | y= _winreg.OpenKey(x,r"SOFTWARE\soqt") 68 | INCLUDE,t = _winreg.QueryValueEx(y,'INSTALL_INCLUDE') 69 | return True 70 | except: 71 | return False 72 | else: 73 | if env.Which('soqt-config'): 74 | return True 75 | return False 76 | 77 | -------------------------------------------------------------------------------- /doc/img/coords.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5b 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 6 5985 4140 6705 4860 11 | 1 4 0 5 0 7 20 -1 20 0.000 1 0.0000 6349 4512 293 293 6056 4512 6642 4512 12 | 2 1 0 1 0 7 15 -1 -1 0.000 0 0 -1 1 0 2 13 | 0 0 1.00 60.00 120.00 14 | 6390 4545 6120 4365 15 | -6 16 | 2 1 0 4 0 7 50 -1 -1 0.000 0 0 -1 0 1 2 17 | 0 0 4.00 300.00 360.00 18 | 6300 3150 6300 4500 19 | 2 1 0 4 0 7 50 -1 -1 0.000 0 0 -1 0 1 2 20 | 0 0 4.00 300.00 360.00 21 | 7650 4500 6300 4500 22 | 2 1 0 4 0 7 50 -1 -1 0.000 0 0 -1 0 1 2 23 | 0 0 4.00 300.00 360.00 24 | 8190 4500 6840 4500 25 | 2 1 0 4 0 7 50 -1 -1 0.000 0 0 -1 0 1 2 26 | 0 0 4.00 300.00 360.00 27 | 8415 4500 7065 4500 28 | 2 1 0 4 0 7 50 -1 -1 0.000 0 0 -1 0 1 2 29 | 0 0 4.00 300.00 360.00 30 | 5445 5355 6278 4479 31 | 2 1 0 4 0 7 50 -1 -1 0.000 0 0 -1 0 1 2 32 | 0 0 4.00 300.00 360.00 33 | 5085 5715 5918 4839 34 | 2 1 0 4 0 7 50 -1 -1 0.000 0 0 -1 0 1 2 35 | 0 0 4.00 300.00 360.00 36 | 4907 5895 5740 5019 37 | 2 1 0 4 0 7 50 -1 -1 0.000 0 0 -1 0 1 2 38 | 0 0 4.00 300.00 360.00 39 | 6300 2565 6300 3915 40 | 2 1 0 4 0 7 50 -1 -1 0.000 0 0 -1 0 1 2 41 | 0 0 4.00 300.00 360.00 42 | 6300 2340 6300 3690 43 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 3 44 | 0 0 1.00 60.00 120.00 45 | 0 0 1.00 60.00 120.00 46 | 8910 5985 9397 5490 10215 5490 47 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 48 | 0 0 1.00 60.00 120.00 49 | 9405 5490 9405 4455 50 | 4 0 0 50 -1 18 20 0.0000 4 225 180 4770 5625 4\001 51 | 4 0 0 50 -1 18 20 0.0000 4 225 180 5400 4995 1\001 52 | 4 0 0 50 -1 18 20 0.0000 4 225 180 7380 4950 2\001 53 | 4 0 0 50 -1 18 20 0.0000 4 225 180 6480 3510 3\001 54 | 4 0 0 50 -1 18 20 0.0000 4 225 180 6435 2565 6\001 55 | 4 0 0 50 -1 3 20 0.0000 4 225 615 5490 3510 6n-3\001 56 | 4 0 0 50 -1 3 20 0.0000 4 225 345 5805 2610 6n\001 57 | 4 0 0 50 -1 3 20 0.0000 4 225 615 5310 5985 6n-2\001 58 | 4 0 0 50 -1 3 20 0.0000 4 225 615 5850 5400 6n-5\001 59 | 4 0 0 50 -1 3 20 0.0000 4 225 615 7200 4185 6n-4\001 60 | 4 0 0 50 -1 3 20 0.0000 4 225 615 8145 4185 6n-1\001 61 | 4 0 0 50 -1 18 20 0.0000 4 225 180 8280 4950 5\001 62 | 4 0 0 50 -1 3 18 0.0000 4 195 180 9540 4725 Z\001 63 | 4 0 0 50 -1 3 18 0.0000 4 195 180 10035 5805 Y\001 64 | 4 0 0 50 -1 3 18 0.0000 4 195 195 8685 5985 X\001 65 | 4 0 0 15 -1 3 20 0.0000 4 150 180 6435 4635 n\001 66 | 4 0 0 50 -1 3 16 0.0000 4 120 150 5895 4410 n\001 67 | 4 0 0 50 -1 3 20 0.0000 4 150 135 5805 4230 r\001 68 | -------------------------------------------------------------------------------- /src/microstran/dumpforces.c: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | *//**@FILE 17 | little program to demonstrate that we can meaninfully parse model forces data files. 18 | */ 19 | 20 | #include "forceparser.h" 21 | 22 | #include 23 | 24 | int main(int argc, char **argv){ 25 | const char *filename = "forces.p1"; 26 | if(argc==2){ 27 | filename = argv[1]; 28 | } 29 | 30 | FILE *f; 31 | f = fopen(filename,"r"); 32 | if(f==NULL){ 33 | fprintf(stderr,"Unable to member forces data file '%s'",filename); 34 | exit(1); 35 | } 36 | 37 | parse *p; 38 | p = parseCreateFileName(filename); 39 | 40 | modelforces *MF = NULL; 41 | parseMicrostranForces(p,&MF); 42 | if(MF==NULL){ 43 | fprintf(stderr,"ERROR: Failed to parse forces!\n"); 44 | exit(1); 45 | } 46 | 47 | unsigned caseid = 1; 48 | fprintf(stderr,"Looking up case %d...\n",caseid); 49 | caseforces *cf; 50 | cf = modelforces_find_case(MF,caseid); 51 | if(cf==NULL){ 52 | fprintf(stderr,"LOAD CASE %d NOT FOUND\n",caseid); 53 | return 1; 54 | }else{ 55 | fprintf(stderr,"CASE ID %d FOUND\n",caseid); 56 | } 57 | 58 | unsigned memberid = 4; 59 | const memberforce *mf; 60 | mf = caseforces_find_member(cf, memberid); 61 | 62 | if(mf==NULL){ 63 | fprintf(stderr,"MEMBER FORCE FOR MEMBER %d NOT FOUND\n",memberid); 64 | return 1; 65 | } 66 | fprintf(stderr,"FOUND FORCE ON MEMBER %d\n",memberid); 67 | 68 | fprintf(stderr,"Force at 'from' end (node %d):\n",mf->fromnode.node); 69 | VEC3_PR(mf->fromnode.F); 70 | VEC3_PR(mf->fromnode.M); 71 | 72 | fprintf(stderr,"Force at 'to' end (node %d):\n",mf->tonode.node); 73 | VEC3_PR(mf->tonode.F); 74 | VEC3_PR(mf->tonode.M); 75 | 76 | return 0; 77 | } 78 | 79 | -------------------------------------------------------------------------------- /examples/saveplot_w32: -------------------------------------------------------------------------------- 1 | # File name: saveplot_w32 2 | # creates a PostScript file using Gnuplot version 4.2 on Windows 3 | # to save the current plot as a postscript file issue the commands: 4 | # gnuplot> load 'saveplot' 5 | # gnuplot> !copy my-plot.ps plotfileA.ps 6 | 7 | # set size 1.0, 0.6 8 | 9 | set terminal postscript landscape enhanced color solid lw 1 font "Helvetica,10" 10 | #set terminal postscript portrait enhanced color solid lw 2 font "Helvetica,10" 11 | #set terminal postscript eps enhanced color solid lw 1 font "Helvetica,10" 12 | 13 | set output "my-plot.ps" 14 | replot 15 | set terminal windows 16 | set size 1,1 17 | 18 | # ... for .png plots ... 19 | set terminal png enhanced notransparent lw 1 large font "Helvetica,10" 20 | set output "my-plot.png" 21 | replot 22 | 23 | 24 | # set terminal postscript {default} 25 | # set terminal postscript {landscape | portrait | eps} 26 | # {enhanced | noenhanced} 27 | # {defaultplex | simplex | duplex} 28 | # {fontfile [add | delete] "" 29 | # | nofontfiles} {{no}adobeglyphnames} 30 | # {level1 | leveldefault} 31 | # {color | colour | monochrome} 32 | # {background | nobackground} 33 | # {solid | dashed} 34 | # {dashlength | dl
} 35 | # {linewidth | lw } 36 | # {rounded | butt} 37 | # {clip | noclip} 38 | # {palfuncparam {,}} 39 | # {size {unit},{unit}} 40 | # {blacktext | colortext | colourtext} 41 | # {{font} "fontname{,fontsize}" {}} 42 | # {fontscale } 43 | 44 | # set terminal gif {transparent} {interlace} 45 | # {tiny | small | medium | large | giant} 46 | # {size ,} 47 | # { ...} 48 | 49 | # set terminal png 50 | # {{no}enhanced} 51 | # {{no}transparent} {{no}interlace} 52 | # {{no}truecolor} {rounded|butt} 53 | # {linewidth } {dashlength
} 54 | # {tiny | small | medium | large | giant} 55 | # {font " {,}"} {fontscale } 56 | # {size ,} {{no}crop} 57 | # {background } 58 | 59 | -------------------------------------------------------------------------------- /examples/saveplot: -------------------------------------------------------------------------------- 1 | # File name: saveplot 2 | # creates a PostScript file using Gnuplot version 4.6 on Linux and OS X 3 | # to save the current plot as a postscript file issue the commands: 4 | # gnuplot> load 'saveplot' 5 | # gnuplot> !cp my-plot.ps plotfileA.ps 6 | 7 | # set size 1.0, 0.6 8 | 9 | # ... for .eps plots ... 10 | #set terminal postscript landscape enhanced color solid lw 1 font "Helvetica,10" 11 | #set terminal postscript portrait enhanced color solid lw 1 font "Helvetica,10" 12 | set terminal postscript eps enhanced color solid lw 1 font "Helvetica,10" 13 | set output "my-plot.eps" 14 | replot 15 | 16 | # ... for .png plots ... 17 | set terminal png enhanced notransparent lw 1 large font "Helvetica,10" 18 | set output "my-plot.png" 19 | replot 20 | 21 | set terminal wxt 22 | set size 1,1 23 | 24 | # set terminal postscript {default} 25 | # set terminal postscript {landscape | portrait | eps} 26 | # {enhanced | noenhanced} 27 | # {defaultplex | simplex | duplex} 28 | # {fontfile [add | delete] "" 29 | # | nofontfiles} {{no}adobeglyphnames} 30 | # {level1 | leveldefault} 31 | # {color | colour | monochrome} 32 | # {background | nobackground} 33 | # {solid | dashed} 34 | # {dashlength | dl
} 35 | # {linewidth | lw } 36 | # {rounded | butt} 37 | # {clip | noclip} 38 | # {palfuncparam {,}} 39 | # {size {unit},{unit}} 40 | # {blacktext | colortext | colourtext} 41 | # {{font} "fontname{,fontsize}" {}} 42 | # {fontscale } 43 | 44 | # set terminal gif {transparent} {interlace} 45 | # {tiny | small | medium | large | giant} 46 | # {size ,} 47 | # { ...} 48 | 49 | # set terminal png 50 | # {{no}enhanced} 51 | # {{no}transparent} {{no}interlace} 52 | # {{no}truecolor} {rounded|butt} 53 | # {linewidth } {dashlength
} 54 | # {tiny | small | medium | large | giant} 55 | # {font " {,}"} {fontscale } 56 | # {size ,} {{no}crop} 57 | # {background } 58 | 59 | -------------------------------------------------------------------------------- /src/microstran/dumpcases.c: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | *//**@FILE 17 | little program to demonstrate that we can retrieve load case data from 18 | parsed microstran .arc files 19 | */ 20 | 21 | #include "modelparser.h" 22 | #include "case.h" 23 | 24 | #include 25 | #include 26 | 27 | int main(int argc, char **argv){ 28 | const char *filename = "model.arc"; 29 | if(argc==2){ 30 | filename = argv[1]; 31 | } 32 | 33 | FILE *f; 34 | f = fopen(filename,"r"); 35 | if(f==NULL){ 36 | fprintf(stderr,"Unable to .arc model file '%s'",filename); 37 | exit(1); 38 | } 39 | 40 | parse *p; 41 | p = parseCreateFileName(filename); 42 | 43 | model *M = NULL; 44 | parseModelMicrostran(p,&M); 45 | if(M==NULL){ 46 | fprintf(stderr,"ERROR: Failed to parse model '%s'!\n",filename); 47 | exit(1); 48 | } 49 | 50 | fprintf(stderr,"======================================\n"); 51 | 52 | unsigned i, j, nc = ARRAY_NUM(M->cases); 53 | for(i=0; icases, i); 55 | switch(c->type){ 56 | case CASE_LOADS: 57 | fprintf(stderr,"Case %d: %d NDLDs '%s'\n", c->id, ARRAY_NUM(c->data), c->name); 58 | break; 59 | case CASE_COMB: 60 | fprintf(stderr,"\nCase %d: %d COMBs '%s'\n", c->id, ARRAY_NUM(c->data), c->name); 61 | for(j = 0; jdata); ++j){ 62 | comb_stmt *c1 = array_get(&c->data, j); 63 | case_stmt *case1 = array_get(&M->cases, c1->caseindex); 64 | //fprintf(stderr,"c1->c = %p, M->cases.data = %p\n", case1, M->cases.data); 65 | //assert(c1->c >= (case_stmt *)M->cases.data); 66 | //assert(c1->c < (((case_stmt *)M->cases.data + ARRAY_NUM(M->cases)))); 67 | fprintf(stderr," + %f × CASE %d '%s'\n", c1->factor, case1->id, case1->name); 68 | } 69 | break; 70 | default: 71 | fprintf(stderr,"CASE UNKNOWN TYPE\n"); 72 | exit(1); 73 | } 74 | }; 75 | 76 | return 0; 77 | } 78 | 79 | -------------------------------------------------------------------------------- /src/coordtrans.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of FRAME3DD: 3 | Static and dynamic structural analysis of 2D and 3D frames and trusses with 4 | elastic and geometric stiffness. 5 | --------------------------------------------------------------------------- 6 | http://frame3dd.sourceforge.net/ 7 | --------------------------------------------------------------------------- 8 | Copyright (C) 1992-2009 Henri P. Gavin 9 | 10 | FRAME3DD is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | FRAME3DD is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with FRAME3DD. If not, see . 22 | *//** 23 | @file 24 | Coordinate transformations for the FRAME3DD solver API. 25 | */ 26 | #ifndef FRAME_COORDTRANS_H 27 | #define FRAME_COORDTRANS_H 28 | 29 | #include "microstran/vec3.h" 30 | 31 | #include "common.h" 32 | #include "HPGutil.h" 33 | 34 | 35 | /** 36 | COORD_TRANS - evaluate the 3D coordinate transformation coefficients 1dec04 37 | Default order of coordinate rotations... typical for Y as the vertical axis 38 | 1. rotate about the global Z axis 39 | 2. rotate about the global Y axis 40 | 3. rotate about the local x axis --- element 'roll' 41 | 42 | If Zvert is defined as 1, then the order of coordinate rotations is typical 43 | for Z as the vertical axis 44 | 1. rotate about the global Y axis 45 | 2. rotate about the global Z axis 46 | 3. rotate about the local x axis --- element 'roll' 47 | 48 | Q=TF; U=TD; T'T=I; Q=kU; TF=kTD; T'TF=T'kTD; T'kT = K; F=KD 49 | */ 50 | void coord_trans ( 51 | vec3 *xyz, // XYZ coordinate of all nodes 52 | double L, // length of all beam elements 53 | int n1, int n2, // node connectivity 54 | double *t1, double *t2, double *t3, double *t4, double *t5, 55 | double *t6, double *t7, double *t8, double *t9, // coord transformation 56 | float p // the roll angle (radians) 57 | ); 58 | 59 | /** 60 | ATMA - carry out the coordinate transformation 61 | */ 62 | void atma ( 63 | double t1, double t2, double t3, 64 | double t4, double t5, double t6, 65 | double t7, double t8, double t9, 66 | double **m, float r1, float r2 67 | ); 68 | 69 | #endif /* FRAME_COORDTRANS_H */ 70 | 71 | -------------------------------------------------------------------------------- /src/microstran/array.h: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | *//** @file 17 | data type for dynamically-size array in C. this array will 18 | automatically resize when you use array_set outside its bounds. it is 19 | dense, however: storage is allocated for members in the range 0..num. 20 | 21 | you can't shrink the array unless you just copy a range into a new array 22 | then destroy the old one. 23 | 24 | note that when the array is resized, data is copied to a new location, so 25 | pointers into the array are a bad idea. you should used array indices 26 | instead. 27 | */ 28 | 29 | #ifndef MSTRANP_ARRAY_H 30 | #define MSTRANP_ARRAY_H 31 | 32 | #include "config.h" 33 | #include 34 | 35 | #ifdef __cplusplus 36 | extern "C"{ 37 | #endif 38 | 39 | typedef struct array_{ 40 | size_t eachsize; 41 | unsigned num; 42 | unsigned cap; 43 | void *data; 44 | } array; 45 | 46 | /** create a new array. prefer to use ARRAY_CREATE instead. */ 47 | array array_create(size_t eachsize, unsigned cap); 48 | 49 | #define ARRAY_CREATE(TYPE,CAP) array_create(sizeof(TYPE),(CAP)) 50 | 51 | #define ARRAY_NUM(ARRAY) ((ARRAY).num) 52 | 53 | /** set a value in the array. pass value by pointer; it is *copied* into place. @return pointer to the updated data element */ 54 | void *array_set(array *a, unsigned index, void *val); 55 | 56 | /** look up a value in the array. @return pointer to the location where the data is stored. */ 57 | MSTRANP_API void *array_get(array *a, unsigned index); 58 | 59 | /** place a value at the end of the array. value is copied into place. @return a pointer to the new member */ 60 | void *array_append(array *a, void *val); 61 | 62 | /** destroy memory contained in array and clear num/cap of the array struct */ 63 | void array_destroy(array *a); 64 | 65 | /** copy an array. capacity of new array will include no spare space */ 66 | array array_copy(const array a); 67 | 68 | #ifdef __cplusplus 69 | }; 70 | #endif 71 | 72 | #endif /* MSTRANP_ARRAY_H */ 73 | 74 | -------------------------------------------------------------------------------- /src/microstran/displacements.h: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | *//** @file 17 | Data structures to hold model case deflection data 18 | */ 19 | #ifndef DISPLACEMENTS_H 20 | #define DISPLACEMENTS_H 21 | 22 | #include "config.h" 23 | #include "model.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C"{ 27 | #endif 28 | 29 | #define MAXDISPLACEMENTSNAME 80 30 | 31 | /** 32 | Displacement (both translation and rotation) 33 | of a node, together with the node's ID. 34 | */ 35 | typedef struct nodedisplacement_{ 36 | int node; 37 | double dx,dy,dz; /* displacements */ 38 | double rx,ry,rz; /* rotations */ 39 | } nodedisplacement; 40 | 41 | /** 42 | Displacement data for a specific load case. 43 | */ 44 | typedef struct casedisplacements_{ 45 | int id; 46 | char name[MAXCASENAME]; 47 | array nodes; /* array (list) of node_displacement */ 48 | } casedisplacements; 49 | 50 | /** 51 | Displacement data structure for containing results parsed from 52 | .p1 data files. 53 | */ 54 | typedef struct modeldisplacements_{ 55 | char filename[MAXDISPLACEMENTSNAME]; 56 | array cases; /* array (list) of displacement_case */ 57 | } modeldisplacements; 58 | 59 | casedisplacements *casedisplacements_create(unsigned id, const char *name); 60 | void casedisplacements_destroy(casedisplacements *cd); 61 | 62 | cbool casedisplacements_add_node(casedisplacements *cd, unsigned nodeid, double dx, double dy, double dz, double rx, double ry, double rz); 63 | 64 | modeldisplacements *modeldisplacements_create(); 65 | void modeldisplacements_destroy(modeldisplacements *a); 66 | 67 | cbool modeldisplacements_add_case(modeldisplacements *md, casedisplacements *cd); 68 | 69 | MSTRANP_API casedisplacements *modeldisplacements_find_case(modeldisplacements *md, unsigned caseid); 70 | 71 | nodedisplacement *casedisplacements_find_node(casedisplacements *cd, const unsigned nodeid); 72 | 73 | MSTRANP_API casedisplacements *modeldisplacements_get_case(modeldisplacements *md, unsigned index); 74 | 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | 79 | #endif 80 | 81 | -------------------------------------------------------------------------------- /src/microstran/vec3.h: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | *//** 17 | @file 18 | 3D vector type and related functions/methods. 19 | */ 20 | #ifndef MSTRAP_VEC3_H 21 | #define MSTRAP_VEC3_H 22 | 23 | #include "config.h" 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C"{ 28 | #endif 29 | 30 | /** 31 | 3D vector type used by the microstran parser 32 | */ 33 | 34 | typedef struct vec3_struct{ 35 | double x, y, z; 36 | } vec3; 37 | 38 | MSTRANP_API const vec3 VEC3_ZERO; 39 | 40 | MSTRANP_API vec3 vec3_create(double x, double y, double z); 41 | MSTRANP_API double vec3_dot(vec3 A, vec3 B); 42 | MSTRANP_API vec3 vec3_add(vec3 A, vec3 B); 43 | MSTRANP_API vec3 vec3_cross(vec3 A, vec3 B); 44 | MSTRANP_API vec3 vec3_scale(vec3 A, double s); 45 | MSTRANP_API vec3 vec3_norm(vec3 A); 46 | MSTRANP_API double vec3_mod(vec3 A); 47 | MSTRANP_API vec3 vec3_negate(vec3 A); 48 | 49 | /** 50 | Vector difference/subtraction. 51 | @return the vector (A - B) 52 | */ 53 | MSTRANP_API vec3 vec3_diff(vec3 A, vec3 B); 54 | 55 | MSTRANP_API int vec3_print(FILE *f, vec3 A); 56 | 57 | MSTRANP_API vec3 vec3_rotate(vec3 A, vec3 axis, double theta); 58 | 59 | /** 60 | Calculate the angle between two vectors, in radians. 61 | */ 62 | MSTRANP_API double vec3_angle(vec3 A, vec3 B); 63 | 64 | /** 65 | Calculate the angle between two vectors, in radians. Also return 66 | the cross-product of the two vectors, useful with vec3_rotate. 67 | */ 68 | MSTRANP_API double vec3_angle_cross(vec3 A, vec3 B, vec3 *C); 69 | 70 | MSTRANP_API char vec3_equal(vec3 A, vec3 B); 71 | MSTRANP_API char vec3_equal_tol(vec3 A, vec3 B, double tol); 72 | 73 | char vec3_isnan(const vec3 *A); 74 | 75 | #define VEC3_PR(V) (fprintf(stderr,"%s = ",#V), vec3_print(stderr,V), fprintf(stderr,"\n")) 76 | 77 | #define VEC3_CHECK_NAN(V) (vec3_isnan(&(V)) ? (VEC3_PR(V), assert(!vec3_isnan(&(V)))) : 0) 78 | 79 | #define VEC3_ASSERT_EQUAL_TOL(X,Y,TOL) (vec3_equal_tol((X),(Y),TOL) ? 0 : (VEC3_PR(X), VEC3_PR(Y), assert(vec3_equal_tol((X),(Y),TOL)))) 80 | 81 | #define VEC3_NOT_EQUAL(X,Y) ((X).x!=(Y).x || (X).y!=(Y).y || (X).z!=(Y).z) 82 | 83 | #define VEC3_NOT_ZERO(X) ((X).x!=0 || (X).y!=0 || (X).z!=0) 84 | 85 | #ifdef __cplusplus 86 | }; 87 | #endif 88 | 89 | #endif 90 | 91 | -------------------------------------------------------------------------------- /matlab/IOdata.plt: -------------------------------------------------------------------------------- 1 | # FRAME3DD ANALYSIS RESULTS http://frame3dd.sf.net/ 2 | # frame analysis via Matlab interface 3 | # Sun Jan 3 10:09:02 2010 4 | # M E S H A N N O T A T I O N F I L E 5 | set title "frame analysis via Matlab interface \nanalysis file: IOdata.FMM deflection exaggeration: 10.0 load case 1 of 1 " 6 | set autoscale 7 | set noborder 8 | set pointsize 1.0 9 | set xtics; set ytics; set ztics; 10 | set nozeroaxis 11 | set nokey 12 | set nolabel 13 | # NODE NUMBER LABELS 14 | set label ' 1' at 0.0000e+00, 0.0000e+00, 0.0000e+00 15 | set label ' 2' at 1.2000e+01, 0.0000e+00, 0.0000e+00 16 | set label ' 3' at 2.4000e+01, 0.0000e+00, 0.0000e+00 17 | set label ' 4' at 3.6000e+01, 0.0000e+00, 0.0000e+00 18 | set label ' 5' at 4.8000e+01, 0.0000e+00, 0.0000e+00 19 | set label ' 6' at 6.0000e+01, 0.0000e+00, 0.0000e+00 20 | set label ' 7' at 7.2000e+01, 0.0000e+00, 0.0000e+00 21 | set label ' 8' at 1.2000e+01, 1.2000e+01, 0.0000e+00 22 | set label ' 9' at 2.4000e+01, 1.2000e+01, 0.0000e+00 23 | set label ' 10' at 3.6000e+01, 1.2000e+01, 0.0000e+00 24 | set label ' 11' at 4.8000e+01, 1.2000e+01, 0.0000e+00 25 | set label ' 12' at 6.0000e+01, 1.2000e+01, 0.0000e+00 26 | # ELEMENT NUMBER LABELS 27 | set label ' 1' at 6.0000e+00, 0.0000e+00, 0.0000e+00 28 | set label ' 2' at 1.8000e+01, 0.0000e+00, 0.0000e+00 29 | set label ' 3' at 3.0000e+01, 0.0000e+00, 0.0000e+00 30 | set label ' 4' at 4.2000e+01, 0.0000e+00, 0.0000e+00 31 | set label ' 5' at 5.4000e+01, 0.0000e+00, 0.0000e+00 32 | set label ' 6' at 6.6000e+01, 0.0000e+00, 0.0000e+00 33 | set label ' 7' at 6.0000e+00, 6.0000e+00, 0.0000e+00 34 | set label ' 8' at 1.2000e+01, 6.0000e+00, 0.0000e+00 35 | set label ' 9' at 1.8000e+01, 6.0000e+00, 0.0000e+00 36 | set label ' 10' at 2.4000e+01, 6.0000e+00, 0.0000e+00 37 | set label ' 11' at 3.0000e+01, 6.0000e+00, 0.0000e+00 38 | set label ' 12' at 3.6000e+01, 6.0000e+00, 0.0000e+00 39 | set label ' 13' at 4.2000e+01, 6.0000e+00, 0.0000e+00 40 | set label ' 14' at 4.8000e+01, 6.0000e+00, 0.0000e+00 41 | set label ' 15' at 5.4000e+01, 6.0000e+00, 0.0000e+00 42 | set label ' 16' at 6.0000e+01, 6.0000e+00, 0.0000e+00 43 | set label ' 17' at 6.6000e+01, 6.0000e+00, 0.0000e+00 44 | set label ' 18' at 1.8000e+01, 1.2000e+01, 0.0000e+00 45 | set label ' 19' at 3.0000e+01, 1.2000e+01, 0.0000e+00 46 | set label ' 20' at 4.2000e+01, 1.2000e+01, 0.0000e+00 47 | set label ' 21' at 5.4000e+01, 1.2000e+01, 0.0000e+00 48 | plot '/tmp/frame3dd_temp_hpgavin/IOdata-msh' u 2:3 t 'undeformed mesh' w lp lw 1 lt 5 pt 6, '/tmp/frame3dd_temp_hpgavin/IOdata-mshf.001' u 1:2 t 'load case 1 of 1' w l lw 2 lt 3 49 | # set parametric 50 | # set view 60, 70, 1 51 | # set nokey 52 | # set xlabel 'x' 53 | # set ylabel 'y' 54 | # set zlabel 'z' 55 | # splot '/tmp/frame3dd_temp_hpgavin/IOdata-msh' u 2:3:4 t 'load case 1 of 1' w lp lw 1 lt 5 pt 6, '/tmp/frame3dd_temp_hpgavin/IOdata-mshf.001' u 1:2:3 t 'load case 1 of 1' w l lw 2 lt 3 56 | -------------------------------------------------------------------------------- /doc/img/IntForceSign.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5b 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 7 0 7 50 -1 -1 0.000 0 1 1 0 7024.876 3060.855 6975 3780 7740 2970 7020 2340 11 | 1 1 5.00 300.00 600.00 12 | 5 1 0 7 0 7 50 -1 -1 0.000 0 1 1 0 7024.876 5940.855 6975 6660 7740 5850 7020 5220 13 | 1 1 5.00 300.00 600.00 14 | 2 1 0 8 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 15 | 1 1 5.00 300.00 525.00 16 | 6840 2970 9135 2970 17 | 2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 7 18 | 1125 3825 1125 2250 6525 2250 6435 3060 6570 3645 6435 3825 19 | 1125 3825 20 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 21 | 0 0 1.00 60.00 120.00 22 | 1125 3015 1125 1170 23 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 24 | 0 0 1.00 60.00 120.00 25 | 1170 3015 6345 3015 26 | 2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 7 27 | 1125 6750 1125 5175 6525 5175 6435 5985 6570 6570 6435 6750 28 | 1125 6750 29 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 30 | 0 0 1.00 60.00 120.00 31 | 1125 6120 1125 4275 32 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 33 | 0 0 1.00 60.00 120.00 34 | 1170 5985 6300 5985 35 | 2 1 0 8 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 36 | 1 1 5.00 300.00 525.00 37 | 9225 2970 10395 2970 38 | 2 1 0 8 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 39 | 1 1 5.00 300.00 525.00 40 | 9225 5940 10395 5940 41 | 2 1 0 8 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 42 | 1 1 5.00 300.00 525.00 43 | 6660 3825 6660 1215 44 | 2 1 0 8 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 45 | 1 1 5.00 300.00 525.00 46 | 6840 5940 9135 5940 47 | 2 1 0 8 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 48 | 1 1 5.00 300.00 525.00 49 | 6660 6750 6660 4140 50 | 2 1 0 8 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 51 | 1 1 5.00 300.00 525.00 52 | 10440 5940 11025 5940 53 | 2 1 0 8 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 54 | 1 1 5.00 300.00 525.00 55 | 10440 2970 11025 2970 56 | 2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 57 | 0 0 2.00 120.00 240.00 58 | 6300 2970 6300 2565 59 | 2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 60 | 0 0 2.00 120.00 240.00 61 | 6300 5940 6300 5535 62 | 3 2 0 2 0 7 50 -1 -1 0.000 0 0 0 3 63 | 1170 3015 3915 2925 6255 2565 64 | 0.000 -1.000 0.000 65 | 3 2 0 2 0 7 50 -1 -1 0.000 0 0 0 3 66 | 1178 5994 3923 5904 6263 5544 67 | 0.000 -1.000 0.000 68 | 4 0 0 50 -1 3 24 0.0000 4 270 180 1305 1530 y\001 69 | 4 0 0 50 -1 3 24 0.0000 4 180 210 6120 3375 x\001 70 | 4 0 0 50 -1 3 24 0.0000 4 270 465 10035 3600 Tx\001 71 | 4 0 0 50 -1 3 24 0.0000 4 180 210 6075 6345 x\001 72 | 4 0 0 50 -1 3 24 0.0000 4 210 165 1305 4635 z\001 73 | 4 0 0 50 -1 3 24 0.0000 4 270 465 9990 6525 Tx\001 74 | 4 0 0 50 -1 3 24 0.0000 4 300 525 7560 2385 Mz\001 75 | 4 0 0 50 -1 3 24 0.0000 4 360 540 7650 5265 My\001 76 | 4 0 0 50 -1 18 24 0.0000 4 300 525 540 3150 N1\001 77 | 4 0 0 50 -1 18 24 0.0000 4 300 525 540 6075 N1\001 78 | 4 0 0 50 -1 3 24 0.0000 4 270 510 8460 6525 Nx\001 79 | 4 0 0 50 -1 3 24 0.0000 4 270 510 8460 3600 Nx\001 80 | 4 0 0 50 -1 3 24 0.0000 4 360 450 6930 1620 Vy\001 81 | 4 0 0 50 -1 3 24 0.0000 4 300 435 6930 4545 Vz\001 82 | 4 0 0 50 -1 3 24 0.0000 4 360 480 5535 2565 Dy\001 83 | 4 0 0 50 -1 3 24 0.0000 4 300 465 5535 5490 Dz\001 84 | -------------------------------------------------------------------------------- /matlab/exA.m: -------------------------------------------------------------------------------- 1 | % exA.m - matlab example for frame3dd Example A 2 | % linear static analysis of a 2D truss with support settlement 3 | % Matlab results are written to IOdata_m.m 4 | 5 | % x y z r node coordinates 6 | XYZ = [ 0.0 0.0 0.0 0.0 ; 7 | 12.0 0.0 0.0 0.0 ; 8 | 24.0 0.0 0.0 0.0 ; 9 | 36.0 0.0 0.0 0.0 ; 10 | 48.0 0.0 0.0 0.0 ; 11 | 60.0 0.0 0.0 0.0 ; 12 | 72.0 0.0 0.0 0.0 ; 13 | 12.0 12.0 0.0 0.0 ; 14 | 24.0 12.0 0.0 0.0 ; 15 | 36.0 12.0 0.0 0.0 ; 16 | 48.0 12.0 0.0 0.0 ; 17 | 60.0 12.0 0.0 0.0 ]'; 18 | 19 | [x,J] = size(XYZ); 20 | 21 | RCT = zeros(6,J); % reactions 22 | 23 | % J x y z xx yy zz 1= fixed, 0=free 24 | RCT(:, 1) = [ 1 1 1 1 1 0 ]'; 25 | RCT(:, 2) = [ 0 0 1 1 1 0 ]'; 26 | RCT(:, 3) = [ 0 0 1 1 1 0 ]'; 27 | RCT(:, 4) = [ 0 0 1 1 1 0 ]'; 28 | RCT(:, 5) = [ 0 0 1 1 1 0 ]'; 29 | RCT(:, 6) = [ 0 0 1 1 1 0 ]'; 30 | RCT(:, 7) = [ 0 1 1 1 1 0 ]'; 31 | RCT(:, 8) = [ 1 0 1 1 1 0 ]'; 32 | RCT(:, 9) = [ 0 0 1 1 1 0 ]'; 33 | RCT(:,10) = [ 0 0 1 1 1 0 ]'; 34 | RCT(:,11) = [ 0 0 1 1 1 0 ]'; 35 | RCT(:,12) = [ 0 0 1 1 1 0 ]'; 36 | 37 | ELTS = [ 1 2 3 4 5 6 1 2 2 3 4 4 4 5 6 6 7 8 9 10 11 ; 38 | 2 3 4 5 6 7 8 8 9 9 9 10 11 11 11 12 12 9 10 11 12 ]; 39 | 40 | [x,B] = size(ELTS); 41 | 42 | % Ax Asy Asz Jxx Iyy Izz E G p dens. 43 | 44 | EAIJ=[ 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001; 45 | 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001; 46 | 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001; 47 | 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001; 48 | 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001; 49 | 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001; 50 | 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001; 51 | 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001; 52 | 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001; 53 | 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001; 54 | 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001; 55 | 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001; 56 | 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001; 57 | 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001; 58 | 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001; 59 | 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001; 60 | 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001; 61 | 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001; 62 | 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001; 63 | 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001; 64 | 30.0 1.0 1.0 1.0 1.0 0.01 10000.0 500.0 0 0.001]'; 65 | 66 | P= zeros(6,J); % point forces 67 | 68 | % J Fx Fy Fz Mxx Myy Mzz 69 | P(:,2) = [ 0.0 -20.0 0.0 0.0 0.0 0.0 ]'; 70 | P(:,3) = [ 0.0 -40.0 0.0 0.0 0.0 0.0 ]'; 71 | P(:,4) = [ 0.0 -30.0 0.0 0.0 0.0 0.0 ]'; 72 | P(:,5) = [ 0.0 -10.0 0.0 0.0 0.0 0.0 ]'; 73 | P(:,6) = [ 0.0 -30.0 0.0 0.0 0.0 0.0 ]'; 74 | 75 | W = zeros(3,B); 76 | 77 | D = zeros(6,J); % prescribed displacements 78 | % J Dx Dy Dz Dxx Dyy Dzz 79 | D(:, 8) = [ 0.01 0.0 0.0 0.0 0.0 0.0 ]'; 80 | 81 | [D,R,F,L,Ks] = frame_3dd ( XYZ,ELTS,RCT,EAIJ,P,W,D ); % analyze it! 82 | 83 | -------------------------------------------------------------------------------- /test/truss.arc: -------------------------------------------------------------------------------- 1 | * Truss test 2 | * Model to check microstran parser in Frame3dd 3 | * 4 | * 5 | 6 | VERS 5 7 | TYPE 5 8 | VERT 2 9 | UNIT 1 m kN T C 10 | 11 | NODE 1 0.0000 0.0000 0.0000 111100 12 | NODE 2 0.0000 1.0000 0.0000 000000 13 | NODE 3 2.0000 0.0000 0.0000 000000 14 | NODE 4 2.0000 1.0000 0.0000 000000 15 | NODE 5 4.0000 0.0000 0.0000 000000 16 | NODE 6 4.0000 1.0000 0.0000 000000 17 | NODE 7 6.0000 0.0000 0.0000 000000 18 | NODE 8 6.0000 1.0000 0.0000 000000 19 | NODE 9 8.0000 0.0000 0.0000 000000 20 | NODE 10 8.0000 1.0000 0.0000 000000 21 | NODE 11 10.0000 0.0000 0.0000 011000 22 | NODE 12 10.0000 1.0000 0.0000 000000 23 | 24 | MEMB 101 1 3 Y 10 1 000000 000000 25 | MEMB 102 3 5 Y 10 1 000000 000000 26 | MEMB 103 5 7 Y 10 1 000000 000000 27 | MEMB 104 7 9 Y 10 1 000000 000000 28 | MEMB 105 9 11 Y 10 1 000000 000000 29 | MEMB 201 2 4 Y 20 1 000000 000000 30 | MEMB 202 4 6 Y 20 1 000000 000000 31 | MEMB 203 6 8 Y 20 1 000000 000000 32 | MEMB 204 8 10 Y 20 1 000000 000000 33 | MEMB 205 10 12 Y 20 1 000000 000000 34 | MEMB 301 1 2 -X 30 1 000000 000000 35 | MEMB 302 3 4 -X 31 1 000000 000000 36 | MEMB 303 5 6 -X 31 1 000000 000000 37 | MEMB 304 7 8 -X 31 1 000000 000000 38 | MEMB 305 9 10 -X 31 1 000000 000000 39 | MEMB 306 11 12 -X 30 1 000000 000000 40 | MEMB 401 2 3 Y 40 1 000000 000000 41 | MEMB 402 4 5 Y 40 1 000000 000000 42 | MEMB 403 6 7 Y 40 1 000000 000000 43 | MEMB 404 5 8 Y 40 1 000000 000000 44 | MEMB 405 7 10 Y 40 1 000000 000000 45 | MEMB 406 9 12 Y 40 1 000000 000000 46 | 47 | PROP 10 PRIS Nominal Bottom_chord 48 | 4.5000E-03 0.000 0.000 0.000 7.0000E-06 1.0000E-05 49 | PROP 20 PRIS Nominal Top_chord 50 | 4.5000E-03 0.000 0.000 0.000 7.0000E-06 1.0000E-05 51 | PROP 30 PRIS Nominal End_verticals 52 | 4.5000E-03 0.000 0.000 0.000 7.0000E-06 1.0000E-05 53 | PROP 31 PRIS Nominal Interior_verts. 54 | 2.0000E-03 0.000 0.000 0.000 2.2000E-06 2.2000E-06 55 | PROP 40 PRIS Nominal Diagonals 56 | 2.0000E-03 0.000 0.000 0.000 2.2000E-06 2.2000E-06 57 | 58 | MATL 1 2.000E+08 2.500E-01 7.850E+00 1.170E-05 59 | 60 | CASE 1 Simple loading 61 | NDLD 6 0.000 -1.000 0.000 0.000 0.000 0.000 62 | NDLD 8 0.500 -0.500 0.500 0.000 0.000 0.000 63 | 64 | END 65 | -------------------------------------------------------------------------------- /src/eig.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of FRAME3DD: 3 | Static and dynamic structural analysis of 2D and 3D frames and trusses with 4 | elastic and geometric stiffness. 5 | --------------------------------------------------------------------------- 6 | http://frame3dd.sourceforge.net/ 7 | --------------------------------------------------------------------------- 8 | Copyright (C) 1992-2009 Henri P. Gavin 9 | 10 | FRAME3DD is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | FRAME3DD is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with FRAME3DD. If not, see . 22 | *//** @file 23 | Routines to solve the generalized eigenvalue problem 24 | 25 | H.P. Gavin, Civil Engineering, Duke University, hpgavin@duke.edu 1 March 2007 26 | Bathe, Finite Element Procecures in Engineering Analysis, Prentice Hall, 1982 27 | */ 28 | #ifndef FRAME_EIG_H 29 | #define FRAME_EIG_H 30 | 31 | /** 32 | Find the lowest m eigenvalues, w, and eigenvectors, V, of the 33 | general eigenproblem, K V = w M V, using sub-space / Jacobi iteration. 34 | 35 | @param K is an n by n symmetric real (stiffness) matrix 36 | @param M is an n by n symmetric positive definate real (mass) matrix 37 | @param w is a diagonal matrix of eigen-values 38 | @param V is a rectangular matrix of eigen-vectors 39 | */ 40 | void subspace( 41 | double **K, double **M, /**< stiffness and mass matrices */ 42 | int n, int m, /**< DoF and number of required modes */ 43 | double *w, double **V, /**< modal frequencies and mode shapes */ 44 | double tol, /**< covergence tolerence */ 45 | double shift, /**< frequency shift for unrestrained frames */ 46 | int *iter, /**< number of sub-space iterations */ 47 | int *ok, /**< Sturm check result */ 48 | int verbose /**< 1: copious screen output, 0: none */ 49 | ); 50 | 51 | 52 | /** 53 | carry out matrix-matrix-matrix multiplication for symmetric A 54 | C = X' A X C is J by J X is N by J A is N by N 55 | */ 56 | void xtAx( double **A, double **X, double **C, int N, int J ); 57 | 58 | /** 59 | calculate the lowest m eigen-values and eigen-vectors of the 60 | generalized eigen-problem, K v = w M v, using a matrix 61 | iteration approach with shifting. 62 | 63 | @param n number of degrees of freedom 64 | @param m number of required modes 65 | */ 66 | void stodola( 67 | double **K, double **M, /**< stiffness and mass matrices */ 68 | int n, int m, /**< DoF and number of required modes */ 69 | double *w, double **V, /**< modal frequencies and mode shapes */ 70 | double tol, /**< covergence tolerence */ 71 | double shift, /**< frequency shift for unrestrained frames */ 72 | int *iter, /**< number of sub-space iterations */ 73 | int *ok, /**< Sturm check result */ 74 | int verbose /**< 1: copious screen output, 0: none */ 75 | ); 76 | 77 | #endif /* FRAME_EIG_H */ 78 | 79 | -------------------------------------------------------------------------------- /doc/img/Tsections.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 1 3 0 1 0 7 50 -1 41 0.000 1 0.0000 1800 4500 900 900 1800 4500 2700 4500 11 | 1 3 0 1 0 7 40 -1 20 0.000 1 0.0000 1833 4500 687 687 1833 4500 2520 4500 12 | 2 1 0 1 0 7 30 -1 -1 0.000 0 0 -1 1 0 2 13 | 0 0 1.00 60.00 120.00 14 | 1845 4500 2700 4320 15 | 2 1 0 1 0 7 30 -1 -1 0.000 0 0 -1 1 0 2 16 | 0 0 1.00 60.00 120.00 17 | 1877 4465 2417 4060 18 | 2 2 0 1 0 7 40 -1 20 0.000 0 0 -1 0 0 5 19 | 4050 3825 5400 3825 5400 5175 4050 5175 4050 3825 20 | 2 2 0 1 0 7 50 -1 41 0.000 0 0 -1 0 0 5 21 | 3825 3600 5625 3600 5625 5400 3825 5400 3825 3600 22 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2 23 | 0 0 1.00 60.00 120.00 24 | 0 0 1.00 60.00 120.00 25 | 3600 5400 3600 3600 26 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2 27 | 0 0 1.00 60.00 120.00 28 | 0 0 1.00 60.00 120.00 29 | 3825 5625 5625 5625 30 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2 31 | 0 0 1.00 60.00 120.00 32 | 0 0 1.00 60.00 120.00 33 | 6750 5625 10125 5625 34 | 2 2 0 1 0 7 40 -1 20 0.000 0 0 -1 0 0 5 35 | 6975 3825 9900 3825 9900 5175 6975 5175 6975 3825 36 | 2 2 0 1 0 7 50 -1 41 0.000 0 0 -1 0 0 5 37 | 6750 3600 10125 3600 10125 5400 6750 5400 6750 3600 38 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2 39 | 0 0 1.00 60.00 120.00 40 | 0 0 1.00 60.00 120.00 41 | 6525 5400 6525 3600 42 | 2 1 0 1 0 7 20 -1 -1 0.000 0 0 -1 1 0 2 43 | 0 0 1.00 60.00 120.00 44 | 10260 4500 11475 4500 45 | 2 1 0 1 0 7 20 -1 -1 0.000 0 0 -1 1 0 2 46 | 0 0 1.00 60.00 120.00 47 | 10575 4950 10125 4950 48 | 2 1 0 1 0 7 20 -1 -1 0.000 0 0 -1 1 0 2 49 | 0 0 1.00 60.00 120.00 50 | 9450 4950 9900 4950 51 | 2 1 0 1 0 7 20 -1 -1 0.000 0 0 -1 1 0 2 52 | 0 0 1.00 60.00 120.00 53 | 7200 3150 7200 3600 54 | 2 1 0 1 0 7 20 -1 -1 0.000 0 0 -1 1 0 2 55 | 0 0 1.00 60.00 120.00 56 | 7200 4275 7200 3825 57 | 2 1 0 1 0 7 20 -1 -1 0.000 0 0 -1 1 0 2 58 | 0 0 1.00 60.00 120.00 59 | 6075 4950 5625 4950 60 | 2 1 0 1 0 7 20 -1 -1 0.000 0 0 -1 1 0 2 61 | 0 0 1.00 60.00 120.00 62 | 4995 4950 5445 4950 63 | 2 1 0 1 0 7 20 -1 -1 0.000 0 0 -1 1 0 2 64 | 0 0 1.00 60.00 120.00 65 | 4275 4275 4275 3825 66 | 2 1 0 1 0 7 20 -1 -1 0.000 0 0 -1 1 0 2 67 | 0 0 1.00 60.00 120.00 68 | 4275 3150 4275 3600 69 | 2 1 0 1 0 7 20 -1 -1 0.000 0 0 -1 1 0 2 70 | 0 0 1.00 60.00 120.00 71 | 8415 3465 8415 2700 72 | 4 0 0 30 -1 19 12 0.0000 4 150 135 1845 4230 R\001 73 | 4 0 0 30 -1 19 12 0.0000 4 150 60 1980 4320 i\001 74 | 4 0 0 30 -1 19 12 0.0000 4 150 135 2070 4680 R\001 75 | 4 0 0 30 -1 19 12 0.0000 4 105 120 2205 4770 o\001 76 | 4 0 0 50 -1 19 12 0.0000 4 150 120 3375 4500 b\001 77 | 4 0 0 50 -1 19 12 0.0000 4 150 120 4635 5850 b\001 78 | 4 0 0 50 -1 19 12 0.0000 4 135 60 10395 5130 t\001 79 | 4 0 0 50 -1 19 12 0.0000 4 135 60 5895 5130 t\001 80 | 4 0 0 50 -1 19 12 0.0000 4 135 60 4140 3330 t\001 81 | 4 0 0 50 -1 19 16 0.0000 4 210 135 11160 4770 y\001 82 | 4 0 0 50 -1 19 16 0.0000 4 150 135 8505 3105 z\001 83 | 4 0 0 50 -1 19 16 0.0000 4 270 2370 7290 6300 Rectangular Tube \001 84 | 4 0 0 50 -1 19 12 0.0000 4 135 60 7020 3375 t\001 85 | 4 0 0 50 -1 19 16 0.0000 4 270 1635 3870 6300 Square Tube\001 86 | 4 0 0 50 -1 19 16 0.0000 4 210 1755 900 6345 Circular Tube\001 87 | 4 0 0 50 -1 19 12 0.0000 4 150 120 6300 4500 b\001 88 | 4 0 0 50 -1 19 12 0.0000 4 105 105 8370 5850 a\001 89 | -------------------------------------------------------------------------------- /doc/img/sign_convention.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5b 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 1 3 0 5 0 7 40 -1 20 0.000 1 0.0000 10856 1234 302 302 10856 1234 11126 1099 11 | 1 3 0 5 0 7 40 -1 20 0.000 1 0.0000 1663 4705 302 302 1663 4705 1933 4570 12 | 2 1 0 5 0 7 50 -1 -1 12.000 0 0 -1 0 0 2 13 | 1755 4680 10620 1305 14 | 2 1 0 3 0 7 50 -1 -1 8.000 0 0 -1 1 0 2 15 | 0 0 3.00 180.00 360.00 16 | 1497 4799 389 5250 17 | 2 1 0 3 0 7 50 -1 -1 8.000 0 0 -1 1 0 2 18 | 0 0 3.00 180.00 360.00 19 | 1845 4725 2880 4725 20 | 2 1 0 3 0 7 50 -1 -1 8.000 0 0 -1 1 0 2 21 | 0 0 3.00 180.00 360.00 22 | 2970 4725 3510 4725 23 | 2 1 0 3 0 7 50 -1 -1 8.000 0 0 -1 1 0 2 24 | 0 0 3.00 180.00 360.00 25 | 3330 4725 3870 4725 26 | 2 1 0 3 0 7 50 -1 -1 8.000 0 0 -1 1 0 2 27 | 0 0 3.00 180.00 360.00 28 | 1665 4500 1665 3600 29 | 2 1 0 3 0 7 50 -1 -1 8.000 0 0 -1 1 0 2 30 | 0 0 3.00 180.00 360.00 31 | 1665 3555 1665 3015 32 | 2 1 0 3 0 7 50 -1 -1 8.000 0 0 -1 1 0 2 33 | 0 0 3.00 180.00 360.00 34 | 1665 3240 1665 2700 35 | 2 1 0 3 0 7 50 -1 -1 8.000 0 0 -1 1 0 2 36 | 0 0 3.00 180.00 360.00 37 | 10712 1129 9604 1580 38 | 2 1 0 3 0 7 50 -1 -1 8.000 0 0 -1 1 0 2 39 | 0 0 3.00 180.00 360.00 40 | 11070 1215 12105 1215 41 | 2 1 0 3 0 7 50 -1 -1 8.000 0 0 -1 1 0 2 42 | 0 0 3.00 180.00 360.00 43 | 12195 1215 12735 1215 44 | 2 1 0 3 0 7 50 -1 -1 8.000 0 0 -1 1 0 2 45 | 0 0 3.00 180.00 360.00 46 | 12510 1215 13050 1215 47 | 2 1 0 3 0 7 50 -1 -1 8.000 0 0 -1 1 0 2 48 | 0 0 3.00 180.00 360.00 49 | 10890 1035 10890 135 50 | 2 1 0 3 0 7 50 -1 -1 8.000 0 0 -1 1 0 2 51 | 0 0 3.00 180.00 360.00 52 | -163 5514 -578 5693 53 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2 54 | 0 0 1.00 60.00 120.00 55 | -584 5706 -1491 6106 56 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2 57 | 0 0 1.00 60.00 120.00 58 | 13140 1215 14355 1215 59 | 2 1 0 3 0 7 50 -1 -1 8.000 0 0 -1 1 0 2 60 | 0 0 3.00 180.00 360.00 61 | 10890 90 10890 -450 62 | 2 1 0 3 0 7 50 -1 -1 8.000 0 0 -1 1 0 2 63 | 0 0 3.00 180.00 360.00 64 | 10890 -225 10890 -765 65 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2 66 | 0 0 1.00 60.00 120.00 67 | 10890 -810 10890 -1845 68 | 2 1 0 3 0 7 50 -1 -1 8.000 0 0 -1 1 0 2 69 | 0 0 3.00 180.00 360.00 70 | 8984 1806 8569 1985 71 | 2 1 0 3 0 7 50 -1 -1 8.000 0 0 -1 1 0 2 72 | 0 0 3.00 180.00 360.00 73 | 9571 1561 8943 1815 74 | 2 1 0 3 0 7 50 -1 -1 8.000 0 0 -1 1 0 2 75 | 0 0 3.00 180.00 360.00 76 | 363 5271 -268 5562 77 | 4 0 0 50 -1 18 20 0.0000 4 240 420 450 4860 Nx\001 78 | 4 0 0 50 -1 18 20 0.0000 4 315 405 2295 5175 Vy\001 79 | 4 0 0 50 -1 18 20 0.0000 4 315 450 3285 5175 My\001 80 | 4 0 0 50 -1 18 20 0.0000 4 240 390 1845 3960 Vz\001 81 | 4 0 0 50 -1 1 20 0.0000 4 165 135 11025 -1620 z\001 82 | 4 0 0 50 -1 1 20 0.0000 4 210 150 14175 1620 y\001 83 | 4 0 0 50 -1 18 20 0.0000 4 315 450 12510 1665 My\001 84 | 4 0 0 50 -1 18 20 0.0000 4 315 405 11520 1665 Vy\001 85 | 4 0 0 50 -1 18 20 0.0000 4 240 420 9720 1170 Nx\001 86 | 4 0 0 50 -1 18 20 0.0000 4 240 390 8775 1530 Tx\001 87 | 4 0 0 50 -1 18 20 0.0000 4 240 390 -540 5310 Tx\001 88 | 4 0 0 50 -1 1 20 0.0000 4 150 150 -1395 5850 x\001 89 | 4 0 0 50 -1 18 20 0.0000 4 240 390 11115 540 Vz\001 90 | 4 0 0 50 -1 18 20 0.0000 4 240 435 11115 -225 Mz\001 91 | 4 0 0 50 -1 18 20 0.0000 4 240 435 1935 3105 Mz\001 92 | 4 0 0 30 -1 18 20 0.0000 4 240 420 1485 4860 N2\001 93 | 4 0 0 30 -1 18 20 0.0000 4 240 420 10710 1350 N1\001 94 | -------------------------------------------------------------------------------- /TODO.txt: -------------------------------------------------------------------------------- 1 | TODO LIST for FRAME3DD 2 | ---------------------- 3 | 4 | * Gnuplot data output for internal forces and moments (??) 5 | 6 | * Create structs to contain frame attributes, coordinates, etc, in order to migrate to a more object-oriented coding style, and simplify the passing of parameters to functions. 7 | 8 | * GPL gui using wxWidgets and OpenGL (??) http://www.wxwidgets.org/ 9 | 10 | * Dynamic time-history analysis with the HHT-alpha method 11 | 12 | * Compute reactions forces along with joint displacements in solve_system function. 13 | 14 | * Consistent mass matrix including the effects of shear deformation on rotatory inertia 15 | 16 | * Improve rigid joint offset method 17 | 18 | * Member end joint releases 19 | Implment end_release function in frame3dd.c into the code to 20 | carry out member end release. 21 | 22 | * Implement import of Microstran .arc format. We can already parse these files 23 | (including many constructs that aren't supported by FRAME3DD) 24 | but we can not yet actually calculate using the parsed data. 25 | 26 | * Fix rendering of members with offsets specified in local coordinates 27 | (ie MOFF LO statements). 28 | 29 | * Spectral modal superposition 30 | 31 | * Linearly tapered frame elements 32 | 33 | * Convert 'save_matrix' to output files in Matrix Market format for easier 34 | import into other programs. 35 | http://math.nist.gov/MatrixMarket/ 36 | 37 | * Consider making use of third-party matrix routines, rather to providing them ourselves. Good options would be UMFPACK (for sparse matrices) or LAPACK (dense). There would be assumed to be some efficiency improvements as a result of this 38 | also, particularly if sparse matrix methods can be used. 39 | 40 | 41 | 42 | COMPLETED ITEMS 43 | ------------------ 44 | 45 | * Add ansi.sys color to terminal output (Dec 1 2010) 46 | 47 | * Add frame element internal force and transverse displacement calculations (Jan 5 2010) 48 | 49 | * Add gravity load option via gravitational acceleration vector (Dec 3 2009) 50 | 51 | * Specify element density along with elastic modulus and shear modulus in the 52 | Frame Element Data section of the Input Data file (Dec 3 2009) 53 | 54 | * Add nX variables for number of beams with eXtra mass, 55 | ... redefine the entry of extra beam mass in a way that is similar 56 | to extra joint inertia. (Dec 3 2009) 57 | 58 | * Separate exaggeration factors for static and dynamic meshes (Dec 2 2009) 59 | 60 | * Check return values of fscanf functions and report errors to user 61 | for input data debugging purposes. (Oct 26 2009) 62 | 63 | * Implement command line parsing using the getopt function (Mar 4 2009) 64 | ... for reasons of ease-of-portability 65 | 66 | * Implement command line parsing using the argtable2 package (Mar 3 2009) 67 | 68 | * Implement trapezoidally-distributed loads existing over only partial member lengths (Feb 26 2009) 69 | 70 | * Separate Input data and Output data files (Feb 9 2009) 71 | 72 | * Migrate website to sf.net (Jan 2009) 73 | 74 | * Add support for .CSV input and output. (Jan 1 2009) 75 | 76 | * Change types values that are read from input files from double to float 77 | (Dec 31 2008) 78 | 79 | * Added support for separate prescribed displacements for each load case individually. (Dec 30 2008) 80 | 81 | * Added comments to describe variables in src/*.h files. (Dec 30 2008) 82 | 83 | ---------------------------------------------------------------------------- 84 | -------------------------------------------------------------------------------- /README-win32.txt: -------------------------------------------------------------------------------- 1 | 2 | FRAME3DD - README FOR WINDOWS USERS AND DEVELOPERS 3 | -------------------------------------------------- 4 | 5 | This README file accompanies the binary packaged version of FRAME3DD for 6 | the Windows platform. 7 | 8 | See 'README.txt' for general information. 9 | 10 | 11 | NOTES FOR WINDOWS USERS 12 | ----------------------- 13 | 14 | The user manual (doc/user-manual.html) includes instructions for installing 15 | and running Frame3DD under Windows. Following these instructions will 16 | install Frame3DD to your Desktop. 17 | 18 | FRAME3DD is a *command line* program. It processes an input text file 19 | and adds output data at the end of that file. 20 | 21 | It is best to run FRAME3DD from within a Command Prompt (or Console) window. 22 | 23 | 24 | 25 | NOTES REGARDING ANSI.SYS and COLORS 26 | ----------------------------------- 27 | 28 | Frame3DD displays text in color using ANSI.SYS escape sequences. 29 | Current versions (Windows 7, VISTA, etc) of the Microsoft 30 | "Command Prompt" do not render ANSI.SYS escape sequences correctly ... 31 | "Console windows in Windows versions based on NT (Windows NT 4.0, Windows 2000, 32 | Windows XP, Windows Server 2003, Windows Vista and Windows Server 2008) 33 | do not support ANSI Escape sequences at all." 34 | http://en.wikipedia.org/wiki/ANSI_escape_code#Windows_and_DOS 35 | 36 | Instead of showing text in color, the Microsoft "Command Prompt" program 37 | displays strange text sequences. 38 | 39 | If these text sequences become annoying to look at, you have two options. 40 | 41 | 42 | ANSI.SYS option #1: 43 | 44 | Download an ANSI capable console for Windows ... ANSICON ... from 45 | ... http://adoxa.110mb.com/ansicon/ ... 46 | Extract the .ZIP file and copy the folder "x86" into the Desktop\Frame3DD\ 47 | Make a shortcut from Desktop/Frame3DD/x86/ansicon to the Desktop. 48 | Run ANSICON instead of the Microsoft "Command Prompt" 49 | 50 | 51 | ANSI.SYS option #2: 52 | 53 | Recompile Frame3DD without the ANSI.SYS escape sequences by changing 54 | line 28 of hpgUtils.h to ... 55 | 56 | #define ANSI_SYS 0 57 | 58 | ... before compiling. 59 | 60 | 61 | 62 | 63 | NOTES ON THE MICROSTRAN .ARC VIEWER PROGRAM 64 | ------------------------------------------- 65 | 66 | The Windows installer includes a viewer for Microstran .ARC files. For this 67 | viewer to run correctly, you must do a bit of work. 68 | 69 | 1. Install QT 4.3.3. 70 | 2. Install Coin3D 2.5.0 71 | 3. Install SoQT 1.3 72 | 73 | The above installers are accessible via the following web page: 74 | http://ascendwiki.cheme.cmu.edu/Binary_installers_for_Coin3d_and_SoQt_on_MinGW 75 | 76 | 4. Get the mingwm10.dll DLL file from the following archive, and copy it into 77 | your c:\Program Files\FRAME3DD folder. 78 | 79 | http://sourceforge.net/project/downloading.php?group_id=2435&filename=mingwrt-3.15.2-mingw32-dll.tar.gz 80 | 81 | 5. Set your PATH to contain the DLL folders for the packages in steps 1 82 | to 3. Depending on where you installed everything, this could be: 83 | 84 | c:\QT\4.3.3\bin;c:\Program Files\Coin3D-2.5.0\bin;c:\Program Files\SoQt-1.4.1 85 | 86 | After performing these steps, you should be able to double-click on an ARC 87 | file and it should display in a viewer window. 88 | 89 | -- 90 | John Pye 91 | http://pye.dyndns.org/ (<-- contact details here) 92 | Jun 2009. 93 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | FRAME3DD: a frame analysis program 2 | ------------------------------- 3 | 4 | FRAME3DD is a program for the static and dynamic structural analysis of 5 | two- and three-dimensional frames and trusses with elastic and 6 | geometric stiffness. 7 | 8 | FRAME3DD reads an Input Data file, containing joint coordinates, member 9 | geometry, material moduli, restrained joints, prescribed displacements, 10 | load information, and optionally, mass information if a modal analysis 11 | is to be carried out. 12 | 13 | FRAME3DD appends results to an Output Data File, The Output Data 14 | recapitulates the input information, gives joint displacements in global 15 | coordinates, member end-forces in local coordinates, reactions in 16 | global coordinates, and natural frequencies and mode shapes in global 17 | coordinates. 18 | 19 | For usage information, see the User Manual, included with both the source 20 | code and binary installer packages. 21 | 22 | Additional output files from FRAME3DD are directed by default to the temporary 23 | file folder (according to the %TEMP% env var on Windows, or /tmp on other 24 | platforms). You can specify an alternative location for output files by setting 25 | the environment variable FRAME3DD_OUTDIR. 26 | 27 | Note that you require write permissions for the input file in order that 28 | FRAME3DD can append its calculation results to that file. 29 | 30 | --- 31 | 32 | FRAME3DD is free software; you may redistribute it and/or modify it under 33 | the terms of the GNU General Public License (GPL) as published by the 34 | Free Software Foundation. FRAME3DD is distributed in the hope that it will 35 | be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 36 | of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 37 | General Public License (GPL) for details. 38 | 39 | --- 40 | 41 | You should have obtained this distribution from SourceForge.net 42 | 43 | svn co https://frame3dd.svn.sourceforge.net/svnroot/frame3dd frame3dd 44 | 45 | --- 46 | 47 | Included in this distribution: 48 | 49 | LICENSE.txt ... GNU GPL license 50 | README.txt ... this file 51 | 52 | SConstruct ... optionally used for compiling and building distribution 53 | using scons ... http://www.scons.org/ 54 | frame3dd.spec... build specification for scons, includes changelog 55 | save.plt ... Gnuplot macro for saving Gnuplot plots as PostScript 56 | 57 | doc/ ... documentation (in HTML format) 58 | examples/ ... examples of FRAME input/output files 59 | scons/ ... used by scons to build distribution 60 | src/ ... C source code 61 | 62 | to compile and build without scons ... 63 | 64 | gcc -O -Wall -o frame3dd main.c frame3dd.c frame3dd_io.c ldl_dcmp.c lu_dcmp.c coordtrans.c eig.c hpgUtils.c nrutil.c -lm 65 | 66 | --- 67 | 68 | FRAME3DD author 69 | 70 | (c) 1992-2008 Henri Gavin - Associate Professor 71 | Department of Civil and Environmental Engineering 72 | Edmund T. Pratt School of Engineering 73 | Duke University - Box 90287, Durham, NC 27708-0287 74 | 75 | mailto:Henri.Gavin@Duke.edu - tel: 919-660-5201 - fax: 919-660-5219 76 | 77 | --- 78 | 79 | Packaging of FRAME3DD for distribution on Linux and Windows, 80 | as well as implementation of the Microstran file parsers 81 | is by John Pye, 2007-2013. 82 | 83 | John Pye 84 | Department of Engineering 85 | Australian National University 86 | mailto:john.pye@anu.edu.au 87 | http://jpye.dyndns.org/ 88 | 89 | --- 90 | 91 | -------------------------------------------------------------------------------- /src/microstran/array.c: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | #define MSTRANP_BUILD 18 | #include "array.h" 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | static void *array_grow(array *a,unsigned index); 25 | 26 | array array_create(size_t eachsize, unsigned cap){ 27 | array a; 28 | a.eachsize = eachsize; 29 | a.num = 0; 30 | a.cap = cap; 31 | a.data = malloc(eachsize * cap); 32 | //fprintf(stderr,"Create array with capacity %d for objects of size %d\n",cap, eachsize); 33 | return a; 34 | } 35 | 36 | void array_destroy(array *a){ 37 | if(a->data)free(a->data); 38 | a->data = NULL; 39 | a->num = 0; 40 | a->cap = 0; 41 | } 42 | 43 | void *array_set(array *a, unsigned index, void *val){ 44 | void *pos; 45 | 46 | //fprintf(stderr,"Adding to array at position %d\n",index); 47 | 48 | if(index >= a->cap){ 49 | if(!array_grow(a, index)){ 50 | return NULL; 51 | } 52 | } 53 | if(index >= a->num){ 54 | //fprintf(stderr,"Incremented num from %d to %d\n",a->num,index+1); 55 | a->num = index + 1; 56 | } 57 | 58 | //fprintf(stderr,"a.num = %d, a.data = %p\n",a->num, a->data); 59 | //fprintf(stderr,"a.eachsize = %d\n",a->eachsize); 60 | 61 | pos = a->data + (a->eachsize * index); 62 | 63 | //fprintf(stderr,"pos = %p\n",pos); 64 | 65 | if(!memcpy(pos, val, a->eachsize)){ 66 | return NULL; 67 | } 68 | 69 | return pos; 70 | } 71 | 72 | void *array_get(array *a, unsigned index){ 73 | if(index >= a->num){ 74 | return NULL; 75 | } 76 | return a->data + (a->eachsize * index); 77 | } 78 | 79 | void *array_grow(array *a,unsigned index){ 80 | unsigned newcap; 81 | void *newdata; 82 | 83 | if(index < a->cap){ 84 | return a->data; 85 | } 86 | if(index < a->cap * 2){ 87 | newcap = a->cap * 2; 88 | }else{ 89 | newcap = index + 1; 90 | } 91 | 92 | newdata = malloc(a->eachsize * newcap); 93 | if(!newdata){ 94 | return NULL; 95 | } 96 | if(!memcpy(newdata,a->data,a->eachsize * a->num)){ 97 | return NULL; 98 | } 99 | free(a->data); 100 | a->data = newdata; 101 | return a->data; 102 | } 103 | 104 | void *array_append(array *a,void *val){ 105 | return array_set(a, a->num, val); 106 | } 107 | 108 | array array_copy(const array oa){ 109 | array a; 110 | a = array_create(oa.eachsize, oa.num); 111 | //fprintf(stderr,"eachsize = %d in array_copy\n",oa.eachsize); 112 | a.data = malloc(a.eachsize * oa.num); 113 | if(!a.data){ 114 | fprintf(stderr,"unable to allocate memory in array_copy\n"); 115 | return a; 116 | } 117 | if(!memcpy(a.data,oa.data,oa.eachsize*oa.num)){ 118 | fprintf(stderr,"unable to memcpy in array_copy\n"); 119 | return a; 120 | } 121 | a.num = oa.num; 122 | return a; 123 | } 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /src/microstran/forces.c: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | #define MSTRANP_BUILD 18 | 19 | #include "forces.h" 20 | #include "new.h" 21 | #include "array.h" 22 | #include "error.h" 23 | 24 | #include 25 | #include 26 | 27 | modelforces *modelforces_create(){ 28 | modelforces *mf; 29 | mf = NEW(modelforces); 30 | if(!mf)abort(); 31 | strcpy(mf->filename,""); 32 | mf->cases = ARRAY_CREATE(caseforces,10); 33 | return mf; 34 | } 35 | 36 | void modelforces_destroy(modelforces *mf){ 37 | unsigned i; 38 | for(i=0;icases);++i){ 39 | caseforces_destroy(array_get(&(mf->cases),i)); 40 | } 41 | array_destroy(&(mf->cases)); 42 | free(mf); 43 | } 44 | 45 | caseforces *caseforces_create(unsigned id, const char *name){ 46 | caseforces *cf; 47 | cf = NEW(caseforces); 48 | if(!cf)abort(); 49 | cf->members = ARRAY_CREATE(memberforce,10); 50 | cf->id = id; 51 | strncpy(cf->name,name,MAXCASENAME); 52 | cf->name[MAXCASENAME-1]='\0'; 53 | return cf; 54 | } 55 | 56 | void caseforces_destroy(caseforces *cf){ 57 | array_destroy(&(cf->members)); 58 | free(cf); 59 | } 60 | 61 | membernodeforce membernodeforce_create(unsigned nodeid, vec3 F, vec3 M){ 62 | membernodeforce mnf; 63 | mnf.node = nodeid; 64 | mnf.F = F; 65 | mnf.M = M; 66 | return mnf; 67 | } 68 | 69 | cbool caseforces_add_member(caseforces *cf, unsigned memberid, membernodeforce fromnode, membernodeforce tonode){ 70 | memberforce mf; 71 | //fprintf(stderr,"ADDING MEMBER %d to case %d\n",memberid,cf->id); 72 | mf.member = memberid; 73 | mf.fromnode = fromnode; 74 | mf.tonode = tonode; 75 | array_append(&(cf->members),&mf); 76 | return 1; 77 | } 78 | 79 | cbool modelforces_add_case(modelforces *mf, caseforces *cf){ 80 | //fprintf(stderr,"Model forces: contains %d cases\n",ARRAY_NUM(mf->cases)); 81 | array_append(&(mf->cases),cf); 82 | return 1; 83 | } 84 | 85 | /* QUERY FUNCTIONS */ 86 | 87 | caseforces *modelforces_find_case(modelforces *mf, unsigned caseid){ 88 | unsigned i; 89 | //fprintf(stderr,"Model displacement contains %d cases\n",ARRAY_NUM(md->cases)); 90 | caseforces *cf; 91 | for(i=0; icases); ++i){ 92 | cf = array_get(&(mf->cases), i); 93 | if(cf->id == caseid){ 94 | return cf; 95 | } 96 | } 97 | return NULL; 98 | } 99 | 100 | memberforce *caseforces_find_member(caseforces *cf, const unsigned memberid){ 101 | unsigned i; 102 | memberforce *mf; 103 | for(i=0; imembers); ++i){ 104 | mf = array_get(&(cf->members), i); 105 | if(mf->member == memberid){ 106 | return mf; 107 | } 108 | } 109 | return NULL; 110 | } 111 | 112 | caseforces *modelforces_get_case(modelforces *mf, unsigned index){ 113 | return array_get(&(mf->cases), index); 114 | } 115 | 116 | -------------------------------------------------------------------------------- /scons/substinfile.py: -------------------------------------------------------------------------------- 1 | import re 2 | from SCons.Script import * # the usual scons stuff you get in a SConscript 3 | 4 | def generate(env): 5 | """ 6 | Add builders and construction variables for the 7 | SubstInFile tool. 8 | 9 | Adds SubstInFile builder, which substitutes the keys->values of SUBST_DICT 10 | from the source to the target. 11 | The values of SUBST_DICT first have any construction variables expanded 12 | (its keys are not expanded). 13 | If a value of SUBST_DICT is a python callable function, it is called and 14 | the result is expanded as the value. 15 | If there's more than one source and more than one target, each target gets 16 | substituted from the corresponding source. 17 | """ 18 | def do_subst_in_file(targetfile, sourcefile, dict): 19 | """Replace all instances of the keys of dict with their values. 20 | For example, if dict is {'%VERSION%': '1.2345', '%BASE%': 'MyProg'}, 21 | then all instances of %VERSION% in the file will be replaced with 1.2345 etc. 22 | """ 23 | try: 24 | f = open(sourcefile, 'rb') 25 | contents = f.read() 26 | f.close() 27 | except: 28 | raise SCons.Errors.UserError, "Can't read source file %s"%sourcefile 29 | for (k,v) in dict.items(): 30 | contents = re.sub(k, v, contents) 31 | try: 32 | f = open(targetfile, 'wb') 33 | f.write(contents) 34 | f.close() 35 | except: 36 | raise SCons.Errors.UserError, "Can't write target file %s"%targetfile 37 | return 0 # success 38 | 39 | def subst_in_file(target, source, env): 40 | if not env.has_key('SUBST_DICT'): 41 | raise SCons.Errors.UserError, "SubstInFile requires SUBST_DICT to be set." 42 | d = dict(env['SUBST_DICT']) # copy it 43 | for (k,v) in d.items(): 44 | if callable(v): 45 | d[k] = env.subst(v()).replace('\\','\\\\') 46 | elif SCons.Util.is_String(v): 47 | d[k] = env.subst(v).replace('\\','\\\\') 48 | else: 49 | raise SCons.Errors.UserError, "SubstInFile: key %s: %s must be a string or callable"%(k, repr(v)) 50 | for (t,s) in zip(target, source): 51 | return do_subst_in_file(str(t), str(s), d) 52 | 53 | def subst_in_file_string(target, source, env): 54 | """This is what gets printed on the console.""" 55 | return '\n'.join(['Substituting vars from %s into %s'%(str(s), str(t)) 56 | for (t,s) in zip(target, source)]) 57 | 58 | def subst_emitter(target, source, env): 59 | """Add dependency from substituted SUBST_DICT to target. 60 | Returns original target, source tuple unchanged. 61 | """ 62 | d = env['SUBST_DICT'].copy() # copy it 63 | for (k,v) in d.items(): 64 | if callable(v): 65 | d[k] = env.subst(v()) 66 | elif SCons.Util.is_String(v): 67 | d[k]=env.subst(v) 68 | Depends(target, SCons.Node.Python.Value(d)) 69 | return target, source 70 | 71 | ## env.Append(TOOLS = 'substinfile') # this should be automaticaly done by Scons ?!? 72 | subst_action = SCons.Action.Action( subst_in_file, subst_in_file_string ) 73 | env['BUILDERS']['SubstInFile'] = Builder(action=subst_action, emitter=subst_emitter) 74 | 75 | def exists(env): 76 | """ 77 | Make sure tool exists. 78 | """ 79 | return True 80 | -------------------------------------------------------------------------------- /src/microstran/displacements.c: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | #define MSTRANP_BUILD 18 | 19 | #include "displacements.h" 20 | #include "new.h" 21 | #include "array.h" 22 | #include "error.h" 23 | 24 | #include 25 | #include 26 | 27 | modeldisplacements *modeldisplacements_create(){ 28 | modeldisplacements *md; 29 | md = NEW(modeldisplacements); 30 | strcpy(md->filename,""); 31 | md->cases = ARRAY_CREATE(casedisplacements,10); 32 | return md; 33 | } 34 | 35 | void modeldisplacements_destroy(modeldisplacements *d){ 36 | /* FIXME destroy contained data too */ 37 | unsigned i; 38 | for(i=0;icases);++i){ 39 | casedisplacements_destroy(array_get(&(d->cases),i)); 40 | } 41 | array_destroy(&(d->cases)); 42 | free(d); 43 | d = NULL; 44 | } 45 | 46 | cbool modeldisplacements_add_case(modeldisplacements *md, casedisplacements *cd){ 47 | //fprintf(stderr,"Model displacements: contains %d cases\n",ARRAY_NUM(md->cases)); 48 | array_append(&(md->cases),cd); 49 | return 1; 50 | } 51 | 52 | casedisplacements *modeldisplacements_get_case(modeldisplacements *md, unsigned index){ 53 | return array_get(&(md->cases), index); 54 | } 55 | 56 | void casedisplacements_destroy(casedisplacements *cd){ 57 | array_destroy(&(cd->nodes)); 58 | free(cd); 59 | cd = NULL; 60 | } 61 | 62 | casedisplacements *casedisplacements_create(unsigned id, const char *name){ 63 | casedisplacements *cd; 64 | cd = NEW(casedisplacements); 65 | if(!cd)abort(); 66 | cd->nodes = ARRAY_CREATE(nodedisplacement,10); 67 | cd->id = id; 68 | strncpy(cd->name,name,MAXCASENAME); 69 | cd->name[MAXCASENAME-1]='\0'; 70 | return cd; 71 | } 72 | 73 | cbool casedisplacements_add_node( 74 | casedisplacements *cd, unsigned nodeid 75 | , double dx, double dy, double dz, double rx, double ry, double rz 76 | ){ 77 | nodedisplacement nd; 78 | //fprintf(stderr,"ADDING NODE %d to case %d",nodeid,cd->id); 79 | nd.node = nodeid; 80 | nd.dx = dx; 81 | nd.dy = dy; 82 | nd.dz = dz; 83 | nd.rx = rx; 84 | nd.ry = ry; 85 | nd.rz = rz; 86 | array_append(&(cd->nodes),&nd); 87 | return 1; 88 | } 89 | 90 | casedisplacements *modeldisplacements_find_case(modeldisplacements *md, unsigned caseid){ 91 | unsigned i; 92 | //fprintf(stderr,"Model displacement contains %d cases\n",ARRAY_NUM(md->cases)); 93 | casedisplacements *cd; 94 | for(i=0; icases); ++i){ 95 | cd = array_get(&(md->cases), i); 96 | if(cd->id == caseid){ 97 | return cd; 98 | } 99 | } 100 | return NULL; 101 | } 102 | 103 | nodedisplacement *casedisplacements_find_node(casedisplacements *cd, const unsigned nodeid){ 104 | unsigned i; 105 | nodedisplacement *nd; 106 | for(i=0; inodes); ++i){ 107 | nd = array_get(&(cd->nodes), i); 108 | if(nd->node == nodeid){ 109 | return nd; 110 | } 111 | } 112 | return NULL; 113 | } 114 | 115 | 116 | -------------------------------------------------------------------------------- /src/microstran/vec3.c: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | #define MSTRANP_BUILD 18 | #include "vec3.h" 19 | 20 | #include 21 | #include 22 | 23 | const vec3 VEC3_ZERO = {0,0,0}; 24 | 25 | vec3 vec3_create(double x, double y, double z){ 26 | vec3 A; 27 | A.x = x; A.y = y; A.z = z; 28 | return A; 29 | } 30 | 31 | vec3 vec3_add(vec3 A, vec3 B){ 32 | return vec3_create( 33 | A.x+B.x, A.y + B.y, A.z + B.z 34 | ); 35 | } 36 | 37 | double vec3_dot(vec3 a, vec3 b){ 38 | return a.x*b.x + a.y*b.y + a.z*b.z; 39 | } 40 | 41 | vec3 vec3_cross(vec3 a, vec3 b){ 42 | return vec3_create( 43 | a.y*b.z-a.z*b.y 44 | ,a.z*b.x-a.x*b.z 45 | ,a.x*b.y-a.y*b.x 46 | ); 47 | } 48 | 49 | vec3 vec3_scale(vec3 A, double s){ 50 | return vec3_create(A.x * s, A.y * s, A.z * s); 51 | } 52 | 53 | double vec3_mod(vec3 A){ 54 | return sqrt(A.x*A.x + A.y*A.y + A.z*A.z); 55 | } 56 | 57 | vec3 vec3_norm(vec3 A){ 58 | return vec3_scale(A, 1./vec3_mod(A)); 59 | } 60 | 61 | vec3 vec3_diff(vec3 A, vec3 B){ 62 | return vec3_create(A.x - B.x, A.y - B.y, A.z - B.z); 63 | } 64 | 65 | vec3 vec3_negate(vec3 A){ 66 | vec3 B; 67 | B.x = -A.x; 68 | B.y = -A.y; 69 | B.z = -A.z; 70 | return B; 71 | } 72 | 73 | int vec3_print(FILE *f, vec3 A){ 74 | return fprintf(f,"%.10f %.10f %.10f",A.x,A.y,A.z); 75 | } 76 | 77 | vec3 vec3_rotate(vec3 A, vec3 axis, double theta){ 78 | #if 0 79 | assert(!isnan(theta)); 80 | assert(!vec3_isnan(&axis)); 81 | assert(!vec3_isnan(&A)); 82 | #endif 83 | 84 | /* source: http://www.mines.edu/~gmurray/ArbitraryAxisRotation/ArbitraryAxisRotation.html */ 85 | double Aa = vec3_dot(A,axis); 86 | double ma = vec3_mod(axis); 87 | 88 | double u = axis.x, v = axis.y, w = axis.z; 89 | double ct = cos(theta); 90 | double st = sin(theta); 91 | vec3 R; 92 | #define SQ(X) ((X)*(X)) 93 | R.x = u*Aa + ( A.x*(SQ(v)+SQ(w)) - u*(v*A.y+w*A.z) )*ct + ma * (-w*A.y+v*A.z) * st; 94 | R.y = v*Aa + ( A.y*(SQ(u)+SQ(w)) - v*(u*A.x+w*A.z) )*ct + ma * (w*A.x-u*A.z) * st; 95 | R.z = w*Aa + ( A.z*(SQ(u)+SQ(v)) - w*(u*A.x+v*A.y) )*ct + ma * (-v*A.x+u*A.y) * st; 96 | 97 | #if 0 98 | if(isnan(R.x) || isnan(R.y) || isnan(R.z)){ 99 | VEC3_PR(R); 100 | } 101 | assert(!isnan(R.x)); 102 | assert(!isnan(R.y)); 103 | assert(!isnan(R.z)); 104 | #endif 105 | 106 | /* fprintf(stderr,"x = %f, y = %f, z = %f\n",R.x, R.y, R.z); */ 107 | return vec3_scale(R, 1./SQ(ma)); 108 | #undef SQ 109 | } 110 | 111 | double vec3_angle(vec3 A, vec3 B){ 112 | assert(A.x!=B.x || A.y!=B.y || A.z!=B.z); 113 | vec3 C = vec3_cross(A,B); 114 | return atan2(vec3_mod(C),vec3_dot(A,B)); 115 | } 116 | 117 | MSTRANP_API double vec3_angle_cross(vec3 A, vec3 B, vec3 *C){ 118 | assert(VEC3_NOT_EQUAL(A,B)); 119 | VEC3_CHECK_NAN(A); 120 | VEC3_CHECK_NAN(B); 121 | assert(C!=NULL); 122 | C->x = A.y*B.z-A.z*B.y; 123 | C->y = A.z*B.x-A.x*B.z; 124 | C->z = A.x*B.y-A.y*B.x; 125 | if(vec3_isnan(C)){ 126 | VEC3_PR(A); 127 | VEC3_PR(B); 128 | //fprintf(stderr,"dot(A,B) = %f\n",vec3_dot(A,B)); 129 | VEC3_CHECK_NAN(*C); 130 | } 131 | return atan2(vec3_mod(*C),vec3_dot(A,B)); 132 | } 133 | 134 | char vec3_equal_tol(vec3 A, vec3 B, double tol){ 135 | return vec3_mod(vec3_diff(B,A))x) || isnan(A->y) || isnan(A->z); 144 | } 145 | 146 | 147 | -------------------------------------------------------------------------------- /test/testvec3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "test.h" 3 | 4 | #include 5 | 6 | #define PI 3.14159265358 7 | 8 | class TestVec3 : public CppUnit::TestFixture{ 9 | 10 | public: 11 | 12 | void test1(){ 13 | vec3 v; 14 | v = vec3_create(1,2,3); 15 | CPPUNIT_ASSERT(v.x==1); 16 | CPPUNIT_ASSERT(v.y==2); 17 | CPPUNIT_ASSERT(v.z==3); 18 | } 19 | 20 | void testadd(){ 21 | vec3 v1 = vec3_create(1.,2.,3.); 22 | vec3 v2 = vec3_create(4.,5.,6.); 23 | CPPUNIT_ASSERT(vec3_equal(vec3_add(v1,v2), vec3_create(5,7,9))); 24 | } 25 | 26 | void testdiff(){ 27 | vec3 v1 = vec3_create(5.,-1.,6.); 28 | vec3 v2 = vec3_create(2.,4.,-8.); 29 | CPPUNIT_ASSERT(vec3_equal(vec3_diff(v1,v2),vec3_create(3.,-5.,14.))); 30 | } 31 | 32 | void testdistance1(){ 33 | vec3 v1 = vec3_create(1,1,0); 34 | vec3 v2 = vec3_create(0,0,0); 35 | CPPUNIT_ASSERT_EQUAL(vec3_mod(vec3_diff(v1,v2)),sqrt(2)); 36 | } 37 | 38 | void testdistance2(){ 39 | vec3 v1 = vec3_create(1,-1,0); 40 | vec3 v2 = vec3_create(0,0,0); 41 | CPPUNIT_ASSERT_EQUAL(vec3_mod(vec3_diff(v1,v2)),sqrt(2)); 42 | } 43 | 44 | void testdistance3(){ 45 | vec3 v1 = vec3_create(3,3,3); 46 | vec3 v2 = vec3_create(0,0,0); 47 | CPPUNIT_ASSERT_EQUAL(vec3_mod(vec3_diff(v1,v2)),sqrt(27)); 48 | } 49 | 50 | void testdot(){ 51 | vec3 v1 = vec3_create(1,2,3); 52 | vec3 v2 = vec3_create(4,5,6); 53 | double d = vec3_dot(v1,v2); 54 | CPPUNIT_ASSERT(vec3_equal(v1,vec3_create(1,2,3))); 55 | CPPUNIT_ASSERT(vec3_equal(v2,vec3_create(4,5,6))); 56 | CPPUNIT_ASSERT(d==4+10+18); 57 | } 58 | 59 | void testcross(){ 60 | vec3 x = vec3_create(1,0,0); 61 | vec3 y = vec3_create(0,1,0); 62 | CPPUNIT_ASSERT(vec3_equal(vec3_cross(x,y),vec3_create(0,0,1))); 63 | 64 | vec3 z = vec3_create(0,0,1); 65 | CPPUNIT_ASSERT(vec3_equal(vec3_cross(x,z),vec3_scale(y,-1))); 66 | 67 | /// @TODO more tests here 68 | } 69 | 70 | void testangle(){ 71 | vec3 x = vec3_create(1,0,0); 72 | vec3 y = vec3_create(0,1,0); 73 | CPPUNIT_ASSERT(fabs( vec3_angle(x,y) - PI/2. ) < 1e-8 ); 74 | 75 | CPPUNIT_ASSERT(fabs( vec3_angle(vec3_add(x,y),y) - PI/4. ) < 1e-8); 76 | } 77 | 78 | /** 79 | A few tests of the behaviour of cross product/angle functions with 80 | large/reflex angles 81 | */ 82 | void testcrossangle(){ 83 | // y 84 | // \._ x 85 | // 86 | vec3 x = vec3_create(1,0,0); 87 | vec3 y = vec3_create(-1,1,0); 88 | CPPUNIT_ASSERT(fabs(vec3_angle(x,y) - 3./4*PI) < 1e-8 ); 89 | vec3 c = vec3_cross(x,y); 90 | CPPUNIT_ASSERT(fabs( c.z - 1 ) < 1e-8 ); 91 | 92 | // 93 | // ._ x 94 | // y2 / 95 | 96 | vec3 y2 = vec3_create(-1,-1,0); 97 | CPPUNIT_ASSERT(fabs(vec3_angle(x,y2) - 3./4*PI) < 1e-8 ); 98 | vec3 c2 = vec3_cross(x,y2); 99 | CPPUNIT_ASSERT(fabs( c2.z + 1 ) < 1e-8 ); 100 | 101 | // 102 | // ._ x 103 | // y2 / 104 | 105 | vec3 c3 = vec3_cross(y2,x); 106 | CPPUNIT_ASSERT(fabs(vec3_angle(y2,x) - 3./4*PI) < 1e-8 ); // commutative 107 | CPPUNIT_ASSERT(fabs( c3.z - 1 ) < 1e-8 ); 108 | 109 | } 110 | 111 | #if 0 112 | /// @TODO need more tests for the 'rotate' routine! 113 | void testrotate(){ 114 | vec3 x = vec3_create(1,0,0); 115 | vec3 y = vec3_create(0,1,0); 116 | VEC3_PR(y); 117 | y = vec3_rotate(y,x,PI/2); 118 | VEC3_PR(y); 119 | CPPUNIT_ASSERT(vec3_equal_tol(y,vec3_create(0.,0.,1.),1e-11)); 120 | 121 | vec3 r = vec3_create(1,1,1); 122 | vec3 z = vec3_create(0,0,1); 123 | z = vec3_rotate(z,r,120.*PI/180); 124 | CPPUNIT_ASSERT(vec3_equal(z,vec3_create(1,0,0))); 125 | } 126 | #endif 127 | 128 | #if 0 129 | void testpolar(){ 130 | Vector x(1,0,0); 131 | Vector r = Vector::polar(1,45*DEG,90*DEG); 132 | x.rotate(Vector(0,0,1),45); 133 | CPPUNIT_ASSERT(r==x); 134 | } 135 | #endif 136 | 137 | CPPUNIT_TEST_SUITE(TestVec3); 138 | CPPUNIT_TEST(test1); 139 | CPPUNIT_TEST(testadd); 140 | CPPUNIT_TEST(testdiff); 141 | CPPUNIT_TEST(testdistance1); 142 | CPPUNIT_TEST(testdistance2); 143 | CPPUNIT_TEST(testdistance3); 144 | CPPUNIT_TEST(testdot); 145 | CPPUNIT_TEST(testcross); 146 | CPPUNIT_TEST(testangle); 147 | CPPUNIT_TEST(testcrossangle); 148 | CPPUNIT_TEST_SUITE_END(); 149 | 150 | }; 151 | 152 | CPPUNIT_TEST_SUITE_REGISTRATION(TestVec3); 153 | 154 | -------------------------------------------------------------------------------- /src/HPGutil.h: -------------------------------------------------------------------------------- 1 | /* hpgUtils.h --- library of general-purpose utility functions */ 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #define MAXL 512 9 | 10 | #define ANSI_SYS 1 /* compile for ANSI_SYS driver; 0: don't */ 11 | // ... requires ANSI.SYS and the line DEVICE = C:\ANSI.SYS in C:\CONFIG.SYS 12 | 13 | 14 | /* --------------------------------------------------------------------------- 15 | COLOR - change color on the screen ... 16 | Screen Color Scheme : 0 = white on black, 1 = bright 17 | first digit= 3 for text color first digit= 4 for background color 18 | second digit codes: 1=red, 2=green, 3=gold, 4=blue, 5=purple, 6=lght blue 19 | ---------------------------------------------------------------------------- */ 20 | void color ( const int colorCode ); /* change the screen color */ 21 | 22 | 23 | /* --------------------------------------------------------------------------- 24 | TEXTCOLOR - change color of text and background 25 | tColor : text color : one of 'k' 'r' 'g' 'y' 'b' 'm' 'c' 'w' 26 | bColor : back color : one of 'k' 'r' 'g' 'y' 'b' 'm' 'c' 'w' 27 | nbf : 'n' = normal, 'b' = bright/bold, 'f' = faint 28 | uline : 'u' = underline 29 | http://en.wikipedia.org/wiki/ANSI_escape_code 30 | --------------------------------------------------------------------------- */ 31 | void textColor ( const char tColor, const char bColor, const char nbf, const char uline ); 32 | 33 | 34 | /* --------------------------------------------------------------------------- 35 | ERRORMSG - write a diagnostic error message in color 36 | ---------------------------------------------------------------------------- */ 37 | void errorMsg ( const char *errString ); 38 | 39 | 40 | /* ------------------------------------------------------------------------- 41 | OPENFILE - open a file or print a diagnostic error message 42 | ---------------------------------------------------------------------------- */ 43 | FILE *openFile (const char *path, const char *fileName, const char *mode, char *usage ); 44 | 45 | 46 | /* --------------------------------------------------------------------------- 47 | SCANLINE - scan through a line until a 'a' is reached, like getline() 3feb94 48 | ---------------------------------------------------------------------------- */ 49 | int scanLine ( FILE *fp, int lim, char *s, const char a ); 50 | 51 | 52 | /* --------------------------------------------------------------------------- 53 | SCANLABEL - scan through a line until a '"' is reached, like getline() 54 | ---------------------------------------------------------------------------- */ 55 | int scanLabel ( FILE *fp, int lim, char *s, const char a ); 56 | 57 | int scanFile ( FILE *fp, int head_lines, int start_chnl, int stop_chnl ); 58 | 59 | 60 | /* --------------------------------------------------------------------------- 61 | * GETLINE - get line form a stream into a character string, return length 62 | * from K&R 3feb94 63 | * --------------------------------------------------------------------------- 64 | */ 65 | int getLine ( FILE *fp, int lim, char *s ); 66 | 67 | 68 | /* --------------------------------------------------------------------------- 69 | * getTime parse a numeric time string of YYYYMMDDhhmmss 70 | * The input variables y, m, d, hr, mn, sc are the indices of the string s[] 71 | * which start the YYYY, MM, DD, hh, mm, ss sections of the time string. 72 | * An offset (os) in seconds is added to allow for correction between 73 | * time zones, UTC and GPS times. 74 | * The corresponding time is returned in "time_t" format. 75 | * --------------------------------------------------------------------------- 76 | */ 77 | time_t getTime( char s[], int y, int m, int d, int hr, int mn, int sc, int os ); 78 | 79 | 80 | /* --------------------------------------------------------------------------- 81 | SHOW_PROGRESS - show the progress of long computations 82 | --------------------------------------------------------------------------- */ 83 | void showProgress ( int i, int n, int count ); 84 | 85 | 86 | /* --------------------------------------------------------------------------- 87 | * SFERR - Display error message upon an erronous *scanf operation 88 | * ------------------------------------------------------------------------- */ 89 | void sferr ( char s[] ); 90 | -------------------------------------------------------------------------------- /src/microstran/main.c: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | #include 18 | #include "modelparser.h" 19 | #include "displacementparser.h" 20 | #include 21 | #include 22 | 23 | int main(int argc, char **argv){ 24 | #if 0 25 | fprintf(stderr,"STARTING PARSE...\n"); 26 | parse *p; 27 | model *a; /* will be allocated by the parser */ 28 | p = parseCreateFile(stdin); 29 | if(parseMicrostranArchive(p,&a)){ 30 | fprintf(stderr,"\nParsed OK\n%d nodes, %d members, %d section properties, %d materials read.\n" 31 | ,a->num_nodes,a->num_membs,a->num_props,a->num_matls 32 | ); 33 | }else{ 34 | fprintf(stderr,"\n\nPARSE FAILED\n"); 35 | } 36 | return 0; 37 | #else 38 | parse *p; 39 | 40 | FILE *modelfile; 41 | const char *defaultmodelfname = "model.arc"; 42 | 43 | FILE *displacementfile; 44 | const char *defaultdisplacementfname = "model.p1"; 45 | 46 | unsigned caseid; 47 | const unsigned defaultcaseid = 1; 48 | 49 | const char *modelfname; 50 | const char *displacementfname; 51 | 52 | if(argc>1){ 53 | modelfname = argv[1]; 54 | fprintf(stderr,"Model file '%s'\n",modelfname); 55 | }else{ 56 | modelfname = defaultmodelfname; 57 | fprintf(stderr,"Using default model filename '%s'.\n",modelfname); 58 | } 59 | 60 | modelfile = fopen(modelfname,"r"); 61 | 62 | if(!modelfile){ 63 | fprintf(stderr,"\nFailed to read model file '%s'\n",modelfname); 64 | return 1; 65 | }else{ 66 | fprintf(stderr,"Opened model file '%s'...\n",modelfname); 67 | } 68 | 69 | if(argc>2){ 70 | displacementfname = argv[2]; 71 | fprintf(stderr,"Displacement file '%s'\n",displacementfname); 72 | }else{ 73 | displacementfname = defaultdisplacementfname; 74 | fprintf(stderr,"Using default displacement filename '%s'.\n",displacementfname); 75 | } 76 | 77 | displacementfile = fopen(displacementfname,"r"); 78 | if(!displacementfile){ 79 | fprintf(stderr,"\nFAILED TO OPEN DISPLACEMENT FILE '%s'\n",displacementfname); 80 | return 1; 81 | }else{ 82 | fprintf(stderr,"Opened displacement file '%s'...\n",displacementfname); 83 | } 84 | 85 | fprintf(stderr,"Loading model...\n"); 86 | p = parseCreateFile(modelfile); 87 | if(!p){ 88 | fprintf(stderr,"\nERROR: Failed to load model file '%s'\n", modelfile); 89 | return 1; 90 | } 91 | model *m; 92 | if(parseModelMicrostran(p,&m)){ 93 | fprintf(stderr,"\nParsed OK\n%d nodes, %d members, %d section properties, %d materials read.\n" 94 | ,m->num_nodes,m->num_membs,m->num_props,m->num_matls 95 | ); 96 | }else{ 97 | fprintf(stderr,"\n\nPARSE FAILED\n"); 98 | return 1; 99 | } 100 | parseDispose(p); 101 | 102 | fprintf(stderr,"Loading displacements...\n"); 103 | parse *p1; 104 | p1 = parseCreateFile(displacementfile); 105 | modeldisplacements *md; 106 | if(parseMicrostranDisplacements(p1,&md)){ 107 | fprintf(stderr,"Parse OK\n"); 108 | }else{ 109 | fprintf(stderr,"\n\nPARSE FAILED\n"); 110 | } 111 | 112 | if(argc>3){ 113 | caseid = atoi(argv[3]); 114 | fprintf(stderr,"Applying displacements for load case %d...\n",caseid); 115 | }else{ 116 | caseid = defaultcaseid; 117 | fprintf(stderr,"Applying default load case %d.\n",caseid); 118 | } 119 | 120 | casedisplacements *cd; 121 | cd = modeldisplacements_find_case(md, caseid); 122 | if(!cd){ 123 | fprintf(stderr,"\n\nFAILED TO FIND CASE %d\n",caseid); 124 | return 1; 125 | } 126 | 127 | if(!model_apply_displacements(m,cd)){ 128 | fprintf(stderr,"\n\nFAILED TO APPLY DISPLACEMENTS\n"); 129 | } 130 | return 0; 131 | #endif 132 | } 133 | -------------------------------------------------------------------------------- /scons/disttar.py: -------------------------------------------------------------------------------- 1 | # DistTarBuilder: tool to generate tar files using SCons 2 | # Copyright (C) 2005, 2006 Matthew A. Nicholson 3 | # 4 | # This file is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License version 2.1 as published by the Free Software Foundation. 7 | # 8 | # This file is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | # Lesser General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU Lesser General Public 14 | # License along with this library; if not, write to the Free Software 15 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | # 17 | # vim: set et sw=3 tw=0 fo=awqorc ft=python: 18 | 19 | import os,sys 20 | from SCons.Script import * 21 | 22 | def disttar_emitter(target,source,env): 23 | 24 | source,origsource = [], source 25 | 26 | excludeexts = env.Dictionary().get('DISTTAR_EXCLUDEEXTS',[]) 27 | excludedirs = env.Dictionary().get('DISTTAR_EXCLUDEDIRS',[]) 28 | 29 | # assume the sources are directories... need to check that 30 | for item in origsource: 31 | for root, dirs, files in os.walk(str(item)): 32 | 33 | # don't make directory dependences as that triggers full build 34 | # of that directory 35 | if root in source: 36 | #print "Removing directory %s" % root 37 | source.remove(root) 38 | 39 | # loop through files in a directory 40 | for name in files: 41 | ext = os.path.splitext(name) 42 | if not ext[1] in excludeexts: 43 | relpath = os.path.join(root,name) 44 | #print "Adding source",relpath 45 | source.append(relpath) 46 | for d in excludedirs: 47 | if d in dirs: 48 | dirs.remove(d) # don't visit CVS directories etc 49 | 50 | return target, source 51 | 52 | def disttar_string(target, source, env): 53 | """This is what gets printed on the console. We'll strip out the list 54 | or source files, since it tends to get very long. If you want to see the 55 | contents, the easiest way is to uncomment the line 'Adding to TAR file' 56 | below. """ 57 | return 'DistTar(%s,...)' % str(target[0]) 58 | 59 | def disttar(target, source, env): 60 | """tar archive builder""" 61 | 62 | import tarfile 63 | 64 | env_dict = env.Dictionary() 65 | 66 | if env_dict.get("DISTTAR_FORMAT") in ["gz", "bz2"]: 67 | tar_format = env_dict["DISTTAR_FORMAT"] 68 | else: 69 | tar_format = "" 70 | 71 | # split the target directory, filename, and stuffix 72 | base_name = str(target[0]).split('.tar')[0] 73 | (target_dir, dir_name) = os.path.split(base_name) 74 | 75 | # create the target directory if it does not exist 76 | if target_dir and not os.path.exists(target_dir): 77 | os.makedirs(target_dir) 78 | 79 | # open our tar file for writing 80 | sys.stderr.write("DistTar: Writing "+str(target[0])) 81 | tar = tarfile.open(str(target[0]), "w:%s" % (tar_format,)) 82 | 83 | # write sources to our tar file 84 | for item in source: 85 | item = str(item) 86 | sys.stderr.write(".") 87 | #print "Adding to TAR file: %s/%s" % (dir_name,item) 88 | tar.add(item,'%s/%s' % (dir_name,item)) 89 | 90 | # all done 91 | sys.stderr.write("\n") #print "Closing TAR file" 92 | tar.close() 93 | 94 | def disttar_suffix(env, sources): 95 | """tar archive suffix generator""" 96 | 97 | env_dict = env.Dictionary() 98 | if env_dict.has_key("DISTTAR_FORMAT") and env_dict["DISTTAR_FORMAT"] in ["gz", "bz2"]: 99 | return ".tar." + env_dict["DISTTAR_FORMAT"] 100 | else: 101 | return ".tar" 102 | 103 | def generate(env): 104 | """ 105 | Add builders and construction variables for the DistTar builder. 106 | """ 107 | 108 | disttar_action=SCons.Action.Action(disttar, disttar_string) 109 | env['BUILDERS']['DistTar'] = Builder( 110 | action=disttar_action 111 | , emitter=disttar_emitter 112 | , suffix = disttar_suffix 113 | , target_factory = env.fs.Entry 114 | ) 115 | 116 | env.AppendUnique( 117 | DISTTAR_FORMAT = 'gz' 118 | ) 119 | 120 | def exists(env): 121 | """ 122 | Make sure this tool exists. 123 | """ 124 | try: 125 | import os 126 | import tarfile 127 | except ImportError: 128 | return False 129 | else: 130 | return True 131 | -------------------------------------------------------------------------------- /src/microstran/ctrans.h: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | *//** @file 17 | Coordinate transformations. 18 | */ 19 | #ifndef MSTRANP_CTRANS_H 20 | #define MSTRANP_CTRANS_H 21 | 22 | #ifdef __cplusplus 23 | extern "C"{ 24 | #endif 25 | 26 | #include "config.h" 27 | #include "vec3.h" 28 | 29 | 30 | /** 31 | Coordinate transformation matrix. We can use this for translation, 32 | scaling, and rotation, or any combination of these. The transformation 33 | is stored as a 4x4 matrix. 34 | 35 | This is a fairly naive implementation, so FIXME. Perhaps we can use a 3x4 36 | matrix instead, and perhaps we can make use of quaternions also. 37 | 38 | http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation 39 | http://www.win.tue.nl/~gino/solid/solid2.html 40 | */ 41 | typedef struct ctrans_matrix_struct{ 42 | double m[4][4]; 43 | } ctrans_matrix; 44 | 45 | MSTRANP_API ctrans_matrix ctrans_identity(void); 46 | 47 | ctrans_matrix ctrans_scale(ctrans_matrix c, double s); 48 | 49 | MSTRANP_API ctrans_matrix ctrans_rotation_z(double theta); 50 | 51 | /** 52 | Apply one transformation after another, creating a new composite. 53 | */ 54 | MSTRANP_API ctrans_matrix ctrans_mult(ctrans_matrix A, ctrans_matrix B); 55 | 56 | ctrans_matrix ctrans_translation(vec3 A); 57 | 58 | /** 59 | Create transformation matrix for general axis/angle rotation. 60 | This transformation will cause points to which this transform is applied 61 | to be rotatied around the origin by the specified amount. 62 | 63 | Note that this different in interpretation from ctrans_rotation_axes, 64 | which gives the transform required to convert local coordinates back to 65 | global coordinates, which is in some way a sort of inverse of this 66 | function. 67 | */ 68 | MSTRANP_API ctrans_matrix ctrans_rotation(vec3 axis, double theta); 69 | 70 | /** 71 | Create rotation transform given the direction of the transformed Z 72 | and X axes. 73 | 74 | @return transformation that if applied to a vector in local coordinates 75 | relative to vectors X, Y, Z (Y = Z × X) will yeild the vector's value in 76 | global coordinates (x,y,z). 77 | */ 78 | MSTRANP_API ctrans_matrix ctrans_rotation_axes(vec3 Z, vec3 X); 79 | 80 | /** 81 | Calculate the transform inverse (this is just a 4×4 matrix inverse) 82 | */ 83 | MSTRANP_API ctrans_matrix ctrans_inverse(ctrans_matrix c); 84 | 85 | /** 86 | Calculate the determinant of the transform matrix. 87 | */ 88 | double ctrans_det(ctrans_matrix c); 89 | 90 | /** 91 | Apply the coordinate transform in a 4x4 transformation matrix 92 | to an input vector p to return a transformed vector q 93 | @return the transformed vector. 94 | 95 | Transform: {q} = [T]{p}. 96 | | q0 | | t00 t01 t02 t03 | | p0 | (x coordinate) 97 | | q1 | = | t10 t11 t12 t13 | * | p1 | (y) 98 | | q2 | | t20 t21 t22 t23 | | p2 | (z) 99 | | 1. | | 0.0 0.0 0.0 1.0 | | 1. | 100 | 101 | (Constants in row 4 are assumed; i.e., no perspective transformation.) 102 | */ 103 | MSTRANP_API vec3 ctrans_apply(ctrans_matrix c, const vec3 p); 104 | 105 | MSTRANP_API int ctrans_print(FILE *f, const ctrans_matrix *c); 106 | 107 | MSTRANP_API char ctrans_equal_tol(const ctrans_matrix *c, const ctrans_matrix *d, double tol); 108 | 109 | char ctrans_isnan(const ctrans_matrix *c); 110 | 111 | #define CTRANS_CHECK_NAN(C) (ctrans_isnan(C) ? (ctrans_print(stderr,C), assert(!ctrans_isnan(C))) : 0) 112 | 113 | #define CTRANS_PR(C) (fprintf(stderr,"%s =",#C), ctrans_print(stderr,&C)) 114 | 115 | #ifdef __cplusplus 116 | }; 117 | #endif 118 | 119 | #endif 120 | 121 | -------------------------------------------------------------------------------- /src/microstran/case.h: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | *//** @file 17 | Load cases data structures, and associated methods. 18 | */ 19 | #ifndef MSTRANP_CASE_H 20 | #define MSTRANP_CASE_H 21 | 22 | #include "config.h" 23 | #include "types.h" 24 | #include "array.h" 25 | #include "vec3.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C"{ 29 | #endif 30 | 31 | /* Load case statements */ 32 | 33 | #define MAXNDLDS 10000 34 | 35 | /** 36 | Node load (NDLD) statement. 37 | */ 38 | typedef struct ndld_stmt_{ 39 | unsigned node; 40 | vec3 F; 41 | vec3 M; 42 | } ndld_stmt; 43 | 44 | struct case_stmt_; 45 | 46 | /** 47 | Load sub-case specified (for use in COMB statements) 48 | */ 49 | typedef struct comb_stmt_{ 50 | unsigned caseindex; /**< this is the index for the referenced load case 51 | in the model->cases array. We can't use a pointer directly because 52 | the array grows dynamically and is relocated when this happens, thus 53 | invalidating pointers. */ 54 | double factor; 55 | } comb_stmt; 56 | 57 | #define MAXCASENAME 200 58 | 59 | typedef enum case_type_{ 60 | CASE_UNDEFINED, CASE_LOADS, CASE_COMB 61 | } case_type; 62 | 63 | /** 64 | Structure to store load case, whether it be a 'combination' load case, 65 | or a 'basic' load case comprised of node loads. 66 | 67 | @TODO FIXME we currently only support NDLD node loads, no support yet 68 | exists for member loads (MBLD statements in the .arc file). 69 | */ 70 | typedef struct case_stmt_{ 71 | unsigned id; 72 | char name[MAXCASENAME]; 73 | case_type type; 74 | unsigned num_sub; 75 | vec3 g; /**< gravity magnitude/direction, if applicable from GRAV stmt */ 76 | array data;/**< array of ndld_stmt or comb_stmt (depending on case type) */ 77 | } case_stmt; 78 | 79 | /** 80 | Find a node-load in a load case, by node ID 81 | */ 82 | ndld_stmt *case_find_node(case_stmt *c, unsigned nodeid); 83 | 84 | /** 85 | Create a new load case, with the specified name 86 | */ 87 | case_stmt *case_create(unsigned caseid, const char *name); 88 | 89 | /** 90 | Duplicate load case data 91 | */ 92 | case_stmt *case_copy(const case_stmt *c); 93 | 94 | /** 95 | Specify the body force (normally gravity) on the structure's mass 96 | */ 97 | cbool case_add_gravity(case_stmt *c, vec3 g); 98 | 99 | /** 100 | Add a node load to a load case 101 | @param nodeid loaded node ID 102 | @param F applied force on the node 103 | @param M applied moment on the node 104 | */ 105 | cbool case_add_node_load(case_stmt *c, unsigned nodeid, vec3 F, vec3 M); 106 | 107 | struct model_; 108 | 109 | /** 110 | Add a sub-case to a 'combined' load case. This is used to implement the 111 | 'COMB' statement from the .arc file format. This allows superposition 112 | of different load cases for more complex loading scenarios. 113 | */ 114 | cbool case_add_comb(struct model_ *a, case_stmt *c, unsigned subcaseid, double factor); 115 | 116 | /** 117 | Get the total load on a node for a particular node. If there is 118 | no applied load on the node, return false. Otherwise, insert the total 119 | applied node load (force, moment) into the ndld_stmt data structure 120 | pointed to by 'nl'. 121 | 122 | @param nodeid node ID of the node we're looking at. 123 | @param nl (returned) applied force and moment on the node, set to zero 124 | if no applied load is found. 125 | @return 1 if node is loaded, 0 otherwise. 126 | */ 127 | MSTRANP_API cbool case_total_load_node(struct model_ *a, case_stmt *c, unsigned nodeid, ndld_stmt *nl); 128 | 129 | #ifdef __cplusplus 130 | }; 131 | #endif 132 | 133 | #endif /* MSTRANP_CASE_H */ 134 | 135 | -------------------------------------------------------------------------------- /src/microstran/CharactersInDouble.c: -------------------------------------------------------------------------------- 1 | // CharactersInDouble 2 | // This code is not protected by copyright and is in the public domain. 3 | // Author: Meritt Reynolds 4 | 5 | #include "CharactersInDouble.h" 6 | #include 7 | #include 8 | 9 | // CharactersInDouble 10 | // 11 | // Parse a string and return the number of characters making up the representation 12 | // of a floating point number. No conversion is done here, the goal is to identify 13 | // the existence and length of the number. The conversion is best done by system 14 | // routines like atof, sscanf, etc. 15 | // 16 | // Returns 0 if there is no valid number present. 17 | // 18 | // Does not skip white space so first character must be part of the number. If you 19 | // don't care about white space then skip it before calling CharactersInDouble. 20 | // 21 | // Example: 22 | // 23 | // while (isspace(p)) p++; 24 | // n = CharactersInDouble(p); 25 | // if (n) 26 | // { 27 | // x = atof(p); 28 | // p += n; // move to unparsed part of string 29 | // } 30 | // 31 | // HOW IT WORKS 32 | // 33 | // A finite state machine with eight states is used to parse numbers that might 34 | // be in scientific notation. Exponent can be indicated by 'e' or 'E'. 35 | // Might want to generalize to 'd' and 'D' as well so old FORTRAN output 36 | // doesn't cause problems. 37 | // 38 | // Valid numbers: 39 | // 1 integer is a double 40 | // -1 negative numbers OK 41 | // +1 explicit + sign OK 42 | // 1. trailing . OK 43 | // .1 leading . OK 44 | // 1e2 exponent without . before 45 | // 1e+2 exponent with explicit + 46 | // 1e-2 exponent with - 47 | // 1.e2 exponent with . before 48 | // 1.1e1 full mantissa 49 | // 1.34e+4 general test 50 | // 51 | // There is no "looking forward". For example, this subroutine does 52 | // not forgive trailing 'e'. If it gets an 'e' it insists on a valid exponent. 53 | // 54 | // Invalid numbers: 55 | // " 1" leading white space 56 | // -a no digit after the - 57 | // a not a digit 58 | // 1e e assumed to be part of number, but exponent is missing 59 | // 60 | // Validly terminated numbers: 61 | // 62 | // 1.7a a clearly not part of the number (returns 3) 63 | // 1.e-7e 2nd e clearly not part of the number (returns 5) 64 | // 65 | // Thinking of porting this to C# one day, we do not use pointers. 66 | 67 | int CharactersInDouble(const char p[]) 68 | { 69 | int len = strlen(p); // in C# we will use something different 70 | int bytes = 0; 71 | int state = 0; 72 | 73 | while (1) 74 | { 75 | int c, digit; 76 | 77 | // Get next character from string. Treat terminating 0 as 78 | // a character and let the finite state machine process it. 79 | 80 | if (bytes < len) 81 | { 82 | c = (int)p[bytes]; 83 | } 84 | else 85 | { 86 | c = 0; 87 | } 88 | 89 | digit = isdigit(c); 90 | 91 | if (state == 0) // start here 92 | { 93 | if (c == '+' || c == '-') state = 1; 94 | else if (digit) state = 2; 95 | else if (c == '.') state = 3; 96 | else return 0; 97 | } 98 | else if (state == 1) // we had a sign, cannot have another 99 | { 100 | if (c == '.') state = 4; 101 | else if (digit) state = 2; 102 | else return 0; 103 | } 104 | else if (state == 2) // had a digit, working on integer part 105 | { 106 | if (c == 'e' || c == 'E') state = 5; 107 | else if (digit) state = 2; 108 | else if (c == '.') state = 4; 109 | else break; 110 | } 111 | else if (state == 3) // had a leading ., need fractional part 112 | { 113 | if (digit) state = 4; 114 | else return 0; 115 | } 116 | else if (state == 4) // working on fractional part 117 | { 118 | if (c == 'e' || c == 'E') state = 5; 119 | else if (digit) state = 4; 120 | else break; 121 | } 122 | else if (state == 5) // had an 'e', need sign or a digit 123 | { 124 | if (c == '+' || c == '-') state = 6; 125 | else if (digit) state = 7; 126 | else return 0; 127 | } 128 | else if (state == 6) // had a sign, need a digit 129 | { 130 | if (digit) state = 7; 131 | else return 0; 132 | } 133 | else if (state == 7) // working on the exponent 134 | { 135 | if (digit) state = 7; 136 | else break; 137 | } 138 | 139 | // Here the character has been accepted. 140 | 141 | bytes++; 142 | } 143 | 144 | return bytes; 145 | } 146 | -------------------------------------------------------------------------------- /matlab/IOdata_out.m: -------------------------------------------------------------------------------- 1 | % Frame3DD version: 20091203 http://frame3dd.sf.net/ 2 | %GPL Copyright (C) 1992-2009, Henri P. Gavin 3 | %Frame3DD is distributed in the hope that it will be useful but with no warranty. 4 | %For details see the GNU Public Licence: http://www.fsf.org/copyleft/gpl.html 5 | % frame analysis via Matlab interface 6 | % Sun Jan 3 10:09:02 2010 7 | % m-file formatted results of frame3dd analysis 8 | % to be read by frame_3dd.m 9 | 10 | % L O A D C A S E 1 O F 1 ... 11 | 12 | % N O D A L D I S P L A C E M E N T S (global) 13 | % X-dsp Y-dsp Z-dsp X-rot Y-rot Z-rot 14 | D1=[ 0.0 0.0 0.0 0.0 0.0 -1.712305e-03 ; 15 | 6.455238e-04 -2.175619e-02 0.0 0.0 0.0 -1.338727e-03 ; 16 | 3.561803e-03 -3.848707e-02 0.0 0.0 0.0 -7.267565e-04 ; 17 | 6.478181e-03 -4.166095e-02 0.0 0.0 0.0 1.039442e-04 ; 18 | 9.536368e-03 -3.626603e-02 0.0 0.0 0.0 7.200522e-04 ; 19 | 1.259451e-02 -2.282369e-02 0.0 0.0 0.0 1.326296e-03 ; 20 | 1.472356e-02 0.0 0.0 0.0 0.0 1.947688e-03 ; 21 | 1.000000e-02 -1.868558e-02 0.0 0.0 0.0 -1.116688e-03 ; 22 | 9.354327e-03 -3.688721e-02 0.0 0.0 0.0 -8.289992e-04 ; 23 | 5.767041e-03 -4.166093e-02 0.0 0.0 0.0 6.003573e-05 ; 24 | 2.179763e-03 -3.586605e-02 0.0 0.0 0.0 7.979142e-04 ; 25 | 5.063876e-05 -2.069475e-02 0.0 0.0 0.0 1.210416e-03 ]'; 26 | 27 | % F R A M E E L E M E N T E N D F O R C E S (local) 28 | % Nx_1 Vy_1 Vz_1 Txx_1 Myy_1 Mzz_1 Nx_2 Vy_2 Vz_2 Txx_2 Myy_2 Mzz_2 29 | F1=[ -1.613810e+01 2.395833e-03 0.0 0.0 0.0 1.126185e-02 1.613810e+01 -2.395833e-03 0.0 0.0 0.0 1.748814e-02 ; 30 | -7.290698e+01 3.012485e-03 0.0 0.0 0.0 1.297515e-02 7.290698e+01 -3.012485e-03 0.0 0.0 0.0 2.317466e-02 ; 31 | -7.290944e+01 -3.909668e-04 0.0 0.0 0.0 -9.268307e-03 7.290944e+01 3.909668e-04 0.0 0.0 0.0 4.576705e-03 ; 32 | -7.645469e+01 -3.131541e-04 0.0 0.0 0.0 -7.013157e-03 7.645469e+01 3.131541e-04 0.0 0.0 0.0 3.255308e-03 ; 33 | -7.645347e+01 -8.085104e-04 0.0 0.0 0.0 -9.903096e-03 7.645347e+01 8.085104e-04 0.0 0.0 0.0 2.009721e-04 ; 34 | -5.322625e+01 -2.208182e-03 0.0 0.0 0.0 -1.842735e-02 5.322625e+01 2.208182e-03 0.0 0.0 0.0 -8.070830e-03 ; 35 | 1.085698e+02 -9.135994e-04 0.0 0.0 0.0 -1.126185e-02 -1.085698e+02 9.135994e-04 0.0 0.0 0.0 -4.242444e-03 ; 36 | -7.676523e+01 -3.734733e-03 0.0 0.0 0.0 -2.425872e-02 7.676523e+01 3.734733e-03 0.0 0.0 0.0 -2.055807e-02 ; 37 | 8.027767e+01 -3.772390e-04 0.0 0.0 0.0 -6.204579e-03 -8.027767e+01 3.772390e-04 0.0 0.0 0.0 -1.973790e-04 ; 38 | -3.999660e+01 -2.459730e-03 0.0 0.0 0.0 -1.390636e-02 3.999660e+01 2.459730e-03 0.0 0.0 0.0 -1.561040e-02 ; 39 | -2.371999e+01 -1.824251e-04 0.0 0.0 0.0 3.949494e-03 2.371999e+01 1.824251e-04 0.0 0.0 0.0 -7.045350e-03 ; 40 | -5.605005e-04 1.894030e-04 0.0 0.0 0.0 1.502322e-03 5.605005e-04 -1.894030e-04 0.0 0.0 0.0 7.705137e-04 ; 41 | -1.870604e+01 1.265596e-04 0.0 0.0 0.0 -3.015364e-03 1.870604e+01 -1.265596e-04 0.0 0.0 0.0 5.163151e-03 ; 42 | -9.999505e+00 1.216106e-03 0.0 0.0 0.0 6.647788e-03 9.999505e+00 -1.216106e-03 0.0 0.0 0.0 7.945488e-03 ; 43 | 3.284527e+01 3.530237e-04 0.0 0.0 0.0 6.109026e-03 -3.284527e+01 -3.530237e-04 0.0 0.0 0.0 -1.180163e-04 ; 44 | -5.322346e+01 1.858614e-03 0.0 0.0 0.0 1.211735e-02 5.322346e+01 -1.858614e-03 0.0 0.0 0.0 1.018601e-02 ; 45 | 7.527285e+01 4.391621e-04 0.0 0.0 0.0 8.070830e-03 -7.527285e+01 -4.391621e-04 0.0 0.0 0.0 -6.180017e-04 ; 46 | 1.614183e+01 4.532987e-03 0.0 0.0 0.0 2.480051e-02 -1.614183e+01 -4.532987e-03 0.0 0.0 0.0 2.959533e-02 ; 47 | 8.968214e+01 1.110710e-04 0.0 0.0 0.0 -6.742199e-03 -8.968214e+01 -1.110710e-04 0.0 0.0 0.0 8.075050e-03 ; 48 | 8.968195e+01 -4.494295e-04 0.0 0.0 0.0 -8.845564e-03 -8.968195e+01 4.494295e-04 0.0 0.0 0.0 3.452410e-03 ; 49 | 5.322811e+01 -2.167587e-03 0.0 0.0 0.0 -1.644303e-02 -5.322811e+01 2.167587e-03 0.0 0.0 0.0 -9.568008e-03 ]'; 50 | 51 | % R E A C T I O N S (global) 52 | % Fx Fy Fz Mxx Myy Mzz 53 | R1=[ 6.063296e+01 7.677216e+01 0.0 0.0 0.0 0.0 ; 54 | 0.0 0.0 0.0 0.0 0.0 0.0 ; 55 | 0.0 0.0 0.0 0.0 0.0 0.0 ; 56 | 0.0 0.0 0.0 0.0 0.0 0.0 ; 57 | 0.0 0.0 0.0 0.0 0.0 0.0 ; 58 | 0.0 0.0 0.0 0.0 0.0 0.0 ; 59 | 0.0 5.322784e+01 0.0 0.0 0.0 0.0 ; 60 | -6.063296e+01 0.0 0.0 0.0 0.0 0.0 ; 61 | 0.0 0.0 0.0 0.0 0.0 0.0 ; 62 | 0.0 0.0 0.0 0.0 0.0 0.0 ; 63 | 0.0 0.0 0.0 0.0 0.0 0.0 ; 64 | 0.0 0.0 0.0 0.0 0.0 0.0 ]'; 65 | 66 | % R M S E Q U I L I B R I U M E R R O R: 9.629e-15 67 | 68 | 69 | load Ks 70 | 71 | -------------------------------------------------------------------------------- /examples/exJ.csv: -------------------------------------------------------------------------------- 1 | "Example J: tesseract (N, mm, ton)",,,,,,,,,,,, 2 | ,,,,,,,,,,,, 3 | "# node data ...",,,,,,,,,,,, 4 | 16,,,,,"# number of nodes",,,,,,, 5 | #.node,x,y,z,r,,,,,,,, 6 | #.n,mm,mm,mm,mm,,,,,,,, 7 | ,,,,,,,,,,,, 8 | 1,100,100,-100,0,,,,,,,, 9 | 2,-100,100,-100,0,,,,,,,, 10 | 3,-100,-100,-100,0,,,,,,,, 11 | 4,100,-100,-100,0,,,,,,,, 12 | ,,,,,,,,,,,, 13 | 5,100,100,100,0,,,,,,,, 14 | 6,-100,100,100,0,,,,,,,, 15 | 7,-100,-100,100,0,,,,,,,, 16 | 8,100,-100,100,0,,,,,,,, 17 | ,,,,,,,,,,,, 18 | 9,70,70,-70,0,,,,,,,, 19 | 10,-70,70,-70,0,,,,,,,, 20 | 11,-70,-70,-70,0,,,,,,,, 21 | 12,70,-70,-70,0,,,,,,,, 22 | ,,,,,,,,,,,, 23 | 13,70,70,70,0,,,,,,,, 24 | 14,-70,70,70,0,,,,,,,, 25 | 15,-70,-70,70,0,,,,,,,, 26 | 16,70,-70,70,0,,,,,,,, 27 | ,,,,,,,,,,,, 28 | "# reaction data ...",,,,,,,,,,,, 29 | 0,,,,,"# number of nodes with reactions",,,,,,, 30 | ,,,,,,,,,,,, 31 | "# frame element data ...",,,,,,,,,,,, 32 | 32,,,,,"# number of frame elements",,,,,,, 33 | #.m,n1,n2,Ax,Asy,Asz,Jxx,Iyy,Izz,E,G,roll,density 34 | #,mm^2,mm^2,mm^2,mm^4,mm^4,mm^4,MPa,MPa,deg,T/mm^3,, 35 | ,,,,,,,,,,,, 36 | 1,1,2,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 37 | 2,2,3,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 38 | 3,3,4,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 39 | 4,4,1,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 40 | ,,,,,,,,,,,, 41 | 5,5,6,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 42 | 6,6,7,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 43 | 7,7,8,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 44 | 8,8,5,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 45 | ,,,,,,,,,,,, 46 | 9,9,10,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 47 | 10,10,11,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 48 | 11,11,12,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 49 | 12,12,9,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 50 | ,,,,,,,,,,,, 51 | 13,13,14,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 52 | 14,14,15,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 53 | 15,15,16,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 54 | 16,16,13,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 55 | ,,,,,,,,,,,, 56 | 17,1,5,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 57 | 18,2,6,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 58 | 19,3,7,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 59 | 20,4,8,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 60 | ,,,,,,,,,,,, 61 | 21,9,13,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 62 | 22,10,14,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 63 | 23,11,15,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 64 | 24,12,16,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 65 | ,,,,,,,,,,,, 66 | 25,1,9,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 67 | 26,2,10,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 68 | 27,3,11,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 69 | 28,4,12,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 70 | ,,,,,,,,,,,, 71 | 29,5,13,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 72 | 30,6,14,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 73 | 31,7,15,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 74 | 32,8,16,100,60,60,500,1000,1000,9990,3800,0,2.73E-09 75 | ,,,,,,,,,,,, 76 | 1,,"# 1: include shear deformations, 0: don't",,,,,,,,,, 77 | 0,,"# 1: include geometric stiffness, 0: don't",,,,,,,,,, 78 | 1,,"# exaggerate static mesh deformations",,,,,,,,,, 79 | 1.0,,"# zoom scale for 3D plotting",,,,,,,,,, 80 | -1,,"# no intrernal force calculations",,,,,,,,,, 81 | ,,,,,,,,,,,, 82 | ,,,,,,,,,,,, 83 | 1,,,,,"# number of static load cases",,,,,,, 84 | "# Begin Static Load Case 1 of 1",,,,,,,,,,,, 85 | 0,0,0,,,"# gravity in the X, Y, Z, directions ",,,,,,, 86 | 0,,,,,"# number of loaded nodes",,,,,,, 87 | 0,,,,,"# number of uniform distributed loads",,,,,,, 88 | 0,,,,,"# number of trapezoidal distributed loads",,,,,,, 89 | 0,,,,,"# number of internal concentrated loads",,,,,,, 90 | 0,,,,,"# number of temperature loads",,,,,,, 91 | 0,,,,,"# number of nodes with prescribed displacements",,,,,,, 92 | "# End of Static Load Case 1 of 1",,,,,,,,,,,, 93 | ,,,,,,,,,,,, 94 | 22,,,,,"# number of desired modes of vibration",,,,,,, 95 | 1,,,,,"# 1: subspace-Jacobe iteration; 2: Stodola method",,,,,,, 96 | 0,,,,,"# 0: consistent mass matrix; 1: lumped mass matrix",,,,,,, 97 | 1E-06,,,,,"# mode shape tolerance",,,,,,, 98 | 10,,,,,"# modal frequency shift factor",,,,,,, 99 | 1,,,,,"# exaggerate modal mesh deformations",,,,,,, 100 | ,,,,,,,,,,,, 101 | 0,,,,,"# number of nodes with extra mass or inertia",,,,,,, 102 | 0,,,,,"# number of frame elements with extra mass",,,,,,, 103 | ,,,,,,,,,,,, 104 | 8,,,,,"# number of modes to animate, nA",,,,,,, 105 | 7,10,12,13,15,18,20,22,,"# list of modes to animate",,, 106 | 3,,,,,"# pan during animation",,,,,,, 107 | ,,,,,,,,,,,, 108 | "# End of input data for example J",,,,,,,,,,,, 109 | -------------------------------------------------------------------------------- /src/microstran/forces.h: -------------------------------------------------------------------------------- 1 | /* FRAME3DD: Static and dynamic structural analysis of 2D & 3D frames and trusses 2 | Copyright (C) 2007-2008 John Pye 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | *//** @file 17 | Data structures to hold member-end force data 18 | */ 19 | #ifndef DISPLACEMENTS_H 20 | #define DISPLACEMENTS_H 21 | 22 | #include "config.h" 23 | #include "model.h" 24 | #include "vec3.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C"{ 28 | #endif 29 | 30 | #define MAXFORCESNAME 80 31 | 32 | /** 33 | Forces and moments on a certain member due to the specified node. 34 | Each member will have two such force struct, one for each end. Forces 35 | are in local member coordinate systems, as can be accessed using the 36 | function 'memb_get_orientation'. 37 | 38 | @NOTE carefully that when a membernodeforce corresponds to a 'from' node, 39 | the true direction of the force and moment is actually the negative 40 | of that stored here, because of the sign convention used by Microstran 41 | for member forces. 42 | 43 | This comes about because positive axial forces are those which cause a 44 | member to be in tension, regardless of whether one is at the +Z or -Z 45 | end of the member. @ENDNOTE 46 | 47 | @NOTE ALSO that in libmicrostranparser's sign convention, local coordinates 48 | are 'Z' aligned with the member axis in the direction from-->to, and 49 | 'Y' is the major axis of the cross-section. 'Z' and 'X' are reversed 50 | compared with the Microstran sign convention. @ENDNOTE 51 | */ 52 | typedef struct membernodeforce_{ 53 | unsigned node; 54 | vec3 F; /**< force applied on member due to this node */ 55 | vec3 M; /**< moment applied on member due to this node */ 56 | } membernodeforce; 57 | 58 | /** 59 | Structure containing all forces calculated for a particular member. 60 | There are forces and moments at each end of the member. 61 | */ 62 | typedef struct memberforce_{ 63 | unsigned member; /* member ID, as read from the .p1 file */ 64 | membernodeforce fromnode; /* forces for the first-listed node (FIXME check that this node corresponds to the 'from' node in the model struct) */ 65 | membernodeforce tonode; /* forces for the second-listed node (FIXME check that this node corresponds to the 'to' node in the model struct) */ 66 | } memberforce; 67 | 68 | /** 69 | All forces from a certain load case. Note that Microstran sometimes doesn't 70 | export forces for ALL members in a model, so we can't assume that all 71 | forces will be present for all nodes/members in subsequent processing. 72 | */ 73 | typedef struct caseforces_{ 74 | unsigned id; /**< case ID, as read from the .p1 file. */ 75 | char name[MAXCASENAME]; /**< load case name, as read from the .p1 file. */ 76 | array members; /**< array (list) of memberforce */ 77 | } caseforces; 78 | 79 | /** 80 | All forces for all load cases for a particular model. We'll expect to be 81 | reading this data from a Microstran output '.p1' file, so we also store 82 | a filename here in this structure. 83 | */ 84 | typedef struct modelforces_{ 85 | char filename[MAXFORCESNAME]; /**< filename from which the data was read. */ 86 | array cases; /* array (list) of caseforces */ 87 | } modelforces; 88 | 89 | caseforces *caseforces_create(unsigned id, const char *name); 90 | void caseforces_destroy(caseforces *cd); 91 | 92 | modelforces *modelforces_create(); 93 | void modelforces_destroy(modelforces *mf); 94 | 95 | membernodeforce membernodeforce_create(unsigned nodeid, vec3 F, vec3 M); 96 | 97 | cbool caseforces_add_member(caseforces *cf, unsigned memberid, membernodeforce fromnode, membernodeforce tonode); 98 | 99 | cbool modelforces_add_case(modelforces *mf, caseforces *cf); 100 | 101 | /* QUERY FUNCTIONS */ 102 | 103 | MSTRANP_API caseforces *modelforces_find_case(modelforces *mf, unsigned caseid); 104 | 105 | MSTRANP_API memberforce *caseforces_find_member(caseforces *cf, const unsigned memberid); 106 | 107 | MSTRANP_API caseforces *modelforces_get_case(modelforces *mf, unsigned index); 108 | 109 | #ifdef __cplusplus 110 | }; 111 | #endif 112 | 113 | #endif /* FORCES_H */ 114 | -------------------------------------------------------------------------------- /examples/exD.csv: -------------------------------------------------------------------------------- 1 | "Example D: dynamic properties of an unrestrained frame with a triangular section",,,,,,,,,,,, 2 | ,,,,,,,,,,,, 3 | "# node data ...",,,,,,,,,,,, 4 | 24,,,,,"# number of nodes",,,,,,, 5 | #.node,x,y,z,r,,,,,,,, 6 | #,in,in,in,in,,,,,,,, 7 | ,,,,,,,,,,,, 8 | 1,-120,0,-210,10,,,,,,,, 9 | 2,0,0,-210,0,,,,,,,, 10 | 3,120,0,-210,10,,,,,,,, 11 | 4,60,115,-210,0,,,,,,,, 12 | 5,0,230,-210,10,,,,,,,, 13 | 6,-60,115,-210,0,,,,,,,, 14 | 7,-120,0,-90,0,,,,,,,, 15 | 8,120,0,-90,0,,,,,,,, 16 | 9,0,230,-90,0,,,,,,,, 17 | 10,-120,0,0,10,,,,,,,, 18 | 11,0,0,0,0,,,,,,,, 19 | 12,120,0,0,10,,,,,,,, 20 | 13,60,115,0,0,,,,,,,, 21 | 14,0,230,0,10,,,,,,,, 22 | 15,-60,115,0,0,,,,,,,, 23 | 16,-120,0,90,0,,,,,,,, 24 | 17,120,0,90,0,,,,,,,, 25 | 18,0,230,90,0,,,,,,,, 26 | 19,-120,0,210,10,,,,,,,, 27 | 20,0,0,210,0,,,,,,,, 28 | 21,120,0,210,10,,,,,,,, 29 | 22,60,115,210,0,,,,,,,, 30 | 23,0,230,210,10,,,,,,,, 31 | 24,-60,115,210,0,,,,,,,, 32 | ,,,,,,,,,,,, 33 | 0,,,,,"# number of nodes with reactions",,,,,,, 34 | ,,,,,,,,,,,, 35 | "# frame element data ...",,,,,,,,,,,, 36 | 30,,,,,"# number of frame elements",,,,,,, 37 | #.m,n1,n2,Ax,Asy,Asz,Jxx,Iyy,Izz,E,G,roll,density 38 | #,.,.,in^2,in^2,in^2,in^4,in^4,in^4,ksi,ksi,deg,k/in^3/g 39 | ,,,,,,,,,,,, 40 | 1,1,2,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 41 | 2,2,3,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 42 | 3,3,4,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 43 | 4,4,5,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 44 | 5,5,6,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 45 | 6,6,1,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 46 | 7,1,7,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 47 | 8,3,8,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 48 | 9,5,9,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 49 | 10,7,10,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 50 | 11,8,12,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 51 | 12,9,14,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 52 | 13,10,11,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 53 | 14,11,12,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 54 | 15,12,13,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 55 | 16,13,14,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 56 | 17,14,15,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 57 | 18,15,10,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 58 | 19,10,16,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 59 | 20,12,17,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 60 | 21,14,18,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 61 | 22,16,19,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 62 | 23,17,21,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 63 | 24,18,23,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 64 | 25,19,20,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 65 | 26,20,21,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 66 | 27,21,22,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 67 | 28,22,23,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 68 | 29,23,24,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 69 | 30,24,19,125,100,100,5000,2500,2500,29000,11500,0,7.33E-07 70 | ,,,,,,,,,,,, 71 | 1,,"# 1: include shear deformation; 0: don't",,,,,,,,,, 72 | 0,,"# 1: include geometric stiffness; 0: don't",,,,,,,,,, 73 | 20,,"# exaggerate static mesh deformations",,,,,,,,,, 74 | 1.0,,"# zoom scale for 3D plotting",,,,,,,,,, 75 | -1,,"# dx = -1 means no internal forces or transverse displacements are calculated",,,,,,,,,, 76 | ,,,,,,,,,,,, 77 | ,,,,,,,,,,,, 78 | ,,,,,,,,,,,, 79 | 1,,,,,"# number of static load cases",,,,,,, 80 | ,,,,,,,,,,,, 81 | "# Begin Static Load Case 1 of 1",,,,,,,,,,,, 82 | 0,0,0,,,"# gravity in X, Y, Z directions (global)",,,,,,, 83 | 0,,,,,"# number of loaded nodes",,,,,,, 84 | 0,,,,,"# number of uniform loads",,,,,,, 85 | 0,,,,,"# number of trapezoidal loads",,,,,,, 86 | 0,,,,,"# number of internal concentrated loads",,,,,,, 87 | 0,,,,,"# number of temperature loads",,,,,,, 88 | 0,,,,,"# number of nodes with prescribed displacements",,,,,,, 89 | "# End of Static Load Case 1 of 1",,,,,,,,,,,, 90 | ,,,,,,,,,,,, 91 | ,,,,,,,,,,,, 92 | 14,,"# number of desired dynamic modes of vibration",,,,,,,,,, 93 | 1,,"# 1: subspace Jacobi iterations; 2: Stodola method",,,,,,,,,, 94 | 0,,"# 0: consistent mass matrix... 1: lumped mass matrix",,,,,,,,,, 95 | 1E-06,,"# mode shape tolerance",,,,,,,,,, 96 | 10,,"# shift value ... For unrestrained structures",,,,,,,,,, 97 | 20,,"# exaggerate modal mesh deformations",,,,,,,,,, 98 | ,,,,,,,,,,,, 99 | 0,,,,,"# number of nodes with extra mass or inertia",,,,,,, 100 | 0,,,,,"# number of elements with extra mass",,,,,,, 101 | ,,,,,,,,,,,, 102 | 5,,,,,"# number of modes to animiate",,,,,,, 103 | 1,7,9,11,12,"# list of modes to animate, omit if nA == 0",,,,,,, 104 | 2,,,,,"# pan rate during animation",,,,,,, 105 | ,,,,,,,,,,,, 106 | "# End of input data file for example D",,,,,,,,,,,, 107 | -------------------------------------------------------------------------------- /examples/exE.csv: -------------------------------------------------------------------------------- 1 | "Example E: a three-dimensional structure showing lateral-torsional dynamic modes (units: kip, in)",,,,,,,,,,,, 2 | ,,,,,,,,,,,, 3 | 12,,,,,"# number of nodes",,,,,,, 4 | #.node,x,y,z,r,,,,,,,, 5 | #,in,in,in,in,,,,,,,, 6 | ,,,,,,,,,,,, 7 | 1,0,0,0,0,,,,,,,, 8 | 2,72,0,0,0,,,,,,,, 9 | 3,144,0,0,0,,,,,,,, 10 | 4,144,36,0,0,,,,,,,, 11 | 5,144,72,0,0,,,,,,,, 12 | 6,72,72,0,0,,,,,,,, 13 | 7,0,72,0,0,,,,,,,, 14 | 8,0,36,0,0,,,,,,,, 15 | 9,0,0,-120,0,,,,,,,, 16 | 10,144,0,-120,0,,,,,,,, 17 | 11,72,72,-120,0,,,,,,,, 18 | 12,72,36,0,0,,,,,,,, 19 | ,,,,,,,,,,,, 20 | 3,,,,,"# number of nodes with reactions",,,,,,, 21 | #.J,x,y,z,xx,yy,zz,"1=fixed,",0=free,,,, 22 | 9,1,1,1,1,1,1,,,,,, 23 | 10,1,1,1,1,1,1,,,,,, 24 | 11,1,1,1,1,1,1,,,,,, 25 | ,,,,,,,,,,,, 26 | 15,,,,,"# number of frame elements",,,,,,, 27 | #.m,n1,n2,Ax,Asy,Asz,Jxx,Iyy,Izz,E,G,roll,density 28 | #,.,.,in^2,in^2,in^2,in^4,in^4,in^4,ksi,ksi,deg, 29 | ,,,,,,,,,,,, 30 | 1,1,2,1100,800,800,1000,500,500,999000,11500,0,7E-07 31 | 2,2,3,1100,800,800,1000,500,500,999000,11500,0,7E-07 32 | 3,3,4,1100,800,800,1000,500,500,999000,11500,0,7E-07 33 | 4,4,5,1100,800,800,1000,500,500,999000,11500,0,7E-07 34 | 5,5,6,1100,800,800,1000,500,500,999000,11500,0,7E-07 35 | 6,6,7,1100,800,800,1000,500,500,999000,11500,0,7E-07 36 | 7,7,8,1100,800,800,1000,500,500,999000,11500,0,7E-07 37 | 8,8,1,1100,800,800,1000,500,500,999000,11500,0,7E-07 38 | 9,9,1,1100,800,800,1,110,110,29000,11500,0,7E-07 39 | 10,10,3,1100,800,800,1,110,110,29000,11500,0,7E-07 40 | 11,11,6,1100,800,800,1,110,110,29000,11500,0,7E-07 41 | 12,12,2,1100,800,800,1000,500,500,999000,11500,0,7E-07 42 | 13,12,4,1100,800,800,1000,500,500,999000,11500,0,7E-07 43 | 14,12,6,1100,800,800,1000,500,500,999000,11500,0,7E-07 44 | 15,12,8,1100,800,800,1000,500,500,999000,11500,0,7E-07 45 | ,,,,,,,,,,,, 46 | ,,,,,,,,,,,, 47 | 1,,"# 1: include shear deformation; 0: don't",,,,,,,,,, 48 | 1,,"# 1: include geometric stiffness; 0: don't",include,geometric,stiffness,,,,,,, 49 | 2,,"# exaggerate static mesh deformations",,,,,,,,,, 50 | 1.5,,"# zoom scale for 3D plotting",,,,,,,,, 51 | 6,,"# x-axis increment for internal force data, in",,,,,,,,,, 52 | ,,"# if dx is -1 then internal force calculations are skipped. ",,,,,,,,,, 53 | ,,,,,,,,,,,, 54 | ,,,,,,,,,,,, 55 | 1,,"# number of static load cases",,,,,,,,,, 56 | ,,,,,,,,,,,, 57 | "# Begin Static Load Case 1 of 1",,,,,,,,,,,, 58 | 0,0,0,,"# gravity in X, Y, Z directions (global)",,,,,,,, 59 | 1,,,,,"# number of loaded nodes",,,,,,, 60 | #.n,Fx,Fy,Fz,Mxx,Myy,Mzz,,,,,, 61 | #,k,k,k,k.in,k.in,k.in,,,,,, 62 | 3,0,500,-500,0,0,0,,,,,, 63 | ,,,,,,,,,,,, 64 | 0,,,,,"# number of uniform distributed loads",,,,,,, 65 | 3,,,,,"# number of trapezoidal distributed loads",,,,,,, 66 | #.m,x1,x2,w1,w2,,,,,,,, 67 | #,in,in,k/in,k/in,,,,,,,, 68 | 9,0,0,0,0,,"# location and loading - local x-axis",,,,,, 69 | ,0,0,0,0,,"# location and loading - local y-axis",,,,,, 70 | ,0,120,0,0.2,,"# location and loading - local z-axis",,,,,, 71 | 10,0,0,0,0,,"# location and loading - local x-axis",,,,,, 72 | ,0,0,0,0,,"# location and loading - local y-axis",,,,,, 73 | ,0,120,0,0.3,,"# location and loading - local z-axis",,,,,, 74 | 11,0,0,0,0,,"# location and loading - local x-axis",,,,,, 75 | ,0,0,0,0,,"# location and loading - local y-axis",,,,,, 76 | ,0,120,0,0.4,,"# location and loading - local z-axis",,,,,, 77 | ,,,,,,,,,,,, 78 | 0,,,,,"# number of internal concentrated loads",loads,,,,,, 79 | 0,,,,,"# number of temperature loads",,,,,,, 80 | 0,,,,,"# number of nodes with prescribed displacements",,,,,,, 81 | "# End of Static Load Case 1 of 1",,,,,,,,,,,, 82 | ,,,,,,,,,,,, 83 | ,,,,,,,,,,,, 84 | 4,,,,,"# number of desired dynamic modes of vibration",,,,,,, 85 | 1,,,,,"# 1: subspace-Jacobi iteration; 2: Stodola method",,,,,,, 86 | 0,,,,,"# 0: consistent mass matrix ... 1: lumped mass matrix",,,,,,, 87 | 1E-05,,,,,"# mode shape tolerance",,,,,,, 88 | 1,,,,,"# shift value ... For unrestrained structures",,,,,,, 89 | 10,,,,,"# exaggerate modal mesh deformations",,,,,,, 90 | ,,,,,,,,,,,, 91 | 1,,,,,"# number of modes with extra mass or inertia",,,,,,, 92 | #.n,M,Ixx,Iyy,Izz,,"... nodes and concentrated masses and inertia",,,,,, 93 | #,kip,k.in^2,k.in^2,k.in^2,,,,,,,, 94 | 12,3.388,0,0,839.37,,,,,,,, 95 | ,,,,,,,,,,,, 96 | 0,,,,,"# number of frame elements with extra mass",,,,,,, 97 | ,,,,,,,,,,,, 98 | 4,,,,,"# number of modes to animate, nA",,,,,,, 99 | 1,2,3,4,,"# list of modes to animate, omit if nA == 0",,,,,,, 100 | 0,,,,,"# don't pan during animation",,,,,,, 101 | ,,,,,,,,,,,, 102 | 2,,,,,"# condensation method: 0=none, 1=static, 2=Guyan, 3=Dynamic",,,,,,, 103 | 1,,,,,"# number of condensed nodes",,,,,,, 104 | 12,1,1,0,0,0,1,,"# node number, 1: condense dof, 0: don;t",,,, 105 | ,,,,,,,,,,,, 106 | 1,2,3,,,"# list of modes to match for dynamic condensation",,,,,,, 107 | ,,,,,,,,,,,, 108 | "# End of input data file for example E",,,,,,,,,,,, 109 | -------------------------------------------------------------------------------- /zipdist.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # zipdist.sh 4 | # assemble .ZIP files for Frame3dd executable and source distribution release 5 | 6 | # NOTE: this version number should preferably be synchronised with the version 7 | # number in file 'SConstruct'. Note the alternative packaging instructions in 8 | # the file 'PACKAGING.txt' which builds DEB, RPM and EXE packages, but nothing 9 | # for Mac users :-( 10 | export VERSION=20140514+ 11 | echo $VERSION 12 | 13 | # clean out prior distribution files 14 | echo "cleaning out prior distribution files ... " 15 | rm -rf dist/Frame3DD 16 | 17 | # make directory structure for distribution .ZIP file in the ./dist directory 18 | echo "creating directory structure for new distribution ... " 19 | mkdir dist/Frame3DD 20 | mkdir dist/Frame3DD/doc 21 | mkdir dist/Frame3DD/doc/img 22 | mkdir dist/Frame3DD/examples 23 | mkdir dist/Frame3DD/matlab 24 | mkdir dist/Frame3DD/linux 25 | mkdir dist/Frame3DD/osx 26 | mkdir dist/Frame3DD/windows 27 | 28 | # make an empty temp directory 29 | echo "making an empty Frame3DD/temp directory ... " 30 | mkdir dist/Frame3DD/temp/ 31 | 32 | echo "creating source code directory structure for new distribution ... " 33 | mkdir dist/Frame3DD/src 34 | mkdir dist/Frame3DD/src/microstran 35 | 36 | # copy documentation 37 | echo "copying documentation ... " 38 | cp --preserve=mode,timestamps doc/*.html dist/Frame3DD/doc/. 39 | cp --preserve=mode,timestamps doc/template.3dd dist/Frame3DD/doc/. 40 | cp --preserve=mode,timestamps doc/template.csv dist/Frame3DD/doc/. 41 | cp --preserve=mode,timestamps doc/img/*.png dist/Frame3DD/doc/img/. 42 | cp --preserve=mode,timestamps doc/img/*.jpg dist/Frame3DD/doc/img/. 43 | cp --preserve=mode,timestamps doc/img/*.gif dist/Frame3DD/doc/img/. 44 | #cp --preserve=mode,timestamps doc/LinuxTerminal.pdf dist/Frame3DD/doc/. 45 | 46 | # copy ChangeLog, license, and README files 47 | cp --preserve=mode,timestamps ChangeLog.txt dist/Frame3DD/. 48 | cp --preserve=mode,timestamps LICENSE.txt dist/Frame3DD/. 49 | cp --preserve=mode,timestamps README.txt dist/Frame3DD/. 50 | cp --preserve=mode,timestamps README-win32.txt dist/Frame3DD/. 51 | 52 | # copy example files (text and .csv formats) 53 | echo "copying example files ... " 54 | cp --preserve=mode,timestamps examples/ex*.3dd dist/Frame3DD/examples/. 55 | cp --preserve=mode,timestamps examples/ex*.out dist/Frame3DD/examples/. 56 | cp --preserve=mode,timestamps examples/ex*.csv dist/Frame3DD/examples/. 57 | cp --preserve=mode,timestamps examples/ex*_out.CSV dist/Frame3DD/examples/. 58 | cp --preserve=mode,timestamps examples/saveplot dist/Frame3DD/examples/. 59 | cp --preserve=mode,timestamps examples/saveplot_w32 dist/Frame3DD/examples/. 60 | 61 | # copy matlab files 62 | echo "copying matlab files ... " 63 | cp --preserve=mode,timestamps matlab/* dist/Frame3DD/matlab/. 64 | 65 | # copy source code 66 | echo "copying source code ... " 67 | cp --preserve=mode,timestamps src/*.c dist/Frame3DD/src/. 68 | cp --preserve=mode,timestamps src/*.h dist/Frame3DD/src/. 69 | cp --preserve=mode,timestamps src/Makefile dist/Frame3DD/src/. 70 | cp --preserve=mode,timestamps src/microstran/vec3.h dist/Frame3DD/src/microstran/. 71 | cp --preserve=mode,timestamps src/microstran/config.h dist/Frame3DD/src/microstran/. 72 | 73 | 74 | # copy binary executable application 75 | echo "copying Linux executable ... " 76 | cp --preserve=mode,timestamps build/linux/frame3dd dist/Frame3DD/linux/frame3dd 77 | echo "copying OS X executable ... " 78 | cp --preserve=mode,timestamps build/osx/frame3dd dist/Frame3DD/osx/frame3dd 79 | echo "copying Windows executable ... " 80 | cp --preserve=mode,timestamps build/windows/frame3dd.exe dist/Frame3DD/windows/frame3dd.exe 81 | cp --preserve=mode,timestamps build/DukeOIT/frame3dd dist/Frame3DD/DukeOIT/frame3dd 82 | 83 | # assemble the .zip file 84 | echo "assembling .zip file ... " 85 | cd dist # change to trunk/dist 86 | zip -r Frame3DD_$(echo $VERSION).zip Frame3DD/* 87 | #zip -r Frame3DD_$(date +%Y%m%d).zip Frame3DD/* 88 | 89 | #rm Frame3DD_$(date +%Y%m%d).zip 90 | 91 | echo "Frame3DD .zip archive complete" 92 | 93 | rm -rf Frame3DD 94 | 95 | # To upload distribution files to sourceforge.net ... 96 | # 97 | # rsync -uav Frame3DD*.zip hpgavin,frame3dd@frs.sourceforge.net:/home/frs/project/f/fr/frame3dd/. 98 | # 99 | ##rsync -uav *.bz2 hpgavin,frame3dd@frs.sourceforge.net:/home/frs/project/f/fr/frame3dd/frame3dd/0.20140514+/. 100 | 101 | # ----------------------------------------------------------------- zipdist.sh 102 | # Henri P. Gavin 2009-10-20 103 | # updated: 2009-10-22, 2009-10-25, 2009-10-27, 2009-10-29, 2010-01-05, 2010-12-1, 2013-03-18, 2014-01-21, 2014-05-14, 2014-05-17, 2015-06-04 104 | -------------------------------------------------------------------------------- /test/lateral-column-x.p1: -------------------------------------------------------------------------------- 1 | 2 | == I N P U T / A N A L Y S I S R E P O R T == 3 | 4 | 5 | Job: lateral-column-x 6 | 7 | Title: Lateral column 8 | Simple test case for demonstrating Microstran parser in Frame3d 9 | Type: Space frame 10 | Date: 7 Apr 2008 11 | Time: 4:33 PM 12 | 13 | Nodes ............................. 2 14 | Members ........................... 1 15 | Spring supports ................... 0 16 | Sections .......................... 1 17 | Materials ......................... 1 18 | Primary load cases ................ 1 19 | Combination load cases ............ 0 20 | 21 | Analysis: Linear elastic 22 | 23 | 24 | == L O A D C A S E S == 25 | 26 | Case Type Analysis Title 27 | 1 P L Horizontal load 1kN 28 | 29 | Analysis Types: 30 | S - Skipped (not analysed) 31 | L - Linear 32 | N - Non-linear 33 | 34 | 35 | == N O D E C O O R D I N A T E S == 36 | 37 | Node X Y Z Restraint 38 | m m m 39 | 1 0.000 0.000 0.000 111111 40 | 2 -1.000 0.000 0.000 000000 41 | 42 | 43 | == M E M B E R D E F I N I T I O N == 44 | 45 | Member A B C Prop Matl Rel-A Rel-B Length 46 | m 47 | 1 1 2 -Z 1 1 000000 000000 1.000 48 | 49 | 50 | == L I B R A R Y S E C T I O N S == 51 | 52 | Section Library Name Axis Comment 53 | 1 asw 65X35X2.0RHS Y comment 54 | 55 | 56 | == S E C T I O N P R O P E R T I E S == 57 | 58 | Section Ax Ay Az J Iy Iz fact 59 | m2 m2 m2 m4 m4 m4 60 | 1 3.740E-04 0.000E+00 0.000E+00 1.840E-07 7.780E-08 2.040E-07 61 | 62 | 63 | == M A T E R I A L P R O P E R T I E S == 64 | 65 | Material E u Density Alpha 66 | kN/m2 t/m3 /deg C 67 | 1 2.000E+08 0.2500 7.850E+00 1.170E-05 68 | 69 | 70 | == T A B L E O F Q U A N T I T I E S == 71 | 72 | MATERIAL 1 73 | 74 | Section Name Length Mass Comment 75 | m tonne 76 | 1 65X35X2.0RHS 1.000 0.003 comment 77 | ---------- ---------- 78 | 1.000 0.003 79 | 80 | 81 | == C O N D I T I O N N U M B E R == 82 | 83 | Maximum condition number: 4.000E+00 at node: 2 DOFN: 5 84 | 85 | 86 | == A P P L I E D L O A D I N G == 87 | 88 | CASE 1: Horizontal load 1kN 89 | 90 | -- Node Loads -- 91 | 92 | Node X Force Y Force Z Force X Moment Y Moment Z Moment 93 | kN kN kN kNm kNm kNm 94 | 2 -3.000 -3.000 5.000 0.000 0.000 0.000 95 | 96 | -- Sum of Applied Loads (Global Axes): -- 97 | FX: -3.000 FY: -3.000 FZ: 5.000 98 | Moments about the global origin: 99 | MX: 0.000 MY: 5.000 MZ: 3.000 100 | 101 | 102 | == N O D E D I S P L A C E M E N T S == 103 | 104 | CASE 1: Horizontal load 1kN 105 | 106 | Node X-Disp Y-Disp Z-Disp X-Rotn Y-Rotn Z-Rotn 107 | m m m rad rad rad 108 | 1 0.0000 0.0000 0.0000 0.00000 0.00000 0.00000 109 | 2 0.0000 -0.0643 0.0408 0.00000 0.06127 0.09640 110 | 111 | 112 | == M E M B E R F O R C E S == 113 | 114 | CASE 1: Horizontal load 1kN 115 | 116 | Member Node Axial Shear-y Shear-z Torque Moment-y Moment-z 117 | kN kN kN kNm kNm kNm 118 | 1 1 3.00 -5.00 3.00 0.00 3.00 -5.00 119 | 2 3.00 -5.00 3.00 0.00 0.00 0.00 120 | 121 | Positive Forces (Member Axes): 122 | Axial - Tension Shear - End A sagging 123 | Torque - Right-hand twist Moment - Sagging 124 | 125 | 126 | == S U P P O R T R E A C T I O N S == 127 | 128 | CASE 1: Horizontal load 1kN 129 | 130 | Node Force-X Force-Y Force-Z Moment-X Moment-Y Moment-Z 131 | kN kN kN kNm kNm kNm 132 | 1 3.00 3.00 -5.00 0.00 -5.00 -3.00 133 | 134 | SUM: 3.00 3.00 -5.00 (all nodes) 135 | 136 | Max. residual: -1.776E-15 at DOFN: 2 137 | 138 | (Reactions act on structure in positive global axis directions.) 139 | -------------------------------------------------------------------------------- /test/lateral-column-y.p1: -------------------------------------------------------------------------------- 1 | 2 | == I N P U T / A N A L Y S I S R E P O R T == 3 | 4 | 5 | Job: lateral-column-y 6 | 7 | Title: Lateral column 8 | Simple test case for demonstrating Microstran parser in Frame3d 9 | Type: Space frame 10 | Date: 7 Apr 2008 11 | Time: 4:31 PM 12 | 13 | Nodes ............................. 2 14 | Members ........................... 1 15 | Spring supports ................... 0 16 | Sections .......................... 1 17 | Materials ......................... 1 18 | Primary load cases ................ 1 19 | Combination load cases ............ 0 20 | 21 | Analysis: Linear elastic 22 | 23 | 24 | == L O A D C A S E S == 25 | 26 | Case Type Analysis Title 27 | 1 P L Horizontal load 1kN 28 | 29 | Analysis Types: 30 | S - Skipped (not analysed) 31 | L - Linear 32 | N - Non-linear 33 | 34 | 35 | == N O D E C O O R D I N A T E S == 36 | 37 | Node X Y Z Restraint 38 | m m m 39 | 1 0.000 0.000 0.000 111111 40 | 2 0.000 1.000 0.000 000000 41 | 42 | 43 | == M E M B E R D E F I N I T I O N == 44 | 45 | Member A B C Prop Matl Rel-A Rel-B Length 46 | m 47 | 1 1 2 X 1 1 000000 000000 1.000 48 | 49 | 50 | == L I B R A R Y S E C T I O N S == 51 | 52 | Section Library Name Axis Comment 53 | 1 asw 65X35X2.0RHS Y comment 54 | 55 | 56 | == S E C T I O N P R O P E R T I E S == 57 | 58 | Section Ax Ay Az J Iy Iz fact 59 | m2 m2 m2 m4 m4 m4 60 | 1 3.740E-04 0.000E+00 0.000E+00 1.840E-07 7.780E-08 2.040E-07 61 | 62 | 63 | == M A T E R I A L P R O P E R T I E S == 64 | 65 | Material E u Density Alpha 66 | kN/m2 t/m3 /deg C 67 | 1 2.000E+08 0.2500 7.850E+00 1.170E-05 68 | 69 | 70 | == T A B L E O F Q U A N T I T I E S == 71 | 72 | MATERIAL 1 73 | 74 | Section Name Length Mass Comment 75 | m tonne 76 | 1 65X35X2.0RHS 1.000 0.003 comment 77 | ---------- ---------- 78 | 1.000 0.003 79 | 80 | 81 | == C O N D I T I O N N U M B E R == 82 | 83 | Maximum condition number: 4.000E+00 at node: 2 DOFN: 4 84 | 85 | 86 | == A P P L I E D L O A D I N G == 87 | 88 | CASE 1: Horizontal load 1kN 89 | 90 | -- Node Loads -- 91 | 92 | Node X Force Y Force Z Force X Moment Y Moment Z Moment 93 | kN kN kN kNm kNm kNm 94 | 2 -3.000 0.000 -5.000 0.000 0.000 0.000 95 | 96 | -- Sum of Applied Loads (Global Axes): -- 97 | FX: -3.000 FY: 0.000 FZ: -5.000 98 | Moments about the global origin: 99 | MX: -5.000 MY: 0.000 MZ: 3.000 100 | 101 | 102 | == N O D E D I S P L A C E M E N T S == 103 | 104 | CASE 1: Horizontal load 1kN 105 | 106 | Node X-Disp Y-Disp Z-Disp X-Rotn Y-Rotn Z-Rotn 107 | m m m rad rad rad 108 | 1 0.0000 0.0000 0.0000 0.00000 0.00000 0.00000 109 | 2 -0.0245 0.0000 -0.1071 -0.16067 0.00000 0.03676 110 | 111 | 112 | == M E M B E R F O R C E S == 113 | 114 | CASE 1: Horizontal load 1kN 115 | 116 | Member Node Axial Shear-y Shear-z Torque Moment-y Moment-z 117 | kN kN kN kNm kNm kNm 118 | 1 1 0.00 -3.00 5.00 0.00 5.00 -3.00 119 | 2 0.00 -3.00 5.00 0.00 0.00 0.00 120 | 121 | Positive Forces (Member Axes): 122 | Axial - Tension Shear - End A sagging 123 | Torque - Right-hand twist Moment - Sagging 124 | 125 | 126 | == S U P P O R T R E A C T I O N S == 127 | 128 | CASE 1: Horizontal load 1kN 129 | 130 | Node Force-X Force-Y Force-Z Moment-X Moment-Y Moment-Z 131 | kN kN kN kNm kNm kNm 132 | 1 3.00 0.00 5.00 5.00 0.00 -3.00 133 | 134 | SUM: 3.00 0.00 5.00 (all nodes) 135 | 136 | Max. residual: 0.000E+00 at DOFN: 6 137 | 138 | (Reactions act on structure in positive global axis directions.) 139 | -------------------------------------------------------------------------------- /test/lateral-column-rev.p1: -------------------------------------------------------------------------------- 1 | 2 | == I N P U T / A N A L Y S I S R E P O R T == 3 | 4 | 5 | Job: lateral-column-rev 6 | 7 | Title: Lateral column 8 | Simple test case for demonstrating Microstran parser in Frame3d 9 | Type: Space frame 10 | Date: 8 Apr 2008 11 | Time: 3:59 PM 12 | 13 | Nodes ............................. 2 14 | Members ........................... 1 15 | Spring supports ................... 0 16 | Sections .......................... 1 17 | Materials ......................... 1 18 | Primary load cases ................ 1 19 | Combination load cases ............ 0 20 | 21 | Analysis: Linear elastic 22 | 23 | 24 | == L O A D C A S E S == 25 | 26 | Case Type Analysis Title 27 | 1 P L Horizontal load 1kN 28 | 29 | Analysis Types: 30 | S - Skipped (not analysed) 31 | L - Linear 32 | N - Non-linear 33 | 34 | 35 | == N O D E C O O R D I N A T E S == 36 | 37 | Node X Y Z Restraint 38 | m m m 39 | 1 0.000 0.000 1.000 000000 40 | 2 0.000 0.000 0.000 111111 41 | 42 | 43 | == M E M B E R D E F I N I T I O N == 44 | 45 | Member A B C Prop Matl Rel-A Rel-B Length 46 | m 47 | 1 2 1 X 1 1 000000 000000 1.000 48 | 49 | 50 | == L I B R A R Y S E C T I O N S == 51 | 52 | Section Library Name Axis Comment 53 | 1 asw 65X35X2.0RHS Y comment 54 | 55 | 56 | == S E C T I O N P R O P E R T I E S == 57 | 58 | Section Ax Ay Az J Iy Iz fact 59 | m2 m2 m2 m4 m4 m4 60 | 1 3.740E-04 0.000E+00 0.000E+00 1.840E-07 7.780E-08 2.040E-07 61 | 62 | 63 | == M A T E R I A L P R O P E R T I E S == 64 | 65 | Material E u Density Alpha 66 | kN/m2 t/m3 /deg C 67 | 1 2.000E+08 0.2500 7.850E+00 1.170E-05 68 | 69 | 70 | == T A B L E O F Q U A N T I T I E S == 71 | 72 | MATERIAL 1 73 | 74 | Section Name Length Mass Comment 75 | m tonne 76 | 1 65X35X2.0RHS 1.000 0.003 comment 77 | ---------- ---------- 78 | 1.000 0.003 79 | 80 | 81 | == C O N D I T I O N N U M B E R == 82 | 83 | Maximum condition number: 4.000E+00 at node: 1 DOFN: 4 84 | 85 | 86 | == A P P L I E D L O A D I N G == 87 | 88 | CASE 1: Horizontal load 1kN 89 | 90 | -- Node Loads -- 91 | 92 | Node X Force Y Force Z Force X Moment Y Moment Z Moment 93 | kN kN kN kNm kNm kNm 94 | 1 5.000 3.000 0.000 0.000 0.000 0.000 95 | 96 | -- Sum of Applied Loads (Global Axes): -- 97 | FX: 5.000 FY: 3.000 FZ: 0.000 98 | Moments about the global origin: 99 | MX: -3.000 MY: 5.000 MZ: 0.000 100 | 101 | 102 | == N O D E D I S P L A C E M E N T S == 103 | 104 | CASE 1: Horizontal load 1kN 105 | 106 | Node X-Disp Y-Disp Z-Disp X-Rotn Y-Rotn Z-Rotn 107 | m m m rad rad rad 108 | 1 0.0408 0.0643 0.0000 -0.09640 0.06127 0.00000 109 | 2 0.0000 0.0000 0.0000 0.00000 0.00000 0.00000 110 | 111 | 112 | == M E M B E R F O R C E S == 113 | 114 | CASE 1: Horizontal load 1kN 115 | 116 | Member Node Axial Shear-y Shear-z Torque Moment-y Moment-z 117 | kN kN kN kNm kNm kNm 118 | 1 2 0.00 5.00 3.00 0.00 3.00 5.00 119 | 1 0.00 5.00 3.00 0.00 0.00 0.00 120 | 121 | Positive Forces (Member Axes): 122 | Axial - Tension Shear - End A sagging 123 | Torque - Right-hand twist Moment - Sagging 124 | 125 | 126 | == S U P P O R T R E A C T I O N S == 127 | 128 | CASE 1: Horizontal load 1kN 129 | 130 | Node Force-X Force-Y Force-Z Moment-X Moment-Y Moment-Z 131 | kN kN kN kNm kNm kNm 132 | 2 -5.00 -3.00 0.00 3.00 -5.00 0.00 133 | 134 | SUM: -5.00 -3.00 0.00 (all nodes) 135 | 136 | Max. residual: 1.776E-15 at DOFN: 2 137 | 138 | (Reactions act on structure in positive global axis directions.) 139 | --------------------------------------------------------------------------------