Index: head/cad/tochnog/Makefile =================================================================== --- head/cad/tochnog/Makefile (revision 349595) +++ head/cad/tochnog/Makefile (revision 349596) @@ -1,91 +1,102 @@ # Created by: Pedro Giffuni # $FreeBSD$ PORTNAME= tochnog -PORTVERSION= 20010211 -PORTREVISION= 9 +PORTVERSION= 20140100 CATEGORIES= cad -MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/feb11_2001 -DISTNAME= ${PORTNAME}_feb11_2001 +MASTER_SITES= SF/${PORTNAME}/Tochnog%20Latest%20January%202014 +DISTFILES= Sources${EXTRACT_SUFX} gid${EXTRACT_SUFX} \ + tools${EXTRACT_SUFX} test${EXTRACT_SUFX} +DIST_SUBDIR= ${PORTNAME}-${PORTVERSION} MAINTAINER= ports@FreeBSD.org COMMENT= Free explicit/implicit Finite Element Program -DEPRECATED= No more public distfiles -EXPIRATION_DATE= 2014-03-07 +LICENSE= GPLv2 BUILD_DEPENDS= ${LOCALBASE}/lib/libf2c.a:${PORTSDIR}/lang/f2c OPTIONS_DEFINE= ATLAS EXAMPLES THREADS ATLAS_DESC= Use ATLAS instead of BLAS/LAPACK -WRKSRC= ${WRKDIR}/${PORTNAME}/src +WRKSRC= ${WRKDIR}/Sources/Tochnog-Latest-jan-2014 MAKEFILE= makefile -USES= fortran +MAKE_ENV= PTHREAD_LIBS=${PTHREAD_LIBS} PTHREAD_CFLAGS=${PTHREAD_CFLAGS} +USES= fortran zip dos2unix +DOS2UNIX_FILES= time.cc time.h tnlapack.h tnsuplu.h # You can set GIDDIR to share/gid to install the scripts to be used # with the cad/linux-gid port, otherwise they can be linked to the data # directory to avoid polluting the port space. GIDDIR?= share/${PORTNAME} PLIST_SUB+= GIDDIR=${GIDDIR} GID_PTYPES= ${PREFIX}/${GIDDIR}/problemtypes .include .if ${PORT_OPTIONS:MATLAS} LIB_DEPENDS+= libatlas.so:${PORTSDIR}/math/atlas .if ${PORT_OPTIONS:MTHREADS} BLAS_LIBS= -lptf77blas .else BLAS_LIBS= -lf77blas .endif .else -LIB_DEPENDS+= libblas.so:${PORTSDIR}/math/blas -BLAS_LIBS= -lblas +LIB_DEPENDS+= libblas.so:${PORTSDIR}/math/blas \ + liblapack.so:${PORTSDIR}/math/lapack +BLAS_LIBS= -llapack -lblas .endif .if ${PORT_OPTIONS:MTHREADS} ALL_TARGET= freebsd_parallel BUILD_DEPENDS+= ${LOCALBASE}/lib/libsuperlu_mt.a:${PORTSDIR}/math/superlu_mt SUPERLU= superlu_mt .else ALL_TARGET= freebsd_old BUILD_DEPENDS+= ${LOCALBASE}/lib/libsuperlu.a:${PORTSDIR}/math/superlu SUPERLU= superlu .endif -post-patch: - @${REINPLACE_CMD} -e 's,%%LOCALBASE%%,${LOCALBASE},g ; \ +post-extract: +.for sup in gid tools test + ${MV} ${WRKDIR}/${sup} ${WRKDIR}/Sources/ +.endfor + +pre-configure: +.for hd in pthread.h + ${MV} ${WRKSRC}/${hd} ${WRKSRC}/${hd}.orig +.endfor + ${REINPLACE_CMD} -e 's,%%LOCALBASE%%,${LOCALBASE},g ; \ s,%%SUPERLU%%,${SUPERLU},g ; \ s,%%BLAS_LIBS%%,-L${LOCALBASE}/lib ${BLAS_LIBS},g' \ ${WRKSRC}/makefile .if ${PORT_OPTIONS:MTHREADS} - @${REINPLACE_CMD} -e 's,SUPERLU_MT_USE 0,SUPERLU_MT_USE 1,' \ + ${REINPLACE_CMD} -e 's,SUPERLU_MT_USE 0,SUPERLU_MT_USE 1,' \ ${WRKSRC}/tnsuplu.h .else # Serial - @${REINPLACE_CMD} -e 's,SUPERLU_USE 0,SUPERLU_USE 1,' \ + ${REINPLACE_CMD} -e 's,SUPERLU_USE 0,SUPERLU_USE 1,' \ ${WRKSRC}/tnsuplu.h .endif post-build: - (cd ${WRKDIR}/tochnog/tools && ${CXX} ${CXXFLAGS} -o aba2tn aba2tn.cc) + (cd ${WRKDIR}/Sources/tools && ${CXX} ${CXXFLAGS} -o aba2tn aba2tn.cc) do-install: ${INSTALL_PROGRAM} ${WRKSRC}/tochnog ${STAGEDIR}${PREFIX}/bin - ${INSTALL_PROGRAM} ${WRKDIR}/tochnog/tools/aba2tn ${STAGEDIR}${PREFIX}/bin - ${INSTALL_SCRIPT} ${WRKDIR}/tochnog/tools/*.awk ${STAGEDIR}${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKDIR}/Sources/tools/aba2tn ${STAGEDIR}${PREFIX}/bin + ${INSTALL_SCRIPT} ${WRKDIR}/Sources/tools/*.awk ${STAGEDIR}${PREFIX}/bin ${MKDIR} ${STAGEDIR}${GID_PTYPES}/tochnog.gid - ${INSTALL_DATA} ${WRKDIR}/tochnog/gid/tochnog.gid/tochnog.cnd \ + ${INSTALL_DATA} ${WRKDIR}/Sources/gid/tochnog.gid/tochnog.cnd \ ${STAGEDIR}${GID_PTYPES}/tochnog.gid - ${INSTALL_DATA} ${WRKDIR}/tochnog/gid/tochnog.gid/tochnog.mat \ + ${INSTALL_DATA} ${WRKDIR}/Sources/gid/tochnog.gid/tochnog.mat \ ${STAGEDIR}${GID_PTYPES}/tochnog.gid - ${INSTALL_SCRIPT} ${WRKDIR}/tochnog/gid/tochnog.gid/tochnog.ba* \ + ${INSTALL_SCRIPT} ${WRKDIR}/Sources/gid/tochnog.gid/tochnog.ba* \ ${STAGEDIR}${GID_PTYPES}/tochnog.gid .if ${PORT_OPTIONS:MEXAMPLES} ${MKDIR} ${STAGEDIR}${EXAMPLESDIR} - ${RM} -f ${WRKDIR}/tochnog/test/*.orig - ${INSTALL_DATA} ${WRKDIR}/tochnog/test/* ${STAGEDIR}${EXAMPLESDIR} + ${RM} -f ${WRKDIR}/Sources/test/*.orig + ${INSTALL_DATA} ${WRKDIR}/Sources/test/* ${STAGEDIR}${EXAMPLESDIR} .endif .include Index: head/cad/tochnog/distinfo =================================================================== --- head/cad/tochnog/distinfo (revision 349595) +++ head/cad/tochnog/distinfo (revision 349596) @@ -1,2 +1,8 @@ -SHA256 (tochnog_feb11_2001.tar.gz) = 0eb52942b9ba4ceae74e901defa74be7cba3594c7853f3ff9ce68adad725d0fa -SIZE (tochnog_feb11_2001.tar.gz) = 394486 +SHA256 (tochnog-20140100/Sources.zip) = 8f1cc04cd07526bbd942e4b246dc0e2f2af5d7920fc6e5d4b48a0bec4f175288 +SIZE (tochnog-20140100/Sources.zip) = 461522 +SHA256 (tochnog-20140100/gid.zip) = fd2bc5fe386b62a41bb95c10e7c78be57c6d3ae8c8c118d09b02f6b05a384d73 +SIZE (tochnog-20140100/gid.zip) = 6040 +SHA256 (tochnog-20140100/tools.zip) = 84d32721eae1b9602641901c51dee74343d92357758bfdf170f2440c8273dddf +SIZE (tochnog-20140100/tools.zip) = 3943 +SHA256 (tochnog-20140100/test.zip) = 94bd12cfb742be29e22f57a31f123a387232f25fa6a2f5d1859ad295745e5a87 +SIZE (tochnog-20140100/test.zip) = 205793 Index: head/cad/tochnog/files/patch-tnhypo.h =================================================================== --- head/cad/tochnog/files/patch-tnhypo.h (revision 349595) +++ head/cad/tochnog/files/patch-tnhypo.h (nonexistent) @@ -1,5 +0,0 @@ ---- tnhypo.h.orig Fri May 9 11:00:50 2003 -+++ tnhypo.h Fri May 9 11:01:12 2003 -@@ -1 +1 @@ --#define HYPO_USE 0 -+#define HYPO_USE 1 Property changes on: head/cad/tochnog/files/patch-tnhypo.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/cad/tochnog/files/patch-so_petsc.c =================================================================== --- head/cad/tochnog/files/patch-so_petsc.c (revision 349595) +++ head/cad/tochnog/files/patch-so_petsc.c (nonexistent) @@ -1,20 +0,0 @@ ---- so_petsc.c.orig Wed Jun 21 00:31:58 2006 -+++ so_petsc.c Wed Jun 21 00:33:30 2006 -@@ -21,14 +21,14 @@ - - #if PETSC_USE - --/* before version 2.2.29 of petsc use these two lines */ -+/* before version 2.2.29 of petsc use these two lines - #include "sles.h" - #include "mg.h" -+*/ - --/* version 2.2.29 and further of petsc use these two lines -+/* version 2.2.29 and further of petsc use these two lines */ - #include "petscsles.h" - #include "petscmg.h" --*/ - - extern double *solve_solution; - Property changes on: head/cad/tochnog/files/patch-so_petsc.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/cad/tochnog/files/patch-so_suplu.c =================================================================== --- head/cad/tochnog/files/patch-so_suplu.c (revision 349595) +++ head/cad/tochnog/files/patch-so_suplu.c (nonexistent) @@ -1,54 +0,0 @@ ---- so_suplu.c.orig Thu Nov 9 15:59:39 2000 -+++ so_suplu.c Sat Feb 4 20:21:59 2006 -@@ -22,14 +22,16 @@ - #if ( SUPERLU_USE || SUPERLU_MT_USE || SUPERLU_DIST_USE ) - - #if SUPERLU_USE --#include "dsp_defs.h" -+#include "slu_ddefs.h" - #elif SUPERLU_MT_USE -+#include "slu_mt_util.h" - #include "pdsp_defs.h" - #elif SUPERLU_DIST_USE - #include -+#include "superlu_util.h" - #include "superlu_ddefs.h" - #endif --#include "util.h" -+ - - long int solve_superlu( double *superlu_A, int *superlu_asub, - int *superlu_xa, int superlu_nnz, double solve_b[], long int solve_nlocal, -@@ -53,6 +55,10 @@ - int *perm_r, *perm_c; - int perm_spec; - int nrhs; -+#if SUPERLU_USE -+ SuperLUStat_t stat; -+ superlu_options_t options; -+#endif - #endif - - /* Create Matrix A in the format expected by SuperLU */ -@@ -94,8 +100,8 @@ - nrhs = 1; - #if ( SUPERLU_USE || SUPERLU_MT_USE ) - dCreate_Dense_Matrix( &B, n, nrhs, solve_b, n, DN, _D, GE ); -- if ( !(perm_r = intMalloc(1000+n)) ) ABORT("Not enough memory for SuperLU."); -- if ( !(perm_c = intMalloc(1000+n)) ) ABORT("Not enough memory for SuperLU."); -+ if ( !(perm_r = intMalloc(1000+n)) ) USER_ABORT("Not enough memory for SuperLU."); -+ if ( !(perm_c = intMalloc(1000+n)) ) USER_ABORT("Not enough memory for SuperLU."); - /* Get column permutation vector perm_c[] */ - perm_spec = 1; - get_perm_c( perm_spec, &A, perm_c ); -@@ -103,7 +109,9 @@ - - /* Solve */ - #if SUPERLU_USE -- dgssv( &A, perm_c, perm_r, &L, &U, &B, &info ); -+ /* Initialize the statistics variables. */ -+ StatInit(&stat); -+ dgssv(&options, &A, perm_c, perm_r, &L, &U, &B, &stat, &info ); - #elif SUPERLU_MT_USE - pdgssv( nthread, &A, perm_c, perm_r, &L, &U, &B, &info ); - #elif SUPERLU_DIST_USE Property changes on: head/cad/tochnog/files/patch-so_suplu.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/cad/tochnog/files/patch-makefile =================================================================== --- head/cad/tochnog/files/patch-makefile (revision 349595) +++ head/cad/tochnog/files/patch-makefile (revision 349596) @@ -1,99 +1,106 @@ ---- makefile.orig Sun Aug 19 19:31:52 2001 -+++ makefile Sun Aug 6 18:58:12 2006 -@@ -1,6 +1,7 @@ - # *********** fortran 2 c ******************* - # Set F2C (for unix -lf2c and for MS windows to f2c.lib) --F2C= +--- makefile.orig 2014-01-05 15:35:37.000000000 +0100 ++++ makefile 2014-03-09 22:07:32.000000000 +0100 +@@ -5,7 +5,8 @@ + #*********** fortran 2 c ******************* + # Set F2C (for unix -lf2c and for MS windows if using Visual C++ to f2c.lib) + +-F2C= -lf2c +F2C= -lf2c -L%%LOCALBASE%%/lib +F2C_INCLUDE= -I%%LOCALBASE%%/include - # *********** hypoplasticity **************** # For hypoplasticity: -@@ -8,8 +9,8 @@ - # set HYPO_USE to 1 in tnhypo.h - # set HYPO_SRC to hypo.c below - # set HYPO_OBJ to hypo.o below --HYPO_SRC=hypo_dum.c --HYPO_OBJ=hypo_dum.o -+HYPO_SRC=hypo.c -+HYPO_OBJ=hypo.o - - # *********** profiler *********************** - # for the gnu profiler, use as follows: -@@ -26,11 +27,11 @@ + # install f2c on your computer (also see F2C above) +@@ -30,11 +31,11 @@ SYS_FILE=sysother BCPP=-P VCPP= -COMPILER_C=bcc32 -COMPILER_CPP=bcc32 -COMPILER_FLAGS= -c -O2 -w- +COMPILER_C=$(CC) +COMPILER_CPP=$(CXX) +COMPILER_FLAGS=$(CFLAGS) -c OBJ=obj -LINK_FLAGS_BEFORE= -l$(F2C) +LINK_FLAGS_BEFORE= -l$(F2C) -L%%LOCALBASE%%/lib LINK_FLAGS_AFTER= # *********** SUPERLU library ******************* -@@ -39,9 +40,9 @@ - # Set SUPERLU_MT_USE to 1 in tnsuplu.h for the multi threaded version - # Set SUPERLU_DIST_USE to 1 in tnsuplu.h for the distributed MPI version - # 2. Activate and adjust the next three lines --# SUPERLU=/home/programs/src/SuperLU --# SUPERLU_LIB=$(SUPERLU)/superlu.a $(SUPERLU)/blas.a --# SUPERLU_INCLUDE=-I$(SUPERLU)/SRC +@@ -49,6 +50,9 @@ + # SUPERLU_INCLUDE=-I/Users/fdolorenzo/Downloads/petsc-3.4.2/arch-darwin-c-debug/include + # 3. For SuperLU_MT be sure to compile a multi threaded version + # of Tochnog (sparc_parallel, alpha_parallel, linux, etc. +SUPERLU=%%LOCALBASE%% +SUPERLU_LIB=$(SUPERLU)/lib/lib%%SUPERLU%%.a %%BLAS_LIBS%% +SUPERLU_INCLUDE=-I$(SUPERLU)/include/%%SUPERLU%% - # 3. For SuperLU_MT be sure to compile a multi threaded version - # of Tochnog (sparc_parallel, alpha_parallel, linux, etc.) -@@ -65,7 +66,7 @@ - ALL_LIB= $(PETSC_LIB) $(SUPERLU_LIB) $(F2C) + # *********** PetSc library ******************* + # Do NOT link together with the SUPERLU library +@@ -80,7 +84,7 @@ + ALL_LIB= $(LAPACK_LIB) $(BLAS_LIB) $(F2C) -lm $(PETSC_LIB) $(SUPERLU_LIB) # *********** default platform ******************* --default: linux_old +-default: darwin-intel +default: freebsd_old # single and multi-processor windows; borland c++ compiler # set SYS_FILE above to syswin32 for multi-processor -@@ -101,17 +102,22 @@ - "LINK_FLAGS_AFTER= /link $(F2C) $(PROFILE) /OUT:tochnog.exe" +@@ -130,17 +134,22 @@ + "LINK_FLAGS_AFTER=-g -v -dynamic -undefined dynamic_lookup $(ALL_LIB) $(PROFILE) -dynamic -lpthread -o tochnog" # single processor linux; gnu gcc compiler -linux_old: -+freebsd_old: - make tochnog \ +- make tochnog \ ++freebsd_old: ++ ${MAKE} tochnog \ "SYS_FILE=sysother" \ "OBJ=o" \ - "BCPP=" \ - "VCPP=" \ - "COMPILER_C=gcc" \ -- "COMPILER_CPP=g++" \ +- "COMPILER_CPP=g++-4.2" \ - "COMPILER_FLAGS= -ansi -c -O2 -Wall $(PROFILE) $(ALL_INCLUDE)" \ + "COMPILER_FLAGS= -c ${CFLAGS} ${CPPFLAGS} $(ALL_INCLUDE)" \ "LINK_FLAGS_BEFORE=" \ - "LINK_FLAGS_AFTER= $(PROFILE) $(ALL_LIB) -static -lm -o tochnog" -+ "LINK_FLAGS_AFTER= $(PROFILE) $(ALL_LIB) ${LDFLAGS} -lm -o tochnog" ++ "LINK_FLAGS_AFTER= $(PROFILE) $(ALL_LIB) ${LDFLAGS} -pthread -lm -o tochnog" + +# Multithreaded FreeBSD +freebsd_parallel: -+ make tochnog \ ++ ${MAKE} tochnog \ + "SYS_FILE=sysposix" \ + "OBJ=o" \ -+ "COMPILER_FLAGS= -c ${CFLAGS} ${CPPFLAGS} -D_REENTRANT $(ALL_INCLUDE)" \ ++ "COMPILER_FLAGS= -c ${CFLAGS} ${CPPFLAGS} -D_REENTRANT $(PTHREAD_CFLAGS) $(ALL_INCLUDE)" \ + "LINK_FLAGS_BEFORE=" \ -+ "LINK_FLAGS_AFTER= $(PROFILE) $(ALL_LIB) ${LDFLAGS} -pthread -lm -o tochnog" ++ "LINK_FLAGS_AFTER= $(PROFILE) $(ALL_LIB) ${LDFLAGS} $(PTHREAD_LIBS) -lm -o tochnog" # multi processor linux; gnu gcc compiler linux: -@@ -375,7 +381,7 @@ +@@ -289,7 +298,7 @@ + renumber.$(OBJ) repeat.$(OBJ) restart.$(OBJ) \ + slide.$(OBJ) \ + so.$(OBJ) so_bicg.$(OBJ) \ +- split.$(OBJ) \ ++ so_suplu.$(OBJ) split.$(OBJ) \ + spring.$(OBJ) stress.$(OBJ) \ + $(SYS_FILE).$(OBJ) tendon.$(OBJ) time.$(OBJ) tn.$(OBJ) \ + top.$(OBJ) truss.$(OBJ) \ +@@ -401,7 +410,7 @@ $(COMPILER_CPP) $(COMPILER_FLAGS) $(BCPP) $(VCPP)hyperela.$(SRC_CPP) $(HYPO_OBJ): $(HYPO_SRC) - $(COMPILER_C) $(COMPILER_FLAGS) $(HYPO_SRC) + $(COMPILER_C) $(COMPILER_FLAGS) $(HYPO_SRC) $(F2C_INCLUDE) hypoplas.$(OBJ): hypoplas.$(SRC_CPP) tochnog.h $(COMPILER_CPP) $(COMPILER_FLAGS) $(BCPP) $(VCPP)hypoplas.$(SRC_CPP) +@@ -565,6 +574,9 @@ + #so_petsc.$(OBJ): so_petsc.$(SRC_C) tochnog.h + # $(COMPILER_C) $(COMPILER_FLAGS) so_petsc.$(SRC_C) + ++so_suplu.$(OBJ): so_suplu.$(SRC_C) tochnog.h ++ $(COMPILER_C) $(COMPILER_FLAGS) so_suplu.$(SRC_C) ++ + split.$(OBJ): split.$(SRC_CPP) tochnog.h + $(COMPILER_CPP) $(COMPILER_FLAGS) $(BCPP) $(VCPP)split.$(SRC_CPP) + Index: head/cad/tochnog/files/patch-tn.cc =================================================================== --- head/cad/tochnog/files/patch-tn.cc (revision 349595) +++ head/cad/tochnog/files/patch-tn.cc (revision 349596) @@ -1,172 +1,175 @@ ---- tn.cc 2002/06/01 13:47:34 1.1 -+++ tn.cc 2002/07/25 14:32:17 1.2 -@@ -33,40 +33,145 @@ +--- tn.cc.orig 2013-08-16 01:47:35.000000000 +0200 ++++ tn.cc 2014-03-09 17:57:23.000000000 +0100 +@@ -33,6 +33,40 @@ int PetscFinalize(void); #endif +#include "getopt.h" + +bool enable_gid; +bool enable_test; + +struct option long_options [] = +{ + {"version", no_argument, NULL, 'v'}, + {"help", no_argument, NULL, 'h'}, + {"gid", no_argument, NULL, 'G'}, + {"test", no_argument, NULL, 't'}, // Not yet implemented + {NULL, 0, 0, 0} +}; + +int usage () +{ + cout << "Usage: tochnog [options]\n" + "or: tochnog [options] file.dat\n" + "or: tochnog [options] file.dat > file.out\n\n" + "options: --version print the version of the tochnog program\n" + " --help print a short options overview and exit\n" + " --gid generate the files necessary for GID interaction\n" + " --test notify if target_item/_value could be meet\n" + " (not very usefull now)\n"; + return 1; +} + +int version () +{ + cout << TOCHNOG_VERSION << '\n'; + return 1; +} + ++ int main( int argc, char* argv[] ) { +@@ -40,37 +74,107 @@ + Time CPU; + CPU.firsttime=CPU.taketime(); + - long int i=0, l=0, any_point=0; -+ + extern char *optarg; + extern int optind, opterr, optopt; -+ ++ + int opt_index, option, error_count = 0; + bool print_usage = false, print_version = false; + + size_t i=0, l=0, s_len=0, any_point=0; // initialise static variables initialize(); // test arguments + while ((option = getopt_long (argc, argv, "hvGt", long_options, &opt_index)) + != EOF) + { + switch (option) + { + // Options without argument + + case 'h': // print a short help message and exit + print_usage = true; + break; -+ case 'v': // print the version string and exit ++ case 'v': // print the version string and exit + print_version = true; + break; -+ case 'G': // use the *flavia* for interaction with gid ++ case 'G': // use the *flavia* for interaction with gid + enable_gid = true; + break; -+ case 't': // use the *flavia* for interaction with gid ++ case 't': // use the *flavia* for interaction with gid + enable_test = true; + break; + // Options with 1 argument + default: + cerr << "tochnog: unrecognized option " << optarg << '\n'; + error_count++; + } + } + + if (error_count > 0) + { + cerr << "Try tochnog --help for more information"; -+ exit(TN_EXIT_STATUS); ++ exit(TN_EXIT_STATUS); + } + + if (print_usage) + { + usage(); + } + if (print_version || print_usage) + { + version(); + exit(TN_EXIT_STATUS); + } + + // No comand argument + + if (argc == optind) + { + strncpy( data_file, "tn.dat", 6 ); + } + + // 1 command line argument, should be input file name + + else if (argc == optind + 1) + { + s_len = strlen (argv[optind]); + strncpy(data_file, argv[optind], s_len); + + // Check if input file name containes already ".dat" suffix + + if (strncmp(&data_file[s_len - 4], ".dat", 4) != 0) + { + + // to preserve compatibility + + if (strncmp(&data_file[s_len - 4], ".dbs", 4) != 0) + { + strncpy(data_file_base, data_file, s_len); + strncpy(&data_file[s_len], ".dat", 4); + } + else + { + strncpy(data_file_base, data_file, s_len - 4); + } + } + else + { + // to preserve compatibility + + strncpy(data_file_base, data_file, s_len - 4); + } + } + else + { + usage(); + exit(TN_EXIT_STATUS); + } + #if MPI_USE strcpy( data_file, "tn.dat" ); -#else - if ( argc==1 ) strcpy( data_file, "tn.dat" ); - else if ( argc==2 ) strcpy( data_file, argv[1] ); - else { - pri( "Usage: tochnog" ); - pri( "or: tochnog file.dat" ); - pri( "or: tochnog file.dat > file.out" ); - exit(TN_EXIT_STATUS); - } -#endif - - // append .dat to input file name - l = strlen( data_file ); - strcpy( data_file_base, "" ); - for ( i=0; i -+// C++ headers -+#include -+#include -+#include -+using namespace std; -+ -+// C headers - #include - #include - #include --#include --#include - #include - #include - #include -@@ -49,6 +53,8 @@ +--- tochnog.h.orig 2013-10-12 05:33:16.000000000 +0200 ++++ tochnog.h 2014-03-09 18:16:04.000000000 +0100 +@@ -58,6 +58,8 @@ MVERSION // maximum number of versions, this must be the last item }; -+#define TOCHNOG_VERSION "July_25_2002" ++#define TOCHNOG_VERSION "Latest-jan-2014" + // constants #define MCHAR 100 // maximum length of names #define MDIM 3 // maximum number of space dimensions Index: head/cad/tochnog/pkg-plist =================================================================== --- head/cad/tochnog/pkg-plist (revision 349595) +++ head/cad/tochnog/pkg-plist (revision 349596) @@ -1,216 +1,216 @@ bin/aba2tn bin/tochnog bin/gmsh2tn.awk -bin/mkansys.awk -bin/mkgmsh.awk %%GIDDIR%%/problemtypes/tochnog.gid/tochnog.bas %%GIDDIR%%/problemtypes/tochnog.gid/tochnog.bat %%GIDDIR%%/problemtypes/tochnog.gid/tochnog.cnd %%GIDDIR%%/problemtypes/tochnog.gid/tochnog.mat -@dirrm %%GIDDIR%%/problemtypes/tochnog.gid -@dirrm %%GIDDIR%%/problemtypes -@dirrm %%GIDDIR%% %%PORTEXAMPLES%%%%EXAMPLESDIR%%/absorp1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/axisym1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/axisym2.dat +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/axisym2.dbs +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/axisym2.flavia.msh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/axisym2.flavia.res %%PORTEXAMPLES%%%%EXAMPLESDIR%%/axisym3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/axisym4.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/axisym5.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/beam2d.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/beam2d_1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/beam2d_2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/beam3d.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/bimet1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/blatz1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/calcul1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/calcul2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/condif1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/condif10.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/condif2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/condif3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/condif5.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/condif6.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/condif7.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/condif8.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/condif9.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/conspr1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/conspr2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/conspr3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/conspr4.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/contac1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/contac2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/contac3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/contac4.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/convec1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/convec2.dat -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/crack1.dat -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/crack2.dat -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/crack3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/ctvmis1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/ctvmis2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/damage1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/dataput1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/delete1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/dens1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/depend1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/diprisc1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/disk1.dat -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/disk2a.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/distri1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/druckpr1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/eigen1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/eigen3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/elasti1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/elasti2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/elasti3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/elasti4.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp10.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp11.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp12.dat -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp13.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp14.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp15.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp16.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp17.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp18.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp19.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp20.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp22.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp23.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp24.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp4.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp5.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp6.dat +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp6.dbs +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp6.flavia.msh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp6.flavia.res %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp7.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp8.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/examp9.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/expans1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/expans2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/force1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/force2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/force3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/force4.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/force5.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/genera1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/genera2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/ground1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/ground2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/ground3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/ho_heat1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/ho_heat2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/ho_mech1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/ho_mech2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/ho_mech3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/ho_mech4.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/ho_othr1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/ho_othr2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/ho_othr3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/ho_othr4.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/hypo1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/hypo2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/hypo3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/hypo4.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/incnav1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/incnav2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/incnav3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/incnav4.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/incnav5.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/interac1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/inver1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/inver2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/inver3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/makefile %%PORTEXAMPLES%%%%EXAMPLESDIR%%/matrix1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/matrix2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/matrix3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/matrix4.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/matrix5.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/matrix6.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/matrix7.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/matrix8.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/matrix9.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/membran1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/membran2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/merge1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/mohrcou1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/mohrcou2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/mohrcou3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/mohrcou4.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/nodfor1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/petsc1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/post1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/post2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/post3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/post4.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/post5.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/post6.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/pridbs.dat +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/pruebavel.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/radiate1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/radiate2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/refine1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/refine2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/refine3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/refine4.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/refine5.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/remesh1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/repeat1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/repeat2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/silo1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/skip1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/slide1.dat -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/slope.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/soften1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/spring1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/spring2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/spring3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/spring4.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/spring5.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/strconv1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/taylor3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/temp1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/temp2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/temp3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/temp4.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/temp5.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/tendon1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/tendon10.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/tendon2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/tendon3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/tendon4.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/tendon6.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/tendon7.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/tendon8.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/tension1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/tet10.dat +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/tn.dvd %%PORTEXAMPLES%%%%EXAMPLESDIR%%/total1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/total2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/total3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/transv1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/tria6.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/trubea1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/trubea2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/trubea3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/trubea4.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/truss1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/truss2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/truss3.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/truss4.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/truss5.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/truss6.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/truss7.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/trussbea.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/tube1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/update1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/visc_pl1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/visc_pl2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/viscel1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/viscos1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/volume1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/volume2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/vonmis1.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/vonmis2.dat %%PORTEXAMPLES%%%%EXAMPLESDIR%%/wave1.dat %%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%% +@dirrm %%GIDDIR%%/problemtypes/tochnog.gid +@dirrm %%GIDDIR%%/problemtypes +@dirrm %%GIDDIR%%