Changeset 13101
- Timestamp:
- 08/20/12 17:39:30 (13 years ago)
- Location:
- issm/branches/trunk-jpl-damage
- Files:
-
- 17 deleted
- 492 edited
- 44 copied
Legend:
- Unmodified
- Added
- Removed
-
issm/branches/trunk-jpl-damage
- Property svn:ignore
-
old new 1 projects 1 2 autom4te.cache 2 3 aclocal.m4
-
- Property svn:mergeinfo changed
/issm/trunk-jpl merged: 12948-13099
- Property svn:ignore
-
issm/branches/trunk-jpl-damage/Makefile.am
r12878 r13101 1 1 EXTRA_DIST = reconf scripts test m4 examples cron etc doc packages contributors.txt 2 SUBDIRS = src bin2 SUBDIRS = src 3 3 bin_SCRIPTS=config.h startup.m README.rtf 4 5 ACLOCAL_AMFLAGS = -I externalpackages/libtool/install/share/aclocal -
issm/branches/trunk-jpl-damage/configs/config-macosx64-larour-ad.sh
r12878 r13101 3 3 ./configure \ 4 4 --prefix=$ISSM_DIR \ 5 --without-modules\ 6 --without-thermal \ 7 --without-control \ 8 --without-hydrology \ 9 --without-diagnostic \ 10 --without-balanced \ 11 --without-responses \ 12 --without-slope \ 13 --without-rifts \ 14 --without-steadystate \ 15 --without-transient \ 16 --without-3d \ 17 --without-groundingline \ 5 --without-modules \ 18 6 --without-kriging \ 19 --with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install 20 #--with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install\7 --with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install \ 8 --with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install -
issm/branches/trunk-jpl-damage/configure.ac
r12946 r13101 4 4 AC_INIT([ISSM],[4.2.1],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure 5 5 AC_CONFIG_AUX_DIR([./aux-config]) #Put config files in aux-config 6 AC_CONFIG_MACRO_DIR([m4]) #m4 macros are located in m4 6 AC_CONFIG_MACRO_DIR([externalpackages/libtool/install/share/aclocal]) #m4 macros are located in m4 7 m4_include([m4/issm_options.m4]) 7 8 AC_CANONICAL_TARGET #Determine the system type 9 8 10 #Compilers 9 11 AC_PROG_CC([cccl cl icl gcc]) … … 11 13 AC_PROG_CXX([cccl cl icl g++]) 12 14 AC_PROG_F77([ifort g77 gfortran]) 15 13 16 #Libraries and linking 14 17 AC_F77_LIBRARY_LDFLAGS … … 22 25 AM_PROG_CC_C_O 23 26 AM_PROG_AR 24 AC_PROG_RANLIB25 27 26 # To produce shared libraries uncomment LT_INIT. In theory, Libtool can be initialized 27 # even if all linking is static, since, if not shared libraries are to be produce, libtool 28 # will act simply as a wrapper around AR and Ranlib. 29 #LT_INIT 28 #Libtool 29 LT_INIT 30 30 31 31 #Run issm_options.m4 … … 36 36 src/Makefile 37 37 src/c/Makefile 38 src/py/Makefile39 src/py/model/Makefile40 38 src/modules/Makefile 41 39 src/modules/python/Makefile 42 40 src/modules/matlab/Makefile 43 src/m/Makefile 44 bin/Makefile]) 41 src/m/Makefile]) 45 42 46 43 #End of configure.ac -
issm/branches/trunk-jpl-damage/etc/environment.csh
r12878 r13101 1 1 #ISSM_DIR and ISSM_ARCH should have been defined already in your shell settings file (.bashrc, .cshrc, etc ...) 2 source $ISSM_DIR/etc/environment_variables.csh3 2 4 #Do we have any command line arguments? (such as MATLAB_DIR=otherdirthandefault), source them before exporting the variables 5 #to environment. 6 7 #foreach i ($@) 8 #eval $i 9 #end 10 11 #CRON utilities 12 setenv PATH {$PATH}:{$ISSM_DIR}/cron 13 14 #SCRIPTS utilities 3 #Load ISSM scripts 15 4 setenv PATH {$PATH}:{$ISSM_DIR}/scripts 16 5 17 6 #MATLAB 18 setenv MATLAB_DIR {$MATLAB_DIR} 19 setenv PATH {$MATLAB_DIR}/bin:{$PATH} 20 setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$MATLAB_DIR/lib 7 set MATLAB_DIR="$ISSM_DIR/externalpackages/matlab/install" 8 if (-d MATLAB_DIR) then 9 setenv MATLAB_DIR {$MATLAB_DIR} 10 setenv PATH {$MATLAB_DIR}/bin:{$PATH} 11 setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$MATLAB_DIR}/bin/glnxa64 12 endif 21 13 22 14 #MPI 23 setenv MPI_DIR {$MPI_DIR} 24 setenv PATH {$MPI_DIR}/bin:{$PATH} 25 setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$MPI_DIR/lib 26 setenv MANPATH {$MANPATH}:$MPI_DIR/man 27 setenv MPIRUN_NPROCS 8 15 set MPI_DIR="$ISSM_DIR/externalpackages/mpich2/install" 16 if (-d $MPI_DIR) then 17 setenv MPI_DIR {$MPI_DIR} 18 setenv PATH {$MPI_DIR}/bin:{$PATH} 19 setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$MPI_DIR/lib 20 setenv MANPATH {$MANPATH}:$MPI_DIR/man 21 endif 28 22 29 23 #PETSC 30 setenv PETSC_DIR {$PETSC_DIR} 31 setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$PETSC_DIR/lib/{$ISSM_ARCH} 24 set PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install" 25 if (-d $PETSC_DIR) then 26 setenv PETSC_DIR {$PETSC_DIR} 27 setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$PETSC_DIR/lib/{$ISSM_ARCH} 28 endif 32 29 33 30 #SLEPC 34 setenv SLEPC_DIR {$SLEPC_DIR} 35 setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$SLEPC_DIR/lib/{$ISSM_ARCH} 31 set SLEPC_DIR="$ISSM_DIR/externalpackages/slepc/install" 32 if (-d $SLEPC_DIR) then 33 setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$SLEPC_DIR/lib/{$ISSM_ARCH} 34 endif 36 35 36 #PETSC 37 set TAO_DIR="$ISSM_DIR/externalpackages/tao/install" 38 if (-d $TAO_DIR) then 39 setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$TAO_DIR/lib/{$ISSM_ARCH} 40 endif 37 41 38 42 #Dakota 39 setenv DAKOTA_DIR {$DAKOTA_DIR} 40 setenv PATH {$PATH}:{$DAKOTA_DIR}/bin 41 setenv MANPATH {$MANPATH}:{$MPI_DIR}/man:{$DAKOTA_DIR}/docs/man:{$DAKOTA_DIR}/docs/man-ref 42 43 #Qhull 44 setenv QHULL_DIR {$QHULL_DIR} 45 setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$QHULL_DIR}/lib 46 43 set DAKOTA_DIR="$ISSM_DIR/externalpackages/dakota/install" 44 if (-d $DAKOTA_DIR) then 45 setenv PATH {$PATH}:{$DAKOTA_DIR}/bin 46 setenv MANPATH {$MANPATH}:{$MPI_DIR}/man:{$DAKOTA_DIR}/docs/man:{$DAKOTA_DIR}/docs/man-ref 47 endif 47 48 48 49 #Doxygen 49 setenv DOXYGEN_DIR {$DOXYGEN_DIR} 50 setenv MANPATH {$MANPATH}:{$DOXYGEN_DIR}/man 51 setenv PATH {$PATH}:{$DOXYGEN_DIR}/bin 52 53 #MTOC 54 setenv MTOC_DIR {$MTOC_DIR} 55 setenv PATH {$PATH}:{$MTOC_DIR} 56 57 #MATLAB 58 setenv MATLAB_DIR {$MATLAB_DIR} 59 setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$MATLAB_DIR}/bin/glnxa64 60 setenv PATH {$PATH}:{$MATLAB_DIR}/bin 61 62 #TRIANGLE 63 setenv TRIANGLE_DIR {$TRIANGLE_DIR} 64 65 #METIS 66 setenv METIS_DIR {$METIS_DIR} 67 68 #BLAS 69 setenv BLAS_DIR {$BLAS_DIR} 70 71 #LAPACK 72 setenv LAPACK_DIR {$LAPACK_DIR} 73 74 #SCALAPACK 75 setenv SCALAPACK_DIR {$SCALAPACK_DIR} 76 77 #PLAPACK 78 setenv PLAPACK_DIR {$PLAPACK_DIR} 79 80 #BLACS 81 setenv BLACS_DIR {$BLACS_DIR} 82 83 #YAMS 84 setenv YAMS_DIR {$YAMS_DIR} 85 setenv PATH {$PATH}:{$YAMS_DIR} 86 87 #TEX2IM 88 setenv TEX2IM_DIR {$TEX2IM_DIR} 89 setenv PATH {$PATH}:{$TEX2IM_DIR} 90 91 #SOWING 92 setenv SOWING_DIR {$SOWING_DIR} 93 setenv PATH {$PATH}:{$SOWING_DIR}/bin 94 setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$SOWING_DIR}/lib 95 setenv MANPATH {$MANPATH}:{$SOWING_DIR}/man 96 97 #Chaco 98 setenv CHACO_DIR {$CHACO_DIR} 99 setenv PATH {$PATH}:{$CHACO_DIR} 100 101 #MeshPart 102 setenv MESHPART_DIR {$MESHPART_DIR} 103 setenv PATH {$PATH}:{$MESHPART_DIR} 104 105 #SCOTCH 106 setenv SCOTCH_DIR {$SCOTCH_DIR} 107 setenv PATH {$PATH}:{$SCOTCH_DIR} 108 setenv MANPATH {$MANPATH}:{$SCOTCH_DIR}/man 50 set DOXYGEN_DIR="$ISSM_DIR/externalpackages/doxygen/install" 51 if (-d $DOXYGEN_DIR) then 52 setenv MANPATH {$MANPATH}:{$DOXYGEN_DIR}/man 53 setenv PATH {$PATH}:{$DOXYGEN_DIR}/bin 54 endif 109 55 110 56 #AUTOCONF 111 setenv AUTOCONF_DIR {$AUTOCONF_DIR} 112 setenv PATH {$AUTOCONF_DIR}/bin:{$PATH} 57 set AUTOCONF_DIR="$ISSM_DIR/externalpackages/autoconf/install" 58 if (-d $AUTOCONF_DIR) then 59 setenv PATH {$AUTOCONF_DIR}/bin:{$PATH} 60 endif 113 61 114 62 #AUTOMAKE 115 setenv AUTOMAKE_DIR {$AUTOMAKE_DIR} 116 setenv PATH {$AUTOMAKE_DIR}/bin:{$PATH} 117 118 #BORLAND 119 setenv BORLAND_DIR {$BORLAND_DIR} 120 setenv PATH {$PATH}:{$BORLAND_DIR}/Bin 63 set AUTOMAKE_DIR="$ISSM_DIR/externalpackages/automake/install" 64 if (-d $AUTOMAKE_DIR) then 65 setenv PATH {$AUTOMAKE_DIR}/bin:{$PATH} 66 endif 121 67 122 68 #SSH 123 setenv SSH_DIR {$SSH_DIR} 124 setenv PATH {$PATH}:{$SSH_DIR} 69 set SSH_DIR="$ISSM_DIR/externalpackages/ssh" 70 if (-d $SSH_DIR) then 71 setenv PATH {$PATH}:{$SSH_DIR} 72 endif 125 73 126 74 #VALGRIND 127 setenv VALGRIND_DIR {$VALGRIND_DIR} 128 setenv PATH {$PATH}:{$VALGRIND_DIR} 75 set VALGRIND_DIR="$ISSM_DIR/externalpackages/valgrind/install/bin" 76 if (-d $VALGRIND_DIR) then 77 setenv PATH {$PATH}:{$VALGRIND_DIR} 78 endif 129 79 130 80 #MERCURIAL 131 #setenv PYTHONPATH {$PYTHONPATH}:{$MERCURIAL_DIR}/mercurial/pure/ 132 setenv PYTHONPATH {$MERCURIAL_DIR}/mercurial/pure/ 133 setenv PATH {$PATH}:{$MERCURIAL_DIR} 81 set MERCURIAL_DIR="$ISSM_DIR/externalpackages/mercurial/install" 82 if (-d $MERCURIAL_DIR) then 83 setenv PYTHONPATH {$MERCURIAL_DIR}/mercurial/pure/ 84 setenv PATH {$PATH}:{$MERCURIAL_DIR} 85 endif 134 86 135 87 #GSL 136 setenv GSL_DIR {$GSL_DIR} 137 setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$GSL_DIR}/lib 88 set GSL_DIR="$ISSM_DIR/externalpackages/gsl/install" 89 if (-d $GSL_DIR) then 90 setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$GSL_DIR}/lib 91 endif 138 92 139 93 #CMAKE 140 setenv PATH {$PATH}:{$CMAKE_DIR}/bin 94 set CMAKE_DIR="$ISSM_DIR/externalpackages/cmake/install" 95 if (-d $CMAKE_DIR) then 96 setenv PATH {$PATH}:{$CMAKE_DIR}/bin 97 endif -
issm/branches/trunk-jpl-damage/etc/environment.sh
r12946 r13101 1 1 #ISSM_DIR and ISSM_ARCH should have been defined already in your shell settings file (.bashrc, .cshrc, etc ...) 2 3 #FIXME: during installation packages are installed one by one but environment.sh was sourced 4 #before so new packages are NOT in the path. 5 #may resource environment.sh with: 6 #if [ -z $(echo "$PATH" | grep "$MATLAB_DIR") ]; then export $PATH...; fi 2 7 3 8 #Windows compilers: … … 6 11 fi 7 12 8 source $ISSM_DIR/etc/environment_variables.sh 9 10 #Do we have any command line arguments? (such as MATLAB_DIR=otherdirthandefault), source them after exporting the variables 11 #to environment. 12 for i in $@ 13 do 14 eval $i 15 done 16 17 #CRON utilities 18 PATH="$PATH:$ISSM_DIR/cron" 19 20 #scripts 21 PATH="$PATH:$ISSM_DIR/scripts" 22 23 ##MATLAB 24 export MATLAB_DIR 25 PATH="$MATLAB_DIR/bin:$PATH" #take precedence over /usr/local/bin/matlab 26 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$MATLAB_DIR/lib" 27 export LD_RUN_PATH="$LD_RUN_PATH:$MATLAB_DIR/lib" 28 #export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$MATLAB_DIR/bin/glnxa64" 29 #export LD_RUN_PATH="$LD_RUN_PATH:$MATLAB_DIR/bin/glnxa64" 30 31 #MPI 32 export MPI_DIR 33 PATH="$MPI_DIR/bin:$PATH" 34 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$MPI_DIR/lib" 35 export LD_RUN_PATH="$LD_RUN_PATH:$MPI_DIR/lib" 36 export MANPATH="$MANPATH:$MPI_DIR/man" 37 export MPIRUN_NPROCS=24 38 39 #PETSC 40 export PETSC_DIR 41 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PETSC_DIR/lib/$ISSM_ARCH:$PETSC_DIR/lib" 42 export LD_RUN_PATH="$LD_RUN_PATH:$PETSC_DIR/lib/$ISSM_ARCH" 43 44 #SLEPC 45 export SLEPC_DIR 46 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SLEPC_DIR/lib/$ISSM_ARCH" 47 export LD_RUN_PATH="$LD_RUN_PATH:$SLEPC_DIR/lib/$ISSM_ARCH" 48 49 #Dakota 50 export DAKOTA_DIR 51 PATH="$PATH:$DAKOTA_DIR/bin" 52 export MANPATH="$MANPATH:$MPI_DIR/man:$DAKOTA_DIR/docs/man:$DAKOTA_DIR/docs/man-ref" 53 54 #Qhull 55 export QHULL_DIR 56 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$QHULL_DIR/lib" 57 export LD_RUN_PATH="$LD_RUN_PATH:$QHULL_DIR/lib" 58 59 #Doxygen 60 export DOXYGEN_DIR 61 MANPATH="$MANPATH:$DOXYGEN_DIR/man" 62 PATH="$PATH:$DOXYGEN_DIR/bin" 63 64 #MTOC 65 export MTOC_DIR 66 PATH="$PATH:$MTOC_DIR" 67 68 #TRIANGLE 69 export TRIANGLE_DIR 70 71 #METIS 72 export METIS_DIR 73 74 #BLAS 75 export BLAS_DIR 76 77 #LAPACK 78 export LAPACK_DIR 79 80 #SCALAPACK 81 export SCALAPACK_DIR 82 83 #PLAPACK 84 export PLAPACK_DIR 85 86 #BLACS 87 export BLACS_DIR 88 89 #YAMS 90 export YAMS_DIR 91 PATH="$PATH:$YAMS_DIR" 92 93 #BAMG 94 export BAMG_DIR 95 PATH="$PATH:$BAMG_DIR" 96 97 #TEX2IM 98 export TEX2IM_DIR 99 PATH="$PATH:$TEX2IM_DIR" 100 101 #SOWING 102 export SOWING_DIR 103 PATH="$PATH:$SOWING_DIR/bin" 104 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SOWING_DIR/lib" 105 export LD_RUN_PATH="$LD_RUN_PATH:$SOWING_DIR/lib" 106 export MANPATH="$MANPATH:$SOWING_DIR/man" 107 108 #Chaco 109 export CHACO_DIR 110 PATH="$PATH:$CHACO_DIR" 111 112 #MeshPart 113 export MESHPART_DIR 114 PATH="$PATH:$MESHPART_DIR" 115 116 #SCOTCH 117 export SCOTCH_DIR 118 PATH="$PATH:$SCOTCH_DIR" 119 export MANPATH="$MANPATH:$SCOTCH_DIR/man" 120 121 #AUTOCONF 122 export AUTOCONF_DIR 123 PATH="$AUTOCONF_DIR/bin:$PATH" 124 125 #AUTOMAKE 126 export AUTOMAKE_DIR 127 PATH="$AUTOMAKE_DIR/bin:$PATH" 128 129 export LIBTOOL_DIR 130 PATH="$LIBTOOL_DIR/bin:$PATH" 131 132 #BORLAND 133 export BORLAND_DIR 134 PATH="$PATH:$BORLAND_DIR/Bin" 135 136 #INTEL 137 #export INTEL_DIR 138 #PATH="$PATH:$INTEL_DIR" 139 #source $ISSM_DIR/externalpackages/intel/intel.sh 140 141 #SDK 142 export SDK_DIR 143 PATH="$PATH:$SDK_DIR" 144 145 #SSH 146 export SSH_DIR 147 PATH="$PATH:$SSH_DIR" 148 149 #VALGRIND 150 export VALGRIND_DIR 151 PATH="$PATH:$VALGRIND_DIR" 152 153 #GRAPHVIZ 154 export GRAPHVIZ_DIR 155 PATH="$PATH:$GRAPHVIZ_DIR" 156 157 #CPPCHECK 158 export CPPCHECK_DIR 159 PATH="$PATH:$CPPCHECK_DIR" 160 161 #GDAL 162 export GDAL_DIR 163 PATH="$GDAL_DIR/bin:$PATH" 164 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$GDAL_DIR/lib" 165 166 #MERCURIAL 167 export PYTHONPATH="$PYTHONPATH:$MERCURIAL_DIR/mercurial/pure/" 168 export PATH="$PATH:$MERCURIAL_DIR/" 169 170 #BOOST 171 export BOOSTROOT 172 export BOOST_DIR 173 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$BOOST_DIR/lib" 174 export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$BOOST_DIR/lib" 175 export PATH="$PATH:$BOOST_DIR/bin" 176 177 #XERCES 178 export XERCESROOT 179 export XERCESCROOT 180 181 #xaifBooster 182 export XAIFBOOSTERROOT 183 export XAIFBOOSTER_HOME 184 export XAIF_DIR 185 export PLATFORM 186 187 #angel 188 export ANGELROOT 189 190 #openanalysis 191 export OPENANALYSISROOT 192 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$OPENANALYSISROOT/lib" 193 194 #JAVA 195 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$JVM_DIR" 196 197 #BBFTP 198 export PATH="$PATH:$BBFTP_DIR/bin" 199 200 #ADIC 201 export PATH="$PATH:$ADIC_DIR/bin" 202 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$ADIC_DIR/lib" 203 export LD_RUN_PATH="$LD_RUN_PATH:$ADIC_DIR/lib" 204 205 #COLPACK 206 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$COLPACK_DIR/lib" 207 export LD_RUN_PATH="$LD_RUN_PATH:$COLPACK_DIR/lib" 208 209 #ECLIPSE 210 export PATH="$PATH:$ECLIPSE_DIR" 211 212 #FLAIM 213 export FLAIM_DIR 214 215 #APPSCAN 216 export PATH="$PATH:$APPSCAN_DIR/install/bin" 217 export PATH="$PATH:$APPSCAN_DIR/bin" 218 219 #CPPCHECK 220 export PATH="$PATH:$CPPCHECK_DIR/bin" 221 222 #RATS 223 export PATH="$PATH:$RATS_DIR/bin" 224 225 #DYSON 226 export PATH="$PATH:$DYSON_DIR" 227 228 #CMAKE 229 export PATH="$PATH:$CMAKE_DIR/bin" 230 231 #SHAPELIB 232 export PATH="$PATH:$SHAPELIB_DIR/exec" 233 234 #CCCL 235 export PATH="$PATH:$CCCL_DIR/bin" 236 237 #PACKAGEMAKER 238 export PATH="$PATH:$PACKAGEMAKER_DIR" 239 240 #ANDROID_NDK: 241 export ANDROID_NDK_DIR 242 export PATH="$PATH:$ANDROID_NDK_DIR/" 243 244 #ANDROID_DIR 245 export ANDROID_DIR 246 247 #ANDROID_SDK 248 export PATH="$PATH:$ANDROID_SDK_DIR/" 249 250 #ANDROID_ANT 251 export PATH="$PATH:$ANDROID_ANT_DIR/" 252 253 #GSL 254 export PATH="$PATH:$GSL_DIR/bin" 255 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$GSL_DIR/lib" 256 export LD_RUN_PATH="$LD_RUN_PATH:$GSL_DIR/lib" 257 258 #GMAKE 259 export PATH="$GMAKE_DIR/bin:$PATH" 260 261 #PYTHON 262 export PATH="$PYTHON_DIR/bin:$PATH" 263 export PYTHONPATH="$PYTHONPATH:$ISSM_DIR/src/modules/python" 264 export LD_LIBRARY_PATH=$ISSM_DIR/src/modules/python:$ISSM_DIR/externalpackages/python/install/lib:$LD_LIBRARY_PATH 265 export PYTHONSTARTUP 266 267 #MODELE 268 export PATH="$MODELE_DIR/src/exec:$PATH" 269 270 #GIT 271 export PATH="$PATH:$GIT_DIR/install/bin" 272 273 #NCVIEW 274 export PATH="$PATH:$NCVIEW_DIR/install" 275 276 #TCLX 277 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$TCLX_DIR" 278 export LD_RUN_PATH="$LD_RUN_PATH:$TCLX_DIR" 279 280 #TCL/TK 13 #Some basic path, in case it is not included by default 281 14 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" 282 15 export LD_RUN_PATH="$LD_RUN_PATH:/usr/local/lib" 283 16 17 #Load ISSM scripts 18 export PATH="$PATH:$ISSM_DIR/scripts" 19 20 #MATLAB 21 MATLAB_DIR="$ISSM_DIR/externalpackages/matlab/install" 22 #if [ -d "$MATLAB_DIR" ]; then 23 export MATLAB_DIR 24 export PATH="$MATLAB_DIR/bin:$PATH" #take precedence over /usr/local/bin/matlab 25 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$MATLAB_DIR/lib" 26 export LD_RUN_PATH="$LD_RUN_PATH:$MATLAB_DIR/lib" 27 #fi 28 29 #MPI 30 MPI_DIR="$ISSM_DIR/externalpackages/mpich2/install" 31 #if [ -d "$MPI_DIR" ]; then 32 export MPI_DIR 33 export PATH="$MPI_DIR/bin:$PATH" 34 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$MPI_DIR/lib" 35 export LD_RUN_PATH="$LD_RUN_PATH:$MPI_DIR/lib" 36 export MANPATH="$MANPATH:$MPI_DIR/man" 37 #fi 38 39 #PETSC 40 PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install" 41 #if [ -d "$PETSC_DIR" ]; then 42 export PETSC_DIR 43 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PETSC_DIR/lib:$PETSC_DIR/lib" 44 export LD_RUN_PATH="$LD_RUN_PATH:$PETSC_DIR/lib" 45 #fi 46 47 #SLEPC 48 SLEPC_DIR="$ISSM_DIR/externalpackages/slepc/install" 49 if [ -d "$SLEPC_DIR" ]; then 50 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SLEPC_DIR/lib/$ISSM_ARCH" 51 export LD_RUN_PATH="$LD_RUN_PATH:$SLEPC_DIR/lib/$ISSM_ARCH" 52 fi 53 54 #PETSC 55 TAO_DIR="$ISSM_DIR/externalpackages/tao/install" 56 if [ -d "$TAO_DIR" ]; then 57 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$TAO_DIR/lib:$TAO_DIR/lib" 58 export LD_RUN_PATH="$LD_RUN_PATH:$TAO_DIR/lib" 59 fi 60 61 #Dakota 62 DAKOTA_DIR="$ISSM_DIR/externalpackages/dakota/install" 63 if [ -d "$DAKOTA_DIR" ]; then 64 export PATH="$PATH:$DAKOTA_DIR/bin" 65 export MANPATH="$MANPATH:$MPI_DIR/man:$DAKOTA_DIR/docs/man:$DAKOTA_DIR/docs/man-ref" 66 fi 67 68 #Doxygen 69 DOXYGEN_DIR="$ISSM_DIR/externalpackages/doxygen/install" 70 if [ -d "$DOXYGEN_DIR" ]; then 71 export MANPATH="$MANPATH:$DOXYGEN_DIR/man" 72 export PATH="$PATH:$DOXYGEN_DIR/bin" 73 fi 74 75 #AUTOCONF 76 AUTOCONF_DIR="$ISSM_DIR/externalpackages/autoconf/install" 77 #if [ -d "$AUTOCONF_DIR" ]; then 78 export PATH="$AUTOCONF_DIR/bin:$PATH" 79 #fi 80 81 #AUTOMAKE 82 AUTOMAKE_DIR="$ISSM_DIR/externalpackages/automake/install" 83 #if [ -d "$AUTOMAKE_DIR" ]; then 84 export PATH="$AUTOMAKE_DIR/bin:$PATH" 85 #fi 86 87 #LIBTOOL 88 LIBTOOL_DIR="$ISSM_DIR/externalpackages/libtool/install" 89 #if [ -d "$LIBTOOL_DIR" ]; then 90 export PATH="$LIBTOOL_DIR/bin:$PATH" 91 #fi 92 93 #SDK 94 SDK_DIR="C:/MicrosoftVisualStudio 9.0/Microsoft Visual C++ 2008 Express Edition with SP1 - ENU" 95 if [ -d "$SDK_DIR" ]; then 96 export PATH="$PATH:$SDK_DIR" 97 fi 98 99 #SSH 100 SSH_DIR="$ISSM_DIR/externalpackages/ssh" 101 if [ -d "$SSH_DIR" ]; then 102 export PATH="$PATH:$SSH_DIR" 103 fi 104 105 #VALGRIND 106 VALGRIND_DIR="$ISSM_DIR/externalpackages/valgrind/install" 107 if [ -d "$VALGRIND_DIR" ]; then 108 export PATH="$VALGRIND_DIR/bin:$PATH" 109 fi 110 111 #CPPCHECK 112 CPPCHECK_DIR="$ISSM_DIR/externalpackages/cppcheck/install" 113 if [ -d "$CPPCHECK_DIR" ]; then 114 export PATH="$PATH:$CPPCHECK_DIR/bin" 115 fi 116 117 #GDAL 118 GDAL_DIR="$ISSM_DIR/externalpackages/gdal/install" 119 if [ -d "$GDAL_DIR" ]; then 120 export PATH="$GDAL_DIR/bin:$PATH" 121 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$GDAL_DIR/lib" 122 fi 123 124 #MERCURIAL 125 MERCURIAL_DIR="$ISSM_DIR/externalpackages/mercurial/install" 126 if [ -d "$MERCURIAL_DIR" ]; then 127 export PYTHONPATH="$PYTHONPATH:$MERCURIAL_DIR/mercurial/pure/" 128 export PATH="$PATH:$MERCURIAL_DIR/" 129 fi 130 131 #BOOST 132 BOOST_DIR="$ISSM_DIR/externalpackages/boost/install" 133 BOOSTROOT="$ISSM_DIR/externalpackages/boost/install" 134 if [ -d "$BOOST_DIR" ]; then 135 export BOOSTROOT 136 export BOOST_DIR 137 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$BOOST_DIR/lib" 138 export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$BOOST_DIR/lib" 139 export PATH="$PATH:$BOOST_DIR/bin" 140 fi 141 142 #XERCES 143 XERCESROOT="$ISSM_DIR/externalpackages/xerces/install" 144 XERCESCROOT="$ISSM_DIR/externalpackages/xerces/src" 145 if [ -d "$XERCESROOT" ]; then 146 export XERCESROOT 147 export XERCESCROOT 148 fi 149 150 #xaifBooster 151 XAIF_DIR="$ISSM_DIR/externalpackages/xaifbooster/xaifBooster" 152 XAIFBOOSTERROOT="$ISSM_DIR/externalpackages/xaifbooster/" 153 XAIFBOOSTER_HOME="$ISSM_DIR/externalpackages/xaifbooster/xaifBooster" 154 PLATFORM="x86-Linux" 155 if [ -d "$XAIF_DIR" ]; then 156 export XAIFBOOSTERROOT 157 export XAIFBOOSTER_HOME 158 export XAIF_DIR 159 export PLATFORM 160 fi 161 162 #angel 163 ANGELROOT="$ISSM_DIR/externalpackages/angel/angel" 164 if [ -d "$ANGELROOT" ]; then 165 export ANGELROOT 166 fi 167 168 #openanalysis 169 OPENANALYSISROOT="$ISSM_DIR/externalpackages/openanalysis/install" 170 if [ -d "$OPENANALYSISROOT" ]; then 171 export OPENANALYSISROOT 172 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$OPENANALYSISROOT/lib" 173 fi 174 175 #JAVA 176 JVM_DIR="/usr/local/gcc/4.3.2/lib64/gcj-4.3.2-9/" 177 if [ -d "$JVM_DIR" ]; then 178 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$JVM_DIR" 179 fi 180 181 #BBFTP 182 BBFTP_DIR="$ISSM_DIR/externalpackages/bbftp/install" 183 if [ -d "$BBFTP_DIR" ]; then 184 export PATH="$PATH:$BBFTP_DIR/bin" 185 fi 186 187 #ADIC 188 ADIC_DIR="$ISSM_DIR/externalpackages/adic/install" 189 if [ -d "$ADIC_DIR" ]; then 190 export PATH="$PATH:$ADIC_DIR/bin" 191 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$ADIC_DIR/lib" 192 export LD_RUN_PATH="$LD_RUN_PATH:$ADIC_DIR/lib" 193 fi 194 195 #COLPACK 196 COLPACK_DIR="$ISSM_DIR/externalpackages/colpack/install" 197 if [ -d "$COLPACK_DIR" ]; then 198 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$COLPACK_DIR/lib" 199 export LD_RUN_PATH="$LD_RUN_PATH:$COLPACK_DIR/lib" 200 fi 201 202 #ECLIPSE 203 ECLIPSE_DIR="$ISSM_DIR/externalpackages/eclipse/install" 204 if [ -d "$ECLIPSE_DIR" ]; then 205 export PATH="$PATH:$ECLIPSE_DIR" 206 fi 207 208 #APPSCAN 209 APPSCAN_DIR="$ISSM_DIR/externalpackages/appscan/install" 210 if [ -d "$APPSCAN_DIR" ]; then 211 export PATH="$PATH:$APPSCAN_DIR/bin" 212 fi 213 214 #RATS 215 RATS_DIR="$ISSM_DIR/externalpackages/rats/install" 216 if [ -d "$RATS_DIR" ]; then 217 export PATH="$PATH:$RATS_DIR/bin" 218 fi 219 220 #DYSON 221 DYSON_DIR="$ISSM_DIR/externalpackages/dyson/" 222 if [ -d "$DYSON_DIR" ]; then 223 export PATH="$PATH:$DYSON_DIR" 224 fi 225 226 #CMAKE 227 CMAKE_DIR="$ISSM_DIR/externalpackages/cmake/install" 228 if [ -d "$CMAKE_DIR" ]; then 229 export PATH="$PATH:$CMAKE_DIR/bin" 230 fi 231 232 #SHAPELIB 233 SHAPELIB_DIR="$ISSM_DIR/externalpackages/shapelib/install" 234 if [ -d "$SHAPELIB_DIR" ]; then 235 export PATH="$PATH:$SHAPELIB_DIR/exec" 236 fi 237 238 #CCCL 239 CCCL_DIR="$ISSM_DIR/externalpackages/cccl/install" 240 if [ -d "$CCCL_DIR" ]; then 241 export PATH="$PATH:$CCCL_DIR/bin" 242 fi 243 244 #PACKAGEMAKER 245 PACKAGEMAKER_DIR="$ISSM_DIR/externalpackages/packagemaker/install" 246 if [ -d "$PACKAGEMAKER_DIR" ]; then 247 export PATH="$PATH:$PACKAGEMAKER_DIR" 248 fi 249 250 #ANDROID_NDK: 251 ANDROID_NDK_DIR="$ISSM_DIR/externalpackages/android-ndk/install" 252 if [ -d "$ANDROID_NDK_DIR" ]; then 253 export PATH="$PATH:$ANDROID_NDK_DIR/" 254 fi 255 256 #ANDROID_SDK 257 ANDROID_SDK_DIR="$ANDROID_DIR/android-sdk/install-sdk" 258 if [ -d "$ANDROID_SDK_DIR" ]; then 259 export PATH="$PATH:$ANDROID_SDK_DIR/" 260 fi 261 262 #GSL 263 GSL_DIR="$ISSM_DIR/externalpackages/gsl/install" 264 if [ -d "$GSL_DIR" ]; then 265 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$GSL_DIR/lib" 266 export LD_RUN_PATH="$LD_RUN_PATH:$GSL_DIR/lib" 267 fi 268 269 #GMAKE 270 GMAKE_DIR="$ISSM_DIR/externalpackages/gmake/install" 271 if [ -d "$GMAKE_DIR" ]; then 272 export PATH="$GMAKE_DIR/bin:$PATH" 273 fi 274 275 #PYTHON 276 PYTHON_DIR="$ISSM_DIR/externalpackages/python/install" 277 if [ -d "$PYTHON_DIR" ]; then 278 PYTHONSTARTUP="$ISSM_DIR/startup.py" 279 export PATH="$PYTHON_DIR/bin:$PATH" 280 export PYTHONPATH="$PYTHONPATH:$ISSM_DIR/src/modules/python" 281 export LD_LIBRARY_PATH=$ISSM_DIR/src/modules/python:$ISSM_DIR/externalpackages/python/install/lib:$LD_LIBRARY_PATH 282 export PYTHONSTARTUP="$ISSM_DIR/startup.py" 283 fi 284 285 #MODELE 286 MODELE_DIR="$ISSM_DIR/externalpackages/modelE/install" 287 if [ -d "$MODELE_DIR" ]; then 288 export PATH="$MODELE_DIR/src/exec:$PATH" 289 fi 290 291 #GIT 292 GIT_DIR="$ISSM_DIR/externalpackages/git/install" 293 if [ -d "$GIT_DIR" ]; then 294 export PATH="$PATH:$GIT_DIR/bin" 295 fi 296 297 #NCVIEW 298 NCVIEW_DIR="$ISSM_DIR/externalpackages/ncview/install" 299 if [ -d "$NCVIEW_DIR" ]; then 300 export PATH="$PATH:$NCVIEW_DIR" 301 fi 302 303 #TCLX 304 TCLX_DIR="$ISSM_DIR/externalpackages/tclx/install/lib/tclx8.4" 305 if [ -d "$TCLX_DIR" ]; then 306 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$TCLX_DIR" 307 export LD_RUN_PATH="$LD_RUN_PATH:$TCLX_DIR" 308 fi 309 284 310 #ASPELL 285 export PATH="$ASPELL_DIR/install/bin:$PATH" 286 311 ASPELL_DIR="$ISSM_DIR/externalpackages/aspell/install" 312 if [ -d "$ASPELL_DIR" ]; then 313 export PATH="$ASPELL_DIR/bin:$PATH" 314 fi 287 315 288 316 #ESMF 289 export ESMF_DIR=$ISSM_DIR/externalpackages/esmf/esmf 290 export ESMF_COMPILER=gfortran 291 export ESMF_COMM=mpich2 317 ESMF_DIR="$ISSM_DIR/externalpackages/esmf/esmf" 318 if [ -d "$ESMF_DIR" ]; then 319 export ESMF_COMPILER=gfortran 320 export ESMF_COMM=mpich2 321 fi 292 322 293 323 #HDF5 294 export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$HDF5_DIR/lib" 295 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HDF5_DIR/lib" 296 export LIBRARY_PATH="$LIBRARY_PATH:$HDF5_DIR/lib" 297 export C_INCLUDE_PATH="$C_INCLUDE_PATH:$HDF5_DIR/include" 298 324 HDF5_DIR="$ISSM_DIR/externalpackages/hdf5/install" 325 if [ -d "$HDF5_DIR" ]; then 326 export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$HDF5_DIR/lib" 327 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HDF5_DIR/lib" 328 export LIBRARY_PATH="$LIBRARY_PATH:$HDF5_DIR/lib" 329 export C_INCLUDE_PATH="$C_INCLUDE_PATH:$HDF5_DIR/include" 330 fi 331 332 #SVN 333 SVN_DIR="$ISSM_DIR/externalpackages/svn/install" 334 if [ -d "$SVN_DIR" ]; then 335 export PATH="$SVN_DIR/bin:$PATH" 336 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SVN_DIR/lib" 337 export LIBRARY_PATH="$LIBRARY_PATH:$SVN_DIR/lib" 338 fi 339 340 #APR 341 APR_DIR="$ISSM_DIR/externalpackages/apr/install" 342 if [ -d "$APR_DIR" ]; then 343 export PATH="$APR_DIR/bin:$PATH" 344 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APR_DIR/lib" 345 export LIBRARY_PATH="$LIBRARY_PATH:$APR_DIR/lib" 346 fi 347 348 #APR_UTIL 349 APR_UTIL_DIR="$ISSM_DIR/externalpackages/apr-util/install" 350 if [ -d "$APR_UTIL_DIR" ]; then 351 export PATH="$APR_UTIL_DIR/bin:$PATH" 352 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APR_UTIL_DIR/lib" 353 export LIBRARY_PATH="$LIBRARY_PATH:$APR_UTIL_DIR/lib" 354 fi 355 356 #SQLITE 357 SQLITE_DIR="$ISSM_DIR/externalpackages/sqlite/install" 358 if [ -d "$SQLITE_DIR" ]; then 359 export PATH="$SQLITE_DIR/bin:$PATH" 360 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SQLITE_DIR/lib" 361 export LIBRARY_PATH="$LIBRARY_PATH:$SQLITE_DIR/lib" 362 fi -
issm/branches/trunk-jpl-damage/externalpackages
- Property svn:ignore
-
old new 1 archive 1 2 MITgcm 2 3 OpenAD
-
- Property svn:ignore
-
issm/branches/trunk-jpl-damage/externalpackages/adolc
- Property svn:ignore
-
old new 1 trunk 1 2 *.gz 2 3 install* 3 4 src 5 src-* 4 6 configure.sh 5 7 .ignore.txt
-
- Property svn:ignore
-
issm/branches/trunk-jpl-damage/externalpackages/adolc/install.sh
r12878 r13101 4 4 5 5 #Some cleanup 6 rm -rf install ADOL-C-2.2.0 src 6 rm -rf install ADOL-C-2.2.0 src trunk 7 8 #Create install directories 9 mkdir install src 7 10 8 11 #Download from ISSM server 9 12 $ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/ADOL-C-2.2.0.tar.gz' 'ADOL-C-2.2.0.tar.gz' 10 11 #Create install directories12 mkdir install src13 13 14 14 #Untar … … 19 19 rm -rf ADOL-C-2.2.0 20 20 21 21 22 #Compile ADOL-C 22 23 cd src 23 24 24 export CC=gcc25 export CXX=g++26 export CFLAGS="-arch x86_64"27 export CXXFLAGS="-arch x86_64"25 #export CC=gcc 26 #export CXX=g++ 27 #export CFLAGS="-arch x86_64" 28 #export CXXFLAGS="-arch x86_64" 28 29 29 30 ./configure \ … … 40 41 fi 41 42 make install 43 44 45 #Ok, bug with libtool: replace all LIBTOOL= by LIBTOOL=libtool 46 #in all Makefiles 47 for i in `find ./ -name Makefile ` 48 do 49 echo $i 50 cat $i | sed 's/LIBTOOL =/LIBTOOL = libtool/g' > $i.bak 51 mv $i.bak $i 52 done 53 54 #remake: 55 if [ -z $1 ]; then 56 make 57 else 58 make -j $1 59 fi 60 make install 61 62 -
issm/branches/trunk-jpl-damage/externalpackages/distribute
- Property svn:ignore
-
old new 1 *.gz 1 2 distribute_setup.py
-
- Property svn:ignore
-
issm/branches/trunk-jpl-damage/externalpackages/matlab/install.sh
r12878 r13101 5 5 6 6 #Select or create a new simlink 7 ln -s /usr/local/pkgs/matlab-7.6/ install7 #ln -s /usr/local/pkgs/matlab-7.6/ install 8 8 #ln -s /discover/vis/mathworks/matlab_r2011b/ install 9 9 #ln -s /usr/local/matlab704/ install -
issm/branches/trunk-jpl-damage/externalpackages/readline
- Property svn:ignore
-
old new 1 *.gz 1 2 src 2 3 src-*
-
- Property svn:ignore
-
issm/branches/trunk-jpl-damage/externalpackages/swig
-
Property svn:ignore
set to
install
*.gz
-
Property svn:ignore
set to
-
issm/branches/trunk-jpl-damage/externalpackages/swig/install.sh
r12258 r13101 21 21 export LDFLAGS="-L$ISSM_DIR/externalpackages/pcre/install/.libs/" 22 22 export LIBS="-lpcre" 23 #Configure doxygen23 #Configure swig 24 24 ./configure \ 25 --prefix="$ISSM_DIR/externalpackages/ python/install" \25 --prefix="$ISSM_DIR/externalpackages/swig/install" \ 26 26 --with-pcre-prefix="$ISSM_DIR/externalpackages/pcre/install" \ 27 --with-pcre-exec-prefix="$ISSM_DIR/externalpackages/pcre/install" 28 make 27 --with-pcre-exec-prefix="$ISSM_DIR/externalpackages/pcre/install" \ 28 --with-python="$ISSM_DIR/externalpackages/python/install/bin/python" 29 30 #Compile and install gdal 31 if [ -z $1 ]; then 32 make 33 else 34 make -j $1 35 fi 29 36 make install -
issm/branches/trunk-jpl-damage/externalpackages/valgrind
- Property svn:ignore
-
old new 3 3 src 4 4 .ignore.txt 5 *.bz2
-
- Property svn:ignore
-
issm/branches/trunk-jpl-damage/externalpackages/vim/addons/vim/syntax/Synchronize.sh
r12946 r13101 6 6 cat c.vim | sed "/ISSM's Enums begin/,/vim: ts=8/d" > temp 7 7 echo "\"ISSM's Enums begin" >> temp 8 cat ../../../../../src/c/EnumDefinitions/EnumDefinitions.h | grep -e "[0-9]Enum," -e "[a A-zZ]Enum," | grep -v StringToEnum | sed -e "s/,//g" | awk '{ printf "syn keyword cConstant " $1 "\n"}' >> temp8 cat ../../../../../src/c/EnumDefinitions/EnumDefinitions.h | grep -e "[0-9]Enum," -e "[a-z]Enum," -e "[A-Z]Enum," | grep -v StringToEnum | sed -e "s/,//g" | awk '{ printf "syn keyword cConstant " $1 "\n"}' >> temp 9 9 echo "\"ISSM's Enums end" >> temp 10 10 cat c.vim | sed "1,/ISSM's Enums end/d" >> temp 11 12 11 mv temp c.vim 12 exit 1 13 13 14 14 #Synchronize objects … … 16 16 echo "\"ISSM's objects begin" >> temp 17 17 find ../../../../../src/c/classes -name "*.h" | sed -e "s/\// /g" -e "s/\.h//"| awk '{print $(NF)}' | awk '{ printf "syn keyword cType " $1 "\n"}'>> temp 18 echo "\"ISSM's objects end" >> temp 18 19 cat c.vim | sed "1,/ISSM's objects end/d" >> temp 19 20 -
issm/branches/trunk-jpl-damage/externalpackages/vim/addons/vim/syntax/c.vim
r12946 r13101 408 408 syn keyword cType Vec Mat SeqVec SeqMat 409 409 "other ISSM's syntax 410 syn keyword cType mxArray ErrorException QuadtreeBox IssmDouble IssmPDouble 410 syn keyword cType mxArray ErrorException QuadtreeBox IssmDouble IssmPDouble Observations 411 411 412 412 "ISSM's objects begin 413 syn keyword cType AdjacentTriangle 414 syn keyword cType BamgGeom 415 syn keyword cType BamgMesh 416 syn keyword cType bamgobjects 417 syn keyword cType BamgOpts 418 syn keyword cType BamgQuadtree 419 syn keyword cType BamgVertex 420 syn keyword cType CrackedEdge 421 syn keyword cType Curve 422 syn keyword cType Direction 423 syn keyword cType DoubleAndInt 424 syn keyword cType Edge 425 syn keyword cType GeomEdge 426 syn keyword cType Geometry 427 syn keyword cType GeomSubDomain 428 syn keyword cType GeomVertex 429 syn keyword cType include 430 syn keyword cType ListofIntersectionTriangles 431 syn keyword cType macros 432 syn keyword cType Mesh 433 syn keyword cType Metric 434 syn keyword cType R2 435 syn keyword cType SetOfE4 436 syn keyword cType SubDomain 437 syn keyword cType Triangle 438 syn keyword cType typedefs 439 syn keyword cType VertexOnEdge 440 syn keyword cType VertexOnGeom 441 syn keyword cType VertexOnVertex 442 syn keyword cType classes 443 syn keyword cType DakotaPlugin 444 syn keyword cType DofIndexing 445 syn keyword cType FemModel 413 syn keyword cType GaussPenta 446 414 syn keyword cType gaussobjects 447 syn keyword cType GaussPenta448 415 syn keyword cType GaussTria 449 syn keyword cType Hook 450 syn keyword cType IoModel 451 syn keyword cType ExponentialVariogram 452 syn keyword cType GaussianVariogram 453 syn keyword cType krigingobjects 454 syn keyword cType Observation 455 syn keyword cType PowerVariogram 456 syn keyword cType Quadtree 457 syn keyword cType SphericalVariogram 458 syn keyword cType Variogram 459 syn keyword cType ElementMatrix 460 syn keyword cType ElementVector 461 syn keyword cType Matrix 462 syn keyword cType matrixobjects 463 syn keyword cType Vector 464 syn keyword cType Constraint 416 syn keyword cType objects 417 syn keyword cType Material 418 syn keyword cType Matice 419 syn keyword cType Matpar 420 syn keyword cType objects 421 syn keyword cType Contour 422 syn keyword cType DoubleInput 423 syn keyword cType Input 424 syn keyword cType ControlInput 425 syn keyword cType DatasetInput 426 syn keyword cType IntInput 427 syn keyword cType BoolInput 428 syn keyword cType TriaP1Input 429 syn keyword cType TransientInput 430 syn keyword cType PentaP1Input 431 syn keyword cType KML_Icon 432 syn keyword cType KML_Point 433 syn keyword cType KML_LinearRing 434 syn keyword cType KML_Feature 435 syn keyword cType KMLFileReadUtils 436 syn keyword cType KML_StyleSelector 437 syn keyword cType KML_LatLonBox 438 syn keyword cType KML_Attribute 439 syn keyword cType KML_PolyStyle 440 syn keyword cType KML_Object 441 syn keyword cType KML_SubStyle 442 syn keyword cType KML_LineString 443 syn keyword cType KML_Overlay 444 syn keyword cType KML_Container 445 syn keyword cType KML_Polygon 446 syn keyword cType KML_Geometry 447 syn keyword cType KML_ColorStyle 448 syn keyword cType KML_Placemark 449 syn keyword cType KML_Unknown 450 syn keyword cType KML_GroundOverlay 451 syn keyword cType KML_Style 452 syn keyword cType KML_Comment 453 syn keyword cType KML_MultiGeometry 454 syn keyword cType KML_LineStyle 455 syn keyword cType KML_Folder 456 syn keyword cType KML_Document 457 syn keyword cType KML_File 458 syn keyword cType DoubleVecParam 459 syn keyword cType DoubleParam 460 syn keyword cType DoubleMatArrayParam 461 syn keyword cType DoubleMatParam 462 syn keyword cType Param 463 syn keyword cType FileParam 464 syn keyword cType IntVecParam 465 syn keyword cType IntParam 466 syn keyword cType BoolParam 467 syn keyword cType IntMatParam 468 syn keyword cType VectorParam 469 syn keyword cType DoubleTransientMatParam 470 syn keyword cType MatrixParam 471 syn keyword cType StringArrayParam 472 syn keyword cType StringParam 473 syn keyword cType TransientParam 474 syn keyword cType OptionStruct 475 syn keyword cType OptionDouble 476 syn keyword cType OptionLogical 477 syn keyword cType OptionUtilities 478 syn keyword cType OptionChar 479 syn keyword cType Option 480 syn keyword cType OptionCell 481 syn keyword cType Segment 482 syn keyword cType Icefront 483 syn keyword cType Friction 484 syn keyword cType Riftfront 485 syn keyword cType Numericalflux 486 syn keyword cType Penpair 487 syn keyword cType Load 488 syn keyword cType Pengrid 489 syn keyword cType Object 490 syn keyword cType DoubleVecExternalResult 491 syn keyword cType DoubleExternalResult 492 syn keyword cType IntExternalResult 493 syn keyword cType BoolExternalResult 494 syn keyword cType DoubleMatExternalResult 495 syn keyword cType PetscVecExternalResult 496 syn keyword cType ExternalResult 497 syn keyword cType StringExternalResult 498 syn keyword cType Vertex 465 499 syn keyword cType SpcDynamic 466 500 syn keyword cType SpcStatic 467 501 syn keyword cType SpcTransient 468 syn keyword cType Contour 502 syn keyword cType Constraint 503 syn keyword cType TriaP1ElementResult 504 syn keyword cType PentaP1ElementResult 505 syn keyword cType DoubleElementResult 506 syn keyword cType ElementResultLocal 469 507 syn keyword cType BoolElementResult 470 syn keyword cType DoubleElementResult471 508 syn keyword cType ElementResult 472 syn keyword cType ElementResultLocal 473 syn keyword cType PentaP1ElementResult 474 syn keyword cType TriaP1ElementResult 509 syn keyword cType Node 510 syn keyword cType TriaRef 511 syn keyword cType TriaHook 512 syn keyword cType PentaRef 513 syn keyword cType PentaHook 514 syn keyword cType Tria 475 515 syn keyword cType Element 476 516 syn keyword cType Penta 477 syn keyword cType PentaHook 478 syn keyword cType PentaRef 479 syn keyword cType Tria 480 syn keyword cType TriaHook 481 syn keyword cType TriaRef 482 syn keyword cType BoolExternalResult 483 syn keyword cType DoubleExternalResult 484 syn keyword cType DoubleMatExternalResult 485 syn keyword cType DoubleVecExternalResult 486 syn keyword cType ExternalResult 487 syn keyword cType IntExternalResult 488 syn keyword cType PetscVecExternalResult 489 syn keyword cType StringExternalResult 490 syn keyword cType BoolInput 491 syn keyword cType ControlInput 492 syn keyword cType DatasetInput 493 syn keyword cType DoubleInput 494 syn keyword cType Input 495 syn keyword cType IntInput 496 syn keyword cType PentaP1Input 497 syn keyword cType TransientInput 498 syn keyword cType TriaP1Input 499 syn keyword cType KML_Attribute 500 syn keyword cType KML_ColorStyle 501 syn keyword cType KML_Comment 502 syn keyword cType KML_Container 503 syn keyword cType KML_Document 504 syn keyword cType KML_Feature 505 syn keyword cType KML_File 506 syn keyword cType KML_Folder 507 syn keyword cType KML_Geometry 508 syn keyword cType KML_GroundOverlay 509 syn keyword cType KML_Icon 510 syn keyword cType KML_LatLonBox 511 syn keyword cType KML_LinearRing 512 syn keyword cType KML_LineString 513 syn keyword cType KML_LineStyle 514 syn keyword cType KML_MultiGeometry 515 syn keyword cType KML_Object 516 syn keyword cType KML_Overlay 517 syn keyword cType KML_Placemark 518 syn keyword cType KML_Point 519 syn keyword cType KML_Polygon 520 syn keyword cType KML_PolyStyle 521 syn keyword cType KML_Style 522 syn keyword cType KML_StyleSelector 523 syn keyword cType KML_SubStyle 524 syn keyword cType KML_Unknown 525 syn keyword cType KMLFileReadUtils 526 syn keyword cType Friction 527 syn keyword cType Icefront 528 syn keyword cType Load 529 syn keyword cType Numericalflux 530 syn keyword cType Pengrid 531 syn keyword cType Penpair 532 syn keyword cType Riftfront 533 syn keyword cType Material 534 syn keyword cType Matice 535 syn keyword cType Matpar 536 syn keyword cType Node 537 syn keyword cType Object 538 syn keyword cType objects 539 syn keyword cType Option 540 syn keyword cType OptionCell 541 syn keyword cType OptionChar 542 syn keyword cType OptionDouble 543 syn keyword cType OptionLogical 544 syn keyword cType OptionStruct 545 syn keyword cType OptionUtilities 546 syn keyword cType BoolParam 547 syn keyword cType DoubleMatArrayParam 548 syn keyword cType DoubleMatParam 549 syn keyword cType DoubleParam 550 syn keyword cType DoubleTransientMatParam 551 syn keyword cType DoubleVecParam 552 syn keyword cType FileParam 553 syn keyword cType IntMatParam 554 syn keyword cType IntParam 555 syn keyword cType IntVecParam 556 syn keyword cType MatrixParam 557 syn keyword cType Param 558 syn keyword cType StringArrayParam 559 syn keyword cType StringParam 560 syn keyword cType TransientParam 561 syn keyword cType VectorParam 562 syn keyword cType Segment 563 syn keyword cType Vertex 564 syn keyword cType objects 517 syn keyword cType classes 518 syn keyword cType DofIndexing 519 syn keyword cType Patch 520 syn keyword cType Hook 521 syn keyword cType Quadtree 522 syn keyword cType Observation 523 syn keyword cType ExponentialVariogram 524 syn keyword cType GaussianVariogram 525 syn keyword cType SphericalVariogram 526 syn keyword cType PowerVariogram 527 syn keyword cType krigingobjects 528 syn keyword cType Variogram 529 syn keyword cType DakotaPlugin 530 syn keyword cType ElementVector 531 syn keyword cType ElementMatrix 532 syn keyword cType matrixobjects 533 syn keyword cType Vector 534 syn keyword cType Matrix 535 syn keyword cType GeomSubDomain 536 syn keyword cType Geometry 537 syn keyword cType AdjacentTriangle 538 syn keyword cType VertexOnEdge 539 syn keyword cType BamgQuadtree 540 syn keyword cType Edge 541 syn keyword cType BamgVertex 542 syn keyword cType SetOfE4 543 syn keyword cType GeomEdge 544 syn keyword cType Direction 545 syn keyword cType VertexOnGeom 546 syn keyword cType R2 547 syn keyword cType Mesh 548 syn keyword cType ListofIntersectionTriangles 549 syn keyword cType Triangle 550 syn keyword cType DoubleAndInt 551 syn keyword cType VertexOnVertex 552 syn keyword cType BamgOpts 553 syn keyword cType BamgGeom 554 syn keyword cType bamgobjects 555 syn keyword cType CrackedEdge 556 syn keyword cType SubDomain 557 syn keyword cType BamgMesh 558 syn keyword cType Metric 559 syn keyword cType include 560 syn keyword cType typedefs 561 syn keyword cType Curve 562 syn keyword cType macros 563 syn keyword cType GeomVertex 565 564 syn keyword cType OptArgs 565 syn keyword cType Update 566 566 syn keyword cType OptPars 567 567 syn keyword cType BamgOpts -
issm/branches/trunk-jpl-damage/externalpackages/vim/addons/vimrc
r10985 r13101 203 203 au BufRead,BufNewFile *.c* iabbr <silent> p1 printf("\n");<Left><Left><Left><Left><Left><C-R>=Eatchar('\s')<CR> 204 204 au BufRead,BufNewFile *.c*,*.h iabbr <silent> ER _error_("");<Left><Left><Left><C-R>=Eatchar('\s')<CR> 205 au BufRead,BufNewFile *.py iabbr <silent> ER raise NameError('')<Left><Left><C-R>=Eatchar('\s')<CR> 206 au BufRead,BufNewFile *.m iabbr <silent> ER error('');<Left><Left><Left><C-R>=Eatchar('\s')<CR> 205 207 au BufRead,BufNewFile *.c* ab VV VecView(ug,PETSC_VIEWER_STDOUT_WORLD); 206 208 au BufRead,BufNewFile *.c* ab AS _assert_(); -
issm/branches/trunk-jpl-damage/ltmain.sh
r11116 r13101 1 # Generated from ltmain.m4sh. 2 3 # ltmain.sh (GNU libtool) 2.2.6b 1 2 # libtool (GNU libtool) 2.4.2 4 3 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 5 4 6 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. 5 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 6 # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. 7 7 # This is free software; see the source for copying conditions. There is NO 8 8 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. … … 33 33 # Provide generalized library-building support services. 34 34 # 35 # --config show all configuration variables 36 # --debug enable verbose shell tracing 37 # -n, --dry-run display commands without modifying any files 38 # --features display basic configuration information and exit 39 # --mode=MODE use operation mode MODE 40 # --preserve-dup-deps don't remove duplicate dependency libraries 41 # --quiet, --silent don't print informational messages 42 # --tag=TAG use configuration variables from tag TAG 43 # -v, --verbose print informational messages (default) 44 # --version print version information 45 # -h, --help print short or long help message 35 # --config show all configuration variables 36 # --debug enable verbose shell tracing 37 # -n, --dry-run display commands without modifying any files 38 # --features display basic configuration information and exit 39 # --mode=MODE use operation mode MODE 40 # --preserve-dup-deps don't remove duplicate dependency libraries 41 # --quiet, --silent don't print informational messages 42 # --no-quiet, --no-silent 43 # print informational messages (default) 44 # --no-warn don't display warning messages 45 # --tag=TAG use configuration variables from tag TAG 46 # -v, --verbose print more informational messages than default 47 # --no-verbose don't print the extra informational messages 48 # --version print version information 49 # -h, --help, --help-all print short, long, or detailed help message 46 50 # 47 51 # MODE must be one of the following: 48 52 # 49 # clean remove files from the build directory50 # compile compile a source file into a libtool object51 # execute automatically set library path, then run a program52 # finish complete the installation of libtool libraries53 # install install libraries or executables54 # link create a library or an executable55 # uninstall remove libraries from an installed directory53 # clean remove files from the build directory 54 # compile compile a source file into a libtool object 55 # execute automatically set library path, then run a program 56 # finish complete the installation of libtool libraries 57 # install install libraries or executables 58 # link create a library or an executable 59 # uninstall remove libraries from an installed directory 56 60 # 57 # MODE-ARGS vary depending on the MODE. 61 # MODE-ARGS vary depending on the MODE. When passed as first option, 62 # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. 58 63 # Try `$progname --help --mode=MODE' for a more detailed description of MODE. 59 64 # … … 61 66 # include the following information: 62 67 # 63 # host-triplet: $host64 # shell: $SHELL65 # compiler: $LTCC66 # compiler flags: $LTCFLAGS67 # linker: $LD (gnu? $with_gnu_ld)68 # $progname: (GNU libtool) 2.2.6b69 # automake:$automake_version70 # autoconf:$autoconf_version68 # host-triplet: $host 69 # shell: $SHELL 70 # compiler: $LTCC 71 # compiler flags: $LTCFLAGS 72 # linker: $LD (gnu? $with_gnu_ld) 73 # $progname: (GNU libtool) 2.4.2 74 # automake: $automake_version 75 # autoconf: $autoconf_version 71 76 # 72 77 # Report bugs to <bug-libtool@gnu.org>. 73 74 PROGRAM=ltmain.sh 78 # GNU libtool home page: <http://www.gnu.org/software/libtool/>. 79 # General help using GNU software: <http://www.gnu.org/gethelp/>. 80 81 PROGRAM=libtool 75 82 PACKAGE=libtool 76 VERSION=2. 2.6b83 VERSION=2.4.2 77 84 TIMESTAMP="" 78 package_revision=1.3 01785 package_revision=1.3337 79 86 80 87 # Be Bourne compatible … … 92 99 DUALCASE=1; export DUALCASE # for MKS sh 93 100 101 # A function that is used when there is no print builtin or printf. 102 func_fallback_echo () 103 { 104 eval 'cat <<_LTECHO_EOF 105 $1 106 _LTECHO_EOF' 107 } 108 94 109 # NLS nuisances: We save the old values to restore during execute mode. 95 # Only set LANG and LC_ALL to C if already set.96 # These must not be set unconditionally because not all systems understand97 # e.g. LANG=C (notably SCO).98 110 lt_user_locale= 99 111 lt_safe_locale= … … 108 120 fi" 109 121 done 122 LC_ALL=C 123 LANGUAGE=C 124 export LANGUAGE LC_ALL 110 125 111 126 $lt_unset CDPATH 112 127 113 128 129 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh 130 # is ksh but when the shell is invoked as "sh" and the current value of 131 # the _XPG environment variable is not equal to 1 (one), the special 132 # positional parameter $0, within a function call, is the name of the 133 # function. 134 progpath="$0" 114 135 115 136 116 137 117 138 : ${CP="cp -f"} 118 : ${ECHO="echo"} 119 : ${EGREP="/bin/grep -E"} 120 : ${FGREP="/bin/grep -F"} 121 : ${GREP="/bin/grep"} 122 : ${LN_S="ln -s"} 139 test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} 123 140 : ${MAKE="make"} 124 141 : ${MKDIR="mkdir"} 125 142 : ${MV="mv -f"} 126 143 : ${RM="rm -f"} 127 : ${SED="/bin/sed"}128 144 : ${SHELL="${CONFIG_SHELL-/bin/sh}"} 129 145 : ${Xsed="$SED -e 1s/^X//"} … … 144 160 dirname="s,/[^/]*$,," 145 161 basename="s,^.*/,," 162 163 # func_dirname file append nondir_replacement 164 # Compute the dirname of FILE. If nonempty, add APPEND to the result, 165 # otherwise set result to NONDIR_REPLACEMENT. 166 func_dirname () 167 { 168 func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` 169 if test "X$func_dirname_result" = "X${1}"; then 170 func_dirname_result="${3}" 171 else 172 func_dirname_result="$func_dirname_result${2}" 173 fi 174 } # func_dirname may be replaced by extended shell implementation 175 176 177 # func_basename file 178 func_basename () 179 { 180 func_basename_result=`$ECHO "${1}" | $SED "$basename"` 181 } # func_basename may be replaced by extended shell implementation 182 146 183 147 184 # func_dirname_and_basename file append nondir_replacement … … 159 196 func_dirname_and_basename () 160 197 { 161 # Extract subdirectory from the argument. 162 func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` 163 if test "X$func_dirname_result" = "X${1}"; then 164 func_dirname_result="${3}" 165 else 166 func_dirname_result="$func_dirname_result${2}" 198 # Extract subdirectory from the argument. 199 func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` 200 if test "X$func_dirname_result" = "X${1}"; then 201 func_dirname_result="${3}" 202 else 203 func_dirname_result="$func_dirname_result${2}" 204 fi 205 func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` 206 } # func_dirname_and_basename may be replaced by extended shell implementation 207 208 209 # func_stripname prefix suffix name 210 # strip PREFIX and SUFFIX off of NAME. 211 # PREFIX and SUFFIX must not contain globbing or regex special 212 # characters, hashes, percent signs, but SUFFIX may contain a leading 213 # dot (in which case that matches only a dot). 214 # func_strip_suffix prefix name 215 func_stripname () 216 { 217 case ${2} in 218 .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; 219 *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; 220 esac 221 } # func_stripname may be replaced by extended shell implementation 222 223 224 # These SED scripts presuppose an absolute path with a trailing slash. 225 pathcar='s,^/\([^/]*\).*$,\1,' 226 pathcdr='s,^/[^/]*,,' 227 removedotparts=':dotsl 228 s@/\./@/@g 229 t dotsl 230 s,/\.$,/,' 231 collapseslashes='s@/\{1,\}@/@g' 232 finalslash='s,/*$,/,' 233 234 # func_normal_abspath PATH 235 # Remove doubled-up and trailing slashes, "." path components, 236 # and cancel out any ".." path components in PATH after making 237 # it an absolute path. 238 # value returned in "$func_normal_abspath_result" 239 func_normal_abspath () 240 { 241 # Start from root dir and reassemble the path. 242 func_normal_abspath_result= 243 func_normal_abspath_tpath=$1 244 func_normal_abspath_altnamespace= 245 case $func_normal_abspath_tpath in 246 "") 247 # Empty path, that just means $cwd. 248 func_stripname '' '/' "`pwd`" 249 func_normal_abspath_result=$func_stripname_result 250 return 251 ;; 252 # The next three entries are used to spot a run of precisely 253 # two leading slashes without using negated character classes; 254 # we take advantage of case's first-match behaviour. 255 ///*) 256 # Unusual form of absolute path, do nothing. 257 ;; 258 //*) 259 # Not necessarily an ordinary path; POSIX reserves leading '//' 260 # and for example Cygwin uses it to access remote file shares 261 # over CIFS/SMB, so we conserve a leading double slash if found. 262 func_normal_abspath_altnamespace=/ 263 ;; 264 /*) 265 # Absolute path, do nothing. 266 ;; 267 *) 268 # Relative path, prepend $cwd. 269 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath 270 ;; 271 esac 272 # Cancel out all the simple stuff to save iterations. We also want 273 # the path to end with a slash for ease of parsing, so make sure 274 # there is one (and only one) here. 275 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ 276 -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` 277 while :; do 278 # Processed it all yet? 279 if test "$func_normal_abspath_tpath" = / ; then 280 # If we ascended to the root using ".." the result may be empty now. 281 if test -z "$func_normal_abspath_result" ; then 282 func_normal_abspath_result=/ 283 fi 284 break 285 fi 286 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ 287 -e "$pathcar"` 288 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ 289 -e "$pathcdr"` 290 # Figure out what to do with it 291 case $func_normal_abspath_tcomponent in 292 "") 293 # Trailing empty path component, ignore it. 294 ;; 295 ..) 296 # Parent dir; strip last assembled component from result. 297 func_dirname "$func_normal_abspath_result" 298 func_normal_abspath_result=$func_dirname_result 299 ;; 300 *) 301 # Actual path component, append it. 302 func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent 303 ;; 304 esac 305 done 306 # Restore leading double-slash if one was found on entry. 307 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result 308 } 309 310 # func_relative_path SRCDIR DSTDIR 311 # generates a relative path from SRCDIR to DSTDIR, with a trailing 312 # slash if non-empty, suitable for immediately appending a filename 313 # without needing to append a separator. 314 # value returned in "$func_relative_path_result" 315 func_relative_path () 316 { 317 func_relative_path_result= 318 func_normal_abspath "$1" 319 func_relative_path_tlibdir=$func_normal_abspath_result 320 func_normal_abspath "$2" 321 func_relative_path_tbindir=$func_normal_abspath_result 322 323 # Ascend the tree starting from libdir 324 while :; do 325 # check if we have found a prefix of bindir 326 case $func_relative_path_tbindir in 327 $func_relative_path_tlibdir) 328 # found an exact match 329 func_relative_path_tcancelled= 330 break 331 ;; 332 $func_relative_path_tlibdir*) 333 # found a matching prefix 334 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" 335 func_relative_path_tcancelled=$func_stripname_result 336 if test -z "$func_relative_path_result"; then 337 func_relative_path_result=. 338 fi 339 break 340 ;; 341 *) 342 func_dirname $func_relative_path_tlibdir 343 func_relative_path_tlibdir=${func_dirname_result} 344 if test "x$func_relative_path_tlibdir" = x ; then 345 # Have to descend all the way to the root! 346 func_relative_path_result=../$func_relative_path_result 347 func_relative_path_tcancelled=$func_relative_path_tbindir 348 break 349 fi 350 func_relative_path_result=../$func_relative_path_result 351 ;; 352 esac 353 done 354 355 # Now calculate path; take care to avoid doubling-up slashes. 356 func_stripname '' '/' "$func_relative_path_result" 357 func_relative_path_result=$func_stripname_result 358 func_stripname '/' '/' "$func_relative_path_tcancelled" 359 if test "x$func_stripname_result" != x ; then 360 func_relative_path_result=${func_relative_path_result}/${func_stripname_result} 167 361 fi 168 func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` 169 } 170 171 # Generated shell functions inserted here. 172 173 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh 174 # is ksh but when the shell is invoked as "sh" and the current value of 175 # the _XPG environment variable is not equal to 1 (one), the special 176 # positional parameter $0, within a function call, is the name of the 177 # function. 178 progpath="$0" 362 363 # Normalisation. If bindir is libdir, return empty string, 364 # else relative path ending with a slash; either way, target 365 # file name can be directly appended. 366 if test ! -z "$func_relative_path_result"; then 367 func_stripname './' '' "$func_relative_path_result/" 368 func_relative_path_result=$func_stripname_result 369 fi 370 } 179 371 180 372 # The name of this program: 181 # In the unlikely event $progname began with a '-', it would play havoc with182 # func_echo (imagine progname=-n), so we prepend ./ in that case:183 373 func_dirname_and_basename "$progpath" 184 374 progname=$func_basename_result 185 case $progname in186 -*) progname=./$progname ;;187 esac188 375 189 376 # Make sure we have an absolute path for reexecution: … … 197 384 *) 198 385 save_IFS="$IFS" 199 IFS= :386 IFS=${PATH_SEPARATOR-:} 200 387 for progdir in $PATH; do 201 388 IFS="$save_IFS" … … 215 402 # Same as above, but do not quote variable references. 216 403 double_quote_subst='s/\(["`\\]\)/\\\1/g' 404 405 # Sed substitution that turns a string into a regex matching for the 406 # string literally. 407 sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' 408 409 # Sed substitution that converts a w32 file name or path 410 # which contains forward slashes, into one that contains 411 # (escaped) backslashes. A very naive implementation. 412 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' 217 413 218 414 # Re-`\' parameter expansions in output of double_quote_subst that were … … 244 440 func_echo () 245 441 { 246 $ECHO "$progname ${mode+: }$mode:$*"442 $ECHO "$progname: ${opt_mode+$opt_mode: }$*" 247 443 } 248 444 … … 259 455 } 260 456 457 # func_echo_all arg... 458 # Invoke $ECHO with all args, space-separated. 459 func_echo_all () 460 { 461 $ECHO "$*" 462 } 463 261 464 # func_error arg... 262 465 # Echo program name prefixed message to standard error. 263 466 func_error () 264 467 { 265 $ECHO "$progname ${mode+: }$mode:"${1+"$@"} 1>&2468 $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 266 469 } 267 470 … … 270 473 func_warning () 271 474 { 272 $opt_warning && $ECHO "$progname ${mode+: }$mode:warning: "${1+"$@"} 1>&2475 $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 273 476 274 477 # bash bug again: … … 327 530 328 531 # ...otherwise throw away the child directory and loop 329 my_directory_path=`$ECHO " X$my_directory_path" | $Xsed-e "$dirname"`532 my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` 330 533 done 331 my_dir_list=`$ECHO " X$my_dir_list" | $Xsed -e's,:*$,,'`534 my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` 332 535 333 536 save_mkdir_p_IFS="$IFS"; IFS=':' … … 379 582 fi 380 583 381 $ECHO " X$my_tmpdir" | $Xsed584 $ECHO "$my_tmpdir" 382 585 } 383 586 … … 393 596 case $1 in 394 597 *[\\\`\"\$]*) 395 func_quote_for_eval_unquoted_result=`$ECHO " X$1" | $Xsed -e"$sed_quote_subst"` ;;598 func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; 396 599 *) 397 600 func_quote_for_eval_unquoted_result="$1" ;; … … 420 623 case $1 in 421 624 *[\\\`\"]*) 422 my_arg=`$ECHO " X$1" | $Xsed\625 my_arg=`$ECHO "$1" | $SED \ 423 626 -e "$double_quote_subst" -e "$sed_double_backslash"` ;; 424 627 *) … … 489 692 } 490 693 491 492 694 # func_tr_sh 695 # Turn $1 into a string suitable for a shell variable name. 696 # Result is stored in $func_tr_sh_result. All characters 697 # not in the set a-zA-Z0-9_ are replaced with '_'. Further, 698 # if $1 begins with a digit, a '_' is prepended as well. 699 func_tr_sh () 700 { 701 case $1 in 702 [0-9]* | *[!a-zA-Z0-9_]*) 703 func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` 704 ;; 705 * ) 706 func_tr_sh_result=$1 707 ;; 708 esac 709 } 493 710 494 711 … … 497 714 func_version () 498 715 { 499 $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { 716 $opt_debug 717 718 $SED -n '/(C)/!b go 719 :more 720 /\./!{ 721 N 722 s/\n# / / 723 b more 724 } 725 :go 726 /^# '$PROGRAM' (GNU /,/# warranty; / { 500 727 s/^# // 501 728 s/^# *$// … … 510 737 func_usage () 511 738 { 512 $SED -n '/^# Usage:/,/# -h/ { 739 $opt_debug 740 741 $SED -n '/^# Usage:/,/^# *.*--help/ { 513 742 s/^# // 514 743 s/^# *$// … … 516 745 p 517 746 }' < "$progpath" 518 $ECHO747 echo 519 748 $ECHO "run \`$progname --help | more' for full usage" 520 749 exit $? 521 750 } 522 751 523 # func_help 524 # Echo long help message to standard output and exit. 752 # func_help [NOEXIT] 753 # Echo long help message to standard output and exit, 754 # unless 'noexit' is passed as argument. 525 755 func_help () 526 756 { 757 $opt_debug 758 527 759 $SED -n '/^# Usage:/,/# Report bugs to/ { 760 :print 528 761 s/^# // 529 762 s/^# *$// … … 535 768 s*\$LD*'"$LD"'* 536 769 s/\$with_gnu_ld/'"$with_gnu_ld"'/ 537 s/\$automake_version/'"`( automake--version) 2>/dev/null |$SED 1q`"'/538 s/\$autoconf_version/'"`( autoconf--version) 2>/dev/null |$SED 1q`"'/770 s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ 771 s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ 539 772 p 540 }' < "$progpath" 541 exit $? 773 d 774 } 775 /^# .* home page:/b print 776 /^# General help using/b print 777 ' < "$progpath" 778 ret=$? 779 if test -z "$1"; then 780 exit $ret 781 fi 542 782 } 543 783 … … 547 787 func_missing_arg () 548 788 { 549 func_error "missing argument for $1" 789 $opt_debug 790 791 func_error "missing argument for $1." 550 792 exit_cmd=exit 551 793 } 552 794 795 796 # func_split_short_opt shortopt 797 # Set func_split_short_opt_name and func_split_short_opt_arg shell 798 # variables after splitting SHORTOPT after the 2nd character. 799 func_split_short_opt () 800 { 801 my_sed_short_opt='1s/^\(..\).*$/\1/;q' 802 my_sed_short_rest='1s/^..\(.*\)$/\1/;q' 803 804 func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` 805 func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` 806 } # func_split_short_opt may be replaced by extended shell implementation 807 808 809 # func_split_long_opt longopt 810 # Set func_split_long_opt_name and func_split_long_opt_arg shell 811 # variables after splitting LONGOPT at the `=' sign. 812 func_split_long_opt () 813 { 814 my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' 815 my_sed_long_arg='1s/^--[^=]*=//' 816 817 func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` 818 func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` 819 } # func_split_long_opt may be replaced by extended shell implementation 820 553 821 exit_cmd=: 554 822 … … 556 824 557 825 558 559 # Check that we have a working $ECHO.560 if test "X$1" = X--no-reexec; then561 # Discard the --no-reexec flag, and continue.562 shift563 elif test "X$1" = X--fallback-echo; then564 # Avoid inline document here, it may be left over565 :566 elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then567 # Yippee, $ECHO works!568 :569 else570 # Restart under the correct shell, and then maybe $ECHO will work.571 exec $SHELL "$progpath" --no-reexec ${1+"$@"}572 fi573 574 if test "X$1" = X--fallback-echo; then575 # used as fallback echo576 shift577 cat <<EOF578 $*579 EOF580 exit $EXIT_SUCCESS581 fi582 826 583 827 magic="%%%MAGIC variable%%%" … … 585 829 586 830 # Global variables. 587 # $mode is unset588 831 nonopt= 589 execute_dlfiles=590 832 preserve_args= 591 833 lo2o="s/\\.lo\$/.${objext}/" … … 594 836 extracted_serial=0 595 837 596 opt_dry_run=false597 opt_duplicate_deps=false598 opt_silent=false599 opt_debug=:600 601 838 # If this variable is set in any of the actions, the command in it 602 839 # will be execed at the end. This prevents here-documents from being … … 604 841 exec_cmd= 605 842 843 # func_append var value 844 # Append VALUE to the end of shell variable VAR. 845 func_append () 846 { 847 eval "${1}=\$${1}\${2}" 848 } # func_append may be replaced by extended shell implementation 849 850 # func_append_quoted var value 851 # Quote VALUE and append to the end of shell variable VAR, separated 852 # by a space. 853 func_append_quoted () 854 { 855 func_quote_for_eval "${2}" 856 eval "${1}=\$${1}\\ \$func_quote_for_eval_result" 857 } # func_append_quoted may be replaced by extended shell implementation 858 859 860 # func_arith arithmetic-term... 861 func_arith () 862 { 863 func_arith_result=`expr "${@}"` 864 } # func_arith may be replaced by extended shell implementation 865 866 867 # func_len string 868 # STRING may not start with a hyphen. 869 func_len () 870 { 871 func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` 872 } # func_len may be replaced by extended shell implementation 873 874 875 # func_lo2o object 876 func_lo2o () 877 { 878 func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` 879 } # func_lo2o may be replaced by extended shell implementation 880 881 882 # func_xform libobj-or-source 883 func_xform () 884 { 885 func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` 886 } # func_xform may be replaced by extended shell implementation 887 888 606 889 # func_fatal_configuration arg... 607 890 # Echo program name prefixed message to standard error, followed by … … 637 920 func_features () 638 921 { 639 $ECHO"host: $host"922 echo "host: $host" 640 923 if test "$build_libtool_libs" = yes; then 641 $ECHO"enable shared libraries"924 echo "enable shared libraries" 642 925 else 643 $ECHO"disable shared libraries"926 echo "disable shared libraries" 644 927 fi 645 928 if test "$build_old_libs" = yes; then 646 $ECHO"enable static libraries"929 echo "enable static libraries" 647 930 else 648 $ECHO"disable static libraries"931 echo "disable static libraries" 649 932 fi 650 933 … … 691 974 ;; 692 975 esac 693 }694 695 # Parse options once, thoroughly. This comes as soon as possible in696 # the script to make things like `libtool --version' happen quickly.697 {698 699 # Shorthand for --mode=foo, only valid as the first argument700 case $1 in701 clean|clea|cle|cl)702 shift; set dummy --mode clean ${1+"$@"}; shift703 ;;704 compile|compil|compi|comp|com|co|c)705 shift; set dummy --mode compile ${1+"$@"}; shift706 ;;707 execute|execut|execu|exec|exe|ex|e)708 shift; set dummy --mode execute ${1+"$@"}; shift709 ;;710 finish|finis|fini|fin|fi|f)711 shift; set dummy --mode finish ${1+"$@"}; shift712 ;;713 install|instal|insta|inst|ins|in|i)714 shift; set dummy --mode install ${1+"$@"}; shift715 ;;716 link|lin|li|l)717 shift; set dummy --mode link ${1+"$@"}; shift718 ;;719 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)720 shift; set dummy --mode uninstall ${1+"$@"}; shift721 ;;722 esac723 724 # Parse non-mode specific arguments:725 while test "$#" -gt 0; do726 opt="$1"727 shift728 729 case $opt in730 --config) func_config ;;731 732 --debug) preserve_args="$preserve_args $opt"733 func_echo "enabling shell trace mode"734 opt_debug='set -x'735 $opt_debug736 ;;737 738 -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break739 execute_dlfiles="$execute_dlfiles $1"740 shift741 ;;742 743 --dry-run | -n) opt_dry_run=: ;;744 --features) func_features ;;745 --finish) mode="finish" ;;746 747 --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break748 case $1 in749 # Valid mode arguments:750 clean) ;;751 compile) ;;752 execute) ;;753 finish) ;;754 install) ;;755 link) ;;756 relink) ;;757 uninstall) ;;758 759 # Catch anything else as an error760 *) func_error "invalid argument for $opt"761 exit_cmd=exit762 break763 ;;764 esac765 766 mode="$1"767 shift768 ;;769 770 --preserve-dup-deps)771 opt_duplicate_deps=: ;;772 773 --quiet|--silent) preserve_args="$preserve_args $opt"774 opt_silent=:775 ;;776 777 --verbose| -v) preserve_args="$preserve_args $opt"778 opt_silent=false779 ;;780 781 --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break782 preserve_args="$preserve_args $opt $1"783 func_enable_tag "$1" # tagname is set here784 shift785 ;;786 787 # Separate optargs to long options:788 -dlopen=*|--mode=*|--tag=*)789 func_opt_split "$opt"790 set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}791 shift792 ;;793 794 -\?|-h) func_usage ;;795 --help) opt_help=: ;;796 --version) func_version ;;797 798 -*) func_fatal_help "unrecognized option \`$opt'" ;;799 800 *) nonopt="$opt"801 break802 ;;803 esac804 done805 806 807 case $host in808 *cygwin* | *mingw* | *pw32* | *cegcc*)809 # don't eliminate duplications in $postdeps and $predeps810 opt_duplicate_compiler_generated_deps=:811 ;;812 *)813 opt_duplicate_compiler_generated_deps=$opt_duplicate_deps814 ;;815 esac816 817 # Having warned about all mis-specified options, bail out if818 # anything was wrong.819 $exit_cmd $EXIT_FAILURE820 976 } 821 977 … … 856 1012 857 1013 1014 # Shorthand for --mode=foo, only valid as the first argument 1015 case $1 in 1016 clean|clea|cle|cl) 1017 shift; set dummy --mode clean ${1+"$@"}; shift 1018 ;; 1019 compile|compil|compi|comp|com|co|c) 1020 shift; set dummy --mode compile ${1+"$@"}; shift 1021 ;; 1022 execute|execut|execu|exec|exe|ex|e) 1023 shift; set dummy --mode execute ${1+"$@"}; shift 1024 ;; 1025 finish|finis|fini|fin|fi|f) 1026 shift; set dummy --mode finish ${1+"$@"}; shift 1027 ;; 1028 install|instal|insta|inst|ins|in|i) 1029 shift; set dummy --mode install ${1+"$@"}; shift 1030 ;; 1031 link|lin|li|l) 1032 shift; set dummy --mode link ${1+"$@"}; shift 1033 ;; 1034 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) 1035 shift; set dummy --mode uninstall ${1+"$@"}; shift 1036 ;; 1037 esac 1038 1039 1040 1041 # Option defaults: 1042 opt_debug=: 1043 opt_dry_run=false 1044 opt_config=false 1045 opt_preserve_dup_deps=false 1046 opt_features=false 1047 opt_finish=false 1048 opt_help=false 1049 opt_help_all=false 1050 opt_silent=: 1051 opt_warning=: 1052 opt_verbose=: 1053 opt_silent=false 1054 opt_verbose=false 1055 1056 1057 # Parse options once, thoroughly. This comes as soon as possible in the 1058 # script to make things like `--version' happen as quickly as we can. 1059 { 1060 # this just eases exit handling 1061 while test $# -gt 0; do 1062 opt="$1" 1063 shift 1064 case $opt in 1065 --debug|-x) opt_debug='set -x' 1066 func_echo "enabling shell trace mode" 1067 $opt_debug 1068 ;; 1069 --dry-run|--dryrun|-n) 1070 opt_dry_run=: 1071 ;; 1072 --config) 1073 opt_config=: 1074 func_config 1075 ;; 1076 --dlopen|-dlopen) 1077 optarg="$1" 1078 opt_dlopen="${opt_dlopen+$opt_dlopen 1079 }$optarg" 1080 shift 1081 ;; 1082 --preserve-dup-deps) 1083 opt_preserve_dup_deps=: 1084 ;; 1085 --features) 1086 opt_features=: 1087 func_features 1088 ;; 1089 --finish) 1090 opt_finish=: 1091 set dummy --mode finish ${1+"$@"}; shift 1092 ;; 1093 --help) 1094 opt_help=: 1095 ;; 1096 --help-all) 1097 opt_help_all=: 1098 opt_help=': help-all' 1099 ;; 1100 --mode) 1101 test $# = 0 && func_missing_arg $opt && break 1102 optarg="$1" 1103 opt_mode="$optarg" 1104 case $optarg in 1105 # Valid mode arguments: 1106 clean|compile|execute|finish|install|link|relink|uninstall) ;; 1107 1108 # Catch anything else as an error 1109 *) func_error "invalid argument for $opt" 1110 exit_cmd=exit 1111 break 1112 ;; 1113 esac 1114 shift 1115 ;; 1116 --no-silent|--no-quiet) 1117 opt_silent=false 1118 func_append preserve_args " $opt" 1119 ;; 1120 --no-warning|--no-warn) 1121 opt_warning=false 1122 func_append preserve_args " $opt" 1123 ;; 1124 --no-verbose) 1125 opt_verbose=false 1126 func_append preserve_args " $opt" 1127 ;; 1128 --silent|--quiet) 1129 opt_silent=: 1130 func_append preserve_args " $opt" 1131 opt_verbose=false 1132 ;; 1133 --verbose|-v) 1134 opt_verbose=: 1135 func_append preserve_args " $opt" 1136 opt_silent=false 1137 ;; 1138 --tag) 1139 test $# = 0 && func_missing_arg $opt && break 1140 optarg="$1" 1141 opt_tag="$optarg" 1142 func_append preserve_args " $opt $optarg" 1143 func_enable_tag "$optarg" 1144 shift 1145 ;; 1146 1147 -\?|-h) func_usage ;; 1148 --help) func_help ;; 1149 --version) func_version ;; 1150 1151 # Separate optargs to long options: 1152 --*=*) 1153 func_split_long_opt "$opt" 1154 set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} 1155 shift 1156 ;; 1157 1158 # Separate non-argument short options: 1159 -\?*|-h*|-n*|-v*) 1160 func_split_short_opt "$opt" 1161 set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} 1162 shift 1163 ;; 1164 1165 --) break ;; 1166 -*) func_fatal_help "unrecognized option \`$opt'" ;; 1167 *) set dummy "$opt" ${1+"$@"}; shift; break ;; 1168 esac 1169 done 1170 1171 # Validate options: 1172 1173 # save first non-option argument 1174 if test "$#" -gt 0; then 1175 nonopt="$opt" 1176 shift 1177 fi 1178 1179 # preserve --debug 1180 test "$opt_debug" = : || func_append preserve_args " --debug" 1181 1182 case $host in 1183 *cygwin* | *mingw* | *pw32* | *cegcc*) 1184 # don't eliminate duplications in $postdeps and $predeps 1185 opt_duplicate_compiler_generated_deps=: 1186 ;; 1187 *) 1188 opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps 1189 ;; 1190 esac 1191 1192 $opt_help || { 1193 # Sanity checks first: 1194 func_check_version_match 1195 1196 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then 1197 func_fatal_configuration "not configured to build any kind of library" 1198 fi 1199 1200 # Darwin sucks 1201 eval std_shrext=\"$shrext_cmds\" 1202 1203 # Only execute mode is allowed to have -dlopen flags. 1204 if test -n "$opt_dlopen" && test "$opt_mode" != execute; then 1205 func_error "unrecognized option \`-dlopen'" 1206 $ECHO "$help" 1>&2 1207 exit $EXIT_FAILURE 1208 fi 1209 1210 # Change the help message to a mode-specific one. 1211 generic_help="$help" 1212 help="Try \`$progname --help --mode=$opt_mode' for more information." 1213 } 1214 1215 1216 # Bail if the options were screwed 1217 $exit_cmd $EXIT_FAILURE 1218 } 1219 1220 1221 1222 858 1223 ## ----------- ## 859 1224 ## Main. ## 860 1225 ## ----------- ## 861 862 $opt_help || {863 # Sanity checks first:864 func_check_version_match865 866 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then867 func_fatal_configuration "not configured to build any kind of library"868 fi869 870 test -z "$mode" && func_fatal_error "error: you must specify a MODE."871 872 873 # Darwin sucks874 eval std_shrext=\"$shrext_cmds\"875 876 877 # Only execute mode is allowed to have -dlopen flags.878 if test -n "$execute_dlfiles" && test "$mode" != execute; then879 func_error "unrecognized option \`-dlopen'"880 $ECHO "$help" 1>&2881 exit $EXIT_FAILURE882 fi883 884 # Change the help message to a mode-specific one.885 generic_help="$help"886 help="Try \`$progname --help --mode=$mode' for more information."887 }888 889 1226 890 1227 # func_lalib_p file … … 951 1288 func_ltwrapper_scriptname () 952 1289 { 953 func_ltwrapper_scriptname_result="" 954 if func_ltwrapper_executable_p "$1"; then 955 func_dirname_and_basename "$1" "" "." 956 func_stripname '' '.exe' "$func_basename_result" 957 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" 958 fi 1290 func_dirname_and_basename "$1" "" "." 1291 func_stripname '' '.exe' "$func_basename_result" 1292 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" 959 1293 } 960 1294 … … 1002 1336 1003 1337 1338 # func_resolve_sysroot PATH 1339 # Replace a leading = in PATH with a sysroot. Store the result into 1340 # func_resolve_sysroot_result 1341 func_resolve_sysroot () 1342 { 1343 func_resolve_sysroot_result=$1 1344 case $func_resolve_sysroot_result in 1345 =*) 1346 func_stripname '=' '' "$func_resolve_sysroot_result" 1347 func_resolve_sysroot_result=$lt_sysroot$func_stripname_result 1348 ;; 1349 esac 1350 } 1351 1352 # func_replace_sysroot PATH 1353 # If PATH begins with the sysroot, replace it with = and 1354 # store the result into func_replace_sysroot_result. 1355 func_replace_sysroot () 1356 { 1357 case "$lt_sysroot:$1" in 1358 ?*:"$lt_sysroot"*) 1359 func_stripname "$lt_sysroot" '' "$1" 1360 func_replace_sysroot_result="=$func_stripname_result" 1361 ;; 1362 *) 1363 # Including no sysroot. 1364 func_replace_sysroot_result=$1 1365 ;; 1366 esac 1367 } 1368 1004 1369 # func_infer_tag arg 1005 1370 # Infer tagged configuration to use if any are available and … … 1014 1379 CC_quoted= 1015 1380 for arg in $CC; do 1016 func_quote_for_eval "$arg" 1017 CC_quoted="$CC_quoted $func_quote_for_eval_result" 1381 func_append_quoted CC_quoted "$arg" 1018 1382 done 1383 CC_expanded=`func_echo_all $CC` 1384 CC_quoted_expanded=`func_echo_all $CC_quoted` 1019 1385 case $@ in 1020 1386 # Blanks in the command may have been stripped by the calling shell, 1021 1387 # but not from the CC environment variable when configure was run. 1022 " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; 1388 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ 1389 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; 1023 1390 # Blanks at the start of $base_compile will cause this to fail 1024 1391 # if we don't check for them as well. … … 1031 1398 for arg in $CC; do 1032 1399 # Double-quote args containing other shell metacharacters. 1033 func_quote_for_eval "$arg" 1034 CC_quoted="$CC_quoted $func_quote_for_eval_result" 1400 func_append_quoted CC_quoted "$arg" 1035 1401 done 1402 CC_expanded=`func_echo_all $CC` 1403 CC_quoted_expanded=`func_echo_all $CC_quoted` 1036 1404 case "$@ " in 1037 " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) 1405 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ 1406 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) 1038 1407 # The compiler in the base compile command matches 1039 1408 # the one in the tagged configuration. … … 1098 1467 } 1099 1468 1469 1470 ################################################## 1471 # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS # 1472 ################################################## 1473 1474 # func_convert_core_file_wine_to_w32 ARG 1475 # Helper function used by file name conversion functions when $build is *nix, 1476 # and $host is mingw, cygwin, or some other w32 environment. Relies on a 1477 # correctly configured wine environment available, with the winepath program 1478 # in $build's $PATH. 1479 # 1480 # ARG is the $build file name to be converted to w32 format. 1481 # Result is available in $func_convert_core_file_wine_to_w32_result, and will 1482 # be empty on error (or when ARG is empty) 1483 func_convert_core_file_wine_to_w32 () 1484 { 1485 $opt_debug 1486 func_convert_core_file_wine_to_w32_result="$1" 1487 if test -n "$1"; then 1488 # Unfortunately, winepath does not exit with a non-zero error code, so we 1489 # are forced to check the contents of stdout. On the other hand, if the 1490 # command is not found, the shell will set an exit code of 127 and print 1491 # *an error message* to stdout. So we must check for both error code of 1492 # zero AND non-empty stdout, which explains the odd construction: 1493 func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null` 1494 if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then 1495 func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | 1496 $SED -e "$lt_sed_naive_backslashify"` 1497 else 1498 func_convert_core_file_wine_to_w32_result= 1499 fi 1500 fi 1501 } 1502 # end: func_convert_core_file_wine_to_w32 1503 1504 1505 # func_convert_core_path_wine_to_w32 ARG 1506 # Helper function used by path conversion functions when $build is *nix, and 1507 # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly 1508 # configured wine environment available, with the winepath program in $build's 1509 # $PATH. Assumes ARG has no leading or trailing path separator characters. 1510 # 1511 # ARG is path to be converted from $build format to win32. 1512 # Result is available in $func_convert_core_path_wine_to_w32_result. 1513 # Unconvertible file (directory) names in ARG are skipped; if no directory names 1514 # are convertible, then the result may be empty. 1515 func_convert_core_path_wine_to_w32 () 1516 { 1517 $opt_debug 1518 # unfortunately, winepath doesn't convert paths, only file names 1519 func_convert_core_path_wine_to_w32_result="" 1520 if test -n "$1"; then 1521 oldIFS=$IFS 1522 IFS=: 1523 for func_convert_core_path_wine_to_w32_f in $1; do 1524 IFS=$oldIFS 1525 func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" 1526 if test -n "$func_convert_core_file_wine_to_w32_result" ; then 1527 if test -z "$func_convert_core_path_wine_to_w32_result"; then 1528 func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" 1529 else 1530 func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" 1531 fi 1532 fi 1533 done 1534 IFS=$oldIFS 1535 fi 1536 } 1537 # end: func_convert_core_path_wine_to_w32 1538 1539 1540 # func_cygpath ARGS... 1541 # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when 1542 # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) 1543 # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or 1544 # (2), returns the Cygwin file name or path in func_cygpath_result (input 1545 # file name or path is assumed to be in w32 format, as previously converted 1546 # from $build's *nix or MSYS format). In case (3), returns the w32 file name 1547 # or path in func_cygpath_result (input file name or path is assumed to be in 1548 # Cygwin format). Returns an empty string on error. 1549 # 1550 # ARGS are passed to cygpath, with the last one being the file name or path to 1551 # be converted. 1552 # 1553 # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH 1554 # environment variable; do not put it in $PATH. 1555 func_cygpath () 1556 { 1557 $opt_debug 1558 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then 1559 func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` 1560 if test "$?" -ne 0; then 1561 # on failure, ensure result is empty 1562 func_cygpath_result= 1563 fi 1564 else 1565 func_cygpath_result= 1566 func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" 1567 fi 1568 } 1569 #end: func_cygpath 1570 1571 1572 # func_convert_core_msys_to_w32 ARG 1573 # Convert file name or path ARG from MSYS format to w32 format. Return 1574 # result in func_convert_core_msys_to_w32_result. 1575 func_convert_core_msys_to_w32 () 1576 { 1577 $opt_debug 1578 # awkward: cmd appends spaces to result 1579 func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | 1580 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` 1581 } 1582 #end: func_convert_core_msys_to_w32 1583 1584 1585 # func_convert_file_check ARG1 ARG2 1586 # Verify that ARG1 (a file name in $build format) was converted to $host 1587 # format in ARG2. Otherwise, emit an error message, but continue (resetting 1588 # func_to_host_file_result to ARG1). 1589 func_convert_file_check () 1590 { 1591 $opt_debug 1592 if test -z "$2" && test -n "$1" ; then 1593 func_error "Could not determine host file name corresponding to" 1594 func_error " \`$1'" 1595 func_error "Continuing, but uninstalled executables may not work." 1596 # Fallback: 1597 func_to_host_file_result="$1" 1598 fi 1599 } 1600 # end func_convert_file_check 1601 1602 1603 # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH 1604 # Verify that FROM_PATH (a path in $build format) was converted to $host 1605 # format in TO_PATH. Otherwise, emit an error message, but continue, resetting 1606 # func_to_host_file_result to a simplistic fallback value (see below). 1607 func_convert_path_check () 1608 { 1609 $opt_debug 1610 if test -z "$4" && test -n "$3"; then 1611 func_error "Could not determine the host path corresponding to" 1612 func_error " \`$3'" 1613 func_error "Continuing, but uninstalled executables may not work." 1614 # Fallback. This is a deliberately simplistic "conversion" and 1615 # should not be "improved". See libtool.info. 1616 if test "x$1" != "x$2"; then 1617 lt_replace_pathsep_chars="s|$1|$2|g" 1618 func_to_host_path_result=`echo "$3" | 1619 $SED -e "$lt_replace_pathsep_chars"` 1620 else 1621 func_to_host_path_result="$3" 1622 fi 1623 fi 1624 } 1625 # end func_convert_path_check 1626 1627 1628 # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG 1629 # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT 1630 # and appending REPL if ORIG matches BACKPAT. 1631 func_convert_path_front_back_pathsep () 1632 { 1633 $opt_debug 1634 case $4 in 1635 $1 ) func_to_host_path_result="$3$func_to_host_path_result" 1636 ;; 1637 esac 1638 case $4 in 1639 $2 ) func_append func_to_host_path_result "$3" 1640 ;; 1641 esac 1642 } 1643 # end func_convert_path_front_back_pathsep 1644 1645 1646 ################################################## 1647 # $build to $host FILE NAME CONVERSION FUNCTIONS # 1648 ################################################## 1649 # invoked via `$to_host_file_cmd ARG' 1650 # 1651 # In each case, ARG is the path to be converted from $build to $host format. 1652 # Result will be available in $func_to_host_file_result. 1653 1654 1655 # func_to_host_file ARG 1656 # Converts the file name ARG from $build format to $host format. Return result 1657 # in func_to_host_file_result. 1658 func_to_host_file () 1659 { 1660 $opt_debug 1661 $to_host_file_cmd "$1" 1662 } 1663 # end func_to_host_file 1664 1665 1666 # func_to_tool_file ARG LAZY 1667 # converts the file name ARG from $build format to toolchain format. Return 1668 # result in func_to_tool_file_result. If the conversion in use is listed 1669 # in (the comma separated) LAZY, no conversion takes place. 1670 func_to_tool_file () 1671 { 1672 $opt_debug 1673 case ,$2, in 1674 *,"$to_tool_file_cmd",*) 1675 func_to_tool_file_result=$1 1676 ;; 1677 *) 1678 $to_tool_file_cmd "$1" 1679 func_to_tool_file_result=$func_to_host_file_result 1680 ;; 1681 esac 1682 } 1683 # end func_to_tool_file 1684 1685 1686 # func_convert_file_noop ARG 1687 # Copy ARG to func_to_host_file_result. 1688 func_convert_file_noop () 1689 { 1690 func_to_host_file_result="$1" 1691 } 1692 # end func_convert_file_noop 1693 1694 1695 # func_convert_file_msys_to_w32 ARG 1696 # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic 1697 # conversion to w32 is not available inside the cwrapper. Returns result in 1698 # func_to_host_file_result. 1699 func_convert_file_msys_to_w32 () 1700 { 1701 $opt_debug 1702 func_to_host_file_result="$1" 1703 if test -n "$1"; then 1704 func_convert_core_msys_to_w32 "$1" 1705 func_to_host_file_result="$func_convert_core_msys_to_w32_result" 1706 fi 1707 func_convert_file_check "$1" "$func_to_host_file_result" 1708 } 1709 # end func_convert_file_msys_to_w32 1710 1711 1712 # func_convert_file_cygwin_to_w32 ARG 1713 # Convert file name ARG from Cygwin to w32 format. Returns result in 1714 # func_to_host_file_result. 1715 func_convert_file_cygwin_to_w32 () 1716 { 1717 $opt_debug 1718 func_to_host_file_result="$1" 1719 if test -n "$1"; then 1720 # because $build is cygwin, we call "the" cygpath in $PATH; no need to use 1721 # LT_CYGPATH in this case. 1722 func_to_host_file_result=`cygpath -m "$1"` 1723 fi 1724 func_convert_file_check "$1" "$func_to_host_file_result" 1725 } 1726 # end func_convert_file_cygwin_to_w32 1727 1728 1729 # func_convert_file_nix_to_w32 ARG 1730 # Convert file name ARG from *nix to w32 format. Requires a wine environment 1731 # and a working winepath. Returns result in func_to_host_file_result. 1732 func_convert_file_nix_to_w32 () 1733 { 1734 $opt_debug 1735 func_to_host_file_result="$1" 1736 if test -n "$1"; then 1737 func_convert_core_file_wine_to_w32 "$1" 1738 func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" 1739 fi 1740 func_convert_file_check "$1" "$func_to_host_file_result" 1741 } 1742 # end func_convert_file_nix_to_w32 1743 1744 1745 # func_convert_file_msys_to_cygwin ARG 1746 # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. 1747 # Returns result in func_to_host_file_result. 1748 func_convert_file_msys_to_cygwin () 1749 { 1750 $opt_debug 1751 func_to_host_file_result="$1" 1752 if test -n "$1"; then 1753 func_convert_core_msys_to_w32 "$1" 1754 func_cygpath -u "$func_convert_core_msys_to_w32_result" 1755 func_to_host_file_result="$func_cygpath_result" 1756 fi 1757 func_convert_file_check "$1" "$func_to_host_file_result" 1758 } 1759 # end func_convert_file_msys_to_cygwin 1760 1761 1762 # func_convert_file_nix_to_cygwin ARG 1763 # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed 1764 # in a wine environment, working winepath, and LT_CYGPATH set. Returns result 1765 # in func_to_host_file_result. 1766 func_convert_file_nix_to_cygwin () 1767 { 1768 $opt_debug 1769 func_to_host_file_result="$1" 1770 if test -n "$1"; then 1771 # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. 1772 func_convert_core_file_wine_to_w32 "$1" 1773 func_cygpath -u "$func_convert_core_file_wine_to_w32_result" 1774 func_to_host_file_result="$func_cygpath_result" 1775 fi 1776 func_convert_file_check "$1" "$func_to_host_file_result" 1777 } 1778 # end func_convert_file_nix_to_cygwin 1779 1780 1781 ############################################# 1782 # $build to $host PATH CONVERSION FUNCTIONS # 1783 ############################################# 1784 # invoked via `$to_host_path_cmd ARG' 1785 # 1786 # In each case, ARG is the path to be converted from $build to $host format. 1787 # The result will be available in $func_to_host_path_result. 1788 # 1789 # Path separators are also converted from $build format to $host format. If 1790 # ARG begins or ends with a path separator character, it is preserved (but 1791 # converted to $host format) on output. 1792 # 1793 # All path conversion functions are named using the following convention: 1794 # file name conversion function : func_convert_file_X_to_Y () 1795 # path conversion function : func_convert_path_X_to_Y () 1796 # where, for any given $build/$host combination the 'X_to_Y' value is the 1797 # same. If conversion functions are added for new $build/$host combinations, 1798 # the two new functions must follow this pattern, or func_init_to_host_path_cmd 1799 # will break. 1800 1801 1802 # func_init_to_host_path_cmd 1803 # Ensures that function "pointer" variable $to_host_path_cmd is set to the 1804 # appropriate value, based on the value of $to_host_file_cmd. 1805 to_host_path_cmd= 1806 func_init_to_host_path_cmd () 1807 { 1808 $opt_debug 1809 if test -z "$to_host_path_cmd"; then 1810 func_stripname 'func_convert_file_' '' "$to_host_file_cmd" 1811 to_host_path_cmd="func_convert_path_${func_stripname_result}" 1812 fi 1813 } 1814 1815 1816 # func_to_host_path ARG 1817 # Converts the path ARG from $build format to $host format. Return result 1818 # in func_to_host_path_result. 1819 func_to_host_path () 1820 { 1821 $opt_debug 1822 func_init_to_host_path_cmd 1823 $to_host_path_cmd "$1" 1824 } 1825 # end func_to_host_path 1826 1827 1828 # func_convert_path_noop ARG 1829 # Copy ARG to func_to_host_path_result. 1830 func_convert_path_noop () 1831 { 1832 func_to_host_path_result="$1" 1833 } 1834 # end func_convert_path_noop 1835 1836 1837 # func_convert_path_msys_to_w32 ARG 1838 # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic 1839 # conversion to w32 is not available inside the cwrapper. Returns result in 1840 # func_to_host_path_result. 1841 func_convert_path_msys_to_w32 () 1842 { 1843 $opt_debug 1844 func_to_host_path_result="$1" 1845 if test -n "$1"; then 1846 # Remove leading and trailing path separator characters from ARG. MSYS 1847 # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; 1848 # and winepath ignores them completely. 1849 func_stripname : : "$1" 1850 func_to_host_path_tmp1=$func_stripname_result 1851 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" 1852 func_to_host_path_result="$func_convert_core_msys_to_w32_result" 1853 func_convert_path_check : ";" \ 1854 "$func_to_host_path_tmp1" "$func_to_host_path_result" 1855 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" 1856 fi 1857 } 1858 # end func_convert_path_msys_to_w32 1859 1860 1861 # func_convert_path_cygwin_to_w32 ARG 1862 # Convert path ARG from Cygwin to w32 format. Returns result in 1863 # func_to_host_file_result. 1864 func_convert_path_cygwin_to_w32 () 1865 { 1866 $opt_debug 1867 func_to_host_path_result="$1" 1868 if test -n "$1"; then 1869 # See func_convert_path_msys_to_w32: 1870 func_stripname : : "$1" 1871 func_to_host_path_tmp1=$func_stripname_result 1872 func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` 1873 func_convert_path_check : ";" \ 1874 "$func_to_host_path_tmp1" "$func_to_host_path_result" 1875 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" 1876 fi 1877 } 1878 # end func_convert_path_cygwin_to_w32 1879 1880 1881 # func_convert_path_nix_to_w32 ARG 1882 # Convert path ARG from *nix to w32 format. Requires a wine environment and 1883 # a working winepath. Returns result in func_to_host_file_result. 1884 func_convert_path_nix_to_w32 () 1885 { 1886 $opt_debug 1887 func_to_host_path_result="$1" 1888 if test -n "$1"; then 1889 # See func_convert_path_msys_to_w32: 1890 func_stripname : : "$1" 1891 func_to_host_path_tmp1=$func_stripname_result 1892 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" 1893 func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" 1894 func_convert_path_check : ";" \ 1895 "$func_to_host_path_tmp1" "$func_to_host_path_result" 1896 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" 1897 fi 1898 } 1899 # end func_convert_path_nix_to_w32 1900 1901 1902 # func_convert_path_msys_to_cygwin ARG 1903 # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. 1904 # Returns result in func_to_host_file_result. 1905 func_convert_path_msys_to_cygwin () 1906 { 1907 $opt_debug 1908 func_to_host_path_result="$1" 1909 if test -n "$1"; then 1910 # See func_convert_path_msys_to_w32: 1911 func_stripname : : "$1" 1912 func_to_host_path_tmp1=$func_stripname_result 1913 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" 1914 func_cygpath -u -p "$func_convert_core_msys_to_w32_result" 1915 func_to_host_path_result="$func_cygpath_result" 1916 func_convert_path_check : : \ 1917 "$func_to_host_path_tmp1" "$func_to_host_path_result" 1918 func_convert_path_front_back_pathsep ":*" "*:" : "$1" 1919 fi 1920 } 1921 # end func_convert_path_msys_to_cygwin 1922 1923 1924 # func_convert_path_nix_to_cygwin ARG 1925 # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a 1926 # a wine environment, working winepath, and LT_CYGPATH set. Returns result in 1927 # func_to_host_file_result. 1928 func_convert_path_nix_to_cygwin () 1929 { 1930 $opt_debug 1931 func_to_host_path_result="$1" 1932 if test -n "$1"; then 1933 # Remove leading and trailing path separator characters from 1934 # ARG. msys behavior is inconsistent here, cygpath turns them 1935 # into '.;' and ';.', and winepath ignores them completely. 1936 func_stripname : : "$1" 1937 func_to_host_path_tmp1=$func_stripname_result 1938 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" 1939 func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" 1940 func_to_host_path_result="$func_cygpath_result" 1941 func_convert_path_check : : \ 1942 "$func_to_host_path_tmp1" "$func_to_host_path_result" 1943 func_convert_path_front_back_pathsep ":*" "*:" : "$1" 1944 fi 1945 } 1946 # end func_convert_path_nix_to_cygwin 1947 1948 1100 1949 # func_mode_compile arg... 1101 1950 func_mode_compile () … … 1138 1987 1139 1988 -pie | -fpie | -fPIE) 1140 pie_flag="$pie_flag$arg"1989 func_append pie_flag " $arg" 1141 1990 continue 1142 1991 ;; 1143 1992 1144 1993 -shared | -static | -prefer-pic | -prefer-non-pic) 1145 later="$later$arg"1994 func_append later " $arg" 1146 1995 continue 1147 1996 ;; … … 1164 2013 for arg in $args; do 1165 2014 IFS="$save_ifs" 1166 func_quote_for_eval "$arg" 1167 lastarg="$lastarg $func_quote_for_eval_result" 2015 func_append_quoted lastarg "$arg" 1168 2016 done 1169 2017 IFS="$save_ifs" … … 1172 2020 1173 2021 # Add the arguments to base_compile. 1174 base_compile="$base_compile$lastarg"2022 func_append base_compile " $lastarg" 1175 2023 continue 1176 2024 ;; … … 1188 2036 1189 2037 # Aesthetically quote the previous argument. 1190 func_quote_for_eval "$lastarg" 1191 base_compile="$base_compile $func_quote_for_eval_result" 2038 func_append_quoted base_compile "$lastarg" 1192 2039 done # for arg 1193 2040 … … 1214 2061 *.ada | *.adb | *.ads | *.asm | \ 1215 2062 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ 1216 *.[fF][09]? | *.for | *.java | *. obj | *.sx)2063 *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) 1217 2064 func_xform "$libobj" 1218 2065 libobj=$func_xform_result … … 1289 2136 # not support -o with -c 1290 2137 if test "$compiler_c_o" = no; then 1291 output_obj=`$ECHO " X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}2138 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} 1292 2139 lockfile="$output_obj.lock" 1293 2140 else … … 1320 2167 exit $EXIT_FAILURE 1321 2168 fi 1322 removelist="$removelist$output_obj"2169 func_append removelist " $output_obj" 1323 2170 $ECHO "$srcfile" > "$lockfile" 1324 2171 fi 1325 2172 1326 2173 $opt_dry_run || $RM $removelist 1327 removelist="$removelist$lockfile"2174 func_append removelist " $lockfile" 1328 2175 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 1329 2176 1330 if test -n "$fix_srcfile_path"; then 1331 eval srcfile=\"$fix_srcfile_path\" 1332 fi 2177 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 2178 srcfile=$func_to_tool_file_result 1333 2179 func_quote_for_eval "$srcfile" 1334 2180 qsrcfile=$func_quote_for_eval_result … … 1350 2196 if test -z "$output_obj"; then 1351 2197 # Place PIC objects in $objdir 1352 command="$command-o $lobj"2198 func_append command " -o $lobj" 1353 2199 fi 1354 2200 … … 1397 2243 fi 1398 2244 if test "$compiler_c_o" = yes; then 1399 command="$command-o $obj"2245 func_append command " -o $obj" 1400 2246 fi 1401 2247 1402 2248 # Suppress compiler output if we already did a PIC compilation. 1403 command="$command$suppress_output"2249 func_append command "$suppress_output" 1404 2250 func_show_eval_locale "$command" \ 1405 2251 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' … … 1446 2292 1447 2293 $opt_help || { 1448 test "$mode" = compile && func_mode_compile ${1+"$@"}2294 test "$opt_mode" = compile && func_mode_compile ${1+"$@"} 1449 2295 } 1450 2296 … … 1452 2298 { 1453 2299 # We need to display help for each of the modes. 1454 case $ mode in2300 case $opt_mode in 1455 2301 "") 1456 2302 # Generic help is extracted from the usage comments … … 1483 2329 -o OUTPUT-FILE set the output file name to OUTPUT-FILE 1484 2330 -no-suppress do not suppress compiler output for multiple passes 1485 -prefer-pic try to build ingPIC objects only1486 -prefer-non-pic try to build ingnon-PIC objects only2331 -prefer-pic try to build PIC objects only 2332 -prefer-non-pic try to build non-PIC objects only 1487 2333 -shared do not build a \`.o' file suitable for static linking 1488 2334 -static only build a \`.o' file suitable for static linking 2335 -Wc,FLAG pass FLAG directly to the compiler 1489 2336 1490 2337 COMPILE-COMMAND is a command to be used in creating a \`standard' object file … … 1539 2386 The following components of INSTALL-COMMAND are treated specially: 1540 2387 1541 -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation2388 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation 1542 2389 1543 2390 The rest of the components are interpreted as arguments to that command (only … … 1559 2406 -all-static do not do any dynamic linking at all 1560 2407 -avoid-version do not add a version suffix if possible 2408 -bindir BINDIR specify path to binaries directory (for systems where 2409 libraries must be found in the PATH setting at runtime) 1561 2410 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime 1562 2411 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols … … 1587 2436 specify library version info [each variable defaults to 0] 1588 2437 -weak LIBNAME declare that the target provides the LIBNAME interface 2438 -Wc,FLAG 2439 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler 2440 -Wl,FLAG 2441 -Xlinker FLAG pass linker-specific FLAG directly to the linker 2442 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) 1589 2443 1590 2444 All other options (arguments beginning with \`-') are ignored. … … 1620 2474 1621 2475 *) 1622 func_fatal_help "invalid operation mode \`$ mode'"2476 func_fatal_help "invalid operation mode \`$opt_mode'" 1623 2477 ;; 1624 2478 esac 1625 2479 1626 $ECHO2480 echo 1627 2481 $ECHO "Try \`$progname --help' for more information about other modes." 1628 1629 exit $? 1630 } 1631 1632 # Now that we've collected a possible --mode arg, show help if necessary 1633 $opt_help && func_mode_help 2482 } 2483 2484 # Now that we've collected a possible --mode arg, show help if necessary 2485 if $opt_help; then 2486 if test "$opt_help" = :; then 2487 func_mode_help 2488 else 2489 { 2490 func_help noexit 2491 for opt_mode in compile link execute install finish uninstall clean; do 2492 func_mode_help 2493 done 2494 } | sed -n '1p; 2,$s/^Usage:/ or: /p' 2495 { 2496 func_help noexit 2497 for opt_mode in compile link execute install finish uninstall clean; do 2498 echo 2499 func_mode_help 2500 done 2501 } | 2502 sed '1d 2503 /^When reporting/,/^Report/{ 2504 H 2505 d 2506 } 2507 $x 2508 /information about other modes/d 2509 /more detailed .*MODE/d 2510 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' 2511 fi 2512 exit $? 2513 fi 1634 2514 1635 2515 … … 1644 2524 1645 2525 # Handle -dlopen flags immediately. 1646 for file in $ execute_dlfiles; do2526 for file in $opt_dlopen; do 1647 2527 test -f "$file" \ 1648 2528 || func_fatal_help "\`$file' is not a file" … … 1651 2531 case $file in 1652 2532 *.la) 2533 func_resolve_sysroot "$file" 2534 file=$func_resolve_sysroot_result 2535 1653 2536 # Check to see that this really is a libtool archive. 1654 2537 func_lalib_unsafe_p "$file" \ … … 1672 2555 1673 2556 if test -f "$dir/$objdir/$dlname"; then 1674 dir="$dir/$objdir"2557 func_append dir "/$objdir" 1675 2558 else 1676 2559 if test ! -f "$dir/$dlname"; then … … 1713 2596 do 1714 2597 case $file in 1715 -* ) ;;2598 -* | *.la | *.lo ) ;; 1716 2599 *) 1717 2600 # Do a test to see if this is really a libtool program. … … 1729 2612 esac 1730 2613 # Quote arguments (to preserve shell metacharacters). 1731 func_quote_for_eval "$file" 1732 args="$args $func_quote_for_eval_result" 2614 func_append_quoted args "$file" 1733 2615 done 1734 2616 … … 1755 2637 if test -n "$shlibpath_var"; then 1756 2638 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" 1757 $ECHO"export $shlibpath_var"2639 echo "export $shlibpath_var" 1758 2640 fi 1759 2641 $ECHO "$cmd$args" … … 1762 2644 } 1763 2645 1764 test "$ mode" = execute && func_mode_execute ${1+"$@"}2646 test "$opt_mode" = execute && func_mode_execute ${1+"$@"} 1765 2647 1766 2648 … … 1769 2651 { 1770 2652 $opt_debug 1771 libdirs="$nonopt" 2653 libs= 2654 libdirs= 1772 2655 admincmds= 1773 2656 2657 for opt in "$nonopt" ${1+"$@"} 2658 do 2659 if test -d "$opt"; then 2660 func_append libdirs " $opt" 2661 2662 elif test -f "$opt"; then 2663 if func_lalib_unsafe_p "$opt"; then 2664 func_append libs " $opt" 2665 else 2666 func_warning "\`$opt' is not a valid libtool archive" 2667 fi 2668 2669 else 2670 func_fatal_error "invalid argument \`$opt'" 2671 fi 2672 done 2673 2674 if test -n "$libs"; then 2675 if test -n "$lt_sysroot"; then 2676 sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` 2677 sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" 2678 else 2679 sysroot_cmd= 2680 fi 2681 2682 # Remove sysroot references 2683 if $opt_dry_run; then 2684 for lib in $libs; do 2685 echo "removing references to $lt_sysroot and \`=' prefixes from $lib" 2686 done 2687 else 2688 tmpdir=`func_mktempdir` 2689 for lib in $libs; do 2690 sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ 2691 > $tmpdir/tmp-la 2692 mv -f $tmpdir/tmp-la $lib 2693 done 2694 ${RM}r "$tmpdir" 2695 fi 2696 fi 2697 1774 2698 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then 1775 for dir1776 do1777 libdirs="$libdirs $dir"1778 done1779 1780 2699 for libdir in $libdirs; do 1781 2700 if test -n "$finish_cmds"; then … … 1787 2706 # Do the single finish_eval. 1788 2707 eval cmds=\"$finish_eval\" 1789 $opt_dry_run || eval "$cmds" || admincmds="$admincmds2708 $opt_dry_run || eval "$cmds" || func_append admincmds " 1790 2709 $cmds" 1791 2710 fi … … 1796 2715 $opt_silent && exit $EXIT_SUCCESS 1797 2716 1798 $ECHO "X----------------------------------------------------------------------" | $Xsed 1799 $ECHO "Libraries have been installed in:" 1800 for libdir in $libdirs; do 1801 $ECHO " $libdir" 1802 done 1803 $ECHO 1804 $ECHO "If you ever happen to want to link against installed libraries" 1805 $ECHO "in a given directory, LIBDIR, you must either use libtool, and" 1806 $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" 1807 $ECHO "flag during linking and do at least one of the following:" 1808 if test -n "$shlibpath_var"; then 1809 $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" 1810 $ECHO " during execution" 2717 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then 2718 echo "----------------------------------------------------------------------" 2719 echo "Libraries have been installed in:" 2720 for libdir in $libdirs; do 2721 $ECHO " $libdir" 2722 done 2723 echo 2724 echo "If you ever happen to want to link against installed libraries" 2725 echo "in a given directory, LIBDIR, you must either use libtool, and" 2726 echo "specify the full pathname of the library, or use the \`-LLIBDIR'" 2727 echo "flag during linking and do at least one of the following:" 2728 if test -n "$shlibpath_var"; then 2729 echo " - add LIBDIR to the \`$shlibpath_var' environment variable" 2730 echo " during execution" 2731 fi 2732 if test -n "$runpath_var"; then 2733 echo " - add LIBDIR to the \`$runpath_var' environment variable" 2734 echo " during linking" 2735 fi 2736 if test -n "$hardcode_libdir_flag_spec"; then 2737 libdir=LIBDIR 2738 eval flag=\"$hardcode_libdir_flag_spec\" 2739 2740 $ECHO " - use the \`$flag' linker flag" 2741 fi 2742 if test -n "$admincmds"; then 2743 $ECHO " - have your system administrator run these commands:$admincmds" 2744 fi 2745 if test -f /etc/ld.so.conf; then 2746 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" 2747 fi 2748 echo 2749 2750 echo "See any operating system documentation about shared libraries for" 2751 case $host in 2752 solaris2.[6789]|solaris2.1[0-9]) 2753 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" 2754 echo "pages." 2755 ;; 2756 *) 2757 echo "more information, such as the ld(1) and ld.so(8) manual pages." 2758 ;; 2759 esac 2760 echo "----------------------------------------------------------------------" 1811 2761 fi 1812 if test -n "$runpath_var"; then1813 $ECHO " - add LIBDIR to the \`$runpath_var' environment variable"1814 $ECHO " during linking"1815 fi1816 if test -n "$hardcode_libdir_flag_spec"; then1817 libdir=LIBDIR1818 eval flag=\"$hardcode_libdir_flag_spec\"1819 1820 $ECHO " - use the \`$flag' linker flag"1821 fi1822 if test -n "$admincmds"; then1823 $ECHO " - have your system administrator run these commands:$admincmds"1824 fi1825 if test -f /etc/ld.so.conf; then1826 $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"1827 fi1828 $ECHO1829 1830 $ECHO "See any operating system documentation about shared libraries for"1831 case $host in1832 solaris2.[6789]|solaris2.1[0-9])1833 $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"1834 $ECHO "pages."1835 ;;1836 *)1837 $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."1838 ;;1839 esac1840 $ECHO "X----------------------------------------------------------------------" | $Xsed1841 2762 exit $EXIT_SUCCESS 1842 2763 } 1843 2764 1844 test "$ mode" = finish && func_mode_finish ${1+"$@"}2765 test "$opt_mode" = finish && func_mode_finish ${1+"$@"} 1845 2766 1846 2767 … … 1853 2774 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || 1854 2775 # Allow the use of GNU shtool's install command. 1855 $ECHO "X$nonopt" | $GREP shtool >/dev/null; then2776 case $nonopt in *shtool*) :;; *) false;; esac; then 1856 2777 # Aesthetically quote it. 1857 2778 func_quote_for_eval "$nonopt" … … 1867 2788 # Aesthetically quote it. 1868 2789 func_quote_for_eval "$arg" 1869 install_prog="$install_prog$func_quote_for_eval_result" 2790 func_append install_prog "$func_quote_for_eval_result" 2791 install_shared_prog=$install_prog 2792 case " $install_prog " in 2793 *[\\\ /]cp\ *) install_cp=: ;; 2794 *) install_cp=false ;; 2795 esac 1870 2796 1871 2797 # We need to accept at least all the BSD install flags. … … 1877 2803 isdir=no 1878 2804 stripme= 2805 no_mode=: 1879 2806 for arg 1880 2807 do 2808 arg2= 1881 2809 if test -n "$dest"; then 1882 f iles="$files$dest"2810 func_append files " $dest" 1883 2811 dest=$arg 1884 2812 continue … … 1888 2816 -d) isdir=yes ;; 1889 2817 -f) 1890 case " $install_prog " in 1891 *[\\\ /]cp\ *) ;; 1892 *) prev=$arg ;; 1893 esac 2818 if $install_cp; then :; else 2819 prev=$arg 2820 fi 1894 2821 ;; 1895 2822 -g | -m | -o) … … 1905 2832 # If the previous option needed an argument, then skip it. 1906 2833 if test -n "$prev"; then 2834 if test "x$prev" = x-m && test -n "$install_override_mode"; then 2835 arg2=$install_override_mode 2836 no_mode=false 2837 fi 1907 2838 prev= 1908 2839 else … … 1915 2846 # Aesthetically quote the argument. 1916 2847 func_quote_for_eval "$arg" 1917 install_prog="$install_prog $func_quote_for_eval_result" 2848 func_append install_prog " $func_quote_for_eval_result" 2849 if test -n "$arg2"; then 2850 func_quote_for_eval "$arg2" 2851 fi 2852 func_append install_shared_prog " $func_quote_for_eval_result" 1918 2853 done 1919 2854 … … 1923 2858 test -n "$prev" && \ 1924 2859 func_fatal_help "the \`$prev' option requires an argument" 2860 2861 if test -n "$install_override_mode" && $no_mode; then 2862 if $install_cp; then :; else 2863 func_quote_for_eval "$install_override_mode" 2864 func_append install_shared_prog " -m $func_quote_for_eval_result" 2865 fi 2866 fi 1925 2867 1926 2868 if test -z "$files"; then … … 1978 2920 *.$libext) 1979 2921 # Do the static libraries later. 1980 staticlibs="$staticlibs$file"2922 func_append staticlibs " $file" 1981 2923 ;; 1982 2924 1983 2925 *.la) 2926 func_resolve_sysroot "$file" 2927 file=$func_resolve_sysroot_result 2928 1984 2929 # Check to see that this really is a libtool archive. 1985 2930 func_lalib_unsafe_p "$file" \ … … 1995 2940 case "$current_libdirs " in 1996 2941 *" $libdir "*) ;; 1997 *) current_libdirs="$current_libdirs$libdir" ;;2942 *) func_append current_libdirs " $libdir" ;; 1998 2943 esac 1999 2944 else … … 2001 2946 case "$future_libdirs " in 2002 2947 *" $libdir "*) ;; 2003 *) fu ture_libdirs="$future_libdirs$libdir" ;;2948 *) func_append future_libdirs " $libdir" ;; 2004 2949 esac 2005 2950 fi … … 2007 2952 func_dirname "$file" "/" "" 2008 2953 dir="$func_dirname_result" 2009 dir="$dir$objdir"2954 func_append dir "$objdir" 2010 2955 2011 2956 if test -n "$relink_command"; then 2012 2957 # Determine the prefix the user has applied to our future dir. 2013 inst_prefix_dir=`$ECHO " X$destdir" | $Xsed-e "s%$libdir\$%%"`2958 inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` 2014 2959 2015 2960 # Don't allow the user to place us outside of our expected … … 2024 2969 if test -n "$inst_prefix_dir"; then 2025 2970 # Stick the inst_prefix_dir data into the link command. 2026 relink_command=`$ECHO " X$relink_command" | $Xsed -e"s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`2971 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` 2027 2972 else 2028 relink_command=`$ECHO " X$relink_command" | $Xsed -e"s%@inst_prefix_dir@%%"`2973 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` 2029 2974 fi 2030 2975 … … 2044 2989 2045 2990 # Install the shared library and build the symlinks. 2046 func_show_eval "$install_ prog $dir/$srcname $destdir/$realname" \2991 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 2047 2992 'exit $?' 2048 2993 tstripme="$stripme" … … 2084 3029 2085 3030 # Maybe install the static library, too. 2086 test -n "$old_library" && staticlibs="$staticlibs$dir/$old_library"3031 test -n "$old_library" && func_append staticlibs " $dir/$old_library" 2087 3032 ;; 2088 3033 … … 2184 3129 func_source "$lib" 2185 3130 fi 2186 libfile="$libdir/"`$ECHO " X$lib" | $Xsed -e's%^.*/%%g'` ### testsuite: skip nested quoting test3131 libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test 2187 3132 if test -n "$libdir" && test ! -f "$libfile"; then 2188 3133 func_warning "\`$lib' has not been installed in \`$libdir'" … … 2203 3148 outputname="$tmpdir/$file" 2204 3149 # Replace the output file specification. 2205 relink_command=`$ECHO " X$relink_command" | $Xsed -e's%@OUTPUT@%'"$outputname"'%g'`3150 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` 2206 3151 2207 3152 $opt_silent || { … … 2222 3167 else 2223 3168 # Install the binary that we compiled earlier. 2224 file=`$ECHO " X$file$stripped_ext" | $Xsed -e"s%\([^/]*\)$%$objdir/\1%"`3169 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` 2225 3170 fi 2226 3171 fi … … 2258 3203 # Set up the ranlib parameters. 2259 3204 oldlib="$destdir/$name" 3205 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 3206 tool_oldlib=$func_to_tool_file_result 2260 3207 2261 3208 func_show_eval "$install_prog \$file \$oldlib" 'exit $?' 2262 3209 2263 3210 if test -n "$stripme" && test -n "$old_striplib"; then 2264 func_show_eval "$old_striplib $ oldlib" 'exit $?'3211 func_show_eval "$old_striplib $tool_oldlib" 'exit $?' 2265 3212 fi 2266 3213 … … 2281 3228 } 2282 3229 2283 test "$ mode" = install && func_mode_install ${1+"$@"}3230 test "$opt_mode" = install && func_mode_install ${1+"$@"} 2284 3231 2285 3232 … … 2324 3271 #endif 2325 3272 3273 #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) 3274 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" 3275 #endif 3276 3277 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ 3278 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) 3279 /* DATA imports from DLLs on WIN32 con't be const, because runtime 3280 relocations are performed -- see ld's documentation on pseudo-relocs. */ 3281 # define LT_DLSYM_CONST 3282 #elif defined(__osf__) 3283 /* This system does not cope well with relocations in const data. */ 3284 # define LT_DLSYM_CONST 3285 #else 3286 # define LT_DLSYM_CONST const 3287 #endif 3288 2326 3289 /* External symbol declarations for the compiler. */\ 2327 3290 " … … 2333 3296 2334 3297 # Add our own program objects to the symbol list. 2335 progfiles=`$ECHO " X$objs$old_deplibs" | $SP2NL | $Xsed -e"$lo2o" | $NL2SP`3298 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` 2336 3299 for progfile in $progfiles; do 2337 func_verbose "extracting global C symbols from \`$progfile'" 2338 $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" 3300 func_to_tool_file "$progfile" func_convert_file_msys_to_w32 3301 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" 3302 $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" 2339 3303 done 2340 3304 … … 2372 3336 eval '$MV "$nlist"T "$nlist"' 2373 3337 case $host in 2374 *cygwin | *mingw* | *cegcc* )3338 *cygwin* | *mingw* | *cegcc* ) 2375 3339 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' 2376 3340 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' … … 2385 3349 func_basename "$dlprefile" 2386 3350 name="$func_basename_result" 2387 $opt_dry_run || { 2388 eval '$ECHO ": $name " >> "$nlist"' 2389 eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" 2390 } 3351 case $host in 3352 *cygwin* | *mingw* | *cegcc* ) 3353 # if an import library, we need to obtain dlname 3354 if func_win32_import_lib_p "$dlprefile"; then 3355 func_tr_sh "$dlprefile" 3356 eval "curr_lafile=\$libfile_$func_tr_sh_result" 3357 dlprefile_dlbasename="" 3358 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then 3359 # Use subshell, to avoid clobbering current variable values 3360 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` 3361 if test -n "$dlprefile_dlname" ; then 3362 func_basename "$dlprefile_dlname" 3363 dlprefile_dlbasename="$func_basename_result" 3364 else 3365 # no lafile. user explicitly requested -dlpreopen <import library>. 3366 $sharedlib_from_linklib_cmd "$dlprefile" 3367 dlprefile_dlbasename=$sharedlib_from_linklib_result 3368 fi 3369 fi 3370 $opt_dry_run || { 3371 if test -n "$dlprefile_dlbasename" ; then 3372 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' 3373 else 3374 func_warning "Could not compute DLL name from $name" 3375 eval '$ECHO ": $name " >> "$nlist"' 3376 fi 3377 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 3378 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | 3379 $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" 3380 } 3381 else # not an import lib 3382 $opt_dry_run || { 3383 eval '$ECHO ": $name " >> "$nlist"' 3384 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 3385 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" 3386 } 3387 fi 3388 ;; 3389 *) 3390 $opt_dry_run || { 3391 eval '$ECHO ": $name " >> "$nlist"' 3392 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 3393 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" 3394 } 3395 ;; 3396 esac 2391 3397 done 2392 3398 … … 2416 3422 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' 2417 3423 else 2418 $ECHO'/* NONE */' >> "$output_objdir/$my_dlsyms"3424 echo '/* NONE */' >> "$output_objdir/$my_dlsyms" 2419 3425 fi 2420 3426 2421 $ECHO>> "$output_objdir/$my_dlsyms" "\3427 echo >> "$output_objdir/$my_dlsyms" "\ 2422 3428 2423 3429 /* The mapping between symbol names and symbols. */ … … 2426 3432 void *address; 2427 3433 } lt_dlsymlist; 2428 " 2429 case $host in 2430 *cygwin* | *mingw* | *cegcc* ) 2431 $ECHO >> "$output_objdir/$my_dlsyms" "\ 2432 /* DATA imports from DLLs on WIN32 con't be const, because 2433 runtime relocations are performed -- see ld's documentation 2434 on pseudo-relocs. */" 2435 lt_dlsym_const= ;; 2436 *osf5*) 2437 echo >> "$output_objdir/$my_dlsyms" "\ 2438 /* This system does not cope well with relocations in const data */" 2439 lt_dlsym_const= ;; 2440 *) 2441 lt_dlsym_const=const ;; 2442 esac 2443 2444 $ECHO >> "$output_objdir/$my_dlsyms" "\ 2445 extern $lt_dlsym_const lt_dlsymlist 3434 extern LT_DLSYM_CONST lt_dlsymlist 2446 3435 lt_${my_prefix}_LTX_preloaded_symbols[]; 2447 $lt_dlsym_constlt_dlsymlist3436 LT_DLSYM_CONST lt_dlsymlist 2448 3437 lt_${my_prefix}_LTX_preloaded_symbols[] = 2449 3438 {\ … … 2458 3447 ;; 2459 3448 esac 2460 $ECHO>> "$output_objdir/$my_dlsyms" "\3449 echo >> "$output_objdir/$my_dlsyms" "\ 2461 3450 {0, (void *) 0} 2462 3451 }; … … 2485 3474 # pic_flag when linking with -static. The problem exists in 2486 3475 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. 2487 *-*-freebsd2 *|*-*-freebsd3.0*|*-*-freebsdelf3.0*)3476 *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) 2488 3477 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; 2489 3478 *-*-hpux*) … … 2501 3490 case $arg in 2502 3491 -pie | -fpie | -fPIE) ;; 2503 *) symtab_cflags="$symtab_cflags$arg" ;;3492 *) func_append symtab_cflags " $arg" ;; 2504 3493 esac 2505 3494 done … … 2516 3505 *cygwin* | *mingw* | *cegcc* ) 2517 3506 if test -f "$output_objdir/$my_outputname.def"; then 2518 compile_command=`$ECHO " X$compile_command" | $Xsed -e"s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`2519 finalize_command=`$ECHO " X$finalize_command" | $Xsed -e"s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`3507 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` 3508 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` 2520 3509 else 2521 compile_command=`$ECHO " X$compile_command" | $Xsed -e"s%@SYMFILE@%$symfileobj%"`2522 finalize_command=`$ECHO " X$finalize_command" | $Xsed -e"s%@SYMFILE@%$symfileobj%"`3510 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` 3511 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` 2523 3512 fi 2524 3513 ;; 2525 3514 *) 2526 compile_command=`$ECHO " X$compile_command" | $Xsed -e"s%@SYMFILE@%$symfileobj%"`2527 finalize_command=`$ECHO " X$finalize_command" | $Xsed -e"s%@SYMFILE@%$symfileobj%"`3515 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` 3516 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` 2528 3517 ;; 2529 3518 esac … … 2539 3528 2540 3529 # Nullify the symbol file. 2541 compile_command=`$ECHO " X$compile_command" | $Xsed -e"s% @SYMFILE@%%"`2542 finalize_command=`$ECHO " X$finalize_command" | $Xsed -e"s% @SYMFILE@%%"`3530 compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` 3531 finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` 2543 3532 fi 2544 3533 } … … 2550 3539 # Has to be a shell function in order to 'eat' the argument 2551 3540 # that is supplied when $file_magic_command is called. 3541 # Despite the name, also deal with 64 bit binaries. 2552 3542 func_win32_libid () 2553 3543 { … … 2560 3550 ;; 2561 3551 *ar\ archive*) # could be an import, or static 3552 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. 2562 3553 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | 2563 $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then 2564 win32_nmres=`eval $NM -f posix -A $1 | 3554 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then 3555 func_to_tool_file "$1" func_convert_file_msys_to_w32 3556 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | 2565 3557 $SED -n -e ' 2566 3558 1,100{ … … 2591 3583 } 2592 3584 3585 # func_cygming_dll_for_implib ARG 3586 # 3587 # Platform-specific function to extract the 3588 # name of the DLL associated with the specified 3589 # import library ARG. 3590 # Invoked by eval'ing the libtool variable 3591 # $sharedlib_from_linklib_cmd 3592 # Result is available in the variable 3593 # $sharedlib_from_linklib_result 3594 func_cygming_dll_for_implib () 3595 { 3596 $opt_debug 3597 sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` 3598 } 3599 3600 # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs 3601 # 3602 # The is the core of a fallback implementation of a 3603 # platform-specific function to extract the name of the 3604 # DLL associated with the specified import library LIBNAME. 3605 # 3606 # SECTION_NAME is either .idata$6 or .idata$7, depending 3607 # on the platform and compiler that created the implib. 3608 # 3609 # Echos the name of the DLL associated with the 3610 # specified import library. 3611 func_cygming_dll_for_implib_fallback_core () 3612 { 3613 $opt_debug 3614 match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` 3615 $OBJDUMP -s --section "$1" "$2" 2>/dev/null | 3616 $SED '/^Contents of section '"$match_literal"':/{ 3617 # Place marker at beginning of archive member dllname section 3618 s/.*/====MARK====/ 3619 p 3620 d 3621 } 3622 # These lines can sometimes be longer than 43 characters, but 3623 # are always uninteresting 3624 /:[ ]*file format pe[i]\{,1\}-/d 3625 /^In archive [^:]*:/d 3626 # Ensure marker is printed 3627 /^====MARK====/p 3628 # Remove all lines with less than 43 characters 3629 /^.\{43\}/!d 3630 # From remaining lines, remove first 43 characters 3631 s/^.\{43\}//' | 3632 $SED -n ' 3633 # Join marker and all lines until next marker into a single line 3634 /^====MARK====/ b para 3635 H 3636 $ b para 3637 b 3638 :para 3639 x 3640 s/\n//g 3641 # Remove the marker 3642 s/^====MARK====// 3643 # Remove trailing dots and whitespace 3644 s/[\. \t]*$// 3645 # Print 3646 /./p' | 3647 # we now have a list, one entry per line, of the stringified 3648 # contents of the appropriate section of all members of the 3649 # archive which possess that section. Heuristic: eliminate 3650 # all those which have a first or second character that is 3651 # a '.' (that is, objdump's representation of an unprintable 3652 # character.) This should work for all archives with less than 3653 # 0x302f exports -- but will fail for DLLs whose name actually 3654 # begins with a literal '.' or a single character followed by 3655 # a '.'. 3656 # 3657 # Of those that remain, print the first one. 3658 $SED -e '/^\./d;/^.\./d;q' 3659 } 3660 3661 # func_cygming_gnu_implib_p ARG 3662 # This predicate returns with zero status (TRUE) if 3663 # ARG is a GNU/binutils-style import library. Returns 3664 # with nonzero status (FALSE) otherwise. 3665 func_cygming_gnu_implib_p () 3666 { 3667 $opt_debug 3668 func_to_tool_file "$1" func_convert_file_msys_to_w32 3669 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` 3670 test -n "$func_cygming_gnu_implib_tmp" 3671 } 3672 3673 # func_cygming_ms_implib_p ARG 3674 # This predicate returns with zero status (TRUE) if 3675 # ARG is an MS-style import library. Returns 3676 # with nonzero status (FALSE) otherwise. 3677 func_cygming_ms_implib_p () 3678 { 3679 $opt_debug 3680 func_to_tool_file "$1" func_convert_file_msys_to_w32 3681 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` 3682 test -n "$func_cygming_ms_implib_tmp" 3683 } 3684 3685 # func_cygming_dll_for_implib_fallback ARG 3686 # Platform-specific function to extract the 3687 # name of the DLL associated with the specified 3688 # import library ARG. 3689 # 3690 # This fallback implementation is for use when $DLLTOOL 3691 # does not support the --identify-strict option. 3692 # Invoked by eval'ing the libtool variable 3693 # $sharedlib_from_linklib_cmd 3694 # Result is available in the variable 3695 # $sharedlib_from_linklib_result 3696 func_cygming_dll_for_implib_fallback () 3697 { 3698 $opt_debug 3699 if func_cygming_gnu_implib_p "$1" ; then 3700 # binutils import library 3701 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` 3702 elif func_cygming_ms_implib_p "$1" ; then 3703 # ms-generated import library 3704 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` 3705 else 3706 # unknown 3707 sharedlib_from_linklib_result="" 3708 fi 3709 } 2593 3710 2594 3711 … … 2599 3716 f_ex_an_ar_dir="$1"; shift 2600 3717 f_ex_an_ar_oldlib="$1" 2601 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' 3718 if test "$lock_old_archive_extraction" = yes; then 3719 lockfile=$f_ex_an_ar_oldlib.lock 3720 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do 3721 func_echo "Waiting for $lockfile to be removed" 3722 sleep 2 3723 done 3724 fi 3725 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 3726 'stat=$?; rm -f "$lockfile"; exit $stat' 3727 if test "$lock_old_archive_extraction" = yes; then 3728 $opt_dry_run || rm -f "$lockfile" 3729 fi 2602 3730 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then 2603 3731 : … … 2670 3798 darwin_files= 2671 3799 for darwin_file in $darwin_filelist; do 2672 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`3800 darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` 2673 3801 $LIPO -create -output "$darwin_file" $darwin_files 2674 3802 done # $darwin_filelist … … 2685 3813 ;; 2686 3814 esac 2687 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`3815 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` 2688 3816 done 2689 3817 2690 3818 func_extract_archives_result="$my_oldobjs" 2691 3819 } 2692 2693 2694 2695 # func_emit_wrapper_part1 [arg=no]2696 #2697 # Emit the first part of a libtool wrapper script on stdout.2698 # For more information, see the description associated with2699 # func_emit_wrapper(), below.2700 func_emit_wrapper_part1 ()2701 {2702 func_emit_wrapper_part1_arg1=no2703 if test -n "$1" ; then2704 func_emit_wrapper_part1_arg1=$12705 fi2706 2707 $ECHO "\2708 #! $SHELL2709 2710 # $output - temporary wrapper script for $objdir/$outputname2711 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION2712 #2713 # The $output program cannot be directly executed until all the libtool2714 # libraries that it depends on are installed.2715 #2716 # This wrapper script should never be moved out of the build directory.2717 # If it is, it will not operate correctly.2718 2719 # Sed substitution that helps us do robust quoting. It backslashifies2720 # metacharacters that are still active within double-quoted strings.2721 Xsed='${SED} -e 1s/^X//'2722 sed_quote_subst='$sed_quote_subst'2723 2724 # Be Bourne compatible2725 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then2726 emulate sh2727 NULLCMD=:2728 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which2729 # is contrary to our usage. Disable this feature.2730 alias -g '\${1+\"\$@\"}'='\"\$@\"'2731 setopt NO_GLOB_SUBST2732 else2733 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac2734 fi2735 BIN_SH=xpg4; export BIN_SH # for Tru642736 DUALCASE=1; export DUALCASE # for MKS sh2737 2738 # The HP-UX ksh and POSIX shell print the target directory to stdout2739 # if CDPATH is set.2740 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH2741 2742 relink_command=\"$relink_command\"2743 2744 # This environment variable determines our operation mode.2745 if test \"\$libtool_install_magic\" = \"$magic\"; then2746 # install mode needs the following variables:2747 generated_by_libtool_version='$macro_version'2748 notinst_deplibs='$notinst_deplibs'2749 else2750 # When we are sourced in execute mode, \$file and \$ECHO are already set.2751 if test \"\$libtool_execute_magic\" != \"$magic\"; then2752 ECHO=\"$qecho\"2753 file=\"\$0\"2754 # Make sure echo works.2755 if test \"X\$1\" = X--no-reexec; then2756 # Discard the --no-reexec flag, and continue.2757 shift2758 elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then2759 # Yippee, \$ECHO works!2760 :2761 else2762 # Restart under the correct shell, and then maybe \$ECHO will work.2763 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}2764 fi2765 fi\2766 "2767 $ECHO "\2768 2769 # Find the directory that this script lives in.2770 thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`2771 test \"x\$thisdir\" = \"x\$file\" && thisdir=.2772 2773 # Follow symbolic links until we get to the real thisdir.2774 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`2775 while test -n \"\$file\"; do2776 destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`2777 2778 # If there was a directory component, then change thisdir.2779 if test \"x\$destdir\" != \"x\$file\"; then2780 case \"\$destdir\" in2781 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;2782 *) thisdir=\"\$thisdir/\$destdir\" ;;2783 esac2784 fi2785 2786 file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`2787 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`2788 done2789 "2790 }2791 # end: func_emit_wrapper_part12792 2793 # func_emit_wrapper_part2 [arg=no]2794 #2795 # Emit the second part of a libtool wrapper script on stdout.2796 # For more information, see the description associated with2797 # func_emit_wrapper(), below.2798 func_emit_wrapper_part2 ()2799 {2800 func_emit_wrapper_part2_arg1=no2801 if test -n "$1" ; then2802 func_emit_wrapper_part2_arg1=$12803 fi2804 2805 $ECHO "\2806 2807 # Usually 'no', except on cygwin/mingw when embedded into2808 # the cwrapper.2809 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg12810 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then2811 # special case for '.'2812 if test \"\$thisdir\" = \".\"; then2813 thisdir=\`pwd\`2814 fi2815 # remove .libs from thisdir2816 case \"\$thisdir\" in2817 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;2818 $objdir ) thisdir=. ;;2819 esac2820 fi2821 2822 # Try to get the absolute directory name.2823 absdir=\`cd \"\$thisdir\" && pwd\`2824 test -n \"\$absdir\" && thisdir=\"\$absdir\"2825 "2826 2827 if test "$fast_install" = yes; then2828 $ECHO "\2829 program=lt-'$outputname'$exeext2830 progdir=\"\$thisdir/$objdir\"2831 2832 if test ! -f \"\$progdir/\$program\" ||2833 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\2834 test \"X\$file\" != \"X\$progdir/\$program\"; }; then2835 2836 file=\"\$\$-\$program\"2837 2838 if test ! -d \"\$progdir\"; then2839 $MKDIR \"\$progdir\"2840 else2841 $RM \"\$progdir/\$file\"2842 fi"2843 2844 $ECHO "\2845 2846 # relink executable if necessary2847 if test -n \"\$relink_command\"; then2848 if relink_command_output=\`eval \$relink_command 2>&1\`; then :2849 else2850 $ECHO \"\$relink_command_output\" >&22851 $RM \"\$progdir/\$file\"2852 exit 12853 fi2854 fi2855 2856 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||2857 { $RM \"\$progdir/\$program\";2858 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }2859 $RM \"\$progdir/\$file\"2860 fi"2861 else2862 $ECHO "\2863 program='$outputname'2864 progdir=\"\$thisdir/$objdir\"2865 "2866 fi2867 2868 $ECHO "\2869 2870 if test -f \"\$progdir/\$program\"; then"2871 2872 # Export our shlibpath_var if we have one.2873 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then2874 $ECHO "\2875 # Add our own library path to $shlibpath_var2876 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"2877 2878 # Some systems cannot cope with colon-terminated $shlibpath_var2879 # The second colon is a workaround for a bug in BeOS R4 sed2880 $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`2881 2882 export $shlibpath_var2883 "2884 fi2885 2886 # fixup the dll searchpath if we need to.2887 if test -n "$dllsearchpath"; then2888 $ECHO "\2889 # Add the dll search path components to the executable PATH2890 PATH=$dllsearchpath:\$PATH2891 "2892 fi2893 2894 $ECHO "\2895 if test \"\$libtool_execute_magic\" != \"$magic\"; then2896 # Run the actual program with our arguments.2897 "2898 case $host in2899 # Backslashes separate directories on plain windows2900 *-*-mingw | *-*-os2* | *-cegcc*)2901 $ECHO "\2902 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}2903 "2904 ;;2905 2906 *)2907 $ECHO "\2908 exec \"\$progdir/\$program\" \${1+\"\$@\"}2909 "2910 ;;2911 esac2912 $ECHO "\2913 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&22914 exit 12915 fi2916 else2917 # The program doesn't exist.2918 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&22919 \$ECHO \"This script is just a wrapper for \$program.\" 1>&22920 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&22921 exit 12922 fi2923 fi\2924 "2925 }2926 # end: func_emit_wrapper_part22927 3820 2928 3821 … … 2943 3836 func_emit_wrapper () 2944 3837 { 2945 func_emit_wrapper_arg1=no 2946 if test -n "$1" ; then 2947 func_emit_wrapper_arg1=$1 2948 fi 2949 2950 # split this up so that func_emit_cwrapperexe_src 2951 # can call each part independently. 2952 func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" 2953 func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" 2954 } 2955 2956 2957 # func_to_host_path arg 3838 func_emit_wrapper_arg1=${1-no} 3839 3840 $ECHO "\ 3841 #! $SHELL 3842 3843 # $output - temporary wrapper script for $objdir/$outputname 3844 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION 2958 3845 # 2959 # Convert paths to host format when used with build tools. 2960 # Intended for use with "native" mingw (where libtool itself 2961 # is running under the msys shell), or in the following cross- 2962 # build environments: 2963 # $build $host 2964 # mingw (msys) mingw [e.g. native] 2965 # cygwin mingw 2966 # *nix + wine mingw 2967 # where wine is equipped with the `winepath' executable. 2968 # In the native mingw case, the (msys) shell automatically 2969 # converts paths for any non-msys applications it launches, 2970 # but that facility isn't available from inside the cwrapper. 2971 # Similar accommodations are necessary for $host mingw and 2972 # $build cygwin. Calling this function does no harm for other 2973 # $host/$build combinations not listed above. 3846 # The $output program cannot be directly executed until all the libtool 3847 # libraries that it depends on are installed. 2974 3848 # 2975 # ARG is the path (on $build) that should be converted to 2976 # the proper representation for $host. The result is stored 2977 # in $func_to_host_path_result. 2978 func_to_host_path () 2979 { 2980 func_to_host_path_result="$1" 2981 if test -n "$1" ; then 2982 case $host in 2983 *mingw* ) 2984 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' 2985 case $build in 2986 *mingw* ) # actually, msys 2987 # awkward: cmd appends spaces to result 2988 lt_sed_strip_trailing_spaces="s/[ ]*\$//" 2989 func_to_host_path_tmp1=`( cmd //c echo "$1" |\ 2990 $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` 2991 func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ 2992 $SED -e "$lt_sed_naive_backslashify"` 2993 ;; 2994 *cygwin* ) 2995 func_to_host_path_tmp1=`cygpath -w "$1"` 2996 func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ 2997 $SED -e "$lt_sed_naive_backslashify"` 2998 ;; 2999 * ) 3000 # Unfortunately, winepath does not exit with a non-zero 3001 # error code, so we are forced to check the contents of 3002 # stdout. On the other hand, if the command is not 3003 # found, the shell will set an exit code of 127 and print 3004 # *an error message* to stdout. So we must check for both 3005 # error code of zero AND non-empty stdout, which explains 3006 # the odd construction: 3007 func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` 3008 if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then 3009 func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ 3010 $SED -e "$lt_sed_naive_backslashify"` 3011 else 3012 # Allow warning below. 3013 func_to_host_path_result="" 3014 fi 3015 ;; 3016 esac 3017 if test -z "$func_to_host_path_result" ; then 3018 func_error "Could not determine host path corresponding to" 3019 func_error " '$1'" 3020 func_error "Continuing, but uninstalled executables may not work." 3021 # Fallback: 3022 func_to_host_path_result="$1" 3023 fi 3024 ;; 3849 # This wrapper script should never be moved out of the build directory. 3850 # If it is, it will not operate correctly. 3851 3852 # Sed substitution that helps us do robust quoting. It backslashifies 3853 # metacharacters that are still active within double-quoted strings. 3854 sed_quote_subst='$sed_quote_subst' 3855 3856 # Be Bourne compatible 3857 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then 3858 emulate sh 3859 NULLCMD=: 3860 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which 3861 # is contrary to our usage. Disable this feature. 3862 alias -g '\${1+\"\$@\"}'='\"\$@\"' 3863 setopt NO_GLOB_SUBST 3864 else 3865 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac 3866 fi 3867 BIN_SH=xpg4; export BIN_SH # for Tru64 3868 DUALCASE=1; export DUALCASE # for MKS sh 3869 3870 # The HP-UX ksh and POSIX shell print the target directory to stdout 3871 # if CDPATH is set. 3872 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH 3873 3874 relink_command=\"$relink_command\" 3875 3876 # This environment variable determines our operation mode. 3877 if test \"\$libtool_install_magic\" = \"$magic\"; then 3878 # install mode needs the following variables: 3879 generated_by_libtool_version='$macro_version' 3880 notinst_deplibs='$notinst_deplibs' 3881 else 3882 # When we are sourced in execute mode, \$file and \$ECHO are already set. 3883 if test \"\$libtool_execute_magic\" != \"$magic\"; then 3884 file=\"\$0\"" 3885 3886 qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` 3887 $ECHO "\ 3888 3889 # A function that is used when there is no print builtin or printf. 3890 func_fallback_echo () 3891 { 3892 eval 'cat <<_LTECHO_EOF 3893 \$1 3894 _LTECHO_EOF' 3895 } 3896 ECHO=\"$qECHO\" 3897 fi 3898 3899 # Very basic option parsing. These options are (a) specific to 3900 # the libtool wrapper, (b) are identical between the wrapper 3901 # /script/ and the wrapper /executable/ which is used only on 3902 # windows platforms, and (c) all begin with the string "--lt-" 3903 # (application programs are unlikely to have options which match 3904 # this pattern). 3905 # 3906 # There are only two supported options: --lt-debug and 3907 # --lt-dump-script. There is, deliberately, no --lt-help. 3908 # 3909 # The first argument to this parsing function should be the 3910 # script's $0 value, followed by "$@". 3911 lt_option_debug= 3912 func_parse_lt_options () 3913 { 3914 lt_script_arg0=\$0 3915 shift 3916 for lt_opt 3917 do 3918 case \"\$lt_opt\" in 3919 --lt-debug) lt_option_debug=1 ;; 3920 --lt-dump-script) 3921 lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` 3922 test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. 3923 lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` 3924 cat \"\$lt_dump_D/\$lt_dump_F\" 3925 exit 0 3926 ;; 3927 --lt-*) 3928 \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 3929 exit 1 3930 ;; 3931 esac 3932 done 3933 3934 # Print the debug banner immediately: 3935 if test -n \"\$lt_option_debug\"; then 3936 echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 3937 fi 3938 } 3939 3940 # Used when --lt-debug. Prints its arguments to stdout 3941 # (redirection is the responsibility of the caller) 3942 func_lt_dump_args () 3943 { 3944 lt_dump_args_N=1; 3945 for lt_arg 3946 do 3947 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" 3948 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` 3949 done 3950 } 3951 3952 # Core function for launching the target application 3953 func_exec_program_core () 3954 { 3955 " 3956 case $host in 3957 # Backslashes separate directories on plain windows 3958 *-*-mingw | *-*-os2* | *-cegcc*) 3959 $ECHO "\ 3960 if test -n \"\$lt_option_debug\"; then 3961 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 3962 func_lt_dump_args \${1+\"\$@\"} 1>&2 3963 fi 3964 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} 3965 " 3966 ;; 3967 3968 *) 3969 $ECHO "\ 3970 if test -n \"\$lt_option_debug\"; then 3971 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 3972 func_lt_dump_args \${1+\"\$@\"} 1>&2 3973 fi 3974 exec \"\$progdir/\$program\" \${1+\"\$@\"} 3975 " 3976 ;; 3977 esac 3978 $ECHO "\ 3979 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 3980 exit 1 3981 } 3982 3983 # A function to encapsulate launching the target application 3984 # Strips options in the --lt-* namespace from \$@ and 3985 # launches target application with the remaining arguments. 3986 func_exec_program () 3987 { 3988 case \" \$* \" in 3989 *\\ --lt-*) 3990 for lt_wr_arg 3991 do 3992 case \$lt_wr_arg in 3993 --lt-*) ;; 3994 *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; 3995 esac 3996 shift 3997 done ;; 3998 esac 3999 func_exec_program_core \${1+\"\$@\"} 4000 } 4001 4002 # Parse options 4003 func_parse_lt_options \"\$0\" \${1+\"\$@\"} 4004 4005 # Find the directory that this script lives in. 4006 thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` 4007 test \"x\$thisdir\" = \"x\$file\" && thisdir=. 4008 4009 # Follow symbolic links until we get to the real thisdir. 4010 file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` 4011 while test -n \"\$file\"; do 4012 destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` 4013 4014 # If there was a directory component, then change thisdir. 4015 if test \"x\$destdir\" != \"x\$file\"; then 4016 case \"\$destdir\" in 4017 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; 4018 *) thisdir=\"\$thisdir/\$destdir\" ;; 4019 esac 4020 fi 4021 4022 file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` 4023 file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` 4024 done 4025 4026 # Usually 'no', except on cygwin/mingw when embedded into 4027 # the cwrapper. 4028 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 4029 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then 4030 # special case for '.' 4031 if test \"\$thisdir\" = \".\"; then 4032 thisdir=\`pwd\` 4033 fi 4034 # remove .libs from thisdir 4035 case \"\$thisdir\" in 4036 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; 4037 $objdir ) thisdir=. ;; 3025 4038 esac 3026 4039 fi 3027 } 3028 # end: func_to_host_path 3029 3030 # func_to_host_pathlist arg 3031 # 3032 # Convert pathlists to host format when used with build tools. 3033 # See func_to_host_path(), above. This function supports the 3034 # following $build/$host combinations (but does no harm for 3035 # combinations not listed here): 3036 # $build $host 3037 # mingw (msys) mingw [e.g. native] 3038 # cygwin mingw 3039 # *nix + wine mingw 3040 # 3041 # Path separators are also converted from $build format to 3042 # $host format. If ARG begins or ends with a path separator 3043 # character, it is preserved (but converted to $host format) 3044 # on output. 3045 # 3046 # ARG is a pathlist (on $build) that should be converted to 3047 # the proper representation on $host. The result is stored 3048 # in $func_to_host_pathlist_result. 3049 func_to_host_pathlist () 3050 { 3051 func_to_host_pathlist_result="$1" 3052 if test -n "$1" ; then 3053 case $host in 3054 *mingw* ) 3055 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' 3056 # Remove leading and trailing path separator characters from 3057 # ARG. msys behavior is inconsistent here, cygpath turns them 3058 # into '.;' and ';.', and winepath ignores them completely. 3059 func_to_host_pathlist_tmp2="$1" 3060 # Once set for this call, this variable should not be 3061 # reassigned. It is used in tha fallback case. 3062 func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ 3063 $SED -e 's|^:*||' -e 's|:*$||'` 3064 case $build in 3065 *mingw* ) # Actually, msys. 3066 # Awkward: cmd appends spaces to result. 3067 lt_sed_strip_trailing_spaces="s/[ ]*\$//" 3068 func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ 3069 $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` 3070 func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ 3071 $SED -e "$lt_sed_naive_backslashify"` 3072 ;; 3073 *cygwin* ) 3074 func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` 3075 func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ 3076 $SED -e "$lt_sed_naive_backslashify"` 3077 ;; 3078 * ) 3079 # unfortunately, winepath doesn't convert pathlists 3080 func_to_host_pathlist_result="" 3081 func_to_host_pathlist_oldIFS=$IFS 3082 IFS=: 3083 for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do 3084 IFS=$func_to_host_pathlist_oldIFS 3085 if test -n "$func_to_host_pathlist_f" ; then 3086 func_to_host_path "$func_to_host_pathlist_f" 3087 if test -n "$func_to_host_path_result" ; then 3088 if test -z "$func_to_host_pathlist_result" ; then 3089 func_to_host_pathlist_result="$func_to_host_path_result" 3090 else 3091 func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" 3092 fi 3093 fi 3094 fi 3095 IFS=: 3096 done 3097 IFS=$func_to_host_pathlist_oldIFS 3098 ;; 3099 esac 3100 if test -z "$func_to_host_pathlist_result" ; then 3101 func_error "Could not determine the host path(s) corresponding to" 3102 func_error " '$1'" 3103 func_error "Continuing, but uninstalled executables may not work." 3104 # Fallback. This may break if $1 contains DOS-style drive 3105 # specifications. The fix is not to complicate the expression 3106 # below, but for the user to provide a working wine installation 3107 # with winepath so that path translation in the cross-to-mingw 3108 # case works properly. 3109 lt_replace_pathsep_nix_to_dos="s|:|;|g" 3110 func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ 3111 $SED -e "$lt_replace_pathsep_nix_to_dos"` 3112 fi 3113 # Now, add the leading and trailing path separators back 3114 case "$1" in 3115 :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" 3116 ;; 3117 esac 3118 case "$1" in 3119 *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" 3120 ;; 3121 esac 3122 ;; 3123 esac 4040 4041 # Try to get the absolute directory name. 4042 absdir=\`cd \"\$thisdir\" && pwd\` 4043 test -n \"\$absdir\" && thisdir=\"\$absdir\" 4044 " 4045 4046 if test "$fast_install" = yes; then 4047 $ECHO "\ 4048 program=lt-'$outputname'$exeext 4049 progdir=\"\$thisdir/$objdir\" 4050 4051 if test ! -f \"\$progdir/\$program\" || 4052 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ 4053 test \"X\$file\" != \"X\$progdir/\$program\"; }; then 4054 4055 file=\"\$\$-\$program\" 4056 4057 if test ! -d \"\$progdir\"; then 4058 $MKDIR \"\$progdir\" 4059 else 4060 $RM \"\$progdir/\$file\" 4061 fi" 4062 4063 $ECHO "\ 4064 4065 # relink executable if necessary 4066 if test -n \"\$relink_command\"; then 4067 if relink_command_output=\`eval \$relink_command 2>&1\`; then : 4068 else 4069 $ECHO \"\$relink_command_output\" >&2 4070 $RM \"\$progdir/\$file\" 4071 exit 1 4072 fi 4073 fi 4074 4075 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || 4076 { $RM \"\$progdir/\$program\"; 4077 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } 4078 $RM \"\$progdir/\$file\" 4079 fi" 4080 else 4081 $ECHO "\ 4082 program='$outputname' 4083 progdir=\"\$thisdir/$objdir\" 4084 " 4085 fi 4086 4087 $ECHO "\ 4088 4089 if test -f \"\$progdir/\$program\"; then" 4090 4091 # fixup the dll searchpath if we need to. 4092 # 4093 # Fix the DLL searchpath if we need to. Do this before prepending 4094 # to shlibpath, because on Windows, both are PATH and uninstalled 4095 # libraries must come first. 4096 if test -n "$dllsearchpath"; then 4097 $ECHO "\ 4098 # Add the dll search path components to the executable PATH 4099 PATH=$dllsearchpath:\$PATH 4100 " 4101 fi 4102 4103 # Export our shlibpath_var if we have one. 4104 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then 4105 $ECHO "\ 4106 # Add our own library path to $shlibpath_var 4107 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" 4108 4109 # Some systems cannot cope with colon-terminated $shlibpath_var 4110 # The second colon is a workaround for a bug in BeOS R4 sed 4111 $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` 4112 4113 export $shlibpath_var 4114 " 4115 fi 4116 4117 $ECHO "\ 4118 if test \"\$libtool_execute_magic\" != \"$magic\"; then 4119 # Run the actual program with our arguments. 4120 func_exec_program \${1+\"\$@\"} 4121 fi 4122 else 4123 # The program doesn't exist. 4124 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 4125 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 4126 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 4127 exit 1 3124 4128 fi 3125 } 3126 # end: func_to_host_pathlist 4129 fi\ 4130 " 4131 } 4132 3127 4133 3128 4134 # func_emit_cwrapperexe_src … … 3142 4148 This wrapper executable should never be moved out of the build directory. 3143 4149 If it is, it will not operate correctly. 3144 3145 Currently, it simply execs the wrapper *script* "$SHELL $output",3146 but could eventually absorb all of the scripts functionality and3147 exec $objdir/$outputname directly.3148 4150 */ 3149 4151 EOF 3150 4152 cat <<"EOF" 4153 #ifdef _MSC_VER 4154 # define _CRT_SECURE_NO_DEPRECATE 1 4155 #endif 3151 4156 #include <stdio.h> 3152 4157 #include <stdlib.h> … … 3155 4160 # include <process.h> 3156 4161 # include <io.h> 3157 # define setmode _setmode3158 4162 #else 3159 4163 # include <unistd.h> … … 3161 4165 # ifdef __CYGWIN__ 3162 4166 # include <io.h> 3163 # define HAVE_SETENV3164 # ifdef __STRICT_ANSI__3165 char *realpath (const char *, char *);3166 int putenv (char *);3167 int setenv (const char *, const char *, int);3168 # endif3169 4167 # endif 3170 4168 #endif … … 3178 4176 #include <sys/stat.h> 3179 4177 4178 /* declarations of non-ANSI functions */ 4179 #if defined(__MINGW32__) 4180 # ifdef __STRICT_ANSI__ 4181 int _putenv (const char *); 4182 # endif 4183 #elif defined(__CYGWIN__) 4184 # ifdef __STRICT_ANSI__ 4185 char *realpath (const char *, char *); 4186 int putenv (char *); 4187 int setenv (const char *, const char *, int); 4188 # endif 4189 /* #elif defined (other platforms) ... */ 4190 #endif 4191 4192 /* portability defines, excluding path handling macros */ 4193 #if defined(_MSC_VER) 4194 # define setmode _setmode 4195 # define stat _stat 4196 # define chmod _chmod 4197 # define getcwd _getcwd 4198 # define putenv _putenv 4199 # define S_IXUSR _S_IEXEC 4200 # ifndef _INTPTR_T_DEFINED 4201 # define _INTPTR_T_DEFINED 4202 # define intptr_t int 4203 # endif 4204 #elif defined(__MINGW32__) 4205 # define setmode _setmode 4206 # define stat _stat 4207 # define chmod _chmod 4208 # define getcwd _getcwd 4209 # define putenv _putenv 4210 #elif defined(__CYGWIN__) 4211 # define HAVE_SETENV 4212 # define FOPEN_WB "wb" 4213 /* #elif defined (other platforms) ... */ 4214 #endif 4215 3180 4216 #if defined(PATH_MAX) 3181 4217 # define LT_PATHMAX PATH_MAX … … 3193 4229 #endif 3194 4230 3195 #ifdef _MSC_VER 3196 # define S_IXUSR _S_IEXEC 3197 # define stat _stat 3198 # ifndef _INTPTR_T_DEFINED 3199 # define intptr_t int 3200 # endif 3201 #endif 3202 4231 /* path handling portability macros */ 3203 4232 #ifndef DIR_SEPARATOR 3204 4233 # define DIR_SEPARATOR '/' … … 3231 4260 #endif /* PATH_SEPARATOR_2 */ 3232 4261 3233 #ifdef __CYGWIN__3234 # define FOPEN_WB "wb"3235 #endif3236 3237 4262 #ifndef FOPEN_WB 3238 4263 # define FOPEN_WB "w" … … 3247 4272 } while (0) 3248 4273 3249 #undef LTWRAPPER_DEBUGPRINTF 3250 #if defined DEBUGWRAPPER 3251 # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args 3252 static void 3253 ltwrapper_debugprintf (const char *fmt, ...) 3254 { 3255 va_list args; 3256 va_start (args, fmt); 3257 (void) vfprintf (stderr, fmt, args); 3258 va_end (args); 3259 } 4274 #if defined(LT_DEBUGWRAPPER) 4275 static int lt_debug = 1; 3260 4276 #else 3261 # define LTWRAPPER_DEBUGPRINTF(args) 4277 static int lt_debug = 0; 3262 4278 #endif 3263 4279 3264 const char *program_name = NULL;4280 const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ 3265 4281 3266 4282 void *xmalloc (size_t num); … … 3272 4288 int check_executable (const char *path); 3273 4289 char *strendzap (char *str, const char *pat); 3274 void lt_fatal (const char *message, ...); 4290 void lt_debugprintf (const char *file, int line, const char *fmt, ...); 4291 void lt_fatal (const char *file, int line, const char *message, ...); 4292 static const char *nonnull (const char *s); 4293 static const char *nonempty (const char *s); 3275 4294 void lt_setenv (const char *name, const char *value); 3276 4295 char *lt_extend_str (const char *orig_value, const char *add, int to_end); 3277 void lt_opt_process_env_set (const char *arg);3278 void lt_opt_process_env_prepend (const char *arg);3279 void lt_opt_process_env_append (const char *arg);3280 int lt_split_name_value (const char *arg, char** name, char** value);3281 4296 void lt_update_exe_path (const char *name, const char *value); 3282 4297 void lt_update_lib_path (const char *name, const char *value); 3283 3284 static const char *script_text_part1 = 4298 char **prepare_spawn (char **argv); 4299 void lt_dump_script (FILE *f); 3285 4300 EOF 3286 4301 3287 func_emit_wrapper_part1 yes |3288 $SED -e 's/\([\\"]\)/\\\1/g' \3289 -e 's/^/ "/' -e 's/$/\\n"/'3290 echo ";"3291 4302 cat <<EOF 3292 3293 static const char *script_text_part2 = 3294 EOF 3295 func_emit_wrapper_part2 yes | 3296 $SED -e 's/\([\\"]\)/\\\1/g' \ 3297 -e 's/^/ "/' -e 's/$/\\n"/' 3298 echo ";" 3299 3300 cat <<EOF 3301 const char * MAGIC_EXE = "$magic_exe"; 4303 volatile const char * MAGIC_EXE = "$magic_exe"; 3302 4304 const char * LIB_PATH_VARNAME = "$shlibpath_var"; 3303 4305 EOF 3304 4306 3305 4307 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then 3306 func_to_host_path list"$temp_rpath"4308 func_to_host_path "$temp_rpath" 3307 4309 cat <<EOF 3308 const char * LIB_PATH_VALUE = "$func_to_host_path list_result";4310 const char * LIB_PATH_VALUE = "$func_to_host_path_result"; 3309 4311 EOF 3310 4312 else … … 3315 4317 3316 4318 if test -n "$dllsearchpath"; then 3317 func_to_host_path list"$dllsearchpath:"4319 func_to_host_path "$dllsearchpath:" 3318 4320 cat <<EOF 3319 4321 const char * EXE_PATH_VARNAME = "PATH"; 3320 const char * EXE_PATH_VALUE = "$func_to_host_path list_result";4322 const char * EXE_PATH_VALUE = "$func_to_host_path_result"; 3321 4323 EOF 3322 4324 else … … 3341 4343 3342 4344 #define LTWRAPPER_OPTION_PREFIX "--lt-" 3343 #define LTWRAPPER_OPTION_PREFIX_LENGTH 5 3344 3345 static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH; 4345 3346 4346 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX; 3347 3348 4347 static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script"; 3349 3350 static const size_t env_set_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 7; 3351 static const char *env_set_opt = LTWRAPPER_OPTION_PREFIX "env-set"; 3352 /* argument is putenv-style "foo=bar", value of foo is set to bar */ 3353 3354 static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11; 3355 static const char *env_prepend_opt = LTWRAPPER_OPTION_PREFIX "env-prepend"; 3356 /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */ 3357 3358 static const size_t env_append_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 10; 3359 static const char *env_append_opt = LTWRAPPER_OPTION_PREFIX "env-append"; 3360 /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */ 4348 static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug"; 3361 4349 3362 4350 int … … 3375 4363 3376 4364 program_name = (char *) xstrdup (base_name (argv[0])); 3377 LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0])); 3378 LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name)); 3379 3380 /* very simple arg parsing; don't want to rely on getopt */ 4365 newargz = XMALLOC (char *, argc + 1); 4366 4367 /* very simple arg parsing; don't want to rely on getopt 4368 * also, copy all non cwrapper options to newargz, except 4369 * argz[0], which is handled differently 4370 */ 4371 newargc=0; 3381 4372 for (i = 1; i < argc; i++) 3382 4373 { … … 3392 4383 3393 4384 cat <<"EOF" 3394 printf ("%s", script_text_part1); 3395 printf ("%s", script_text_part2); 4385 lt_dump_script (stdout); 3396 4386 return 0; 3397 4387 } 4388 if (strcmp (argv[i], debug_opt) == 0) 4389 { 4390 lt_debug = 1; 4391 continue; 4392 } 4393 if (strcmp (argv[i], ltwrapper_option_prefix) == 0) 4394 { 4395 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX 4396 namespace, but it is not one of the ones we know about and 4397 have already dealt with, above (inluding dump-script), then 4398 report an error. Otherwise, targets might begin to believe 4399 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX 4400 namespace. The first time any user complains about this, we'll 4401 need to make LTWRAPPER_OPTION_PREFIX a configure-time option 4402 or a configure.ac-settable value. 4403 */ 4404 lt_fatal (__FILE__, __LINE__, 4405 "unrecognized %s option: '%s'", 4406 ltwrapper_option_prefix, argv[i]); 4407 } 4408 /* otherwise ... */ 4409 newargz[++newargc] = xstrdup (argv[i]); 3398 4410 } 3399 3400 newargz = XMALLOC (char *, argc + 1); 4411 newargz[++newargc] = NULL; 4412 4413 EOF 4414 cat <<EOF 4415 /* The GNU banner must be the first non-error debug message */ 4416 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n"); 4417 EOF 4418 cat <<"EOF" 4419 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]); 4420 lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name); 4421 3401 4422 tmp_pathspec = find_executable (argv[0]); 3402 4423 if (tmp_pathspec == NULL) 3403 lt_fatal ("Couldn't find %s", argv[0]); 3404 LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n", 3405 tmp_pathspec)); 4424 lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]); 4425 lt_debugprintf (__FILE__, __LINE__, 4426 "(main) found exe (before symlink chase) at: %s\n", 4427 tmp_pathspec); 3406 4428 3407 4429 actual_cwrapper_path = chase_symlinks (tmp_pathspec); 3408 LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n", 3409 actual_cwrapper_path)); 4430 lt_debugprintf (__FILE__, __LINE__, 4431 "(main) found exe (after symlink chase) at: %s\n", 4432 actual_cwrapper_path); 3410 4433 XFREE (tmp_pathspec); 3411 4434 3412 actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));4435 actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path)); 3413 4436 strendzap (actual_cwrapper_path, actual_cwrapper_name); 3414 4437 … … 3428 4451 tmp_pathspec = 0; 3429 4452 3430 LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n", 3431 target_name)); 4453 lt_debugprintf (__FILE__, __LINE__, 4454 "(main) libtool target name: %s\n", 4455 target_name); 3432 4456 EOF 3433 4457 … … 3479 4503 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */ 3480 4504 lt_setenv ("DUALCASE", "1"); /* for MSK sh */ 4505 /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must 4506 be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath) 4507 because on Windows, both *_VARNAMEs are PATH but uninstalled 4508 libraries must come first. */ 4509 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE); 3481 4510 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE); 3482 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE); 3483 3484 newargc=0; 3485 for (i = 1; i < argc; i++) 3486 { 3487 if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0) 3488 { 3489 if (argv[i][env_set_opt_len] == '=') 3490 { 3491 const char *p = argv[i] + env_set_opt_len + 1; 3492 lt_opt_process_env_set (p); 3493 } 3494 else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc) 3495 { 3496 lt_opt_process_env_set (argv[++i]); /* don't copy */ 3497 } 3498 else 3499 lt_fatal ("%s missing required argument", env_set_opt); 3500 continue; 3501 } 3502 if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0) 3503 { 3504 if (argv[i][env_prepend_opt_len] == '=') 3505 { 3506 const char *p = argv[i] + env_prepend_opt_len + 1; 3507 lt_opt_process_env_prepend (p); 3508 } 3509 else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc) 3510 { 3511 lt_opt_process_env_prepend (argv[++i]); /* don't copy */ 3512 } 3513 else 3514 lt_fatal ("%s missing required argument", env_prepend_opt); 3515 continue; 3516 } 3517 if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0) 3518 { 3519 if (argv[i][env_append_opt_len] == '=') 3520 { 3521 const char *p = argv[i] + env_append_opt_len + 1; 3522 lt_opt_process_env_append (p); 3523 } 3524 else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc) 3525 { 3526 lt_opt_process_env_append (argv[++i]); /* don't copy */ 3527 } 3528 else 3529 lt_fatal ("%s missing required argument", env_append_opt); 3530 continue; 3531 } 3532 if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0) 3533 { 3534 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX 3535 namespace, but it is not one of the ones we know about and 3536 have already dealt with, above (inluding dump-script), then 3537 report an error. Otherwise, targets might begin to believe 3538 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX 3539 namespace. The first time any user complains about this, we'll 3540 need to make LTWRAPPER_OPTION_PREFIX a configure-time option 3541 or a configure.ac-settable value. 3542 */ 3543 lt_fatal ("Unrecognized option in %s namespace: '%s'", 3544 ltwrapper_option_prefix, argv[i]); 3545 } 3546 /* otherwise ... */ 3547 newargz[++newargc] = xstrdup (argv[i]); 3548 } 3549 newargz[++newargc] = NULL; 3550 3551 LTWRAPPER_DEBUGPRINTF (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>"))); 4511 4512 lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n", 4513 nonnull (lt_argv_zero)); 3552 4514 for (i = 0; i < newargc; i++) 3553 4515 { 3554 LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>"))); 4516 lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n", 4517 i, nonnull (newargz[i])); 3555 4518 } 3556 4519 … … 3561 4524 cat <<"EOF" 3562 4525 /* execv doesn't actually work on mingw as expected on unix */ 4526 newargz = prepare_spawn (newargz); 3563 4527 rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); 3564 4528 if (rval == -1) 3565 4529 { 3566 4530 /* failed to start process */ 3567 LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); 4531 lt_debugprintf (__FILE__, __LINE__, 4532 "(main) failed to launch target \"%s\": %s\n", 4533 lt_argv_zero, nonnull (strerror (errno))); 3568 4534 return 127; 3569 4535 } … … 3587 4553 void *p = (void *) malloc (num); 3588 4554 if (!p) 3589 lt_fatal ( "Memory exhausted");4555 lt_fatal (__FILE__, __LINE__, "memory exhausted"); 3590 4556 3591 4557 return p; … … 3621 4587 struct stat st; 3622 4588 3623 LTWRAPPER_DEBUGPRINTF (("(check_executable): %s\n",3624 path ? (*path ? path : "EMPTY!") : "NULL!"));4589 lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n", 4590 nonempty (path)); 3625 4591 if ((!path) || (!*path)) 3626 4592 return 0; … … 3639 4605 struct stat st; 3640 4606 3641 LTWRAPPER_DEBUGPRINTF (("(make_executable): %s\n",3642 path ? (*path ? path : "EMPTY!") : "NULL!"));4607 lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", 4608 nonempty (path)); 3643 4609 if ((!path) || (!*path)) 3644 4610 return 0; … … 3666 4632 char *concat_name; 3667 4633 3668 LTWRAPPER_DEBUGPRINTF (("(find_executable): %s\n",3669 wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));4634 lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", 4635 nonempty (wrapper)); 3670 4636 3671 4637 if ((wrapper == NULL) || (*wrapper == '\0')) … … 3720 4686 /* empty path: current directory */ 3721 4687 if (getcwd (tmp, LT_PATHMAX) == NULL) 3722 lt_fatal ("getcwd failed"); 4688 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", 4689 nonnull (strerror (errno))); 3723 4690 tmp_len = strlen (tmp); 3724 4691 concat_name = … … 3745 4712 /* Relative path | not found in path: prepend cwd */ 3746 4713 if (getcwd (tmp, LT_PATHMAX) == NULL) 3747 lt_fatal ("getcwd failed"); 4714 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", 4715 nonnull (strerror (errno))); 3748 4716 tmp_len = strlen (tmp); 3749 4717 concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); … … 3771 4739 while (strlen (tmp_pathspec) && !has_symlinks) 3772 4740 { 3773 LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", 3774 tmp_pathspec)); 4741 lt_debugprintf (__FILE__, __LINE__, 4742 "checking path component for symlinks: %s\n", 4743 tmp_pathspec); 3775 4744 if (lstat (tmp_pathspec, &s) == 0) 3776 4745 { … … 3794 4763 else 3795 4764 { 3796 char *errstr = strerror (errno); 3797 lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); 4765 lt_fatal (__FILE__, __LINE__, 4766 "error accessing file \"%s\": %s", 4767 tmp_pathspec, nonnull (strerror (errno))); 3798 4768 } 3799 4769 } … … 3808 4778 if (tmp_pathspec == 0) 3809 4779 { 3810 lt_fatal ("Could not follow symlinks for %s", pathspec); 4780 lt_fatal (__FILE__, __LINE__, 4781 "could not follow symlinks for %s", pathspec); 3811 4782 } 3812 4783 return xstrdup (tmp_pathspec); … … 3834 4805 } 3835 4806 4807 void 4808 lt_debugprintf (const char *file, int line, const char *fmt, ...) 4809 { 4810 va_list args; 4811 if (lt_debug) 4812 { 4813 (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); 4814 va_start (args, fmt); 4815 (void) vfprintf (stderr, fmt, args); 4816 va_end (args); 4817 } 4818 } 4819 3836 4820 static void 3837 lt_error_core (int exit_status, const char *mode, 4821 lt_error_core (int exit_status, const char *file, 4822 int line, const char *mode, 3838 4823 const char *message, va_list ap) 3839 4824 { 3840 fprintf (stderr, "%s: %s: ", program_name, mode);4825 fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); 3841 4826 vfprintf (stderr, message, ap); 3842 4827 fprintf (stderr, ".\n"); … … 3847 4832 3848 4833 void 3849 lt_fatal (const char * message, ...)4834 lt_fatal (const char *file, int line, const char *message, ...) 3850 4835 { 3851 4836 va_list ap; 3852 4837 va_start (ap, message); 3853 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);4838 lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); 3854 4839 va_end (ap); 4840 } 4841 4842 static const char * 4843 nonnull (const char *s) 4844 { 4845 return s ? s : "(null)"; 4846 } 4847 4848 static const char * 4849 nonempty (const char *s) 4850 { 4851 return (s && !*s) ? "(empty)" : nonnull (s); 3855 4852 } 3856 4853 … … 3858 4855 lt_setenv (const char *name, const char *value) 3859 4856 { 3860 LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",3861 (name ? name : "<NULL>"),3862 (value ? value : "<NULL>")));4857 lt_debugprintf (__FILE__, __LINE__, 4858 "(lt_setenv) setting '%s' to '%s'\n", 4859 nonnull (name), nonnull (value)); 3863 4860 { 3864 4861 #ifdef HAVE_SETENV … … 3905 4902 } 3906 4903 3907 int3908 lt_split_name_value (const char *arg, char** name, char** value)3909 {3910 const char *p;3911 int len;3912 if (!arg || !*arg)3913 return 1;3914 3915 p = strchr (arg, (int)'=');3916 3917 if (!p)3918 return 1;3919 3920 *value = xstrdup (++p);3921 3922 len = strlen (arg) - strlen (*value);3923 *name = XMALLOC (char, len);3924 strncpy (*name, arg, len-1);3925 (*name)[len - 1] = '\0';3926 3927 return 0;3928 }3929 3930 void3931 lt_opt_process_env_set (const char *arg)3932 {3933 char *name = NULL;3934 char *value = NULL;3935 3936 if (lt_split_name_value (arg, &name, &value) != 0)3937 {3938 XFREE (name);3939 XFREE (value);3940 lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);3941 }3942 3943 lt_setenv (name, value);3944 XFREE (name);3945 XFREE (value);3946 }3947 3948 void3949 lt_opt_process_env_prepend (const char *arg)3950 {3951 char *name = NULL;3952 char *value = NULL;3953 char *new_value = NULL;3954 3955 if (lt_split_name_value (arg, &name, &value) != 0)3956 {3957 XFREE (name);3958 XFREE (value);3959 lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);3960 }3961 3962 new_value = lt_extend_str (getenv (name), value, 0);3963 lt_setenv (name, new_value);3964 XFREE (new_value);3965 XFREE (name);3966 XFREE (value);3967 }3968 3969 void3970 lt_opt_process_env_append (const char *arg)3971 {3972 char *name = NULL;3973 char *value = NULL;3974 char *new_value = NULL;3975 3976 if (lt_split_name_value (arg, &name, &value) != 0)3977 {3978 XFREE (name);3979 XFREE (value);3980 lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);3981 }3982 3983 new_value = lt_extend_str (getenv (name), value, 1);3984 lt_setenv (name, new_value);3985 XFREE (new_value);3986 XFREE (name);3987 XFREE (value);3988 }3989 3990 4904 void 3991 4905 lt_update_exe_path (const char *name, const char *value) 3992 4906 { 3993 LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",3994 (name ? name : "<NULL>"),3995 (value ? value : "<NULL>")));4907 lt_debugprintf (__FILE__, __LINE__, 4908 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", 4909 nonnull (name), nonnull (value)); 3996 4910 3997 4911 if (name && *name && value && *value) … … 4012 4926 lt_update_lib_path (const char *name, const char *value) 4013 4927 { 4014 LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",4015 (name ? name : "<NULL>"),4016 (value ? value : "<NULL>")));4928 lt_debugprintf (__FILE__, __LINE__, 4929 "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", 4930 nonnull (name), nonnull (value)); 4017 4931 4018 4932 if (name && *name && value && *value) … … 4024 4938 } 4025 4939 4026 4027 4940 EOF 4941 case $host_os in 4942 mingw*) 4943 cat <<"EOF" 4944 4945 /* Prepares an argument vector before calling spawn(). 4946 Note that spawn() does not by itself call the command interpreter 4947 (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : 4948 ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); 4949 GetVersionEx(&v); 4950 v.dwPlatformId == VER_PLATFORM_WIN32_NT; 4951 }) ? "cmd.exe" : "command.com"). 4952 Instead it simply concatenates the arguments, separated by ' ', and calls 4953 CreateProcess(). We must quote the arguments since Win32 CreateProcess() 4954 interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a 4955 special way: 4956 - Space and tab are interpreted as delimiters. They are not treated as 4957 delimiters if they are surrounded by double quotes: "...". 4958 - Unescaped double quotes are removed from the input. Their only effect is 4959 that within double quotes, space and tab are treated like normal 4960 characters. 4961 - Backslashes not followed by double quotes are not special. 4962 - But 2*n+1 backslashes followed by a double quote become 4963 n backslashes followed by a double quote (n >= 0): 4964 \" -> " 4965 \\\" -> \" 4966 \\\\\" -> \\" 4967 */ 4968 #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" 4969 #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" 4970 char ** 4971 prepare_spawn (char **argv) 4972 { 4973 size_t argc; 4974 char **new_argv; 4975 size_t i; 4976 4977 /* Count number of arguments. */ 4978 for (argc = 0; argv[argc] != NULL; argc++) 4979 ; 4980 4981 /* Allocate new argument vector. */ 4982 new_argv = XMALLOC (char *, argc + 1); 4983 4984 /* Put quoted arguments into the new argument vector. */ 4985 for (i = 0; i < argc; i++) 4986 { 4987 const char *string = argv[i]; 4988 4989 if (string[0] == '\0') 4990 new_argv[i] = xstrdup ("\"\""); 4991 else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) 4992 { 4993 int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); 4994 size_t length; 4995 unsigned int backslashes; 4996 const char *s; 4997 char *quoted_string; 4998 char *p; 4999 5000 length = 0; 5001 backslashes = 0; 5002 if (quote_around) 5003 length++; 5004 for (s = string; *s != '\0'; s++) 5005 { 5006 char c = *s; 5007 if (c == '"') 5008 length += backslashes + 1; 5009 length++; 5010 if (c == '\\') 5011 backslashes++; 5012 else 5013 backslashes = 0; 5014 } 5015 if (quote_around) 5016 length += backslashes + 1; 5017 5018 quoted_string = XMALLOC (char, length + 1); 5019 5020 p = quoted_string; 5021 backslashes = 0; 5022 if (quote_around) 5023 *p++ = '"'; 5024 for (s = string; *s != '\0'; s++) 5025 { 5026 char c = *s; 5027 if (c == '"') 5028 { 5029 unsigned int j; 5030 for (j = backslashes + 1; j > 0; j--) 5031 *p++ = '\\'; 5032 } 5033 *p++ = c; 5034 if (c == '\\') 5035 backslashes++; 5036 else 5037 backslashes = 0; 5038 } 5039 if (quote_around) 5040 { 5041 unsigned int j; 5042 for (j = backslashes; j > 0; j--) 5043 *p++ = '\\'; 5044 *p++ = '"'; 5045 } 5046 *p = '\0'; 5047 5048 new_argv[i] = quoted_string; 5049 } 5050 else 5051 new_argv[i] = (char *) string; 5052 } 5053 new_argv[argc] = NULL; 5054 5055 return new_argv; 5056 } 5057 EOF 5058 ;; 5059 esac 5060 5061 cat <<"EOF" 5062 void lt_dump_script (FILE* f) 5063 { 5064 EOF 5065 func_emit_wrapper yes | 5066 $SED -n -e ' 5067 s/^\(.\{79\}\)\(..*\)/\1\ 5068 \2/ 5069 h 5070 s/\([\\"]\)/\\\1/g 5071 s/$/\\n/ 5072 s/\([^\n]*\).*/ fputs ("\1", f);/p 5073 g 5074 D' 5075 cat <<"EOF" 5076 } 5077 EOF 4028 5078 } 4029 5079 # end: func_emit_cwrapperexe_src 5080 5081 # func_win32_import_lib_p ARG 5082 # True if ARG is an import lib, as indicated by $file_magic_cmd 5083 func_win32_import_lib_p () 5084 { 5085 $opt_debug 5086 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in 5087 *import*) : ;; 5088 *) false ;; 5089 esac 5090 } 4030 5091 4031 5092 # func_mode_link arg... … … 4073 5134 4074 5135 avoid_version=no 5136 bindir= 4075 5137 dlfiles= 4076 5138 dlprefiles= … … 4165 5227 4166 5228 case $prev in 5229 bindir) 5230 bindir="$arg" 5231 prev= 5232 continue 5233 ;; 4167 5234 dlfiles|dlprefiles) 4168 5235 if test "$preload" = no; then … … 4196 5263 *) 4197 5264 if test "$prev" = dlfiles; then 4198 dlfiles="$dlfiles$arg"5265 func_append dlfiles " $arg" 4199 5266 else 4200 dlprefiles="$dlprefiles$arg"5267 func_append dlprefiles " $arg" 4201 5268 fi 4202 5269 prev= … … 4222 5289 case "$deplibs " in 4223 5290 *" $qarg.ltframework "*) ;; 4224 *) deplibs="$deplibs$qarg.ltframework" # this is fixed later5291 *) func_append deplibs " $qarg.ltframework" # this is fixed later 4225 5292 ;; 4226 5293 esac … … 4241 5308 for fil in `cat "$save_arg"` 4242 5309 do 4243 # moreargs="$moreargs$fil"5310 # func_append moreargs " $fil" 4244 5311 arg=$fil 4245 5312 # A libtool-controlled object. … … 4270 5337 if test "$prev" = dlfiles; then 4271 5338 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then 4272 dlfiles="$dlfiles$pic_object"5339 func_append dlfiles " $pic_object" 4273 5340 prev= 4274 5341 continue … … 4282 5349 if test "$prev" = dlprefiles; then 4283 5350 # Preload the old-style object. 4284 dlprefiles="$dlprefiles$pic_object"5351 func_append dlprefiles " $pic_object" 4285 5352 prev= 4286 5353 fi … … 4352 5419 case "$rpath " in 4353 5420 *" $arg "*) ;; 4354 *) rpath="$rpath$arg" ;;5421 *) func_append rpath " $arg" ;; 4355 5422 esac 4356 5423 else 4357 5424 case "$xrpath " in 4358 5425 *" $arg "*) ;; 4359 *) xrpath="$xrpath$arg" ;;5426 *) func_append xrpath " $arg" ;; 4360 5427 esac 4361 5428 fi … … 4369 5436 ;; 4370 5437 weak) 4371 weak_libs="$weak_libs$arg"5438 func_append weak_libs " $arg" 4372 5439 prev= 4373 5440 continue 4374 5441 ;; 4375 5442 xcclinker) 4376 linker_flags="$linker_flags$qarg"4377 compiler_flags="$compiler_flags$qarg"5443 func_append linker_flags " $qarg" 5444 func_append compiler_flags " $qarg" 4378 5445 prev= 4379 5446 func_append compile_command " $qarg" … … 4382 5449 ;; 4383 5450 xcompiler) 4384 compiler_flags="$compiler_flags$qarg"5451 func_append compiler_flags " $qarg" 4385 5452 prev= 4386 5453 func_append compile_command " $qarg" … … 4389 5456 ;; 4390 5457 xlinker) 4391 linker_flags="$linker_flags$qarg"4392 compiler_flags="$compiler_flags$wl$qarg"5458 func_append linker_flags " $qarg" 5459 func_append compiler_flags " $wl$qarg" 4393 5460 prev= 4394 5461 func_append compile_command " $wl$qarg" … … 4426 5493 ;; 4427 5494 5495 -bindir) 5496 prev=bindir 5497 continue 5498 ;; 5499 4428 5500 -dlopen) 4429 5501 prev=dlfiles … … 4476 5548 4477 5549 -L*) 4478 func_stripname '-L' '' "$arg" 4479 dir=$func_stripname_result 4480 if test -z "$dir"; then 5550 func_stripname "-L" '' "$arg" 5551 if test -z "$func_stripname_result"; then 4481 5552 if test "$#" -gt 0; then 4482 5553 func_fatal_error "require no space between \`-L' and \`$1'" … … 4485 5556 fi 4486 5557 fi 5558 func_resolve_sysroot "$func_stripname_result" 5559 dir=$func_resolve_sysroot_result 4487 5560 # We need an absolute path. 4488 5561 case $dir in … … 4496 5569 esac 4497 5570 case "$deplibs " in 4498 *" -L$dir "*) ;; 5571 *" -L$dir "* | *" $arg "*) 5572 # Will only happen for absolute or sysroot arguments 5573 ;; 4499 5574 *) 4500 deplibs="$deplibs -L$dir" 4501 lib_search_path="$lib_search_path $dir" 5575 # Preserve sysroot, but never include relative directories 5576 case $dir in 5577 [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; 5578 *) func_append deplibs " -L$dir" ;; 5579 esac 5580 func_append lib_search_path " $dir" 4502 5581 ;; 4503 5582 esac 4504 5583 case $host in 4505 5584 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) 4506 testbindir=`$ECHO " X$dir" | $Xsed -e's*/lib$*/bin*'`5585 testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` 4507 5586 case :$dllsearchpath: in 4508 5587 *":$dir:"*) ;; 4509 5588 ::) dllsearchpath=$dir;; 4510 *) dllsearchpath="$dllsearchpath:$dir";;5589 *) func_append dllsearchpath ":$dir";; 4511 5590 esac 4512 5591 case :$dllsearchpath: in 4513 5592 *":$testbindir:"*) ;; 4514 5593 ::) dllsearchpath=$testbindir;; 4515 *) dllsearchpath="$dllsearchpath:$testbindir";;5594 *) func_append dllsearchpath ":$testbindir";; 4516 5595 esac 4517 5596 ;; … … 4523 5602 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then 4524 5603 case $host in 4525 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* )5604 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) 4526 5605 # These systems don't actually have a C or math library (as such) 4527 5606 continue … … 4537 5616 *-*-rhapsody* | *-*-darwin1.[012]) 4538 5617 # Rhapsody C and math libraries are in the System framework 4539 deplibs="$deplibsSystem.ltframework"5618 func_append deplibs " System.ltframework" 4540 5619 continue 4541 5620 ;; … … 4557 5636 esac 4558 5637 fi 4559 deplibs="$deplibs$arg"5638 func_append deplibs " $arg" 4560 5639 continue 4561 5640 ;; … … 4569 5648 # classes, name mangling, and exception handling. 4570 5649 # Darwin uses the -arch flag to determine output architecture. 4571 -model|-arch|-isysroot )4572 compiler_flags="$compiler_flags$arg"5650 -model|-arch|-isysroot|--sysroot) 5651 func_append compiler_flags " $arg" 4573 5652 func_append compile_command " $arg" 4574 5653 func_append finalize_command " $arg" … … 4577 5656 ;; 4578 5657 4579 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) 4580 compiler_flags="$compiler_flags $arg" 5658 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ 5659 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) 5660 func_append compiler_flags " $arg" 4581 5661 func_append compile_command " $arg" 4582 5662 func_append finalize_command " $arg" 4583 5663 case "$new_inherited_linker_flags " in 4584 5664 *" $arg "*) ;; 4585 * ) new_inherited_linker_flags="$new_inherited_linker_flags$arg" ;;5665 * ) func_append new_inherited_linker_flags " $arg" ;; 4586 5666 esac 4587 5667 continue … … 4650 5730 case $dir in 4651 5731 [\\/]* | [A-Za-z]:[\\/]*) ;; 5732 =*) 5733 func_stripname '=' '' "$dir" 5734 dir=$lt_sysroot$func_stripname_result 5735 ;; 4652 5736 *) 4653 5737 func_fatal_error "only absolute run-paths are allowed" … … 4656 5740 case "$xrpath " in 4657 5741 *" $dir "*) ;; 4658 *) xrpath="$xrpath$dir" ;;5742 *) func_append xrpath " $dir" ;; 4659 5743 esac 4660 5744 continue … … 4709 5793 IFS="$save_ifs" 4710 5794 func_quote_for_eval "$flag" 4711 arg="$arg $wl$func_quote_for_eval_result"4712 compiler_flags="$compiler_flags$func_quote_for_eval_result"5795 func_append arg " $func_quote_for_eval_result" 5796 func_append compiler_flags " $func_quote_for_eval_result" 4713 5797 done 4714 5798 IFS="$save_ifs" … … 4725 5809 IFS="$save_ifs" 4726 5810 func_quote_for_eval "$flag" 4727 arg="$arg$wl$func_quote_for_eval_result"4728 compiler_flags="$compiler_flags$wl$func_quote_for_eval_result"4729 linker_flags="$linker_flags$func_quote_for_eval_result"5811 func_append arg " $wl$func_quote_for_eval_result" 5812 func_append compiler_flags " $wl$func_quote_for_eval_result" 5813 func_append linker_flags " $func_quote_for_eval_result" 4730 5814 done 4731 5815 IFS="$save_ifs" … … 4755 5839 ;; 4756 5840 4757 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler 4758 # -r[0-9][0-9]* specifies the processor on the SGI compiler 4759 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler 4760 # +DA*, +DD* enable 64-bit mode on the HP compiler 4761 # -q* pass through compiler args for the IBM compiler 4762 # -m*, -t[45]*, -txscale* pass through architecture-specific 4763 # compiler args for GCC 4764 # -F/path gives path to uninstalled frameworks, gcc on darwin 4765 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC 4766 # @file GCC response files 5841 # Flags to be passed through unchanged, with rationale: 5842 # -64, -mips[0-9] enable 64-bit mode for the SGI compiler 5843 # -r[0-9][0-9]* specify processor for the SGI compiler 5844 # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler 5845 # +DA*, +DD* enable 64-bit mode for the HP compiler 5846 # -q* compiler args for the IBM compiler 5847 # -m*, -t[45]*, -txscale* architecture-specific flags for GCC 5848 # -F/path path to uninstalled frameworks, gcc on darwin 5849 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC 5850 # @file GCC response files 5851 # -tp=* Portland pgcc target processor selection 5852 # --sysroot=* for sysroot support 5853 # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization 4767 5854 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ 4768 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) 5855 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ 5856 -O*|-flto*|-fwhopr*|-fuse-linker-plugin) 4769 5857 func_quote_for_eval "$arg" 4770 5858 arg="$func_quote_for_eval_result" 4771 5859 func_append compile_command " $arg" 4772 5860 func_append finalize_command " $arg" 4773 compiler_flags="$compiler_flags$arg"5861 func_append compiler_flags " $arg" 4774 5862 continue 4775 5863 ;; … … 4783 5871 *.$objext) 4784 5872 # A standard object. 4785 objs="$objs$arg"5873 func_append objs " $arg" 4786 5874 ;; 4787 5875 … … 4814 5902 if test "$prev" = dlfiles; then 4815 5903 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then 4816 dlfiles="$dlfiles$pic_object"5904 func_append dlfiles " $pic_object" 4817 5905 prev= 4818 5906 continue … … 4826 5914 if test "$prev" = dlprefiles; then 4827 5915 # Preload the old-style object. 4828 dlprefiles="$dlprefiles$pic_object"5916 func_append dlprefiles " $pic_object" 4829 5917 prev= 4830 5918 fi … … 4871 5959 *.$libext) 4872 5960 # An archive. 4873 deplibs="$deplibs$arg"4874 old_deplibs="$old_deplibs$arg"5961 func_append deplibs " $arg" 5962 func_append old_deplibs " $arg" 4875 5963 continue 4876 5964 ;; … … 4879 5967 # A libtool-controlled library. 4880 5968 5969 func_resolve_sysroot "$arg" 4881 5970 if test "$prev" = dlfiles; then 4882 5971 # This library was specified with -dlopen. 4883 dlfiles="$dlfiles $arg"5972 func_append dlfiles " $func_resolve_sysroot_result" 4884 5973 prev= 4885 5974 elif test "$prev" = dlprefiles; then 4886 5975 # The library was specified with -dlpreopen. 4887 dlprefiles="$dlprefiles $arg"5976 func_append dlprefiles " $func_resolve_sysroot_result" 4888 5977 prev= 4889 5978 else 4890 deplibs="$deplibs $arg"5979 func_append deplibs " $func_resolve_sysroot_result" 4891 5980 fi 4892 5981 continue … … 4926 6015 if test -n "$shlibpath_var"; then 4927 6016 # get the directories listed in $shlibpath_var 4928 eval shlib_search_path=\`\$ECHO \" X\${$shlibpath_var}\" \| \$Xsed -e\'s/:/ /g\'\`6017 eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` 4929 6018 else 4930 6019 shlib_search_path= … … 4935 6024 func_dirname "$output" "/" "" 4936 6025 output_objdir="$func_dirname_result$objdir" 6026 func_to_tool_file "$output_objdir/" 6027 tool_output_objdir=$func_to_tool_file_result 4937 6028 # Create the object directory. 4938 6029 func_mkdir_p "$output_objdir" … … 4955 6046 # that are linked more than once (e.g. -la -lb -la) 4956 6047 for deplib in $deplibs; do 4957 if $opt_ duplicate_deps ; then6048 if $opt_preserve_dup_deps ; then 4958 6049 case "$libs " in 4959 *" $deplib "*) specialdeplibs="$specialdeplibs$deplib" ;;6050 *" $deplib "*) func_append specialdeplibs " $deplib" ;; 4960 6051 esac 4961 6052 fi 4962 libs="$libs$deplib"6053 func_append libs " $deplib" 4963 6054 done 4964 6055 … … 4973 6064 for pre_post_dep in $predeps $postdeps; do 4974 6065 case "$pre_post_deps " in 4975 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs$pre_post_deps" ;;6066 *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; 4976 6067 esac 4977 pre_post_deps="$pre_post_deps$pre_post_dep"6068 func_append pre_post_deps " $pre_post_dep" 4978 6069 done 4979 6070 fi … … 5042 6133 # Ignore non-libtool-libs 5043 6134 dependency_libs= 6135 func_resolve_sysroot "$lib" 5044 6136 case $lib in 5045 *.la) func_source "$ lib" ;;6137 *.la) func_source "$func_resolve_sysroot_result" ;; 5046 6138 esac 5047 6139 … … 5049 6141 # has declared as weak libs 5050 6142 for deplib in $dependency_libs; do 5051 deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` 6143 func_basename "$deplib" 6144 deplib_base=$func_basename_result 5052 6145 case " $weak_libs " in 5053 6146 *" $deplib_base "*) ;; 5054 *) deplibs="$deplibs$deplib" ;;6147 *) func_append deplibs " $deplib" ;; 5055 6148 esac 5056 6149 done … … 5068 6161 found=no 5069 6162 case $deplib in 5070 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) 6163 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ 6164 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) 5071 6165 if test "$linkmode,$pass" = "prog,link"; then 5072 6166 compile_deplibs="$deplib $compile_deplibs" 5073 6167 finalize_deplibs="$deplib $finalize_deplibs" 5074 6168 else 5075 compiler_flags="$compiler_flags$deplib"6169 func_append compiler_flags " $deplib" 5076 6170 if test "$linkmode" = lib ; then 5077 6171 case "$new_inherited_linker_flags " in 5078 6172 *" $deplib "*) ;; 5079 * ) new_inherited_linker_flags="$new_inherited_linker_flags$deplib" ;;6173 * ) func_append new_inherited_linker_flags " $deplib" ;; 5080 6174 esac 5081 6175 fi … … 5162 6256 case "$new_inherited_linker_flags " in 5163 6257 *" $deplib "*) ;; 5164 * ) new_inherited_linker_flags="$new_inherited_linker_flags$deplib" ;;6258 * ) func_append new_inherited_linker_flags " $deplib" ;; 5165 6259 esac 5166 6260 fi … … 5175 6269 newdependency_libs="$deplib $newdependency_libs" 5176 6270 func_stripname '-L' '' "$deplib" 5177 newlib_search_path="$newlib_search_path $func_stripname_result" 6271 func_resolve_sysroot "$func_stripname_result" 6272 func_append newlib_search_path " $func_resolve_sysroot_result" 5178 6273 ;; 5179 6274 prog) … … 5189 6284 fi 5190 6285 func_stripname '-L' '' "$deplib" 5191 newlib_search_path="$newlib_search_path $func_stripname_result" 6286 func_resolve_sysroot "$func_stripname_result" 6287 func_append newlib_search_path " $func_resolve_sysroot_result" 5192 6288 ;; 5193 6289 *) … … 5200 6296 if test "$pass" = link; then 5201 6297 func_stripname '-R' '' "$deplib" 5202 dir=$func_stripname_result 6298 func_resolve_sysroot "$func_stripname_result" 6299 dir=$func_resolve_sysroot_result 5203 6300 # Make sure the xrpath contains only unique directories. 5204 6301 case "$xrpath " in 5205 6302 *" $dir "*) ;; 5206 *) xrpath="$xrpath$dir" ;;6303 *) func_append xrpath " $dir" ;; 5207 6304 esac 5208 6305 fi … … 5210 6307 continue 5211 6308 ;; 5212 *.la) lib="$deplib" ;; 6309 *.la) 6310 func_resolve_sysroot "$deplib" 6311 lib=$func_resolve_sysroot_result 6312 ;; 5213 6313 *.$libext) 5214 6314 if test "$pass" = conv; then … … 5228 6328 set dummy $deplibs_check_method; shift 5229 6329 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` 5230 if eval "\$ECHO \" X$deplib\"" 2>/dev/null | $Xsed -e10q \6330 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ 5231 6331 | $EGREP "$match_pattern_regex" > /dev/null; then 5232 6332 valid_a_lib=yes … … 5238 6338 esac 5239 6339 if test "$valid_a_lib" != yes; then 5240 $ECHO6340 echo 5241 6341 $ECHO "*** Warning: Trying to link with static lib archive $deplib." 5242 $ECHO"*** I have the capability to make that library automatically link in when"5243 $ECHO"*** you link to this library. But I can only do this if you have a"5244 $ECHO"*** shared version of the library, which you do not appear to have"5245 $ECHO"*** because the file extensions .$libext of this argument makes me believe"5246 $ECHO"*** that it is just a static archive that I should not use here."6342 echo "*** I have the capability to make that library automatically link in when" 6343 echo "*** you link to this library. But I can only do this if you have a" 6344 echo "*** shared version of the library, which you do not appear to have" 6345 echo "*** because the file extensions .$libext of this argument makes me believe" 6346 echo "*** that it is just a static archive that I should not use here." 5247 6347 else 5248 $ECHO6348 echo 5249 6349 $ECHO "*** Warning: Linking the shared library $output against the" 5250 6350 $ECHO "*** static library $deplib is not portable!" … … 5273 6373 # If there is no dlopen support or we're linking statically, 5274 6374 # we need to preload. 5275 newdlprefiles="$newdlprefiles$deplib"6375 func_append newdlprefiles " $deplib" 5276 6376 compile_deplibs="$deplib $compile_deplibs" 5277 6377 finalize_deplibs="$deplib $finalize_deplibs" 5278 6378 else 5279 newdlfiles="$newdlfiles$deplib"6379 func_append newdlfiles " $deplib" 5280 6380 fi 5281 6381 fi … … 5319 6419 # Convert "-framework foo" to "foo.ltframework" 5320 6420 if test -n "$inherited_linker_flags"; then 5321 tmp_inherited_linker_flags=`$ECHO " X$inherited_linker_flags" | $Xsed -e's/-framework \([^ $]*\)/\1.ltframework/g'`6421 tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` 5322 6422 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do 5323 6423 case " $new_inherited_linker_flags " in 5324 6424 *" $tmp_inherited_linker_flag "*) ;; 5325 *) new_inherited_linker_flags="$new_inherited_linker_flags$tmp_inherited_linker_flag";;6425 *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; 5326 6426 esac 5327 6427 done 5328 6428 fi 5329 dependency_libs=`$ECHO " X $dependency_libs" | $Xsed -e's% \([^ $]*\).ltframework% -framework \1%g'`6429 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` 5330 6430 if test "$linkmode,$pass" = "lib,link" || 5331 6431 test "$linkmode,$pass" = "prog,scan" || 5332 6432 { test "$linkmode" != prog && test "$linkmode" != lib; }; then 5333 test -n "$dlopen" && dlfiles="$dlfiles$dlopen"5334 test -n "$dlpreopen" && dlprefiles="$dlprefiles$dlpreopen"6433 test -n "$dlopen" && func_append dlfiles " $dlopen" 6434 test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" 5335 6435 fi 5336 6436 … … 5343 6443 fi 5344 6444 # It is a libtool convenience library, so add in its objects. 5345 convenience="$convenience$ladir/$objdir/$old_library"5346 old_convenience="$old_convenience$ladir/$objdir/$old_library"6445 func_append convenience " $ladir/$objdir/$old_library" 6446 func_append old_convenience " $ladir/$objdir/$old_library" 5347 6447 elif test "$linkmode" != prog && test "$linkmode" != lib; then 5348 6448 func_fatal_error "\`$lib' is not a convenience library" … … 5351 6451 for deplib in $dependency_libs; do 5352 6452 deplibs="$deplib $deplibs" 5353 if $opt_ duplicate_deps ; then6453 if $opt_preserve_dup_deps ; then 5354 6454 case "$tmp_libs " in 5355 *" $deplib "*) specialdeplibs="$specialdeplibs$deplib" ;;6455 *" $deplib "*) func_append specialdeplibs " $deplib" ;; 5356 6456 esac 5357 6457 fi 5358 tmp_libs="$tmp_libs$deplib"6458 func_append tmp_libs " $deplib" 5359 6459 done 5360 6460 continue … … 5364 6464 # Get the name of the library we link against. 5365 6465 linklib= 5366 for l in $old_library $library_names; do 5367 linklib="$l" 5368 done 6466 if test -n "$old_library" && 6467 { test "$prefer_static_libs" = yes || 6468 test "$prefer_static_libs,$installed" = "built,no"; }; then 6469 linklib=$old_library 6470 else 6471 for l in $old_library $library_names; do 6472 linklib="$l" 6473 done 6474 fi 5369 6475 if test -z "$linklib"; then 5370 6476 func_fatal_error "cannot find name of link library for \`$lib'" … … 5383 6489 # dependent libraries so libltdl's deplib preloader doesn't 5384 6490 # bomb out in the load deplibs phase. 5385 dlprefiles="$dlprefiles$lib $dependency_libs"6491 func_append dlprefiles " $lib $dependency_libs" 5386 6492 else 5387 newdlfiles="$newdlfiles$lib"6493 func_append newdlfiles " $lib" 5388 6494 fi 5389 6495 continue … … 5407 6513 # Find the relevant object directory and library name. 5408 6514 if test "X$installed" = Xyes; then 5409 if test ! -f "$l ibdir/$linklib" && test -f "$abs_ladir/$linklib"; then6515 if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then 5410 6516 func_warning "library \`$lib' was moved." 5411 6517 dir="$ladir" … … 5413 6519 libdir="$abs_ladir" 5414 6520 else 5415 dir="$l ibdir"5416 absdir="$l ibdir"6521 dir="$lt_sysroot$libdir" 6522 absdir="$lt_sysroot$libdir" 5417 6523 fi 5418 6524 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes … … 5422 6528 absdir="$abs_ladir" 5423 6529 # Remove this search path later 5424 notinst_path="$notinst_path$abs_ladir"6530 func_append notinst_path " $abs_ladir" 5425 6531 else 5426 6532 dir="$ladir/$objdir" 5427 6533 absdir="$abs_ladir/$objdir" 5428 6534 # Remove this search path later 5429 notinst_path="$notinst_path$abs_ladir"6535 func_append notinst_path " $abs_ladir" 5430 6536 fi 5431 6537 fi # $installed = yes … … 5438 6544 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" 5439 6545 fi 5440 # Prefer using a static library (so that no silly _DYNAMIC symbols 5441 # are required to link). 5442 if test -n "$old_library"; then 5443 newdlprefiles="$newdlprefiles $dir/$old_library" 5444 # Keep a list of preopened convenience libraries to check 5445 # that they are being used correctly in the link pass. 5446 test -z "$libdir" && \ 5447 dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" 5448 # Otherwise, use the dlname, so that lt_dlopen finds it. 5449 elif test -n "$dlname"; then 5450 newdlprefiles="$newdlprefiles $dir/$dlname" 5451 else 5452 newdlprefiles="$newdlprefiles $dir/$linklib" 5453 fi 6546 case "$host" in 6547 # special handling for platforms with PE-DLLs. 6548 *cygwin* | *mingw* | *cegcc* ) 6549 # Linker will automatically link against shared library if both 6550 # static and shared are present. Therefore, ensure we extract 6551 # symbols from the import library if a shared library is present 6552 # (otherwise, the dlopen module name will be incorrect). We do 6553 # this by putting the import library name into $newdlprefiles. 6554 # We recover the dlopen module name by 'saving' the la file 6555 # name in a special purpose variable, and (later) extracting the 6556 # dlname from the la file. 6557 if test -n "$dlname"; then 6558 func_tr_sh "$dir/$linklib" 6559 eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" 6560 func_append newdlprefiles " $dir/$linklib" 6561 else 6562 func_append newdlprefiles " $dir/$old_library" 6563 # Keep a list of preopened convenience libraries to check 6564 # that they are being used correctly in the link pass. 6565 test -z "$libdir" && \ 6566 func_append dlpreconveniencelibs " $dir/$old_library" 6567 fi 6568 ;; 6569 * ) 6570 # Prefer using a static library (so that no silly _DYNAMIC symbols 6571 # are required to link). 6572 if test -n "$old_library"; then 6573 func_append newdlprefiles " $dir/$old_library" 6574 # Keep a list of preopened convenience libraries to check 6575 # that they are being used correctly in the link pass. 6576 test -z "$libdir" && \ 6577 func_append dlpreconveniencelibs " $dir/$old_library" 6578 # Otherwise, use the dlname, so that lt_dlopen finds it. 6579 elif test -n "$dlname"; then 6580 func_append newdlprefiles " $dir/$dlname" 6581 else 6582 func_append newdlprefiles " $dir/$linklib" 6583 fi 6584 ;; 6585 esac 5454 6586 fi # $pass = dlpreopen 5455 6587 … … 5469 6601 5470 6602 if test "$linkmode" = prog && test "$pass" != link; then 5471 newlib_search_path="$newlib_search_path$ladir"6603 func_append newlib_search_path " $ladir" 5472 6604 deplibs="$lib $deplibs" 5473 6605 … … 5482 6614 case $deplib in 5483 6615 -L*) func_stripname '-L' '' "$deplib" 5484 newlib_search_path="$newlib_search_path $func_stripname_result" 6616 func_resolve_sysroot "$func_stripname_result" 6617 func_append newlib_search_path " $func_resolve_sysroot_result" 5485 6618 ;; 5486 6619 esac … … 5493 6626 newdependency_libs="$deplib $newdependency_libs" 5494 6627 fi 5495 if $opt_ duplicate_deps ; then6628 if $opt_preserve_dup_deps ; then 5496 6629 case "$tmp_libs " in 5497 *" $deplib "*) specialdeplibs="$specialdeplibs$deplib" ;;6630 *" $deplib "*) func_append specialdeplibs " $deplib" ;; 5498 6631 esac 5499 6632 fi 5500 tmp_libs="$tmp_libs$deplib"6633 func_append tmp_libs " $deplib" 5501 6634 done # for deplib 5502 6635 continue … … 5513 6646 case "$temp_rpath:" in 5514 6647 *"$absdir:"*) ;; 5515 *) temp_rpath="$temp_rpath$absdir:" ;;6648 *) func_append temp_rpath "$absdir:" ;; 5516 6649 esac 5517 6650 fi … … 5525 6658 case "$compile_rpath " in 5526 6659 *" $absdir "*) ;; 5527 *) compile_rpath="$compile_rpath $absdir"6660 *) func_append compile_rpath " $absdir" ;; 5528 6661 esac 5529 6662 ;; … … 5534 6667 case "$finalize_rpath " in 5535 6668 *" $libdir "*) ;; 5536 *) f inalize_rpath="$finalize_rpath $libdir"6669 *) func_append finalize_rpath " $libdir" ;; 5537 6670 esac 5538 6671 ;; … … 5559 6692 *cygwin* | *mingw* | *cegcc*) 5560 6693 # No point in relinking DLLs because paths are not encoded 5561 notinst_deplibs="$notinst_deplibs$lib"6694 func_append notinst_deplibs " $lib" 5562 6695 need_relink=no 5563 6696 ;; 5564 6697 *) 5565 6698 if test "$installed" = no; then 5566 notinst_deplibs="$notinst_deplibs$lib"6699 func_append notinst_deplibs " $lib" 5567 6700 need_relink=yes 5568 6701 fi … … 5581 6714 done 5582 6715 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then 5583 $ECHO6716 echo 5584 6717 if test "$linkmode" = prog; then 5585 6718 $ECHO "*** Warning: Linking the executable $output against the loadable module" … … 5599 6732 case "$compile_rpath " in 5600 6733 *" $absdir "*) ;; 5601 *) compile_rpath="$compile_rpath $absdir"6734 *) func_append compile_rpath " $absdir" ;; 5602 6735 esac 5603 6736 ;; … … 5608 6741 case "$finalize_rpath " in 5609 6742 *" $libdir "*) ;; 5610 *) f inalize_rpath="$finalize_rpath $libdir"6743 *) func_append finalize_rpath " $libdir" ;; 5611 6744 esac 5612 6745 ;; … … 5662 6795 fi # test -n "$old_archive_from_expsyms_cmds" 5663 6796 5664 if test "$linkmode" = prog || test "$ mode" != relink; then6797 if test "$linkmode" = prog || test "$opt_mode" != relink; then 5665 6798 add_shlibpath= 5666 6799 add_dir= … … 5684 6817 $ECHO "*** Warning: lib $linklib is a module, not a shared library" 5685 6818 if test -z "$old_library" ; then 5686 $ECHO5687 $ECHO"*** And there doesn't seem to be a static archive available"5688 $ECHO"*** The link will probably fail, sorry"6819 echo 6820 echo "*** And there doesn't seem to be a static archive available" 6821 echo "*** The link will probably fail, sorry" 5689 6822 else 5690 6823 add="$dir/$old_library" … … 5713 6846 add="$dir/$linklib" 5714 6847 elif test "$hardcode_minus_L" = yes; then 5715 add_dir="-L$ dir"6848 add_dir="-L$absdir" 5716 6849 # Try looking first in the location we're being installed to. 5717 6850 if test -n "$inst_prefix_dir"; then 5718 6851 case $libdir in 5719 6852 [\\/]*) 5720 add_dir="$add_dir-L$inst_prefix_dir$libdir"6853 func_append add_dir " -L$inst_prefix_dir$libdir" 5721 6854 ;; 5722 6855 esac … … 5740 6873 case :$compile_shlibpath: in 5741 6874 *":$add_shlibpath:"*) ;; 5742 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;6875 *) func_append compile_shlibpath "$add_shlibpath:" ;; 5743 6876 esac 5744 6877 fi … … 5754 6887 case :$finalize_shlibpath: in 5755 6888 *":$libdir:"*) ;; 5756 *) f inalize_shlibpath="$finalize_shlibpath$libdir:" ;;6889 *) func_append finalize_shlibpath "$libdir:" ;; 5757 6890 esac 5758 6891 fi … … 5760 6893 fi 5761 6894 5762 if test "$linkmode" = prog || test "$ mode" = relink; then6895 if test "$linkmode" = prog || test "$opt_mode" = relink; then 5763 6896 add_shlibpath= 5764 6897 add_dir= … … 5774 6907 case :$finalize_shlibpath: in 5775 6908 *":$libdir:"*) ;; 5776 *) f inalize_shlibpath="$finalize_shlibpath$libdir:" ;;6909 *) func_append finalize_shlibpath "$libdir:" ;; 5777 6910 esac 5778 6911 add="-l$name" … … 5791 6924 case $libdir in 5792 6925 [\\/]*) 5793 add_dir="$add_dir-L$inst_prefix_dir$libdir"6926 func_append add_dir " -L$inst_prefix_dir$libdir" 5794 6927 ;; 5795 6928 esac … … 5826 6959 # Just print a warning and add the library to dependency_libs so 5827 6960 # that the program can be linked against the static library. 5828 $ECHO6961 echo 5829 6962 $ECHO "*** Warning: This system can not link to static lib archive $lib." 5830 $ECHO"*** I have the capability to make that library automatically link in when"5831 $ECHO"*** you link to this library. But I can only do this if you have a"5832 $ECHO"*** shared version of the library, which you do not appear to have."6963 echo "*** I have the capability to make that library automatically link in when" 6964 echo "*** you link to this library. But I can only do this if you have a" 6965 echo "*** shared version of the library, which you do not appear to have." 5833 6966 if test "$module" = yes; then 5834 $ECHO"*** But as you try to build a module library, libtool will still create "5835 $ECHO"*** a static module, that should work as long as the dlopening application"5836 $ECHO"*** is linked with the -dlopen flag to resolve symbols at runtime."6967 echo "*** But as you try to build a module library, libtool will still create " 6968 echo "*** a static module, that should work as long as the dlopening application" 6969 echo "*** is linked with the -dlopen flag to resolve symbols at runtime." 5837 6970 if test -z "$global_symbol_pipe"; then 5838 $ECHO5839 $ECHO"*** However, this would only work if libtool was able to extract symbol"5840 $ECHO"*** lists from a program, using \`nm' or equivalent, but libtool could"5841 $ECHO"*** not find such a program. So, this module is probably useless."5842 $ECHO"*** \`nm' from GNU binutils and a full rebuild may help."6971 echo 6972 echo "*** However, this would only work if libtool was able to extract symbol" 6973 echo "*** lists from a program, using \`nm' or equivalent, but libtool could" 6974 echo "*** not find such a program. So, this module is probably useless." 6975 echo "*** \`nm' from GNU binutils and a full rebuild may help." 5843 6976 fi 5844 6977 if test "$build_old_libs" = no; then … … 5868 7001 case " $xrpath " in 5869 7002 *" $temp_xrpath "*) ;; 5870 *) xrpath="$xrpath$temp_xrpath";;7003 *) func_append xrpath " $temp_xrpath";; 5871 7004 esac;; 5872 *) temp_deplibs="$temp_deplibs$libdir";;7005 *) func_append temp_deplibs " $libdir";; 5873 7006 esac 5874 7007 done … … 5876 7009 fi 5877 7010 5878 newlib_search_path="$newlib_search_path$absdir"7011 func_append newlib_search_path " $absdir" 5879 7012 # Link against this library 5880 7013 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" … … 5883 7016 for deplib in $dependency_libs; do 5884 7017 newdependency_libs="$deplib $newdependency_libs" 5885 if $opt_duplicate_deps ; then 7018 case $deplib in 7019 -L*) func_stripname '-L' '' "$deplib" 7020 func_resolve_sysroot "$func_stripname_result";; 7021 *) func_resolve_sysroot "$deplib" ;; 7022 esac 7023 if $opt_preserve_dup_deps ; then 5886 7024 case "$tmp_libs " in 5887 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 7025 *" $func_resolve_sysroot_result "*) 7026 func_append specialdeplibs " $func_resolve_sysroot_result" ;; 5888 7027 esac 5889 7028 fi 5890 tmp_libs="$tmp_libs $deplib"7029 func_append tmp_libs " $func_resolve_sysroot_result" 5891 7030 done 5892 7031 … … 5894 7033 # Add the search paths of all dependency libraries 5895 7034 for deplib in $dependency_libs; do 7035 path= 5896 7036 case $deplib in 5897 7037 -L*) path="$deplib" ;; 5898 7038 *.la) 7039 func_resolve_sysroot "$deplib" 7040 deplib=$func_resolve_sysroot_result 5899 7041 func_dirname "$deplib" "" "." 5900 dir= "$func_dirname_result"7042 dir=$func_dirname_result 5901 7043 # We need an absolute path. 5902 7044 case $dir in … … 5925 7067 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` 5926 7068 fi 5927 compiler_flags="$compiler_flags${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"5928 linker_flags="$linker_flags-dylib_file ${darwin_install_name}:${depdepl}"7069 func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" 7070 func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" 5929 7071 path= 5930 7072 fi … … 5959 7101 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" 5960 7102 else 5961 compiler_flags="$compiler_flags "`$ECHO " X $new_inherited_linker_flags" | $Xsed -e's% \([^ $]*\).ltframework% -framework \1%g'`7103 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` 5962 7104 fi 5963 7105 fi … … 5976 7118 case "$lib_search_path " in 5977 7119 *" $dir "*) ;; 5978 *) lib_search_path="$lib_search_path$dir" ;;7120 *) func_append lib_search_path " $dir" ;; 5979 7121 esac 5980 7122 done … … 6034 7176 case " $tmp_libs " in 6035 7177 *" $deplib "*) ;; 6036 *) tmp_libs="$tmp_libs$deplib" ;;7178 *) func_append tmp_libs " $deplib" ;; 6037 7179 esac 6038 7180 ;; 6039 *) tmp_libs="$tmp_libs$deplib" ;;7181 *) func_append tmp_libs " $deplib" ;; 6040 7182 esac 6041 7183 done … … 6053 7195 esac 6054 7196 if test -n "$i" ; then 6055 tmp_libs="$tmp_libs$i"7197 func_append tmp_libs " $i" 6056 7198 fi 6057 7199 done … … 6094 7236 build_libtool_libs=no 6095 7237 oldlibs="$output" 6096 objs="$objs$old_deplibs"7238 func_append objs "$old_deplibs" 6097 7239 ;; 6098 7240 … … 6127 7269 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 6128 7270 else 6129 $ECHO7271 echo 6130 7272 $ECHO "*** Warning: Linking the shared library $output against the non-libtool" 6131 7273 $ECHO "*** objects $objs is not portable!" 6132 libobjs="$libobjs$objs"7274 func_append libobjs " $objs" 6133 7275 fi 6134 7276 fi … … 6189 7331 # 6190 7332 case $version_type in 7333 # correct linux to gnu/linux during the next big refactor 6191 7334 darwin|linux|osf|windows|none) 6192 7335 func_arith $number_major + $number_minor … … 6195 7338 revision="$number_revision" 6196 7339 ;; 6197 freebsd-aout|freebsd-elf| sunos)7340 freebsd-aout|freebsd-elf|qnx|sunos) 6198 7341 current="$number_major" 6199 7342 revision="$number_minor" … … 6305 7448 ;; 6306 7449 6307 linux) 7450 linux) # correct to gnu/linux during the next big refactor 6308 7451 func_arith $current - $age 6309 7452 major=.$func_arith_result … … 6328 7471 6329 7472 # Make executables depend on our current version. 6330 verstring="$verstring:${current}.0"7473 func_append verstring ":${current}.0" 6331 7474 ;; 6332 7475 … … 6396 7539 6397 7540 func_generate_dlsyms "$libname" "$libname" "yes" 6398 libobjs="$libobjs$symfileobj"7541 func_append libobjs " $symfileobj" 6399 7542 test "X$libobjs" = "X " && libobjs= 6400 7543 6401 if test "$ mode" != relink; then7544 if test "$opt_mode" != relink; then 6402 7545 # Remove our outputs, but don't remove object files since they 6403 7546 # may have been created when compiling PIC objects. … … 6415 7558 fi 6416 7559 fi 6417 removelist="$removelist$p"7560 func_append removelist " $p" 6418 7561 ;; 6419 7562 *) ;; … … 6426 7569 # Now set the variables for building old libraries. 6427 7570 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then 6428 oldlibs="$oldlibs$output_objdir/$libname.$libext"7571 func_append oldlibs " $output_objdir/$libname.$libext" 6429 7572 6430 7573 # Transform .lo files to .o files. 6431 oldobjs="$objs "`$ECHO " X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`7574 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` 6432 7575 fi 6433 7576 6434 7577 # Eliminate all temporary directories. 6435 7578 #for path in $notinst_path; do 6436 # lib_search_path=`$ECHO " X$lib_search_path " | $Xsed -e"s% $path % %g"`6437 # deplibs=`$ECHO " X$deplibs " | $Xsed -e"s% -L$path % %g"`6438 # dependency_libs=`$ECHO " X$dependency_libs " | $Xsed -e"s% -L$path % %g"`7579 # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` 7580 # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` 7581 # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` 6439 7582 #done 6440 7583 … … 6443 7586 temp_xrpath= 6444 7587 for libdir in $xrpath; do 6445 temp_xrpath="$temp_xrpath -R$libdir" 7588 func_replace_sysroot "$libdir" 7589 func_append temp_xrpath " -R$func_replace_sysroot_result" 6446 7590 case "$finalize_rpath " in 6447 7591 *" $libdir "*) ;; 6448 *) f inalize_rpath="$finalize_rpath$libdir" ;;7592 *) func_append finalize_rpath " $libdir" ;; 6449 7593 esac 6450 7594 done … … 6460 7604 case " $dlprefiles $dlfiles " in 6461 7605 *" $lib "*) ;; 6462 *) dlfiles="$dlfiles$lib" ;;7606 *) func_append dlfiles " $lib" ;; 6463 7607 esac 6464 7608 done … … 6470 7614 case "$dlprefiles " in 6471 7615 *" $lib "*) ;; 6472 *) dlprefiles="$dlprefiles$lib" ;;7616 *) func_append dlprefiles " $lib" ;; 6473 7617 esac 6474 7618 done … … 6477 7621 if test -n "$rpath"; then 6478 7622 case $host in 6479 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* )7623 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) 6480 7624 # these systems don't actually have a c library (as such)! 6481 7625 ;; 6482 7626 *-*-rhapsody* | *-*-darwin1.[012]) 6483 7627 # Rhapsody C library is in the System framework 6484 deplibs="$deplibsSystem.ltframework"7628 func_append deplibs " System.ltframework" 6485 7629 ;; 6486 7630 *-*-netbsd*) … … 6499 7643 # Add libc to deplibs on all other systems if necessary. 6500 7644 if test "$build_libtool_need_lc" = "yes"; then 6501 deplibs="$deplibs-lc"7645 func_append deplibs " -lc" 6502 7646 fi 6503 7647 ;; … … 6548 7692 case " $predeps $postdeps " in 6549 7693 *" $i "*) 6550 newdeplibs="$newdeplibs$i"7694 func_append newdeplibs " $i" 6551 7695 i="" 6552 7696 ;; … … 6559 7703 deplib_match=$1 6560 7704 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 6561 newdeplibs="$newdeplibs$i"7705 func_append newdeplibs " $i" 6562 7706 else 6563 7707 droppeddeps=yes 6564 $ECHO7708 echo 6565 7709 $ECHO "*** Warning: dynamic linker does not accept needed library $i." 6566 $ECHO"*** I have the capability to make that library automatically link in when"6567 $ECHO"*** you link to this library. But I can only do this if you have a"6568 $ECHO"*** shared version of the library, which I believe you do not have"6569 $ECHO"*** because a test_compile did reveal that the linker did not use it for"6570 $ECHO"*** its dynamic dependency list that programs get resolved with at runtime."7710 echo "*** I have the capability to make that library automatically link in when" 7711 echo "*** you link to this library. But I can only do this if you have a" 7712 echo "*** shared version of the library, which I believe you do not have" 7713 echo "*** because a test_compile did reveal that the linker did not use it for" 7714 echo "*** its dynamic dependency list that programs get resolved with at runtime." 6571 7715 fi 6572 7716 fi 6573 7717 ;; 6574 7718 *) 6575 newdeplibs="$newdeplibs$i"7719 func_append newdeplibs " $i" 6576 7720 ;; 6577 7721 esac … … 6591 7735 case " $predeps $postdeps " in 6592 7736 *" $i "*) 6593 newdeplibs="$newdeplibs$i"7737 func_append newdeplibs " $i" 6594 7738 i="" 6595 7739 ;; … … 6602 7746 deplib_match=$1 6603 7747 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 6604 newdeplibs="$newdeplibs$i"7748 func_append newdeplibs " $i" 6605 7749 else 6606 7750 droppeddeps=yes 6607 $ECHO7751 echo 6608 7752 $ECHO "*** Warning: dynamic linker does not accept needed library $i." 6609 $ECHO"*** I have the capability to make that library automatically link in when"6610 $ECHO"*** you link to this library. But I can only do this if you have a"6611 $ECHO"*** shared version of the library, which you do not appear to have"6612 $ECHO"*** because a test_compile did reveal that the linker did not use this one"6613 $ECHO"*** as a dynamic dependency that programs can get resolved with at runtime."7753 echo "*** I have the capability to make that library automatically link in when" 7754 echo "*** you link to this library. But I can only do this if you have a" 7755 echo "*** shared version of the library, which you do not appear to have" 7756 echo "*** because a test_compile did reveal that the linker did not use this one" 7757 echo "*** as a dynamic dependency that programs can get resolved with at runtime." 6614 7758 fi 6615 7759 fi 6616 7760 else 6617 7761 droppeddeps=yes 6618 $ECHO7762 echo 6619 7763 $ECHO "*** Warning! Library $i is needed by this library but I was not able to" 6620 $ECHO"*** make it link in! You will probably need to install it or some"6621 $ECHO"*** library that it depends on before this library will be fully"6622 $ECHO"*** functional. Installing it before continuing would be even better."7764 echo "*** make it link in! You will probably need to install it or some" 7765 echo "*** library that it depends on before this library will be fully" 7766 echo "*** functional. Installing it before continuing would be even better." 6623 7767 fi 6624 7768 ;; 6625 7769 *) 6626 newdeplibs="$newdeplibs$i"7770 func_append newdeplibs " $i" 6627 7771 ;; 6628 7772 esac … … 6641 7785 case " $predeps $postdeps " in 6642 7786 *" $a_deplib "*) 6643 newdeplibs="$newdeplibs$a_deplib"7787 func_append newdeplibs " $a_deplib" 6644 7788 a_deplib="" 6645 7789 ;; … … 6648 7792 if test -n "$a_deplib" ; then 6649 7793 libname=`eval "\\$ECHO \"$libname_spec\""` 7794 if test -n "$file_magic_glob"; then 7795 libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` 7796 else 7797 libnameglob=$libname 7798 fi 7799 test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` 6650 7800 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 6651 potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 7801 if test "$want_nocaseglob" = yes; then 7802 shopt -s nocaseglob 7803 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` 7804 $nocaseglob 7805 else 7806 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` 7807 fi 6652 7808 for potent_lib in $potential_libs; do 6653 7809 # Follow soft links. … … 6666 7822 case $potliblink in 6667 7823 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; 6668 *) potlib=`$ECHO " X$potlib" | $Xsed -e's,[^/]*$,,'`"$potliblink";;7824 *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; 6669 7825 esac 6670 7826 done … … 6672 7828 $SED -e 10q | 6673 7829 $EGREP "$file_magic_regex" > /dev/null; then 6674 newdeplibs="$newdeplibs$a_deplib"7830 func_append newdeplibs " $a_deplib" 6675 7831 a_deplib="" 6676 7832 break 2 … … 6681 7837 if test -n "$a_deplib" ; then 6682 7838 droppeddeps=yes 6683 $ECHO7839 echo 6684 7840 $ECHO "*** Warning: linker path does not have real file for library $a_deplib." 6685 $ECHO"*** I have the capability to make that library automatically link in when"6686 $ECHO"*** you link to this library. But I can only do this if you have a"6687 $ECHO"*** shared version of the library, which you do not appear to have"6688 $ECHO"*** because I did check the linker path looking for a file starting"7841 echo "*** I have the capability to make that library automatically link in when" 7842 echo "*** you link to this library. But I can only do this if you have a" 7843 echo "*** shared version of the library, which you do not appear to have" 7844 echo "*** because I did check the linker path looking for a file starting" 6689 7845 if test -z "$potlib" ; then 6690 7846 $ECHO "*** with $libname but no candidates were found. (...for file magic test)" … … 6697 7853 *) 6698 7854 # Add a -L argument. 6699 newdeplibs="$newdeplibs$a_deplib"7855 func_append newdeplibs " $a_deplib" 6700 7856 ;; 6701 7857 esac … … 6713 7869 case " $predeps $postdeps " in 6714 7870 *" $a_deplib "*) 6715 newdeplibs="$newdeplibs$a_deplib"7871 func_append newdeplibs " $a_deplib" 6716 7872 a_deplib="" 6717 7873 ;; … … 6724 7880 for potent_lib in $potential_libs; do 6725 7881 potlib="$potent_lib" # see symlink-check above in file_magic test 6726 if eval "\$ECHO \" X$potent_lib\"" 2>/dev/null | $Xsed -e10q | \7882 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ 6727 7883 $EGREP "$match_pattern_regex" > /dev/null; then 6728 newdeplibs="$newdeplibs$a_deplib"7884 func_append newdeplibs " $a_deplib" 6729 7885 a_deplib="" 6730 7886 break 2 … … 6735 7891 if test -n "$a_deplib" ; then 6736 7892 droppeddeps=yes 6737 $ECHO7893 echo 6738 7894 $ECHO "*** Warning: linker path does not have real file for library $a_deplib." 6739 $ECHO"*** I have the capability to make that library automatically link in when"6740 $ECHO"*** you link to this library. But I can only do this if you have a"6741 $ECHO"*** shared version of the library, which you do not appear to have"6742 $ECHO"*** because I did check the linker path looking for a file starting"7895 echo "*** I have the capability to make that library automatically link in when" 7896 echo "*** you link to this library. But I can only do this if you have a" 7897 echo "*** shared version of the library, which you do not appear to have" 7898 echo "*** because I did check the linker path looking for a file starting" 6743 7899 if test -z "$potlib" ; then 6744 7900 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" … … 6751 7907 *) 6752 7908 # Add a -L argument. 6753 newdeplibs="$newdeplibs$a_deplib"7909 func_append newdeplibs " $a_deplib" 6754 7910 ;; 6755 7911 esac … … 6758 7914 none | unknown | *) 6759 7915 newdeplibs="" 6760 tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ 6761 -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` 7916 tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` 6762 7917 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 6763 7918 for i in $predeps $postdeps ; do 6764 7919 # can't use Xsed below, because $i might contain '/' 6765 tmp_deplibs=`$ECHO " X $tmp_deplibs" | $Xsed -e"s,$i,,"`7920 tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` 6766 7921 done 6767 7922 fi 6768 if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |6769 $GREP . >/dev/null; then6770 $ECHO7923 case $tmp_deplibs in 7924 *[!\ \ ]*) 7925 echo 6771 7926 if test "X$deplibs_check_method" = "Xnone"; then 6772 $ECHO"*** Warning: inter-library dependencies are not supported in this platform."7927 echo "*** Warning: inter-library dependencies are not supported in this platform." 6773 7928 else 6774 $ECHO"*** Warning: inter-library dependencies are not known to be supported."7929 echo "*** Warning: inter-library dependencies are not known to be supported." 6775 7930 fi 6776 $ECHO"*** All declared inter-library dependencies are being dropped."7931 echo "*** All declared inter-library dependencies are being dropped." 6777 7932 droppeddeps=yes 6778 fi 7933 ;; 7934 esac 6779 7935 ;; 6780 7936 esac … … 6788 7944 *-*-rhapsody* | *-*-darwin1.[012]) 6789 7945 # On Rhapsody replace the C library with the System framework 6790 newdeplibs=`$ECHO " X $newdeplibs" | $Xsed -e's/ -lc / System.ltframework /'`7946 newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` 6791 7947 ;; 6792 7948 esac … … 6794 7950 if test "$droppeddeps" = yes; then 6795 7951 if test "$module" = yes; then 6796 $ECHO6797 $ECHO"*** Warning: libtool could not satisfy all declared inter-library"7952 echo 7953 echo "*** Warning: libtool could not satisfy all declared inter-library" 6798 7954 $ECHO "*** dependencies of module $libname. Therefore, libtool will create" 6799 $ECHO"*** a static module, that should work as long as the dlopening"6800 $ECHO"*** application is linked with the -dlopen flag."7955 echo "*** a static module, that should work as long as the dlopening" 7956 echo "*** application is linked with the -dlopen flag." 6801 7957 if test -z "$global_symbol_pipe"; then 6802 $ECHO6803 $ECHO"*** However, this would only work if libtool was able to extract symbol"6804 $ECHO"*** lists from a program, using \`nm' or equivalent, but libtool could"6805 $ECHO"*** not find such a program. So, this module is probably useless."6806 $ECHO"*** \`nm' from GNU binutils and a full rebuild may help."7958 echo 7959 echo "*** However, this would only work if libtool was able to extract symbol" 7960 echo "*** lists from a program, using \`nm' or equivalent, but libtool could" 7961 echo "*** not find such a program. So, this module is probably useless." 7962 echo "*** \`nm' from GNU binutils and a full rebuild may help." 6807 7963 fi 6808 7964 if test "$build_old_libs" = no; then … … 6814 7970 fi 6815 7971 else 6816 $ECHO"*** The inter-library dependencies that have been dropped here will be"6817 $ECHO"*** automatically added whenever a program is linked with this library"6818 $ECHO"*** or is declared to -dlopen it."7972 echo "*** The inter-library dependencies that have been dropped here will be" 7973 echo "*** automatically added whenever a program is linked with this library" 7974 echo "*** or is declared to -dlopen it." 6819 7975 6820 7976 if test "$allow_undefined" = no; then 6821 $ECHO6822 $ECHO"*** Since this library must not contain undefined symbols,"6823 $ECHO"*** because either the platform does not support them or"6824 $ECHO"*** it was explicitly requested with -no-undefined,"6825 $ECHO"*** libtool will only create a static version of it."7977 echo 7978 echo "*** Since this library must not contain undefined symbols," 7979 echo "*** because either the platform does not support them or" 7980 echo "*** it was explicitly requested with -no-undefined," 7981 echo "*** libtool will only create a static version of it." 6826 7982 if test "$build_old_libs" = no; then 6827 7983 oldlibs="$output_objdir/$libname.$libext" … … 6840 7996 case $host in 6841 7997 *-*-darwin*) 6842 newdeplibs=`$ECHO " X $newdeplibs" | $Xsed -e's% \([^ $]*\).ltframework% -framework \1%g'`6843 new_inherited_linker_flags=`$ECHO " X $new_inherited_linker_flags" | $Xsed -e's% \([^ $]*\).ltframework% -framework \1%g'`6844 deplibs=`$ECHO " X $deplibs" | $Xsed -e's% \([^ $]*\).ltframework% -framework \1%g'`7998 newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` 7999 new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` 8000 deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` 6845 8001 ;; 6846 8002 esac … … 6855 8011 case " $deplibs " in 6856 8012 *" -L$path/$objdir "*) 6857 new_libs="$new_libs-L$path/$objdir" ;;8013 func_append new_libs " -L$path/$objdir" ;; 6858 8014 esac 6859 8015 ;; … … 6865 8021 case " $new_libs " in 6866 8022 *" $deplib "*) ;; 6867 *) new_libs="$new_libs$deplib" ;;8023 *) func_append new_libs " $deplib" ;; 6868 8024 esac 6869 8025 ;; 6870 *) new_libs="$new_libs$deplib" ;;8026 *) func_append new_libs " $deplib" ;; 6871 8027 esac 6872 8028 done … … 6880 8036 # Test again, we may have decided not to build it any more 6881 8037 if test "$build_libtool_libs" = yes; then 8038 # Remove ${wl} instances when linking with ld. 8039 # FIXME: should test the right _cmds variable. 8040 case $archive_cmds in 8041 *\$LD\ *) wl= ;; 8042 esac 6882 8043 if test "$hardcode_into_libs" = yes; then 6883 8044 # Hardcode the library paths … … 6885 8046 dep_rpath= 6886 8047 rpath="$finalize_rpath" 6887 test "$ mode" != relink && rpath="$compile_rpath$rpath"8048 test "$opt_mode" != relink && rpath="$compile_rpath$rpath" 6888 8049 for libdir in $rpath; do 6889 8050 if test -n "$hardcode_libdir_flag_spec"; then 6890 8051 if test -n "$hardcode_libdir_separator"; then 8052 func_replace_sysroot "$libdir" 8053 libdir=$func_replace_sysroot_result 6891 8054 if test -z "$hardcode_libdirs"; then 6892 8055 hardcode_libdirs="$libdir" … … 6897 8060 ;; 6898 8061 *) 6899 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"8062 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" 6900 8063 ;; 6901 8064 esac … … 6903 8066 else 6904 8067 eval flag=\"$hardcode_libdir_flag_spec\" 6905 dep_rpath="$dep_rpath$flag"8068 func_append dep_rpath " $flag" 6906 8069 fi 6907 8070 elif test -n "$runpath_var"; then 6908 8071 case "$perm_rpath " in 6909 8072 *" $libdir "*) ;; 6910 *) perm_rpath="$perm_rpath$libdir" ;;8073 *) func_append perm_rpath " $libdir" ;; 6911 8074 esac 6912 8075 fi … … 6916 8079 test -n "$hardcode_libdirs"; then 6917 8080 libdir="$hardcode_libdirs" 6918 if test -n "$hardcode_libdir_flag_spec_ld"; then 6919 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" 6920 else 6921 eval dep_rpath=\"$hardcode_libdir_flag_spec\" 6922 fi 8081 eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" 6923 8082 fi 6924 8083 if test -n "$runpath_var" && test -n "$perm_rpath"; then … … 6926 8085 rpath= 6927 8086 for dir in $perm_rpath; do 6928 rpath="$rpath$dir:"8087 func_append rpath "$dir:" 6929 8088 done 6930 8089 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" … … 6934 8093 6935 8094 shlibpath="$finalize_shlibpath" 6936 test "$ mode" != relink && shlibpath="$compile_shlibpath$shlibpath"8095 test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" 6937 8096 if test -n "$shlibpath"; then 6938 8097 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" … … 6960 8119 for link 6961 8120 do 6962 linknames="$linknames$link"8121 func_append linknames " $link" 6963 8122 done 6964 8123 6965 8124 # Use standard objects if they are pic 6966 test -z "$pic_flag" && libobjs=`$ECHO " X$libobjs" | $SP2NL | $Xsed -e"$lo2o" | $NL2SP`8125 test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` 6967 8126 test "X$libobjs" = "X " && libobjs= 6968 8127 … … 6971 8130 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" 6972 8131 export_symbols="$output_objdir/$libname.uexp" 6973 delfiles="$delfiles$export_symbols"8132 func_append delfiles " $export_symbols" 6974 8133 fi 6975 8134 … … 7002 8161 cmds=$export_symbols_cmds 7003 8162 save_ifs="$IFS"; IFS='~' 7004 for cmd in $cmds; do8163 for cmd1 in $cmds; do 7005 8164 IFS="$save_ifs" 7006 eval cmd=\"$cmd\" 7007 func_len " $cmd" 7008 len=$func_len_result 7009 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then 8165 # Take the normal branch if the nm_file_list_spec branch 8166 # doesn't work or if tool conversion is not needed. 8167 case $nm_file_list_spec~$to_tool_file_cmd in 8168 *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) 8169 try_normal_branch=yes 8170 eval cmd=\"$cmd1\" 8171 func_len " $cmd" 8172 len=$func_len_result 8173 ;; 8174 *) 8175 try_normal_branch=no 8176 ;; 8177 esac 8178 if test "$try_normal_branch" = yes \ 8179 && { test "$len" -lt "$max_cmd_len" \ 8180 || test "$max_cmd_len" -le -1; } 8181 then 7010 8182 func_show_eval "$cmd" 'exit $?' 8183 skipped_export=false 8184 elif test -n "$nm_file_list_spec"; then 8185 func_basename "$output" 8186 output_la=$func_basename_result 8187 save_libobjs=$libobjs 8188 save_output=$output 8189 output=${output_objdir}/${output_la}.nm 8190 func_to_tool_file "$output" 8191 libobjs=$nm_file_list_spec$func_to_tool_file_result 8192 func_append delfiles " $output" 8193 func_verbose "creating $NM input file list: $output" 8194 for obj in $save_libobjs; do 8195 func_to_tool_file "$obj" 8196 $ECHO "$func_to_tool_file_result" 8197 done > "$output" 8198 eval cmd=\"$cmd1\" 8199 func_show_eval "$cmd" 'exit $?' 8200 output=$save_output 8201 libobjs=$save_libobjs 7011 8202 skipped_export=false 7012 8203 else … … 7030 8221 tmp_export_symbols="$export_symbols" 7031 8222 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" 7032 $opt_dry_run || eval '$ECHO " X$include_expsyms" | $Xsed| $SP2NL >> "$tmp_export_symbols"'8223 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' 7033 8224 fi 7034 8225 … … 7042 8233 # isn't a blessed tool. 7043 8234 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter 7044 delfiles="$delfiles$export_symbols $output_objdir/$libname.filter"8235 func_append delfiles " $export_symbols $output_objdir/$libname.filter" 7045 8236 export_symbols=$output_objdir/$libname.def 7046 8237 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols … … 7052 8243 *" $test_deplib "*) ;; 7053 8244 *) 7054 tmp_deplibs="$tmp_deplibs$test_deplib"8245 func_append tmp_deplibs " $test_deplib" 7055 8246 ;; 7056 8247 esac … … 7072 8263 else 7073 8264 gentop="$output_objdir/${outputname}x" 7074 generated="$generated$gentop"8265 func_append generated " $gentop" 7075 8266 7076 8267 func_extract_archives $gentop $convenience 7077 libobjs="$libobjs$func_extract_archives_result"8268 func_append libobjs " $func_extract_archives_result" 7078 8269 test "X$libobjs" = "X " && libobjs= 7079 8270 fi … … 7082 8273 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then 7083 8274 eval flag=\"$thread_safe_flag_spec\" 7084 linker_flags="$linker_flags$flag"8275 func_append linker_flags " $flag" 7085 8276 fi 7086 8277 7087 8278 # Make a backup of the uninstalled library when relinking 7088 if test "$ mode" = relink; then8279 if test "$opt_mode" = relink; then 7089 8280 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? 7090 8281 fi … … 7131 8322 fi 7132 8323 save_output=$output 7133 output_la=`$ECHO "X$output" | $Xsed -e "$basename"` 8324 func_basename "$output" 8325 output_la=$func_basename_result 7134 8326 7135 8327 # Clear the reloadable object creation command queue and … … 7144 8336 output=${output_objdir}/${output_la}.lnkscript 7145 8337 func_verbose "creating GNU ld script: $output" 7146 $ECHO'INPUT (' > $output8338 echo 'INPUT (' > $output 7147 8339 for obj in $save_libobjs 7148 8340 do 7149 $ECHO "$obj" >> $output 8341 func_to_tool_file "$obj" 8342 $ECHO "$func_to_tool_file_result" >> $output 7150 8343 done 7151 $ECHO ')' >> $output 7152 delfiles="$delfiles $output" 8344 echo ')' >> $output 8345 func_append delfiles " $output" 8346 func_to_tool_file "$output" 8347 output=$func_to_tool_file_result 7153 8348 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then 7154 8349 output=${output_objdir}/${output_la}.lnk … … 7164 8359 for obj 7165 8360 do 7166 $ECHO "$obj" >> $output 8361 func_to_tool_file "$obj" 8362 $ECHO "$func_to_tool_file_result" >> $output 7167 8363 done 7168 delfiles="$delfiles $output" 7169 output=$firstobj\"$file_list_spec$output\" 8364 func_append delfiles " $output" 8365 func_to_tool_file "$output" 8366 output=$firstobj\"$file_list_spec$func_to_tool_file_result\" 7170 8367 else 7171 8368 if test -n "$save_libobjs"; then … … 7191 8388 if test "$k" -eq 1 ; then 7192 8389 # The first file doesn't have a previous command to add. 7193 eval concat_cmds=\"$reload_cmds $objlist $last_robj\" 8390 reload_objs=$objlist 8391 eval concat_cmds=\"$reload_cmds\" 7194 8392 else 7195 8393 # All subsequent reloadable object files will link in 7196 8394 # the last one created. 7197 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" 8395 reload_objs="$objlist $last_robj" 8396 eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" 7198 8397 fi 7199 8398 last_robj=$output_objdir/$output_la-${k}.$objext … … 7201 8400 k=$func_arith_result 7202 8401 output=$output_objdir/$output_la-${k}.$objext 7203 objlist= $obj8402 objlist=" $obj" 7204 8403 func_len " $last_robj" 7205 8404 func_arith $len0 + $func_len_result … … 7211 8410 # files will link in the last one created. 7212 8411 test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 7213 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" 8412 reload_objs="$objlist $last_robj" 8413 eval concat_cmds=\"\${concat_cmds}$reload_cmds\" 7214 8414 if test -n "$last_robj"; then 7215 8415 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" 7216 8416 fi 7217 delfiles="$delfiles$output"8417 func_append delfiles " $output" 7218 8418 7219 8419 else … … 7249 8449 7250 8450 # Restore the uninstalled library and exit 7251 if test "$ mode" = relink; then8451 if test "$opt_mode" = relink; then 7252 8452 ( cd "$output_objdir" && \ 7253 8453 $RM "${realname}T" && \ … … 7270 8470 tmp_export_symbols="$export_symbols" 7271 8471 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" 7272 $opt_dry_run || eval '$ECHO " X$include_expsyms" | $Xsed| $SP2NL >> "$tmp_export_symbols"'8472 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' 7273 8473 fi 7274 8474 … … 7282 8482 # isn't a blessed tool. 7283 8483 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter 7284 delfiles="$delfiles$export_symbols $output_objdir/$libname.filter"8484 func_append delfiles " $export_symbols $output_objdir/$libname.filter" 7285 8485 export_symbols=$output_objdir/$libname.def 7286 8486 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols … … 7323 8523 if test -n "$dlprefiles"; then 7324 8524 gentop="$output_objdir/${outputname}x" 7325 generated="$generated$gentop"8525 func_append generated " $gentop" 7326 8526 7327 8527 func_extract_archives $gentop $dlprefiles 7328 libobjs="$libobjs$func_extract_archives_result"8528 func_append libobjs " $func_extract_archives_result" 7329 8529 test "X$libobjs" = "X " && libobjs= 7330 8530 fi … … 7342 8542 7343 8543 # Restore the uninstalled library and exit 7344 if test "$ mode" = relink; then8544 if test "$opt_mode" = relink; then 7345 8545 ( cd "$output_objdir" && \ 7346 8546 $RM "${realname}T" && \ … … 7354 8554 7355 8555 # Restore the uninstalled library and exit 7356 if test "$ mode" = relink; then8556 if test "$opt_mode" = relink; then 7357 8557 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? 7358 8558 … … 7435 8635 if test -n "$whole_archive_flag_spec"; then 7436 8636 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" 7437 reload_conv_objs=$reload_objs\ `$ECHO " X$tmp_whole_archive_flags" | $Xsed -e's|,| |g'`8637 reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` 7438 8638 else 7439 8639 gentop="$output_objdir/${obj}x" 7440 generated="$generated$gentop"8640 func_append generated " $gentop" 7441 8641 7442 8642 func_extract_archives $gentop $convenience … … 7445 8645 fi 7446 8646 8647 # If we're not building shared, we need to use non_pic_objs 8648 test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" 8649 7447 8650 # Create the old-style object. 7448 reload_objs="$objs$old_deplibs "`$ECHO " X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test8651 reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test 7449 8652 7450 8653 output="$obj" … … 7506 8709 *-*-rhapsody* | *-*-darwin1.[012]) 7507 8710 # On Rhapsody replace the C library is the System framework 7508 compile_deplibs=`$ECHO " X $compile_deplibs" | $Xsed -e's/ -lc / System.ltframework /'`7509 finalize_deplibs=`$ECHO " X $finalize_deplibs" | $Xsed -e's/ -lc / System.ltframework /'`8711 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` 8712 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` 7510 8713 ;; 7511 8714 esac … … 7518 8721 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 7519 8722 10.[0123]) 7520 compile_command="$compile_command${wl}-bind_at_load"7521 f inalize_command="$finalize_command${wl}-bind_at_load"8723 func_append compile_command " ${wl}-bind_at_load" 8724 func_append finalize_command " ${wl}-bind_at_load" 7522 8725 ;; 7523 8726 esac 7524 8727 fi 7525 8728 # Time to change all our "foo.ltframework" stuff back to "-framework foo" 7526 compile_deplibs=`$ECHO " X $compile_deplibs" | $Xsed -e's% \([^ $]*\).ltframework% -framework \1%g'`7527 finalize_deplibs=`$ECHO " X $finalize_deplibs" | $Xsed -e's% \([^ $]*\).ltframework% -framework \1%g'`8729 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` 8730 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` 7528 8731 ;; 7529 8732 esac … … 7539 8742 case " $compile_deplibs " in 7540 8743 *" -L$path/$objdir "*) 7541 new_libs="$new_libs-L$path/$objdir" ;;8744 func_append new_libs " -L$path/$objdir" ;; 7542 8745 esac 7543 8746 ;; … … 7549 8752 case " $new_libs " in 7550 8753 *" $deplib "*) ;; 7551 *) new_libs="$new_libs$deplib" ;;8754 *) func_append new_libs " $deplib" ;; 7552 8755 esac 7553 8756 ;; 7554 *) new_libs="$new_libs$deplib" ;;8757 *) func_append new_libs " $deplib" ;; 7555 8758 esac 7556 8759 done … … 7558 8761 7559 8762 7560 compile_command="$compile_command$compile_deplibs"7561 f inalize_command="$finalize_command$finalize_deplibs"8763 func_append compile_command " $compile_deplibs" 8764 func_append finalize_command " $finalize_deplibs" 7562 8765 7563 8766 if test -n "$rpath$xrpath"; then … … 7567 8770 case "$finalize_rpath " in 7568 8771 *" $libdir "*) ;; 7569 *) f inalize_rpath="$finalize_rpath$libdir" ;;8772 *) func_append finalize_rpath " $libdir" ;; 7570 8773 esac 7571 8774 done … … 7586 8789 ;; 7587 8790 *) 7588 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"8791 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" 7589 8792 ;; 7590 8793 esac … … 7592 8795 else 7593 8796 eval flag=\"$hardcode_libdir_flag_spec\" 7594 rpath="$rpath$flag"8797 func_append rpath " $flag" 7595 8798 fi 7596 8799 elif test -n "$runpath_var"; then 7597 8800 case "$perm_rpath " in 7598 8801 *" $libdir "*) ;; 7599 *) perm_rpath="$perm_rpath$libdir" ;;8802 *) func_append perm_rpath " $libdir" ;; 7600 8803 esac 7601 8804 fi … … 7606 8809 *":$libdir:"*) ;; 7607 8810 ::) dllsearchpath=$libdir;; 7608 *) dllsearchpath="$dllsearchpath:$libdir";;8811 *) func_append dllsearchpath ":$libdir";; 7609 8812 esac 7610 8813 case :$dllsearchpath: in 7611 8814 *":$testbindir:"*) ;; 7612 8815 ::) dllsearchpath=$testbindir;; 7613 *) dllsearchpath="$dllsearchpath:$testbindir";;8816 *) func_append dllsearchpath ":$testbindir";; 7614 8817 esac 7615 8818 ;; … … 7637 8840 ;; 7638 8841 *) 7639 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"8842 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" 7640 8843 ;; 7641 8844 esac … … 7643 8846 else 7644 8847 eval flag=\"$hardcode_libdir_flag_spec\" 7645 rpath="$rpath$flag"8848 func_append rpath " $flag" 7646 8849 fi 7647 8850 elif test -n "$runpath_var"; then 7648 8851 case "$finalize_perm_rpath " in 7649 8852 *" $libdir "*) ;; 7650 *) f inalize_perm_rpath="$finalize_perm_rpath$libdir" ;;8853 *) func_append finalize_perm_rpath " $libdir" ;; 7651 8854 esac 7652 8855 fi … … 7662 8865 if test -n "$libobjs" && test "$build_old_libs" = yes; then 7663 8866 # Transform all the library objects into standard objects. 7664 compile_command=`$ECHO " X$compile_command" | $SP2NL | $Xsed -e"$lo2o" | $NL2SP`7665 finalize_command=`$ECHO " X$finalize_command" | $SP2NL | $Xsed -e"$lo2o" | $NL2SP`8867 compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` 8868 finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` 7666 8869 fi 7667 8870 … … 7675 8878 wrappers_required=yes 7676 8879 case $host in 8880 *cegcc* | *mingw32ce*) 8881 # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. 8882 wrappers_required=no 8883 ;; 7677 8884 *cygwin* | *mingw* ) 7678 8885 if test "$build_libtool_libs" != yes; then 7679 8886 wrappers_required=no 7680 8887 fi 7681 ;;7682 *cegcc)7683 # Disable wrappers for cegcc, we are cross compiling anyway.7684 wrappers_required=no7685 8888 ;; 7686 8889 *) … … 7692 8895 if test "$wrappers_required" = no; then 7693 8896 # Replace the output file specification. 7694 compile_command=`$ECHO " X$compile_command" | $Xsed -e's%@OUTPUT@%'"$output"'%g'`8897 compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` 7695 8898 link_command="$compile_command$compile_rpath" 7696 8899 … … 7698 8901 exit_status=0 7699 8902 func_show_eval "$link_command" 'exit_status=$?' 8903 8904 if test -n "$postlink_cmds"; then 8905 func_to_tool_file "$output" 8906 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` 8907 func_execute_cmds "$postlink_cmds" 'exit $?' 8908 fi 7700 8909 7701 8910 # Delete the generated files. … … 7721 8930 rpath= 7722 8931 for dir in $perm_rpath; do 7723 rpath="$rpath$dir:"8932 func_append rpath "$dir:" 7724 8933 done 7725 8934 compile_var="$runpath_var=\"$rpath\$$runpath_var\" " … … 7729 8938 rpath= 7730 8939 for dir in $finalize_perm_rpath; do 7731 rpath="$rpath$dir:"8940 func_append rpath "$dir:" 7732 8941 done 7733 8942 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " … … 7739 8948 link_command="$compile_var$compile_command$compile_rpath" 7740 8949 # Replace the output file specification. 7741 link_command=`$ECHO " X$link_command" | $Xsed -e's%@OUTPUT@%'"$output"'%g'`8950 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` 7742 8951 # Delete the old output file. 7743 8952 $opt_dry_run || $RM $output 7744 8953 # Link the executable and exit 7745 8954 func_show_eval "$link_command" 'exit $?' 8955 8956 if test -n "$postlink_cmds"; then 8957 func_to_tool_file "$output" 8958 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` 8959 func_execute_cmds "$postlink_cmds" 'exit $?' 8960 fi 8961 7746 8962 exit $EXIT_SUCCESS 7747 8963 fi … … 7758 8974 link_command="$finalize_var$compile_command$finalize_rpath" 7759 8975 if test "$fast_install" = yes; then 7760 relink_command=`$ECHO " X$compile_var$compile_command$compile_rpath" | $Xsed -e's%@OUTPUT@%\$progdir/\$file%g'`8976 relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` 7761 8977 else 7762 8978 # fast_install is set to needless … … 7770 8986 7771 8987 # Replace the output file specification. 7772 link_command=`$ECHO " X$link_command" | $Xsed -e's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`8988 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` 7773 8989 7774 8990 # Delete the old output files. … … 7776 8992 7777 8993 func_show_eval "$link_command" 'exit $?' 8994 8995 if test -n "$postlink_cmds"; then 8996 func_to_tool_file "$output_objdir/$outputname" 8997 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` 8998 func_execute_cmds "$postlink_cmds" 'exit $?' 8999 fi 7778 9000 7779 9001 # Now create the wrapper script. … … 7794 9016 done 7795 9017 relink_command="(cd `pwd`; $relink_command)" 7796 relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` 7797 fi 7798 7799 # Quote $ECHO for shipping. 7800 if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then 7801 case $progpath in 7802 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; 7803 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; 7804 esac 7805 qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` 7806 else 7807 qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` 9018 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` 7808 9019 fi 7809 9020 … … 7885 9096 oldobjs="$old_deplibs $non_pic_objects" 7886 9097 if test "$preload" = yes && test -f "$symfileobj"; then 7887 oldobjs="$oldobjs$symfileobj"9098 func_append oldobjs " $symfileobj" 7888 9099 fi 7889 9100 fi … … 7893 9104 if test -n "$addlibs"; then 7894 9105 gentop="$output_objdir/${outputname}x" 7895 generated="$generated$gentop"9106 func_append generated " $gentop" 7896 9107 7897 9108 func_extract_archives $gentop $addlibs 7898 oldobjs="$oldobjs$func_extract_archives_result"9109 func_append oldobjs " $func_extract_archives_result" 7899 9110 fi 7900 9111 … … 7907 9118 if test -n "$dlprefiles"; then 7908 9119 gentop="$output_objdir/${outputname}x" 7909 generated="$generated$gentop"9120 func_append generated " $gentop" 7910 9121 7911 9122 func_extract_archives $gentop $dlprefiles 7912 oldobjs="$oldobjs$func_extract_archives_result"9123 func_append oldobjs " $func_extract_archives_result" 7913 9124 fi 7914 9125 … … 7926 9137 : 7927 9138 else 7928 $ECHO"copying selected object files to avoid basename conflicts..."9139 echo "copying selected object files to avoid basename conflicts..." 7929 9140 gentop="$output_objdir/${outputname}x" 7930 generated="$generated$gentop"9141 func_append generated " $gentop" 7931 9142 func_mkdir_p "$gentop" 7932 9143 save_oldobjs=$oldobjs … … 7952 9163 done 7953 9164 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" 7954 oldobjs="$oldobjs$gentop/$newobj"9165 func_append oldobjs " $gentop/$newobj" 7955 9166 ;; 7956 *) oldobjs="$oldobjs$obj" ;;9167 *) func_append oldobjs " $obj" ;; 7957 9168 esac 7958 9169 done 7959 9170 fi 9171 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 9172 tool_oldlib=$func_to_tool_file_result 7960 9173 eval cmds=\"$old_archive_cmds\" 7961 9174 … … 7963 9176 len=$func_len_result 7964 9177 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then 9178 cmds=$old_archive_cmds 9179 elif test -n "$archiver_list_spec"; then 9180 func_verbose "using command file archive linking..." 9181 for obj in $oldobjs 9182 do 9183 func_to_tool_file "$obj" 9184 $ECHO "$func_to_tool_file_result" 9185 done > $output_objdir/$libname.libcmd 9186 func_to_tool_file "$output_objdir/$libname.libcmd" 9187 oldobjs=" $archiver_list_spec$func_to_tool_file_result" 7965 9188 cmds=$old_archive_cmds 7966 9189 else … … 8037 9260 # Quote the link command for shipping. 8038 9261 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" 8039 relink_command=`$ECHO " X$relink_command" | $Xsed -e"$sed_quote_subst"`9262 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` 8040 9263 if test "$hardcode_automatic" = yes ; then 8041 9264 relink_command= … … 8057 9280 func_basename "$deplib" 8058 9281 name="$func_basename_result" 8059 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 9282 func_resolve_sysroot "$deplib" 9283 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` 8060 9284 test -z "$libdir" && \ 8061 9285 func_fatal_error "\`$deplib' is not a valid libtool archive" 8062 newdependency_libs="$newdependency_libs$libdir/$name"9286 func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" 8063 9287 ;; 8064 *) newdependency_libs="$newdependency_libs $deplib" ;; 9288 -L*) 9289 func_stripname -L '' "$deplib" 9290 func_replace_sysroot "$func_stripname_result" 9291 func_append newdependency_libs " -L$func_replace_sysroot_result" 9292 ;; 9293 -R*) 9294 func_stripname -R '' "$deplib" 9295 func_replace_sysroot "$func_stripname_result" 9296 func_append newdependency_libs " -R$func_replace_sysroot_result" 9297 ;; 9298 *) func_append newdependency_libs " $deplib" ;; 8065 9299 esac 8066 9300 done … … 8076 9310 test -z "$libdir" && \ 8077 9311 func_fatal_error "\`$lib' is not a valid libtool archive" 8078 newdlfiles="$newdlfiles$libdir/$name"9312 func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" 8079 9313 ;; 8080 *) newdlfiles="$newdlfiles$lib" ;;9314 *) func_append newdlfiles " $lib" ;; 8081 9315 esac 8082 9316 done … … 8095 9329 test -z "$libdir" && \ 8096 9330 func_fatal_error "\`$lib' is not a valid libtool archive" 8097 newdlprefiles="$newdlprefiles$libdir/$name"9331 func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" 8098 9332 ;; 8099 9333 esac … … 8107 9341 *) abs=`pwd`"/$lib" ;; 8108 9342 esac 8109 newdlfiles="$newdlfiles$abs"9343 func_append newdlfiles " $abs" 8110 9344 done 8111 9345 dlfiles="$newdlfiles" … … 8116 9350 *) abs=`pwd`"/$lib" ;; 8117 9351 esac 8118 newdlprefiles="$newdlprefiles$abs"9352 func_append newdlprefiles " $abs" 8119 9353 done 8120 9354 dlprefiles="$newdlprefiles" … … 8122 9356 $RM $output 8123 9357 # place dlname in correct position for cygwin 9358 # In fact, it would be nice if we could use this code for all target 9359 # systems that can't hard-code library paths into their executables 9360 # and that have no shared library path variable independent of PATH, 9361 # but it turns out we can't easily determine that from inspecting 9362 # libtool variables, so we have to hard-code the OSs to which it 9363 # applies here; at the moment, that means platforms that use the PE 9364 # object format with DLL files. See the long comment at the top of 9365 # tests/bindir.at for full details. 8124 9366 tdlname=$dlname 8125 9367 case $host,$output,$installed,$module,$dlname in 8126 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; 9368 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) 9369 # If a -bindir argument was supplied, place the dll there. 9370 if test "x$bindir" != x ; 9371 then 9372 func_relative_path "$install_libdir" "$bindir" 9373 tdlname=$func_relative_path_result$dlname 9374 else 9375 # Otherwise fall back on heuristic. 9376 tdlname=../bin/$dlname 9377 fi 9378 ;; 8127 9379 esac 8128 9380 $ECHO > $output "\ … … 8183 9435 } 8184 9436 8185 { test "$ mode" = link || test "$mode" = relink; } &&9437 { test "$opt_mode" = link || test "$opt_mode" = relink; } && 8186 9438 func_mode_link ${1+"$@"} 8187 9439 … … 8203 9455 do 8204 9456 case $arg in 8205 -f) RM="$RM$arg"; rmforce=yes ;;8206 -*) RM="$RM$arg" ;;8207 *) f iles="$files$arg" ;;9457 -f) func_append RM " $arg"; rmforce=yes ;; 9458 -*) func_append RM " $arg" ;; 9459 *) func_append files " $arg" ;; 8208 9460 esac 8209 9461 done … … 8214 9466 rmdirs= 8215 9467 8216 origobjdir="$objdir"8217 9468 for file in $files; do 8218 9469 func_dirname "$file" "" "." 8219 9470 dir="$func_dirname_result" 8220 9471 if test "X$dir" = X.; then 8221 o bjdir="$origobjdir"9472 odir="$objdir" 8222 9473 else 8223 o bjdir="$dir/$origobjdir"9474 odir="$dir/$objdir" 8224 9475 fi 8225 9476 func_basename "$file" 8226 9477 name="$func_basename_result" 8227 test "$ mode" = uninstall && objdir="$dir"8228 8229 # Remember o bjdir for removal later, being careful to avoid duplicates8230 if test "$ mode" = clean; then9478 test "$opt_mode" = uninstall && odir="$dir" 9479 9480 # Remember odir for removal later, being careful to avoid duplicates 9481 if test "$opt_mode" = clean; then 8231 9482 case " $rmdirs " in 8232 *" $o bjdir "*) ;;8233 *) rmdirs="$rmdirs $objdir" ;;9483 *" $odir "*) ;; 9484 *) func_append rmdirs " $odir" ;; 8234 9485 esac 8235 9486 fi … … 8257 9508 # Delete the libtool libraries and symlinks. 8258 9509 for n in $library_names; do 8259 rmfiles="$rmfiles $objdir/$n"9510 func_append rmfiles " $odir/$n" 8260 9511 done 8261 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"8262 8263 case "$ mode" in9512 test -n "$old_library" && func_append rmfiles " $odir/$old_library" 9513 9514 case "$opt_mode" in 8264 9515 clean) 8265 case " $library_names " in 8266 # " " in the beginning catches empty $dlname 9516 case " $library_names " in 8267 9517 *" $dlname "*) ;; 8268 *) rmfiles="$rmfiles $objdir/$dlname" ;;9518 *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; 8269 9519 esac 8270 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"9520 test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" 8271 9521 ;; 8272 9522 uninstall) … … 8296 9546 if test -n "$pic_object" && 8297 9547 test "$pic_object" != none; then 8298 rmfiles="$rmfiles$dir/$pic_object"9548 func_append rmfiles " $dir/$pic_object" 8299 9549 fi 8300 9550 … … 8302 9552 if test -n "$non_pic_object" && 8303 9553 test "$non_pic_object" != none; then 8304 rmfiles="$rmfiles$dir/$non_pic_object"9554 func_append rmfiles " $dir/$non_pic_object" 8305 9555 fi 8306 9556 fi … … 8308 9558 8309 9559 *) 8310 if test "$ mode" = clean ; then9560 if test "$opt_mode" = clean ; then 8311 9561 noexename=$name 8312 9562 case $file in … … 8318 9568 # $file with .exe has already been added to rmfiles, 8319 9569 # add $file without .exe 8320 rmfiles="$rmfiles$file"9570 func_append rmfiles " $file" 8321 9571 ;; 8322 9572 esac … … 8327 9577 relink_command= 8328 9578 func_source $func_ltwrapper_scriptname_result 8329 rmfiles="$rmfiles$func_ltwrapper_scriptname_result"9579 func_append rmfiles " $func_ltwrapper_scriptname_result" 8330 9580 else 8331 9581 relink_command= … … 8335 9585 # note $name still contains .exe if it was in $file originally 8336 9586 # as does the version of $file that was added into $rmfiles 8337 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"9587 func_append rmfiles " $odir/$name $odir/${name}S.${objext}" 8338 9588 if test "$fast_install" = yes && test -n "$relink_command"; then 8339 rmfiles="$rmfiles $objdir/lt-$name"9589 func_append rmfiles " $odir/lt-$name" 8340 9590 fi 8341 9591 if test "X$noexename" != "X$name" ; then 8342 rmfiles="$rmfiles $objdir/lt-${noexename}.c"9592 func_append rmfiles " $odir/lt-${noexename}.c" 8343 9593 fi 8344 9594 fi … … 8348 9598 func_show_eval "$RM $rmfiles" 'exit_status=1' 8349 9599 done 8350 objdir="$origobjdir"8351 9600 8352 9601 # Try to remove the ${objdir}s in the directories where we deleted files … … 8360 9609 } 8361 9610 8362 { test "$ mode" = uninstall || test "$mode" = clean; } &&9611 { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && 8363 9612 func_mode_uninstall ${1+"$@"} 8364 9613 8365 test -z "$ mode" && {9614 test -z "$opt_mode" && { 8366 9615 help="$generic_help" 8367 9616 func_fatal_help "you must specify a MODE" … … 8369 9618 8370 9619 test -z "$exec_cmd" && \ 8371 func_fatal_help "invalid operation mode \`$ mode'"9620 func_fatal_help "invalid operation mode \`$opt_mode'" 8372 9621 8373 9622 if test -n "$exec_cmd"; then -
issm/branches/trunk-jpl-damage/m4
- Property svn:ignore
-
old new 1 svn-commit.tmp 1
-
- Property svn:ignore
-
issm/branches/trunk-jpl-damage/m4/issm_options.m4
r12946 r13101 15 15 dnl }}} 16 16 dnl shared build {{{ 17 AC_ARG_ENABLE([shared], dnl feature 18 AS_HELP_STRING([--enable-shared], [produce libISSM.so.0]), dnl help string 19 [enable_shared=$enableval], dnl action if given 20 [enable_shared=no]) dnl action if not given 21 AM_CONDITIONAL([SHARED], [test $enable_shared = yes]) 17 AC_ARG_ENABLE([sharedlibs], dnl feature 18 AS_HELP_STRING([--enable-sharedlibs], [produce libISSM.so.0]), dnl help string 19 [enable_sharedlibs=$enableval], dnl action if given 20 [enable_sharedlibs=no]) dnl action if not given 21 AM_CONDITIONAL([SHAREDLIBS], [test x$enable_sharedlibs = xyes]) 22 dnl }}} 23 24 dnl shared build {{{ 25 AC_ARG_ENABLE([version], dnl feature 26 AS_HELP_STRING([--enable-version], [produce libISSM.so.0]), dnl help string 27 [enable_version=$enableval], dnl action if given 28 [enable_version=no]) dnl action if not given 29 AM_CONDITIONAL([VERSION], [test x$enable_VERSION = xyes]) 22 30 dnl }}} 23 31 … … 221 229 MATLABWRAPPEREXT=$MEXEXT 222 230 AC_SUBST([MATLABWRAPPEREXT]) 223 231 AC_SUBST([MEXLIB]) 224 232 AC_SUBST([MEXLINK]) 225 233 fi … … 466 474 AC_MSG_RESULT($HAVE_ADOLC) 467 475 dnl }}} 476 dnl adolc-version{{{ 477 AC_ARG_WITH([adolc-version], 478 AS_HELP_STRING([--with-adolc-version=number], [adolc version.]), 479 [ADOLC_VERSION=$withval],[ADOLC_VERSION=2]) 480 AC_MSG_CHECKING(for adolc-version) 481 482 AC_DEFINE_UNQUOTED([_ADOLC_VERSION_],$ADOLC_VERSION,[ADOLC version]) 483 AC_MSG_RESULT($ADOLC_VERSION) 484 dnl }}} 468 485 dnl adic2{{{ 469 486 AC_ARG_WITH([adic2-dir], … … 589 606 ;; 590 607 esac 591 608 592 609 METISINCL=-I"$METIS_ROOT/include" 593 610 AC_DEFINE([_METIS_VERSION_],[5],[ Metis version number]) … … 606 623 AC_MSG_CHECKING(for mpi) 607 624 AC_ARG_WITH([mpi-lib], 608 AS_HELP_STRING([--with-mpi-lib = o tions],[mpi options, for ex: "-L$MPIROOT -lmpich]),625 AS_HELP_STRING([--with-mpi-lib = options],[mpi options, for ex: "-L$MPIROOT -lmpich]), 609 626 [MPILIB=$withval],[MPILIB=""]) 610 627 … … 620 637 else 621 638 HAVE_MPI=yes 622 MPIINCL=-I"$MPI_INCLUDE /"639 MPIINCL=-I"$MPI_INCLUDE" 623 640 AC_DEFINE([_HAVE_MPI_],[1],[with Mpi in ISSM src]) 624 641 AC_DEFINE([HAVE_MPI],[1],[Mpi Flag for Dakota (DO NOT REMOVE)]) … … 666 683 *cygwin*) 667 684 if test "$PETSC_MAJOR" = "2" ; then 668 PETSCLIB="-link -LIBPATH:\"$PETSC_ROOT/ $PETSC_ARCH/lib\" -LIBPATH:\"$PETSC_ROOT/lib\" -LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" libpetscksp.lib libpetscdm.lib libpetscmat.lib libpetscvec.lib libpetscsnes.lib libpetscts.lib libmpiuni.lib libpetsc.lib"685 PETSCLIB="-link -LIBPATH:\"$PETSC_ROOT/lib\" -LIBPATH:\"$PETSC_ROOT/lib\" -LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" libpetscksp.lib libpetscdm.lib libpetscmat.lib libpetscvec.lib libpetscsnes.lib libpetscts.lib libmpiuni.lib libpetsc.lib" 669 686 else 670 PETSCLIB="-link -LIBPATH:\"$PETSC_ROOT/ $PETSC_ARCH/lib\" -LIBPATH:\"$PETSC_ROOT/lib\" -LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" libpetsc.lib"687 PETSCLIB="-link -LIBPATH:\"$PETSC_ROOT/lib\" -LIBPATH:\"$PETSC_ROOT/lib\" -LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" libpetsc.lib" 671 688 fi 672 689 ;; 673 690 *linux*) 674 691 if test "$PETSC_MAJOR" = "2" ; then 675 PETSCLIB="-L$PETSC_ROOT/ $PETSC_ARCH/lib -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc -lpetscsnes -lpetscts"692 PETSCLIB="-L$PETSC_ROOT/lib -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc -lpetscsnes -lpetscts" 676 693 else 677 PETSCLIB="-L$PETSC_ROOT/ $PETSC_ARCH/lib -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lpetsc -ldl"694 PETSCLIB="-L$PETSC_ROOT/lib -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lpetsc -ldl" 678 695 fi 679 696 ;; 680 697 *darwin*) 681 698 if test "$PETSC_MAJOR" = "2" ; then 682 PETSCLIB="-L$PETSC_ROOT/ $PETSC_ARCH/lib -L$PETSC_ROOT/lib/$PETSC_ARCH/ -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetscsnes -lpetscts -lpetsc"699 PETSCLIB="-L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH/ -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetscsnes -lpetscts -lpetsc" 683 700 else 684 PETSCLIB="-L$PETSC_ROOT/ $PETSC_ARCH/lib -L$PETSC_ROOT/lib/$PETSC_ARCH/ -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lpetsc"701 PETSCLIB="-L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH/ -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lpetsc" 685 702 fi 686 703 ;; -
issm/branches/trunk-jpl-damage/scripts/automakererun.sh
r12878 r13101 9 9 10 10 cd $ISSM_DIR 11 autoreconf -iv -I m411 autoreconf -iv -I externalpackages/libtool/install/share/aclocal -
issm/branches/trunk-jpl-damage/scripts/historyISSM.m
r11577 r13101 3 3 md.mesh.numberofelements 4 4 md=mesh(md,'DomainOutline.exp',5000); 5 md=setmask(md,'','');6 5 md=setflowequation(md,'macayeal','all'); 7 md=setflowequation(md,'pattyn','all','stokes','all');8 6 md=solve(md,TransientSolutionEnum); 9 md=solve(md,BalancedthicknessSolutionEnum);10 7 md=solve(md,DiagnosticSolutionEnum); 11 8 md=loadresultsfromcluster(md); -
issm/branches/trunk-jpl-damage/src/Makefile.am
r12878 r13101 1 EXTRA_DIST = perl propy1 EXTRA_DIST = perl pro py 2 2 SUBDIRS = c modules m -
issm/branches/trunk-jpl-damage/src/ad/todo
r12878 r13101 43 43 44 44 Replace memcpy, realloc with x layers. Replace all calls to malloc and free in the code. 45 46 47 48 Questions: 49 set of active IssmDouble variables different from set of independent variables activated with <<=? 50 same thing dependent variables? -
issm/branches/trunk-jpl-damage/src/c/Container/DataSet.cpp
r12878 r13101 133 133 vector<Object*>::iterator object; 134 134 135 if(this==NULL)_error 2_("trying to echo a NULL dataset");135 if(this==NULL)_error_("trying to echo a NULL dataset"); 136 136 137 137 _pprintLine_("DataSet echo: " << objects.size() << " objects"); … … 150 150 vector<Object*>::iterator object; 151 151 152 if(this==NULL)_error 2_("trying to echo a NULL dataset");152 if(this==NULL)_error_("trying to echo a NULL dataset"); 153 153 154 154 _pprintLine_("DataSet echo: " << objects.size() << " objects"); … … 194 194 195 195 _assert_(this); 196 if(!sorted)_error 2_("trying to binary search on a non-sorted dataset!");196 if(!sorted)_error_("trying to binary search on a non-sorted dataset!"); 197 197 198 198 /*Carry out a binary search on the sorted_ids: */ 199 199 if(!binary_search(&id_offset,eid, sorted_ids,objects.size())){ 200 _error 2_("could not find object with id " << eid << " in DataSet " << EnumToStringx(enum_type));200 _error_("could not find object with id " << eid << " in DataSet " << EnumToStringx(enum_type)); 201 201 } 202 202 … … 259 259 /*Only sort if we are not already sorted: */ 260 260 if(!sorted){ 261 _error 2_("not implemented yet!");262 } 263 } 264 /*}}}*/ 261 _error_("not implemented yet!"); 262 } 263 } 264 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/Container/Elements.cpp
r12878 r13101 203 203 /*see what the first element of this partition has in stock (this is common to all partitions)*/ 204 204 if(my_rank==minrank){ 205 if(this->Size()==0) _error 2_("Cannot write results because there is no element??");205 if(this->Size()==0) _error_("Cannot write results because there is no element??"); 206 206 Element* element=(Element*)this->GetObjectByOffset(0); 207 207 element->ListResultsInfo(&resultsenums,&resultssizes,&resultstimes,&resultssteps,&numberofresults); … … 232 232 if(resultssizes[i]==P1Enum) vectorsize=numberofvertices; 233 233 else if(resultssizes[i]==P0Enum) vectorsize=numberofelements; 234 else _error 2_("Unkown result size: " << EnumToStringx(resultssizes[i]));234 else _error_("Unkown result size: " << EnumToStringx(resultssizes[i])); 235 235 vector=new Vector(vectorsize); 236 236 -
issm/branches/trunk-jpl-damage/src/c/Container/Inputs.cpp
r12878 r13101 57 57 /*we could not find an input with the correct enum type. No defaults values were provided, 58 58 * error out: */ 59 _error 2_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");59 _error_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")"); 60 60 } 61 61 … … 85 85 /*we could not find an input with the correct enum type. No defaults values were provided, 86 86 * error out: */ 87 _error 2_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");87 _error_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")"); 88 88 } 89 89 … … 113 113 /*we could not find an input with the correct enum type. No defaults values were provided, 114 114 * error out: */ 115 _error 2_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");115 _error_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")"); 116 116 } 117 117 … … 141 141 /*we could not find an input with the correct enum type. No defaults values were provided, 142 142 * error out: */ 143 _error 2_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")");143 _error_("could not find input with enum type " << enum_type << " (" << EnumToStringx(enum_type) << ")"); 144 144 } 145 145 … … 213 213 214 214 /*some checks: */ 215 if(!constrain_input) _error 2_("input " << EnumToStringx(constrain_enum) << " could not be found!");215 if(!constrain_input) _error_("input " << EnumToStringx(constrain_enum) << " could not be found!"); 216 216 217 217 /*Apply ContrainMin: */ … … 254 254 } 255 255 else{ 256 _error 2_("Input " << EnumToStringx(enumtype) << " not found");256 _error_("Input " << EnumToStringx(enumtype) << " not found"); 257 257 } 258 258 … … 275 275 } 276 276 else{ 277 _error 2_("Input " << EnumToStringx(enumtype) << " not found");277 _error_("Input " << EnumToStringx(enumtype) << " not found"); 278 278 } 279 279 … … 296 296 } 297 297 else{ 298 _error 2_("Input " << EnumToStringx(enumtype) << " not found");298 _error_("Input " << EnumToStringx(enumtype) << " not found"); 299 299 } 300 300 … … 317 317 } 318 318 else{ 319 _error 2_("Input " << EnumToStringx(enumtype) << " not found");319 _error_("Input " << EnumToStringx(enumtype) << " not found"); 320 320 } 321 321 … … 369 369 /*Make a copy of the original input: */ 370 370 original=(Input*)this->GetInput(original_enum); 371 if(!original)_error 2_("could not find input with enum: " << EnumToStringx(original_enum));371 if(!original)_error_("could not find input with enum: " << EnumToStringx(original_enum)); 372 372 copy=(Input*)original->copy(); 373 373 … … 416 416 417 417 /*some checks: */ 418 if(!xinput) _error 2_("input " << EnumToStringx(MeshXEnum) << " could not be found!");419 if(!yinput) _error 2_("input " << EnumToStringx(MeshYEnum) << " could not be found!");418 if(!xinput) _error_("input " << EnumToStringx(MeshXEnum) << " could not be found!"); 419 if(!yinput) _error_("input " << EnumToStringx(MeshYEnum) << " could not be found!"); 420 420 421 421 /*Apply AXPY: */ -
issm/branches/trunk-jpl-damage/src/c/Container/Observations.cpp
r12946 r13101 58 58 options->Get(&maxtrimming,"maxtrimming",+1.e+21); 59 59 options->Get(&minspacing,"minspacing",0.01); 60 if(minspacing<=0) _error 2_("minspacing must > 0");60 if(minspacing<=0) _error_("minspacing must > 0"); 61 61 62 62 /*Get Minimum box size*/ 63 63 if(options->GetOption("boxlength")){ 64 64 options->Get(&minlength,"boxlength"); 65 if(minlength<=0)_error 2_("boxlength should be a positive number");66 maxdepth= int(log(max(xmax-xmin,ymax-ymin)/minlength +1)/log(2.0));65 if(minlength<=0)_error_("boxlength should be a positive number"); 66 maxdepth=reCast<int,IssmDouble>(log(max(xmax-xmin,ymax-ymin)/minlength +1)/log(2.0)); 67 67 } 68 68 else{ … … 383 383 SolverxSeq(&GinvZ, Gamma,obs,n_obs); // Gamma^-1 Z 384 384 #else 385 _error 2_("GSL is required");385 _error_("GSL is required"); 386 386 #endif 387 387 -
issm/branches/trunk-jpl-damage/src/c/Container/Options.cpp
r12878 r13101 47 47 48 48 /*Also, check the option name*/ 49 if(!in_option->name) _error 2_("input option has an empty name");50 if(strchr(in_option->name,'.')) _error 2_("Option \"" << in_option->name << "\" has a protected character \".\"");51 if(strchr(in_option->name,'[')) _error 2_("Option \"" << in_option->name << "\" has a protected character \"[\"");52 if(strchr(in_option->name,']')) _error 2_("Option \"" << in_option->name << "\" has a protected character \"]\"");49 if(!in_option->name) _error_("input option has an empty name"); 50 if(strchr(in_option->name,'.')) _error_("Option \"" << in_option->name << "\" has a protected character \".\""); 51 if(strchr(in_option->name,'[')) _error_("Option \"" << in_option->name << "\" has a protected character \"[\""); 52 if(strchr(in_option->name,']')) _error_("Option \"" << in_option->name << "\" has a protected character \"]\""); 53 53 54 54 /*Finally, check that no option of the same name already exists in the dataset*/ … … 57 57 option=(Option*)(*object); 58 58 if (!strcmp(option->name,in_option->name)){ 59 _error 2_("Options \"" << in_option->name << "\" found multiple times");59 _error_("Options \"" << in_option->name << "\" found multiple times"); 60 60 break; 61 61 } … … 83 83 /*Else, the Option does not exist, no default provided*/ 84 84 else{ 85 _error 2_("option of name \"" << name << "\" not found, and no default value has been provided");85 _error_("option of name \"" << name << "\" not found, and no default value has been provided"); 86 86 } 87 87 } … … 121 121 /*Else, the Option does not exist, no default provided*/ 122 122 else{ 123 _error 2_("option of name \"" << name << "\" not found, and no default value has been provided");123 _error_("option of name \"" << name << "\" not found, and no default value has been provided"); 124 124 } 125 125 } … … 159 159 /*Else, the Option does not exist, no default provided*/ 160 160 else{ 161 _error 2_("option of name \"" << name << "\" not found, and no default value has been provided");161 _error_("option of name \"" << name << "\" not found, and no default value has been provided"); 162 162 } 163 163 } … … 199 199 /*Else, the Option does not exist, no default provided*/ 200 200 else{ 201 _error 2_("option of name \"" << name << "\" not found, and no default value has been provided");201 _error_("option of name \"" << name << "\" not found, and no default value has been provided"); 202 202 } 203 203 … … 264 264 /*Else: not supported*/ 265 265 else{ 266 _error 2_("Cannot recover field \"" << name << "\" for an option of type " << EnumToStringx(option->ObjectEnum()));266 _error_("Cannot recover field \"" << name << "\" for an option of type " << EnumToStringx(option->ObjectEnum())); 267 267 } 268 268 } … … 290 290 /*Else, the Option does not exist, no default provided*/ 291 291 else{ 292 _error 2_("option of name \"" << name << "\" not found, and no default value has been provided");292 _error_("option of name \"" << name << "\" not found, and no default value has been provided"); 293 293 } 294 294 } … … 324 324 /*Else: not supported*/ 325 325 else{ 326 _error 2_("Cannot recover field \"" << name << "\" for an option of type " << EnumToStringx(option->ObjectEnum()));326 _error_("Cannot recover field \"" << name << "\" for an option of type " << EnumToStringx(option->ObjectEnum())); 327 327 } 328 328 } -
issm/branches/trunk-jpl-damage/src/c/Container/Parameters.cpp
r12878 r13101 65 65 } 66 66 } 67 _error 2_("could not find parameter " << EnumToStringx(enum_type));67 _error_("could not find parameter " << EnumToStringx(enum_type)); 68 68 } 69 69 /*}}}*/ … … 82 82 } 83 83 } 84 _error 2_("could not find parameter " << EnumToStringx(enum_type));84 _error_("could not find parameter " << EnumToStringx(enum_type)); 85 85 } 86 86 /*}}}*/ … … 99 99 } 100 100 } 101 _error 2_("could not find parameter " << EnumToStringx(enum_type));101 _error_("could not find parameter " << EnumToStringx(enum_type)); 102 102 } 103 103 /*}}}*/ … … 116 116 } 117 117 } 118 _error 2_("could not find parameter " << EnumToStringx(enum_type));118 _error_("could not find parameter " << EnumToStringx(enum_type)); 119 119 } 120 120 /*}}}*/ … … 133 133 } 134 134 } 135 _error 2_("could not find parameter " << EnumToStringx(enum_type));135 _error_("could not find parameter " << EnumToStringx(enum_type)); 136 136 137 137 } … … 151 151 } 152 152 } 153 _error 2_("could not find parameter " << EnumToStringx(enum_type));153 _error_("could not find parameter " << EnumToStringx(enum_type)); 154 154 155 155 } … … 169 169 } 170 170 } 171 _error 2_("could not find parameter " << EnumToStringx(enum_type));171 _error_("could not find parameter " << EnumToStringx(enum_type)); 172 172 173 173 } … … 187 187 } 188 188 } 189 _error 2_("could not find parameter " << EnumToStringx(enum_type));189 _error_("could not find parameter " << EnumToStringx(enum_type)); 190 190 191 191 } … … 205 205 } 206 206 } 207 _error 2_("could not find parameter " << EnumToStringx(enum_type));207 _error_("could not find parameter " << EnumToStringx(enum_type)); 208 208 209 209 } … … 223 223 } 224 224 } 225 _error 2_("could not find parameter " << EnumToStringx(enum_type));225 _error_("could not find parameter " << EnumToStringx(enum_type)); 226 226 227 227 } … … 241 241 } 242 242 } 243 _error 2_("could not find parameter " << EnumToStringx(enum_type));243 _error_("could not find parameter " << EnumToStringx(enum_type)); 244 244 } 245 245 /*}}}*/ … … 258 258 } 259 259 } 260 _error 2_("could not find parameter " << EnumToStringx(enum_type));260 _error_("could not find parameter " << EnumToStringx(enum_type)); 261 261 262 262 } … … 276 276 } 277 277 } 278 _error 2_("could not find parameter " << EnumToStringx(enum_type));278 _error_("could not find parameter " << EnumToStringx(enum_type)); 279 279 280 280 } … … 294 294 } 295 295 } 296 _error 2_("could not find parameter " << EnumToStringx(enum_type));296 _error_("could not find parameter " << EnumToStringx(enum_type)); 297 297 } 298 298 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/EnumDefinitions/EnumDefinitions.h
r12946 r13101 12 12 enum definitions{ 13 13 /*Model fields {{{1*/ 14 AutodiffForwardEnum,15 14 AutodiffIsautodiffEnum, 16 AutodiffReverseEnum,17 15 BalancethicknessSpcthicknessEnum, 18 16 BalancethicknessStabilizationEnum, … … 50 48 FlowequationElementEquationEnum, 51 49 FlowequationIshutterEnum, 50 FlowequationIsl1l2Enum, 52 51 FlowequationIsmacayealpattynEnum, 53 52 FlowequationIsstokesEnum, … … 238 237 /*Approximations {{{1*/ 239 238 ApproximationEnum, 239 NoneApproximationEnum, 240 240 HutterApproximationEnum, 241 241 MacAyealApproximationEnum, 242 242 MacAyealPattynApproximationEnum, 243 243 MacAyealStokesApproximationEnum, 244 NoneApproximationEnum,244 L1L2ApproximationEnum, 245 245 PattynApproximationEnum, 246 246 PattynStokesApproximationEnum, … … 286 286 NumericalfluxEnum, 287 287 ParamEnum, 288 L1L2IceFrontEnum, 288 289 PattynIceFrontEnum, 289 290 PengridEnum, … … 385 386 EnthalpyPicardEnum, 386 387 ThicknessAbsGradientEnum, 388 ThicknessAlongGradientEnum, 389 ThicknessAcrossGradientEnum, 387 390 StepResponsesEnum, 388 391 IntMatParamEnum, … … 405 408 StressTensoryzEnum, 406 409 StressTensorzzEnum, 407 IceVolumeEnum, //FIXME reposition408 TotalSmbEnum, //FIXME reposition409 ThicknessAlongGradientEnum,410 ThicknessAcrossGradientEnum,411 410 /*}}}*/ 412 411 /*Element Interpolations{{{1*/ … … 448 447 MaxVzEnum, 449 448 MaxAbsVzEnum, 449 IceVolumeEnum, 450 TotalSmbEnum, 450 451 /*}}}*/ 451 452 /*Convergence{{{1*/ -
issm/branches/trunk-jpl-damage/src/c/EnumDefinitions/Synchronize.sh
r12878 r13101 98 98 cat <<END >> $ISSM_DIR/src/c/modules/StringToEnumx/StringToEnumx.cpp 99 99 /*If we reach this point, the string provided has not been found*/ 100 _error 2_("Enum " << name << " not found");100 _error_("Enum " << name << " not found"); 101 101 } 102 102 END … … 107 107 #Add header to pythonenum file{{{ 108 108 cat <<END > $ISSM_DIR/src/m/enum/EnumDefinitions.py 109 from StringToEnum import StringToEnum 110 109 111 """ 110 112 … … 166 168 """ 167 169 168 return StringToEnum('$NAME') 170 return StringToEnum('$NAME')[0] 169 171 170 172 END -
issm/branches/trunk-jpl-damage/src/c/Makefile.am
r12946 r13101 1 INCLUDES = @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @MPIINCL@ @MATLABINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @BLASLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @TRIANGLEINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @GSLINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@1 AM_CPPFLAGS = @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @MPIINCL@ @MATLABINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @BLASLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @TRIANGLEINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @GSLINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@ 2 2 3 3 EXEEXT=$(ISSMEXT) … … 6 6 lib_LIBRARIES = libISSMCore.a libISSMOverload.a 7 7 8 #if SHARED 9 #lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la libISSM.la10 #endif8 if SHAREDLIBS 9 lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la libISSM.la 10 endif 11 11 if PYTHON 12 12 lib_LIBRARIES += libISSMPython.a 13 13 endif 14 14 if MATLAB 15 if SHAREDLIBS 16 lib_LTLIBRARIES += libISSMMatlab.la 17 endif 15 18 lib_LIBRARIES += libISSMMatlab.a 16 19 endif 17 20 if MODULES 21 if SHAREDLIBS 22 lib_LTLIBRARIES += libISSMModules.la 23 endif 18 24 lib_LIBRARIES += libISSMModules.a 19 25 endif … … 197 203 ./shared/Numerics/isnan.h\ 198 204 ./shared/Numerics/isnan.cpp\ 205 ./shared/Numerics/cubic.cpp\ 199 206 ./shared/Numerics/extrema.cpp\ 200 207 ./shared/Numerics/XZvectorsToCoordinateSystem.cpp\ … … 384 391 ./modules/Dakotax/SpawnCore.cpp\ 385 392 ./modules/Dakotax/DescriptorIndex.cpp\ 386 ./modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp\387 393 ./modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp\ 388 ./modules/AverageOntoPartitionx/AverageOntoPartitionx.h\389 394 ./modules/Dakotax/SpawnCoreParallel.cpp 390 395 #}}} … … 1006 1011 libISSMCore_a_CXXFLAGS = $(ALLCXXFLAGS) 1007 1012 1008 #if SHARED 1009 #libISSM_la_SOURCES = solutions/issm.cpp1010 #libISSM_la_LIBADD = libISSMCore.la libISSMOverload.la1011 # 1012 #libISSMCore_la_SOURCES = $(issm_sources)1013 #libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB)1014 # 1015 #libISSMOverload_la_SOURCES = ./shared/String/stricmp.c1016 #endif1013 if SHAREDLIBS 1014 libISSM_la_SOURCES = solutions/issm.cpp 1015 libISSM_la_LIBADD = libISSMCore.la libISSMOverload.la 1016 1017 libISSMCore_la_SOURCES = $(issm_sources) 1018 libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB) 1019 1020 libISSMOverload_la_SOURCES = ./shared/String/stricmp.c 1021 endif 1017 1022 1018 1023 if MODULES … … 1022 1027 libISSMModules_a_SOURCES += $(kml_sources) 1023 1028 libISSMModules_a_CXXFLAGS = $(ALLCXXFLAGS) 1029 libISSMModules_a_LIBADD = ./libISSMCore.a 1030 if SHAREDLIBS 1031 libISSMModules_la_SOURCES = $(libISSMModules_a_SOURCES) 1032 endif 1024 1033 endif 1025 1034 … … 1032 1041 libISSMMatlab_a_SOURCES = $(matlab_sources) 1033 1042 libISSMMatlab_a_CXXFLAGS= $(ALLCXXFLAGS) 1034 endif 1035 1043 if SHAREDLIBS 1044 libISSMMatlab_la_SOURCES = $(libISSMMatlab_a_SOURCES) 1045 endif 1046 endif 1047 1048 if VERSION 1049 AM_LDFLAGS = 1050 else 1051 AM_LDFLAGS = -avoid-version 1052 endif 1036 1053 #}}} 1037 1054 #Overload library, to overload any non-standard symbols. {{{ -
issm/branches/trunk-jpl-damage/src/c/classes/DofIndexing.cpp
r12832 r13101 143 143 else this->sdoflist=NULL; 144 144 } 145 else _error 2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");145 else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!"); 146 146 } 147 147 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/classes/FemModel.cpp
r12832 r13101 129 129 } 130 130 if(found!=-1) analysis_counter=found; 131 else _error 2_("Could not find alias for analysis_type " << EnumToStringx(configuration_type) << " in list of FemModel analyses");131 else _error_("Could not find alias for analysis_type " << EnumToStringx(configuration_type) << " in list of FemModel analyses"); 132 132 133 133 /*Now, plug analysis_counter and analysis_type inside the parameters: */ -
issm/branches/trunk-jpl-damage/src/c/classes/Hook.cpp
r12832 r13101 185 185 this->objects[i]=(Object*)dataset->GetObjectById(this->offsets+i,this->ids[i]); //remember the offset for later on. 186 186 /*check the id is correct!: */ 187 if (this->objects[i]->Id()!=this->ids[i]) _error 2_("wrong id: " << this->objects[i]->Id() << " vs " << this->ids[i] << " in resolved pointer!");187 if (this->objects[i]->Id()!=this->ids[i]) _error_("wrong id: " << this->objects[i]->Id() << " vs " << this->ids[i] << " in resolved pointer!"); 188 188 } 189 189 } … … 194 194 195 195 /*first, check that we only have one T object in our object list: */ 196 if (this->num!=1) _error 2_("trying to delivery a single hook object when hook holds " << this->num << " objects" << "\n");196 if (this->num!=1) _error_("trying to delivery a single hook object when hook holds " << this->num << " objects" << "\n"); 197 197 198 198 /*check NULL: */ 199 if (this->objects==NULL) _error 2_("hook is not pointing to any object, objects pointer is NULL");199 if (this->objects==NULL) _error_("hook is not pointing to any object, objects pointer is NULL"); 200 200 201 201 return *objects; … … 246 246 247 247 /*Else, check that we are requesting a half of num*/ 248 if (numindices>this->num) _error 2_("Cannot spawn hook with " << numindices << " objects from a Hook of " << this->num << " objects");248 if (numindices>this->num) _error_("Cannot spawn hook with " << numindices << " objects from a Hook of " << this->num << " objects"); 249 249 250 250 /*go pickup the correct objects, ids and offsets :*/ 251 251 output->num=numindices; 252 if(output->num<1) _error 2_("Trying to spawn an empty ElementProperties!");252 if(output->num<1) _error_("Trying to spawn an empty ElementProperties!"); 253 253 254 254 output->objects=xNew<Object*>(output->num); -
issm/branches/trunk-jpl-damage/src/c/classes/IoModel.cpp
r12832 r13101 110 110 /*Get first Enum*/ 111 111 if(fread(&record_enum,sizeof(int),1,this->fid)==0){ 112 _error 2_("Marshalled file is empty");112 _error_("Marshalled file is empty"); 113 113 } 114 114 else{ … … 128 128 _printLine_("========================================================================="); 129 129 _printLine_(""); 130 _error 2_("Enums not consistent (See error message above)");130 _error_("Enums not consistent (See error message above)"); 131 131 } 132 132 } … … 177 177 /*Find constant*/ 178 178 Param* param=(Param*)this->constants->FindParamObject(constant_enum); 179 if(!param) _error 2_("Constant " << EnumToStringx(constant_enum) << " not found in iomodel");179 if(!param) _error_("Constant " << EnumToStringx(constant_enum) << " not found in iomodel"); 180 180 181 181 return (Param*)param->copy(); … … 266 266 case 1: 267 267 /*Read the boolean and broadcast it to other cpus:*/ 268 if(fread(&booleanint,sizeof(int),1,this->fid)!=1) _error 2_("could not read boolean ");268 if(fread(&booleanint,sizeof(int),1,this->fid)!=1) _error_("could not read boolean "); 269 269 #ifdef _HAVE_MPI_ 270 270 MPI_Bcast(&booleanint,1,MPI_INT,0,MPI_COMM_WORLD); … … 277 277 case 2: 278 278 /*Read the integer and broadcast it to other cpus:*/ 279 if(fread(&integer,sizeof(int),1,this->fid)!=1) _error 2_("could not read integer ");279 if(fread(&integer,sizeof(int),1,this->fid)!=1) _error_("could not read integer "); 280 280 #ifdef _HAVE_MPI_ 281 281 MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD); … … 288 288 case 3: 289 289 /*Read the scalar and broadcast it to other cpus:*/ 290 if(fread(&scalar,sizeof(IssmPDouble),1,this->fid)!=1) _error 2_("could not read scalar ");290 if(fread(&scalar,sizeof(IssmPDouble),1,this->fid)!=1) _error_("could not read scalar "); 291 291 #ifdef _HAVE_MPI_ 292 292 MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD); … … 299 299 case 4: 300 300 /*We have to read a string from disk. First read the dimensions of the string, then the string: */ 301 if(fread(&string_size,sizeof(int),1,this->fid)!=1) _error 2_("could not read length of string ");301 if(fread(&string_size,sizeof(int),1,this->fid)!=1) _error_("could not read length of string "); 302 302 #ifdef _HAVE_MPI_ 303 303 MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); … … 309 309 310 310 /*Read string, then broadcast: */ 311 if(fread(string,string_size*sizeof(char),1,this->fid)!=1)_error 2_(" could not read string ");311 if(fread(string,string_size*sizeof(char),1,this->fid)!=1)_error_(" could not read string "); 312 312 #ifdef _HAVE_MPI_ 313 313 MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); … … 360 360 361 361 default: 362 _error 2_("unknown record type:" << record_code);362 _error_("unknown record type:" << record_code); 363 363 break;; 364 364 } … … 428 428 429 429 default: 430 _error 2_("unknown record type:" << record_code);430 _error_("unknown record type:" << record_code); 431 431 break;; 432 432 } … … 453 453 fid=this->SetFilePointerToData(&code,NULL,data_enum); 454 454 455 if(code!=1)_error 2_("expecting a boolean for enum " << EnumToStringx(data_enum));455 if(code!=1)_error_("expecting a boolean for enum " << EnumToStringx(data_enum)); 456 456 457 457 /*We have to read a boolean from disk. */ 458 458 if(my_rank==0){ 459 if(fread(&booleanint,sizeof(int),1,fid)!=1) _error 2_("could not read boolean ");459 if(fread(&booleanint,sizeof(int),1,fid)!=1) _error_("could not read boolean "); 460 460 } 461 461 #ifdef _HAVE_MPI_ … … 482 482 fid=this->SetFilePointerToData(&code,NULL,data_enum); 483 483 484 if(code!=2)_error 2_("expecting an integer for enum " << EnumToStringx(data_enum));484 if(code!=2)_error_("expecting an integer for enum " << EnumToStringx(data_enum)); 485 485 486 486 /*We have to read a integer from disk. First read the dimensions of the integer, then the integer: */ 487 487 if(my_rank==0){ 488 if(fread(&integer,sizeof(int),1,fid)!=1) _error 2_("could not read integer ");488 if(fread(&integer,sizeof(int),1,fid)!=1) _error_("could not read integer "); 489 489 } 490 490 … … 512 512 fid=this->SetFilePointerToData(&code,NULL,data_enum); 513 513 514 if(code!=3)_error 2_("expecting a IssmDouble for enum " << EnumToStringx(data_enum));514 if(code!=3)_error_("expecting a IssmDouble for enum " << EnumToStringx(data_enum)); 515 515 516 516 /*We have to read a scalar from disk. First read the dimensions of the scalar, then the scalar: */ 517 517 if(my_rank==0){ 518 if(fread(&scalar,sizeof(IssmPDouble),1,fid)!=1)_error 2_("could not read scalar ");518 if(fread(&scalar,sizeof(IssmPDouble),1,fid)!=1)_error_("could not read scalar "); 519 519 } 520 520 #ifdef _HAVE_MPI_ … … 542 542 fid=this->SetFilePointerToData(&code,NULL,data_enum); 543 543 544 if(code!=4)_error 2_("expecting a string for enum " << EnumToStringx(data_enum));544 if(code!=4)_error_("expecting a string for enum " << EnumToStringx(data_enum)); 545 545 546 546 /*Now fetch: */ … … 548 548 /*We have to read a string from disk. First read the dimensions of the string, then the string: */ 549 549 if(my_rank==0){ 550 if(fread(&string_size,sizeof(int),1,fid)!=1) _error 2_("could not read length of string ");550 if(fread(&string_size,sizeof(int),1,fid)!=1) _error_("could not read length of string "); 551 551 } 552 552 … … 562 562 /*Read string on node 0, then broadcast: */ 563 563 if(my_rank==0){ 564 if(fread(string,string_size*sizeof(char),1,fid)!=1)_error 2_(" could not read string ");564 if(fread(string,string_size*sizeof(char),1,fid)!=1)_error_(" could not read string "); 565 565 } 566 566 #ifdef _HAVE_MPI_ … … 596 596 fid=this->SetFilePointerToData(&code,&vector_type,data_enum); 597 597 598 if((code!=5) && (code!=6) && (code!=7))_error 2_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum));598 if((code!=5) && (code!=6) && (code!=7))_error_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum)); 599 599 600 600 /*Now fetch: */ … … 603 603 /*numberofelements: */ 604 604 if(my_rank==0){ 605 if(fread(&M,sizeof(int),1,fid)!=1) _error 2_("could not read number of rows for matrix ");605 if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows for matrix "); 606 606 } 607 607 … … 611 611 612 612 if(my_rank==0){ 613 if(fread(&N,sizeof(int),1,fid)!=1) _error 2_("could not read number of columns for matrix ");613 if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix "); 614 614 } 615 615 #ifdef _HAVE_MPI_ … … 623 623 /*Read matrix on node 0, then broadcast: */ 624 624 if(my_rank==0){ 625 if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error 2_("could not read matrix ");625 if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix "); 626 626 } 627 627 … … 667 667 /*Set file pointer to beginning of the data: */ 668 668 fid=this->SetFilePointerToData(&code,&vector_type,data_enum); 669 if((code!=5) && (code!=6) && (code!=7))_error 2_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum));669 if((code!=5) && (code!=6) && (code!=7))_error_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum)); 670 670 671 671 /*Now fetch: */ … … 674 674 /*numberofelements: */ 675 675 if(my_rank==0){ 676 if(fread(&M,sizeof(int),1,fid)!=1) _error 2_("could not read number of rows for matrix ");676 if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows for matrix "); 677 677 } 678 678 #ifdef _HAVE_MPI_ … … 681 681 682 682 if(my_rank==0){ 683 if(fread(&N,sizeof(int),1,fid)!=1) _error 2_("could not read number of columns for matrix ");683 if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix "); 684 684 } 685 685 #ifdef _HAVE_MPI_ … … 693 693 /*Read matrix on node 0, then broadcast: */ 694 694 if(my_rank==0){ 695 if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error 2_("could not read matrix ");695 if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix "); 696 696 } 697 697 #ifdef _HAVE_MPI_ … … 729 729 fid=this->SetFilePointerToData(&code,NULL,data_enum); 730 730 731 if(code!=9)_error 2_("expecting a string array for enum " << EnumToStringx(data_enum));731 if(code!=9)_error_("expecting a string array for enum " << EnumToStringx(data_enum)); 732 732 733 733 /*We have to read a bunch of strings from disk. First read the number of strings, and allocate: */ 734 734 if(my_rank==0){ 735 if(fread(&numstrings,sizeof(int),1,fid)!=1) _error 2_("could not read length of string array");735 if(fread(&numstrings,sizeof(int),1,fid)!=1) _error_("could not read length of string array"); 736 736 } 737 737 #ifdef _HAVE_MPI_ … … 748 748 749 749 if(my_rank==0){ 750 if(fread(&string_size,sizeof(int),1,fid)!=1) _error 2_("could not read length of string ");750 if(fread(&string_size,sizeof(int),1,fid)!=1) _error_("could not read length of string "); 751 751 } 752 752 #ifdef _HAVE_MPI_ … … 759 759 /*Read string on node 0, then broadcast: */ 760 760 if(my_rank==0){ 761 if(fread(string,string_size*sizeof(char),1,fid)!=1)_error 2_(" could not read string ");761 if(fread(string,string_size*sizeof(char),1,fid)!=1)_error_(" could not read string "); 762 762 } 763 763 #ifdef _HAVE_MPI_ … … 800 800 /*Set file pointer to beginning of the data: */ 801 801 fid=this->SetFilePointerToData(&code,NULL,data_enum); 802 if(code!=8)_error 2_("expecting a IssmDouble mat array for enum " << EnumToStringx(data_enum));802 if(code!=8)_error_("expecting a IssmDouble mat array for enum " << EnumToStringx(data_enum)); 803 803 804 804 /*Now fetch: */ 805 805 if(my_rank==0){ 806 if(fread(&numrecords,sizeof(int),1,fid)!=1) _error 2_("could not read number of records in matrix array ");806 if(fread(&numrecords,sizeof(int),1,fid)!=1) _error_("could not read number of records in matrix array "); 807 807 } 808 808 #ifdef _HAVE_MPI_ … … 827 827 828 828 if(my_rank==0){ 829 if(fread(&M,sizeof(int),1,fid)!=1) _error 2_("could not read number of rows in " << i << "th matrix of matrix array");829 if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows in " << i << "th matrix of matrix array"); 830 830 } 831 831 #ifdef _HAVE_MPI_ … … 834 834 835 835 if(my_rank==0){ 836 if(fread(&N,sizeof(int),1,fid)!=1) _error 2_("could not read number of columns in " << i << "th matrix of matrix array");836 if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns in " << i << "th matrix of matrix array"); 837 837 } 838 838 #ifdef _HAVE_MPI_ … … 846 846 /*Read matrix on node 0, then broadcast: */ 847 847 if(my_rank==0){ 848 if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error 2_("could not read matrix ");848 if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix "); 849 849 } 850 850 … … 912 912 } 913 913 default: 914 _error 2_("Option of format " << code << " not supported yet");914 _error_("Option of format " << code << " not supported yet"); 915 915 } 916 916 … … 941 941 _assert_(dataenum<MaximumNumberOfEnums); 942 942 if(this->data[dataenum]){ 943 _error 2_("Info: trying to fetch " << EnumToStringx(dataenum) << " but previous pointer has not been freed (DeleteData has not been called)");943 _error_("Info: trying to fetch " << EnumToStringx(dataenum) << " but previous pointer has not been freed (DeleteData has not been called)"); 944 944 } 945 945 #endif … … 1141 1141 break; /*}}}*/ 1142 1142 default: /*{{{*/ 1143 _error 2_("data code " << code << " not supported yet!");1143 _error_("data code " << code << " not supported yet!"); 1144 1144 break; 1145 1145 /*}}}*/ … … 1232 1232 #ifdef _HAVE_MPI_ 1233 1233 MPI_Bcast(&found,1,MPI_INT,0,MPI_COMM_WORLD); 1234 if(!found)_error 2_("could not find data with name" << " " << EnumToStringx(data_enum) << " ");1234 if(!found)_error_("could not find data with name" << " " << EnumToStringx(data_enum) << " "); 1235 1235 #endif 1236 1236 -
issm/branches/trunk-jpl-damage/src/c/classes/bamg/BamgOpts.cpp
r12821 r13101 60 60 int i; 61 61 62 if (this->anisomax<1) _error 2_("'anisomax' option should be >=1");63 if (this->coeff==0) _error 2_("'coeff' should be positive");64 if (this->errg<0) _error 2_("'errg' option should be >0");65 if (this->gradation<1) _error 2_("'gradation' option should be >=1");66 if (this->Hessiantype!=0 && this->Hessiantype!=1) _error 2_("'Hessiantype' supported options are 0 and 1");67 if (this->maxnbv<3) _error 2_("'maxnbv' option should be >3");68 if (this->maxsubdiv<=1) _error 2_("'maxsubdiv' should be >1");69 if (this->Metrictype!=0 && this->Metrictype!=1 && this->Metrictype!=2) _error 2_("'Metrictype' supported options are 0, 1 and 2");70 if (this->nbjacobi<=0) _error 2_("'nbjacobi' option should be >0");71 if (this->nbsmooth<=0) _error 2_("'nbsmooth' option should be >0");62 if (this->anisomax<1) _error_("'anisomax' option should be >=1"); 63 if (this->coeff==0) _error_("'coeff' should be positive"); 64 if (this->errg<0) _error_("'errg' option should be >0"); 65 if (this->gradation<1) _error_("'gradation' option should be >=1"); 66 if (this->Hessiantype!=0 && this->Hessiantype!=1) _error_("'Hessiantype' supported options are 0 and 1"); 67 if (this->maxnbv<3) _error_("'maxnbv' option should be >3"); 68 if (this->maxsubdiv<=1) _error_("'maxsubdiv' should be >1"); 69 if (this->Metrictype!=0 && this->Metrictype!=1 && this->Metrictype!=2) _error_("'Metrictype' supported options are 0, 1 and 2"); 70 if (this->nbjacobi<=0) _error_("'nbjacobi' option should be >0"); 71 if (this->nbsmooth<=0) _error_("'nbsmooth' option should be >0"); 72 72 73 if (this->Crack!=0 && this->Crack!=1) _error 2_("'Crack' supported options are 0 and 1");74 if (this->KeepVertices!=0 && this->KeepVertices!=1) _error 2_("'KeepVertices' supported options are 0 and 1");75 if (this->geometricalmetric!=0 && this->geometricalmetric!=1) _error 2_("'geometricalmetric' supported options are 0 and 1");73 if (this->Crack!=0 && this->Crack!=1) _error_("'Crack' supported options are 0 and 1"); 74 if (this->KeepVertices!=0 && this->KeepVertices!=1) _error_("'KeepVertices' supported options are 0 and 1"); 75 if (this->geometricalmetric!=0 && this->geometricalmetric!=1) _error_("'geometricalmetric' supported options are 0 and 1"); 76 76 77 if (this->hmin<=0) _error 2_("'hmin' option should be >0");78 if (this->hmax<=0 || this->hmax<this->hmin) _error 2_("'hmax' option should be between 0 and hmin=" << this->hmin);79 if (this->hminVertices && this->hminVerticesSize[1]!=1) _error 2_("'hminVertices' should be a column");80 if (this->hmaxVertices && this->hmaxVerticesSize[1]!=1) _error 2_("'hmaxVertices' should be a column");81 if (this->hVertices && this->hVerticesSize[1]!=1) _error 2_("'hVertices' should be a column");82 if (this->metric && (this->metricSize[1]!=1 && this->metricSize[1]!=3)) _error 2_("'metric' should have either 1 (iso) or 3 (aniso) columns.");77 if (this->hmin<=0) _error_("'hmin' option should be >0"); 78 if (this->hmax<=0 || this->hmax<this->hmin) _error_("'hmax' option should be between 0 and hmin=" << this->hmin); 79 if (this->hminVertices && this->hminVerticesSize[1]!=1) _error_("'hminVertices' should be a column"); 80 if (this->hmaxVertices && this->hmaxVerticesSize[1]!=1) _error_("'hmaxVertices' should be a column"); 81 if (this->hVertices && this->hVerticesSize[1]!=1) _error_("'hVertices' should be a column"); 82 if (this->metric && (this->metricSize[1]!=1 && this->metricSize[1]!=3)) _error_("'metric' should have either 1 (iso) or 3 (aniso) columns."); 83 83 if (this->field){ 84 if (this->errSize[0]!=1 || this->errSize[1]!=this->fieldSize[1]) _error 2_("'err' should be of size " << 1 << " x " << this->fieldSize[1]);85 for (i=0;i<this->fieldSize[1];i++) {if (this->err[i]<=0) _error 2_("'err' option should be >0");};84 if (this->errSize[0]!=1 || this->errSize[1]!=this->fieldSize[1]) _error_("'err' should be of size " << 1 << " x " << this->fieldSize[1]); 85 for (i=0;i<this->fieldSize[1];i++) {if (this->err[i]<=0) _error_("'err' option should be >0");}; 86 86 } 87 87 -
issm/branches/trunk-jpl-damage/src/c/classes/bamg/BamgQuadtree.h
r12835 r13101 31 31 }; 32 32 /*Object functions*/ 33 void Echo() {_error 2_("not implemented yet"); };34 void DeepEcho() {_error 2_("not implemented yet"); };35 int Id() {_error 2_("not implemented yet"); };36 int MyRank() {_error 2_("not implemented yet"); };37 int ObjectEnum() {_error 2_("not implemented yet"); };38 Object *copy() {_error 2_("not implemented yet"); };33 void Echo() {_error_("not implemented yet"); }; 34 void DeepEcho() {_error_("not implemented yet"); }; 35 int Id() {_error_("not implemented yet"); }; 36 int MyRank() {_error_("not implemented yet"); }; 37 int ObjectEnum() {_error_("not implemented yet"); }; 38 Object *copy() {_error_("not implemented yet"); }; 39 39 }; 40 40 -
issm/branches/trunk-jpl-damage/src/c/classes/bamg/BamgVertex.cpp
r12821 r13101 76 76 } 77 77 else{ 78 _error 2_("Metrictype " << Metrictype << " not supported yet (use 0,1 or 2(default))");78 _error_("Metrictype " << Metrictype << " not supported yet (use 0,1 or 2(default))"); 79 79 } 80 80 … … 146 146 j = NextEdge[jc]; 147 147 if (k>=2000){ 148 _error 2_("k>=2000 (Maximum number of iterations reached)");148 _error_("k>=2000 (Maximum number of iterations reached)"); 149 149 } 150 150 } while ( tbegin != tria); … … 213 213 j = NextEdge[jc]; 214 214 if (k>=2000){ 215 _error 2_("k>=2000");215 _error_("k>=2000"); 216 216 } 217 217 }while ( tbegin != tria); -
issm/branches/trunk-jpl-damage/src/c/classes/bamg/Edge.cpp
r12821 r13101 45 45 46 46 /*some shecks*/ 47 if (!(adj[0]==&e || adj[1]==&e)){ _error 2_("Intersection bug"); }47 if (!(adj[0]==&e || adj[1]==&e)){ _error_("Intersection bug"); } 48 48 _assert_(adj[0]==&e || adj[1]==&e); 49 49 -
issm/branches/trunk-jpl-damage/src/c/classes/bamg/Geometry.cpp
r12821 r13101 76 76 77 77 //some checks 78 if (bamggeom->Vertices==NULL) _error 2_("the domain provided does not contain any vertex");79 if (bamggeom->Edges==NULL) _error 2_("the domain provided does not contain any edge");78 if (bamggeom->Vertices==NULL) _error_("the domain provided does not contain any vertex"); 79 if (bamggeom->Edges==NULL) _error_("the domain provided does not contain any edge"); 80 80 81 81 //Vertices 82 82 if (bamggeom->Vertices){ 83 83 if(verbose>5) _printLine_(" processing Vertices"); 84 if (bamggeom->VerticesSize[1]!=3) _error 2_("Vertices should have 3 columns");84 if (bamggeom->VerticesSize[1]!=3) _error_("Vertices should have 3 columns"); 85 85 vertices = new GeomVertex[nbv]; 86 86 for (i=0;i<nbv;i++) { … … 115 115 */ 116 116 coefIcoor=(MaxICoor)/(Max(pmax.x-pmin.x,pmax.y-pmin.y)); 117 if(coefIcoor<=0) _error 2_("coefIcoor should be positive");117 if(coefIcoor<=0) _error_("coefIcoor should be positive"); 118 118 } 119 119 else{ 120 _error 2_("No BamgVertex provided");120 _error_("No BamgVertex provided"); 121 121 } 122 122 … … 127 127 128 128 if(verbose>5) _printLine_(" processing Edges"); 129 if (bamggeom->EdgesSize[1]!=3) _error 2_("Edges should have 3 columns");129 if (bamggeom->EdgesSize[1]!=3) _error_("Edges should have 3 columns"); 130 130 edges = new GeomEdge[nbe]; 131 131 … … 176 176 } 177 177 else{ 178 _error 2_("No edges provided");178 _error_("No edges provided"); 179 179 } 180 180 … … 206 206 if (bamggeom->TangentAtEdges){ 207 207 if(verbose>5) _printString_(" processing TangentAtEdges"); 208 if (bamggeom->TangentAtEdgesSize[1]!=4) _error 2_("TangentAtEdges should have 4 columns");208 if (bamggeom->TangentAtEdgesSize[1]!=4) _error_("TangentAtEdges should have 4 columns"); 209 209 int n,i,j,k; 210 210 R2 tg; … … 216 216 tg.x=bamggeom->TangentAtEdges[k*4+2]; 217 217 tg.y=bamggeom->TangentAtEdges[k*4+3]; 218 if (i<0 || i>=nbe) _error 2_("TangentAtEdges first index exceeds matrix dimension");219 if (j!=0 && j!=1) _error 2_("TangentAtEdges second index should be 1 or 2 only");218 if (i<0 || i>=nbe) _error_("TangentAtEdges first index exceeds matrix dimension"); 219 if (j!=0 && j!=1) _error_("TangentAtEdges second index should be 1 or 2 only"); 220 220 edges[i].tg[j] = tg; 221 221 } … … 225 225 if(bamggeom->Corners){ 226 226 if(verbose>5) _printString_(" processing Corners"); 227 if (bamggeom->CornersSize[1]!=1) _error 2_("Corners should have 1 column");227 if (bamggeom->CornersSize[1]!=1) _error_("Corners should have 1 column"); 228 228 n=bamggeom->CornersSize[0]; 229 229 for (i=0;i<n;i++) { 230 230 j=(int)bamggeom->Corners[i]-1; //for C indexing 231 if (j>nbv-1 || j<0) _error 2_("Bad corner definition: should in [0 " << nbv << "]");231 if (j>nbv-1 || j<0) _error_("Bad corner definition: should in [0 " << nbv << "]"); 232 232 /*Required => at the same time SetRequired and SetCorner*/ 233 233 vertices[j].SetCorner(); … … 239 239 if(bamggeom->RequiredVertices){ 240 240 if(verbose>5) _printLine_(" processing RequiredVertices"); 241 if (bamggeom->RequiredVerticesSize[1]!=1) _error 2_("RequiredVertices should have 1 column");241 if (bamggeom->RequiredVerticesSize[1]!=1) _error_("RequiredVertices should have 1 column"); 242 242 n=bamggeom->RequiredVerticesSize[0]; 243 243 for (i=0;i<n;i++) { 244 244 j=(int)bamggeom->RequiredVertices[i]-1; //for C indexing 245 if (j>nbv-1 || j<0) _error 2_("Bad RequiredVerticess definition: should in [0 " << nbv << "]");245 if (j>nbv-1 || j<0) _error_("Bad RequiredVerticess definition: should in [0 " << nbv << "]"); 246 246 vertices[j].SetRequired(); 247 247 } … … 251 251 if(bamggeom->RequiredEdges){ 252 252 if(verbose>5) _printLine_(" processing RequiredEdges"); 253 if (bamggeom->RequiredEdgesSize[1]!=1) _error 2_("RequiredEdges should have 1 column");253 if (bamggeom->RequiredEdgesSize[1]!=1) _error_("RequiredEdges should have 1 column"); 254 254 n=bamggeom->RequiredEdgesSize[0]; 255 255 for (i=0;i<n;i++) { 256 256 j=(int)bamggeom->RequiredEdges[i]-1; //for C indexing 257 if (j>nbe-1 || j<0) _error 2_("Bad RequiredEdges definition: should in [0 " << nbe << "]");257 if (j>nbe-1 || j<0) _error_("Bad RequiredEdges definition: should in [0 " << nbe << "]"); 258 258 edges[j].SetRequired(); 259 259 } … … 263 263 if(bamggeom->SubDomains){ 264 264 if(verbose>5) _printLine_(" processing SubDomains"); 265 if (bamggeom->SubDomainsSize[1]!=4) _error 2_("SubDomains should have 4 columns");265 if (bamggeom->SubDomainsSize[1]!=4) _error_("SubDomains should have 4 columns"); 266 266 nbsubdomains=bamggeom->SubDomainsSize[0]; 267 267 subdomains = new GeomSubDomain[nbsubdomains]; … … 271 271 i2=(int)bamggeom->SubDomains[i*4+2]; 272 272 i3=(int)bamggeom->SubDomains[i*4+3]; 273 if (i0!=2) _error 2_("Bad Subdomain definition: first number should be 2 (for Edges)");274 if (i1>nbe || i1<=0) _error 2_("Bad Subdomain definition: second number should in [1 " << nbe << "] (edge number)");273 if (i0!=2) _error_("Bad Subdomain definition: first number should be 2 (for Edges)"); 274 if (i1>nbe || i1<=0) _error_("Bad Subdomain definition: second number should in [1 " << nbe << "] (edge number)"); 275 275 subdomains[i].edge=edges + (i1-1); 276 276 subdomains[i].direction = (int) i2; … … 532 532 delete [] head_v; 533 533 delete [] eangle; 534 _error 2_("two points of the geometry are very closed to each other (see reference numbers above)");534 _error_("two points of the geometry are very closed to each other (see reference numbers above)"); 535 535 } 536 536 … … 610 610 delete [] head_v; 611 611 delete [] eangle; 612 _error 2_("Length of edge " << i << " is 0");612 _error_("Length of edge " << i << " is 0"); 613 613 } 614 614 //compute angle in [-Pi Pi] … … 704 704 long i1 = n1/2 ,j1=n1%2; 705 705 706 if( edges[i1].v[j1] != edges[i].v[j]) _error 2_("Problem while processing edges: check the edge list");706 if( edges[i1].v[j1] != edges[i].v[j]) _error_("Problem while processing edges: check the edge list"); 707 707 708 708 edges[i1].Adj[j1] = edges + i; … … 831 831 GeomEdge* on=e.GeomEdgeHook; 832 832 if (!on){ 833 _error 2_("ProjectOnCurve error message: edge provided should be on geometry");833 _error_("ProjectOnCurve error message: edge provided should be on geometry"); 834 834 } 835 835 if (!e[0].GeomEdgeHook || !e[1].GeomEdgeHook){ 836 _error 2_("ProjectOnCurve error message: at least one of the vertex of the edge provided is not on geometry");836 _error_("ProjectOnCurve error message: at least one of the vertex of the edge provided is not on geometry"); 837 837 } 838 838 … … 875 875 _printLine_(" 2) code bug : be sure that we call Mesh::SetVertexFieldOn() before"); 876 876 _printLine_("To solve the problem do a coarsening of the geometrical mesh or change the constant value of mxe (dangerous)"); 877 _error 2_("see above");877 _error_("see above"); 878 878 } 879 879 NbTry++; … … 895 895 _printLine_(" 2) code bug : be sure that we call Mesh::SetVertexFieldOn() before"); 896 896 _printLine_("To solve the problem do a coarsening of the geometrical mesh or change the constant value of mxe (dangerous)"); 897 _error 2_("see above");897 _error_("see above"); 898 898 } 899 899 GeomEdge* tmpge = eg1; -
issm/branches/trunk-jpl-damage/src/c/classes/bamg/ListofIntersectionTriangles.cpp
r12821 r13101 38 38 // check Size 39 39 if (Size<=0){ 40 _error 2_("Size<=0");40 _error_("Size<=0"); 41 41 } 42 42 … … 268 268 k=(*t)(0) ? (( (*t)(1) ? ( (*t)(2) ? -1 : 2) : 1 )) : 0; 269 269 if (k<0){ 270 _error 2_("k<0");270 _error_("k<0"); 271 271 } 272 272 ocut = OppositeEdge[k]; … … 312 312 double dij = detj-deti; 313 313 if (i+j+k != 0 + 1 +2){ 314 _error 2_("i+j+k != 0 + 1 +2");314 _error_("i+j+k != 0 + 1 +2"); 315 315 } 316 316 ba[j] = detj/dij; … … 384 384 } 385 385 else { 386 _error 2_("Bug Split Edge");386 _error_("Bug Split Edge"); 387 387 } 388 388 } -
issm/branches/trunk-jpl-damage/src/c/classes/bamg/ListofIntersectionTriangles.h
r12821 r13101 34 34 double c01=lEnd-lBegin, c0=(lEnd-s)/c01, c1=(s-lBegin)/c01; 35 35 if (lBegin>s || s>lEnd){ 36 _error 2_("lBegin>s || s>lEnd");36 _error_("lBegin>s || s>lEnd"); 37 37 } 38 38 return e->F(sBegin*c0+sEnd*c1); -
issm/branches/trunk-jpl-damage/src/c/classes/bamg/Mesh.cpp
r12946 r13101 117 117 delete [] kk; 118 118 delete [] refv; 119 _error 2_("imaxnbv != nbv");119 _error_("imaxnbv != nbv"); 120 120 } 121 121 for (i=0;i<Tho.nbt;i++) … … 128 128 if (i0<0 || i1<0 || i2<0){ 129 129 delete [] refv; 130 _error 2_("i0<0 || i1<0 || i2< 0");130 _error_("i0<0 || i1<0 || i2< 0"); 131 131 } 132 132 if (i0>=Tho.nbv || i1>=Tho.nbv || i2>=Tho.nbv){ 133 _error 2_("i0>=Tho.nbv || i1>=Tho.nbv || i2>=Tho.nbv");133 _error_("i0>=Tho.nbv || i1>=Tho.nbv || i2>=Tho.nbv"); 134 134 } 135 135 triangles[nbt] = Triangle(this,kk[i0],kk[i1],kk[i2]); … … 138 138 } 139 139 if (kt!=nbt){ 140 _error 2_("kt!=nbt");140 _error_("kt!=nbt"); 141 141 } 142 142 if (nbt==0 && nbv==0) { 143 _error 2_("All triangles have been removed");143 _error_("All triangles have been removed"); 144 144 } 145 145 delete [] kk; … … 153 153 154 154 if (!nbsubdomains){ 155 _error 2_("nbsubdomains==0");155 _error_("nbsubdomains==0"); 156 156 } 157 157 if (!subdomains[0].head || !subdomains[0].head->link){ 158 _error 2_("!subdomains[0].head || !subdomains[0].head->link");158 _error_("!subdomains[0].head || !subdomains[0].head->link"); 159 159 } 160 160 … … 323 323 } 324 324 } 325 if(isorphan) _error 2_("Orphan found in mesh, see ids above");325 if(isorphan) _error_("Orphan found in mesh, see ids above"); 326 326 327 327 /*Clean up*/ … … 362 362 } 363 363 else{ 364 if(verbose>5) _error 2_("no Vertices found in the initial mesh");364 if(verbose>5) _error_("no Vertices found in the initial mesh"); 365 365 } 366 366 … … 380 380 } 381 381 else{ 382 if(verbose>5) _error 2_("no Triangles found in the initial mesh");382 if(verbose>5) _error_("no Triangles found in the initial mesh"); 383 383 } 384 384 … … 506 506 //Check value 507 507 if(!(i>=0 && j>=0 && i<nbe && j<Gh.nbe)) { 508 _error 2_("ReadMesh error: EdgesOnGeomEdge edge provided (line " << i1+1 << ": [" << i+1 << " " << j+1 << "]) is incorrect (must be positive, [0<i<nbe=" << nbe << " 0<j<Gh.nbe=" << Gh.nbe << "]");508 _error_("ReadMesh error: EdgesOnGeomEdge edge provided (line " << i1+1 << ": [" << i+1 << " " << j+1 << "]) is incorrect (must be positive, [0<i<nbe=" << nbe << " 0<j<Gh.nbe=" << Gh.nbe << "]"); 509 509 } 510 510 edges[i].GeomEdgeHook=Gh.edges+j; … … 522 522 head=(int)bamgmesh->SubDomains[i*3+1]-1;//C indexing 523 523 direction=(int)bamgmesh->SubDomains[i*3+2]; 524 if (i3!=23) _error 2_("Bad Subdomain definition: first number should be 3");525 if (head<0 || head>=nbt) _error 2_("Bad Subdomain definition: head should in [1 " << nbt << "] (triangle number)");524 if (i3!=23) _error_("Bad Subdomain definition: first number should be 3"); 525 if (head<0 || head>=nbt) _error_("Bad Subdomain definition: head should in [1 " << nbt << "] (triangle number)"); 526 526 subdomains[i].head = triangles+head; 527 527 } … … 567 567 for (j=0;j<3;j++){ 568 568 int v=GetId(triangles[i][j]); //jth vertex of the ith triangle 569 if (k>3*nbt-1 || k<0) _error 2_("k = " << k << ", nbt = " << nbt);569 if (k>3*nbt-1 || k<0) _error_("k = " << k << ", nbt = " << nbt); 570 570 next_1[k]=head_1[v]; 571 if (v>nbv-1 || v<0) _error 2_("v = " << v << ", nbv = " << nbv);571 if (v>nbv-1 || v<0) _error_("v = " << v << ", nbv = " << nbv); 572 572 head_1[v]=k++; 573 573 connectivitysize_1[v]+=1; … … 707 707 } 708 708 if (!stop){ 709 _error 2_("Element holding segment [" << i1+1 << " " << i2+1 << "] not found...");709 _error_("Element holding segment [" << i1+1 << " " << i2+1 << "] not found..."); 710 710 } 711 711 } … … 805 805 const VertexOnGeom &v=VerticesOnGeomEdge[i]; 806 806 if (!v.OnGeomEdge()){ 807 _error 2_("A vertices supposed to be OnGeomEdge is actually not");807 _error_("A vertices supposed to be OnGeomEdge is actually not"); 808 808 } 809 809 bamgmesh->VerticesOnGeomEdge[i*3+0]=GetId((BamgVertex*)v)+1; //back to Matlab indexing … … 888 888 for (j=0;j<2;j++){ 889 889 int v=(int)bamgmesh->IssmEdges[i*i2+j]-1; //back to C indexing 890 if (k>2*i1-1 || k<0) _error 2_("Index exceed matrix dimensions (k=" << k << " not in [0 " << 2*i1-1 << "]");890 if (k>2*i1-1 || k<0) _error_("Index exceed matrix dimensions (k=" << k << " not in [0 " << 2*i1-1 << "]"); 891 891 next_2[k]=head_2[v]; 892 if (v>nbv-1 || v<0) _error 2_("Index exceed matrix dimensions (v=" << v << " not in [0 " << nbv-1 << "])");892 if (v>nbv-1 || v<0) _error_("Index exceed matrix dimensions (v=" << v << " not in [0 " << nbv-1 << "])"); 893 893 head_2[v]=k++; 894 894 connectivitysize_2[v]+=1; … … 1061 1061 //check that hmax is positive 1062 1062 if (hmax<=0){ 1063 _error 2_("hmax<=0");1063 _error_("hmax<=0"); 1064 1064 } 1065 1065 … … 1090 1090 1091 1091 if (ht<=0 || hn<=0){ 1092 _error 2_("ht<=0 || hn<=0");1092 _error_("ht<=0 || hn<=0"); 1093 1093 } 1094 1094 EigenMetric Vp(1/(ht*ht),1/(hn*hn),tg); … … 1115 1115 } 1116 1116 else{ 1117 _error 2_("Hessiantype " << Hessiantype << " not supported yet (1->use Green formula, 0-> double P2 projection)");1117 _error_("Hessiantype " << Hessiantype << " not supported yet (1->use Green formula, 0-> double P2 projection)"); 1118 1118 } 1119 1119 } … … 1159 1159 //some checks 1160 1160 if (( infvertexindex <0 ) && (detOld <0) || ( infvertexindex >=0 ) && (detOld >0) ){ 1161 _error 2_("inconsistent configuration (Contact ISSM developers)");1161 _error_("inconsistent configuration (Contact ISSM developers)"); 1162 1162 } 1163 1163 … … 1201 1201 } 1202 1202 else{ 1203 _error 2_("Cannot add a vertex more than once. Check duplicates");1203 _error_("Cannot add a vertex more than once. Check duplicates"); 1204 1204 } 1205 1205 } … … 1214 1214 tt[2]= &triangles[nbt++]; 1215 1215 1216 if (nbt>maxnbt) _error 2_("Not enough triangles");1216 if (nbt>maxnbt) _error_("Not enough triangles"); 1217 1217 1218 1218 *tt[1]=*tt[2]=*t; … … 1251 1251 1252 1252 if (!rswap) { 1253 _error 2_("swap the point s is on a edge");1253 _error_("swap the point s is on a edge"); 1254 1254 } 1255 1255 } … … 1318 1318 //check that the mesh is not empty 1319 1319 if (nbt<=0 || nbv <=0 ) { 1320 _error 2_("nbt or nbv is negative (Mesh empty?)");1320 _error_("nbt or nbv is negative (Mesh empty?)"); 1321 1321 } 1322 1322 … … 1340 1340 if (nbe != edge4->nb()){ 1341 1341 delete [] st; 1342 _error 2_("Some Double edge in the mesh, the number is " << nbe << ", nbe4=" << edge4->nb());1342 _error_("Some Double edge in the mesh, the number is " << nbe << ", nbe4=" << edge4->nb()); 1343 1343 } 1344 1344 //keep nbe in nbeold … … 1360 1360 //check that it is not an edge on boundary (should not already exist) 1361 1361 if (triangles[i].TriangleAdj(j) || triangles[st[k]/3].TriangleAdj((int) (st[k]%3))){ 1362 _error 2_("problem in Geometry reconstruction: an edge on boundary is duplicated (double element?)");1362 _error_("problem in Geometry reconstruction: an edge on boundary is duplicated (double element?)"); 1363 1363 } 1364 1364 //OK, the element is not on boundary, is belongs to 2 triangles -> build Adjacent triangles list … … 1378 1378 _printLine_("Edge " << (-st[k]+2)%3 << " of triangle " << (-st[k]+2)/3); 1379 1379 _printLine_("Edge " << triangles[(-st[k]+2)/3].NuEdgeTriangleAdj((int)((-st[k]+2)%3)) << " of triangle " << GetId(triangles[(-st[k]+2)/3].TriangleAdj((int)((-st[k]+2)%3)))); 1380 _error 2_("An edge belongs to more than 2 triangles");1380 _error_("An edge belongs to more than 2 triangles"); 1381 1381 } 1382 1382 } … … 1460 1460 //check that we have been through all edges 1461 1461 if (k!=nbe){ 1462 _error 2_("problem in edge construction process: k!=nbe (should not happen)");1462 _error_("problem in edge construction process: k!=nbe (should not happen)"); 1463 1463 } 1464 1464 //delete edgessave … … 1505 1505 //check that we have the correct vertex 1506 1506 if (v!=edges[i0 ].v[j0]){ 1507 _error 2_("v!=edges[i0 ].v[j0]: this should not happen as the vertex belongs to this edge");1507 _error_("v!=edges[i0 ].v[j0]: this should not happen as the vertex belongs to this edge"); 1508 1508 } 1509 1509 … … 1522 1522 //check that nbsubdomains is empty 1523 1523 if (nbsubdomains){ 1524 _error 2_("nbsubdomains should be 0");1524 _error_("nbsubdomains should be 0"); 1525 1525 } 1526 1526 nbsubdomains=0; … … 1591 1591 if (k!= nbsubdomains){ 1592 1592 delete [] colorT; 1593 _error 2_("k!= nbsubdomains");1593 _error_("k!= nbsubdomains"); 1594 1594 } 1595 1595 //delete colorT and st … … 1652 1652 if (Gh.coefIcoor<=0){ 1653 1653 delete [] colorV; 1654 _error 2_("Gh.coefIcoor<=0 in infered Geometry (this should not happen)");1654 _error_("Gh.coefIcoor<=0 in infered Geometry (this should not happen)"); 1655 1655 } 1656 1656 … … 1705 1705 delete [] len; 1706 1706 delete [] colorV; 1707 _error 2_("problem in Edge4 construction: k != i");1707 _error_("problem in Edge4 construction: k != i"); 1708 1708 } 1709 1709 } … … 1734 1734 } 1735 1735 else 1736 _error 2_("%i should be >=0");1736 _error_("%i should be >=0"); 1737 1737 } 1738 1738 … … 1768 1768 1769 1769 /*Check size*/ 1770 if (bamgopts->fieldSize[0] != nbv) _error 2_("'field' should have " << nbv << " rows");1770 if (bamgopts->fieldSize[0] != nbv) _error_("'field' should have " << nbv << " rows"); 1771 1771 1772 1772 //initialization of some variables … … 1973 1973 1974 1974 /*Check size*/ 1975 if (bamgopts->fieldSize[0] != nbv) _error 2_("'field' should have " << nbv << " rows");1975 if (bamgopts->fieldSize[0] != nbv) _error_("'field' should have " << nbv << " rows"); 1976 1976 1977 1977 //initialization of some variables … … 2298 2298 if (splitvertex[i1]==3 || splitvertex[i2]==3){ 2299 2299 delete [] splitvertex; 2300 _error 2_("Crossing rifts not supported yet");2300 _error_("Crossing rifts not supported yet"); 2301 2301 } 2302 2302 } … … 2376 2376 //_printLine_(element_renu[GetId(ta.t)] << " -> " << GetId((*ta.t)[0])+1 << " " << GetId((*ta.t)[1])+1 << " " << GetId((*ta.t)[2])+1 << ", edge [" << i1 << "->" << j1 << " " << i2 << "->" << j2 << "]"); 2377 2377 ta = Next(ta).Adj(); 2378 if (count++>50) _error 2_("Maximum number of iteration exceeded");2378 if (count++>50) _error_("Maximum number of iteration exceeded"); 2379 2379 }while ((tbegin != ta)); 2380 2380 } … … 2383 2383 for(i=0;i<NbCrackedEdges;i++){ 2384 2384 if (Edgeflags[i]!=2){ 2385 _error 2_("A problem occured: at least one crack edge (number " << i+1 << ") does not belong to 2 elements");2385 _error_("A problem occured: at least one crack edge (number " << i+1 << ") does not belong to 2 elements"); 2386 2386 } 2387 2387 } … … 2433 2433 } 2434 2434 if (k!=0) { 2435 _error 2_("there is " << k << " triangles of mes = 0");2435 _error_("there is " << k << " triangles of mes = 0"); 2436 2436 } 2437 2437 … … 2447 2447 if (nbswp) nbfe++; 2448 2448 if ( nbswp < 0 && k < 5){ 2449 _error 2_("Missing Edge " << i << ", v0=" << GetId(edges[i][0]) << ",v1=" << GetId(edges[i][1]));2449 _error_("Missing Edge " << i << ", v0=" << GetId(edges[i][0]) << ",v1=" << GetId(edges[i][1])); 2450 2450 } 2451 2451 } 2452 2452 2453 2453 if (k!=0) { 2454 _error 2_("There are " << k << " lost edges, the boundary might be crossing");2454 _error_("There are " << k << " lost edges, the boundary might be crossing"); 2455 2455 } 2456 2456 for (int j=0;j<nbv;j++){ … … 2534 2534 if (nbt == nbtout || !NbSubDomTot) { 2535 2535 delete [] HeapArete; 2536 _error 2_("The boundary is not close: all triangles are outside");2536 _error_("The boundary is not close: all triangles are outside"); 2537 2537 } 2538 2538 … … 2572 2572 if (k!=nbsubdomains){ 2573 2573 delete [] mark; 2574 _error 2_("k!=nbsubdomains");2574 _error_("k!=nbsubdomains"); 2575 2575 } 2576 2576 if(OutSide) … … 2662 2662 subdomains[i].head=t=ta; 2663 2663 if(t<triangles || t >= triangles+nbt || t->det < 0 || t->link == 0) { 2664 _error 2_("bad definition of SubSomain " << i);2664 _error_("bad definition of SubSomain " << i); 2665 2665 } 2666 2666 long it = GetId(t); … … 2677 2677 kkk++; 2678 2678 if (mark[GetId(tt)]>=0){ 2679 _error 2_("mark[GetId(tt)]>=0");2679 _error_("mark[GetId(tt)]>=0"); 2680 2680 } 2681 2681 mark[GetId(tt)]=i; … … 2686 2686 ta = Previous(Adj(ta)); 2687 2687 if(t == (Triangle *) ta) { 2688 _error 2_("bad definition of SubSomain " << i);2688 _error_("bad definition of SubSomain " << i); 2689 2689 } 2690 2690 } … … 2848 2848 //if i is higher than nbv, it means that all the determinants are 0, 2849 2849 //all vertices are aligned! 2850 if (++i>=nbv) _error 2_("all the vertices are aligned");2850 if (++i>=nbv) _error_("all the vertices are aligned"); 2851 2851 } 2852 2852 // exchange i et 2 in "orderedvertices" so that … … 2984 2984 long j=vj.ReferenceNumber; 2985 2985 if (&vj!=orderedvertices[j]){ 2986 _error 2_("&vj!= orderedvertices[j]");2986 _error_("&vj!= orderedvertices[j]"); 2987 2987 } 2988 2988 if(i!=j){ … … 2994 2994 if (tcvj && !tcvj->link){ 2995 2995 tcvj->Echo(); 2996 _error 2_("problem inserting point in InsertNewPoints (tcvj=" << tcvj << " and tcvj->link=" << tcvj->link << ")");2996 _error_("problem inserting point in InsertNewPoints (tcvj=" << tcvj << " and tcvj->link=" << tcvj->link << ")"); 2997 2997 } 2998 2998 quadtree->Add(vj); … … 3026 3026 3027 3027 if (!Gh.nbe){ 3028 _error 2_("!Gh.nbe");3028 _error_("!Gh.nbe"); 3029 3029 } 3030 3030 Edge **e= new (Edge* [Gh.nbe]); … … 3059 3059 } 3060 3060 } 3061 if(kk) _error 2_("See above");3061 if(kk) _error_("See above"); 3062 3062 3063 3063 return e; … … 3258 3258 //check i 3259 3259 if (i<0 || i>=nbt ){ 3260 _error 2_("Index problem in NewPoints (i=" << i << " not in [0 " << nbt-1 << "])");3260 _error_("Index problem in NewPoints (i=" << i << " not in [0 " << nbt-1 << "])"); 3261 3261 } 3262 3262 //change first_np_or_next_t[i] … … 3309 3309 } 3310 3310 if (ta.EdgeVertex(0)!=s){ 3311 _error 2_("ta.EdgeVertex(0)!=s");3311 _error_("ta.EdgeVertex(0)!=s"); 3312 3312 } 3313 3313 ta = Next(Adj(ta)); … … 3344 3344 } 3345 3345 else { 3346 _error 2_("ProjectOnCurve On BamgVertex " << BTh.GetId(vA) << " forget call to SetVertexFieldOnBTh");3346 _error_("ProjectOnCurve On BamgVertex " << BTh.GetId(vA) << " forget call to SetVertexFieldOnBTh"); 3347 3347 } 3348 3348 … … 3355 3355 } 3356 3356 else { 3357 _error 2_("ProjectOnCurve On BamgVertex " << BTh.GetId(vB) << " forget call to SetVertexFieldOnBTh");3357 _error_("ProjectOnCurve On BamgVertex " << BTh.GetId(vB) << " forget call to SetVertexFieldOnBTh"); 3358 3358 } 3359 3359 Edge * e = &BhAB; 3360 3360 if (!pA || !pB || !e){ 3361 _error 2_("!pA || !pB || !e");3361 _error_("!pA || !pB || !e"); 3362 3362 } 3363 3363 // be carefull the back ground edge e is on same geom edge … … 3365 3365 //check Is a background Mesh; 3366 3366 if (e<BTh.edges || e>=BTh.edges+BTh.nbe){ 3367 _error 2_("e<BTh.edges || e>=BTh.edges+BTh.nbe");3367 _error_("e<BTh.edges || e>=BTh.edges+BTh.nbe"); 3368 3368 } 3369 3369 // walk on BTh edge … … 3388 3388 } 3389 3389 else{ // do the search by walking 3390 _error 2_("case not supported yet");3390 _error_("case not supported yet"); 3391 3391 } 3392 3392 … … 3452 3452 3453 3453 } 3454 _error 2_("Big bug...");3454 _error_("Big bug..."); 3455 3455 return 0; // just for the compiler 3456 3456 } … … 3493 3493 } 3494 3494 if (kk != nbe){ 3495 _error 2_("There are " << kk-nbe << " double edges in the mesh");3495 _error_("There are " << kk-nbe << " double edges in the mesh"); 3496 3496 } 3497 3497 … … 3525 3525 //An edge belongs to 2 triangles 3526 3526 else { 3527 _error 2_("The edge (" << GetId(triangles[i][VerticesOfTriangularEdge[j][0]]) << " , " << GetId(triangles[i][VerticesOfTriangularEdge[j][1]]) << ") belongs to more than 2 triangles");3527 _error_("The edge (" << GetId(triangles[i][VerticesOfTriangularEdge[j][0]]) << " , " << GetId(triangles[i][VerticesOfTriangularEdge[j][1]]) << ") belongs to more than 2 triangles"); 3528 3528 } 3529 3529 } … … 3563 3563 } 3564 3564 if(k) { 3565 _error 2_(k << " boundary edges (from the geometry) are not defined as mesh edges");3565 _error_(k << " boundary edges (from the geometry) are not defined as mesh edges"); 3566 3566 } 3567 3567 … … 3590 3590 for (i=2;det(orderedvertices[0]->i,orderedvertices[1]->i,orderedvertices[i]->i)==0;) 3591 3591 if (++i>=nbvb) { 3592 _error 2_("ReconstructExistingMesh: All the vertices are aligned");3592 _error_("ReconstructExistingMesh: All the vertices are aligned"); 3593 3593 } 3594 3594 //Move this vertex (i) to the 2d position in orderedvertices … … 3650 3650 } 3651 3651 if(nbloss) { 3652 _error 2_("we lost " << nbloss << " existing edges other " << knbe);3652 _error_("we lost " << nbloss << " existing edges other " << knbe); 3653 3653 } 3654 3654 … … 3725 3725 subdomains = savesubdomains; 3726 3726 if (k) { 3727 _error 2_("number of triangles edges alone = " << k);3727 _error_("number of triangles edges alone = " << k); 3728 3728 } 3729 3729 FindSubDomain(); … … 3755 3755 3756 3756 _printLine_("This edge is on geometry and has no adjacent edge (open curve) and one of the tip is not required"); 3757 _error 2_("See above (might be cryptic...)");3757 _error_("See above (might be cryptic...)"); 3758 3758 } 3759 3759 } … … 3778 3778 t=t0=subdomains[i].head; 3779 3779 if (!t0){ // not empty sub domain 3780 _error 2_("!t0");3780 _error_("!t0"); 3781 3781 } 3782 3782 do { 3783 3783 long kt = GetId(t); 3784 3784 if (kt<0 || kt >= nbt ){ 3785 _error 2_("kt<0 || kt >= nbt");3785 _error_("kt<0 || kt >= nbt"); 3786 3786 } 3787 3787 if (renu[kt]!=-1){ 3788 _error 2_("renu[kt]!=-1");3788 _error_("renu[kt]!=-1"); 3789 3789 } 3790 3790 renu[kt]=k++; … … 3803 3803 } 3804 3804 if (k != nbt){ 3805 _error 2_("k != nbt");3805 _error_("k != nbt"); 3806 3806 } 3807 3807 // do the change on all the pointeur … … 3929 3929 coefIcoor= (MaxICoor)/(Max(pmax.x-pmin.x,pmax.y-pmin.y)); 3930 3930 if (coefIcoor<=0){ 3931 _error 2_("coefIcoor should be positive, a problem in the geometry is likely");3931 _error_("coefIcoor should be positive, a problem in the geometry is likely"); 3932 3932 } 3933 3933 … … 3965 3965 } 3966 3966 3967 if (number_of_errors) _error 2_("Fatal error: some triangles have negative areas, see above");3967 if (number_of_errors) _error_("Fatal error: some triangles have negative areas, see above"); 3968 3968 } 3969 3969 /*}}}*/ … … 4146 4146 register Triangle* t= vertices[i].t; 4147 4147 if (!t){ 4148 _error 2_("!t");4148 _error_("!t"); 4149 4149 } 4150 4150 BamgVertex & vi = vertices[i]; … … 4154 4154 ta=Previous(Adj(ta)); 4155 4155 if (vertices+i != ta.EdgeVertex(1)){ 4156 _error 2_("vertices+i != ta.EdgeVertex(1)");4156 _error_("vertices+i != ta.EdgeVertex(1)"); 4157 4157 } 4158 4158 BamgVertex & vj = *(ta.EdgeVertex(0)); … … 4160 4160 j= &vj-vertices; 4161 4161 if (j<0 || j >= nbv){ 4162 _error 2_("j<0 || j >= nbv");4162 _error_("j<0 || j >= nbv"); 4163 4163 } 4164 4164 R2 Aij = (R2) vj - (R2) vi; … … 4284 4284 // the first PB is to now a background edge between the 2 vertices 4285 4285 if (!edgesGtoB){ 4286 _error 2_("!edgesGtoB");4286 _error_("!edgesGtoB"); 4287 4287 } 4288 4288 ong= ProjectOnCurve(*edgesGtoB[Gh.GetId(edges[i].GeomEdgeHook)], … … 4356 4356 Triangle & t = triangles[i]; 4357 4357 if (!t.link){ 4358 _error 2_("!t.link");4358 _error_("!t.link"); 4359 4359 } 4360 4360 for(int j=0;j<3;j++) … … 4383 4383 || (cc=Area2( t[0].r , t[1].r , A.r )) < 0.0)){ 4384 4384 _printLine_(ke + nbvold << " not in triangle " << i << " In= " << !!t.link << " " << aa << " " << bb << " " << cc << " " << dd); 4385 _error 2_("Number of triangles with P2 interpolation Problem");4385 _error_("Number of triangles with P2 interpolation Problem"); 4386 4386 } 4387 4387 } … … 4391 4391 || (cc=Area2( tt[0].r , tt[1].r , A.r )) < 0)){ 4392 4392 _printLine_(ke + nbvold << " not in triangle " << ii << " In= " << !!tt.link << " " << aa << " " << bb << " " << cc << " " << dd); 4393 _error 2_("Number of triangles with P2 interpolation Problem");4393 _error_("Number of triangles with P2 interpolation Problem"); 4394 4394 } 4395 4395 } … … 4439 4439 } // tt 4440 4440 else 4441 _error 2_("Bug...");4441 _error_("Bug..."); 4442 4442 } // ke<0 4443 4443 else … … 4452 4452 } 4453 4453 if (nbinvisible>=2){ 4454 _error 2_("nbinvisible>=2");4454 _error_("nbinvisible>=2"); 4455 4455 } 4456 4456 switch (nbsplitedge) { … … 4464 4464 } 4465 4465 if (ksplit[i]<40){ 4466 _error 2_("ksplit[i]<40");4466 _error_("ksplit[i]<40"); 4467 4467 } 4468 4468 } … … 4481 4481 int ke=(int) (ksplit[i]%10); 4482 4482 if (kk>=7 || kk<=0){ 4483 _error 2_("kk>=7 || kk<=0");4483 _error_("kk>=7 || kk<=0"); 4484 4484 } 4485 4485 … … 4498 4498 4499 4499 if (nbmkadj>=10){ 4500 _error 2_("nbmkadj>=10");4500 _error_("nbmkadj>=10"); 4501 4501 } 4502 4502 // -------------------------- … … 4516 4516 t1=t0; 4517 4517 if (kedge[3*i+i0]<0){ 4518 _error 2_("kedge[3*i+i0]<0");4518 _error_("kedge[3*i+i0]<0"); 4519 4519 } 4520 4520 BamgVertex * v3 = vertices + kedge[3*i+k0]; … … 4532 4532 t2=t1=t0; 4533 4533 if (kedge[3*i+k1]<0){ 4534 _error 2_("kedge[3*i+k1]<0");4534 _error_("kedge[3*i+k1]<0"); 4535 4535 } 4536 4536 if (kedge[3*i+k2]<0){ 4537 _error 2_("kedge[3*i+k2]<0");4537 _error_("kedge[3*i+k2]<0"); 4538 4538 } 4539 4539 … … 4559 4559 t3=t2=t1=t0; 4560 4560 if (kedge[3*i+k0] <0 || kedge[3*i+k1]<0 || kedge[3*i+k2]<0){ 4561 _error 2_("kedge[3*i+k0] <0 || kedge[3*i+k1]<0 || kedge[3*i+k2]<0");4561 _error_("kedge[3*i+k0] <0 || kedge[3*i+k1]<0 || kedge[3*i+k2]<0"); 4562 4562 } 4563 4563 BamgVertex * v12 = vertices + kedge[3*i+k0]; … … 4633 4633 } 4634 4634 if (nbmkadj>13){// 13 = 6 + 4 + 4635 _error 2_("nbmkadj>13");4635 _error_("nbmkadj>13"); 4636 4636 } 4637 4637 … … 4759 4759 quadtree->Add(vi); 4760 4760 if (!tcvi || tcvi->det<0){// internal 4761 _error 2_("!tcvi || tcvi->det < 0");4761 _error_("!tcvi || tcvi->det < 0"); 4762 4762 } 4763 4763 AddVertex(vi,tcvi,det3); … … 4802 4802 4803 4803 /*Check that the quadtree does exist*/ 4804 if (!quadtree) _error 2_("no starting triangle provided and no quadtree available");4804 if (!quadtree) _error_("no starting triangle provided and no quadtree available"); 4805 4805 4806 4806 /*Call NearestVertex*/ … … 4808 4808 4809 4809 /*Check output (Vertex a)*/ 4810 if (!a) _error 2_("problem while trying to find nearest vertex from a given point. No output found");4811 if (!a->t) _error 2_("no triangle is associated to vertex number " << GetId(a)+1 << " (orphan?)");4810 if (!a) _error_("problem while trying to find nearest vertex from a given point. No output found"); 4811 if (!a->t) _error_("no triangle is associated to vertex number " << GetId(a)+1 << " (orphan?)"); 4812 4812 _assert_(a>=vertices && a<vertices+nbv); 4813 4813 … … 4844 4844 4845 4845 /*Increase counter*/ 4846 if (++counter>=10000) _error 2_("Maximum number of iteration reached (threshold = " << counter << ").");4846 if (++counter>=10000) _error_("Maximum number of iteration reached (threshold = " << counter << ")."); 4847 4847 4848 4848 j= OppositeVertex[jj]; … … 4908 4908 4909 4909 //check that the subdomain is not empty 4910 if (!t0){ _error 2_("At least one subdomain is empty");}4910 if (!t0){ _error_("At least one subdomain is empty");} 4911 4911 4912 4912 //loop … … 4991 4991 //allocate 4992 4992 VerticesOnGeomVertex = new VertexOnGeom[NbVerticesOnGeomVertex]; 4993 if(NbVerticesOnGeomVertex >= maxnbv) _error 2_("too many vertices on geometry: " << NbVerticesOnGeomVertex << " >= " << maxnbv);4993 if(NbVerticesOnGeomVertex >= maxnbv) _error_("too many vertices on geometry: " << NbVerticesOnGeomVertex << " >= " << maxnbv); 4994 4994 _assert_(nbv==0); 4995 4995 //Build VerticesOnGeomVertex … … 5080 5080 NbNewPoints=0; 5081 5081 NbEdgeCurve=0; 5082 if (nbvend>=maxnbv) _error 2_("maximum number of vertices too low! Check the domain outline or increase maxnbv");5082 if (nbvend>=maxnbv) _error_("maximum number of vertices too low! Check the domain outline or increase maxnbv"); 5083 5083 lcurve =0; 5084 5084 s = lstep; //-1 initially, then length of each sub edge … … 5322 5322 printf("\n"); 5323 5323 if(NbVerticesOnGeomVertex >= maxnbv){ 5324 _error 2_("too many vertices on geometry: " << NbVerticesOnGeomVertex << " >= " << maxnbv);5324 _error_("too many vertices on geometry: " << NbVerticesOnGeomVertex << " >= " << maxnbv); 5325 5325 } 5326 5326 … … 5393 5393 if (bfind!=Gh.nbcurves){ 5394 5394 delete [] bcurve; 5395 _error 2_("problem generating number of curves (" << Gh.nbcurves << " found in the geometry but " << bfind << " curve found in the mesh)");5395 _error_("problem generating number of curves (" << Gh.nbcurves << " found in the geometry but " << bfind << " curve found in the mesh)"); 5396 5396 } 5397 5397 … … 5492 5492 double se= (sNew-L0)/LAB; 5493 5493 if (se<0 || se>=1.000000001){ 5494 _error 2_("Problem creating point on a boundary: se=" << se << " should be in [0 1]");5494 _error_("Problem creating point on a boundary: se=" << se << " should be in [0 1]"); 5495 5495 } 5496 5496 se = abscisseInterpole(v0.m,v1.m,AB,se,1); 5497 5497 if (se<0 || se>1){ 5498 _error 2_("Problem creating point on a boundary: se=" << se << " should be in [0 1]");5498 _error_("Problem creating point on a boundary: se=" << se << " should be in [0 1]"); 5499 5499 } 5500 5500 se = k1 ? se : 1. - se; … … 5528 5528 } 5529 5529 if (!ee.adj[k1]) { 5530 _error 2_("adj edge " << BTh.GetId(ee) << ", nbe=" << nbe << ", Gh.vertices=" << Gh.vertices);5530 _error_("adj edge " << BTh.GetId(ee) << ", nbe=" << nbe << ", Gh.vertices=" << Gh.vertices); 5531 5531 } 5532 5532 pe = ee.adj[k1]; // next edge … … 5566 5566 if(step==0){ 5567 5567 if(nbv+NbOfNewPoints > maxnbv) { 5568 _error 2_("too many vertices on geometry: " << nbv+NbOfNewPoints << " >= " << maxnbv);5568 _error_("too many vertices on geometry: " << nbv+NbOfNewPoints << " >= " << maxnbv); 5569 5569 } 5570 5570 edges = new Edge[NbOfNewEdge]; … … 5611 5611 int dir=0; 5612 5612 if (k<0){ 5613 _error 2_("k<0");5613 _error_("k<0"); 5614 5614 } 5615 5615 int kkk=0; … … 5619 5619 kkk++; 5620 5620 if (kkk>=1000){ 5621 _error 2_("kkk>=1000");5621 _error_("kkk>=1000"); 5622 5622 } 5623 5623 BamgVertex &vI = *edge.EdgeVertex(0); … … 5636 5636 double IJ2 = IJ_IA + IJ_AJ; 5637 5637 if (IJ2==0){ 5638 _error 2_("IJ2==0");5638 _error_("IJ2==0"); 5639 5639 } 5640 5640 a= IJ_AJ/IJ2; … … 5650 5650 int NbSwap =0; 5651 5651 if (!a.t || !b.t){ // the 2 vertex is in a mesh 5652 _error 2_("!a.t || !b.t");5652 _error_("!a.t || !b.t"); 5653 5653 } 5654 5654 int k=0; … … 5667 5667 vbegin =v2; 5668 5668 if (!v2){ 5669 _error 2_("!v2");5669 _error_("!v2"); 5670 5670 } 5671 5671 det2 = det(*v2,a,b); … … 5684 5684 tc = Previous(tc); 5685 5685 if (!v1 || !v2){ 5686 _error 2_("!v1 || !v2");5686 _error_("!v1 || !v2"); 5687 5687 } 5688 5688 Icoor2 detss = 0,l=0,ks; 5689 5689 while ((ks=SwapForForcingEdge( va, vb, tc, detss, det1,det2,NbSwap))) 5690 5690 if(l++ > 10000000) { 5691 _error 2_("Loop in forcing Egde, nb de swap=" << NbSwap << ", nb of try swap (" << l << ") too big");5691 _error_("Loop in forcing Egde, nb de swap=" << NbSwap << ", nb of try swap (" << l << ") too big"); 5692 5692 } 5693 5693 BamgVertex *aa = tc.EdgeVertex(0), *bb = tc.EdgeVertex(1); … … 5708 5708 k++; 5709 5709 if (k>=2000){ 5710 _error 2_("k>=2000");5710 _error_("k>=2000"); 5711 5711 } 5712 5712 if ( vbegin == v2 ) return -1;// error … … 5780 5780 short a1=tt1,a2=tt2;// les 2 numero de l arete dans les 2 triangles 5781 5781 if ( a1<0 || a1>=3 ){ 5782 _error 2_("a1<0 || a1>=3");5782 _error_("a1<0 || a1>=3"); 5783 5783 } 5784 5784 … … 5792 5792 Icoor2 detT = det1+det2; 5793 5793 if ((det1<=0 ) || (det2<=0)){ 5794 _error 2_("(det1<=0 ) || (det2<=0)");5794 _error_("(det1<=0 ) || (det2<=0)"); 5795 5795 } 5796 5796 if ( (detsa>=0) || (detsb<=0) ){ // [a,b] cut infinite line va,bb 5797 _error 2_("(detsa>=0) || (detsb<=0)");5797 _error_("(detsa>=0) || (detsb<=0)"); 5798 5798 } 5799 5799 Icoor2 ndet1 = bamg::det(s1,sa,s2); -
issm/branches/trunk-jpl-damage/src/c/classes/bamg/Metric.cpp
r12821 r13101 197 197 // warning for optimisation S is in [0:0.5] not in [0:1] 198 198 if (i>=512){ 199 _error 2_("i>=512");199 _error_("i>=512"); 200 200 } 201 201 LastMetricInterpole.lab=l; … … 345 345 } 346 346 if (r>1 || r<0){ 347 _error 2_("r>1 || r<0");347 _error_("r>1 || r<0"); 348 348 } 349 349 return r ; -
issm/branches/trunk-jpl-damage/src/c/classes/bamg/SetOfE4.cpp
r12821 r13101 50 50 //check that nbax <=NbOfEdges 51 51 if (nbax <=NbOfEdges ) { 52 _error 2_("SetOfEdges4::add overflow: NbOfEdges=" << NbOfEdges << " > nbax=" << nbax);52 _error_("SetOfEdges4::add overflow: NbOfEdges=" << NbOfEdges << " > nbax=" << nbax); 53 53 } 54 54 -
issm/branches/trunk-jpl-damage/src/c/classes/bamg/SubDomain.cpp
r12821 r13101 16 16 *this = Th.subdomains[i]; 17 17 if ( head-Th.triangles<0 || head-Th.triangles>=Th.nbt){ 18 _error 2_("head-Th.triangles<0 || head-Th.triangles>=Th.nbt");18 _error_("head-Th.triangles<0 || head-Th.triangles>=Th.nbt"); 19 19 } 20 20 head = ThNew.triangles + Th.GetId(head) ; 21 21 if (edge-Th.edges<0 || edge-Th.edges>=Th.nbe);{ 22 _error 2_("edge-Th.edges<0 || edge-Th.edges>=Th.nbe");22 _error_("edge-Th.edges<0 || edge-Th.edges>=Th.nbe"); 23 23 } 24 24 edge = ThNew.edges+ Th.GetId(edge); -
issm/branches/trunk-jpl-damage/src/c/classes/bamg/Triangle.cpp
r12821 r13101 19 19 long nbv = Th->nbv; 20 20 if (i<0 || j<0 || k<0){ 21 _error 2_("i<0 || j<0 || k<0");21 _error_("i<0 || j<0 || k<0"); 22 22 } 23 23 if (i>=nbv || j>=nbv || k>=nbv){ 24 _error 2_("i>=nbv || j>=nbv || k>=nbv");24 _error_("i>=nbv || j>=nbv || k>=nbv"); 25 25 } 26 26 vertices[0]=v+i; … … 173 173 //check number of iterations 174 174 if (k>=2000){ 175 _error 2_("too many iteration in Triangle::FindBoundaryEdge (k>=2000)");175 _error_("too many iteration in Triangle::FindBoundaryEdge (k>=2000)"); 176 176 } 177 177 } while (this!= t); … … 213 213 do { 214 214 while (t->swap(j,koption)){ 215 if (k>=20000) _error 2_("k>=20000");215 if (k>=20000) _error_("k>=20000"); 216 216 NbSwap++; 217 217 k++; -
issm/branches/trunk-jpl-damage/src/c/classes/gauss/GaussPenta.cpp
r12832 r13101 119 119 } 120 120 else{ 121 _error 2_("Penta not supported yet");121 _error_("Penta not supported yet"); 122 122 } 123 123 … … 159 159 } 160 160 else{ 161 _error 2_("Tria not supported yet");161 _error_("Tria not supported yet"); 162 162 } 163 163 … … 221 221 } 222 222 else{ 223 _error 2_("Tria not supported yet (user provided indices " << index1 << " " << index2 << " " << index3 << " " << index4 << ")");223 _error_("Tria not supported yet (user provided indices " << index1 << " " << index2 << " " << index3 << " " << index4 << ")"); 224 224 } 225 225 … … 340 340 break; 341 341 default: 342 _error 2_("vertex index should be in [0 5]");342 _error_("vertex index should be in [0 5]"); 343 343 344 344 } … … 359 359 } 360 360 else{ 361 _error 2_("Tria not supported yet");361 _error_("Tria not supported yet"); 362 362 } 363 363 -
issm/branches/trunk-jpl-damage/src/c/classes/gauss/GaussTria.cpp
r12832 r13101 80 80 } 81 81 else 82 _error 2_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")");82 _error_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")"); 83 83 84 84 /*Initialize static fields as undefined*/ … … 178 178 } 179 179 else 180 _error 2_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")");180 _error_("The 2 indices provided are not supported yet (user provided " << index1 << " and " << index2 << ")"); 181 181 182 182 } … … 197 197 /*}}}*/ 198 198 /*FUNCTION GaussTria::GaussFromCoords{{{*/ 199 void GaussTria::GaussFromCoords(Issm PDouble x,IssmPDouble y,IssmPDouble* xyz_list){199 void GaussTria::GaussFromCoords(IssmDouble x,IssmDouble y,IssmDouble* xyz_list){ 200 200 201 201 /*Intermediaries*/ 202 Issm PDouble area = 0;203 Issm PDouble x1,y1,x2,y2,x3,y3;202 IssmDouble area = 0; 203 IssmDouble x1,y1,x2,y2,x3,y3; 204 204 205 205 /*in debugging mode: check that the default constructor has been called*/ … … 241 241 break; 242 242 default: 243 _error 2_("vertex index should be in [0 2]");243 _error_("vertex index should be in [0 2]"); 244 244 245 245 } -
issm/branches/trunk-jpl-damage/src/c/classes/gauss/GaussTria.h
r12822 r13101 22 22 public: 23 23 IssmPDouble weight; 24 Issm PDouble coord1;25 Issm PDouble coord2;26 Issm PDouble coord3;24 IssmDouble coord1; 25 IssmDouble coord2; 26 IssmDouble coord3; 27 27 28 28 public: … … 38 38 int end(void); 39 39 void Echo(void); 40 void GaussFromCoords(Issm PDouble x1,IssmPDouble y1,IssmPDouble* xyz_list);40 void GaussFromCoords(IssmDouble x1,IssmDouble y1,IssmDouble* xyz_list); 41 41 void GaussPoint(int ig); 42 42 void GaussVertex(int iv); -
issm/branches/trunk-jpl-damage/src/c/classes/kriging/ExponentialVariogram.cpp
r12821 r13101 39 39 40 40 /*Checks*/ 41 if(nugget==sill) _error 2_("nugget and sill cannot be equal (constant semivariogram not allowed)");41 if(nugget==sill) _error_("nugget and sill cannot be equal (constant semivariogram not allowed)"); 42 42 } 43 43 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/classes/kriging/ExponentialVariogram.h
r12821 r13101 23 23 /*Object virtual functions definitions*/ 24 24 void Echo(); 25 void DeepEcho(){_error 2_("Not implemented yet");};26 int Id(){_error 2_("Not implemented yet");};27 int MyRank(){_error 2_("Not implemented yet");};28 int ObjectEnum(){_error 2_("Not implemented yet");};29 Object* copy(){_error 2_("Not implemented yet");};25 void DeepEcho(){_error_("Not implemented yet");}; 26 int Id(){_error_("Not implemented yet");}; 27 int MyRank(){_error_("Not implemented yet");}; 28 int ObjectEnum(){_error_("Not implemented yet");}; 29 Object* copy(){_error_("Not implemented yet");}; 30 30 31 31 /*Variogram functions*/ -
issm/branches/trunk-jpl-damage/src/c/classes/kriging/GaussianVariogram.cpp
r12821 r13101 39 39 40 40 /*Checks*/ 41 if(nugget==sill) _error 2_("nugget and sill cannot be equal (constant semivariogram not allowed)");41 if(nugget==sill) _error_("nugget and sill cannot be equal (constant semivariogram not allowed)"); 42 42 } 43 43 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/classes/kriging/GaussianVariogram.h
r12832 r13101 24 24 /*Object virtual functions definitions*/ 25 25 void Echo(); 26 void DeepEcho(){_error 2_("Not implemented yet");};27 int Id(){_error 2_("Not implemented yet");};28 int MyRank(){_error 2_("Not implemented yet");};29 int ObjectEnum(){_error 2_("Not implemented yet");};30 Object* copy(){_error 2_("Not implemented yet");};26 void DeepEcho(){_error_("Not implemented yet");}; 27 int Id(){_error_("Not implemented yet");}; 28 int MyRank(){_error_("Not implemented yet");}; 29 int ObjectEnum(){_error_("Not implemented yet");}; 30 Object* copy(){_error_("Not implemented yet");}; 31 31 32 32 /*Variogram functions*/ -
issm/branches/trunk-jpl-damage/src/c/classes/kriging/Observation.h
r12832 r13101 24 24 /*Object virtual functions definitions*/ 25 25 void Echo(); 26 void DeepEcho() {_error 2_("Not implemented yet"); };27 int Id() {_error 2_("Not implemented yet"); };28 int MyRank() {_error 2_("Not implemented yet"); };29 int ObjectEnum(){_error 2_("Not implemented yet"); };30 Object *copy() {_error 2_("Not implemented yet"); };26 void DeepEcho() {_error_("Not implemented yet"); }; 27 int Id() {_error_("Not implemented yet"); }; 28 int MyRank() {_error_("Not implemented yet"); }; 29 int ObjectEnum(){_error_("Not implemented yet"); }; 30 Object *copy() {_error_("Not implemented yet"); }; 31 31 32 32 /*Management*/ -
issm/branches/trunk-jpl-damage/src/c/classes/kriging/PowerVariogram.cpp
r12821 r13101 39 39 40 40 /*Checks*/ 41 if(power<=0 || power>=2) _error 2_("power must be betwwen 0 and 2 (0 < power < 2)");42 if(slope<=0) _error 2_("slope must be positive");41 if(power<=0 || power>=2) _error_("power must be betwwen 0 and 2 (0 < power < 2)"); 42 if(slope<=0) _error_("slope must be positive"); 43 43 } 44 44 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/classes/kriging/PowerVariogram.h
r12821 r13101 23 23 /*Object virtual functions definitions*/ 24 24 void Echo(); 25 void DeepEcho(){_error 2_("Not implemented yet");};26 int Id(){_error 2_("Not implemented yet");};27 int MyRank(){_error 2_("Not implemented yet");};28 int ObjectEnum(){_error 2_("Not implemented yet");};29 Object* copy(){_error 2_("Not implemented yet");};25 void DeepEcho(){_error_("Not implemented yet");}; 26 int Id(){_error_("Not implemented yet");}; 27 int MyRank(){_error_("Not implemented yet");}; 28 int ObjectEnum(){_error_("Not implemented yet");}; 29 Object* copy(){_error_("Not implemented yet");}; 30 30 31 31 /*Variogram functions*/ -
issm/branches/trunk-jpl-damage/src/c/classes/kriging/Quadtree.cpp
r12821 r13101 83 83 /*FUNCTION Quadtree::Quadtree(){{{*/ 84 84 Quadtree::Quadtree(){ 85 _error 2_("Constructor not supported");85 _error_("Constructor not supported"); 86 86 87 87 } … … 248 248 } 249 249 else{ 250 _error 2_("Box is not full");250 _error_("Box is not full"); 251 251 } 252 252 }/*}}}*/ … … 397 397 break; 398 398 default: 399 _error 2_("Case " << index << " not supported");399 _error_("Case " << index << " not supported"); 400 400 } 401 401 newbox->length=master->length/2; … … 574 574 break; 575 575 default: 576 _error 2_("Case " << this->IsWithinRange(x,y,range) << " not supported");576 _error_("Case " << this->IsWithinRange(x,y,range) << " not supported"); 577 577 } 578 578 -
issm/branches/trunk-jpl-damage/src/c/classes/kriging/Quadtree.h
r12821 r13101 27 27 /*Object functions (Needed because the Quadtree uses a Container*/ 28 28 void Echo(); 29 void DeepEcho() {_error 2_("not implemented yet"); };30 int Id() {_error 2_("not implemented yet"); };31 int MyRank() {_error 2_("not implemented yet"); };32 int ObjectEnum(){_error 2_("not implemented yet"); };33 Object *copy() {_error 2_("not implemented yet"); };29 void DeepEcho() {_error_("not implemented yet"); }; 30 int Id() {_error_("not implemented yet"); }; 31 int MyRank() {_error_("not implemented yet"); }; 32 int ObjectEnum(){_error_("not implemented yet"); }; 33 Object *copy() {_error_("not implemented yet"); }; 34 34 35 35 /*Methods*/ -
issm/branches/trunk-jpl-damage/src/c/classes/kriging/SphericalVariogram.cpp
r12821 r13101 39 39 40 40 /*Checks*/ 41 if(nugget==sill) _error 2_("nugget and sill cannot be equal (constant semivariogram not allowed)");41 if(nugget==sill) _error_("nugget and sill cannot be equal (constant semivariogram not allowed)"); 42 42 } 43 43 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/classes/kriging/SphericalVariogram.h
r12821 r13101 23 23 /*Object virtual functions definitions*/ 24 24 void Echo(); 25 void DeepEcho(){_error 2_("Not implemented yet");};26 int Id(){_error 2_("Not implemented yet");};27 int MyRank(){_error 2_("Not implemented yet");};28 int ObjectEnum(){_error 2_("Not implemented yet");};29 Object* copy(){_error 2_("Not implemented yet");};25 void DeepEcho(){_error_("Not implemented yet");}; 26 int Id(){_error_("Not implemented yet");}; 27 int MyRank(){_error_("Not implemented yet");}; 28 int ObjectEnum(){_error_("Not implemented yet");}; 29 Object* copy(){_error_("Not implemented yet");}; 30 30 31 31 /*Variogram functions*/ -
issm/branches/trunk-jpl-damage/src/c/classes/matrix/ElementMatrix.cpp
r12832 r13101 47 47 ElementMatrix::ElementMatrix(ElementMatrix* Ke){ 48 48 49 if(!Ke) _error 2_("Input Element Matrix is a NULL pointer");49 if(!Ke) _error_("Input Element Matrix is a NULL pointer"); 50 50 this->Init(Ke); 51 51 return; … … 63 63 /*If one of the two matrix is NULL, we copy the other one*/ 64 64 if(!Ke1 && !Ke2){ 65 _error 2_("Two input element matrices are NULL");65 _error_("Two input element matrices are NULL"); 66 66 } 67 67 else if(!Ke1){ … … 75 75 76 76 /*General Case: Ke1 and Ke2 are not empty*/ 77 if(!Ke1->dofsymmetrical || !Ke2->dofsymmetrical) _error 2_("merging 2 non dofsymmetrical matrices not implemented yet");77 if(!Ke1->dofsymmetrical || !Ke2->dofsymmetrical) _error_("merging 2 non dofsymmetrical matrices not implemented yet"); 78 78 79 79 /*Initialize itransformation matrix Ke[P[i]] = Ke2[i]*/ … … 295 295 } 296 296 else{ 297 _error 2_("non dofsymmetrical matrix AddToGlobal routine not support yet!");297 _error_("non dofsymmetrical matrix AddToGlobal routine not support yet!"); 298 298 } 299 299 … … 332 332 } 333 333 else{ 334 _error 2_("non dofsymmetrical matrix AddToGlobal routine not support yet!");334 _error_("non dofsymmetrical matrix AddToGlobal routine not support yet!"); 335 335 } 336 336 … … 343 343 for (int i=0;i<this->nrows;i++){ 344 344 for(int j=0;j<this->ncols;j++){ 345 if (xIsNan<IssmDouble>(this->values[i*this->ncols+j])) _error 2_("NaN found in Element Matrix");346 if (fabs(this->values[i*this->ncols+j])>1.e+50) _error 2_("Element Matrix values exceeds 1.e+50");345 if (xIsNan<IssmDouble>(this->values[i*this->ncols+j])) _error_("NaN found in Element Matrix"); 346 if (fabs(this->values[i*this->ncols+j])>1.e+50) _error_("Element Matrix values exceeds 1.e+50"); 347 347 } 348 348 } … … 365 365 /*Transpose indices*/ 366 366 if(!dofsymmetrical){ 367 _error 2_("not supported yet");367 _error_("not supported yet"); 368 368 } 369 369 … … 378 378 int i,j; 379 379 _printLine_("Element Matrix echo:"); 380 _printLine_(" nrows: " << nrows);381 _printLine_(" ncols: " << nrows);380 _printLine_(" nrows: " << this->nrows); 381 _printLine_(" ncols: " << this->ncols); 382 382 _printLine_(" dofsymmetrical: " << (dofsymmetrical?"true":"false")); 383 383 … … 488 488 int i; 489 489 490 if(this->nrows!=this->ncols)_error 2_("need square matrix in input!");490 if(this->nrows!=this->ncols)_error_("need square matrix in input!"); 491 491 492 492 for(i=0;i<this->nrows;i++){ -
issm/branches/trunk-jpl-damage/src/c/classes/matrix/ElementVector.cpp
r12832 r13101 42 42 /*If one of the two matrix is NULL, we copy the other one*/ 43 43 if(!pe1 && !pe2){ 44 _error 2_("Two input element matrices are NULL");44 _error_("Two input element matrices are NULL"); 45 45 } 46 46 else if(!pe1){ … … 210 210 #ifdef _ISSM_DEBUG_ 211 211 for (int i=0;i<this->nrows;i++){ 212 if (xIsNan<IssmDouble>(this->values[i])) _error 2_("NaN found in Element Vector");213 if (fabs( this->values[i])>1.e+50) _error 2_("Element Vector values exceeds 1.e+50");212 if (xIsNan<IssmDouble>(this->values[i])) _error_("NaN found in Element Vector"); 213 if (fabs( this->values[i])>1.e+50) _error_("Element Vector values exceeds 1.e+50"); 214 214 } 215 215 #endif -
issm/branches/trunk-jpl-damage/src/c/classes/matrix/Matrix.cpp
r12946 r13101 51 51 this->pmatrix=new PetscMat(M,N); 52 52 #else 53 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");53 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 54 54 #endif 55 55 } … … 57 57 this->smatrix=new SeqMat(M,N); 58 58 } 59 else _error 2_("Matrix type: " << type << " not supported yet!");59 else _error_("Matrix type: " << type << " not supported yet!"); 60 60 61 61 } … … 74 74 this->pmatrix=new PetscMat(M,N,sparsity); 75 75 #else 76 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");76 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 77 77 #endif 78 78 } … … 80 80 this->smatrix=new SeqMat(M,N,sparsity); 81 81 } 82 else _error 2_("Matrix type: " << type << " not supported yet!");82 else _error_("Matrix type: " << type << " not supported yet!"); 83 83 } 84 84 /*}}}*/ … … 96 96 this->pmatrix=new PetscMat(serial_mat,M,N,sparsity); 97 97 #else 98 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");98 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 99 99 #endif 100 100 } … … 102 102 this->smatrix=new SeqMat(serial_mat,M,N,sparsity); 103 103 } 104 else _error 2_("Matrix type: " << type << " not supported yet!");104 else _error_("Matrix type: " << type << " not supported yet!"); 105 105 106 106 } … … 119 119 this->pmatrix=new PetscMat(M,N,connectivity,numberofdofspernode); 120 120 #else 121 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");121 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 122 122 #endif 123 123 } … … 125 125 this->smatrix=new SeqMat(M,N,connectivity,numberofdofspernode); 126 126 } 127 else _error 2_("Matrix type: " << type << " not supported yet!");127 else _error_("Matrix type: " << type << " not supported yet!"); 128 128 129 129 } … … 136 136 delete this->pmatrix; 137 137 #else 138 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");138 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 139 139 #endif 140 140 } … … 142 142 delete this->smatrix; 143 143 } 144 else _error 2_("Matrix type: " << type << " not supported yet!");144 else _error_("Matrix type: " << type << " not supported yet!"); 145 145 146 146 } … … 150 150 /*FUNCTION Matrix::Echo{{{*/ 151 151 void Matrix::Echo(void){ 152 _assert_(this); 152 153 153 154 if(type==PetscMatType){ 154 155 #ifdef _HAVE_PETSC_ 155 156 this->pmatrix->Echo(); 156 #else157 _error2_("Petsc matrix format not usable, as Petsc has not been compiled!");158 157 #endif 159 158 } … … 161 160 this->smatrix->Echo(); 162 161 } 163 else _error 2_("Matrix type: " << type << " not supported yet!");162 else _error_("Matrix type: " << type << " not supported yet!"); 164 163 165 164 } … … 171 170 #ifdef _HAVE_PETSC_ 172 171 this->pmatrix->Assemble(); 173 #else174 _error2_("Petsc matrix format not usable, as Petsc has not been compiled!");175 172 #endif 176 173 } … … 179 176 } 180 177 else{ 181 _error 2_("Matrix type: " << type << " not supported yet!");178 _error_("Matrix type: " << type << " not supported yet!"); 182 179 } 183 180 } … … 191 188 #ifdef _HAVE_PETSC_ 192 189 norm=this->pmatrix->Norm(norm_type); 193 #else194 _error2_("Petsc matrix format not usable, as Petsc has not been compiled!");195 190 #endif 196 191 } … … 198 193 norm=this->smatrix->Norm(norm_type); 199 194 } 200 else _error 2_("Matrix type: " << type << " not supported yet!");195 else _error_("Matrix type: " << type << " not supported yet!"); 201 196 202 197 return norm; … … 209 204 #ifdef _HAVE_PETSC_ 210 205 this->pmatrix->GetSize(pM,pN); 211 #else212 _error2_("Petsc matrix format not usable, as Petsc has not been compiled!");213 206 #endif 214 207 } … … 216 209 this->smatrix->GetSize(pM,pN); 217 210 } 218 else _error 2_("Matrix type: " << type << " not supported yet!");211 else _error_("Matrix type: " << type << " not supported yet!"); 219 212 220 213 } … … 226 219 #ifdef _HAVE_PETSC_ 227 220 this->pmatrix->GetLocalSize(pM,pN); 228 #else229 _error2_("Petsc matrix format not usable, as Petsc has not been compiled!");230 221 #endif 231 222 } … … 233 224 this->smatrix->GetLocalSize(pM,pN); 234 225 } 235 else _error 2_("Matrix type: " << type << " not supported yet!");226 else _error_("Matrix type: " << type << " not supported yet!"); 236 227 237 228 } … … 243 234 #ifdef _HAVE_PETSC_ 244 235 this->pmatrix->MatMult(X->pvector,AX->pvector); 245 #else246 _error2_("Petsc matrix format not usable, as Petsc has not been compiled!");247 236 #endif 248 237 } … … 250 239 this->smatrix->MatMult(X->svector,AX->svector); 251 240 } 252 else _error 2_("Matrix type: " << type << " not supported yet!");241 else _error_("Matrix type: " << type << " not supported yet!"); 253 242 254 243 } … … 264 253 #ifdef _HAVE_PETSC_ 265 254 output->pmatrix=this->pmatrix->Duplicate(); 266 #else267 _error2_("Petsc matrix format not usable, as Petsc has not been compiled!");268 255 #endif 269 256 } … … 271 258 output->smatrix=this->smatrix->Duplicate(); 272 259 } 273 else _error 2_("Matrix type: " << type << " not supported yet!");260 else _error_("Matrix type: " << type << " not supported yet!"); 274 261 275 262 return output; … … 284 271 #ifdef _HAVE_PETSC_ 285 272 output=this->pmatrix->ToSerial(); 286 #else287 _error2_("Petsc matrix format not usable, as Petsc has not been compiled!");288 273 #endif 289 274 } … … 291 276 output=this->smatrix->ToSerial(); 292 277 } 293 else _error 2_("Matrix type: " << type << " not supported yet!");278 else _error_("Matrix type: " << type << " not supported yet!"); 294 279 295 280 … … 303 288 #ifdef _HAVE_PETSC_ 304 289 this->pmatrix->SetValues(m,idxm,n,idxn,values,mode); 305 #else306 _error2_("Petsc matrix format not usable, as Petsc has not been compiled!");307 290 #endif 308 291 } … … 310 293 this->smatrix->SetValues(m,idxm,n,idxn,values,mode); 311 294 } 312 else _error 2_("Matrix type: " << type << " not supported yet!");295 else _error_("Matrix type: " << type << " not supported yet!"); 313 296 } 314 297 /*}}}*/ … … 319 302 #ifdef _HAVE_PETSC_ 320 303 this->pmatrix->Convert(newtype); 321 #else322 _error2_("Petsc matrix format not usable, as Petsc has not been compiled!");323 304 #endif 324 305 } … … 327 308 } 328 309 else{ 329 _error 2_("Matrix type: " << type << " not supported yet!");330 } 331 332 } 333 /*}}}*/ 310 _error_("Matrix type: " << type << " not supported yet!"); 311 } 312 313 } 314 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/classes/matrix/Matrix.h
r12860 r13101 32 32 /*Matrix constructors, destructors {{{*/ 33 33 Matrix(); 34 #ifdef _HAVE_PETSC_ 34 35 Matrix(int M,int N,int type=PetscMatType); 35 36 Matrix(int M,int N,IssmDouble sparsity,int type=PetscMatType); 36 37 Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity,int type=PetscMatType); 37 38 Matrix(int M,int N,int connectivity,int numberofdofspernode,int type=PetscMatType); 39 #else 40 Matrix(int M,int N,int type=SeqMatType); 41 Matrix(int M,int N,IssmDouble sparsity,int type=SeqMatType); 42 Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity,int type=SeqMatType); 43 Matrix(int M,int N,int connectivity,int numberofdofspernode,int type=SeqMatType); 44 #endif 38 45 ~Matrix(); 39 46 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/classes/matrix/Vector.cpp
r12946 r13101 51 51 this->pvector=new PetscVec(M,fromlocalsize); 52 52 #else 53 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");53 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 54 54 #endif 55 55 } … … 57 57 this->svector=new SeqVec(M,fromlocalsize); 58 58 } 59 else _error 2_("Vector type: " << type << " not supported yet!");59 else _error_("Vector type: " << type << " not supported yet!"); 60 60 61 61 } … … 86 86 this->pvector=new PetscVec(serial_vec,M); 87 87 #else 88 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");88 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 89 89 #endif 90 90 } … … 92 92 this->svector=new SeqVec(serial_vec,M); 93 93 } 94 else _error 2_("Vector type: " << type << " not supported yet!");94 else _error_("Vector type: " << type << " not supported yet!"); 95 95 96 96 } … … 103 103 delete this->pvector; 104 104 #else 105 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");105 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 106 106 #endif 107 107 } … … 109 109 delete this->svector; 110 110 } 111 else _error 2_("Vector type: " << type << " not supported yet!");111 else _error_("Vector type: " << type << " not supported yet!"); 112 112 } 113 113 /*}}}*/ … … 121 121 this->pvector->Echo(); 122 122 #else 123 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");123 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 124 124 #endif 125 125 } … … 127 127 this->svector->Echo(); 128 128 } 129 else _error 2_("Vector type: " << type << " not supported yet!");129 else _error_("Vector type: " << type << " not supported yet!"); 130 130 131 131 } … … 138 138 this->pvector->Assemble(); 139 139 #else 140 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");140 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 141 141 #endif 142 142 } … … 144 144 this->svector->Assemble(); 145 145 } 146 else _error 2_("Vector type: " << type << " not supported yet!");146 else _error_("Vector type: " << type << " not supported yet!"); 147 147 148 148 } … … 156 156 this->pvector->SetValues(ssize,list,values,mode); 157 157 #else 158 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");158 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 159 159 #endif 160 160 } … … 162 162 this->svector->SetValues(ssize,list,values,mode); 163 163 } 164 else _error 2_("Vector type: " << type << " not supported yet!");164 else _error_("Vector type: " << type << " not supported yet!"); 165 165 166 166 … … 175 175 this->pvector->SetValue(dof,value,mode); 176 176 #else 177 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");177 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 178 178 #endif 179 179 } … … 181 181 this->svector->SetValue(dof,value,mode); 182 182 } 183 else _error 2_("Vector type: " << type << " not supported yet!");183 else _error_("Vector type: " << type << " not supported yet!"); 184 184 185 185 } … … 193 193 this->pvector->GetValue(pvalue,dof); 194 194 #else 195 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");195 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 196 196 #endif 197 197 } … … 199 199 this->svector->GetValue(pvalue,dof); 200 200 } 201 else _error 2_("Vector type: " << type << " not supported yet!");201 else _error_("Vector type: " << type << " not supported yet!"); 202 202 203 203 } … … 210 210 this->pvector->GetSize(pM); 211 211 #else 212 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");212 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 213 213 #endif 214 214 } … … 216 216 this->svector->GetSize(pM); 217 217 } 218 else _error 2_("Vector type: " << type << " not supported yet!");218 else _error_("Vector type: " << type << " not supported yet!"); 219 219 220 220 } … … 241 241 this->pvector->GetLocalSize(pM); 242 242 #else 243 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");243 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 244 244 #endif 245 245 } … … 247 247 this->svector->GetLocalSize(pM); 248 248 } 249 else _error 2_("Vector type: " << type << " not supported yet!");249 else _error_("Vector type: " << type << " not supported yet!"); 250 250 251 251 } … … 262 262 output->pvector=this->pvector->Duplicate(); 263 263 #else 264 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");264 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 265 265 #endif 266 266 } … … 269 269 output->svector=this->svector->Duplicate(); 270 270 } 271 else _error 2_("Vector type: " << type << " not supported yet!");271 else _error_("Vector type: " << type << " not supported yet!"); 272 272 273 273 return output; … … 283 283 this->pvector->Set(value); 284 284 #else 285 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");285 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 286 286 #endif 287 287 } … … 289 289 this->svector->Set(value); 290 290 } 291 else _error 2_("Vector type: " << type << " not supported yet!");291 else _error_("Vector type: " << type << " not supported yet!"); 292 292 293 293 } … … 301 301 this->pvector->AXPY(X->pvector,a); 302 302 #else 303 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");303 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 304 304 #endif 305 305 } … … 307 307 this->svector->AXPY(X->svector,a); 308 308 } 309 else _error 2_("Vector type: " << type << " not supported yet!");309 else _error_("Vector type: " << type << " not supported yet!"); 310 310 311 311 } … … 319 319 this->pvector->AYPX(X->pvector,a); 320 320 #else 321 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");321 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 322 322 #endif 323 323 } … … 325 325 this->svector->AYPX(X->svector,a); 326 326 } 327 else _error 2_("Vector type: " << type << " not supported yet!");327 else _error_("Vector type: " << type << " not supported yet!"); 328 328 329 329 … … 339 339 vec_serial=this->pvector->ToMPISerial(); 340 340 #else 341 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");341 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 342 342 #endif 343 343 } … … 345 345 vec_serial=this->svector->ToMPISerial(); 346 346 } 347 else _error 2_("Vector type: " << type << " not supported yet!");347 else _error_("Vector type: " << type << " not supported yet!"); 348 348 349 349 return vec_serial; … … 359 359 this->pvector->Copy(to->pvector); 360 360 #else 361 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");361 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 362 362 #endif 363 363 } … … 365 365 this->svector->Copy(to->svector); 366 366 } 367 else _error 2_("Vector type: " << type << " not supported yet!");367 else _error_("Vector type: " << type << " not supported yet!"); 368 368 369 369 … … 379 379 norm=this->pvector->Norm(norm_type); 380 380 #else 381 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");381 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 382 382 #endif 383 383 } … … 385 385 norm=this->svector->Norm(norm_type); 386 386 } 387 else _error 2_("Vector type: " << type << " not supported yet!");387 else _error_("Vector type: " << type << " not supported yet!"); 388 388 389 389 return norm; … … 398 398 this->pvector->Scale(scale_factor); 399 399 #else 400 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");400 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 401 401 #endif 402 402 } … … 404 404 this->svector->Scale(scale_factor); 405 405 } 406 else _error 2_("Vector type: " << type << " not supported yet!");406 else _error_("Vector type: " << type << " not supported yet!"); 407 407 408 408 } … … 417 417 dot=this->pvector->Dot(vector->pvector); 418 418 #else 419 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");419 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 420 420 #endif 421 421 } … … 423 423 dot=this->svector->Dot(vector->svector); 424 424 } 425 else _error 2_("Vector type: " << type << " not supported yet!");425 else _error_("Vector type: " << type << " not supported yet!"); 426 426 427 427 return dot; … … 436 436 this->pvector->PointwiseDivide(x->pvector,y->pvector); 437 437 #else 438 _error 2_("Petsc matrix format not usable, as Petsc has not been compiled!");438 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 439 439 #endif 440 440 } … … 442 442 this->svector->PointwiseDivide(x->svector,y->svector); 443 443 } 444 else _error 2_("Vector type: " << type << " not supported yet!");445 446 } 447 /*}}}*/ 444 else _error_("Vector type: " << type << " not supported yet!"); 445 446 } 447 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/classes/matrix/Vector.h
r12946 r13101 34 34 /*Vector constructors, destructors {{{*/ 35 35 Vector(); 36 #ifdef _HAVE_PETSC_ 37 Vector(Vec petsc_vector); 36 38 Vector(int M,bool fromlocalsize=false,int type=PetscVecType); 37 39 Vector(IssmDouble* serial_vec,int pM,int type=PetscVecType); 38 #ifdef _HAVE_PETSC_ 39 Vector(Vec petsc_vector); 40 #else 41 Vector(int M,bool fromlocalsize=false,int type=SeqVecType); 42 Vector(IssmDouble* serial_vec,int pM,int type=SeqVecType); 40 43 #endif 44 41 45 ~Vector(); 42 46 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Constraints/SpcTransient.cpp
r12832 r13101 146 146 } 147 147 148 if(!found)_error 2_("could not find time segment for constraint");148 if(!found)_error_("could not find time segment for constraint"); 149 149 150 150 /*Apply or relax constraint: */ -
issm/branches/trunk-jpl-damage/src/c/classes/objects/ElementResults/BoolElementResult.cpp
r12832 r13101 128 128 void BoolElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){ 129 129 130 _error 2_("cannot return vector on vertices");130 _error_("cannot return vector on vertices"); 131 131 } /*}}}*/ 132 132 /*FUNCTION BoolElementResult::GetElementVectorFromResults{{{*/ -
issm/branches/trunk-jpl-damage/src/c/classes/objects/ElementResults/PentaP1ElementResult.cpp
r12832 r13101 142 142 IssmDouble data[6]; 143 143 144 if(numdofs!=6)_error 2_("Result " << EnumToStringx(this->enum_type) << " is a PentaP1ElementResult and cannot write vector of " << numdofs << " dofs");144 if(numdofs!=6)_error_("Result " << EnumToStringx(this->enum_type) << " is a PentaP1ElementResult and cannot write vector of " << numdofs << " dofs"); 145 145 for(int i=0;i<6;i++) data[i]=this->values[i]/(IssmDouble)connectivitylist[i]; 146 146 vector->SetValues(numdofs,doflist,&data[0],ADD_VAL); … … 150 150 void PentaP1ElementResult::GetElementVectorFromResults(Vector* vector,int dof){ 151 151 152 _error 2_("Result " << EnumToStringx(enum_type) << " is a PentaP1ElementResult and should not write vector of size numberofelemenrs");152 _error_("Result " << EnumToStringx(enum_type) << " is a PentaP1ElementResult and should not write vector of size numberofelemenrs"); 153 153 } /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/classes/objects/ElementResults/TriaP1ElementResult.cpp
r12832 r13101 130 130 IssmDouble data[3]; 131 131 132 if(numdofs!=3)_error 2_("Result " << EnumToStringx(this->enum_type) << " is a TriaP1ElementResult and cannot write vector of " << numdofs << " dofs");132 if(numdofs!=3)_error_("Result " << EnumToStringx(this->enum_type) << " is a TriaP1ElementResult and cannot write vector of " << numdofs << " dofs"); 133 133 for(int i=0;i<3;i++) data[i]=this->values[i]/(IssmDouble)connectivitylist[i]; 134 134 vector->SetValues(numdofs,doflist,&data[0],ADD_VAL); … … 137 137 /*FUNCTION TriaP1ElementResult::GetElementVectorFromResults{{{*/ 138 138 void TriaP1ElementResult::GetElementVectorFromResults(Vector* vector,int dof){ 139 _error 2_("Result " << EnumToStringx(enum_type) << " is a TriaP1ElementResult and should not write vector of size numberofelemenrs");139 _error_("Result " << EnumToStringx(enum_type) << " is a TriaP1ElementResult and should not write vector of size numberofelemenrs"); 140 140 } /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Elements/Penta.cpp
r12946 r13101 67 67 /*Build neighbors list*/ 68 68 if (xIsNan<IssmDouble>(iomodel->Data(MeshUpperelementsEnum)[index])) penta_elements_ids[1]=this->id; //upper penta is the same penta 69 else penta_elements_ids[1]= (int)(iomodel->Data(MeshUpperelementsEnum)[index]);69 else penta_elements_ids[1]=reCast<int,IssmDouble>((iomodel->Data(MeshUpperelementsEnum)[index])); 70 70 if (xIsNan<IssmDouble>(iomodel->Data(MeshLowerelementsEnum)[index])) penta_elements_ids[0]=this->id; //lower penta is the same penta 71 else penta_elements_ids[0]= (int)(iomodel->Data(MeshLowerelementsEnum)[index]);71 else penta_elements_ids[0]=reCast<int,IssmDouble>((iomodel->Data(MeshLowerelementsEnum)[index])); 72 72 this->InitHookNeighbors(penta_elements_ids); 73 73 74 74 /*Build horizontalneighborsids list: */ 75 75 _assert_(iomodel->Data(MeshElementconnectivityEnum)); 76 for(i=0;i<3;i++) this->horizontalneighborsids[i]= (int)iomodel->Data(MeshElementconnectivityEnum)[3*index+i]-1;76 for(i=0;i<3;i++) this->horizontalneighborsids[i]=reCast<int,IssmDouble>(iomodel->Data(MeshElementconnectivityEnum)[3*index+i])-1; 77 77 78 78 //this->parameters: we still can't point to it, it may not even exist. Configure will handle this. … … 146 146 /*FUNCTION Penta::AverageOntoPartition {{{*/ 147 147 void Penta::AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){ 148 _error 2_("Not supported yet!");148 _error_("Not supported yet!"); 149 149 } 150 150 /*}}}*/ … … 252 252 253 253 /*Check analysis_types*/ 254 if (analysis_type!=DiagnosticHorizAnalysisEnum) _error 2_("Not supported yet!");255 if (approximation!=StokesApproximationEnum) _error 2_("Not supported yet!");254 if (analysis_type!=DiagnosticHorizAnalysisEnum) _error_("Not supported yet!"); 255 if (approximation!=StokesApproximationEnum) _error_("Not supported yet!"); 256 256 257 257 /*retrieve some parameters: */ … … 318 318 void Penta::ComputeStrainRate(Vector* eps){ 319 319 320 _error 2_("Not implemented yet");320 _error_("Not implemented yet"); 321 321 322 322 } … … 442 442 #endif 443 443 case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum: 444 Ke=Create KMatrixSlope();444 Ke=CreateBasalMassMatrix(); 445 445 break; 446 446 case PrognosticAnalysisEnum: … … 464 464 #endif 465 465 default: 466 _error 2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");466 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 467 467 } 468 468 … … 500 500 } 501 501 /*}}}*/ 502 /*FUNCTION Penta::Create KMatrixSlope{{{*/503 ElementMatrix* Penta::Create KMatrixSlope(void){502 /*FUNCTION Penta::CreateBasalMassMatrix{{{*/ 503 ElementMatrix* Penta::CreateBasalMassMatrix(void){ 504 504 505 505 if (!IsOnBed()) return NULL; 506 506 507 507 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 508 ElementMatrix* Ke=tria->Create KMatrixSlope();508 ElementMatrix* Ke=tria->CreateMassMatrix(); 509 509 delete tria->matice; delete tria; 510 510 … … 569 569 #endif 570 570 default: 571 _error 2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");571 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 572 572 } 573 573 … … 638 638 #endif 639 639 default: 640 _error 2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");640 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 641 641 } 642 642 … … 888 888 return i; 889 889 } 890 _error 2_("Node provided not found among element nodes");890 _error_("Node provided not found among element nodes"); 891 891 892 892 } … … 901 901 /*Recover input*/ 902 902 Input* input=inputs->GetInput(enumtype); 903 if (!input) _error 2_("Input " << EnumToStringx(enumtype) << " not found in element");903 if (!input) _error_("Input " << EnumToStringx(enumtype) << " not found in element"); 904 904 905 905 /*Checks in debugging mode*/ … … 950 950 951 951 Input* input=inputs->GetInput(enumtype); 952 if(!input) _error 2_("No input of type " << EnumToStringx(enumtype) << " found in tria");952 if(!input) _error_("No input of type " << EnumToStringx(enumtype) << " found in tria"); 953 953 954 954 GaussPenta* gauss=new GaussPenta(); … … 1045 1045 #endif 1046 1046 default: 1047 _error 2_("analysis: " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");1047 _error_("analysis: " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 1048 1048 } 1049 1049 } … … 1085 1085 /*Check that both inputs have been found*/ 1086 1086 if (!vx_input || !vy_input){ 1087 _error 2_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << "\n");1087 _error_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << "\n"); 1088 1088 } 1089 1089 … … 1110 1110 /*Check that both inputs have been found*/ 1111 1111 if (!vx_input || !vy_input || !vz_input){ 1112 _error 2_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << ", vz: " << vz_input << "\n");1112 _error_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << ", vz: " << vz_input << "\n"); 1113 1113 } 1114 1114 … … 1145 1145 /*Get input (either in element or material)*/ 1146 1146 Input* input=inputs->GetInput(input_enum); 1147 if(!input) _error 2_("Input " << EnumToStringx(input_enum) << " not found in element");1147 if(!input) _error_("Input " << EnumToStringx(input_enum) << " not found in element"); 1148 1148 1149 1149 /*We found the enum. Use its values to fill into the vector, using the vertices ids: */ … … 1157 1157 ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(offset); 1158 1158 if(elementresult->InstanceEnum()!=enum_in){ 1159 _error_("Results of offset %i is %s, when %s was expected",offset,EnumToStringx(elementresult->InstanceEnum()),EnumToStringx(enum_in));1159 _error_("Results of offset "<<offset<<" is "<<EnumToStringx(elementresult->InstanceEnum())<<" when "<<EnumToStringx(enum_in)<<" was expected"); 1160 1160 } 1161 1161 if(interp==P1Enum){ … … 1208 1208 /*Make a copy of the original input: */ 1209 1209 input=(Input*)this->inputs->GetInput(enum_type); 1210 if(!input)_error 2_("could not find old input with enum: " << EnumToStringx(enum_type));1210 if(!input)_error_("could not find old input with enum: " << EnumToStringx(enum_type)); 1211 1211 1212 1212 /*ArtificialNoise: */ … … 1228 1228 new_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+0]); 1229 1229 old_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+1]); 1230 if(!new_inputs[i])_error 2_("could not find input with enum " << EnumToStringx(enums[2*i+0]));1231 if(!old_inputs[i])_error 2_("could not find input with enum " << EnumToStringx(enums[2*i+0]));1230 if(!new_inputs[i])_error_("could not find input with enum " << EnumToStringx(enums[2*i+0])); 1231 if(!old_inputs[i])_error_("could not find input with enum " << EnumToStringx(enums[2*i+0])); 1232 1232 } 1233 1233 … … 1253 1253 1254 1254 if ((code==5) || (code==1)){ //boolean 1255 this->inputs->AddInput(new BoolInput(name, (bool)scalar));1255 this->inputs->AddInput(new BoolInput(name,reCast<bool,IssmDouble>(scalar))); 1256 1256 } 1257 1257 else if ((code==6) || (code==2)){ //integer 1258 this->inputs->AddInput(new IntInput(name, (int)scalar));1258 this->inputs->AddInput(new IntInput(name,reCast<int,IssmDouble>(scalar))); 1259 1259 } 1260 1260 else if ((code==7) || (code==3)){ //IssmDouble 1261 this->inputs->AddInput(new DoubleInput(name, (IssmDouble)scalar));1262 } 1263 else _error 2_("could not recognize nature of vector from code " << code);1261 this->inputs->AddInput(new DoubleInput(name,scalar)); 1262 } 1263 else _error_("could not recognize nature of vector from code " << code); 1264 1264 1265 1265 } … … 1291 1291 for(i=0;i<6;i++){ 1292 1292 _assert_(iomodel->Data(MeshElementsEnum)); 1293 penta_vertex_ids[i]= (int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab1293 penta_vertex_ids[i]=reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[6*index+i]); //ids for vertices are in the elements array from Matlab 1294 1294 } 1295 1295 … … 1327 1327 this->inputs->AddInput(transientinput); 1328 1328 } 1329 else _error 2_("nodal vector is either numberofnodes (" << numberofvertices << "), or numberofnodes+1 long. Field provided is " << M << " long. Enum " << EnumToStringx(vector_enum));1329 else _error_("nodal vector is either numberofnodes (" << numberofvertices << "), or numberofnodes+1 long. Field provided is " << M << " long. Enum " << EnumToStringx(vector_enum)); 1330 1330 } 1331 1331 else if(vector_type==2){ //element vector … … 1336 1336 1337 1337 if (code==5){ //boolean 1338 this->inputs->AddInput(new BoolInput(vector_enum, (bool)vector[index]));1338 this->inputs->AddInput(new BoolInput(vector_enum,reCast<bool,IssmDouble>(vector[index]))); 1339 1339 } 1340 1340 else if (code==6){ //integer 1341 this->inputs->AddInput(new IntInput(vector_enum, (int)vector[index]));1341 this->inputs->AddInput(new IntInput(vector_enum,reCast<int,IssmDouble>(vector[index]))); 1342 1342 } 1343 1343 else if (code==7){ //IssmDouble 1344 this->inputs->AddInput(new DoubleInput(vector_enum, (IssmDouble)vector[index]));1344 this->inputs->AddInput(new DoubleInput(vector_enum,vector[index])); 1345 1345 } 1346 else _error 2_("could not recognize nature of vector from code " << code);1346 else _error_("could not recognize nature of vector from code " << code); 1347 1347 } 1348 1348 else { 1349 _error 2_("transient elementary inputs not supported yet!");1349 _error_("transient elementary inputs not supported yet!"); 1350 1350 } 1351 1351 } 1352 1352 else{ 1353 _error 2_("Cannot add input for vector type " << vector_type << " (not supported)");1353 _error_("Cannot add input for vector type " << vector_type << " (not supported)"); 1354 1354 } 1355 1355 … … 1390 1390 original_input=(Input*)penta->matice->inputs->GetInput(enum_type); 1391 1391 else 1392 _error 2_("object " << EnumToStringx(object_enum) << " not supported yet");1393 if(!original_input) _error 2_("could not find input with enum " << EnumToStringx(enum_type));1392 _error_("object " << EnumToStringx(object_enum) << " not supported yet"); 1393 if(!original_input) _error_("could not find input with enum " << EnumToStringx(enum_type)); 1394 1394 1395 1395 /*If first time, initialize total_integrated_input*/ … … 1402 1402 total_integrated_input=new DoubleInput(average_enum_type,0.0); 1403 1403 else 1404 _error 2_("object " << EnumToStringx(original_input->ObjectEnum()) << " not supported yet");1404 _error_("object " << EnumToStringx(original_input->ObjectEnum()) << " not supported yet"); 1405 1405 } 1406 1406 … … 1450 1450 this->matice->inputs->AddInput((Input*)depth_averaged_input); 1451 1451 else 1452 _error 2_("object " << EnumToStringx(object_enum) << " not supported yet");1452 _error_("object " << EnumToStringx(object_enum) << " not supported yet"); 1453 1453 } 1454 1454 /*}}}*/ … … 1491 1491 } 1492 1492 else{ 1493 _error 2_("object of type " << EnumToStringx(object_type) << " not supported yet");1493 _error_("object of type " << EnumToStringx(object_type) << " not supported yet"); 1494 1494 } 1495 1495 for(i=0;i<num_inputs;i++){ 1496 if(!base_inputs[i]) _error 2_("could not find input with enum " << EnumToStringx(enum_type) << " in object " << EnumToStringx(object_type));1496 if(!base_inputs[i]) _error_("could not find input with enum " << EnumToStringx(enum_type) << " in object " << EnumToStringx(object_type)); 1497 1497 base_inputs[i]->Extrude(); 1498 1498 } … … 1521 1521 } 1522 1522 else{ 1523 _error 2_("object of type " << EnumToStringx(object_type) << " not supported yet");1523 _error_("object of type " << EnumToStringx(object_type) << " not supported yet"); 1524 1524 } 1525 1525 } … … 1540 1540 /*Make a copy of the original input: */ 1541 1541 input=(Input*)this->inputs->GetInput(enum_type); 1542 if(!input)_error 2_("could not find old input with enum: " << EnumToStringx(enum_type));1542 if(!input)_error_("could not find old input with enum: " << EnumToStringx(enum_type)); 1543 1543 1544 1544 /*Scale: */ … … 1556 1556 if (enum_type==MaterialsRheologyBbarEnum) input=this->matice->inputs->GetInput(MaterialsRheologyBEnum); 1557 1557 else input=this->inputs->GetInput(enum_type); 1558 //if (!input) _error 2_("Input " << EnumToStringx(enum_type) << " not found in penta->inputs"); why error out? if the requested input does not exist, we should still1558 //if (!input) _error_("Input " << EnumToStringx(enum_type) << " not found in penta->inputs"); why error out? if the requested input does not exist, we should still 1559 1559 //try and output whatever we can instead of just failing. 1560 1560 if(!input)return; … … 1626 1626 /*Recover vertices ids needed to initialize inputs*/ 1627 1627 for(i=0;i<6;i++){ 1628 penta_vertex_ids[i]= (int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab1628 penta_vertex_ids[i]=reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[6*index+i]); //ids for vertices are in the elements array from Matlab 1629 1629 } 1630 1630 … … 1633 1633 if (control_analysis && iomodel->Data(InversionControlParametersEnum)){ 1634 1634 for(i=0;i<num_control_type;i++){ 1635 switch( (int)iomodel->Data(InversionControlParametersEnum)[i]){1635 switch(reCast<int,IssmDouble>(iomodel->Data(InversionControlParametersEnum)[i])){ 1636 1636 case BalancethicknessThickeningRateEnum: 1637 1637 if (iomodel->Data(BalancethicknessThickeningRateEnum)){ … … 1669 1669 /*Matice will take care of it*/ break; 1670 1670 default: 1671 _error 2_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");1671 _error_("Control " << EnumToStringx(reCast<int,IssmDouble>(iomodel->Data(InversionControlParametersEnum)[i])) << " not implemented yet"); 1672 1672 } 1673 1673 } … … 1677 1677 //Need to know the type of approximation for this element 1678 1678 if(iomodel->Data(FlowequationElementEquationEnum)){ 1679 if ( *(iomodel->Data(FlowequationElementEquationEnum)+index)==MacAyealApproximationEnum){1679 if (iomodel->Data(FlowequationElementEquationEnum)[index]==MacAyealApproximationEnum){ 1680 1680 this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealApproximationEnum)); 1681 1681 } 1682 else if ( *(iomodel->Data(FlowequationElementEquationEnum)+index)==PattynApproximationEnum){1682 else if (iomodel->Data(FlowequationElementEquationEnum)[index]==PattynApproximationEnum){ 1683 1683 this->inputs->AddInput(new IntInput(ApproximationEnum,PattynApproximationEnum)); 1684 1684 } 1685 else if ( *(iomodel->Data(FlowequationElementEquationEnum)+index)==MacAyealPattynApproximationEnum){1685 else if (iomodel->Data(FlowequationElementEquationEnum)[index]==MacAyealPattynApproximationEnum){ 1686 1686 this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealPattynApproximationEnum)); 1687 1687 } 1688 else if ( *(iomodel->Data(FlowequationElementEquationEnum)+index)==HutterApproximationEnum){1688 else if (iomodel->Data(FlowequationElementEquationEnum)[index]==HutterApproximationEnum){ 1689 1689 this->inputs->AddInput(new IntInput(ApproximationEnum,HutterApproximationEnum)); 1690 1690 } 1691 else if (*(iomodel->Data(FlowequationElementEquationEnum)+index)==StokesApproximationEnum){ 1691 else if (iomodel->Data(FlowequationElementEquationEnum)[index]==L1L2ApproximationEnum){ 1692 this->inputs->AddInput(new IntInput(ApproximationEnum,L1L2ApproximationEnum)); 1693 } 1694 else if (iomodel->Data(FlowequationElementEquationEnum)[index]==StokesApproximationEnum){ 1692 1695 this->inputs->AddInput(new IntInput(ApproximationEnum,StokesApproximationEnum)); 1693 1696 } 1694 else if ( *(iomodel->Data(FlowequationElementEquationEnum)+index)==MacAyealStokesApproximationEnum){1697 else if (iomodel->Data(FlowequationElementEquationEnum)[index]==MacAyealStokesApproximationEnum){ 1695 1698 this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealStokesApproximationEnum)); 1696 1699 } 1697 else if ( *(iomodel->Data(FlowequationElementEquationEnum)+index)==PattynStokesApproximationEnum){1700 else if (iomodel->Data(FlowequationElementEquationEnum)[index]==PattynStokesApproximationEnum){ 1698 1701 this->inputs->AddInput(new IntInput(ApproximationEnum,PattynStokesApproximationEnum)); 1699 1702 } 1700 else if ( *(iomodel->Data(FlowequationElementEquationEnum)+index)==NoneApproximationEnum){1703 else if (iomodel->Data(FlowequationElementEquationEnum)[index]==NoneApproximationEnum){ 1701 1704 this->inputs->AddInput(new IntInput(ApproximationEnum,NoneApproximationEnum)); 1702 1705 } 1703 1706 else{ 1704 _error 2_("Approximation type " << EnumToStringx((int)*(iomodel->Data(FlowequationElementEquationEnum)+index)) << " not supported yet");1707 _error_("Approximation type " << EnumToStringx(reCast<int,IssmDouble>(iomodel->Data(FlowequationElementEquationEnum)[index])) << " not supported yet"); 1705 1708 } 1706 1709 } … … 1786 1789 #endif 1787 1790 default: 1788 _error 2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");1791 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 1789 1792 } 1790 1793 } … … 1817 1820 for(i=0;i<numdof2d;i++){ 1818 1821 newthickness[i]=solution[doflist[i]]; 1819 if(xIsNan<IssmDouble>(newthickness[i])) _error 2_("NaN found in solution vector");1822 if(xIsNan<IssmDouble>(newthickness[i])) _error_("NaN found in solution vector"); 1820 1823 /*Constrain thickness to be at least 1m*/ 1821 1824 if(newthickness[i]<minthickness) newthickness[i]=minthickness; … … 1850 1853 newbed[i]=oldbed[i]-rho_ice/rho_water*(newthickness[i]-oldthickness[i]); //bed = oldbed + di * dH 1851 1854 } 1852 else _error 2_("Hydrostatic adjustment " << hydroadjustment << " (" << EnumToStringx(hydroadjustment) << ") not supported yet");1855 else _error_("Hydrostatic adjustment " << hydroadjustment << " (" << EnumToStringx(hydroadjustment) << ") not supported yet"); 1853 1856 } 1854 1857 } … … 1887 1890 for(int i=0;i<numdof;i++){ 1888 1891 values[i]=solution[doflist[i]]; 1889 if(xIsNan<IssmDouble>(values[i])) _error 2_("NaN found in solution vector");1892 if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector"); 1890 1893 } 1891 1894 … … 1917 1920 values[i] =solution[doflist[i]]; 1918 1921 values[i+numdof2d]=values[i]; 1919 if(xIsNan<IssmDouble>(values[i])) _error 2_("NaN found in solution vector");1922 if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector"); 1920 1923 } 1921 1924 … … 1948 1951 1949 1952 case VertexEnum: 1950 1951 /*New PentaVertexInpu*/ 1952 IssmDouble values[6]; 1953 1954 /*Get values on the 6 vertices*/ 1955 for (int i=0;i<6;i++){ 1956 values[i]=vector[this->nodes[i]->GetVertexDof()]; 1953 { 1954 1955 /*New PentaVertexInpu*/ 1956 IssmDouble values[6]; 1957 1958 /*Get values on the 6 vertices*/ 1959 for (int i=0;i<6;i++){ 1960 values[i]=vector[this->nodes[i]->GetVertexDof()]; 1961 } 1962 1963 /*update input*/ 1964 this->inputs->AddInput(new PentaP1Input(name,values)); 1965 return; 1966 break; 1957 1967 } 1958 1968 1959 /*update input*/1960 this->inputs->AddInput(new PentaP1Input(name,values));1961 return;1962 1963 1969 default: 1964 1970 1965 _error 2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");1971 _error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet"); 1966 1972 } 1967 1973 } … … 1969 1975 /*FUNCTION Penta::InputUpdateFromVector(int* vector, int name, int type);{{{*/ 1970 1976 void Penta::InputUpdateFromVector(int* vector, int name, int type){ 1971 _error 2_("not supported yet!");1977 _error_("not supported yet!"); 1972 1978 } 1973 1979 /*}}}*/ 1974 1980 /*FUNCTION Penta::InputUpdateFromVector(bool* vector, int name, int type);{{{*/ 1975 1981 void Penta::InputUpdateFromVector(bool* vector, int name, int type){ 1976 _error 2_("not supported yet!");1982 _error_("not supported yet!"); 1977 1983 } 1978 1984 /*}}}*/ … … 2060 2066 2061 2067 for(i=0;i<NUMVERTICES;i++){ 2062 if ( flags[nodes[i]->Sid()]){2068 if (reCast<bool,IssmDouble>(flags[nodes[i]->Sid()])){ 2063 2069 shelf=true; 2064 2070 break; … … 2161 2167 for(i=0;i<NUMVERTICES;i++){ 2162 2168 /*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */ 2163 if( old_floating_ice[nodes[i]->Sid()]){2169 if(reCast<bool,IssmDouble>(old_floating_ice[nodes[i]->Sid()])){ 2164 2170 if(b[i]<=ba[i]){ 2165 2171 b[i]=ba[i]; … … 2181 2187 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false)); 2182 2188 } 2183 else if(migration_style==SoftMigrationEnum && sheet_ungrounding[nodes[i]->Sid()]){2189 else if(migration_style==SoftMigrationEnum && reCast<int,IssmDouble>(sheet_ungrounding[nodes[i]->Sid()])){ 2184 2190 s[i]=(1-density)*h[i]; 2185 2191 b[i]=-density*h[i]; … … 2575 2581 void Penta::SetClone(int* minranks){ 2576 2582 2577 _error 2_("not implemented yet");2583 _error_("not implemented yet"); 2578 2584 } 2579 2585 /*}}}*/ … … 2801 2807 2802 2808 /*Intermediaries*/ 2803 IssmInt i,j;2804 int penta_type;2805 int penta_node_ids[6];2806 int penta_vertex_ids[6];2807 IssmDouble 2808 IssmDouble 2809 int stabilization;2810 bool dakota_analysis;2811 bool isstokes;2812 IssmDouble 2809 IssmInt i,j; 2810 int penta_type; 2811 int penta_node_ids[6]; 2812 int penta_vertex_ids[6]; 2813 IssmDouble nodeinputs[6]; 2814 IssmDouble yts; 2815 int stabilization; 2816 bool dakota_analysis; 2817 bool isstokes; 2818 IssmDouble beta,heatcapacity,referencetemperature,meltingpoint,latentheat; 2813 2819 2814 2820 /*Fetch parameters: */ … … 2840 2846 2841 2847 /*Recover vertices ids needed to initialize inputs*/ 2842 for(i=0;i<6;i++) penta_vertex_ids[i]= (int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab2848 for(i=0;i<6;i++) penta_vertex_ids[i]=reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[6*index+i]); //ids for vertices are in the elements array from Matlab 2843 2849 2844 2850 /*Recover nodes ids needed to initialize the node hook.*/ … … 2846 2852 //go recover node ids, needed to initialize the node hook. 2847 2853 //WARNING: We assume P1 elements here!!!!! 2848 penta_node_ids[i]=iomodel->nodecounter+ (int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab2854 penta_node_ids[i]=iomodel->nodecounter+reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[6*index+i]); //ids for vertices are in the elements array from Matlab 2849 2855 } 2850 2856 … … 2942 2948 this->inputs->AddInput(new PentaP1Input(EnthalpyEnum,nodeinputs)); 2943 2949 } 2944 else _error 2_("temperature and waterfraction required for the enthalpy solution");2950 else _error_("temperature and waterfraction required for the enthalpy solution"); 2945 2951 break; 2946 2952 … … 2959 2965 /*Go through nodes, and whoever is on the potential_sheet_ungrounding, ends up in nodes_on_iceshelf: */ 2960 2966 for(i=0;i<NUMVERTICES;i++){ 2961 if ( vertices_potentially_ungrounding[nodes[i]->Sid()]){2967 if (reCast<bool,IssmDouble>(vertices_potentially_ungrounding[nodes[i]->Sid()])){ 2962 2968 vec_nodes_on_iceshelf->SetValue(nodes[i]->Sid(),1,INS_VAL); 2963 2969 … … 3021 3027 /*FUNCTION Penta::SmearFunction {{{*/ 3022 3028 void Penta::SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){ 3023 _error 2_("not implemented yet");3029 _error_("not implemented yet"); 3024 3030 } 3025 3031 /*}}}*/ … … 3225 3231 break; 3226 3232 case VelEnum: 3227 3228 /*Get input:*/ 3229 IssmDouble vel; 3230 Input* vel_input; 3231 3232 vel_input=this->inputs->GetInput(VelEnum); _assert_(vel_input); 3233 vel_input->GetInputAverage(&vel); 3234 3235 /*process units if requested: */ 3236 if(process_units) vel=UnitConversion(vel,IuToExtEnum,VelEnum); 3237 3238 /*Assign output pointers:*/ 3239 *presponse=vel; 3233 { 3234 3235 /*Get input:*/ 3236 IssmDouble vel; 3237 Input* vel_input; 3238 3239 vel_input=this->inputs->GetInput(VelEnum); _assert_(vel_input); 3240 vel_input->GetInputAverage(&vel); 3241 3242 /*process units if requested: */ 3243 if(process_units) vel=UnitConversion(vel,IuToExtEnum,VelEnum); 3244 3245 /*Assign output pointers:*/ 3246 *presponse=vel; 3247 } 3248 break; 3240 3249 default: 3241 _error 2_("Response type " << EnumToStringx(response_enum) << " not supported yet!");3250 _error_("Response type " << EnumToStringx(response_enum) << " not supported yet!"); 3242 3251 } 3243 3252 … … 3362 3371 kappa=matpar->GetEnthalpyDiffusionParameter(enthalpy,pressure); 3363 3372 D_scalar_conduct=gauss->weight*Jdet*kappa; 3364 if( dt) D_scalar_conduct=D_scalar_conduct*dt;3373 if(reCast<bool,IssmDouble>(dt)) D_scalar_conduct=D_scalar_conduct*dt; 3365 3374 3366 3375 D[0][0]=D_scalar_conduct; D[0][1]=0; D[0][2]=0; … … 3382 3391 3383 3392 D_scalar_advec=gauss->weight*Jdet; 3384 if( dt) D_scalar_advec=D_scalar_advec*dt;3393 if(reCast<bool,IssmDouble>(dt)) D_scalar_advec=D_scalar_advec*dt; 3385 3394 3386 3395 D[0][0]=D_scalar_advec*vx;D[0][1]=0; D[0][2]=0; … … 3394 3403 3395 3404 /*Transient: */ 3396 if( dt){3405 if(reCast<bool,IssmDouble>(dt)){ 3397 3406 GetNodalFunctionsP1(&L[0], gauss); 3398 3407 D_scalar_trans=gauss->weight*Jdet; … … 3415 3424 K[2][0]=h/(2*vel)*vz*vx; K[2][1]=h/(2*vel)*vz*vy; K[2][2]=h/(2*vel)*vz*vz; 3416 3425 D_scalar_stab=gauss->weight*Jdet; 3417 if( dt) D_scalar_stab=D_scalar_stab*dt;3426 if(reCast<bool,IssmDouble>(dt)) D_scalar_stab=D_scalar_stab*dt; 3418 3427 for(i=0;i<3;i++) for(j=0;j<3;j++) K[i][j] = D_scalar_stab*K[i][j]; 3419 3428 … … 3435 3444 } 3436 3445 } 3437 if( dt){3446 if(reCast<bool,IssmDouble>(dt)){ 3438 3447 for(i=0;i<numdof;i++){ 3439 3448 for(j=0;j<numdof;j++){ … … 3491 3500 3492 3501 D_scalar=gauss->weight*Jdet2d*rho_water*mixed_layer_capacity*thermal_exchange_velocity/(rho_ice*heatcapacity); 3493 if( dt) D_scalar=dt*D_scalar;3502 if(reCast<bool,IssmDouble>(dt)) D_scalar=dt*D_scalar; 3494 3503 3495 3504 TripleMultiply(&basis[0],numdof,1,0, … … 3591 3600 3592 3601 D_scalar_conduct=gauss->weight*Jdet*kappa; 3593 if( dt) D_scalar_conduct=D_scalar_conduct*dt;3602 if(reCast<bool,IssmDouble>(dt)) D_scalar_conduct=D_scalar_conduct*dt; 3594 3603 3595 3604 D[0][0]=D_scalar_conduct; D[0][1]=0; D[0][2]=0; … … 3612 3621 3613 3622 D_scalar_advec=gauss->weight*Jdet; 3614 if( dt) D_scalar_advec=D_scalar_advec*dt;3623 if(reCast<bool,IssmDouble>(dt)) D_scalar_advec=D_scalar_advec*dt; 3615 3624 3616 3625 D[0][0]=D_scalar_advec*vx; D[0][1]=0; D[0][2]=0; … … 3624 3633 3625 3634 /*Transient: */ 3626 if( dt){3635 if(reCast<bool,IssmDouble>(dt)){ 3627 3636 GetNodalFunctionsP1(&L[0], gauss); 3628 3637 D_scalar_trans=gauss->weight*Jdet; … … 3647 3656 3648 3657 D_scalar_stab=gauss->weight*Jdet; 3649 if( dt) D_scalar_stab=D_scalar_stab*dt;3658 if(reCast<bool,IssmDouble>(dt)) D_scalar_stab=D_scalar_stab*dt; 3650 3659 for(i=0;i<3;i++) for(j=0;j<3;j++) K[i][j] = D_scalar_stab*K[i][j]; 3651 3660 … … 3667 3676 } 3668 3677 } 3669 if( dt){3678 if(reCast<bool,IssmDouble>(dt)){ 3670 3679 for(i=0;i<numdof;i++){ 3671 3680 for(j=0;j<numdof;j++){ … … 3724 3733 3725 3734 D_scalar=gauss->weight*Jdet2d*rho_water*mixed_layer_capacity*thermal_exchange_velocity/(heatcapacity*rho_ice); 3726 if( dt) D_scalar=dt*D_scalar;3735 if(reCast<bool,IssmDouble>(dt)) D_scalar=dt*D_scalar; 3727 3736 3728 3737 TripleMultiply(&basis[0],numdof,1,0, … … 3793 3802 Input* enthalpy_input=NULL; 3794 3803 Input* enthalpypicard_input=NULL; 3795 if( dt){3804 if(reCast<bool,IssmDouble>(dt)){ 3796 3805 enthalpy_input=inputs->GetInput(EnthalpyEnum); _assert_(enthalpy_input); 3797 3806 } … … 3815 3824 3816 3825 scalar_def=phi/rho_ice*Jdet*gauss->weight; 3817 if( dt) scalar_def=scalar_def*dt;3826 if(reCast<bool,IssmDouble>(dt)) scalar_def=scalar_def*dt; 3818 3827 3819 3828 for(i=0;i<NUMVERTICES;i++) pe->values[i]+=scalar_def*L[i]; 3820 3829 3821 3830 /* Build transient now */ 3822 if( dt){3831 if(reCast<bool,IssmDouble>(dt)){ 3823 3832 enthalpy_input->GetInputValue(&enthalpy, gauss); 3824 3833 scalar_transient=enthalpy*Jdet*gauss->weight; … … 3838 3847 3839 3848 for(i=0;i<NUMVERTICES;i++) pe->values[i]+=tau_parameter*scalar_def*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]); 3840 if( dt){3849 if(reCast<bool,IssmDouble>(dt)){ 3841 3850 for(i=0;i<NUMVERTICES;i++) pe->values[i]+=tau_parameter*scalar_transient*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]); 3842 3851 } … … 3896 3905 3897 3906 scalar_ocean=gauss->weight*Jdet2d*rho_water*mixed_layer_capacity*thermal_exchange_velocity*(h_pmp)/(rho_ice*heatcapacity); 3898 if( dt) scalar_ocean=dt*scalar_ocean;3907 if(reCast<bool,IssmDouble>(dt)) scalar_ocean=dt*scalar_ocean; 3899 3908 3900 3909 for(i=0;i<numdof;i++) pe->values[i]+=scalar_ocean*basis[i]; … … 3982 3991 3983 3992 scalar=gauss->weight*Jdet2d*(basalfriction+geothermalflux_value)/(rho_ice); 3984 if( dt) scalar=dt*scalar;3993 if(reCast<bool,IssmDouble>(dt)) scalar=dt*scalar; 3985 3994 3986 3995 for(i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i]; … … 4054 4063 Input* vz_input=inputs->GetInput(VzEnum); _assert_(vz_input); 4055 4064 Input* temperature_input=NULL; 4056 if ( dt) temperature_input=inputs->GetInput(TemperatureEnum); _assert_(inputs);4065 if (reCast<bool,IssmDouble>(dt)) temperature_input=inputs->GetInput(TemperatureEnum); _assert_(inputs); 4057 4066 if (stabilization==2) diameter=MinEdgeLength(xyz_list); 4058 4067 … … 4071 4080 4072 4081 scalar_def=phi/(rho_ice*heatcapacity)*Jdet*gauss->weight; 4073 if( dt) scalar_def=scalar_def*dt;4082 if(reCast<bool,IssmDouble>(dt)) scalar_def=scalar_def*dt; 4074 4083 4075 4084 for(i=0;i<NUMVERTICES;i++) pe->values[i]+=scalar_def*L[i]; 4076 4085 4077 4086 /* Build transient now */ 4078 if( dt){4087 if(reCast<bool,IssmDouble>(dt)){ 4079 4088 temperature_input->GetInputValue(&temperature, gauss); 4080 4089 scalar_transient=temperature*Jdet*gauss->weight; … … 4092 4101 4093 4102 for(i=0;i<NUMVERTICES;i++) pe->values[i]+=tau_parameter*scalar_def*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]); 4094 if( dt){4103 if(reCast<bool,IssmDouble>(dt)){ 4095 4104 for(i=0;i<NUMVERTICES;i++) pe->values[i]+=tau_parameter*scalar_transient*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]); 4096 4105 } … … 4150 4159 4151 4160 scalar_ocean=gauss->weight*Jdet2d*rho_water*mixed_layer_capacity*thermal_exchange_velocity*(t_pmp)/(heatcapacity*rho_ice); 4152 if( dt) scalar_ocean=dt*scalar_ocean;4161 if(reCast<bool,IssmDouble>(dt)) scalar_ocean=dt*scalar_ocean; 4153 4162 4154 4163 for(i=0;i<numdof;i++) pe->values[i]+=scalar_ocean*basis[i]; … … 4216 4225 4217 4226 scalar=gauss->weight*Jdet2d*(basalfriction+geothermalflux_value)/(heatcapacity*rho_ice); 4218 if( dt) scalar=dt*scalar;4227 if(reCast<bool,IssmDouble>(dt)) scalar=dt*scalar; 4219 4228 4220 4229 for(i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i]; … … 4232 4241 const int numdof=NDOF1*NUMVERTICES; 4233 4242 4234 int 4235 int * doflist=NULL;4236 IssmDouble 4237 IssmDouble 4238 GaussPenta *gauss=NULL;4243 int i; 4244 int *doflist = NULL; 4245 IssmDouble values[numdof]; 4246 IssmDouble temp; 4247 GaussPenta *gauss = NULL; 4239 4248 4240 4249 /*Get dof list: */ … … 4314 4323 4315 4324 /*Check solution*/ 4316 if(xIsNan<IssmDouble>(values[i])) _error 2_("NaN found in solution vector");4325 if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector"); 4317 4326 //if(values[i]<0) _printLine_("temperature < 0°K found in solution vector"); 4318 4327 //if(values[i]>275) _printLine_("temperature > 275°K found in solution vector (Paterson's rheology associated is negative)"); … … 4348 4357 break; 4349 4358 default: 4350 _error 2_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet");4359 _error_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet"); 4351 4360 4352 4361 } … … 4384 4393 4385 4394 /*Check solution*/ 4386 if(xIsNan<IssmDouble>(values[i])) _error 2_("NaN found in solution vector");4395 if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector"); 4387 4396 } 4388 4397 … … 4397 4406 for(i=0;i<numdof;i++){ 4398 4407 matpar->EnthalpyToThermal(&temperatures[i],&waterfraction[i],values[i],pressure[i]); 4399 if(waterfraction[i]<0) _error 2_("Negative water fraction found in solution vector");4400 //if(waterfraction[i]>1) _error 2_("Water fraction >1 found in solution vector");4408 if(waterfraction[i]<0) _error_("Negative water fraction found in solution vector"); 4409 //if(waterfraction[i]>1) _error_("Water fraction >1 found in solution vector"); 4401 4410 } 4402 4411 … … 4426 4435 break; 4427 4436 default: 4428 _error 2_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet");4437 _error_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet"); 4429 4438 4430 4439 } … … 4454 4463 input=inputs->GetInput(enum_type); 4455 4464 } 4456 if (!input) _error 2_("Input " << EnumToStringx(enum_type) << " not found");4457 if (input->ObjectEnum()!=ControlInputEnum) _error 2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");4465 if (!input) _error_("Input " << EnumToStringx(enum_type) << " not found"); 4466 if (input->ObjectEnum()!=ControlInputEnum) _error_("Input " << EnumToStringx(enum_type) << " is not a ControlInput"); 4458 4467 4459 4468 GradientIndexing(&doflist1[0],control_index); … … 4472 4481 input=inputs->GetInput(enum_type); 4473 4482 } 4474 if (!input) _error 2_("Input " << EnumToStringx(enum_type) << " not found");4475 if (input->ObjectEnum()!=ControlInputEnum) _error 2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");4483 if (!input) _error_("Input " << EnumToStringx(enum_type) << " not found"); 4484 if (input->ObjectEnum()!=ControlInputEnum) _error_("Input " << EnumToStringx(enum_type) << " is not a ControlInput"); 4476 4485 4477 4486 ((ControlInput*)input)->ScaleGradient(scale); … … 4491 4500 input=inputs->GetInput(enum_type); 4492 4501 } 4493 if (!input) _error 2_("Input " << EnumToStringx(enum_type) << " not found");4494 if (input->ObjectEnum()!=ControlInputEnum) _error 2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");4502 if (!input) _error_("Input " << EnumToStringx(enum_type) << " not found"); 4503 if (input->ObjectEnum()!=ControlInputEnum) _error_("Input " << EnumToStringx(enum_type) << " is not a ControlInput"); 4495 4504 4496 4505 GradientIndexing(&doflist1[0],control_index); … … 4516 4525 return NULL; 4517 4526 default: 4518 _error 2_("Approximation " << EnumToStringx(approximation) << " not supported yet");4527 _error_("Approximation " << EnumToStringx(approximation) << " not supported yet"); 4519 4528 } 4520 4529 } … … 4706 4715 return CreatePVectorAdjointStokes(); 4707 4716 default: 4708 _error 2_("Approximation " << EnumToStringx(approximation) << " not supported yet");4717 _error_("Approximation " << EnumToStringx(approximation) << " not supported yet"); 4709 4718 } 4710 4719 } … … 4795 4804 break; 4796 4805 default: 4797 _error 2_("approximation " << EnumToStringx(approximation) << " not supported yet");4806 _error_("approximation " << EnumToStringx(approximation) << " not supported yet"); 4798 4807 } 4799 4808 break; … … 4815 4824 break; 4816 4825 default: 4817 _error 2_("approximation " << EnumToStringx(approximation) << " not supported yet");4826 _error_("approximation " << EnumToStringx(approximation) << " not supported yet"); 4818 4827 } 4819 4828 break; 4820 4829 4821 4830 default: 4822 _error 2_("control type " << EnumToStringx(control_type) << " not supported yet: ");4831 _error_("control type " << EnumToStringx(control_type) << " not supported yet: "); 4823 4832 } 4824 4833 … … 4852 4861 break; 4853 4862 default: 4854 _error 2_("response " << EnumToStringx(responses[resp]) << " not supported yet");4863 _error_("response " << EnumToStringx(responses[resp]) << " not supported yet"); 4855 4864 } 4856 4865 xDelete<int>(responses); … … 5106 5115 } 5107 5116 5108 if (input->ObjectEnum()!=ControlInputEnum) _error 2_("input " << EnumToStringx(control_type[i]) << " is not a ControlInput");5117 if (input->ObjectEnum()!=ControlInputEnum) _error_("input " << EnumToStringx(control_type[i]) << " is not a ControlInput"); 5109 5118 5110 5119 ((ControlInput*)input)->UpdateValue(scalar); … … 5149 5158 5150 5159 /*Check solution*/ 5151 if(xIsNan<IssmDouble>(lambdax[i])) _error 2_("NaN found in solution vector");5152 if(xIsNan<IssmDouble>(lambday[i])) _error 2_("NaN found in solution vector");5153 if(xIsNan<IssmDouble>(lambdaz[i])) _error 2_("NaN found in solution vector");5154 if(xIsNan<IssmDouble>(lambdap[i])) _error 2_("NaN found in solution vector");5160 if(xIsNan<IssmDouble>(lambdax[i])) _error_("NaN found in solution vector"); 5161 if(xIsNan<IssmDouble>(lambday[i])) _error_("NaN found in solution vector"); 5162 if(xIsNan<IssmDouble>(lambdaz[i])) _error_("NaN found in solution vector"); 5163 if(xIsNan<IssmDouble>(lambdap[i])) _error_("NaN found in solution vector"); 5155 5164 } 5156 5165 … … 5188 5197 5189 5198 /*Check solution*/ 5190 if(xIsNan<IssmDouble>(lambdax[i])) _error 2_("NaN found in solution vector");5191 if(xIsNan<IssmDouble>(lambday[i])) _error 2_("NaN found in solution vector");5199 if(xIsNan<IssmDouble>(lambdax[i])) _error_("NaN found in solution vector"); 5200 if(xIsNan<IssmDouble>(lambday[i])) _error_("NaN found in solution vector"); 5192 5201 } 5193 5202 … … 5390 5399 IssmDouble Penta::ThicknessAbsGradient(bool process_units,int weight_index){ 5391 5400 5392 _error 2_("Not implemented yet");5401 _error_("Not implemented yet"); 5393 5402 } 5394 5403 /*}}}*/ … … 5405 5414 /*If on water, return 0: */ 5406 5415 if(IsOnWater())return 0; 5407 _error 2_("Not implemented yet");5416 _error_("Not implemented yet"); 5408 5417 5409 5418 tria=(Tria*)SpawnTria(0,1,2); … … 5456 5465 /*Get input (either in element or material)*/ 5457 5466 Input* input=inputs->GetInput(control_enum); 5458 if(!input) _error 2_("Input " << EnumToStringx(control_enum) << " not found in element");5467 if(!input) _error_("Input " << EnumToStringx(control_enum) << " not found in element"); 5459 5468 5460 5469 /*Check that it is a ControlInput*/ 5461 5470 if (input->ObjectEnum()!=ControlInputEnum){ 5462 _error 2_("input " << EnumToStringx(control_enum) << " is not a ControlInput");5471 _error_("input " << EnumToStringx(control_enum) << " is not a ControlInput"); 5463 5472 } 5464 5473 … … 5495 5504 5496 5505 if (input->ObjectEnum()!=ControlInputEnum){ 5497 _error 2_("input " << EnumToStringx(control_enum) << " is not a ControlInput");5506 _error_("input " << EnumToStringx(control_enum) << " is not a ControlInput"); 5498 5507 } 5499 5508 … … 5601 5610 5602 5611 default: 5603 _error 2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");5612 _error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet"); 5604 5613 } 5605 5614 … … 5608 5617 /*FUNCTION Penta::InputUpdateFromVectorDakota(int* vector, int name, int type);{{{*/ 5609 5618 void Penta::InputUpdateFromVectorDakota(int* vector, int name, int type){ 5610 _error 2_("not supported yet!");5619 _error_("not supported yet!"); 5611 5620 } 5612 5621 /*}}}*/ 5613 5622 /*FUNCTION Penta::InputUpdateFromVectorDakota(bool* vector, int name, int type);{{{*/ 5614 5623 void Penta::InputUpdateFromVectorDakota(bool* vector, int name, int type){ 5615 _error 2_("not supported yet!");5624 _error_("not supported yet!"); 5616 5625 } 5617 5626 /*}}}*/ … … 5656 5665 5657 5666 default: 5658 _error 2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");5667 _error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet"); 5659 5668 } 5660 5669 … … 6200 6209 case MacAyealApproximationEnum: 6201 6210 return CreateKMatrixDiagnosticMacAyeal2d(); 6211 case L1L2ApproximationEnum: 6212 return CreateKMatrixDiagnosticL1L2(); 6202 6213 case PattynApproximationEnum: 6203 6214 return CreateKMatrixDiagnosticPattyn(); … … 6215 6226 return CreateKMatrixDiagnosticPattynStokes(); 6216 6227 default: 6217 _error 2_("Approximation " << EnumToStringx(approximation) << " not supported yet");6228 _error_("Approximation " << EnumToStringx(approximation) << " not supported yet"); 6218 6229 } 6219 6230 } … … 6226 6237 6227 6238 /*Intermediaries*/ 6228 int connectivity[2];6229 int i,i0,i1,j0,j1;6230 IssmDouble 6239 int connectivity[2]; 6240 int i,i0,i1,j0,j1; 6241 IssmDouble one0,one1; 6231 6242 6232 6243 /*Initialize Element matrix*/ … … 6327 6338 /*Intermediaries */ 6328 6339 int i,j,ig,approximation; 6329 IssmDouble 6330 IssmDouble viscosity, oldviscosity, newviscosity, viscosity_overshoot;6331 IssmDouble epsilon[5],oldepsilon[5];/* epsilon=[exx,eyy,exy,exz,eyz];*/6332 IssmDouble epsilons[6];//6 for stokes6333 IssmDouble 6334 IssmDouble 6335 IssmDouble 6336 IssmDouble D[3][3]={0.0};// material matrix, simple scalar matrix.6337 IssmDouble 6338 IssmDouble Ke_gg_gaussian[numdof2d][numdof2d]; //stiffness matrix evaluated at the gaussian point.6339 Tria * tria=NULL;6340 Penta * pentabase=NULL;6341 GaussPenta *gauss =NULL;6342 GaussTria *gauss_tria =NULL;6340 IssmDouble Jdet; 6341 IssmDouble viscosity , oldviscosity, newviscosity, viscosity_overshoot; 6342 IssmDouble epsilon[5],oldepsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/ 6343 IssmDouble epsilons[6]; //6 for stokes 6344 IssmDouble xyz_list[NUMVERTICES][3]; 6345 IssmDouble B[3][numdof2d]; 6346 IssmDouble Bprime[3][numdof2d]; 6347 IssmDouble D[3][3]= {0.0}; // material matrix, simple scalar matrix. 6348 IssmDouble D_scalar; 6349 IssmDouble Ke_gg_gaussian[numdof2d][numdof2d]; 6350 Tria *tria = NULL; 6351 Penta *pentabase = NULL; 6352 GaussPenta *gauss = NULL; 6353 GaussTria *gauss_tria = NULL; 6343 6354 6344 6355 /*Find penta on bed as this is a macayeal elements: */ … … 6383 6394 matice->GetViscosity3dStokes(&newviscosity,&epsilons[0]); 6384 6395 } 6385 else _error 2_("approximation " << approximation << " (" << EnumToStringx(approximation) << ") not supported yet");6396 else _error_("approximation " << approximation << " (" << EnumToStringx(approximation) << ") not supported yet"); 6386 6397 6387 6398 D_scalar=2*newviscosity*gauss->weight*Jdet; … … 6453 6464 delete Ke2; 6454 6465 delete Ke3; 6466 return Ke; 6467 } 6468 /*}}}*/ 6469 /*FUNCTION Penta::CreateKMatrixDiagnosticL1L2{{{*/ 6470 ElementMatrix* Penta::CreateKMatrixDiagnosticL1L2(void){ 6471 6472 /*compute all stiffness matrices for this element*/ 6473 ElementMatrix* Ke1=CreateKMatrixDiagnosticL1L2Viscous(); 6474 ElementMatrix* Ke2=CreateKMatrixDiagnosticL1L2Friction(); 6475 ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2); 6476 6477 /*clean-up and return*/ 6478 delete Ke1; 6479 delete Ke2; 6480 return Ke; 6481 } 6482 /*}}}*/ 6483 /*FUNCTION Penta::CreateKMatrixDiagnosticL1L2Viscous{{{*/ 6484 ElementMatrix* Penta::CreateKMatrixDiagnosticL1L2Viscous(void){ 6485 6486 /*Constants*/ 6487 const int numdof2d=2*NUMVERTICES2D; 6488 6489 /*Intermediaries */ 6490 int i,j; 6491 IssmDouble Jdet,viscosity; 6492 IssmDouble epsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/ 6493 IssmDouble xyz_list[NUMVERTICES][3]; 6494 IssmDouble B[3][numdof2d]; 6495 IssmDouble Bprime[3][numdof2d]; 6496 IssmDouble Ke_gg_gaussian[numdof2d][numdof2d]; 6497 IssmDouble D[3][3]= {0.0}; // material matrix, simple scalar matrix. 6498 Tria *tria = NULL; 6499 Penta *pentabase = NULL; 6500 GaussPenta *gauss = NULL; 6501 GaussTria *gauss_tria = NULL; 6502 6503 /*Find penta on bed as this is a macayeal elements: */ 6504 pentabase=GetBasalElement(); 6505 tria=pentabase->SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 6506 6507 /*Initialize Element matrix*/ 6508 ElementMatrix* Ke=new ElementMatrix(tria->nodes,NUMVERTICES2D,this->parameters,L1L2ApproximationEnum); 6509 6510 /*Retrieve all inputs and parameters*/ 6511 GetVerticesCoordinates(&xyz_list[0][0], nodes,NUMVERTICES); 6512 Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input); 6513 Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input); 6514 Input* surf_input=inputs->GetInput(SurfaceEnum); _assert_(surf_input); 6515 6516 /* Start looping on the number of gaussian points: */ 6517 gauss=new GaussPenta(5,5); 6518 gauss_tria=new GaussTria(); 6519 for(int ig=gauss->begin();ig<gauss->end();ig++){ 6520 6521 gauss->GaussPoint(ig); 6522 gauss->SynchronizeGaussTria(gauss_tria); 6523 6524 GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss); 6525 tria->GetBMacAyeal(&B[0][0], &xyz_list[0][0], gauss_tria); 6526 tria->GetBprimeMacAyeal(&Bprime[0][0], &xyz_list[0][0], gauss_tria); 6527 6528 /*Get viscosity for L1L2 model*/ 6529 GetL1L2Viscosity(&viscosity,&xyz_list[0][0],gauss,vx_input,vy_input,surf_input); 6530 6531 for(i=0;i<3;i++) D[i][i]=2*viscosity*gauss->weight*Jdet; 6532 6533 TripleMultiply( &B[0][0],3,numdof2d,1, 6534 &D[0][0],3,3,0, 6535 &Bprime[0][0],3,numdof2d,0, 6536 &Ke_gg_gaussian[0][0],0); 6537 for(i=0;i<numdof2d;i++) for(j=0;j<numdof2d;j++) Ke->values[i*numdof2d+j]+=Ke_gg_gaussian[i][j]; 6538 } 6539 6540 /*Transform Coordinate System*/ 6541 TransformStiffnessMatrixCoord(Ke,tria->nodes,NUMVERTICES2D,XYEnum); 6542 6543 /*Clean up and return*/ 6544 delete tria->matice; 6545 delete tria; 6546 delete gauss_tria; 6547 delete gauss; 6548 return Ke; 6549 } 6550 /*}}}*/ 6551 /*FUNCTION Penta::CreateKMatrixDiagnosticL1L2Friction{{{*/ 6552 ElementMatrix* Penta::CreateKMatrixDiagnosticL1L2Friction(void){ 6553 6554 /*Initialize Element matrix and return if necessary*/ 6555 if(IsFloating() || !IsOnBed()) return NULL; 6556 6557 /*Build a tria element using the 3 nodes of the base of the penta. Then use 6558 * the tria functionality to build a friction stiffness matrix on these 3 6559 * nodes: */ 6560 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 6561 ElementMatrix* Ke=tria->CreateKMatrixDiagnosticMacAyealFriction(); 6562 delete tria->matice; delete tria; 6563 6564 /*clean-up and return*/ 6455 6565 return Ke; 6456 6566 } … … 7193 7303 case PattynApproximationEnum: 7194 7304 return CreatePVectorDiagnosticPattyn(); 7305 case L1L2ApproximationEnum: 7306 return CreatePVectorDiagnosticL1L2(); 7195 7307 case HutterApproximationEnum: 7196 7308 return NULL; … … 7206 7318 return CreatePVectorDiagnosticPattynStokes(); 7207 7319 default: 7208 _error 2_("Approximation " << EnumToStringx(approximation) << " not supported yet");7320 _error_("Approximation " << EnumToStringx(approximation) << " not supported yet"); 7209 7321 } 7210 7322 } … … 7346 7458 /*FUNCTION Penta::CreatePVectorDiagnosticMacAyeal{{{*/ 7347 7459 ElementVector* Penta::CreatePVectorDiagnosticMacAyeal(void){ 7460 7461 if (!IsOnBed()) return NULL; 7462 7463 /*Call Tria function*/ 7464 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 7465 ElementVector* pe=tria->CreatePVectorDiagnosticMacAyeal(); 7466 delete tria->matice; delete tria; 7467 7468 /*Clean up and return*/ 7469 return pe; 7470 } 7471 /*}}}*/ 7472 /*FUNCTION Penta::CreatePVectorDiagnosticL1L2{{{*/ 7473 ElementVector* Penta::CreatePVectorDiagnosticL1L2(void){ 7348 7474 7349 7475 if (!IsOnBed()) return NULL; … … 7719 7845 return NULL; 7720 7846 default: 7721 _error 2_("Approximation " << EnumToStringx(approximation) << " not supported yet");7847 _error_("Approximation " << EnumToStringx(approximation) << " not supported yet"); 7722 7848 } 7723 7849 } … … 7892 8018 const int numdof=NDOF2*NUMVERTICES; 7893 8019 7894 int 7895 int 7896 int * doflist=NULL;7897 IssmDouble 7898 IssmDouble 7899 GaussPenta *gauss;8020 int i; 8021 int approximation; 8022 int *doflist = NULL; 8023 IssmDouble vx,vy; 8024 IssmDouble values[numdof]; 8025 GaussPenta *gauss; 7900 8026 7901 8027 /*Get approximation enum and dof list: */ … … 8043 8169 } 8044 8170 /*}}}*/ 8171 /*FUNCTION Penta::GetL1L2Viscosity{{{*/ 8172 void Penta::GetL1L2Viscosity(IssmDouble* pviscosity,IssmDouble* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input,Input* surface_input){ 8173 /*Compute the L1L2 viscosity 8174 * 8175 * 1 8176 * mu = - A^-1 (sigma'_e)^(1-n) 8177 * 2 8178 * 8179 * sigma'_e^2 = |sigma'_//|^2 + |sigma'_perp|^2 (see Perego 2012 eq. 17,18) 8180 * 8181 * L1L2 assumptions: 8182 * 8183 * (1) |eps_b|_// = A (|sigma'_//|^2 + |sigma'_perp|^2)^((n-1)/2) |sigma'_//| 8184 * (2) |sigma'_perp|^2 = |rho g (s-z) grad(s)|^2 8185 * 8186 * Assuming that n = 3, we have a polynom of degree 3 to solve (the only unkown is X=|sigma'_//|) 8187 * 8188 * A X^3 + A |rho g (s-z) grad(s)|^2 X - |eps_b|_// = 0 */ 8189 8190 int i; 8191 IssmDouble z,s,viscosity,p,q,delta; 8192 IssmDouble tau_perp,tau_par,eps_b,A; 8193 IssmDouble epsilonvx[5]; /*exx eyy exy exz eyz*/ 8194 IssmDouble epsilonvy[5]; /*exx eyy exy exz eyz*/ 8195 IssmDouble epsilon[5]; /*exx eyy exy exz eyz*/ 8196 IssmDouble z_list[NUMVERTICES]; 8197 IssmDouble slope[3]; 8198 8199 /*Check that both inputs have been found*/ 8200 if (!vx_input || !vy_input || !surface_input) _error_("Input missing"); 8201 8202 /*Get tau_perp*/ 8203 for(i=0;i<NUMVERTICES;i++) z_list[i]=xyz_list[3*i+2]; 8204 surface_input->GetInputValue(&s,gauss); 8205 surface_input->GetInputDerivativeValue(&slope[0],xyz_list,gauss); 8206 PentaRef::GetInputValue(&z,&z_list[0],gauss); 8207 tau_perp = matpar->GetRhoIce() * matpar->GetG() * fabs(s-z)*sqrt(slope[0]*slope[0]+slope[1]*slope[1]); 8208 8209 /* Get eps_b*/ 8210 vx_input->GetVxStrainRate3dPattyn(epsilonvx,xyz_list,gauss); 8211 vy_input->GetVyStrainRate3dPattyn(epsilonvy,xyz_list,gauss); 8212 for(i=0;i<5;i++) epsilon[i]=epsilonvx[i]+epsilonvy[i]; 8213 eps_b = sqrt(epsilon[0]*epsilon[0] + epsilon[1]*epsilon[1] + epsilon[0]*epsilon[1] + epsilon[2]*epsilon[2]); 8214 if(eps_b==0.){ 8215 *pviscosity = 2.5e+17; 8216 return; 8217 } 8218 8219 /*Get A*/ 8220 _assert_(matice->GetN()==3.0); 8221 A=matice->GetA(); 8222 8223 /*Solve for tau_perp (http://fr.wikipedia.org/wiki/Méthode_de_Cardan)*/ 8224 p = tau_perp *tau_perp; 8225 q = - eps_b/A; 8226 delta = q *q + p*p*p*4./27.; 8227 _assert_(delta>0); 8228 tau_par = pow(0.5*(-q+sqrt(delta)),1./3.) - pow(0.5*(q+sqrt(delta)),1./3.); 8229 8230 /*Viscosity*/ 8231 viscosity = 1./(2.*A*(tau_par*tau_par + tau_perp*tau_perp)); 8232 _assert_(!isnan(viscosity)); 8233 _assert_(viscosity > 0.); 8234 8235 /*Assign output pointer*/ 8236 *pviscosity = viscosity; 8237 return; 8238 } 8239 /*}}}*/ 8045 8240 /*FUNCTION Penta::InputUpdateFromSolutionDiagnosticHoriz {{{*/ 8046 8241 void Penta::InputUpdateFromSolutionDiagnosticHoriz(IssmDouble* solution){ … … 8061 8256 return; 8062 8257 } 8258 } 8259 if (approximation==L1L2ApproximationEnum){ 8260 if (!IsOnBed()) return; 8261 InputUpdateFromSolutionDiagnosticL1L2(solution); 8262 return; 8063 8263 } 8064 8264 else if (approximation==PattynApproximationEnum){ … … 8114 8314 8115 8315 /*Check solution*/ 8116 if(xIsNan<IssmDouble>(vx[i])) _error 2_("NaN found in solution vector");8117 if(xIsNan<IssmDouble>(vy[i])) _error 2_("NaN found in solution vector");8316 if(xIsNan<IssmDouble>(vx[i])) _error_("NaN found in solution vector"); 8317 if(xIsNan<IssmDouble>(vy[i])) _error_("NaN found in solution vector"); 8118 8318 } 8119 8319 … … 8212 8412 8213 8413 /*Check solution*/ 8214 if(xIsNan<IssmDouble>(vx[i])) _error 2_("NaN found in solution vector");8215 if(xIsNan<IssmDouble>(vy[i])) _error 2_("NaN found in solution vector");8414 if(xIsNan<IssmDouble>(vx[i])) _error_("NaN found in solution vector"); 8415 if(xIsNan<IssmDouble>(vy[i])) _error_("NaN found in solution vector"); 8216 8416 } 8217 8417 … … 8300 8500 8301 8501 /*Check solution*/ 8302 if(xIsNan<IssmDouble>(vx[i])) _error 2_("NaN found in solution vector");8303 if(xIsNan<IssmDouble>(vy[i])) _error 2_("NaN found in solution vector");8304 if(xIsNan<IssmDouble>(vzstokes[i])) _error 2_("NaN found in solution vector");8305 if(xIsNan<IssmDouble>(pressure[i])) _error 2_("NaN found in solution vector");8502 if(xIsNan<IssmDouble>(vx[i])) _error_("NaN found in solution vector"); 8503 if(xIsNan<IssmDouble>(vy[i])) _error_("NaN found in solution vector"); 8504 if(xIsNan<IssmDouble>(vzstokes[i])) _error_("NaN found in solution vector"); 8505 if(xIsNan<IssmDouble>(pressure[i])) _error_("NaN found in solution vector"); 8306 8506 } 8307 8507 … … 8310 8510 if (vzmacayeal_input){ 8311 8511 if (vzmacayeal_input->ObjectEnum()!=PentaP1InputEnum){ 8312 _error 2_("Cannot compute Vel as VzMacAyeal is of type " << EnumToStringx(vzmacayeal_input->ObjectEnum()));8512 _error_("Cannot compute Vel as VzMacAyeal is of type " << EnumToStringx(vzmacayeal_input->ObjectEnum())); 8313 8513 } 8314 8514 GetInputListOnVertices(&vzmacayeal[0],VzMacAyealEnum); 8315 8515 } 8316 8516 else{ 8317 _error 2_("Cannot update solution as VzMacAyeal is not present");8517 _error_("Cannot update solution as VzMacAyeal is not present"); 8318 8518 } 8319 8519 … … 8342 8542 xDelete<int>(doflistm); 8343 8543 xDelete<int>(doflists); 8544 } 8545 /*}}}*/ 8546 /*FUNCTION Penta::InputUpdateFromSolutionDiagnosticL1L2 {{{*/ 8547 void Penta::InputUpdateFromSolutionDiagnosticL1L2(IssmDouble* solution){ 8548 8549 const int numdof=NDOF2*NUMVERTICES; 8550 8551 int i; 8552 IssmDouble rho_ice,g; 8553 IssmDouble values[numdof]; 8554 IssmDouble vx[NUMVERTICES]; 8555 IssmDouble vy[NUMVERTICES]; 8556 IssmDouble vz[NUMVERTICES]; 8557 IssmDouble vel[NUMVERTICES]; 8558 IssmDouble pressure[NUMVERTICES]; 8559 IssmDouble surface[NUMVERTICES]; 8560 IssmDouble xyz_list[NUMVERTICES][3]; 8561 int *doflist = NULL; 8562 Penta *penta = NULL; 8563 8564 /*Get dof list: */ 8565 GetDofList(&doflist,L1L2ApproximationEnum,GsetEnum); 8566 8567 /*Use the dof list to index into the solution vector: */ 8568 for(i=0;i<numdof;i++) values[i]=solution[doflist[i]]; 8569 8570 /*Transform solution in Cartesian Space*/ 8571 TransformSolutionCoord(&values[0],nodes,NUMVERTICES2D,XYEnum); /*2D: only the first 3 nodes are taken*/ 8572 8573 /*Ok, we have vx and vy in values, fill in vx and vy arrays and extrude */ 8574 for(i=0;i<3;i++){ 8575 vx[i] =values[i*NDOF2+0]; 8576 vy[i] =values[i*NDOF2+1]; 8577 vx[i+3]=vx[i]; 8578 vy[i+3]=vy[i]; 8579 8580 /*Check solution*/ 8581 if(xIsNan<IssmDouble>(vx[i])) _error_("NaN found in solution vector"); 8582 if(xIsNan<IssmDouble>(vy[i])) _error_("NaN found in solution vector"); 8583 } 8584 8585 /*Get parameters fro pressure computation*/ 8586 rho_ice=matpar->GetRhoIce(); 8587 g=matpar->GetG(); 8588 8589 /*Start looping over all elements above current element and update all inputs*/ 8590 penta=this; 8591 for(;;){ 8592 8593 /*Get node data: */ 8594 GetVerticesCoordinates(&xyz_list[0][0],penta->nodes,NUMVERTICES); 8595 8596 /*Now Compute vel*/ 8597 GetInputListOnVertices(&vz[0],VzEnum,0.0); //default is 0 8598 for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5); 8599 8600 /*Now compute pressure*/ 8601 GetInputListOnVertices(&surface[0],SurfaceEnum); 8602 for(i=0;i<NUMVERTICES;i++) pressure[i]=rho_ice*g*(surface[i]-xyz_list[i][2]); 8603 8604 /*Now, we have to move the previous Vx and Vy inputs to old 8605 * status, otherwise, we'll wipe them off: */ 8606 penta->inputs->ChangeEnum(VxEnum,VxPicardEnum); 8607 penta->inputs->ChangeEnum(VyEnum,VyPicardEnum); 8608 penta->inputs->ChangeEnum(PressureEnum,PressurePicardEnum); 8609 8610 /*Add vx and vy as inputs to the tria element: */ 8611 penta->inputs->AddInput(new PentaP1Input(VxEnum,vx)); 8612 penta->inputs->AddInput(new PentaP1Input(VyEnum,vy)); 8613 penta->inputs->AddInput(new PentaP1Input(VelEnum,vel)); 8614 penta->inputs->AddInput(new PentaP1Input(PressureEnum,pressure)); 8615 8616 /*Stop if we have reached the surface*/ 8617 if (penta->IsOnSurface()) break; 8618 8619 /* get upper Penta*/ 8620 penta=penta->GetUpperElement(); _assert_(penta->Id()!=this->id); 8621 } 8622 8623 /*Free ressources:*/ 8624 xDelete<int>(doflist); 8344 8625 } 8345 8626 /*}}}*/ … … 8379 8660 8380 8661 /*Check solution*/ 8381 if(xIsNan<IssmDouble>(vx[i])) _error 2_("NaN found in solution vector");8382 if(xIsNan<IssmDouble>(vy[i])) _error 2_("NaN found in solution vector");8662 if(xIsNan<IssmDouble>(vx[i])) _error_("NaN found in solution vector"); 8663 if(xIsNan<IssmDouble>(vy[i])) _error_("NaN found in solution vector"); 8383 8664 } 8384 8665 … … 8468 8749 8469 8750 /*Check solution*/ 8470 if(xIsNan<IssmDouble>(vx[i])) _error 2_("NaN found in solution vector");8471 if(xIsNan<IssmDouble>(vy[i])) _error 2_("NaN found in solution vector");8472 if(xIsNan<IssmDouble>(vzstokes[i])) _error 2_("NaN found in solution vector");8473 if(xIsNan<IssmDouble>(pressure[i])) _error 2_("NaN found in solution vector");8751 if(xIsNan<IssmDouble>(vx[i])) _error_("NaN found in solution vector"); 8752 if(xIsNan<IssmDouble>(vy[i])) _error_("NaN found in solution vector"); 8753 if(xIsNan<IssmDouble>(vzstokes[i])) _error_("NaN found in solution vector"); 8754 if(xIsNan<IssmDouble>(pressure[i])) _error_("NaN found in solution vector"); 8474 8755 } 8475 8756 … … 8478 8759 if (vzpattyn_input){ 8479 8760 if (vzpattyn_input->ObjectEnum()!=PentaP1InputEnum){ 8480 _error 2_("Cannot compute Vel as VzPattyn is of type " << EnumToStringx(vzpattyn_input->ObjectEnum()));8761 _error_("Cannot compute Vel as VzPattyn is of type " << EnumToStringx(vzpattyn_input->ObjectEnum())); 8481 8762 } 8482 8763 GetInputListOnVertices(&vzpattyn[0],VzPattynEnum); 8483 8764 } 8484 8765 else{ 8485 _error 2_("Cannot update solution as VzPattyn is not present");8766 _error_("Cannot update solution as VzPattyn is not present"); 8486 8767 } 8487 8768 … … 8544 8825 8545 8826 /*Check solution*/ 8546 if(xIsNan<IssmDouble>(vx[i])) _error 2_("NaN found in solution vector");8547 if(xIsNan<IssmDouble>(vy[i])) _error 2_("NaN found in solution vector");8827 if(xIsNan<IssmDouble>(vx[i])) _error_("NaN found in solution vector"); 8828 if(xIsNan<IssmDouble>(vy[i])) _error_("NaN found in solution vector"); 8548 8829 } 8549 8830 … … 8613 8894 8614 8895 /*Check solution*/ 8615 if(xIsNan<IssmDouble>(vz[i])) _error 2_("NaN found in solution vector");8896 if(xIsNan<IssmDouble>(vz[i])) _error_("NaN found in solution vector"); 8616 8897 } 8617 8898 … … 8624 8905 Input* vzstokes_input=inputs->GetInput(VzStokesEnum); 8625 8906 if (vzstokes_input){ 8626 if (vzstokes_input->ObjectEnum()!=PentaP1InputEnum) _error 2_("Cannot compute Vel as VzStokes is of type " << EnumToStringx(vzstokes_input->ObjectEnum()));8907 if (vzstokes_input->ObjectEnum()!=PentaP1InputEnum) _error_("Cannot compute Vel as VzStokes is of type " << EnumToStringx(vzstokes_input->ObjectEnum())); 8627 8908 GetInputListOnVertices(&vzstokes[0],VzStokesEnum); 8628 8909 } 8629 else _error 2_("Cannot compute Vz as VzStokes in not present in PattynStokes element");8910 else _error_("Cannot compute Vz as VzStokes in not present in PattynStokes element"); 8630 8911 for(i=0;i<NUMVERTICES;i++){ 8631 8912 vzpattyn[i]=vz[i]; … … 8636 8917 Input* vzstokes_input=inputs->GetInput(VzStokesEnum); 8637 8918 if (vzstokes_input){ 8638 if (vzstokes_input->ObjectEnum()!=PentaP1InputEnum) _error 2_("Cannot compute Vel as VzStokes is of type " << EnumToStringx(vzstokes_input->ObjectEnum()));8919 if (vzstokes_input->ObjectEnum()!=PentaP1InputEnum) _error_("Cannot compute Vel as VzStokes is of type " << EnumToStringx(vzstokes_input->ObjectEnum())); 8639 8920 GetInputListOnVertices(&vzstokes[0],VzStokesEnum); 8640 8921 } 8641 else _error 2_("Cannot compute Vz as VzStokes in not present in MacAyealStokes element");8922 else _error_("Cannot compute Vz as VzStokes in not present in MacAyealStokes element"); 8642 8923 for(i=0;i<NUMVERTICES;i++){ 8643 8924 vzmacayeal[i]=vz[i]; … … 8711 8992 8712 8993 /*Check solution*/ 8713 if(xIsNan<IssmDouble>(vx[i])) _error 2_("NaN found in solution vector");8714 if(xIsNan<IssmDouble>(vy[i])) _error 2_("NaN found in solution vector");8715 if(xIsNan<IssmDouble>(vz[i])) _error 2_("NaN found in solution vector");8716 if(xIsNan<IssmDouble>(pressure[i])) _error 2_("NaN found in solution vector");8994 if(xIsNan<IssmDouble>(vx[i])) _error_("NaN found in solution vector"); 8995 if(xIsNan<IssmDouble>(vy[i])) _error_("NaN found in solution vector"); 8996 if(xIsNan<IssmDouble>(vz[i])) _error_("NaN found in solution vector"); 8997 if(xIsNan<IssmDouble>(pressure[i])) _error_("NaN found in solution vector"); 8717 8998 } 8718 8999 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Elements/Penta.h
r12946 r13101 162 162 IssmDouble SurfaceAverageVelMisfit(bool process_units,int weight_index); 163 163 IssmDouble ThicknessAbsGradient(bool process_units,int weight_index); 164 IssmDouble ThicknessAlongGradient( bool process_units,int weight_index){_error 2_("not supported");};165 IssmDouble ThicknessAcrossGradient(bool process_units,int weight_index){_error 2_("not supported");};164 IssmDouble ThicknessAlongGradient( bool process_units,int weight_index){_error_("not supported");}; 165 IssmDouble ThicknessAcrossGradient(bool process_units,int weight_index){_error_("not supported");}; 166 166 void InputControlUpdate(IssmDouble scalar,bool save_parameter); 167 167 #endif … … 169 169 /*Penta specific routines:{{{*/ 170 170 void BedNormal(IssmDouble* bed_normal, IssmDouble xyz_list[3][3]); 171 ElementMatrix* CreateBasalMassMatrix(void); 171 172 ElementMatrix* CreateKMatrixPrognostic(void); 172 ElementMatrix* CreateKMatrixSlope(void);173 173 ElementVector* CreatePVectorPrognostic(void); 174 174 ElementVector* CreatePVectorSlope(void); … … 227 227 ElementMatrix* CreateKMatrixDiagnosticMacAyealPattyn(void); 228 228 ElementMatrix* CreateKMatrixDiagnosticMacAyealStokes(void); 229 ElementMatrix* CreateKMatrixDiagnosticL1L2(void); 230 ElementMatrix* CreateKMatrixDiagnosticL1L2Viscous(void); 231 ElementMatrix* CreateKMatrixDiagnosticL1L2Friction(void); 229 232 ElementMatrix* CreateKMatrixDiagnosticPattyn(void); 230 233 ElementMatrix* CreateKMatrixDiagnosticPattynViscous(void); … … 245 248 void InputUpdateFromSolutionDiagnosticMacAyealPattyn( IssmDouble* solutiong); 246 249 void InputUpdateFromSolutionDiagnosticMacAyealStokes( IssmDouble* solutiong); 250 void InputUpdateFromSolutionDiagnosticL1L2( IssmDouble* solutiong); 247 251 void InputUpdateFromSolutionDiagnosticPattyn( IssmDouble* solutiong); 248 252 void InputUpdateFromSolutionDiagnosticPattynStokes( IssmDouble* solutiong); … … 265 269 ElementVector* CreatePVectorDiagnosticMacAyealPattyn(void); 266 270 ElementVector* CreatePVectorDiagnosticMacAyealStokes(void); 271 ElementVector* CreatePVectorDiagnosticL1L2(void); 267 272 ElementVector* CreatePVectorDiagnosticPattyn(void); 268 273 ElementVector* CreatePVectorDiagnosticPattynStokes(void); … … 273 278 ElementVector* CreatePVectorDiagnosticVertVolume(void); 274 279 ElementVector* CreatePVectorDiagnosticVertBase(void); 280 void GetL1L2Viscosity(IssmDouble*, IssmDouble*, GaussPenta*, Input*, Input*, Input*); 275 281 #endif 276 282 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Elements/PentaRef.cpp
r12832 r13101 949 949 /*Get Determinant*/ 950 950 Matrix3x3Determinant(Jdet,&J[0][0]); 951 if(*Jdet<0) _error 2_("negative jacobian determinant!");951 if(*Jdet<0) _error_("negative jacobian determinant!"); 952 952 953 953 } … … 972 972 /*Jdet = norm( AB ^ AC ) / (2 * area of the reference triangle), with areaRef=sqrt(3) */ 973 973 *Jdet=SQRT3/6.0*pow(pow(((y2-y1)*(z3-z1)-(z2-z1)*(y3-y1)),2.0)+pow(((z2-z1)*(x3-x1)-(x2-x1)*(z3-z1)),2.0)+pow(((x2-x1)*(y3-y1)-(y2-y1)*(x3-x1)),2.0),0.5); 974 if(*Jdet<0) _error 2_("negative jacobian determinant!");974 if(*Jdet<0) _error_("negative jacobian determinant!"); 975 975 } 976 976 /*}}}*/ … … 990 990 991 991 *Jdet=1.0/2.0*sqrt(pow(x2-x1,2.) + pow(y2-y1,2.) + pow(z2-z1,2.)); 992 if(*Jdet<0) _error 2_("negative jacobian determinant!");992 if(*Jdet<0) _error_("negative jacobian determinant!"); 993 993 994 994 } … … 1226 1226 /*Area of a trabezoid = altitude * (base1 + base2)/2 */ 1227 1227 *Jdet= pow(pow(x2-x1,2.) + pow(y2-y1,2.),0.5) * (z4-z1 + z3-z2)/8; 1228 if(*Jdet<0) _error 2_("negative jacobian determinant!");1228 if(*Jdet<0) _error_("negative jacobian determinant!"); 1229 1229 1230 1230 } -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Elements/PentaRef.h
r12494 r13101 56 56 void GetLprimeStokesMacAyeal(IssmDouble* LprimeStokesMacAyeal, IssmDouble* xyz_list, GaussPenta* gauss); 57 57 void GetInputValue(IssmDouble* pvalue,IssmDouble* plist, GaussPenta* gauss); 58 void GetInputValue(IssmDouble* pvalue,IssmDouble* plist,GaussTria* gauss){_error 2_("only PentaGauss are supported");};58 void GetInputValue(IssmDouble* pvalue,IssmDouble* plist,GaussTria* gauss){_error_("only PentaGauss are supported");}; 59 59 void GetInputDerivativeValue(IssmDouble* pvalues, IssmDouble* plist,IssmDouble* xyz_list, GaussPenta* gauss); 60 void GetInputDerivativeValue(IssmDouble* pvalues, IssmDouble* plist,IssmDouble* xyz_list, GaussTria* gauss){_error 2_("only PentaGauss are supported");};60 void GetInputDerivativeValue(IssmDouble* pvalues, IssmDouble* plist,IssmDouble* xyz_list, GaussTria* gauss){_error_("only PentaGauss are supported");}; 61 61 62 62 }; -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Elements/Tria.cpp
r12946 r13101 193 193 #endif 194 194 case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum: 195 Ke=Create KMatrixSlope();195 Ke=CreateMassMatrix(); 196 196 break; 197 197 case PrognosticAnalysisEnum: … … 214 214 #endif 215 215 default: 216 _error 2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");216 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 217 217 } 218 218 … … 232 232 /*Intermediaries */ 233 233 int i,j,ig; 234 IssmDouble 235 IssmDouble 236 IssmDouble 237 IssmDouble 234 IssmDouble heatcapacity,latentheat; 235 IssmDouble Jdet,D_scalar; 236 IssmDouble xyz_list[NUMVERTICES][3]; 237 IssmDouble L[3]; 238 238 GaussTria *gauss=NULL; 239 239 … … 277 277 return CreateKMatrixPrognostic_DG(); 278 278 default: 279 _error 2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");279 _error_("Element type " << EnumToStringx(GetElementType()) << " not supported yet"); 280 280 } 281 281 … … 370 370 if(stabilization==2){ 371 371 /*Streamline upwinding*/ 372 vel=sqrt( pow(vx,2.)+pow(vy,2.))+1.e-8;372 vel=sqrt(vx*vx+vy*vy)+1.e-8; 373 373 K[0][0]=h/(2*vel)*vx*vx; 374 374 K[1][0]=h/(2*vel)*vy*vx; … … 477 477 } 478 478 /*}}}*/ 479 /*FUNCTION Tria::Create KMatrixSlope{{{*/480 ElementMatrix* Tria::Create KMatrixSlope(void){479 /*FUNCTION Tria::CreateMassMatrix {{{*/ 480 ElementMatrix* Tria::CreateMassMatrix(void){ 481 481 482 482 /*constants: */ … … 484 484 485 485 /* Intermediaries */ 486 int i,j,ig; 487 IssmDouble DL_scalar,Jdet; 488 IssmDouble xyz_list[NUMVERTICES][3]; 489 IssmDouble L[1][3]; 490 GaussTria *gauss = NULL; 486 IssmDouble D,Jdet; 487 IssmDouble xyz_list[NUMVERTICES][3]; 488 IssmDouble L[1][3]; 489 GaussTria *gauss = NULL; 491 490 492 491 /*Initialize Element matrix*/ … … 497 496 /* Start looping on the number of gaussian points: */ 498 497 gauss=new GaussTria(2); 499 for (ig=gauss->begin();ig<gauss->end();ig++){498 for(int ig=gauss->begin();ig<gauss->end();ig++){ 500 499 501 500 gauss->GaussPoint(ig); 502 501 503 502 GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss); 504 D L_scalar=gauss->weight*Jdet;503 D=gauss->weight*Jdet; 505 504 506 505 GetL(&L[0][0], &xyz_list[0][0], gauss,NDOF1); 507 506 508 507 TripleMultiply(&L[0][0],1,3,1, 509 &D L_scalar,1,1,0,508 &D,1,1,0, 510 509 &L[0][0],1,3,0, 511 510 &Ke->values[0],1); … … 568 567 #endif 569 568 default: 570 _error 2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");569 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 571 570 } 572 571 … … 587 586 return CreatePVectorPrognostic_DG(); 588 587 default: 589 _error 2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");588 _error_("Element type " << EnumToStringx(GetElementType()) << " not supported yet"); 590 589 } 591 590 } … … 763 762 #endif 764 763 default: 765 _error 2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");764 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 766 765 } 767 766 … … 775 774 /*FUNCTION Tria::ComputeBasalStress {{{*/ 776 775 void Tria::ComputeBasalStress(Vector* eps){ 777 _error 2_("Not Implemented yet");776 _error_("Not Implemented yet"); 778 777 } 779 778 /*}}}*/ 780 779 /*FUNCTION Tria::ComputeStrainRate {{{*/ 781 780 void Tria::ComputeStrainRate(Vector* eps){ 782 _error 2_("Not Implemented yet");781 _error_("Not Implemented yet"); 783 782 } 784 783 /*}}}*/ … … 1088 1087 return i; 1089 1088 } 1090 _error 2_("Node provided not found among element nodes");1089 _error_("Node provided not found among element nodes"); 1091 1090 } 1092 1091 /*}}}*/ … … 1100 1099 /*Recover input*/ 1101 1100 Input* input=inputs->GetInput(enumtype); 1102 if (!input) _error 2_("Input " << EnumToStringx(enumtype) << " not found in element");1101 if (!input) _error_("Input " << EnumToStringx(enumtype) << " not found in element"); 1103 1102 1104 1103 /*Checks in debugging mode*/ … … 1172 1171 1173 1172 Input* input=inputs->GetInput(enumtype); 1174 if(!input) _error 2_("No input of type " << EnumToStringx(enumtype) << " found in tria");1173 if(!input) _error_("No input of type " << EnumToStringx(enumtype) << " found in tria"); 1175 1174 1176 1175 GaussTria* gauss=new GaussTria(); … … 1214 1213 #endif 1215 1214 default: 1216 _error 2_("analysis: " << EnumToStringx(analysis_type) << " not supported yet");1215 _error_("analysis: " << EnumToStringx(analysis_type) << " not supported yet"); 1217 1216 } 1218 1217 … … 1230 1229 /*Check that both inputs have been found*/ 1231 1230 if (!vx_input || !vy_input){ 1232 _error 2_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << "\n");1231 _error_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << "\n"); 1233 1232 } 1234 1233 … … 1254 1253 /*Get input (either in element or material)*/ 1255 1254 Input* input=inputs->GetInput(input_enum); 1256 if(!input) _error 2_("Input " << EnumToStringx(input_enum) << " not found in element");1255 if(!input) _error_("Input " << EnumToStringx(input_enum) << " not found in element"); 1257 1256 1258 1257 /*We found the enum. Use its values to fill into the vector, using the vertices ids: */ … … 1266 1265 ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(offset); 1267 1266 if(elementresult->InstanceEnum()!=enum_in){ 1268 _error_("Results of offset %i is %s, when %s was expected",offset,EnumToStringx(elementresult->InstanceEnum()),EnumToStringx(enum_in));1267 _error_("Results of offset "<<offset<<" is "<<EnumToStringx(elementresult->InstanceEnum())<<" when "<<EnumToStringx(enum_in)<<" was expected"); 1269 1268 } 1270 1269 if(interp==P1Enum){ … … 1304 1303 /*Make a copy of the original input: */ 1305 1304 input=(Input*)this->inputs->GetInput(enum_type); 1306 if(!input)_error 2_("could not find old input with enum: " << EnumToStringx(enum_type));1305 if(!input)_error_("could not find old input with enum: " << EnumToStringx(enum_type)); 1307 1306 1308 1307 /*ArtificialNoise: */ … … 1324 1323 new_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+0]); 1325 1324 old_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+1]); 1326 if(!new_inputs[i])_error 2_("could not find input with enum " << EnumToStringx(enums[2*i+0]));1327 if(!old_inputs[i])_error 2_("could not find input with enum " << EnumToStringx(enums[2*i+0]));1325 if(!new_inputs[i])_error_("could not find input with enum " << EnumToStringx(enums[2*i+0])); 1326 if(!old_inputs[i])_error_("could not find input with enum " << EnumToStringx(enums[2*i+0])); 1328 1327 } 1329 1328 … … 1353 1352 oldinput=(Input*)this->matice->inputs->GetInput(enum_type); 1354 1353 else 1355 _error 2_("object " << EnumToStringx(object_enum) << " not supported yet");1356 if(!oldinput)_error 2_("could not find old input with enum: " << EnumToStringx(enum_type));1354 _error_("object " << EnumToStringx(object_enum) << " not supported yet"); 1355 if(!oldinput)_error_("could not find old input with enum: " << EnumToStringx(enum_type)); 1357 1356 newinput=(Input*)oldinput->copy(); 1358 1357 … … 1366 1365 this->matice->inputs->AddInput((Input*)newinput); 1367 1366 else 1368 _error 2_("object " << EnumToStringx(object_enum) << " not supported yet");1367 _error_("object " << EnumToStringx(object_enum) << " not supported yet"); 1369 1368 } 1370 1369 /*}}}*/ … … 1384 1383 /*Make a copy of the original input: */ 1385 1384 input=(Input*)this->inputs->GetInput(enum_type); 1386 if(!input)_error 2_("could not find old input with enum: " << EnumToStringx(enum_type));1385 if(!input)_error_("could not find old input with enum: " << EnumToStringx(enum_type)); 1387 1386 1388 1387 /*Scale: */ … … 1399 1398 if (enum_type==MaterialsRheologyBbarEnum || enum_type==MaterialsRheologyZbarEnum) input=this->matice->inputs->GetInput(enum_type); 1400 1399 else input=this->inputs->GetInput(enum_type); 1401 //if (!input) _error 2_("Input " << EnumToStringx(enum_type) << " not found in tria->inputs");1400 //if (!input) _error_("Input " << EnumToStringx(enum_type) << " not found in tria->inputs"); 1402 1401 if(!input)return; 1403 1402 … … 1444 1443 1445 1444 /*Intermediaries*/ 1446 int i,j;1447 int tria_vertex_ids[3];1445 int i,j; 1446 int tria_vertex_ids[3]; 1448 1447 IssmDouble nodeinputs[3]; 1449 1448 IssmDouble cmmininputs[3]; 1450 1449 IssmDouble cmmaxinputs[3]; 1451 bool control_analysis=false;1452 int num_control_type;1450 bool control_analysis = false; 1451 int num_control_type; 1453 1452 IssmDouble yts; 1454 int num_cm_responses;1453 int num_cm_responses; 1455 1454 1456 1455 /*Get parameters: */ … … 1469 1468 if (control_analysis && iomodel->Data(InversionControlParametersEnum)){ 1470 1469 for(i=0;i<num_control_type;i++){ 1471 switch( (int)iomodel->Data(InversionControlParametersEnum)[i]){1470 switch(reCast<int>(iomodel->Data(InversionControlParametersEnum)[i])){ 1472 1471 case BalancethicknessThickeningRateEnum: 1473 1472 if (iomodel->Data(BalancethicknessThickeningRateEnum)){ … … 1506 1505 /*Matice will take care of it*/ break; 1507 1506 default: 1508 _error 2_("Control " << EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]) << " not implemented yet");1507 _error_("Control " << EnumToStringx(reCast<int,IssmDouble>(iomodel->Data(InversionControlParametersEnum)[i])) << " not implemented yet"); 1509 1508 } 1510 1509 } … … 1578 1577 break; 1579 1578 default: 1580 _error 2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");1579 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 1581 1580 } 1582 1581 } … … 1596 1595 for(int i=0;i<numdof;i++){ 1597 1596 values[i]=solution[doflist[i]]; 1598 if(xIsNan<IssmDouble>(values[i])) _error 2_("NaN found in solution vector");1597 if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector"); 1599 1598 } 1600 1599 … … 1629 1628 for(i=0;i<numdof;i++){ 1630 1629 newthickness[i]=solution[doflist[i]]; 1631 if(xIsNan<IssmDouble>(newthickness[i])) _error 2_("NaN found in solution vector");1630 if(xIsNan<IssmDouble>(newthickness[i])) _error_("NaN found in solution vector"); 1632 1631 /*Constrain thickness to be at least 1m*/ 1633 1632 if(newthickness[i]<minthickness) newthickness[i]=minthickness; … … 1660 1659 newbed[i]=oldbed[i]-rho_ice/rho_water*(newthickness[i]-oldthickness[i]); //bed = oldbed + di * dH 1661 1660 } 1662 else _error 2_("Hydrostatic adjustment " << hydroadjustment << " (" << EnumToStringx(hydroadjustment) << ") not supported yet");1661 else _error_("Hydrostatic adjustment " << hydroadjustment << " (" << EnumToStringx(hydroadjustment) << ") not supported yet"); 1663 1662 } 1664 1663 } … … 1701 1700 } 1702 1701 default: 1703 _error 2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");1702 _error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet"); 1704 1703 } 1705 1704 } … … 1707 1706 /*FUNCTION Tria::InputUpdateFromVector(int* vector, int name, int type);{{{*/ 1708 1707 void Tria::InputUpdateFromVector(int* vector, int name, int type){ 1709 _error 2_("not supported yet!");1708 _error_("not supported yet!"); 1710 1709 } 1711 1710 /*}}}*/ 1712 1711 /*FUNCTION Tria::InputUpdateFromVector(bool* vector, int name, int type);{{{*/ 1713 1712 void Tria::InputUpdateFromVector(bool* vector, int name, int type){ 1714 _error 2_("not supported yet!");1713 _error_("not supported yet!"); 1715 1714 } 1716 1715 /*}}}*/ … … 1730 1729 this->inputs->AddInput(new DoubleInput(name,reCast<int>(scalar))); 1731 1730 } 1732 else _error 2_("could not recognize nature of vector from code " << code);1731 else _error_("could not recognize nature of vector from code " << code); 1733 1732 1734 1733 } … … 1796 1795 this->inputs->AddInput(transientinput); 1797 1796 } 1798 else _error 2_("nodal vector is either numberofnodes or numberofnodes+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");1797 else _error_("nodal vector is either numberofnodes or numberofnodes+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long"); 1799 1798 } 1800 1799 else if(vector_type==2){ //element vector … … 1813 1812 this->inputs->AddInput(new DoubleInput(vector_enum,vector[index])); 1814 1813 } 1815 else _error 2_("could not recognize nature of vector from code " << code);1814 else _error_("could not recognize nature of vector from code " << code); 1816 1815 } 1817 1816 else { 1818 _error 2_("transient elementary inputs not supported yet!");1817 _error_("transient elementary inputs not supported yet!"); 1819 1818 } 1820 1819 } 1821 1820 else{ 1822 _error 2_("Cannot add input for vector type " << vector_type << " (not supported)");1821 _error_("Cannot add input for vector type " << vector_type << " (not supported)"); 1823 1822 } 1824 1823 … … 2248 2247 void Tria::SetClone(int* minranks){ 2249 2248 2250 _error 2_("not implemented yet");2249 _error_("not implemented yet"); 2251 2250 } 2252 2251 /*}}}*/ 2253 2252 /*FUNCTION Tria::SmearFunction {{{*/ 2254 2253 void Tria::SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){ 2255 _error 2_("not implemented yet");2254 _error_("not implemented yet"); 2256 2255 2257 2256 } … … 2330 2329 IssmDouble Tria::SurfaceArea(void){ 2331 2330 2332 int i;2333 2331 IssmDouble S; 2334 2332 IssmDouble normal[3]; … … 2341 2339 GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES); 2342 2340 2343 for (i=0;i<3;i++){2341 for(int i=0;i<3;i++){ 2344 2342 v13[i]=xyz_list[0][i]-xyz_list[2][i]; 2345 2343 v23[i]=xyz_list[1][i]-xyz_list[2][i]; … … 2350 2348 normal[2]=v13[0]*v23[1]-v13[1]*v23[0]; 2351 2349 2352 S = 0.5 * sqrt( pow(normal[0],(IssmDouble)2)+pow(normal[1],(IssmDouble)2)+pow(normal[2],(IssmDouble)2));2350 S = 0.5 * sqrt(normal[0]*normal[0] + normal[1]*normal[1] + normal[2]*normal[2]); 2353 2351 2354 2352 /*Return: */ … … 2359 2357 void Tria::SurfaceNormal(IssmDouble* surface_normal, IssmDouble xyz_list[3][3]){ 2360 2358 2361 int i;2362 2359 IssmDouble v13[3],v23[3]; 2363 2360 IssmDouble normal[3]; 2364 2361 IssmDouble normal_norm; 2365 2362 2366 for (i=0;i<3;i++){2363 for(int i=0;i<3;i++){ 2367 2364 v13[i]=xyz_list[0][i]-xyz_list[2][i]; 2368 2365 v23[i]=xyz_list[1][i]-xyz_list[2][i]; … … 2373 2370 normal[2]=v13[0]*v23[1]-v13[1]*v23[0]; 2374 2371 2375 normal_norm=sqrt( pow(normal[0],(IssmDouble)2)+pow(normal[1],(IssmDouble)2)+pow(normal[2],(IssmDouble)2));2376 2377 *(surface_normal )=normal[0]/normal_norm;2378 *(surface_normal+1) =normal[1]/normal_norm;2379 *(surface_normal+2) =normal[2]/normal_norm;2372 normal_norm=sqrt( normal[0]*normal[0] + normal[1]*normal[1] + normal[2]*normal[2]); 2373 2374 *(surface_normal+0) = normal[0]/normal_norm; 2375 *(surface_normal+1) = normal[1]/normal_norm; 2376 *(surface_normal+2) = normal[2]/normal_norm; 2380 2377 } 2381 2378 /*}}}*/ … … 2400 2397 this->MaxAbsVy(&maxabsvy,false); 2401 2398 #else 2402 _error 2_("ISSM was not compiled with responses compiled in, exiting!");2399 _error_("ISSM was not compiled with responses compiled in, exiting!"); 2403 2400 #endif 2404 2401 … … 2593 2590 2594 2591 /*First off, check that this segment belongs to this element: */ 2595 if ( (int)*(segment+4)!=this->id)_error2_("error message: segment with id " << (int)*(segment+4) << " does not belong to element with id:" << this->id);2592 if (reCast<int>(*(segment+4))!=this->id)_error_("error message: segment with id " << reCast<int>(*(segment+4)) << " does not belong to element with id:" << this->id); 2596 2593 2597 2594 /*Recover segment node locations: */ … … 2610 2607 normal[1]=sin(atan2(x1-x2,y2-y1)); 2611 2608 2612 length=sqrt(pow(x2-x1,2 .0)+pow(y2-y1,2));2609 length=sqrt(pow(x2-x1,2)+pow(y2-y1,2)); 2613 2610 2614 2611 Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input); … … 2800 2797 *presponse=this->matice->GetZbar(); 2801 2798 break; 2802 case VelEnum: 2799 case VelEnum:{ 2803 2800 2804 2801 /*Get input:*/ … … 2813 2810 2814 2811 /*Assign output pointers:*/ 2815 *presponse=vel; 2812 *presponse=vel;} 2813 break; 2816 2814 default: 2817 _error 2_("Response type " << EnumToStringx(response_enum) << " not supported yet!");2815 _error_("Response type " << EnumToStringx(response_enum) << " not supported yet!"); 2818 2816 } 2819 2817 … … 2978 2976 //velocity should be = 0. To achieve this result, we set alpha2_list to a very high value: */ 2979 2977 surface_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss); 2980 slope_magnitude=sqrt( pow(slope[0],2)+pow(slope[1],2));2978 slope_magnitude=sqrt(slope[0]*slope[0]+slope[1]*slope[1]); 2981 2979 if(slope_magnitude>MAXSLOPE) alpha2=pow((IssmDouble)10,MOUNTAINKEXPONENT); 2982 2980 else friction->GetAlpha2(&alpha2, gauss,VxEnum,VyEnum,VzEnum); … … 3302 3300 3303 3301 /*Check solution*/ 3304 if(xIsNan<IssmDouble>(vx[i])) _error 2_("NaN found in solution vector");3305 if(xIsNan<IssmDouble>(vy[i])) _error 2_("NaN found in solution vector");3302 if(xIsNan<IssmDouble>(vx[i])) _error_("NaN found in solution vector"); 3303 if(xIsNan<IssmDouble>(vy[i])) _error_("NaN found in solution vector"); 3306 3304 } 3307 3305 3308 3306 /*Get Vz and compute vel*/ 3309 3307 GetInputListOnVertices(&vz[0],VzEnum,0); 3310 for(i=0;i<NUMVERTICES;i++) vel[i]= pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);3308 for(i=0;i<NUMVERTICES;i++) vel[i]=sqrt(vx[i]*vx[i] + vy[i]*vy[i] + vz[i]*vz[i]); 3311 3309 3312 3310 /*For pressure: we have not computed pressure in this analysis, for this element. We are in 2D, … … 3362 3360 3363 3361 /*Check solution*/ 3364 if(xIsNan<IssmDouble>(vx[i])) _error 2_("NaN found in solution vector");3365 if(xIsNan<IssmDouble>(vy[i])) _error 2_("NaN found in solution vector");3362 if(xIsNan<IssmDouble>(vx[i])) _error_("NaN found in solution vector"); 3363 if(xIsNan<IssmDouble>(vy[i])) _error_("NaN found in solution vector"); 3366 3364 } 3367 3365 3368 3366 /*Now Compute vel*/ 3369 3367 GetInputListOnVertices(&vz[0],VzEnum,0.0); //default is 0 3370 for(i=0;i<NUMVERTICES;i++) vel[i]= pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);3368 for(i=0;i<NUMVERTICES;i++) vel[i]=sqrt(vx[i]*vx[i] + vy[i]*vy[i] + vz[i]*vz[i]); 3371 3369 3372 3370 /*For pressure: we have not computed pressure in this analysis, for this element. We are in 2D, … … 3418 3416 3419 3417 if (input->ObjectEnum()!=ControlInputEnum){ 3420 _error 2_("input " << EnumToStringx(control_type[i]) << " is not a ControlInput");3418 _error_("input " << EnumToStringx(control_type[i]) << " is not a ControlInput"); 3421 3419 } 3422 3420 … … 3443 3441 input=inputs->GetInput(enum_type); 3444 3442 } 3445 if (!input) _error 2_("Input " << EnumToStringx(enum_type) << " not found");3446 if (input->ObjectEnum()!=ControlInputEnum) _error 2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");3443 if (!input) _error_("Input " << EnumToStringx(enum_type) << " not found"); 3444 if (input->ObjectEnum()!=ControlInputEnum) _error_("Input " << EnumToStringx(enum_type) << " is not a ControlInput"); 3447 3445 3448 3446 GradientIndexing(&doflist1[0],control_index); … … 3461 3459 input=inputs->GetInput(enum_type); 3462 3460 } 3463 if (!input) _error 2_("Input " << EnumToStringx(enum_type) << " not found");3464 if (input->ObjectEnum()!=ControlInputEnum) _error 2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");3461 if (!input) _error_("Input " << EnumToStringx(enum_type) << " not found"); 3462 if (input->ObjectEnum()!=ControlInputEnum) _error_("Input " << EnumToStringx(enum_type) << " is not a ControlInput"); 3465 3463 3466 3464 ((ControlInput*)input)->ScaleGradient(scale); … … 3480 3478 input=inputs->GetInput(enum_type); 3481 3479 } 3482 if (!input) _error 2_("Input " << EnumToStringx(enum_type) << " not found");3483 if (input->ObjectEnum()!=ControlInputEnum) _error 2_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");3480 if (!input) _error_("Input " << EnumToStringx(enum_type) << " not found"); 3481 if (input->ObjectEnum()!=ControlInputEnum) _error_("Input " << EnumToStringx(enum_type) << " is not a ControlInput"); 3484 3482 3485 3483 GradientIndexing(&doflist1[0],control_index); … … 3518 3516 break; 3519 3517 default: 3520 _error 2_("control type not supported yet: " << control_type);3518 _error_("control type not supported yet: " << control_type); 3521 3519 } 3522 3520 … … 3548 3546 break; 3549 3547 default: 3550 _error 2_("response " << EnumToStringx(responses[resp]) << " not supported yet");3548 _error_("response " << EnumToStringx(responses[resp]) << " not supported yet"); 3551 3549 } 3552 3550 … … 4087 4085 * S obs obs 4088 4086 */ 4089 misfit=1/S* pow( pow(vx-vxobs,2.) + pow(vy-vyobs,2.) ,0.5);4087 misfit=1/S*sqrt( pow(vx-vxobs,2) + pow(vy-vyobs,2)); 4090 4088 4091 4089 if(process_units)UnitConversion(misfit,IuToExtEnum,SurfaceAverageVelMisfitEnum); … … 4150 4148 * obs 4151 4149 */ 4152 velocity_mag =sqrt(pow(vx, 2 .)+pow(vy, 2.))+epsvel;4153 obs_velocity_mag=sqrt(pow(vxobs,2 .)+pow(vyobs,2.))+epsvel;4154 misfit=4*pow(meanvel,2 .)*pow(log(velocity_mag/obs_velocity_mag),2.);4150 velocity_mag =sqrt(pow(vx, 2)+pow(vy, 2))+epsvel; 4151 obs_velocity_mag=sqrt(pow(vxobs,2)+pow(vyobs,2))+epsvel; 4152 misfit=4*pow(meanvel,2)*pow(log(velocity_mag/obs_velocity_mag),2); 4155 4153 4156 4154 if(process_units)UnitConversion(misfit,IuToExtEnum,SurfaceLogVelMisfitEnum); … … 4216 4214 * obs obs 4217 4215 */ 4218 misfit=0.5*pow(meanvel,2 .)*(4219 pow(log((fabs(vx)+epsvel)/(fabs(vxobs)+epsvel)),2 .) +4220 pow(log((fabs(vy)+epsvel)/(fabs(vyobs)+epsvel)),2 .) );4216 misfit=0.5*pow(meanvel,2)*( 4217 pow(log((fabs(vx)+epsvel)/(fabs(vxobs)+epsvel)),2) + 4218 pow(log((fabs(vy)+epsvel)/(fabs(vyobs)+epsvel)),2) ); 4221 4219 4222 4220 if(process_units)UnitConversion(misfit,IuToExtEnum,SurfaceLogVxVyMisfitEnum); … … 4279 4277 * 4280 4278 */ 4281 misfit=0.5*( pow(vx-vxobs,2 .) + pow(vy-vyobs,2.) );4279 misfit=0.5*( pow(vx-vxobs,2) + pow(vy-vyobs,2) ); 4282 4280 4283 4281 if(process_units)UnitConversion(misfit,IuToExtEnum,SurfaceAverageVelMisfitEnum); … … 4342 4340 * obs obs 4343 4341 */ 4344 scalex=pow(meanvel/(vxobs+epsvel),2 .); if(vxobs==0)scalex=0;4345 scaley=pow(meanvel/(vyobs+epsvel),2 .); if(vyobs==0)scaley=0;4346 misfit=0.5*(scalex*pow((vx-vxobs),2 .)+scaley*pow((vy-vyobs),2.));4342 scalex=pow(meanvel/(vxobs+epsvel),2); if(vxobs==0)scalex=0; 4343 scaley=pow(meanvel/(vyobs+epsvel),2); if(vyobs==0)scaley=0; 4344 misfit=0.5*(scalex*pow((vx-vxobs),2)+scaley*pow((vy-vyobs),2)); 4347 4345 if(process_units)UnitConversion(misfit,IuToExtEnum,SurfaceRelVelMisfitEnum); 4348 4346 … … 4392 4390 4393 4391 /*Tikhonov regularization: J = 1/2 ((dp/dx)^2 + (dp/dy)^2) */ 4394 Jelem+=weight*1/2*( pow(dp[0],2.)+pow(dp[1],2.))*Jdet*gauss->weight;4392 Jelem+=weight*1/2*(dp[0]*dp[0]+dp[1]*dp[1])*Jdet*gauss->weight; 4395 4393 } 4396 4394 … … 4410 4408 IssmDouble xyz_list[NUMVERTICES][3]; 4411 4409 IssmDouble dp[NDOF2]; 4412 IssmDouble vx,vy ;4410 IssmDouble vx,vy,vel; 4413 4411 GaussTria *gauss = NULL; 4414 4412 … … 4439 4437 vx_input->GetInputValue(&vx,gauss); 4440 4438 vy_input->GetInputValue(&vy,gauss); 4439 vel = sqrt(vx*vx+vy*vy); 4440 vx = vx/(vel+1.e-9); 4441 vy = vy/(vel+1.e-9); 4441 4442 4442 4443 /*J = 1/2 ( vx*dH/dx + vy*dH/dy )^2 */ … … 4459 4460 IssmDouble xyz_list[NUMVERTICES][3]; 4460 4461 IssmDouble dp[NDOF2]; 4461 IssmDouble vx,vy ;4462 IssmDouble vx,vy,vel; 4462 4463 GaussTria *gauss = NULL; 4463 4464 … … 4488 4489 vx_input->GetInputValue(&vx,gauss); 4489 4490 vy_input->GetInputValue(&vy,gauss); 4491 vel = sqrt(vx*vx+vy*vy); 4492 vx = vx/(vel+1.e-9); 4493 vy = vy/(vel+1.e-9); 4490 4494 4491 4495 /*J = 1/2 ( -vy*dH/dx + vx*dH/dy )^2 */ … … 4535 4539 4536 4540 /*compute ThicknessAbsMisfit*/ 4537 Jelem+=0.5* pow(thickness-thicknessobs,2.0)*weight*Jdet*gauss->weight;4541 Jelem+=0.5*(thickness-thicknessobs)*(thickness-thicknessobs)*weight*Jdet*gauss->weight; 4538 4542 } 4539 4543 … … 4558 4562 IssmDouble dbasis[NDOF2][NUMVERTICES]; 4559 4563 IssmDouble dH[2]; 4560 IssmDouble v [2];4564 IssmDouble vx,vy,vel; 4561 4565 GaussTria *gauss = NULL; 4562 4566 int *responses = NULL; … … 4603 4607 case ThicknessAlongGradientEnum: 4604 4608 weights_input->GetInputValue(&weight, gauss,resp); 4605 vx_input->GetInputValue(&v[0],gauss); 4606 vy_input->GetInputValue(&v[1],gauss); 4607 for(i=0;i<numdof;i++) pe->values[i]+= - weight*(dH[0]*v[0]+dH[1]*v[1])*(dbasis[0][i]*v[0]+dbasis[1][i]*v[1])*Jdet*gauss->weight; 4609 vx_input->GetInputValue(&vx,gauss); 4610 vy_input->GetInputValue(&vy,gauss); 4611 vel = sqrt(vx*vx+vy*vy); 4612 vx = vx/(vel+1.e-9); 4613 vy = vy/(vel+1.e-9); 4614 for(i=0;i<numdof;i++) pe->values[i]+= - weight*(dH[0]*vx+dH[1]*vy)*(dbasis[0][i]*vx+dbasis[1][i]*vy)*Jdet*gauss->weight; 4608 4615 break; 4609 4616 case ThicknessAcrossGradientEnum: 4610 4617 weights_input->GetInputValue(&weight, gauss,resp); 4611 vx_input->GetInputValue(&v[0],gauss); 4612 vy_input->GetInputValue(&v[1],gauss); 4613 for(i=0;i<numdof;i++) pe->values[i]+= - weight*(dH[0]*(-v[1])+dH[1]*v[0])*(dbasis[0][i]*(-v[1])+dbasis[1][i]*v[0])*Jdet*gauss->weight; 4618 vx_input->GetInputValue(&vx,gauss); 4619 vy_input->GetInputValue(&vy,gauss); 4620 vel = sqrt(vx*vx+vy*vy); 4621 vx = vx/(vel+1.e-9); 4622 vy = vy/(vel+1.e-9); 4623 for(i=0;i<numdof;i++) pe->values[i]+= - weight*(dH[0]*(-vy)+dH[1]*vx)*(dbasis[0][i]*(-vy)+dbasis[1][i]*vx)*Jdet*gauss->weight; 4614 4624 break; 4615 4625 default: 4616 _error 2_("response " << EnumToStringx(responses[resp]) << " not supported yet");4626 _error_("response " << EnumToStringx(responses[resp]) << " not supported yet"); 4617 4627 } 4618 4628 } … … 4717 4727 */ 4718 4728 for (i=0;i<NUMVERTICES;i++){ 4719 scalex=pow(meanvel/(vxobs+epsvel),2 .); if(vxobs==0)scalex=0;4720 scaley=pow(meanvel/(vyobs+epsvel),2 .); if(vyobs==0)scaley=0;4729 scalex=pow(meanvel/(vxobs+epsvel),2); if(vxobs==0)scalex=0; 4730 scaley=pow(meanvel/(vyobs+epsvel),2); if(vyobs==0)scaley=0; 4721 4731 dux=scalex*(vxobs-vx); 4722 4732 duy=scaley*(vyobs-vy); … … 4738 4748 */ 4739 4749 for (i=0;i<NUMVERTICES;i++){ 4740 velocity_mag =sqrt(pow(vx, 2 .)+pow(vy, 2.))+epsvel;4741 obs_velocity_mag=sqrt(pow(vxobs,2 .)+pow(vyobs,2.))+epsvel;4742 scale=-8*pow(meanvel,2 .)/pow(velocity_mag,2.)*log(velocity_mag/obs_velocity_mag);4750 velocity_mag =sqrt(pow(vx, 2)+pow(vy, 2))+epsvel; 4751 obs_velocity_mag=sqrt(pow(vxobs,2)+pow(vyobs,2))+epsvel; 4752 scale=-8*pow(meanvel,2)/pow(velocity_mag,2)*log(velocity_mag/obs_velocity_mag); 4743 4753 dux=scale*vx; 4744 4754 duy=scale*vy; … … 4758 4768 */ 4759 4769 for (i=0;i<NUMVERTICES;i++){ 4760 scale=1./(S*2*sqrt(pow(vx-vxobs,2 .)+pow(vy-vyobs,2.))+epsvel);4770 scale=1./(S*2*sqrt(pow(vx-vxobs,2)+pow(vy-vyobs,2))+epsvel); 4761 4771 dux=scale*(vxobs-vx); 4762 4772 duy=scale*(vyobs-vy); … … 4776 4786 */ 4777 4787 for (i=0;i<NUMVERTICES;i++){ 4778 dux = - pow(meanvel,2.)* log((fabs(vx)+epsvel)/(fabs(vxobs)+epsvel)) / (vx+epsvel);4779 duy = - pow(meanvel,2.)* log((fabs(vy)+epsvel)/(fabs(vyobs)+epsvel)) / (vy+epsvel);4788 dux = - meanvel*meanvel * log((fabs(vx)+epsvel)/(fabs(vxobs)+epsvel)) / (vx+epsvel); 4789 duy = - meanvel*meanvel * log((fabs(vy)+epsvel)/(fabs(vyobs)+epsvel)) / (vy+epsvel); 4780 4790 pe->values[i*NDOF2+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 4781 4791 pe->values[i*NDOF2+1]+=duy*weight*Jdet*gauss->weight*basis[i]; … … 4798 4808 break; 4799 4809 default: 4800 _error 2_("response " << EnumToStringx(responses[resp]) << " not supported yet");4810 _error_("response " << EnumToStringx(responses[resp]) << " not supported yet"); 4801 4811 } 4802 4812 } … … 4900 4910 */ 4901 4911 for (i=0;i<NUMVERTICES;i++){ 4902 scalex=pow(meanvel/(vxobs+epsvel),2 .); if(vxobs==0)scalex=0;4903 scaley=pow(meanvel/(vyobs+epsvel),2 .); if(vyobs==0)scaley=0;4912 scalex=pow(meanvel/(vxobs+epsvel),2); if(vxobs==0)scalex=0; 4913 scaley=pow(meanvel/(vyobs+epsvel),2); if(vyobs==0)scaley=0; 4904 4914 dux=scalex*(vxobs-vx); 4905 4915 duy=scaley*(vyobs-vy); … … 4921 4931 */ 4922 4932 for (i=0;i<NUMVERTICES;i++){ 4923 velocity_mag =sqrt(pow(vx, 2 .)+pow(vy, 2.))+epsvel;4924 obs_velocity_mag=sqrt(pow(vxobs,2 .)+pow(vyobs,2.))+epsvel;4925 scale=-8*pow(meanvel,2 .)/pow(velocity_mag,2.)*log(velocity_mag/obs_velocity_mag);4933 velocity_mag =sqrt(pow(vx, 2)+pow(vy, 2))+epsvel; 4934 obs_velocity_mag=sqrt(pow(vxobs,2)+pow(vyobs,2))+epsvel; 4935 scale=-8*pow(meanvel,2)/pow(velocity_mag,2)*log(velocity_mag/obs_velocity_mag); 4926 4936 dux=scale*vx; 4927 4937 duy=scale*vy; … … 4941 4951 */ 4942 4952 for (i=0;i<NUMVERTICES;i++){ 4943 scale=1./(S*2*sqrt(pow(vx-vxobs,2 .)+pow(vy-vyobs,2.))+epsvel);4953 scale=1./(S*2*sqrt(pow(vx-vxobs,2)+pow(vy-vyobs,2))+epsvel); 4944 4954 dux=scale*(vxobs-vx); 4945 4955 duy=scale*(vyobs-vy); … … 4959 4969 */ 4960 4970 for (i=0;i<NUMVERTICES;i++){ 4961 dux = - pow(meanvel,2.)* log((fabs(vx)+epsvel)/(fabs(vxobs)+epsvel)) / (vx+epsvel);4962 duy = - pow(meanvel,2.)* log((fabs(vy)+epsvel)/(fabs(vyobs)+epsvel)) / (vy+epsvel);4971 dux = - meanvel*meanvel * log((fabs(vx)+epsvel)/(fabs(vxobs)+epsvel)) / (vx+epsvel); 4972 duy = - meanvel*meanvel * log((fabs(vy)+epsvel)/(fabs(vyobs)+epsvel)) / (vy+epsvel); 4963 4973 pe->values[i*NDOF4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 4964 4974 pe->values[i*NDOF4+1]+=duy*weight*Jdet*gauss->weight*basis[i]; … … 4981 4991 break; 4982 4992 default: 4983 _error 2_("response " << EnumToStringx(responses[resp]) << " not supported yet");4993 _error_("response " << EnumToStringx(responses[resp]) << " not supported yet"); 4984 4994 } 4985 4995 } … … 5028 5038 5029 5039 /*Tikhonov regularization: J = 1/2 ((dp/dx)^2 + (dp/dy)^2) */ 5030 Jelem+=weight*1/2*( pow(dp[0],2.)+pow(dp[1],2.))*Jdet*gauss->weight;5040 Jelem+=weight*1/2*(dp[0]*dp[0]+dp[1]*dp[1])*Jdet*gauss->weight; 5031 5041 } 5032 5042 … … 5050 5060 break; 5051 5061 default: 5052 _error 2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");5062 _error_("Element type " << EnumToStringx(GetElementType()) << " not supported yet"); 5053 5063 } 5054 5064 … … 5151 5161 5152 5162 /*Check solution*/ 5153 if(xIsNan<IssmDouble>(lambdax[i])) _error 2_("NaN found in solution vector");5154 if(xIsNan<IssmDouble>(lambday[i])) _error 2_("NaN found in solution vector");5163 if(xIsNan<IssmDouble>(lambdax[i])) _error_("NaN found in solution vector"); 5164 if(xIsNan<IssmDouble>(lambday[i])) _error_("NaN found in solution vector"); 5155 5165 } 5156 5166 … … 5182 5192 for(i=0;i<numdof;i++){ 5183 5193 lambda[i]=values[i]; 5184 if(xIsNan<IssmDouble>(lambda[i])) _error 2_("NaN found in solution vector");5194 if(xIsNan<IssmDouble>(lambda[i])) _error_("NaN found in solution vector"); 5185 5195 } 5186 5196 … … 5205 5215 5206 5216 /*Get input (either in element or material)*/ 5207 if(control_enum==MaterialsRheologyBbarEnum ){5217 if(control_enum==MaterialsRheologyBbarEnum || control_enum==MaterialsRheologyZbarEnum){ 5208 5218 input=(Input*)matice->inputs->GetInput(control_enum); _assert_(input); 5209 5219 } … … 5214 5224 /*Check that it is a ControlInput*/ 5215 5225 if (input->ObjectEnum()!=ControlInputEnum){ 5216 _error 2_("input " << EnumToStringx(control_enum) << " is not a ControlInput");5226 _error_("input " << EnumToStringx(control_enum) << " is not a ControlInput"); 5217 5227 } 5218 5228 … … 5240 5250 new_input = new TriaP1Input(control_enum,values); 5241 5251 5242 if(control_enum==MaterialsRheologyBbarEnum ){5252 if(control_enum==MaterialsRheologyBbarEnum || control_enum==MaterialsRheologyZbarEnum){ 5243 5253 input=(Input*)matice->inputs->GetInput(control_enum); _assert_(input); 5244 5254 } … … 5248 5258 5249 5259 if (input->ObjectEnum()!=ControlInputEnum){ 5250 _error 2_("input " << EnumToStringx(control_enum) << " is not a ControlInput");5260 _error_("input " << EnumToStringx(control_enum) << " is not a ControlInput"); 5251 5261 } 5252 5262 … … 5285 5295 5286 5296 /* compute VelocityFactor */ 5287 VelocityFactor= n_man* pow(CR,2)*rho_water*g/mu_water;5297 VelocityFactor= n_man*CR*CR*rho_water*g/mu_water; 5288 5298 5289 5299 gauss=new GaussTria(); … … 5297 5307 5298 5308 /* Water velocity x and y components */ 5299 // vx[iv]= - pow(w,2)/(12 * mu_water)*(rho_ice*g*dsdx+(rho_water-rho_ice)*g*dbdx); 5300 // vy[iv]= - pow(w,2)/(12 * mu_water)*(rho_ice*g*dsdy+(rho_water-rho_ice)*g*dbdy); 5301 5302 vx[iv]= - pow(w,2)/(VelocityFactor* mu_water)*(rho_ice*g*dsdx+(rho_water-rho_ice)*g*dbdx); 5303 vy[iv]= - pow(w,2)/(VelocityFactor* mu_water)*(rho_ice*g*dsdy+(rho_water-rho_ice)*g*dbdy); 5309 // vx[iv]= - w*w/(12 * mu_water)*(rho_ice*g*dsdx+(rho_water-rho_ice)*g*dbdx); 5310 // vy[iv]= - w*w/(12 * mu_water)*(rho_ice*g*dsdy+(rho_water-rho_ice)*g*dbdy); 5311 vx[iv]= - w*w/(VelocityFactor* mu_water)*(rho_ice*g*dsdx+(rho_water-rho_ice)*g*dbdx); 5312 vy[iv]= - w*w/(VelocityFactor* mu_water)*(rho_ice*g*dsdy+(rho_water-rho_ice)*g*dbdy); 5304 5313 } 5305 5314 … … 5396 5405 5397 5406 /*Artificial diffusivity*/ 5398 vel=sqrt( pow(vx,2.)+pow(vy,2.));5407 vel=sqrt(vx*vx+vy*vy); 5399 5408 K[0][0]=diffusivity*h/(2*vel)*vx*vx; 5400 5409 K[1][0]=diffusivity*h/(2*vel)*vy*vx; … … 5457 5466 old_watercolumn_input->GetInputValue(&old_watercolumn_g,gauss); 5458 5467 5459 if( dt)for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*(old_watercolumn_g+dt*basal_melting_g)*basis[i];5468 if(reCast<int,IssmDouble>(dt))for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*(old_watercolumn_g+dt*basal_melting_g)*basis[i]; 5460 5469 else for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*basal_melting_g*basis[i]; 5461 5470 } … … 5506 5515 5507 5516 /*Intermediaries*/ 5508 const int numdof = NDOF1*NUMVERTICES; 5509 5510 int i; 5511 int* doflist=NULL; 5512 IssmDouble values[numdof]; 5517 const int numdof = NDOF1 *NUMVERTICES; 5518 int *doflist = NULL; 5519 IssmDouble values[numdof]; 5513 5520 5514 5521 /*Get dof list: */ … … 5516 5523 5517 5524 /*Use the dof list to index into the solution vector: */ 5518 for(i =0;i<numdof;i++){5525 for(int i=0;i<numdof;i++){ 5519 5526 values[i]=solution[doflist[i]]; 5520 if(xIsNan<IssmDouble>(values[i])) _error2_("NaN found in solution vector"); 5521 if (values[i]<pow((IssmDouble)10,(IssmDouble)-10))values[i]=pow((IssmDouble)10,(IssmDouble)-10); //correcting the water column to positive values 5522 5527 if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector"); 5528 if (values[i]<10e-10) values[i]=10e-10; //correcting the water column to positive values 5523 5529 } 5524 5530 … … 5617 5623 5618 5624 default: 5619 _error 2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");5625 _error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet"); 5620 5626 } 5621 5627 … … 5624 5630 /*FUNCTION Tria::InputUpdateFromVectorDakota(int* vector, int name, int type);{{{*/ 5625 5631 void Tria::InputUpdateFromVectorDakota(int* vector, int name, int type){ 5626 _error 2_("not supported yet!");5632 _error_("not supported yet!"); 5627 5633 } 5628 5634 /*}}}*/ 5629 5635 /*FUNCTION Tria::InputUpdateFromVectorDakota(bool* vector, int name, int type);{{{*/ 5630 5636 void Tria::InputUpdateFromVectorDakota(bool* vector, int name, int type){ 5631 _error 2_("not supported yet!");5637 _error_("not supported yet!"); 5632 5638 } 5633 5639 /*}}}*/ … … 5671 5677 5672 5678 default: 5673 _error 2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");5679 _error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet"); 5674 5680 } 5675 5681 … … 5688 5694 return CreateKMatrixBalancethickness_DG(); 5689 5695 default: 5690 _error 2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");5696 _error_("Element type " << EnumToStringx(GetElementType()) << " not supported yet"); 5691 5697 } 5692 5698 … … 5771 5777 if(stabilization==1){ 5772 5778 /*Streamline upwinding*/ 5773 vel=sqrt( pow(vx,2.)+pow(vy,2.));5779 vel=sqrt(vx*vx+vy*vy); 5774 5780 K[0][0]=h/(2*vel)*vx*vx; 5775 5781 K[1][0]=h/(2*vel)*vy*vx; … … 5867 5873 return CreatePVectorBalancethickness_DG(); 5868 5874 default: 5869 _error 2_("Element type " << EnumToStringx(GetElementType()) << " not supported yet");5875 _error_("Element type " << EnumToStringx(GetElementType()) << " not supported yet"); 5870 5876 } 5871 5877 } -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Elements/Tria.h
r12946 r13101 100 100 void InputToResult(int enum_type,int step,IssmDouble time); 101 101 void DeleteResults(void); 102 void MaterialUpdateFromTemperature(void){_error 2_("not implemented yet");};102 void MaterialUpdateFromTemperature(void){_error_("not implemented yet");}; 103 103 void MigrateGroundingLine(IssmDouble* oldfloating,IssmDouble* sheet_ungrounding); 104 104 int NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units); … … 110 110 void PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes); 111 111 void ProcessResultsUnits(void); 112 void ResetCoordinateSystem(void){_error 2_("not implemented yet");};112 void ResetCoordinateSystem(void){_error_("not implemented yet");}; 113 113 void SmbGradients(); 114 114 IssmDouble SurfaceArea(void); … … 179 179 ElementMatrix* CreateKMatrixPrognostic_CG(void); 180 180 ElementMatrix* CreateKMatrixPrognostic_DG(void); 181 ElementMatrix* Create KMatrixSlope(void);181 ElementMatrix* CreateMassMatrix(void); 182 182 ElementVector* CreatePVectorBalancethickness(void); 183 183 ElementVector* CreatePVectorBalancethickness_DG(void); -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Elements/TriaRef.cpp
r12832 r13101 338 338 339 339 *Jdet=1.0/2.0*sqrt(pow(x2-x1,2.) + pow(y2-y1,2.)); 340 if(*Jdet<0) _error 2_("negative jacobian determinant!");340 if(*Jdet<0) _error_("negative jacobian determinant!"); 341 341 342 342 } … … 353 353 /*Get Determinant*/ 354 354 Matrix2x2Determinant(Jdet,&J[0][0]); 355 if(*Jdet<0) _error 2_("negative jacobian determinant!");355 if(*Jdet<0) _error_("negative jacobian determinant!"); 356 356 357 357 } … … 375 375 376 376 *Jdet=SQRT3/6.0*pow(pow(((y2-y1)*(z3-z1)-(z2-z1)*(y3-y1)),2.0)+pow(((z2-z1)*(x3-x1)-(x2-x1)*(z3-z1)),2.0)+pow(((x2-x1)*(y3-y1)-(y2-y1)*(x3-x1)),2.0),0.5); 377 if(*Jdet<0) _error 2_("negative jacobian determinant!");377 if(*Jdet<0) _error_("negative jacobian determinant!"); 378 378 379 379 } -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Inputs/BoolInput.cpp
r12832 r13101 112 112 /*}}}*/ 113 113 /*FUNCTION BoolInput::GetInputValue(int* pvalue){{{*/ 114 void BoolInput::GetInputValue(int* pvalue){_error 2_("not supported yet!");}114 void BoolInput::GetInputValue(int* pvalue){_error_("not supported yet!");} 115 115 /*}}}*/ 116 116 /*FUNCTION BoolInput::GetInputValue(IssmDouble* pvalue){{{*/ 117 void BoolInput::GetInputValue(IssmDouble* pvalue){_error 2_("not supported yet!");}117 void BoolInput::GetInputValue(IssmDouble* pvalue){_error_("not supported yet!");} 118 118 /*}}}*/ 119 119 /*FUNCTION BoolInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){{{*/ 120 void BoolInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error 2_("not supported yet!");}120 void BoolInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error_("not supported yet!");} 121 121 /*}}}*/ 122 122 /*FUNCTION BoolInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){{{*/ 123 void BoolInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error 2_("not supported yet!");}123 void BoolInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error_("not supported yet!");} 124 124 /*}}}*/ 125 125 /*FUNCTION BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){{{*/ 126 void BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error 2_("not supported yet!");}126 void BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error_("not supported yet!");} 127 127 /*}}}*/ 128 128 /*FUNCTION BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){{{*/ 129 void BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not supported yet!");}129 void BoolInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not supported yet!");} 130 130 /*}}}*/ 131 131 /*FUNCTION BoolInput::ChangeEnum{{{*/ … … 161 161 162 162 default: 163 _error 2_("not implemented yet");163 _error_("not implemented yet"); 164 164 } 165 165 … … 176 176 void BoolInput::GetVectorFromInputs(Vector* vector,int* doflist){ 177 177 178 _error 2_("not supporte yet!");178 _error_("not supporte yet!"); 179 179 180 180 } … … 183 183 void BoolInput::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){ 184 184 185 _error 2_("not supported yet!");185 _error_("not supported yet!"); 186 186 187 187 } -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Inputs/BoolInput.h
r12832 r13101 37 37 int InstanceEnum(); 38 38 Input* SpawnTriaInput(int* indices); 39 Input* PointwiseDivide(Input* inputB){_error 2_("not implemented yet");};40 Input* PointwiseMin(Input* inputB){_error 2_("not implemented yet");};41 Input* PointwiseMax(Input* inputB){_error 2_("not implemented yet");};39 Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");}; 40 Input* PointwiseMin(Input* inputB){_error_("not implemented yet");}; 41 Input* PointwiseMax(Input* inputB){_error_("not implemented yet");}; 42 42 ElementResult* SpawnResult(int step, IssmDouble time); 43 43 void Configure(Parameters* parameters); 44 void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error 2_("not supported yet");};44 void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");}; 45 45 /*}}}*/ 46 46 /*numerics: {{{*/ … … 50 50 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss); 51 51 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss); 52 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error 2_("not implemented yet");};53 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error 2_("not implemented yet");};54 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error 2_("not implemented yet");};55 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error 2_("not implemented yet");};52 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");}; 53 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");}; 54 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");}; 55 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");}; 56 56 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss); 57 57 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss); 58 void GetInputAverage(IssmDouble* pvalue){_error 2_("not implemented yet");};59 void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error 2_("not implemented yet");};60 void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error 2_("not implemented yet");};61 void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};62 void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};63 void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};64 void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};65 void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};58 void GetInputAverage(IssmDouble* pvalue){_error_("not implemented yet");}; 59 void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");}; 60 void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");}; 61 void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 62 void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 63 void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 64 void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 65 void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 66 66 void ChangeEnum(int newenumtype); 67 67 void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters); 68 void ConstrainMin(IssmDouble minimum){_error 2_("not implemented yet");};69 IssmDouble InfinityNorm(void){_error 2_("InfinityNorm not implemented for booleans");};70 IssmDouble Max(void){_error 2_("Max not implemented for booleans");};71 IssmDouble MaxAbs(void){_error 2_("Max not implemented for booleans");};72 IssmDouble Min(void){_error 2_("Min not implemented for booleans");};73 IssmDouble MinAbs(void){_error 2_("Min not implemented for booleans");};68 void ConstrainMin(IssmDouble minimum){_error_("not implemented yet");}; 69 IssmDouble InfinityNorm(void){_error_("InfinityNorm not implemented for booleans");}; 70 IssmDouble Max(void){_error_("Max not implemented for booleans");}; 71 IssmDouble MaxAbs(void){_error_("Max not implemented for booleans");}; 72 IssmDouble Min(void){_error_("Min not implemented for booleans");}; 73 IssmDouble MinAbs(void){_error_("Min not implemented for booleans");}; 74 74 void Scale(IssmDouble scale_factor); 75 void ArtificialNoise(IssmDouble min,IssmDouble max){_error 2_("not implemented yet");};75 void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");}; 76 76 void AXPY(Input* xinput,IssmDouble scalar); 77 void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error 2_("Constrain not implemented for booleans");};77 void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error_("Constrain not implemented for booleans");}; 78 78 void Extrude(void); 79 void VerticallyIntegrate(Input* thickness_input){_error 2_("not supported yet");};79 void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");}; 80 80 void GetVectorFromInputs(Vector* vector,int* doflist); 81 81 void GetValuesPtr(IssmDouble** pvalues,int* pnum_values); -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Inputs/ControlInput.cpp
r12832 r13101 48 48 break; 49 49 default: 50 _error 2_("Input of Enum " << EnumToStringx(enum_input) << " not supported yet by ControlInput");50 _error_("Input of Enum " << EnumToStringx(enum_input) << " not supported yet by ControlInput"); 51 51 } 52 52 gradient =NULL; … … 152 152 /*FUNCTION ControlInput::ScaleGradient{{{*/ 153 153 void ControlInput::ScaleGradient(IssmDouble scaling_factor){ 154 if(!gradient) _error 2_("Gradient of ControlInput " << EnumToStringx(enum_type) << " not found");154 if(!gradient) _error_("Gradient of ControlInput " << EnumToStringx(enum_type) << " not found"); 155 155 gradient->Scale(scaling_factor); 156 156 }/*}}}*/ … … 170 170 break; 171 171 default: 172 _error 2_("more than 3 controls not implemented yet (Gradient " << this->control_id << " was requested). EnumDefinitions.h needs to be updated.");172 _error_("more than 3 controls not implemented yet (Gradient " << this->control_id << " was requested). EnumDefinitions.h needs to be updated."); 173 173 } 174 174 … … 221 221 } 222 222 else{ 223 _error 2_("Data " << data << " not supported yet");223 _error_("Data " << data << " not supported yet"); 224 224 } 225 225 }/*}}}*/ … … 258 258 /*FUNCTION ControlInput::SaveValue{{{*/ 259 259 void ControlInput::SaveValue(void){ 260 if(!values) _error 2_("Values of " << EnumToStringx(this->enum_type) << " not found");260 if(!values) _error_("Values of " << EnumToStringx(this->enum_type) << " not found"); 261 261 262 262 if(savedvalues) delete this->savedvalues; … … 265 265 /*FUNCTION ControlInput::UpdateValue{{{*/ 266 266 void ControlInput::UpdateValue(IssmDouble scalar){ 267 if(!gradient) _error 2_("Gradient of " << EnumToStringx(this->enum_type) << " not found");268 if(!savedvalues) _error 2_("Values of " << EnumToStringx(this->enum_type) << " not found");267 if(!gradient) _error_("Gradient of " << EnumToStringx(this->enum_type) << " not found"); 268 if(!savedvalues) _error_("Values of " << EnumToStringx(this->enum_type) << " not found"); 269 269 270 270 if(values) delete this->values; -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Inputs/ControlInput.h
r12832 r13101 41 41 int InstanceEnum(); 42 42 Input* SpawnTriaInput(int* indices); 43 Input* PointwiseDivide(Input* inputB){_error 2_("not implemented yet");};44 Input* PointwiseMin(Input* inputB){_error 2_("not implemented yet");};45 Input* PointwiseMax(Input* inputB){_error 2_("not implemented yet");};43 Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");}; 44 Input* PointwiseMin(Input* inputB){_error_("not implemented yet");}; 45 Input* PointwiseMax(Input* inputB){_error_("not implemented yet");}; 46 46 ElementResult* SpawnResult(int step, IssmDouble time); 47 void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error 2_("not supported yet");};47 void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");}; 48 48 void Configure(Parameters* parameters); 49 49 /*}}}*/ … … 55 55 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss); 56 56 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss); 57 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error 2_("not implemented yet");};58 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error 2_("not implemented yet");};59 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error 2_("not implemented yet");};60 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error 2_("not implemented yet");};57 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");}; 58 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");}; 59 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");}; 60 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");}; 61 61 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss); 62 62 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss); 63 63 void GetInputAverage(IssmDouble* pvalue); 64 void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error 2_("not implemented yet");};65 void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error 2_("not implemented yet");};66 void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};67 void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};68 void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};69 void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};70 void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};71 void ChangeEnum(int newenumtype){_error 2_("not implemented yet");};72 void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){_error 2_("not implemented yet");};73 void ConstrainMin(IssmDouble minimum){_error 2_("not implemented yet");};74 void Scale(IssmDouble scale_factor){_error 2_("not implemented yet");};75 void ArtificialNoise(IssmDouble min,IssmDouble max){_error 2_("not implemented yet");};76 void AXPY(Input* xinput,IssmDouble scalar){_error 2_("not implemented yet");};64 void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");}; 65 void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");}; 66 void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 67 void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 68 void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 69 void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 70 void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 71 void ChangeEnum(int newenumtype){_error_("not implemented yet");}; 72 void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){_error_("not implemented yet");}; 73 void ConstrainMin(IssmDouble minimum){_error_("not implemented yet");}; 74 void Scale(IssmDouble scale_factor){_error_("not implemented yet");}; 75 void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");}; 76 void AXPY(Input* xinput,IssmDouble scalar){_error_("not implemented yet");}; 77 77 void Constrain(void); 78 78 void Constrain(IssmDouble min,IssmDouble max); 79 IssmDouble InfinityNorm(void){_error 2_("not implemented yet");};80 IssmDouble Max(void){_error 2_("not implemented yet");};81 IssmDouble MaxAbs(void){_error 2_("not implemented yet");};82 IssmDouble Min(void){_error 2_("not implemented yet");};83 IssmDouble MinAbs(void){_error 2_("not implemented yet");};79 IssmDouble InfinityNorm(void){_error_("not implemented yet");}; 80 IssmDouble Max(void){_error_("not implemented yet");}; 81 IssmDouble MaxAbs(void){_error_("not implemented yet");}; 82 IssmDouble Min(void){_error_("not implemented yet");}; 83 IssmDouble MinAbs(void){_error_("not implemented yet");}; 84 84 void Extrude(void); 85 85 void VerticallyIntegrate(Input* thickness_input); 86 86 void GetVectorFromInputs(Vector* vector,int* doflist,const char* data); 87 87 void GetVectorFromInputs(Vector* vector,int* doflist); 88 void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error 2_("not implemented yet");};88 void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not implemented yet");}; 89 89 ElementResult* SpawnGradient(int step, IssmDouble time); 90 90 void GetGradient(Vector* gradient_vec,int* doflist); -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Inputs/DatasetInput.cpp
r12832 r13101 115 115 116 116 /*Get requested input within dataset*/ 117 if(index<0 || index > inputs->Size()-1) _error 2_("index requested (" << index << ") exceeds dataset size (" << inputs->Size() << ")");117 if(index<0 || index > inputs->Size()-1) _error_("index requested (" << index << ") exceeds dataset size (" << inputs->Size() << ")"); 118 118 Input* input=(Input*)this->inputs->GetObjectByOffset(index); 119 119 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Inputs/DatasetInput.h
r12832 r13101 37 37 int InstanceEnum(); 38 38 Input* SpawnTriaInput(int* indices); 39 Input* PointwiseDivide(Input* inputB){_error 2_("not implemented yet");};40 Input* PointwiseMin(Input* inputB){_error 2_("not implemented yet");};41 Input* PointwiseMax(Input* inputB){_error 2_("not implemented yet");};42 ElementResult* SpawnResult(int step, IssmDouble time){_error 2_("not implemented yet");};43 void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error 2_("not supported yet");};39 Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");}; 40 Input* PointwiseMin(Input* inputB){_error_("not implemented yet");}; 41 Input* PointwiseMax(Input* inputB){_error_("not implemented yet");}; 42 ElementResult* SpawnResult(int step, IssmDouble time){_error_("not implemented yet");}; 43 void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");}; 44 44 void Configure(Parameters* parameters); 45 45 /*}}}*/ 46 46 /*numerics: {{{*/ 47 void GetInputValue(bool* pvalue){_error 2_("not implemented yet");};48 void GetInputValue(int* pvalue){_error 2_("not implemented yet");};49 void GetInputValue(IssmDouble* pvalue){_error 2_("not implemented yet");};50 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error 2_("not implemented yet");};51 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error 2_("not implemented yet");};52 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error 2_("not implemented yet");};53 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error 2_("not implemented yet");};47 void GetInputValue(bool* pvalue){_error_("not implemented yet");}; 48 void GetInputValue(int* pvalue){_error_("not implemented yet");}; 49 void GetInputValue(IssmDouble* pvalue){_error_("not implemented yet");}; 50 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error_("not implemented yet");}; 51 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error_("not implemented yet");}; 52 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");}; 53 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");}; 54 54 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index); 55 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error 2_("not implemented yet");};56 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error 2_("not implemented yet");};57 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};58 void GetInputAverage(IssmDouble* pvalue){_error 2_("not implemented yet");};59 void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error 2_("not implemented yet");};60 void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error 2_("not implemented yet");};61 void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};62 void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};63 void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};64 void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};65 void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};66 void ChangeEnum(int newenumtype){_error 2_("not implemented yet");};67 void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){_error 2_("not implemented yet");};68 void ConstrainMin(IssmDouble minimum){_error 2_("not implemented yet");};69 void Scale(IssmDouble scale_factor){_error 2_("not implemented yet");};70 void ArtificialNoise(IssmDouble min,IssmDouble max){_error 2_("not implemented yet");};71 void AXPY(Input* xinput,IssmDouble scalar){_error 2_("not implemented yet");};72 void Constrain(void){_error 2_("not implemented yet");};73 void Constrain(IssmDouble min,IssmDouble max){_error 2_("not implemented yet");};74 IssmDouble InfinityNorm(void){_error 2_("not implemented yet");};75 IssmDouble Max(void){_error 2_("not implemented yet");};76 IssmDouble MaxAbs(void){_error 2_("not implemented yet");};77 IssmDouble Min(void){_error 2_("not implemented yet");};78 IssmDouble MinAbs(void){_error 2_("not implemented yet");};79 void Extrude(void){_error 2_("not implemented yet");};80 void VerticallyIntegrate(Input* thickness_input){_error 2_("not implemented yet");};81 void GetVectorFromInputs(Vector* vector,int* doflist){_error 2_("not implemented yet");};82 void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error 2_("not implemented yet");};83 ElementResult* SpawnGradient(int step, IssmDouble time){_error 2_("not implemented yet");};84 void GetGradient(Vector* gradient_vec,int* doflist){_error 2_("not implemented yet");};85 void ScaleGradient(IssmDouble scale){_error 2_("not implemented yet");};86 void SetGradient(Input* gradient_in){_error 2_("not implemented yet");};87 void UpdateValue(IssmDouble scalar){_error 2_("not implemented yet");};88 void SaveValue(void){_error 2_("not implemented yet");};55 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");}; 56 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");}; 57 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 58 void GetInputAverage(IssmDouble* pvalue){_error_("not implemented yet");}; 59 void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");}; 60 void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");}; 61 void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 62 void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 63 void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 64 void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 65 void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 66 void ChangeEnum(int newenumtype){_error_("not implemented yet");}; 67 void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters){_error_("not implemented yet");}; 68 void ConstrainMin(IssmDouble minimum){_error_("not implemented yet");}; 69 void Scale(IssmDouble scale_factor){_error_("not implemented yet");}; 70 void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");}; 71 void AXPY(Input* xinput,IssmDouble scalar){_error_("not implemented yet");}; 72 void Constrain(void){_error_("not implemented yet");}; 73 void Constrain(IssmDouble min,IssmDouble max){_error_("not implemented yet");}; 74 IssmDouble InfinityNorm(void){_error_("not implemented yet");}; 75 IssmDouble Max(void){_error_("not implemented yet");}; 76 IssmDouble MaxAbs(void){_error_("not implemented yet");}; 77 IssmDouble Min(void){_error_("not implemented yet");}; 78 IssmDouble MinAbs(void){_error_("not implemented yet");}; 79 void Extrude(void){_error_("not implemented yet");}; 80 void VerticallyIntegrate(Input* thickness_input){_error_("not implemented yet");}; 81 void GetVectorFromInputs(Vector* vector,int* doflist){_error_("not implemented yet");}; 82 void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not implemented yet");}; 83 ElementResult* SpawnGradient(int step, IssmDouble time){_error_("not implemented yet");}; 84 void GetGradient(Vector* gradient_vec,int* doflist){_error_("not implemented yet");}; 85 void ScaleGradient(IssmDouble scale){_error_("not implemented yet");}; 86 void SetGradient(Input* gradient_in){_error_("not implemented yet");}; 87 void UpdateValue(IssmDouble scalar){_error_("not implemented yet");}; 88 void SaveValue(void){_error_("not implemented yet");}; 89 89 /*}}}*/ 90 90 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Inputs/DoubleInput.cpp
r12832 r13101 108 108 /*FUNCTION DoubleInput::GetInputValue(bool* pvalue) {{{*/ 109 109 void DoubleInput::GetInputValue(bool* pvalue){ 110 _error 2_("Double input of enum " << EnumToStringx(enum_type) << " cannot return a boolean");110 _error_("Double input of enum " << EnumToStringx(enum_type) << " cannot return a boolean"); 111 111 112 112 } … … 114 114 /*FUNCTION DoubleInput::GetInputValue(int* pvalue){{{*/ 115 115 void DoubleInput::GetInputValue(int* pvalue){ 116 _error 2_("Double input of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");116 _error_("Double input of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer"); 117 117 118 118 } … … 132 132 /*}}}*/ 133 133 /*FUNCTION DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){{{*/ 134 void DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error 2_("not supported yet!");}134 void DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error_("not supported yet!");} 135 135 /*}}}*/ 136 136 /*FUNCTION DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){{{*/ 137 void DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not supported yet!");}137 void DoubleInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not supported yet!");} 138 138 /*}}}*/ 139 139 /*FUNCTION DoubleInput::GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){{{*/ … … 217 217 218 218 default: 219 _error 2_("not implemented yet");219 _error_("not implemented yet"); 220 220 } 221 221 … … 253 253 void DoubleInput::GetVectorFromInputs(Vector* vector,int* doflist){ 254 254 255 _error 2_("not supporte yet!");255 _error_("not supporte yet!"); 256 256 257 257 } … … 260 260 void DoubleInput::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){ 261 261 262 _error 2_("not supported yet!");262 _error_("not supported yet!"); 263 263 264 264 } … … 276 276 277 277 /*Check that input provided is a thickness*/ 278 if (thickness_input->InstanceEnum()!=ThicknessEnum) _error 2_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");278 if (thickness_input->InstanceEnum()!=ThicknessEnum) _error_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")"); 279 279 280 280 /*vertically integrate depending on type:*/ … … 287 287 288 288 default: 289 _error 2_("not implemented yet");289 _error_("not implemented yet"); 290 290 } 291 291 } -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Inputs/DoubleInput.h
r12832 r13101 40 40 Input* PointwiseMax(Input* inputB); 41 41 ElementResult* SpawnResult(int step, IssmDouble time); 42 void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error 2_("not supported yet");};42 void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");}; 43 43 void Configure(Parameters* parameters); 44 44 /*}}}*/ … … 49 49 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss); 50 50 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss); 51 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error 2_("not implemented yet");};52 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error 2_("not implemented yet");};53 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error 2_("not implemented yet");};54 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error 2_("not implemented yet");};51 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");}; 52 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");}; 53 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");}; 54 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");}; 55 55 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss); 56 56 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss); … … 67 67 void ConstrainMin(IssmDouble minimum); 68 68 void Scale(IssmDouble scale_factor); 69 void ArtificialNoise(IssmDouble min,IssmDouble max){_error 2_("not implemented yet");};69 void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");}; 70 70 void AXPY(Input* xinput,IssmDouble scalar); 71 71 void Constrain(IssmDouble cm_min, IssmDouble cm_max); 72 IssmDouble InfinityNorm(void){_error 2_("not implemented yet");};72 IssmDouble InfinityNorm(void){_error_("not implemented yet");}; 73 73 IssmDouble Max(void); 74 74 IssmDouble MaxAbs(void); 75 75 IssmDouble Min(void); 76 76 IssmDouble MinAbs(void); 77 void Extrude(void){_error 2_("not supported yet");};77 void Extrude(void){_error_("not supported yet");}; 78 78 void VerticallyIntegrate(Input* thickness_input); 79 79 void GetVectorFromInputs(Vector* vector,int* doflist); -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Inputs/IntInput.cpp
r12832 r13101 99 99 ElementResult* IntInput::SpawnResult(int step, IssmDouble time){ 100 100 101 _error 2_("not supported yet!");101 _error_("not supported yet!"); 102 102 103 103 } … … 106 106 /*Object functions*/ 107 107 /*FUNCTION IntInput::GetInputValue(bool* pvalue) {{{*/ 108 void IntInput::GetInputValue(bool* pvalue){_error 2_("not supported yet!");}108 void IntInput::GetInputValue(bool* pvalue){_error_("not supported yet!");} 109 109 /*}}}*/ 110 110 /*FUNCTION IntInput::GetInputValue(int* pvalue){{{*/ … … 115 115 /*FUNCTION IntInput::GetInputValue(IssmDouble* pvalue){{{*/ 116 116 void IntInput::GetInputValue(IssmDouble* pvalue){ 117 _error 2_("IntInput cannot return a IssmDouble in parallel");117 _error_("IntInput cannot return a IssmDouble in parallel"); 118 118 } 119 119 /*}}}*/ 120 120 /*FUNCTION IntInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){{{*/ 121 void IntInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error 2_("not supported yet!");}121 void IntInput::GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error_("not supported yet!");} 122 122 /*}}}*/ 123 123 /*FUNCTION IntInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){{{*/ 124 void IntInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error 2_("not supported yet!");}124 void IntInput::GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error_("not supported yet!");} 125 125 /*}}}*/ 126 126 /*FUNCTION IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){{{*/ 127 void IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error 2_("not supported yet!");}127 void IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error_("not supported yet!");} 128 128 /*}}}*/ 129 129 /*FUNCTION IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){{{*/ 130 void IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not supported yet!");}130 void IntInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not supported yet!");} 131 131 /*}}}*/ 132 132 /*FUNCTION IntInput::ChangeEnum{{{*/ … … 166 166 167 167 default: 168 _error 2_("not implemented yet");168 _error_("not implemented yet"); 169 169 } 170 170 … … 182 182 void IntInput::GetVectorFromInputs(Vector* vector,int* doflist){ 183 183 184 _error 2_("not supporte yet!");184 _error_("not supporte yet!"); 185 185 186 186 } … … 189 189 void IntInput::GetValuesPtr(IssmDouble** pvalues,int* pnum_values){ 190 190 191 _error 2_("not supported yet!");191 _error_("not supported yet!"); 192 192 193 193 } -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Inputs/IntInput.h
r12832 r13101 37 37 int InstanceEnum(); 38 38 Input* SpawnTriaInput(int* indices); 39 Input* PointwiseDivide(Input* inputB){_error 2_("not implemented yet");};40 Input* PointwiseMin(Input* inputB){_error 2_("not implemented yet");};41 Input* PointwiseMax(Input* inputB){_error 2_("not implemented yet");};39 Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");}; 40 Input* PointwiseMin(Input* inputB){_error_("not implemented yet");}; 41 Input* PointwiseMax(Input* inputB){_error_("not implemented yet");}; 42 42 ElementResult* SpawnResult(int step, IssmDouble time); 43 void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error 2_("not supported yet");};43 void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");}; 44 44 void Configure(Parameters* parameters); 45 45 /*}}}*/ … … 50 50 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss); 51 51 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss); 52 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error 2_("not implemented yet");};53 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error 2_("not implemented yet");};54 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error 2_("not implemented yet");};55 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error 2_("not implemented yet");};52 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");}; 53 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");}; 54 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");}; 55 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");}; 56 56 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss); 57 57 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss); 58 void GetInputAverage(IssmDouble* pvalue){_error 2_("not implemented yet");};59 void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error 2_("not implemented yet");};60 void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error 2_("not implemented yet");};61 void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};62 void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};63 void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};64 void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};65 void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};58 void GetInputAverage(IssmDouble* pvalue){_error_("not implemented yet");}; 59 void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");}; 60 void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");}; 61 void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 62 void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 63 void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 64 void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 65 void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 66 66 void ChangeEnum(int newenumtype); 67 67 void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters); 68 void ConstrainMin(IssmDouble minimum){_error 2_("not implemented yet");};68 void ConstrainMin(IssmDouble minimum){_error_("not implemented yet");}; 69 69 void Scale(IssmDouble scale_factor); 70 void ArtificialNoise(IssmDouble min,IssmDouble max){_error 2_("not implemented yet");};70 void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");}; 71 71 void AXPY(Input* xinput,IssmDouble scalar); 72 72 void Constrain(IssmDouble cm_min, IssmDouble cm_max); 73 IssmDouble InfinityNorm(void){_error 2_("InfinityNorm not implemented for integers");};74 IssmDouble Max(void){_error 2_("Max not implemented for integers");};75 IssmDouble MaxAbs(void){_error 2_("Max not implemented for integers");};76 IssmDouble Min(void){_error 2_("Min not implemented for integers");};77 IssmDouble MinAbs(void){_error 2_("Min not implemented for integers");};78 void Extrude(void){_error 2_("not supported yet");};79 void VerticallyIntegrate(Input* thickness_input){_error 2_("not supported yet");};73 IssmDouble InfinityNorm(void){_error_("InfinityNorm not implemented for integers");}; 74 IssmDouble Max(void){_error_("Max not implemented for integers");}; 75 IssmDouble MaxAbs(void){_error_("Max not implemented for integers");}; 76 IssmDouble Min(void){_error_("Min not implemented for integers");}; 77 IssmDouble MinAbs(void){_error_("Min not implemented for integers");}; 78 void Extrude(void){_error_("not supported yet");}; 79 void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");}; 80 80 void GetVectorFromInputs(Vector* vector,int* doflist); 81 81 void GetValuesPtr(IssmDouble** pvalues,int* pnum_values); -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Inputs/PentaP1Input.cpp
r12832 r13101 455 455 case ControlInputEnum:{ 456 456 ControlInput* cont_input=(ControlInput*)xinput; 457 if(cont_input->values->ObjectEnum()!=PentaP1InputEnum) _error 2_("not supported yet");457 if(cont_input->values->ObjectEnum()!=PentaP1InputEnum) _error_("not supported yet"); 458 458 PentaP1Input* cast_input=(PentaP1Input*)cont_input->values; 459 459 for(i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*(cast_input->values[i]);} 460 460 return; 461 461 default: 462 _error 2_("not implemented yet");462 _error_("not implemented yet"); 463 463 } 464 464 … … 495 495 496 496 /*Check that input provided is a thickness*/ 497 if (thickness_input->InstanceEnum()!=ThicknessEnum) _error 2_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");497 if (thickness_input->InstanceEnum()!=ThicknessEnum) _error_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")"); 498 498 499 499 /*Get Thickness value pointer*/ … … 511 511 512 512 default: 513 _error 2_("not implemented yet");513 _error_("not implemented yet"); 514 514 } 515 515 } … … 529 529 530 530 /*Check that inputB is of the same type*/ 531 if (inputB->ObjectEnum()!=PentaP1InputEnum) _error 2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));531 if (inputB->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum())); 532 532 xinputB=(PentaP1Input*)inputB; 533 533 … … 560 560 561 561 /*Check that inputB is of the same type*/ 562 if (inputB->ObjectEnum()!=PentaP1InputEnum) _error 2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));562 if (inputB->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum())); 563 563 xinputB=(PentaP1Input*)inputB; 564 564 … … 591 591 592 592 /*Check that inputB is of the same type*/ 593 if (inputB->ObjectEnum()!=PentaP1InputEnum) _error 2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));593 if (inputB->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum())); 594 594 xinputB=(PentaP1Input*)inputB; 595 595 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Inputs/PentaP1Input.h
r12704 r13101 41 41 Input* PointwiseMax(Input* inputB); 42 42 ElementResult* SpawnResult(int step, IssmDouble time); 43 void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error 2_("not supported yet");};43 void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");}; 44 44 void Configure(Parameters* parameters); 45 45 /*}}}*/ 46 46 /*numerics: {{{*/ 47 void GetInputValue(bool* pvalue){_error 2_("not implemented yet");};48 void GetInputValue(int* pvalue){_error 2_("not implemented yet");};49 void GetInputValue(IssmDouble* pvalue){_error 2_("not implemented yet");};50 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error 2_("not implemented yet");};47 void GetInputValue(bool* pvalue){_error_("not implemented yet");}; 48 void GetInputValue(int* pvalue){_error_("not implemented yet");}; 49 void GetInputValue(IssmDouble* pvalue){_error_("not implemented yet");}; 50 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss){_error_("not implemented yet");}; 51 51 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss); 52 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error 2_("not implemented yet");};53 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error 2_("not implemented yet");};54 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error 2_("not implemented yet");};55 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error 2_("not implemented yet");};56 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error 2_("not implemented yet");};52 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");}; 53 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");}; 54 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");}; 55 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");}; 56 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");}; 57 57 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss); 58 58 void GetInputAverage(IssmDouble* pvalue); 59 void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error 2_("not implemented yet");};60 void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error 2_("not implemented yet");};59 void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");}; 60 void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");}; 61 61 void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss); 62 62 void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss); … … 69 69 void ConstrainMin(IssmDouble minimum); 70 70 void Scale(IssmDouble scale_factor); 71 void ArtificialNoise(IssmDouble min,IssmDouble max){_error 2_("not implemented yet");};71 void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");}; 72 72 void AXPY(Input* xinput,IssmDouble scalar); 73 73 void Constrain(IssmDouble cm_min, IssmDouble cm_max); -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Inputs/TransientInput.cpp
r12946 r13101 482 482 } 483 483 } 484 if(!found)_error 2_("did not find time interval on which to interpolate forcing values!");484 if(!found)_error_("did not find time interval on which to interpolate forcing values!"); 485 485 486 486 /*Assign output pointer*/ -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Inputs/TransientInput.h
r12946 r13101 40 40 int InstanceEnum(); 41 41 Input* SpawnTriaInput(int* indices); 42 Input* PointwiseDivide(Input* forcingB){_error 2_("not implemented yet");};43 Input* PointwiseMin(Input* forcingB){_error 2_("not implemented yet");};44 Input* PointwiseMax(Input* forcingB){_error 2_("not implemented yet");};42 Input* PointwiseDivide(Input* forcingB){_error_("not implemented yet");}; 43 Input* PointwiseMin(Input* forcingB){_error_("not implemented yet");}; 44 Input* PointwiseMax(Input* forcingB){_error_("not implemented yet");}; 45 45 ElementResult* SpawnResult(int step, IssmDouble time); 46 46 void Configure(Parameters* parameters); 47 47 /*}}}*/ 48 48 /*numerics: {{{*/ 49 void GetInputValue(bool* pvalue){_error 2_("not implemented yet");};50 void GetInputValue(int* pvalue){_error 2_("not implemented yet");};51 void GetInputValue(IssmDouble* pvalue){_error 2_("not implemented yet");};49 void GetInputValue(bool* pvalue){_error_("not implemented yet");}; 50 void GetInputValue(int* pvalue){_error_("not implemented yet");}; 51 void GetInputValue(IssmDouble* pvalue){_error_("not implemented yet");}; 52 52 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss); 53 53 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss); 54 54 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time); 55 55 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time); 56 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error 2_("not implemented yet");};57 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error 2_("not implemented yet");};56 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");}; 57 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");}; 58 58 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss); 59 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};59 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 60 60 void GetInputAverage(IssmDouble* pvalue); 61 void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error 2_("not implemented yet");};62 void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error 2_("not implemented yet");};63 void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};64 void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};65 void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};66 void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};67 void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};61 void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");}; 62 void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");}; 63 void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 64 void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 65 void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 66 void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 67 void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 68 68 void ChangeEnum(int newenumtype); 69 69 70 70 void SquareMin(IssmDouble* psquaremin, bool process_units,Parameters* parameters); 71 void ConstrainMin(IssmDouble minimum){_error 2_("not implemented yet");};72 void Scale(IssmDouble scale_factor){_error 2_("not implemented yet");};73 void ArtificialNoise(IssmDouble min,IssmDouble max){_error 2_("not implemented yet");};74 void AXPY(Input* xforcing,IssmDouble scalar){_error 2_("not implemented yet");};75 void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error 2_("not implemented yet");};71 void ConstrainMin(IssmDouble minimum){_error_("not implemented yet");}; 72 void Scale(IssmDouble scale_factor){_error_("not implemented yet");}; 73 void ArtificialNoise(IssmDouble min,IssmDouble max){_error_("not implemented yet");}; 74 void AXPY(Input* xforcing,IssmDouble scalar){_error_("not implemented yet");}; 75 void Constrain(IssmDouble cm_min, IssmDouble cm_max){_error_("not implemented yet");}; 76 76 IssmDouble InfinityNorm(void); 77 77 IssmDouble Max(void); … … 80 80 IssmDouble MinAbs(void); 81 81 void Extrude(void); 82 void VerticallyIntegrate(Input* thickness_forcing){_error 2_("not supported yet");};82 void VerticallyIntegrate(Input* thickness_forcing){_error_("not supported yet");}; 83 83 void GetVectorFromInputs(Vector* vector,int* doflist); 84 void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error 2_("not supported yet");};85 void GetTimeValues(IssmDouble* values,IssmDouble time){_error 2_("not implemented yet");};84 void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not supported yet");}; 85 void GetTimeValues(IssmDouble* values,IssmDouble time){_error_("not implemented yet");}; 86 86 Input* GetTimeInput(IssmDouble time); 87 87 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Inputs/TriaP1Input.cpp
r12832 r13101 323 323 324 324 default : 325 _error 2_("not implemented yet");325 _error_("not implemented yet"); 326 326 } 327 327 … … 368 368 369 369 /*Check that inputB is of the same type*/ 370 if (inputB->ObjectEnum()!=TriaP1InputEnum) _error 2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));370 if (inputB->ObjectEnum()!=TriaP1InputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum())); 371 371 xinputB=(TriaP1Input*)inputB; 372 372 … … 399 399 400 400 /*Check that inputB is of the same type*/ 401 if (inputB->ObjectEnum()!=TriaP1InputEnum) _error 2_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));401 if (inputB->ObjectEnum()!=TriaP1InputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum())); 402 402 xinputB=(TriaP1Input*)inputB; 403 403 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Inputs/TriaP1Input.h
r12704 r13101 37 37 int InstanceEnum(); 38 38 Input* SpawnTriaInput(int* indices); 39 Input* PointwiseDivide(Input* inputB){_error 2_("not implemented yet");};39 Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");}; 40 40 Input* PointwiseMin(Input* inputB); 41 41 Input* PointwiseMax(Input* inputB); 42 42 ElementResult* SpawnResult(int step, IssmDouble time); 43 void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error 2_("not supported yet");};43 void AddTimeValues(IssmDouble* values,int step,IssmDouble time){_error_("not supported yet");}; 44 44 void Configure(Parameters* parameters); 45 45 /*}}}*/ 46 46 /*numerics: {{{*/ 47 void GetInputValue(bool* pvalue){_error 2_("not implemented yet");}48 void GetInputValue(int* pvalue){_error 2_("not implemented yet");}49 void GetInputValue(IssmDouble* pvalue){_error 2_("not implemented yet");}47 void GetInputValue(bool* pvalue){_error_("not implemented yet");} 48 void GetInputValue(int* pvalue){_error_("not implemented yet");} 49 void GetInputValue(IssmDouble* pvalue){_error_("not implemented yet");} 50 50 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss); 51 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error 2_("not implemented yet");};52 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error 2_("not implemented yet");};53 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error 2_("not implemented yet");};54 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error 2_("not implemented yet");};55 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,int index){_error 2_("not implemented yet");};51 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error_("not implemented yet");}; 52 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time){_error_("not implemented yet");}; 53 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error_("not implemented yet");}; 54 void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");}; 55 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,int index){_error_("not implemented yet");}; 56 56 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussTria* gauss); 57 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};57 void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 58 58 void GetInputAverage(IssmDouble* pvalue); 59 59 void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss); 60 60 void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss); 61 void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};62 void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};63 void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};64 void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};65 void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error 2_("not implemented yet");};61 void GetVxStrainRate3d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 62 void GetVyStrainRate3d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 63 void GetVzStrainRate3d(IssmDouble* epsilonvz,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 64 void GetVxStrainRate3dPattyn(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 65 void GetVyStrainRate3dPattyn(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");}; 66 66 void ChangeEnum(int newenumtype); 67 67 … … 77 77 IssmDouble Min(void); 78 78 IssmDouble MinAbs(void); 79 void Extrude(void){_error 2_("not supported yet");};80 void VerticallyIntegrate(Input* thickness_input){_error 2_("not supported yet");};79 void Extrude(void){_error_("not supported yet");}; 80 void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");}; 81 81 void GetVectorFromInputs(Vector* vector,int* doflist); 82 82 void GetValuesPtr(IssmDouble** pvalues,int* pnum_values); -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KMLFileReadUtils.cpp
r12946 r13101 259 259 260 260 if (strncmp(&ktag[0],"<" ,1) || strncmp(&ktag[strlen(ktag)-1],">",1)) 261 _error 2_("KMLFileTagName -- Missing tag delimiters in " << ktag << ".\n");261 _error_("KMLFileTagName -- Missing tag delimiters in " << ktag << ".\n"); 262 262 263 263 /* strtok modifies ktag, so work on copy */ … … 355 355 NULL,NULL)) || 356 356 (kstr[0] == '<')) 357 _error 2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");357 _error_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n"); 358 358 359 359 sscanf(kstr,"%d",pival); … … 368 368 (kstr[1] != '/') || 369 369 (strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1))) 370 {_error 2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}370 {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");} 371 371 else 372 372 xDelete<char>(kstr); … … 388 388 NULL,NULL)) || 389 389 (kstr[0] == '<')) 390 {_error 2_("KMLFileTokenParse -- Missing bool field for " << ktag << ".\n");}390 {_error_("KMLFileTokenParse -- Missing bool field for " << ktag << ".\n");} 391 391 392 392 sscanf(kstr,"%d",&ival); … … 402 402 (kstr[1] != '/') || 403 403 (strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1))) 404 {_error 2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}404 {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");} 405 405 else 406 406 xDelete<char>(kstr); … … 433 433 NULL,NULL)) || 434 434 (kstr[0] == '<')) 435 _error 2_("KMLFileTokenParse -- Missing string field for " << ktag << ".\n");435 _error_("KMLFileTokenParse -- Missing string field for " << ktag << ".\n"); 436 436 437 437 if (!pstr) { … … 463 463 (kstr[1] != '/') || 464 464 (strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1))) 465 {_error 2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}465 {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");} 466 466 else 467 467 xDelete<char>(kstr); … … 484 484 NULL,NULL)) || 485 485 (kstr[0] == '<')) 486 {_error 2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");}486 {_error_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");} 487 487 488 488 sscanf(kstr,"%g",pfval); … … 497 497 (kstr[1] != '/') || 498 498 (strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1))) 499 {_error 2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}499 {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");} 500 500 else 501 501 xDelete<char>(kstr); … … 518 518 NULL,NULL)) || 519 519 (kstr[0] == '<')) 520 _error 2_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n");520 _error_("KMLFileTokenParse -- Missing integer field for " << ktag << ".\n"); 521 521 522 522 sscanf(kstr,"%lg",pdval); … … 531 531 (kstr[1] != '/') || 532 532 (strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1))) 533 {_error 2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}533 {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");} 534 534 else 535 535 xDelete<char>(kstr); … … 556 556 NULL,NULL)) || 557 557 (kstr[0] == '<')) 558 _error 2_("KMLFileTokenParse -- Missing double [m] field for " << ktag << ".\n");558 _error_("KMLFileTokenParse -- Missing double [m] field for " << ktag << ".\n"); 559 559 560 560 if (!*pdval) … … 570 570 i++; 571 571 if (maxlen && (maxlen < i+1)) 572 _error 2_("KMLFileTokenParse -- Double [m] field too short for " << ktag << ".\n");572 _error_("KMLFileTokenParse -- Double [m] field too short for " << ktag << ".\n"); 573 573 sscanf(ktok,"%lg",&((*pdval)[i])); 574 574 ktok=strtok(NULL,delim); … … 595 595 (kstr[1] != '/') || 596 596 (strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1))) 597 {_error 2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}597 {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");} 598 598 else 599 599 xDelete<char>(kstr); … … 622 622 NULL,NULL)) || 623 623 (kstr[0] == '<')) 624 _error 2_("KMLFileTokenParse -- Missing double [m x n] field for " << ktag << ".\n");624 _error_("KMLFileTokenParse -- Missing double [m x n] field for " << ktag << ".\n"); 625 625 626 626 if (!*pdval) … … 636 636 i++; 637 637 if (maxlen && (maxlen*n < i+1)) 638 _error 2_("KMLFileTokenParse -- Double [m x n] field too short for " << ktag << ".\n");638 _error_("KMLFileTokenParse -- Double [m x n] field too short for " << ktag << ".\n"); 639 639 j=(j+1) % n; 640 640 sscanf(ktok,"%lg",&((*pdval)[i])); … … 665 665 (kstr[1] != '/') || 666 666 (strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1))) 667 {_error 2_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}667 {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");} 668 668 else 669 669 xDelete<char>(kstr); … … 712 712 else if ((kstr[0] == '<') && 713 713 (kstr[1] == '/')) { 714 _error 2_("KMLFileTagSkip -- Unexpected closing tag " << kstr << ".\n");714 _error_("KMLFileTagSkip -- Unexpected closing tag " << kstr << ".\n"); 715 715 } 716 716 … … 718 718 } 719 719 720 _error 2_("KMLFileTokenParse -- Corresponding closing tag for " << ktag << " not found.\n");720 _error_("KMLFileTokenParse -- Corresponding closing tag for " << ktag << " not found.\n"); 721 721 722 722 return(0); -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Attribute.h
r12832 r13101 30 30 virtual void DeepEcho(); 31 31 virtual void DeepEcho(const char* indent); 32 int Id(){_error 2_("Not implemented yet.");};33 int MyRank(){_error 2_("Not implemented yet.");};34 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};35 int MarshallSize(){_error 2_("Not implemented yet.");};36 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};37 int ObjectEnum(){_error 2_("Not implemented yet.");};38 Object* copy(){_error 2_("Not implemented yet.");};32 int Id(){_error_("Not implemented yet.");}; 33 int MyRank(){_error_("Not implemented yet.");}; 34 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 35 int MarshallSize(){_error_("Not implemented yet.");}; 36 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 37 int ObjectEnum(){_error_("Not implemented yet.");}; 38 Object* copy(){_error_("Not implemented yet.");}; 39 39 /*}}}*/ 40 40 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_ColorStyle.cpp
r12835 r13101 93 93 return; 94 94 else if (!strncmp(kstr,"</",2)) 95 {_error 2_("KML_ColorStyle::Read -- Unexpected closing tag " << kstr);}95 {_error_("KML_ColorStyle::Read -- Unexpected closing tag " << kstr);} 96 96 else if (strncmp(kstr,"<",1)) 97 {_error 2_("KML_ColorStyle::Read -- Unexpected field \"" << kstr << "\"");}97 {_error_("KML_ColorStyle::Read -- Unexpected field \"" << kstr << "\"");} 98 98 99 99 else if (!strcmp(kstr,"<color>")) -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_ColorStyle.h
r12832 r13101 35 35 void Write(FILE* fid,const char* indent); 36 36 void Read(FILE* fid,char* kstr); 37 int Id(){_error 2_("Not implemented yet.");};38 int MyRank(){_error 2_("Not implemented yet.");};39 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};40 int MarshallSize(){_error 2_("Not implemented yet.");};41 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};42 int ObjectEnum(){_error 2_("Not implemented yet.");};43 Object* copy(){_error 2_("Not implemented yet.");};37 int Id(){_error_("Not implemented yet.");}; 38 int MyRank(){_error_("Not implemented yet.");}; 39 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 40 int MarshallSize(){_error_("Not implemented yet.");}; 41 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 42 int ObjectEnum(){_error_("Not implemented yet.");}; 43 Object* copy(){_error_("Not implemented yet.");}; 44 44 /*}}}*/ 45 45 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Comment.h
r12832 r13101 30 30 virtual void DeepEcho(); 31 31 virtual void DeepEcho(const char* indent); 32 int Id(){_error 2_("Not implemented yet.");};33 int MyRank(){_error 2_("Not implemented yet.");};34 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};35 int MarshallSize(){_error 2_("Not implemented yet.");};36 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};37 int ObjectEnum(){_error 2_("Not implemented yet.");};38 Object* copy(){_error 2_("Not implemented yet.");};32 int Id(){_error_("Not implemented yet.");}; 33 int MyRank(){_error_("Not implemented yet.");}; 34 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 35 int MarshallSize(){_error_("Not implemented yet.");}; 36 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 37 int ObjectEnum(){_error_("Not implemented yet.");}; 38 Object* copy(){_error_("Not implemented yet.");}; 39 39 /*}}}*/ 40 40 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Container.cpp
r12946 r13101 120 120 } 121 121 else if (!strncmp(kstr,"</",2)) 122 {_error 2_("KML_Container::Read -- Unexpected closing tag " << kstr );}122 {_error_("KML_Container::Read -- Unexpected closing tag " << kstr );} 123 123 else if (strncmp(kstr,"<",1)) 124 {_error 2_("KML_Container::Read -- Unexpected field \"" << kstr << "\"");}124 {_error_("KML_Container::Read -- Unexpected field \"" << kstr << "\"");} 125 125 126 126 else if (!strncmp(kstr,"<Placemark",10)) { -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Container.h
r12832 r13101 33 33 void Read(FILE* fid,char* kstr); 34 34 void WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp); 35 int Id(){_error 2_("Not implemented yet.");};36 int MyRank(){_error 2_("Not implemented yet.");};37 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};38 int MarshallSize(){_error 2_("Not implemented yet.");};39 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};40 int ObjectEnum(){_error 2_("Not implemented yet.");};41 Object* copy(){_error 2_("Not implemented yet.");};35 int Id(){_error_("Not implemented yet.");}; 36 int MyRank(){_error_("Not implemented yet.");}; 37 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 38 int MarshallSize(){_error_("Not implemented yet.");}; 39 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 40 int ObjectEnum(){_error_("Not implemented yet.");}; 41 Object* copy(){_error_("Not implemented yet.");}; 42 42 /*}}}*/ 43 43 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Document.cpp
r12946 r13101 106 106 } 107 107 else if (!strncmp(kstri,"</",2)) 108 {_error 2_("KML_Document::Read -- Unexpected closing tag " << kstri << ".\n");}108 {_error_("KML_Document::Read -- Unexpected closing tag " << kstri << ".\n");} 109 109 else if (strncmp(kstri,"<",1)) 110 {_error 2_("KML_Document::Read -- Unexpected field \"" << kstri << "\".\n");}110 {_error_("KML_Document::Read -- Unexpected field \"" << kstri << "\".\n");} 111 111 112 112 else if (!strncmp(kstri,"<",1)) -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Document.h
r12832 r13101 30 30 void Write(FILE* fid,const char* indent); 31 31 void Read(FILE* fid,char* kstr); 32 int Id(){_error 2_("Not implemented yet.");};33 int MyRank(){_error 2_("Not implemented yet.");};34 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};35 int MarshallSize(){_error 2_("Not implemented yet.");};36 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};37 int ObjectEnum(){_error 2_("Not implemented yet.");};38 Object* copy(){_error 2_("Not implemented yet.");};32 int Id(){_error_("Not implemented yet.");}; 33 int MyRank(){_error_("Not implemented yet.");}; 34 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 35 int MarshallSize(){_error_("Not implemented yet.");}; 36 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 37 int ObjectEnum(){_error_("Not implemented yet.");}; 38 Object* copy(){_error_("Not implemented yet.");}; 39 39 /*}}}*/ 40 40 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Feature.cpp
r12835 r13101 149 149 return; 150 150 else if (!strncmp(kstr,"</",2)) 151 {_error 2_("KML_Feature::Read -- Unexpected closing tag " << kstr);}151 {_error_("KML_Feature::Read -- Unexpected closing tag " << kstr);} 152 152 else if (strncmp(kstr,"<",1)) 153 {_error 2_("KML_Feature::Read -- Unexpected field \"" << kstr << "\"");}153 {_error_("KML_Feature::Read -- Unexpected field \"" << kstr << "\"");} 154 154 155 155 else if (!strncmp(kstr,"<Style", 6)) { -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Feature.h
r12832 r13101 44 44 void Write(FILE* fid,const char* indent); 45 45 void Read(FILE* fid,char* kstr); 46 int Id(){_error 2_("Not implemented yet.");};47 int MyRank(){_error 2_("Not implemented yet.");};48 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};49 int MarshallSize(){_error 2_("Not implemented yet.");};50 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};51 int ObjectEnum(){_error 2_("Not implemented yet.");};52 Object* copy(){_error 2_("Not implemented yet.");};46 int Id(){_error_("Not implemented yet.");}; 47 int MyRank(){_error_("Not implemented yet.");}; 48 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 49 int MarshallSize(){_error_("Not implemented yet.");}; 50 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 51 int ObjectEnum(){_error_("Not implemented yet.");}; 52 Object* copy(){_error_("Not implemented yet.");}; 53 53 /*}}}*/ 54 54 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_File.cpp
r12946 r13101 107 107 } 108 108 else if (!strncmp(kstri,"</",2)) 109 {_error 2_("KML_File::Read -- Unexpected closing tag " << kstri << ".");}109 {_error_("KML_File::Read -- Unexpected closing tag " << kstri << ".");} 110 110 else if (strncmp(kstri,"<",1)) 111 {_error 2_("KML_File::Read -- Unexpected field \"" << kstri << "\"");}111 {_error_("KML_File::Read -- Unexpected field \"" << kstri << "\"");} 112 112 113 113 else if (!strncmp(kstri,"<",1)) -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_File.h
r12832 r13101 31 31 void Read(FILE* fid,char* kstr); 32 32 void WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp); 33 int Id(){_error 2_("Not implemented yet.");};34 int MyRank(){_error 2_("Not implemented yet.");};35 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};36 int MarshallSize(){_error 2_("Not implemented yet.");};37 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};38 int ObjectEnum(){_error 2_("Not implemented yet.");};39 Object* copy(){_error 2_("Not implemented yet.");};33 int Id(){_error_("Not implemented yet.");}; 34 int MyRank(){_error_("Not implemented yet.");}; 35 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 36 int MarshallSize(){_error_("Not implemented yet.");}; 37 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 38 int ObjectEnum(){_error_("Not implemented yet.");}; 39 Object* copy(){_error_("Not implemented yet.");}; 40 40 /*}}}*/ 41 41 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Folder.cpp
r12946 r13101 106 106 } 107 107 else if (!strncmp(kstri,"</",2)) 108 {_error 2_("KML_Folder::Read -- Unexpected closing tag " << kstri << ".\n");}108 {_error_("KML_Folder::Read -- Unexpected closing tag " << kstri << ".\n");} 109 109 else if (strncmp(kstri,"<",1)) 110 {_error 2_("KML_Folder::Read -- Unexpected field \"" << kstri << "\".\n");}110 {_error_("KML_Folder::Read -- Unexpected field \"" << kstri << "\".\n");} 111 111 112 112 else if (!strncmp(kstri,"<",1)) -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Folder.h
r12832 r13101 30 30 void Write(FILE* fid,const char* indent); 31 31 void Read(FILE* fid,char* kstr); 32 int Id(){_error 2_("Not implemented yet.");};33 int MyRank(){_error 2_("Not implemented yet.");};34 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};35 int MarshallSize(){_error 2_("Not implemented yet.");};36 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};37 int ObjectEnum(){_error 2_("Not implemented yet.");};38 Object* copy(){_error 2_("Not implemented yet.");};32 int Id(){_error_("Not implemented yet.");}; 33 int MyRank(){_error_("Not implemented yet.");}; 34 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 35 int MarshallSize(){_error_("Not implemented yet.");}; 36 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 37 int ObjectEnum(){_error_("Not implemented yet.");}; 38 Object* copy(){_error_("Not implemented yet.");}; 39 39 /*}}}*/ 40 40 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Geometry.cpp
r12835 r13101 79 79 return; 80 80 else if (!strncmp(kstr,"</",2)) 81 {_error 2_("KML_Geometry::Read -- Unexpected closing tag " << kstr << ".\n");}81 {_error_("KML_Geometry::Read -- Unexpected closing tag " << kstr << ".\n");} 82 82 else if (strncmp(kstr,"<",1)) 83 {_error 2_("KML_Geometry::Read -- Unexpected field \"" << kstr << "\".\n");}83 {_error_("KML_Geometry::Read -- Unexpected field \"" << kstr << "\".\n");} 84 84 85 85 else if (!strncmp(kstr,"<",1)) -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Geometry.h
r12832 r13101 29 29 void Write(FILE* fid,const char* indent); 30 30 void Read(FILE* fid,char* kstr); 31 int Id(){_error 2_("Not implemented yet.");};32 int MyRank(){_error 2_("Not implemented yet.");};33 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};34 int MarshallSize(){_error 2_("Not implemented yet.");};35 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};36 int ObjectEnum(){_error 2_("Not implemented yet.");};37 Object* copy(){_error 2_("Not implemented yet.");};31 int Id(){_error_("Not implemented yet.");}; 32 int MyRank(){_error_("Not implemented yet.");}; 33 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 34 int MarshallSize(){_error_("Not implemented yet.");}; 35 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 36 int ObjectEnum(){_error_("Not implemented yet.");}; 37 Object* copy(){_error_("Not implemented yet.");}; 38 38 /*}}}*/ 39 39 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_GroundOverlay.cpp
r12946 r13101 131 131 } 132 132 else if (!strncmp(kstri,"</",2)) 133 {_error 2_("KML_GroundOverlay::Read -- Unexpected closing tag " << kstri << ".\n");}133 {_error_("KML_GroundOverlay::Read -- Unexpected closing tag " << kstri << ".\n");} 134 134 else if (strncmp(kstri,"<",1)) 135 {_error 2_("KML_GroundOverlay::Read -- Unexpected field \"" << kstri << "\".\n");}135 {_error_("KML_GroundOverlay::Read -- Unexpected field \"" << kstri << "\".\n");} 136 136 137 137 else if (!strcmp(kstri,"<altitude>")) -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_GroundOverlay.h
r12832 r13101 36 36 void Write(FILE* fid,const char* indent); 37 37 void Read(FILE* fid,char* kstr); 38 int Id(){_error 2_("Not implemented yet.");};39 int MyRank(){_error 2_("Not implemented yet.");};40 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};41 int MarshallSize(){_error 2_("Not implemented yet.");};42 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};43 int ObjectEnum(){_error 2_("Not implemented yet.");};44 Object* copy(){_error 2_("Not implemented yet.");};38 int Id(){_error_("Not implemented yet.");}; 39 int MyRank(){_error_("Not implemented yet.");}; 40 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 41 int MarshallSize(){_error_("Not implemented yet.");}; 42 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 43 int ObjectEnum(){_error_("Not implemented yet.");}; 44 Object* copy(){_error_("Not implemented yet.");}; 45 45 /*}}}*/ 46 46 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Icon.cpp
r12946 r13101 145 145 } 146 146 else if (!strncmp(kstri,"</",2)) 147 {_error 2_("KML_Icon::Read -- Unexpected closing tag " << kstri << ".\n");}147 {_error_("KML_Icon::Read -- Unexpected closing tag " << kstri << ".\n");} 148 148 else if (strncmp(kstri,"<",1)) 149 {_error 2_("KML_Icon::Read -- Unexpected field \"" << kstri << "\".\n");}149 {_error_("KML_Icon::Read -- Unexpected field \"" << kstri << "\".\n");} 150 150 151 151 else if (!strcmp(kstri,"<href>")) -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Icon.h
r12832 r13101 44 44 void Write(FILE* fid,const char* indent); 45 45 void Read(FILE* fid,char* kstr); 46 int Id(){_error 2_("Not implemented yet.");};47 int MyRank(){_error 2_("Not implemented yet.");};48 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};49 int MarshallSize(){_error 2_("Not implemented yet.");};50 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};51 int ObjectEnum(){_error 2_("Not implemented yet.");};52 Object* copy(){_error 2_("Not implemented yet.");};46 int Id(){_error_("Not implemented yet.");}; 47 int MyRank(){_error_("Not implemented yet.");}; 48 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 49 int MarshallSize(){_error_("Not implemented yet.");}; 50 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 51 int ObjectEnum(){_error_("Not implemented yet.");}; 52 Object* copy(){_error_("Not implemented yet.");}; 53 53 /*}}}*/ 54 54 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_LatLonBox.cpp
r12946 r13101 121 121 } 122 122 else if (!strncmp(kstri,"</",2)) 123 {_error 2_("KML_LatLonBox::Read -- Unexpected closing tag " << kstri << ".\n");}123 {_error_("KML_LatLonBox::Read -- Unexpected closing tag " << kstri << ".\n");} 124 124 else if (strncmp(kstri,"<",1)) 125 {_error 2_("KML_LatLonBox::Read -- Unexpected field \"" << kstri << "\".\n");}125 {_error_("KML_LatLonBox::Read -- Unexpected field \"" << kstri << "\".\n");} 126 126 127 127 else if (!strcmp(kstri,"<north>")) -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_LatLonBox.h
r12832 r13101 35 35 void Write(FILE* fid,const char* indent); 36 36 void Read(FILE* fid,char* kstr); 37 int Id(){_error 2_("Not implemented yet.");};38 int MyRank(){_error 2_("Not implemented yet.");};39 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};40 int MarshallSize(){_error 2_("Not implemented yet.");};41 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};42 int ObjectEnum(){_error 2_("Not implemented yet.");};43 Object* copy(){_error 2_("Not implemented yet.");};37 int Id(){_error_("Not implemented yet.");}; 38 int MyRank(){_error_("Not implemented yet.");}; 39 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 40 int MarshallSize(){_error_("Not implemented yet.");}; 41 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 42 int ObjectEnum(){_error_("Not implemented yet.");}; 43 Object* copy(){_error_("Not implemented yet.");}; 44 44 /*}}}*/ 45 45 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_LineString.cpp
r12946 r13101 141 141 } 142 142 else if (!strncmp(kstri,"</",2)) 143 {_error 2_("KML_LineString::Read -- Unexpected closing tag " << kstri << ".\n");}143 {_error_("KML_LineString::Read -- Unexpected closing tag " << kstri << ".\n");} 144 144 else if (strncmp(kstri,"<",1)) 145 {_error 2_("KML_LineString::Read -- Unexpected field \"" << kstri << "\".\n");}145 {_error_("KML_LineString::Read -- Unexpected field \"" << kstri << "\".\n");} 146 146 147 147 else if (!strcmp(kstri,"<extrude>")) -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_LineString.h
r12832 r13101 38 38 void Read(FILE* fid,char* kstr); 39 39 void WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp); 40 int Id(){_error 2_("Not implemented yet.");};41 int MyRank(){_error 2_("Not implemented yet.");};42 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};43 int MarshallSize(){_error 2_("Not implemented yet.");};44 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};45 int ObjectEnum(){_error 2_("Not implemented yet.");};46 Object* copy(){_error 2_("Not implemented yet.");};40 int Id(){_error_("Not implemented yet.");}; 41 int MyRank(){_error_("Not implemented yet.");}; 42 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 43 int MarshallSize(){_error_("Not implemented yet.");}; 44 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 45 int ObjectEnum(){_error_("Not implemented yet.");}; 46 Object* copy(){_error_("Not implemented yet.");}; 47 47 /*}}}*/ 48 48 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_LineStyle.cpp
r12946 r13101 113 113 } 114 114 else if (!strncmp(kstri,"</",2)) 115 {_error 2_("KML_LineStyle::Read -- Unexpected closing tag " << kstri << ".\n");}115 {_error_("KML_LineStyle::Read -- Unexpected closing tag " << kstri << ".\n");} 116 116 else if (strncmp(kstri,"<",1)) 117 {_error 2_("KML_LineStyle::Read -- Unexpected field \"" << kstri << "\".\n");}117 {_error_("KML_LineStyle::Read -- Unexpected field \"" << kstri << "\".\n");} 118 118 119 119 else if (!strcmp(kstri,"<width>")) -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_LineStyle.h
r12832 r13101 31 31 void Write(FILE* fid,const char* indent); 32 32 void Read(FILE* fid,char* kstr); 33 int Id(){_error 2_("Not implemented yet.");};34 int MyRank(){_error 2_("Not implemented yet.");};35 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};36 int MarshallSize(){_error 2_("Not implemented yet.");};37 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};38 int ObjectEnum(){_error 2_("Not implemented yet.");};39 Object* copy(){_error 2_("Not implemented yet.");};33 int Id(){_error_("Not implemented yet.");}; 34 int MyRank(){_error_("Not implemented yet.");}; 35 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 36 int MarshallSize(){_error_("Not implemented yet.");}; 37 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 38 int ObjectEnum(){_error_("Not implemented yet.");}; 39 Object* copy(){_error_("Not implemented yet.");}; 40 40 /*}}}*/ 41 41 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_LinearRing.cpp
r12946 r13101 139 139 } 140 140 else if (!strncmp(kstri,"</",2)) 141 {_error 2_("KML_LinearRing::Read -- Unexpected closing tag " << kstri << ".\n");}141 {_error_("KML_LinearRing::Read -- Unexpected closing tag " << kstri << ".\n");} 142 142 else if (strncmp(kstri,"<",1)) 143 {_error 2_("KML_LinearRing::Read -- Unexpected field \"" << kstri << "\".\n");}143 {_error_("KML_LinearRing::Read -- Unexpected field \"" << kstri << "\".\n");} 144 144 145 145 else if (!strcmp(kstri,"<extrude>")) -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_LinearRing.h
r12832 r13101 38 38 void Read(FILE* fid,char* kstr); 39 39 void WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp); 40 int Id(){_error 2_("Not implemented yet.");};41 int MyRank(){_error 2_("Not implemented yet.");};42 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};43 int MarshallSize(){_error 2_("Not implemented yet.");};44 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};45 int ObjectEnum(){_error 2_("Not implemented yet.");};46 Object* copy(){_error 2_("Not implemented yet.");};40 int Id(){_error_("Not implemented yet.");}; 41 int MyRank(){_error_("Not implemented yet.");}; 42 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 43 int MarshallSize(){_error_("Not implemented yet.");}; 44 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 45 int ObjectEnum(){_error_("Not implemented yet.");}; 46 Object* copy(){_error_("Not implemented yet.");}; 47 47 /*}}}*/ 48 48 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_MultiGeometry.cpp
r12946 r13101 140 140 } 141 141 else if (!strncmp(kstri,"</",2)) 142 {_error 2_("KML_MultiGeometry::Read -- Unexpected closing tag " << kstri << ".\n");}142 {_error_("KML_MultiGeometry::Read -- Unexpected closing tag " << kstri << ".\n");} 143 143 else if (strncmp(kstri,"<",1)) 144 {_error 2_("KML_MultiGeometry::Read -- Unexpected field \"" << kstri << "\".\n");}144 {_error_("KML_MultiGeometry::Read -- Unexpected field \"" << kstri << "\".\n");} 145 145 146 146 else if (!strncmp(kstri,"<Point", 6)) { -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_MultiGeometry.h
r12832 r13101 34 34 void Read(FILE* fid,char* kstr); 35 35 void WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp); 36 int Id(){_error 2_("Not implemented yet.");};37 int MyRank(){_error 2_("Not implemented yet.");};38 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};39 int MarshallSize(){_error 2_("Not implemented yet.");};40 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};41 int ObjectEnum(){_error 2_("Not implemented yet.");};42 Object* copy(){_error 2_("Not implemented yet.");};36 int Id(){_error_("Not implemented yet.");}; 37 int MyRank(){_error_("Not implemented yet.");}; 38 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 39 int MarshallSize(){_error_("Not implemented yet.");}; 40 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 41 int ObjectEnum(){_error_("Not implemented yet.");}; 42 Object* copy(){_error_("Not implemented yet.");}; 43 43 /*}}}*/ 44 44 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Object.cpp
r12946 r13101 146 146 return; 147 147 else if (!strncmp(kstr,"</",2)) 148 {_error 2_("KML_Object::Read -- Unexpected closing tag " << kstr << ".\n");}148 {_error_("KML_Object::Read -- Unexpected closing tag " << kstr << ".\n");} 149 149 else if (strncmp(kstr,"<",1)) 150 {_error 2_("KML_Object::Read -- Unexpected field \"" << kstr << "\".\n");}150 {_error_("KML_Object::Read -- Unexpected field \"" << kstr << "\".\n");} 151 151 152 152 else if (!strncmp(kstr,"<Placemark",10)) { -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Object.h
r12832 r13101 31 31 virtual void DeepEcho(); 32 32 virtual void DeepEcho(const char* indent); 33 int Id(){_error 2_("Not implemented yet.");};34 int MyRank(){_error 2_("Not implemented yet.");};35 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};36 int MarshallSize(){_error 2_("Not implemented yet.");};37 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};38 int ObjectEnum(){_error 2_("Not implemented yet.");};39 Object* copy(){_error 2_("Not implemented yet.");};33 int Id(){_error_("Not implemented yet.");}; 34 int MyRank(){_error_("Not implemented yet.");}; 35 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 36 int MarshallSize(){_error_("Not implemented yet.");}; 37 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 38 int ObjectEnum(){_error_("Not implemented yet.");}; 39 Object* copy(){_error_("Not implemented yet.");}; 40 40 /*}}}*/ 41 41 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Overlay.cpp
r12946 r13101 110 110 } 111 111 else if (!strncmp(kstr,"</",2)) 112 {_error 2_("KML_Overlay::Read -- Unexpected closing tag " << kstr << ".\n");}112 {_error_("KML_Overlay::Read -- Unexpected closing tag " << kstr << ".\n");} 113 113 else if (strncmp(kstr,"<",1)) 114 {_error 2_("KML_Overlay::Read -- Unexpected field \"" << kstr << "\".\n");}114 {_error_("KML_Overlay::Read -- Unexpected field \"" << kstr << "\".\n");} 115 115 116 116 else if (!strcmp(kstr,"<color>")) -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Overlay.h
r12832 r13101 36 36 void Write(FILE* fid,const char* indent); 37 37 void Read(FILE* fid,char* kstr); 38 int Id(){_error 2_("Not implemented yet.");};39 int MyRank(){_error 2_("Not implemented yet.");};40 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};41 int MarshallSize(){_error 2_("Not implemented yet.");};42 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};43 int ObjectEnum(){_error 2_("Not implemented yet.");};44 Object* copy(){_error 2_("Not implemented yet.");};38 int Id(){_error_("Not implemented yet.");}; 39 int MyRank(){_error_("Not implemented yet.");}; 40 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 41 int MarshallSize(){_error_("Not implemented yet.");}; 42 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 43 int ObjectEnum(){_error_("Not implemented yet.");}; 44 Object* copy(){_error_("Not implemented yet.");}; 45 45 /*}}}*/ 46 46 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Placemark.cpp
r12946 r13101 140 140 } 141 141 else if (!strncmp(kstri,"</",2)) 142 {_error 2_("KML_Placemark::Read -- Unexpected closing tag " << kstri << ".\n");}142 {_error_("KML_Placemark::Read -- Unexpected closing tag " << kstri << ".\n");} 143 143 else if (strncmp(kstri,"<",1)) 144 {_error 2_("KML_Placemark::Read -- Unexpected field \"" << kstri << "\".\n");}144 {_error_("KML_Placemark::Read -- Unexpected field \"" << kstri << "\".\n");} 145 145 146 146 else if (!strncmp(kstri,"<Point", 6)) { -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Placemark.h
r12832 r13101 34 34 void Read(FILE* fid,char* kstr); 35 35 void WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp); 36 int Id(){_error 2_("Not implemented yet.");};37 int MyRank(){_error 2_("Not implemented yet.");};38 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};39 int MarshallSize(){_error 2_("Not implemented yet.");};40 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};41 int ObjectEnum(){_error 2_("Not implemented yet.");};42 Object* copy(){_error 2_("Not implemented yet.");};36 int Id(){_error_("Not implemented yet.");}; 37 int MyRank(){_error_("Not implemented yet.");}; 38 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 39 int MarshallSize(){_error_("Not implemented yet.");}; 40 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 41 int ObjectEnum(){_error_("Not implemented yet.");}; 42 Object* copy(){_error_("Not implemented yet.");}; 43 43 /*}}}*/ 44 44 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Point.cpp
r12946 r13101 126 126 } 127 127 else if (!strncmp(kstri,"</",2)) 128 {_error 2_("KML_Point::Read -- Unexpected closing tag " << kstri << ".\n");}128 {_error_("KML_Point::Read -- Unexpected closing tag " << kstri << ".\n");} 129 129 else if (strncmp(kstri,"<",1)) 130 {_error 2_("KML_Point::Read -- Unexpected field \"" << kstri << "\".\n");}130 {_error_("KML_Point::Read -- Unexpected field \"" << kstri << "\".\n");} 131 131 132 132 else if (!strcmp(kstri,"<extrude>")) -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Point.h
r12832 r13101 36 36 void Read(FILE* fid,char* kstr); 37 37 void WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp); 38 int Id(){_error 2_("Not implemented yet.");};39 int MyRank(){_error 2_("Not implemented yet.");};40 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};41 int MarshallSize(){_error 2_("Not implemented yet.");};42 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};43 int ObjectEnum(){_error 2_("Not implemented yet.");};44 Object* copy(){_error 2_("Not implemented yet.");};38 int Id(){_error_("Not implemented yet.");}; 39 int MyRank(){_error_("Not implemented yet.");}; 40 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 41 int MarshallSize(){_error_("Not implemented yet.");}; 42 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 43 int ObjectEnum(){_error_("Not implemented yet.");}; 44 Object* copy(){_error_("Not implemented yet.");}; 45 45 /*}}}*/ 46 46 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_PolyStyle.cpp
r12946 r13101 117 117 } 118 118 else if (!strncmp(kstri,"</",2)) 119 {_error 2_("KML_PolyStyle::Read -- Unexpected closing tag " << kstri << ".\n");}119 {_error_("KML_PolyStyle::Read -- Unexpected closing tag " << kstri << ".\n");} 120 120 else if (strncmp(kstri,"<",1)) 121 {_error 2_("KML_PolyStyle::Read -- Unexpected field \"" << kstri << "\".\n");}121 {_error_("KML_PolyStyle::Read -- Unexpected field \"" << kstri << "\".\n");} 122 122 123 123 else if (!strcmp(kstri,"<fill>")) -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_PolyStyle.h
r12832 r13101 32 32 void Write(FILE* fid,const char* indent); 33 33 void Read(FILE* fid,char* kstr); 34 int Id(){_error 2_("Not implemented yet.");};35 int MyRank(){_error 2_("Not implemented yet.");};36 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};37 int MarshallSize(){_error 2_("Not implemented yet.");};38 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};39 int ObjectEnum(){_error 2_("Not implemented yet.");};40 Object* copy(){_error 2_("Not implemented yet.");};34 int Id(){_error_("Not implemented yet.");}; 35 int MyRank(){_error_("Not implemented yet.");}; 36 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 37 int MarshallSize(){_error_("Not implemented yet.");}; 38 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 39 int ObjectEnum(){_error_("Not implemented yet.");}; 40 Object* copy(){_error_("Not implemented yet.");}; 41 41 /*}}}*/ 42 42 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Polygon.cpp
r12946 r13101 179 179 } 180 180 else if (!strncmp(kstri,"</",2)) 181 {_error 2_("KML_Polygon::Read -- Unexpected closing tag " << kstri << ".\n");}181 {_error_("KML_Polygon::Read -- Unexpected closing tag " << kstri << ".\n");} 182 182 else if (strncmp(kstri,"<",1)) 183 {_error 2_("KML_Polygon::Read -- Unexpected field \"" << kstri << "\".\n");}183 {_error_("KML_Polygon::Read -- Unexpected field \"" << kstri << "\".\n");} 184 184 185 185 else if (!strcmp(kstri,"<extrude>")) … … 207 207 } 208 208 else if (!strncmp(kstrj,"</",2)) 209 {_error 2_("KML_Polygon::Read -- Unexpected closing tag " << kstrj << ".\n");}209 {_error_("KML_Polygon::Read -- Unexpected closing tag " << kstrj << ".\n");} 210 210 else if (strncmp(kstrj,"<",1)) 211 {_error 2_("KML_Polygon::Read -- Unexpected field \"" << kstrj << "\".\n");}211 {_error_("KML_Polygon::Read -- Unexpected field \"" << kstrj << "\".\n");} 212 212 213 213 else if (!strncmp(kstrj,"<LinearRing",11)) { … … 234 234 } 235 235 else if (!strncmp(kstrj,"</",2)) 236 {_error 2_("KML_Polygon::Read -- Unexpected closing tag " << kstrj << ".\n");}236 {_error_("KML_Polygon::Read -- Unexpected closing tag " << kstrj << ".\n");} 237 237 else if (strncmp(kstrj,"<",1)) 238 {_error 2_("KML_Polygon::Read -- Unexpected field \"" << kstrj << "\".\n");}238 {_error_("KML_Polygon::Read -- Unexpected field \"" << kstrj << "\".\n");} 239 239 240 240 else if (!strncmp(kstrj,"<LinearRing",11)) { -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Polygon.h
r12832 r13101 40 40 void Read(FILE* fid,char* kstr); 41 41 void WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp); 42 int Id(){_error 2_("Not implemented yet.");};43 int MyRank(){_error 2_("Not implemented yet.");};44 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};45 int MarshallSize(){_error 2_("Not implemented yet.");};46 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};47 int ObjectEnum(){_error 2_("Not implemented yet.");};48 Object* copy(){_error 2_("Not implemented yet.");};42 int Id(){_error_("Not implemented yet.");}; 43 int MyRank(){_error_("Not implemented yet.");}; 44 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 45 int MarshallSize(){_error_("Not implemented yet.");}; 46 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 47 int ObjectEnum(){_error_("Not implemented yet.");}; 48 Object* copy(){_error_("Not implemented yet.");}; 49 49 /*}}}*/ 50 50 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Style.cpp
r12946 r13101 189 189 } 190 190 else if (!strncmp(kstri,"</",2)) 191 {_error 2_("KML_Style::Read -- Unexpected closing tag " << kstri << ".\n");}191 {_error_("KML_Style::Read -- Unexpected closing tag " << kstri << ".\n");} 192 192 else if (strncmp(kstri,"<",1)) 193 {_error 2_("KML_Style::Read -- Unexpected field \"" << kstri << "\".\n");}193 {_error_("KML_Style::Read -- Unexpected field \"" << kstri << "\".\n");} 194 194 195 195 // else if (!strncmp(kstri,"<IconStyle",10)) { -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Style.h
r12832 r13101 38 38 void Write(FILE* fid,const char* indent); 39 39 void Read(FILE* fid,char* kstr); 40 int Id(){_error 2_("Not implemented yet.");};41 int MyRank(){_error 2_("Not implemented yet.");};42 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};43 int MarshallSize(){_error 2_("Not implemented yet.");};44 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};45 int ObjectEnum(){_error 2_("Not implemented yet.");};46 Object* copy(){_error 2_("Not implemented yet.");};40 int Id(){_error_("Not implemented yet.");}; 41 int MyRank(){_error_("Not implemented yet.");}; 42 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 43 int MarshallSize(){_error_("Not implemented yet.");}; 44 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 45 int ObjectEnum(){_error_("Not implemented yet.");}; 46 Object* copy(){_error_("Not implemented yet.");}; 47 47 /*}}}*/ 48 48 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_StyleSelector.cpp
r12835 r13101 83 83 return; 84 84 else if (!strncmp(kstr,"</",2)) 85 {_error 2_("KML_StyleSelector::Read -- Unexpected closing tag " << kstr << ".\n");}85 {_error_("KML_StyleSelector::Read -- Unexpected closing tag " << kstr << ".\n");} 86 86 else if (strncmp(kstr,"<",1)) 87 {_error 2_("KML_StyleSelector::Read -- Unexpected field \"" << kstr << "\".\n");}87 {_error_("KML_StyleSelector::Read -- Unexpected field \"" << kstr << "\".\n");} 88 88 89 89 else if (!strncmp(kstr,"<",1)) -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_StyleSelector.h
r12832 r13101 29 29 void Write(FILE* fid,const char* indent); 30 30 void Read(FILE* fid,char* kstr); 31 int Id(){_error 2_("Not implemented yet.");};32 int MyRank(){_error 2_("Not implemented yet.");};33 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};34 int MarshallSize(){_error 2_("Not implemented yet.");};35 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};36 int ObjectEnum(){_error 2_("Not implemented yet.");};37 Object* copy(){_error 2_("Not implemented yet.");};31 int Id(){_error_("Not implemented yet.");}; 32 int MyRank(){_error_("Not implemented yet.");}; 33 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 34 int MarshallSize(){_error_("Not implemented yet.");}; 35 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 36 int ObjectEnum(){_error_("Not implemented yet.");}; 37 Object* copy(){_error_("Not implemented yet.");}; 38 38 /*}}}*/ 39 39 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_SubStyle.cpp
r12835 r13101 83 83 return; 84 84 else if (!strncmp(kstr,"</",2)) 85 {_error 2_("KML_SubStyle::Read -- Unexpected closing tag " << kstr << ".\n");}85 {_error_("KML_SubStyle::Read -- Unexpected closing tag " << kstr << ".\n");} 86 86 else if (strncmp(kstr,"<",1)) 87 {_error 2_("KML_SubStyle::Read -- Unexpected field \"" << kstr << "\".\n");}87 {_error_("KML_SubStyle::Read -- Unexpected field \"" << kstr << "\".\n");} 88 88 89 89 else if (!strncmp(kstr,"<",1)) -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_SubStyle.h
r12832 r13101 29 29 void Write(FILE* fid,const char* indent); 30 30 void Read(FILE* fid,char* kstr); 31 int Id(){_error 2_("Not implemented yet.");};32 int MyRank(){_error 2_("Not implemented yet.");};33 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};34 int MarshallSize(){_error 2_("Not implemented yet.");};35 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};36 int ObjectEnum(){_error 2_("Not implemented yet.");};37 Object* copy(){_error 2_("Not implemented yet.");};31 int Id(){_error_("Not implemented yet.");}; 32 int MyRank(){_error_("Not implemented yet.");}; 33 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 34 int MarshallSize(){_error_("Not implemented yet.");}; 35 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 36 int ObjectEnum(){_error_("Not implemented yet.");}; 37 Object* copy(){_error_("Not implemented yet.");}; 38 38 /*}}}*/ 39 39 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Unknown.cpp
r12946 r13101 160 160 } 161 161 else if (!strncmp(kstri,"</",2)) 162 {_error 2_("KML_Unknown::Read -- Unexpected closing tag " << kstri << ".\n");}162 {_error_("KML_Unknown::Read -- Unexpected closing tag " << kstri << ".\n");} 163 163 164 164 else if (strncmp(kstri,"<",1)) { -
issm/branches/trunk-jpl-damage/src/c/classes/objects/KML/KML_Unknown.h
r12832 r13101 32 32 void Write(FILE* fid,const char* indent); 33 33 void Read(FILE* fid,char* kstr); 34 int Id(){_error 2_("Not implemented yet.");};35 int MyRank(){_error 2_("Not implemented yet.");};36 void Marshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};37 int MarshallSize(){_error 2_("Not implemented yet.");};38 void Demarshall(char** pmarshalled_dataset){_error 2_("Not implemented yet.");};39 int ObjectEnum(){_error 2_("Not implemented yet.");};40 Object* copy(){_error 2_("Not implemented yet.");};34 int Id(){_error_("Not implemented yet.");}; 35 int MyRank(){_error_("Not implemented yet.");}; 36 void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 37 int MarshallSize(){_error_("Not implemented yet.");}; 38 void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");}; 39 int ObjectEnum(){_error_("Not implemented yet.");}; 40 Object* copy(){_error_("Not implemented yet.");}; 41 41 /*}}}*/ 42 42 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Loads/Friction.cpp
r12832 r13101 107 107 vmag=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2)); 108 108 } 109 else _error 2_("element_type "<< element_type << " not supported yet");109 else _error_("element_type "<< element_type << " not supported yet"); 110 110 111 111 /*Checks that s-1>0 if v=0*/ 112 if(vmag==0 && (s-1)<0) _error 2_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf");112 if(vmag==0 && (s-1)<0) _error_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf"); 113 113 114 114 alpha2=pow(drag_coefficient,2)*pow(Neff,r)*pow(vmag,(s-1)); … … 171 171 vmag=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2)); 172 172 } 173 else _error 2_("element_type "<< element_type << " not supported yet");173 else _error_("element_type "<< element_type << " not supported yet"); 174 174 175 175 /*Checks that s-1>0 if v=0*/ 176 if(vmag==0 && (s-1)<0) _error 2_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf");176 if(vmag==0 && (s-1)<0) _error_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf"); 177 177 178 178 alpha2=pow(drag_coefficient,2)*pow(Neff,r)*pow(vmag,(s-1)); … … 238 238 vmag=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2)); 239 239 } 240 else _error 2_("element_type "<< element_type << " not supported yet");240 else _error_("element_type "<< element_type << " not supported yet"); 241 241 242 242 /*Checks that s-1>0 if v=0*/ 243 if(vmag==0 && (s-1)<0) _error 2_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf");243 if(vmag==0 && (s-1)<0) _error_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf"); 244 244 245 245 alpha_complement=pow(Neff,r)*pow(vmag,(s-1)); _assert_(!xIsNan<IssmDouble>(alpha_complement)); … … 304 304 vmag=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2)); 305 305 } 306 else _error 2_("element_type "<< element_type << " not supported yet");306 else _error_("element_type "<< element_type << " not supported yet"); 307 307 308 308 /*Checks that s-1>0 if v=0*/ 309 if(vmag==0 && (s-1)<0) _error 2_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf");309 if(vmag==0 && (s-1)<0) _error_("velocity is 0 and (s-1)=" << (s-1) << "<0, alpha_complement is Inf"); 310 310 311 311 alpha_complement=pow(Neff,r)*pow(vmag,(s-1)); _assert_(!xIsNan<IssmDouble>(alpha_complement)); … … 319 319 320 320 Input* input=inputs->GetInput(enum_type); 321 if(!input) _error 2_("input " << EnumToStringx(enum_type) << " not found");321 if(!input) _error_("input " << EnumToStringx(enum_type) << " not found"); 322 322 input->GetInputValue(pvalue,gauss); 323 323 … … 328 328 329 329 Input* input=inputs->GetInput(enum_type); 330 if(!input) _error 2_("input " << EnumToStringx(enum_type) << " not found");330 if(!input) _error_("input " << EnumToStringx(enum_type) << " not found"); 331 331 input->GetInputValue(pvalue,gauss); 332 332 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Loads/Icefront.cpp
r12832 r13101 81 81 icefront_node_ids[3]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+3)); 82 82 } 83 else _error 2_("in_icefront_type " << EnumToStringx(in_icefront_type) << " not supported yet!");83 else _error_("in_icefront_type " << EnumToStringx(in_icefront_type) << " not supported yet!"); 84 84 85 85 if (in_icefront_type==PattynIceFrontEnum || in_icefront_type==StokesIceFrontEnum) … … 263 263 #endif 264 264 default: 265 _error 2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");265 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 266 266 } 267 267 … … 379 379 #endif 380 380 default: 381 _error 2_("Icefront type " << EnumToStringx(type) << " not supported yet");381 _error_("Icefront type " << EnumToStringx(type) << " not supported yet"); 382 382 } 383 383 } … … 441 441 break; 442 442 default: 443 _error 2_("fill type " << EnumToStringx(fill) << " not supported yet");443 _error_("fill type " << EnumToStringx(fill) << " not supported yet"); 444 444 } 445 445 ice_pressure=1.0/2.0*gravity*rho_ice*pow(thickness,2); … … 564 564 break; 565 565 default: 566 _error 2_("fill type " << EnumToStringx(fill) << " not supported yet");566 _error_("fill type " << EnumToStringx(fill) << " not supported yet"); 567 567 } 568 568 ice_pressure=rho_ice*gravity*(surface-z_g); … … 638 638 break; 639 639 default: 640 _error 2_("fill type " << EnumToStringx(fill) << " not supported yet");640 _error_("fill type " << EnumToStringx(fill) << " not supported yet"); 641 641 } 642 642 air_pressure=0; -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Loads/Icefront.h
r12494 r13101 64 64 void InputUpdateFromConstant(bool constant, int name); 65 65 void InputUpdateFromSolution(IssmDouble* solution); 66 void InputUpdateFromIoModel(int index, IoModel* iomodel){_error 2_("not implemented yet");};66 void InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");}; 67 67 /*}}}*/ 68 68 /*Load virtual functions definitions: {{{*/ -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Loads/Numericalflux.cpp
r12832 r13101 270 270 break; 271 271 default: 272 _error 2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");272 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 273 273 } 274 274 … … 300 300 break; 301 301 default: 302 _error 2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");302 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 303 303 } 304 304 … … 347 347 return CreateKMatrixPrognosticBoundary(); 348 348 default: 349 _error 2_("type not supported yet");349 _error_("type not supported yet"); 350 350 } 351 351 } … … 500 500 return CreateKMatrixBalancethicknessBoundary(); 501 501 default: 502 _error 2_("type not supported yet");502 _error_("type not supported yet"); 503 503 } 504 504 } … … 651 651 return CreateKMatrixAdjointBalancethicknessBoundary(); 652 652 default: 653 _error 2_("type not supported yet");653 _error_("type not supported yet"); 654 654 } 655 655 } … … 683 683 return CreatePVectorPrognosticBoundary(); 684 684 default: 685 _error 2_("type not supported yet");685 _error_("type not supported yet"); 686 686 } 687 687 } … … 751 751 vyaverage_input->GetInputValue(&vy,gauss); 752 752 spcthickness_input->GetInputValue(&thickness,gauss); 753 if(xIsNan<IssmDouble>(thickness)) _error 2_("Cannot weakly apply constraint because NaN was provided");753 if(xIsNan<IssmDouble>(thickness)) _error_("Cannot weakly apply constraint because NaN was provided"); 754 754 755 755 UdotN=vx*normal[0]+vy*normal[1]; … … 777 777 return CreatePVectorBalancethicknessBoundary(); 778 778 default: 779 _error 2_("type not supported yet");779 _error_("type not supported yet"); 780 780 } 781 781 } -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Loads/Numericalflux.h
r12494 r13101 50 50 /*Update virtual functions resolution: {{{*/ 51 51 void InputUpdateFromVector(IssmDouble* vector, int name, int type){/*Do nothing*/} 52 void InputUpdateFromVector(int* vector, int name, int type){_error 2_("Not implemented yet!");}53 void InputUpdateFromVector(bool* vector, int name, int type){_error 2_("Not implemented yet!");}52 void InputUpdateFromVector(int* vector, int name, int type){_error_("Not implemented yet!");} 53 void InputUpdateFromVector(bool* vector, int name, int type){_error_("Not implemented yet!");} 54 54 void InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){/*Do nothing*/} 55 55 void InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){/*Do nothing*/} 56 void InputUpdateFromVectorDakota(int* vector, int name, int type){_error 2_("Not implemented yet!");}57 void InputUpdateFromVectorDakota(bool* vector, int name, int type){_error 2_("Not implemented yet!");}56 void InputUpdateFromVectorDakota(int* vector, int name, int type){_error_("Not implemented yet!");} 57 void InputUpdateFromVectorDakota(bool* vector, int name, int type){_error_("Not implemented yet!");} 58 58 void InputUpdateFromConstant(IssmDouble constant, int name){/*Do nothing*/}; 59 59 void InputUpdateFromConstant(int constant, int name){/*Do nothing*/}; 60 void InputUpdateFromConstant(bool constant, int name){_error 2_("Not implemented yet!");}61 void InputUpdateFromSolution(IssmDouble* solution){_error 2_("Not implemented yet!");}62 void InputUpdateFromIoModel(int index, IoModel* iomodel){_error 2_("not implemented yet");};60 void InputUpdateFromConstant(bool constant, int name){_error_("Not implemented yet!");} 61 void InputUpdateFromSolution(IssmDouble* solution){_error_("Not implemented yet!");} 62 void InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");}; 63 63 /*}}}*/ 64 64 /*Load virtual functions definitions: {{{*/ … … 67 67 void CreateKMatrix(Matrix* Kff, Matrix* Kfs); 68 68 void CreatePVector(Vector* pf); 69 void CreateJacobianMatrix(Matrix* Jff){_error 2_("Not implemented yet");};70 void PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error 2_("Not implemented yet");};69 void CreateJacobianMatrix(Matrix* Jff){_error_("Not implemented yet");}; 70 void PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error_("Not implemented yet");}; 71 71 void PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax); 72 72 void PenaltyCreatePVector(Vector* pf, IssmDouble kmax); -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Loads/Pengrid.cpp
r12832 r13101 239 239 #endif 240 240 default: 241 _error 2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");241 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 242 242 } 243 243 … … 271 271 #endif 272 272 default: 273 _error 2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");273 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 274 274 } 275 275 … … 379 379 } 380 380 else{ 381 _error 2_("analysis: " << EnumToStringx(analysis_type) << " not supported yet");381 _error_("analysis: " << EnumToStringx(analysis_type) << " not supported yet"); 382 382 } 383 383 … … 572 572 } 573 573 else{ 574 if ( dt) pe->values[0]=melting_offset*pow((IssmDouble)10,penalty_factor)*(temperature-t_pmp)/dt;574 if (reCast<bool>(dt)) pe->values[0]=melting_offset*pow((IssmDouble)10,penalty_factor)*(temperature-t_pmp)/dt; 575 575 else pe->values[0]=melting_offset*pow((IssmDouble)10,penalty_factor)*(temperature-t_pmp); 576 576 } … … 616 616 /*FUNCTION Pengrid::UpdateInputs {{{*/ 617 617 void Pengrid::UpdateInputs(IssmDouble* solution){ 618 _error 2_("not supported yet!");619 } 620 /*}}}*/ 618 _error_("not supported yet!"); 619 } 620 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Loads/Pengrid.h
r12494 r13101 65 65 void InputUpdateFromConstant(bool constant, int name); 66 66 void InputUpdateFromSolution(IssmDouble* solution); 67 void InputUpdateFromIoModel(int index, IoModel* iomodel){_error 2_("not implemented yet");};67 void InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");}; 68 68 /*}}}*/ 69 69 /*Load virtual functions definitions: {{{*/ … … 72 72 void CreateKMatrix(Matrix* Kff, Matrix* Kfs); 73 73 void CreatePVector(Vector* pf); 74 void CreateJacobianMatrix(Matrix* Jff){_error 2_("Not implemented yet");};75 void PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error 2_("Not implemented yet");};74 void CreateJacobianMatrix(Matrix* Jff){_error_("Not implemented yet");}; 75 void PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error_("Not implemented yet");}; 76 76 void PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax); 77 77 void PenaltyCreatePVector(Vector* pf, IssmDouble kmax); -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Loads/Penpair.cpp
r12832 r13101 172 172 break; 173 173 default: 174 _error 2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");174 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 175 175 } 176 176 … … 244 244 case MacAyealApproximationEnum: return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax); 245 245 case PattynApproximationEnum: return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax); 246 default: _error 2_("not supported yet");246 default: _error_("not supported yet"); 247 247 } 248 248 case PattynApproximationEnum: … … 250 250 case MacAyealApproximationEnum: return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax); 251 251 case PattynApproximationEnum: return PenaltyCreateKMatrixDiagnosticMacAyealPattyn(kmax); 252 default: _error 2_("not supported yet");252 default: _error_("not supported yet"); 253 253 } 254 254 case StokesApproximationEnum: … … 256 256 case StokesApproximationEnum: return PenaltyCreateKMatrixDiagnosticStokes(kmax); 257 257 case NoneApproximationEnum: return PenaltyCreateKMatrixDiagnosticStokes(kmax); 258 default: _error 2_("not supported yet");258 default: _error_("not supported yet"); 259 259 } 260 260 case NoneApproximationEnum: … … 262 262 case StokesApproximationEnum: return PenaltyCreateKMatrixDiagnosticStokes(kmax); 263 263 case NoneApproximationEnum: return PenaltyCreateKMatrixDiagnosticStokes(kmax); 264 default: _error 2_("not supported yet");264 default: _error_("not supported yet"); 265 265 } 266 default: _error 2_("not supported yet");266 default: _error_("not supported yet"); 267 267 } 268 268 } -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Loads/Penpair.h
r12494 r13101 44 44 void InputUpdateFromVector(int* vector, int name, int type); 45 45 void InputUpdateFromVector(bool* vector, int name, int type); 46 void InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrow, int ncols,int name, int type){_error 2_("Not implemented yet!");}47 void InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){_error 2_("Not implemented yet!");}48 void InputUpdateFromVectorDakota(int* vector, int name, int type){_error 2_("Not implemented yet!");}49 void InputUpdateFromVectorDakota(bool* vector, int name, int type){_error 2_("Not implemented yet!");}46 void InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrow, int ncols,int name, int type){_error_("Not implemented yet!");} 47 void InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){_error_("Not implemented yet!");} 48 void InputUpdateFromVectorDakota(int* vector, int name, int type){_error_("Not implemented yet!");} 49 void InputUpdateFromVectorDakota(bool* vector, int name, int type){_error_("Not implemented yet!");} 50 50 void InputUpdateFromConstant(IssmDouble constant, int name); 51 51 void InputUpdateFromConstant(int constant, int name); 52 52 void InputUpdateFromConstant(bool constant, int name); 53 void InputUpdateFromSolution(IssmDouble* solution){_error 2_("Not implemented yet!");}54 void InputUpdateFromIoModel(int index, IoModel* iomodel){_error 2_("not implemented yet");};53 void InputUpdateFromSolution(IssmDouble* solution){_error_("Not implemented yet!");} 54 void InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");}; 55 55 /*}}}*/ 56 56 /*Load virtual functions definitions: {{{*/ -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Loads/Riftfront.cpp
r12832 r13101 60 60 61 61 /*Ok, retrieve all the data needed to add a penalty between the two nodes: */ 62 el1= (int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+2);63 el2= (int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+3);64 65 node1= (int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+0);66 node2= (int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+1);62 el1=reCast<int,IssmDouble>(*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+2)); 63 el2=reCast<int,IssmDouble>(*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+3)) ; 64 65 node1=reCast<int,IssmDouble>(*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+0)); 66 node2=reCast<int,IssmDouble>(*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+1)); 67 67 68 68 /*id: */ … … 93 93 this->length=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+6); 94 94 this->fraction=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+9); 95 this->state= (int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+11);95 this->state=reCast<int,IssmDouble>(*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+11)); 96 96 97 97 //intialize inputs, and add as many inputs per element as requested: … … 99 99 100 100 riftfront_type=SegmentRiftfrontEnum; 101 riftfront_fill = (int)*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+7);101 riftfront_fill = reCast<int,IssmDouble>(*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+7)); 102 102 riftfront_friction=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+8); 103 103 riftfront_fractionincrement=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+10); 104 riftfront_shelf= (bool)iomodel->Data(MaskVertexonfloatingiceEnum)[node1-1];104 riftfront_shelf=reCast<bool,IssmDouble>(iomodel->Data(MaskVertexonfloatingiceEnum)[node1-1]); 105 105 106 106 this->inputs->AddInput(new IntInput(TypeEnum,riftfront_type)); … … 276 276 277 277 /*update input*/ 278 _error 2_("not implemented yet");278 _error_("not implemented yet"); 279 279 //this->inputs->AddInput(new DoubleInput(name,constant)); 280 280 … … 324 324 break; 325 325 default: 326 _error 2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");326 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 327 327 } 328 328 … … 350 350 break; 351 351 default: 352 _error 2_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");352 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 353 353 } 354 354 … … 397 397 398 398 /*enum of element? */ 399 if(elements[0]->ObjectEnum()!=TriaEnum)_error 2_("only Tria element allowed for Riftfront load!");399 if(elements[0]->ObjectEnum()!=TriaEnum)_error_("only Tria element allowed for Riftfront load!"); 400 400 tria1=(Tria*)elements[0]; 401 401 tria2=(Tria*)elements[1]; … … 410 410 tria1->GetInputValue(&h[0],nodes[0],ThicknessEnum); 411 411 tria2->GetInputValue(&h[1],nodes[1],ThicknessEnum); 412 if (h[0]!=h[1])_error 2_("different thicknesses not supported for rift fronts");412 if (h[0]!=h[1])_error_("different thicknesses not supported for rift fronts"); 413 413 thickness=h[0]; 414 414 … … 488 488 489 489 /*enum of element? */ 490 if(elements[0]->ObjectEnum()!=TriaEnum)_error 2_("only Tria element allowed for Riftfront load!");490 if(elements[0]->ObjectEnum()!=TriaEnum)_error_("only Tria element allowed for Riftfront load!"); 491 491 tria1=(Tria*)elements[0]; 492 492 tria2=(Tria*)elements[1]; … … 504 504 tria1->GetInputValue(&h[0],nodes[0],ThicknessEnum); 505 505 tria2->GetInputValue(&h[1],nodes[1],ThicknessEnum); 506 if (h[0]!=h[1])_error 2_("different thicknesses not supported for rift fronts");506 if (h[0]!=h[1])_error_("different thicknesses not supported for rift fronts"); 507 507 thickness=h[0]; 508 508 tria1->GetInputValue(&b[0],nodes[0],BedEnum); 509 509 tria2->GetInputValue(&b[1],nodes[1],BedEnum); 510 if (b[0]!=b[1])_error 2_("different beds not supported for rift fronts");510 if (b[0]!=b[1])_error_("different beds not supported for rift fronts"); 511 511 bed=b[0]; 512 512 … … 536 536 else if(fill==MelangeEnum){ //icefront finding itself against another icefront (pressure imbalance is fully compensated, ice vs ice) 537 537 538 if(!shelf) _error 2_("fill type " << fill << " not supported on ice sheets yet.");538 if(!shelf) _error_("fill type " << fill << " not supported on ice sheets yet."); 539 539 540 540 pressure_litho=rho_ice*gravity*pow(thickness,(IssmDouble)2)/(IssmDouble)2; … … 546 546 } 547 547 else{ 548 _error 2_("fill type " << fill << " not supported yet.");548 _error_("fill type " << fill << " not supported yet."); 549 549 } 550 550 … … 585 585 586 586 /*enum of element? */ 587 if(elements[0]->ObjectEnum()!=TriaEnum)_error 2_("only Tria element allowed for Riftfront load!");587 if(elements[0]->ObjectEnum()!=TriaEnum)_error_("only Tria element allowed for Riftfront load!"); 588 588 589 589 /*recover elements on both side of rift: */ … … 679 679 this->inputs->GetInputValue(&converged,ConvergedEnum); 680 680 681 if( converged){681 if(reCast<int,IssmDouble>(converged)){ 682 682 /*ok, material non-linearity has converged. If that was already the case, we keep 683 683 * constraining the rift front. If it was not, and this is the first time the material … … 706 706 707 707 /*enum of element? */ 708 if(elements[0]->ObjectEnum()!=TriaEnum)_error 2_("only Tria element allowed for Riftfront load!");708 if(elements[0]->ObjectEnum()!=TriaEnum)_error_("only Tria element allowed for Riftfront load!"); 709 709 710 710 /*recover elements on both side of rift: */ … … 751 751 752 752 /*enum of element? */ 753 if(elements[0]->ObjectEnum()!=TriaEnum)_error 2_("only Tria element allowed for Riftfront load!");753 if(elements[0]->ObjectEnum()!=TriaEnum)_error_("only Tria element allowed for Riftfront load!"); 754 754 755 755 /*recover elements on both side of rift: */ … … 794 794 795 795 /*enum of element? */ 796 if(elements[0]->ObjectEnum()!=TriaEnum)_error 2_("only Tria element allowed for Riftfront load!");796 if(elements[0]->ObjectEnum()!=TriaEnum)_error_("only Tria element allowed for Riftfront load!"); 797 797 798 798 /*recover elements on both side of rift: */ … … 844 844 845 845 /*enum of element? */ 846 if(elements[0]->ObjectEnum()!=TriaEnum)_error 2_("only Tria element allowed for Riftfront load!");846 if(elements[0]->ObjectEnum()!=TriaEnum)_error_("only Tria element allowed for Riftfront load!"); 847 847 848 848 /*recover elements on both side of rift: */ -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Loads/Riftfront.h
r12494 r13101 62 62 /*Update virtual functions resolution: {{{*/ 63 63 void InputUpdateFromVector(IssmDouble* vector, int name, int type); 64 void InputUpdateFromVector(int* vector, int name, int type){_error 2_("Not implemented yet!");}65 void InputUpdateFromVector(bool* vector, int name, int type){_error 2_("Not implemented yet!");}66 void InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows,int ncols, int name, int type){_error 2_("Not implemented yet!");}67 void InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){_error 2_("Not implemented yet!");}68 void InputUpdateFromVectorDakota(int* vector, int name, int type){_error 2_("Not implemented yet!");}69 void InputUpdateFromVectorDakota(bool* vector, int name, int type){_error 2_("Not implemented yet!");}64 void InputUpdateFromVector(int* vector, int name, int type){_error_("Not implemented yet!");} 65 void InputUpdateFromVector(bool* vector, int name, int type){_error_("Not implemented yet!");} 66 void InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows,int ncols, int name, int type){_error_("Not implemented yet!");} 67 void InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){_error_("Not implemented yet!");} 68 void InputUpdateFromVectorDakota(int* vector, int name, int type){_error_("Not implemented yet!");} 69 void InputUpdateFromVectorDakota(bool* vector, int name, int type){_error_("Not implemented yet!");} 70 70 void InputUpdateFromConstant(IssmDouble constant, int name); 71 void InputUpdateFromConstant(int constant, int name){_error 2_("Not implemented yet!");}71 void InputUpdateFromConstant(int constant, int name){_error_("Not implemented yet!");} 72 72 void InputUpdateFromConstant(bool constant, int name); 73 void InputUpdateFromSolution(IssmDouble* solution){_error 2_("Not implemented yet!");}74 void InputUpdateFromIoModel(int index, IoModel* iomodel){_error 2_("not implemented yet");};73 void InputUpdateFromSolution(IssmDouble* solution){_error_("Not implemented yet!");} 74 void InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");}; 75 75 /*}}}*/ 76 76 /*Load virtual functions definitions: {{{*/ … … 79 79 void CreateKMatrix(Matrix* Kff, Matrix* Kfs); 80 80 void CreatePVector(Vector* pf); 81 void CreateJacobianMatrix(Matrix* Jff){_error 2_("Not implemented yet");};82 void PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error 2_("Not implemented yet");};81 void CreateJacobianMatrix(Matrix* Jff){_error_("Not implemented yet");}; 82 void PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error_("Not implemented yet");}; 83 83 void PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax); 84 84 void PenaltyCreatePVector(Vector* pf, IssmDouble kmax); -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Materials/Matice.cpp
r12897 r13101 128 128 } 129 129 /*}}}*/ 130 /*FUNCTION Matice::GetA {{{*/ 131 IssmDouble Matice::GetA(){ 132 /* 133 * A = 1/B^n 134 */ 135 136 IssmDouble B,n; 137 138 inputs->GetInputAverage(&B,MaterialsRheologyBEnum); 139 n=this->GetN(); 140 141 return pow(B,-n); 142 } 143 /*}}}*/ 130 144 /*FUNCTION Matice::GetB {{{*/ 131 145 IssmDouble Matice::GetB(){ … … 200 214 /*Get input (either in element or material)*/ 201 215 Input* input=inputs->GetInput(input_enum); 202 if(!input) _error 2_("Input " << EnumToStringx(input_enum) << " not found in material");216 if(!input) _error_("Input " << EnumToStringx(input_enum) << " not found in material"); 203 217 204 218 /*We found the enum. Use its values to fill into the vector, using the vertices ids: */ … … 206 220 break; 207 221 208 default: _error 2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");222 default: _error_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet"); 209 223 } 210 224 } … … 258 272 if(A==0){ 259 273 /*Maxiviscositym viscosity for 0 shear areas: */ 260 viscosity=2.5*pow( (IssmDouble)10,(IssmDouble)17);274 viscosity=2.5*pow(10.,17.); 261 275 } 262 276 else{ … … 268 282 269 283 /*Checks in debugging mode*/ 270 if(viscosity<=0) _error 2_("Negative viscosity");284 if(viscosity<=0) _error_("Negative viscosity"); 271 285 _assert_(B>0); 272 286 _assert_(n>0); … … 339 353 340 354 /*Checks in debugging mode*/ 341 if(viscosity3d<=0) _error 2_("Negative viscosity");355 if(viscosity3d<=0) _error_("Negative viscosity"); 342 356 _assert_(B>0); 343 357 _assert_(n>0); … … 411 425 412 426 /*Checks in debugging mode*/ 413 if(viscosity3d<=0) _error 2_("Negative viscosity");427 if(viscosity3d<=0) _error_("Negative viscosity"); 414 428 _assert_(B>0); 415 429 _assert_(n>0); … … 628 642 return; 629 643 } 630 default: _error 2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");631 } 632 default: _error 2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");644 default: _error_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet"); 645 } 646 default: _error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet"); 633 647 } 634 648 } … … 686 700 return; 687 701 } 688 default: _error 2_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");689 } 690 default: _error 2_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");702 default: _error_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet"); 703 } 704 default: _error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet"); 691 705 } 692 706 … … 775 789 if (control_analysis && iomodel->Data(InversionControlParametersEnum)){ 776 790 for(i=0;i<num_control_type;i++){ 777 switch( (int)iomodel->Data(InversionControlParametersEnum)[i]){791 switch(reCast<int>(iomodel->Data(InversionControlParametersEnum)[i])){ 778 792 case MaterialsRheologyBbarEnum: 779 793 if (iomodel->Data(MaterialsRheologyBEnum)){ 780 794 _assert_(iomodel->Data(MaterialsRheologyBEnum));_assert_(iomodel->Data(InversionMinParametersEnum)); _assert_(iomodel->Data(InversionMaxParametersEnum)); 781 for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyBEnum)[ int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];782 for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[ int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];783 for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[ int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];795 for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyBEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)]; 796 for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i]; 797 for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i]; 784 798 this->inputs->AddInput(new ControlInput(MaterialsRheologyBbarEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 785 799 } … … 813 827 /*Get B*/ 814 828 if (iomodel->Data(MaterialsRheologyBEnum)) { 815 for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyBEnum)[ int(iomodel->Data(MeshElementsEnum)[num_vertices*index+i]-1)];829 for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyBEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+i]-1)]; 816 830 this->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,nodeinputs)); 817 831 } … … 833 847 if (control_analysis && iomodel->Data(InversionControlParametersEnum)){ 834 848 for(i=0;i<num_control_type;i++){ 835 switch( (int)iomodel->Data(InversionControlParametersEnum)[i]){849 switch(reCast<int>(iomodel->Data(InversionControlParametersEnum)[i])){ 836 850 case MaterialsRheologyBbarEnum: 837 851 if (iomodel->Data(MaterialsRheologyBEnum)){ 838 852 _assert_(iomodel->Data(MaterialsRheologyBEnum));_assert_(iomodel->Data(InversionMinParametersEnum)); _assert_(iomodel->Data(InversionMaxParametersEnum)); 839 for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyBEnum)[ int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];840 for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[ int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];841 for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[ int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];853 for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyBEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)]; 854 for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i]; 855 for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[reCast<int,IssmDouble>(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i]; 842 856 this->inputs->AddInput(new ControlInput(MaterialsRheologyBEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 843 857 } … … 859 873 #endif 860 874 else{ 861 _error 2_("Mesh type not supported yet!");875 _error_("Mesh type not supported yet!"); 862 876 } 863 877 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Materials/Matice.h
r12897 r13101 66 66 void GetViscosityDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon); 67 67 void GetViscosity2dDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon); 68 IssmDouble GetA(); 68 69 IssmDouble GetB(); 69 70 IssmDouble GetBbar(); -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Materials/Matpar.h
r12494 r13101 62 62 void InputUpdateFromConstant(bool constant, int name); 63 63 void InputUpdateFromSolution(IssmDouble* solution); 64 void InputUpdateFromIoModel(int index, IoModel* iomodel){_error 2_("not implemented yet");};64 void InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");}; 65 65 /*}}}*/ 66 66 /*Material virtual functions resolution: {{{*/ 67 void InputDuplicate(int original_enum,int new_enum){_error 2_("not implemented yet");};67 void InputDuplicate(int original_enum,int new_enum){_error_("not implemented yet");}; 68 68 void Configure(Elements* elements); 69 69 void GetVectorFromInputs(Vector* vector,int input_enum){return;} -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Node.cpp
r12832 r13101 70 70 71 71 /*spc all nodes on water*/ 72 if (!iomodel->Data(MaskVertexonwaterEnum)) _error 2_("iomodel->nodeonwater is NULL");72 if (!iomodel->Data(MaskVertexonwaterEnum)) _error_("iomodel->nodeonwater is NULL"); 73 73 if (reCast<IssmBool>(iomodel->Data(MaskVertexonwaterEnum)[io_index])){ 74 74 for(k=1;k<=gsize;k++){ … … 89 89 _assert_(iomodel->Data(MeshVertexonbedEnum)); 90 90 _assert_(iomodel->Data(FlowequationVertexEquationEnum)); 91 if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealApproximationEnum && ! iomodel->Data(MeshVertexonbedEnum)[io_index]){91 if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealApproximationEnum && !reCast<int>(iomodel->Data(MeshVertexonbedEnum)[io_index])){ 92 92 for(k=1;k<=gsize;k++) this->FreezeDof(k); 93 93 } 94 if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealPattynApproximationEnum && iomodel->Data(FlowequationBordermacayealEnum)[io_index]){ 95 if(!iomodel->Data(MeshVertexonbedEnum)[io_index]){ 94 if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==L1L2ApproximationEnum && !reCast<int>(iomodel->Data(MeshVertexonbedEnum)[io_index])){ 95 for(k=1;k<=gsize;k++) this->FreezeDof(k); 96 } 97 if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealPattynApproximationEnum && reCast<int>(iomodel->Data(FlowequationBordermacayealEnum)[io_index])){ 98 if(!reCast<int>(iomodel->Data(MeshVertexonbedEnum)[io_index])){ 96 99 for(k=1;k<=gsize;k++) this->FreezeDof(k); 97 100 } 98 101 } 99 if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealStokesApproximationEnum && iomodel->Data(FlowequationBordermacayealEnum)[io_index]){100 if(! iomodel->Data(MeshVertexonbedEnum)[io_index]){102 if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealStokesApproximationEnum && reCast<int>(iomodel->Data(FlowequationBordermacayealEnum)[io_index])){ 103 if(!reCast<int>(iomodel->Data(MeshVertexonbedEnum)[io_index])){ 101 104 for(k=1;k<=2;k++) this->FreezeDof(k); 102 105 } … … 114 117 /*Diagnostic Hutter*/ 115 118 if (analysis_type==DiagnosticHutterAnalysisEnum){ 116 if (!iomodel->Data(FlowequationVertexEquationEnum)) _error2_("iomodel->vertices_type is NULL");119 _assert_(iomodel->Data(FlowequationVertexEquationEnum)); 117 120 /*Constrain all nodes that are not Hutter*/ 118 121 if (reCast<int>(iomodel->Data(FlowequationVertexEquationEnum)[io_index])!=HutterApproximationEnum){ … … 230 233 return indexing.sdoflist[dofindex]; 231 234 } 232 else _error 2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");235 else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!"); 233 236 234 237 } … … 302 305 else for(i=0;i<this->indexing.ssize;i++) outdoflist[i]=indexing.sdoflist[i]; 303 306 } 304 else _error 2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");307 else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!"); 305 308 } 306 309 } … … 342 345 } 343 346 } 344 else _error 2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");347 else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!"); 345 348 } 346 349 else{ … … 411 414 } 412 415 } 413 else _error 2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");416 else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!"); 414 417 } 415 418 } … … 597 600 else if (setenum==FsetEnum) numdofs=this->indexing.fsize; 598 601 else if (setenum==SsetEnum) numdofs=this->indexing.ssize; 599 else _error 2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");602 else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!"); 600 603 } 601 604 else{ … … 627 630 else numdofs=this->indexing.ssize; 628 631 } 629 else _error 2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");632 else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!"); 630 633 } 631 634 return numdofs; … … 834 837 } 835 838 } 836 else _error 2_("VecMerge can only merge from the s or f-set onto the g-set!");839 else _error_("VecMerge can only merge from the s or f-set onto the g-set!"); 837 840 838 841 /*Free ressources:*/ … … 880 883 } 881 884 } 882 else _error 2_("VecReduce can only merge from the s or f-set onto the g-set!");885 else _error_("VecReduce can only merge from the s or f-set onto the g-set!"); 883 886 884 887 /*Free ressources:*/ … … 927 930 dofcount+=this->indexing.ssize; 928 931 } 929 else _error 2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");932 else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!"); 930 933 931 934 … … 956 959 for(i=0;i<this->indexing.ssize;i++) indexing.sdoflist[i]+=dofcount; 957 960 } 958 else _error 2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");961 else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!"); 959 962 } 960 963 /*}}}*/ … … 972 975 else if(setenum==FsetEnum)for(j=0;j<this->indexing.fsize;j++) *(truedofs+ncols*sid+j)=indexing.fdoflist[j]; 973 976 else if(setenum==SsetEnum)for(j=0;j<this->indexing.ssize;j++) *(truedofs+ncols*sid+j)=indexing.sdoflist[j]; 974 else _error 2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");977 else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!"); 975 978 976 979 } … … 991 994 else if(setenum==FsetEnum)for(j=0;j<this->indexing.fsize;j++) indexing.fdoflist[j]=*(alltruedofs+ncols*sid+j); 992 995 else if(setenum==SsetEnum)for(j=0;j<this->indexing.ssize;j++) indexing.sdoflist[j]=*(alltruedofs+ncols*sid+j); 993 else _error 2_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");996 else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!"); 994 997 995 998 } -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Node.h
r12832 r13101 45 45 int MyRank(); 46 46 int ObjectEnum(); 47 Object* copy(){_error 2_("Not implemented yet (similar to Elements)");};47 Object* copy(){_error_("Not implemented yet (similar to Elements)");}; 48 48 /*}}}*/ 49 49 /*Update virtual functions definitions: {{{*/ … … 59 59 void InputUpdateFromConstant(int constant, int name); 60 60 void InputUpdateFromConstant(bool constant, int name); 61 void InputUpdateFromSolution(IssmDouble* solution){_error 2_("Not implemented yet!");}62 void InputUpdateFromIoModel(int index, IoModel* iomodel){_error 2_("Not implemented yet!");}61 void InputUpdateFromSolution(IssmDouble* solution){_error_("Not implemented yet!");} 62 void InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("Not implemented yet!");} 63 63 /*}}}*/ 64 64 /*Node numerical routines {{{*/ -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Options/Option.h
r12832 r13101 31 31 virtual void DeepEcho(); 32 32 virtual void DeepEcho(char* indent); 33 int Id(){_error 2_("Not implemented yet");};34 int MyRank(){_error 2_("Not implemented yet");};33 int Id(){_error_("Not implemented yet");}; 34 int MyRank(){_error_("Not implemented yet");}; 35 35 int ObjectEnum(){return OptionEnum;}; 36 Object* copy(){_error 2_("Not implemented yet");};36 Object* copy(){_error_("Not implemented yet");}; 37 37 /*}}}*/ 38 38 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Options/OptionCell.h
r12832 r13101 28 28 void DeepEcho(); 29 29 void DeepEcho(char* indent); 30 int Id(){_error 2_("Not implemented yet");};31 int MyRank(){_error 2_("Not implemented yet");};30 int Id(){_error_("Not implemented yet");}; 31 int MyRank(){_error_("Not implemented yet");}; 32 32 int ObjectEnum(){return OptionCellEnum;}; 33 Object* copy(){_error 2_("Not implemented yet");};33 Object* copy(){_error_("Not implemented yet");}; 34 34 /*}}}*/ 35 35 … … 39 39 int NDims(); 40 40 int* Size(); 41 void Get(int* pvalue){_error 2_("An OptionCell object cannot return a int");};42 void Get(IssmDouble* pvalue){_error 2_("An OptionCell object cannot return a IssmDouble");};43 void Get(bool* pvalue){ _error 2_("An OptionCell object cannot return a bool");};44 void Get(char** pvalue){ _error 2_("An OptionCell object cannot return a string");};45 void Get(char*** ppvalue,int *pnumel){ _error 2_("An OptionCell object cannot return a string vec");};46 void Get(IssmDouble** pvalue,int *pnumel){ _error 2_("An OptionCell object cannot return a IssmDouble vec");};41 void Get(int* pvalue){_error_("An OptionCell object cannot return a int");}; 42 void Get(IssmDouble* pvalue){_error_("An OptionCell object cannot return a IssmDouble");}; 43 void Get(bool* pvalue){ _error_("An OptionCell object cannot return a bool");}; 44 void Get(char** pvalue){ _error_("An OptionCell object cannot return a string");}; 45 void Get(char*** ppvalue,int *pnumel){ _error_("An OptionCell object cannot return a string vec");}; 46 void Get(IssmDouble** pvalue,int *pnumel){ _error_("An OptionCell object cannot return a IssmDouble vec");}; 47 47 void Get(Options** pvalue); 48 void Get(Options*** ppvalue,int *pnumel){ _error 2_("An OptionCell object cannot return an Options DataSet vec");};48 void Get(Options*** ppvalue,int *pnumel){ _error_("An OptionCell object cannot return an Options DataSet vec");}; 49 49 50 50 }; -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Options/OptionChar.cpp
r12832 r13101 153 153 /*We should first check that the size is at least one*/ 154 154 if(this->NumEl()<=0){ 155 _error 2_("option \"" << this->name << "\" is empty and cannot return a string vector");155 _error_("option \"" << this->name << "\" is empty and cannot return a string vector"); 156 156 } 157 157 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Options/OptionChar.h
r12832 r13101 28 28 void DeepEcho(); 29 29 void DeepEcho(char* indent); 30 int Id(){_error 2_("Not implemented yet");};31 int MyRank(){_error 2_("Not implemented yet");};30 int Id(){_error_("Not implemented yet");}; 31 int MyRank(){_error_("Not implemented yet");}; 32 32 int ObjectEnum(){return OptionCharEnum;}; 33 Object* copy(){_error 2_("Not implemented yet");};33 Object* copy(){_error_("Not implemented yet");}; 34 34 /*}}}*/ 35 35 … … 39 39 int NDims(); 40 40 int* Size(); 41 void Get(int* pvalue){_error 2_("An OptionChar object cannot return a int");};42 void Get(IssmDouble* pvalue){_error 2_("An OptionChar object cannot return a IssmDouble");};43 void Get(bool* pvalue){ _error 2_("An OptionChar object cannot return a bool");};41 void Get(int* pvalue){_error_("An OptionChar object cannot return a int");}; 42 void Get(IssmDouble* pvalue){_error_("An OptionChar object cannot return a IssmDouble");}; 43 void Get(bool* pvalue){ _error_("An OptionChar object cannot return a bool");}; 44 44 void Get(char** pvalue); 45 45 void Get(char*** ppvalue,int *pnumel); 46 void Get(IssmDouble** pvalue,int *pnumel){ _error 2_("An OptionChar object cannot return a IssmDouble vec");};47 void Get(Options** pvalue){ _error 2_("An OptionChar object cannot return an Options DataSet");};48 void Get(Options*** ppvalue,int *pnumel){ _error 2_("An OptionChar object cannot return an Options DataSet vec");};46 void Get(IssmDouble** pvalue,int *pnumel){ _error_("An OptionChar object cannot return a IssmDouble vec");}; 47 void Get(Options** pvalue){ _error_("An OptionChar object cannot return an Options DataSet");}; 48 void Get(Options*** ppvalue,int *pnumel){ _error_("An OptionChar object cannot return an Options DataSet vec");}; 49 49 50 50 }; -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Options/OptionDouble.cpp
r12832 r13101 125 125 /*We should first check that the size is one*/ 126 126 if(this->NumEl()!=1){ 127 _error 2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single int");127 _error_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single int"); 128 128 } 129 129 … … 137 137 /*We should first check that the size is one*/ 138 138 if(this->NumEl()!=1){ 139 _error 2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single IssmDouble");139 _error_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single IssmDouble"); 140 140 } 141 141 … … 149 149 /*We should first check that the size is at least one*/ 150 150 if(this->NumEl()<=0){ 151 _error 2_("option \"" << this->name << "\" is empty and cannot return a IssmDouble vector");151 _error_("option \"" << this->name << "\" is empty and cannot return a IssmDouble vector"); 152 152 } 153 153 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Options/OptionDouble.h
r12832 r13101 28 28 void DeepEcho(); 29 29 void DeepEcho(char* indent); 30 int Id(){_error 2_("Not implemented yet");};31 int MyRank(){_error 2_("Not implemented yet");};30 int Id(){_error_("Not implemented yet");}; 31 int MyRank(){_error_("Not implemented yet");}; 32 32 int ObjectEnum(){return OptionDoubleEnum;}; 33 Object* copy(){_error 2_("Not implemented yet");};33 Object* copy(){_error_("Not implemented yet");}; 34 34 /*}}}*/ 35 35 … … 41 41 void Get(int* pvalue); 42 42 void Get(IssmDouble* pvalue); 43 void Get(bool* pvalue){ _error 2_("An OptionDouble object cannot return a bool");};44 void Get(char** pvalue){ _error 2_("An OptionDouble object cannot return a string");};45 void Get(char*** ppvalue,int *pnumel){ _error 2_("An OptionDouble object cannot return a string vec");};43 void Get(bool* pvalue){ _error_("An OptionDouble object cannot return a bool");}; 44 void Get(char** pvalue){ _error_("An OptionDouble object cannot return a string");}; 45 void Get(char*** ppvalue,int *pnumel){ _error_("An OptionDouble object cannot return a string vec");}; 46 46 void Get(IssmDouble** pvalue,int* pnumel); 47 void Get(Options** pvalue){ _error 2_("An OptionDouble object cannot return an Options DataSet");};48 void Get(Options*** ppvalue,int *pnumel){ _error 2_("An OptionDouble object cannot return an Options DataSet vec");};47 void Get(Options** pvalue){ _error_("An OptionDouble object cannot return an Options DataSet");}; 48 void Get(Options*** ppvalue,int *pnumel){ _error_("An OptionDouble object cannot return an Options DataSet vec");}; 49 49 50 50 }; -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Options/OptionLogical.cpp
r12832 r13101 125 125 /*We should first check that the size is one*/ 126 126 if(this->NumEl()!=1){ 127 _error 2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single bool");127 _error_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single bool"); 128 128 } 129 129 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Options/OptionLogical.h
r12832 r13101 28 28 void DeepEcho(); 29 29 void DeepEcho(char* indent); 30 int Id(){_error 2_("Not implemented yet");};31 int MyRank(){_error 2_("Not implemented yet");};30 int Id(){_error_("Not implemented yet");}; 31 int MyRank(){_error_("Not implemented yet");}; 32 32 int ObjectEnum(){return OptionLogicalEnum;}; 33 Object* copy(){_error 2_("Not implemented yet");};33 Object* copy(){_error_("Not implemented yet");}; 34 34 /*}}}*/ 35 35 … … 39 39 int NDims(); 40 40 int* Size(); 41 void Get(int* pvalue){_error 2_("An OptionLogical object cannot return a int");};42 void Get(IssmDouble* pvalue){_error 2_("An OptionLogical object cannot return a IssmDouble");};41 void Get(int* pvalue){_error_("An OptionLogical object cannot return a int");}; 42 void Get(IssmDouble* pvalue){_error_("An OptionLogical object cannot return a IssmDouble");}; 43 43 void Get(bool* pvalue); 44 void Get(char** pvalue){ _error 2_("An OptionLogical object cannot return a string");};45 void Get(char*** ppvalue,int *pnumel){ _error 2_("An OptionLogical object cannot return a string vec");};46 void Get(IssmDouble** pvalue,int *pnumel){ _error 2_("An OptionLogical object cannot return a IssmDouble vec");};47 void Get(Options** pvalue){ _error 2_("An OptionLogical object cannot return an Options DataSet");};48 void Get(Options*** ppvalue,int *pnumel){ _error 2_("An OptionLogical object cannot return an Options DataSet vec");};44 void Get(char** pvalue){ _error_("An OptionLogical object cannot return a string");}; 45 void Get(char*** ppvalue,int *pnumel){ _error_("An OptionLogical object cannot return a string vec");}; 46 void Get(IssmDouble** pvalue,int *pnumel){ _error_("An OptionLogical object cannot return a IssmDouble vec");}; 47 void Get(Options** pvalue){ _error_("An OptionLogical object cannot return an Options DataSet");}; 48 void Get(Options*** ppvalue,int *pnumel){ _error_("An OptionLogical object cannot return an Options DataSet vec");}; 49 49 50 50 }; -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Options/OptionStruct.cpp
r12832 r13101 132 132 /*We should first check that the size is one*/ 133 133 if(this->NumEl()!=1){ 134 _error 2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single options dataset");134 _error_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single options dataset"); 135 135 } 136 136 … … 144 144 /*We should first check that the size is at least one*/ 145 145 if(this->NumEl()<=0){ 146 _error 2_("option \"" << this->name << "\" is empty and cannot return an options dataset vector");146 _error_("option \"" << this->name << "\" is empty and cannot return an options dataset vector"); 147 147 } 148 148 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Options/OptionStruct.h
r12832 r13101 28 28 void DeepEcho(); 29 29 void DeepEcho(char* indent); 30 int Id(){_error 2_("Not implemented yet");};31 int MyRank(){_error 2_("Not implemented yet");};30 int Id(){_error_("Not implemented yet");}; 31 int MyRank(){_error_("Not implemented yet");}; 32 32 int ObjectEnum(){return OptionStructEnum;}; 33 Object* copy(){_error 2_("Not implemented yet");};33 Object* copy(){_error_("Not implemented yet");}; 34 34 /*}}}*/ 35 35 … … 39 39 int NDims(); 40 40 int* Size(); 41 void Get(int* pvalue){_error 2_("An OptionStruct object cannot return a int");};42 void Get(IssmDouble* pvalue){_error 2_("An OptionStruct object cannot return a IssmDouble");};43 void Get(bool* pvalue){ _error 2_("An OptionStruct object cannot return a bool");};44 void Get(char** pvalue){ _error 2_("An OptionStruct object cannot return a string");};45 void Get(char*** ppvalue,int *pnumel){ _error 2_("An OptionStruct object cannot return a string vec");};46 void Get(IssmDouble** pvalue,int *pnumel){ _error 2_("An OptionStruct object cannot return a IssmDouble vec");};41 void Get(int* pvalue){_error_("An OptionStruct object cannot return a int");}; 42 void Get(IssmDouble* pvalue){_error_("An OptionStruct object cannot return a IssmDouble");}; 43 void Get(bool* pvalue){ _error_("An OptionStruct object cannot return a bool");}; 44 void Get(char** pvalue){ _error_("An OptionStruct object cannot return a string");}; 45 void Get(char*** ppvalue,int *pnumel){ _error_("An OptionStruct object cannot return a string vec");}; 46 void Get(IssmDouble** pvalue,int *pnumel){ _error_("An OptionStruct object cannot return a IssmDouble vec");}; 47 47 void Get(Options** pvalue); 48 48 void Get(Options*** ppvalue,int *pnumel); -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Options/OptionUtilities.cpp
r12832 r13101 27 27 /*check for index too large */ 28 28 for (i=0;i<ndims;i++) aprod*=size[i]; 29 if (index >= aprod) _error 2_("Index " << index << " exceeds number of elements " << aprod << ".");29 if (index >= aprod) _error_("Index " << index << " exceeds number of elements " << aprod << "."); 30 30 31 31 /*calculate the dimensions (being careful of integer division) */ … … 46 46 /*check for any dimension too large */ 47 47 for (i=0;i<ndims;i++){ 48 if (dims[i] >= size[i]) _error 2_("Dimension " << i << " of " << dims[i] << " exceeds size of " << size[i] << ".");48 if (dims[i] >= size[i]) _error_("Dimension " << i << " of " << dims[i] << " exceeds size of " << size[i] << "."); 49 49 } 50 50 … … 65 65 /*check for index too large */ 66 66 for (i=0; i<ndims; i++) aprod*=size[i]; 67 if (index >= aprod) _error 2_("Index " << index << " exceeds number of elements " << aprod << ".");67 if (index >= aprod) _error_("Index " << index << " exceeds number of elements " << aprod << "."); 68 68 69 69 /*calculate the dimensions (being careful of integer division) */ … … 84 84 /*check for any dimension too large */ 85 85 for (i=0; i<ndims; i++){ 86 if (dims[i] >= size[i]) _error 2_("Dimension " << i << " of " << dims[i] << " exceeds size of " << size[i] << ".");86 if (dims[i] >= size[i]) _error_("Dimension " << i << " of " << dims[i] << " exceeds size of " << size[i] << "."); 87 87 } 88 88 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Params/BoolParam.h
r12832 r13101 43 43 int InstanceEnum(){return enum_type;} 44 44 void GetParameterValue(bool* pbool){*pbool=value;} 45 void GetParameterValue(int* pinteger){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot return an integer");}46 void GetParameterValue(int** pintarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot return an array of integers");}47 void GetParameterValue(int** pintarray,int* pM,int* pN){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot return an array of integers");}48 void GetParameterValue(IssmDouble* pIssmDouble){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble");}49 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}50 void GetParameterValue(char** pstring){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot return a string");}51 void GetParameterValue(char*** pstringarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot return a string array");}52 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble array");}54 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot return a matrix array");}55 void GetParameterValue(Vector** pvec){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot return a Vec");}56 void GetParameterValue(Matrix** pmat){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot return a Mat");}57 void GetParameterValue(FILE** pfid){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot return a FILE");}45 void GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return an integer");} 46 void GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return an array of integers");} 47 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return an array of integers");} 48 void GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble");} 49 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");} 50 void GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a string");} 51 void GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a string array");} 52 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble array");} 53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a IssmDouble array");} 54 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a matrix array");} 55 void GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a Vec");} 56 void GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a Mat");} 57 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << ") cannot return a FILE");} 58 58 59 59 void SetValue(bool boolean){this->value=boolean;} 60 void SetValue(int integer){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot hold an int");}61 void SetValue(IssmDouble scalar){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot hold an IssmPDouble");}62 void SetValue(char* string){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a string");}63 void SetValue(char** stringarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a string array");}64 void SetValue(IssmDouble* IssmDoublearray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}65 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}66 void SetValue(int* intarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a int array");}67 void SetValue(int* pintarray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a int array");}68 void SetValue(Vector* vec){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a Vec");}69 void SetValue(Matrix* mat){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a Mat");}70 void SetValue(FILE* fid){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot hold a FILE");}71 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error 2_("Param "<< EnumToStringx(enum_type) << ") cannot hold an array of matrices");}60 void SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold an int");} 61 void SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold an IssmPDouble");} 62 void SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a string");} 63 void SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a string array");} 64 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");} 65 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");} 66 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a int array");} 67 void SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a int array");} 68 void SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a Vec");} 69 void SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a Mat");} 70 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold a FILE");} 71 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << ") cannot hold an array of matrices");} 72 72 void UnitConversion(int direction_enum); 73 73 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Params/DoubleMatArrayParam.h
r12832 r13101 45 45 /*Param vritual function definitions: {{{*/ 46 46 int InstanceEnum(){return enum_type;} 47 void GetParameterValue(bool* pbool){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot return a bool");}48 void GetParameterValue(int* pinteger){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot return an integer");}49 void GetParameterValue(int** pintarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot return an array of integers");}50 void GetParameterValue(int** pintarray,int* pM,int* pN){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot return an array of integers");}51 void GetParameterValue(IssmDouble* pIssmDouble){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble");}52 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}53 void GetParameterValue(char** pstring){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot return a string");}54 void GetParameterValue(char*** pstringarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot return a string array");}55 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble array");}56 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble array");}47 void GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a bool");} 48 void GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << "cannot return an integer");} 49 void GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << "cannot return an array of integers");} 50 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << "cannot return an array of integers");} 51 void GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble");} 52 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");} 53 void GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a string");} 54 void GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a string array");} 55 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble array");} 56 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble array");} 57 57 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims); 58 void GetParameterValue(Vector** pvec){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot return a Vec");}59 void GetParameterValue(Matrix** pmat){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot return a Mat");}60 void GetParameterValue(FILE** pfid){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot return a FILE");}58 void GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a Vec");} 59 void GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a Mat");} 60 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a FILE");} 61 61 62 void SetValue(bool boolean){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot hold a boolean");}63 void SetValue(int integer){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot hold an integer");}64 void SetValue(IssmDouble scalar){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot hold a scalar");}65 void SetValue(char* string){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot hold a string");}66 void SetValue(char** stringarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot hold a string array");}67 void SetValue(IssmDouble* IssmDoublearray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot hold a IssmDouble vec array");}68 void SetValue(IssmDouble* IssmDoublearray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot hold a IssmDouble mat array");}69 void SetValue(int* intarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot hold a int vec array");}70 void SetValue(int* intarray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot hold a int mat array");}71 void SetValue(Vector* vec){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot hold a Vec");}72 void SetValue(Matrix* mat){_error 2_("Param "<< EnumToStringx(enum_type) << "cannot hold a Mat");}73 void SetValue(FILE* fid){_error 2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}62 void SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a boolean");} 63 void SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold an integer");} 64 void SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a scalar");} 65 void SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a string");} 66 void SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a string array");} 67 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a IssmDouble vec array");} 68 void SetValue(IssmDouble* IssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a IssmDouble mat array");} 69 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a int vec array");} 70 void SetValue(int* intarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a int mat array");} 71 void SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a Vec");} 72 void SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a Mat");} 73 void SetValue(FILE* fid){_error_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");} 74 74 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array); 75 75 void UnitConversion(int direction_enum); -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Params/DoubleMatParam.cpp
r12832 r13101 109 109 /*FUNCTION DoubleMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){{{*/ 110 110 void DoubleMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){ 111 _error 2_("DoubleMat of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of int");111 _error_("DoubleMat of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of int"); 112 112 } 113 113 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Params/DoubleMatParam.h
r12832 r13101 44 44 /*Param vritual function definitions: {{{*/ 45 45 int InstanceEnum(){return enum_type;} 46 void GetParameterValue(bool* pbool){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}47 void GetParameterValue(int* pinteger){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}48 void GetParameterValue(int** pintarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}46 void GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");} 47 void GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");} 48 void GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");} 49 49 void GetParameterValue(int** pintarray,int* pM,int* pN); 50 void GetParameterValue(IssmDouble* pIssmDouble){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}51 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}52 void GetParameterValue(char** pstring){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}53 void GetParameterValue(char*** pstringarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}50 void GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");} 51 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");} 52 void GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");} 53 void GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");} 54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 55 55 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN); 56 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}57 void GetParameterValue(Vector** pvec){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}58 void GetParameterValue(Matrix** pmat){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}59 void GetParameterValue(FILE** pfid){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}56 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");} 57 void GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");} 58 void GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");} 59 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");} 60 60 61 void SetValue(bool boolean){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}62 void SetValue(int integer){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}63 void SetValue(IssmDouble scalar){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}64 void SetValue(char* string){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}65 void SetValue(char** stringarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}66 void SetValue(IssmDouble* IssmDoublearray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}61 void SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");} 62 void SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");} 63 void SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");} 64 void SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");} 65 void SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");} 66 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");} 67 67 void SetValue(IssmDouble* IssmDoublearray,int M,int N); 68 void SetValue(int* intarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");}69 void SetValue(int* intarray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");};70 void SetValue(Vector* vec){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}71 void SetValue(Matrix* mat){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}72 void SetValue(FILE* fid){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}73 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}68 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");} 69 void SetValue(int* intarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");}; 70 void SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");} 71 void SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");} 72 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 73 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 74 74 void UnitConversion(int direction_enum); 75 75 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Params/DoubleParam.cpp
r12832 r13101 82 82 /*FUNCTION DoubleParam::GetParameterValue(int* pinteger){{{*/ 83 83 void DoubleParam::GetParameterValue(int* pinteger){ 84 _error 2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");84 _error_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer"); 85 85 } 86 86 /*}}}*/ 87 87 /*FUNCTION DoubleParam::GetParameterValue(bool* pbool){{{*/ 88 88 void DoubleParam::GetParameterValue(bool* pbool){ 89 _error 2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an bool");89 _error_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an bool"); 90 90 } 91 91 /*}}}*/ 92 92 /*FUNCTION DoubleParam::GetParameterValue(int** pintarray,int* pM){{{*/ 93 93 void DoubleParam::GetParameterValue(int** pintarray,int* pM){ 94 _error 2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");94 _error_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers"); 95 95 } 96 96 /*}}}*/ 97 97 /*FUNCTION DoubleParam::GetParameterValue(int** pintarray,int* pM,int* pN){{{*/ 98 98 void DoubleParam::GetParameterValue(int** pintarray,int* pM,int* pN){ 99 _error 2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");99 _error_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers"); 100 100 } 101 101 /*}}}*/ 102 102 /*FUNCTION DoubleParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){{{*/ 103 103 void DoubleParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){ 104 _error 2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of IssmDouble");104 _error_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of IssmDouble"); 105 105 } 106 106 /*}}}*/ 107 107 /*FUNCTION DoubleParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){{{*/ 108 108 void DoubleParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){ 109 _error 2_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of IssmDouble");109 _error_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of IssmDouble"); 110 110 } 111 111 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Params/DoubleParam.h
r12832 r13101 48 48 void GetParameterValue(int** pintarray,int* pM,int* pN); 49 49 void GetParameterValue(IssmDouble* pIssmDouble){*pIssmDouble=value;} 50 void GetParameterValue(char** pstring){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}51 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}52 void GetParameterValue(char*** pstringarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}50 void GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");} 51 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");} 52 void GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");} 53 53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM); 54 54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN); 55 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}56 void GetParameterValue(Vector** pvec){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}57 void GetParameterValue(Matrix** pmat){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}58 void GetParameterValue(FILE** pfid){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}55 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");} 56 void GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");} 57 void GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");} 58 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");} 59 59 60 60 void SetValue(bool boolean){this->value=(IssmDouble)boolean;} 61 61 void SetValue(int integer){this->value=(IssmDouble)integer;} 62 62 void SetValue(IssmDouble scalar){this->value=(IssmDouble)scalar;} 63 void SetValue(char* string){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}64 void SetValue(char** stringarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}65 void SetValue(IssmDouble* IssmDoublearray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}66 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}67 void SetValue(int* intarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}68 void SetValue(int* pintarray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}69 void SetValue(Vector* vec){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}70 void SetValue(Matrix* mat){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}71 void SetValue(FILE* fid){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}72 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}63 void SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");} 64 void SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");} 65 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");} 66 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");} 67 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");} 68 void SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");} 69 void SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");} 70 void SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");} 71 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 72 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 73 73 void UnitConversion(int direction_enum); 74 74 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Params/DoubleVecParam.cpp
r12832 r13101 124 124 /*FUNCTION DoubleVecParam::GetParameterValue(int** pintarray,int* pM){{{*/ 125 125 void DoubleVecParam::GetParameterValue(int** pintarray,int* pM){ 126 _error 2_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of int");126 _error_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of int"); 127 127 } 128 128 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Params/DoubleVecParam.h
r12832 r13101 43 43 /*Param virtual functions definitions: {{{*/ 44 44 int InstanceEnum(){return enum_type;} 45 void GetParameterValue(bool* pbool){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}46 void GetParameterValue(int* pinteger){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}45 void GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");} 46 void GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");} 47 47 void GetParameterValue(int** pintarray,int* pM); 48 void GetParameterValue(int** pintarray,int* pM,int* pN){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");};49 void GetParameterValue(IssmDouble* pIssmDouble){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}50 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}51 void GetParameterValue(char** pstring){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}52 void GetParameterValue(char*** pstringarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}48 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}; 49 void GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");} 50 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");} 51 void GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");} 52 void GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");} 53 53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM); 54 54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN); 55 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}56 void GetParameterValue(Vector** pvec){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}57 void GetParameterValue(Matrix** pmat){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}58 void GetParameterValue(FILE** pfid){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}55 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");} 56 void GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");} 57 void GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");} 58 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");} 59 59 60 void SetValue(bool boolean){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}61 void SetValue(int integer){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}62 void SetValue(IssmDouble scalar){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}63 void SetValue(char* string){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}64 void SetValue(char** stringarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}60 void SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");} 61 void SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");} 62 void SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");} 63 void SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");} 64 void SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");} 65 65 void SetValue(IssmDouble* IssmDoublearray,int M); 66 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");}67 void SetValue(int* intarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");};68 void SetValue(int* pintarray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");}69 void SetValue(Vector* vec){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}70 void SetValue(Matrix* mat){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}71 void SetValue(FILE* fid){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}72 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}66 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");} 67 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");}; 68 void SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");} 69 void SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");} 70 void SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");} 71 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 72 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 73 73 void UnitConversion(int direction_enum); 74 74 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Params/FileParam.h
r12832 r13101 42 42 /*Param vritual function definitions: {{{*/ 43 43 int InstanceEnum(){return enum_type;} 44 void GetParameterValue(bool* pbool){ _error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}45 void GetParameterValue(int* pinteger){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}46 void GetParameterValue(int** pintarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}47 void GetParameterValue(int** pintarray,int* pM,int* pN){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}48 void GetParameterValue(IssmDouble* pIssmDouble){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}49 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}50 void GetParameterValue(char** pstring){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}51 void GetParameterValue(char*** pstringarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}52 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}54 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error 2_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}55 void GetParameterValue(Vector** pvec){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}56 void GetParameterValue(Matrix** pmat){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}44 void GetParameterValue(bool* pbool){ _error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");} 45 void GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");} 46 void GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");} 47 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");} 48 void GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");} 49 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");} 50 void GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");} 51 void GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");} 52 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 54 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");} 55 void GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");} 56 void GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");} 57 57 void GetParameterValue(FILE** pfid){*pfid=value;}; 58 58 59 void SetValue(bool boolean){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}60 void SetValue(int integer){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}61 void SetValue(IssmDouble scalar){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}62 void SetValue(char* string){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}63 void SetValue(char** stringarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}64 void SetValue(IssmDouble* IssmDoublearray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}65 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}66 void SetValue(int* intarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}67 void SetValue(int* pintarray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}68 void SetValue(Vector* vec){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}69 void SetValue(Matrix* mat){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}70 void SetValue(FILE* fid){_error 2_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}71 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error 2_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");}59 void SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");} 60 void SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");} 61 void SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");} 62 void SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");} 63 void SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");} 64 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");} 65 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");} 66 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");} 67 void SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");} 68 void SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");} 69 void SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");} 70 void SetValue(FILE* fid){_error_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");} 71 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");} 72 72 void UnitConversion(int direction_enum); 73 73 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Params/IntMatParam.h
r12832 r13101 44 44 /*Param vritual function definitions: {{{*/ 45 45 int InstanceEnum(){return enum_type;} 46 void GetParameterValue(bool* pbool){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}47 void GetParameterValue(int* pinteger){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}48 void GetParameterValue(int** pintarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}46 void GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");} 47 void GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");} 48 void GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");} 49 49 void GetParameterValue(int** pintarray,int* pM,int* pN); 50 void GetParameterValue(IssmDouble* pIssmDouble){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}51 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}52 void GetParameterValue(char** pstring){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}53 void GetParameterValue(char*** pstringarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}55 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");};56 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}57 void GetParameterValue(Vector** pvec){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}58 void GetParameterValue(Matrix** pmat){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}59 void GetParameterValue(FILE** pfid){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}50 void GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");} 51 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");} 52 void GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");} 53 void GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");} 54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 55 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}; 56 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");} 57 void GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");} 58 void GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");} 59 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");} 60 60 61 void SetValue(bool boolean){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}62 void SetValue(int integer){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}63 void SetValue(IssmDouble scalar){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}64 void SetValue(char* string){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}65 void SetValue(char** stringarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}66 void SetValue(IssmDouble* IssmDoublearray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}67 void SetValue(IssmDouble* IssmDoublearray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");};68 void SetValue(int* intarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");};61 void SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");} 62 void SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");} 63 void SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");} 64 void SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");} 65 void SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");} 66 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");} 67 void SetValue(IssmDouble* IssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}; 68 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");}; 69 69 void SetValue(int* intarray,int M,int N); 70 void SetValue(Vector* vec){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}71 void SetValue(Matrix* mat){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}72 void SetValue(FILE* fid){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}73 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}70 void SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");} 71 void SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");} 72 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 73 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 74 74 void UnitConversion(int direction_enum); 75 75 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Params/IntParam.h
r12832 r13101 43 43 /*Param vritual function definitions: {{{*/ 44 44 int InstanceEnum(){return enum_type;} 45 void GetParameterValue(bool* pbool){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}45 void GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");} 46 46 void GetParameterValue(int* pinteger){*pinteger=value;} 47 void GetParameterValue(int** pintarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}48 void GetParameterValue(int** pintarray,int* pM,int* pN){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}49 void GetParameterValue(IssmDouble* pIssmDouble){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}50 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}51 void GetParameterValue(char** pstring){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}52 void GetParameterValue(char*** pstringarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}55 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}56 void GetParameterValue(Vector** pvec){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}57 void GetParameterValue(Matrix** pmat){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}58 void GetParameterValue(FILE** pfid){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}47 void GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");} 48 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");} 49 void GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");} 50 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");} 51 void GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");} 52 void GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");} 53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 55 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");} 56 void GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");} 57 void GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");} 58 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");} 59 59 60 void SetValue(bool boolean){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a bool");}60 void SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a bool");} 61 61 void SetValue(int integer){this->value=integer;} 62 void SetValue(int* intarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold an int array");}63 void SetValue(int* intarray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold an int array");}64 void SetValue(IssmDouble scalar){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold an IssmDouble");}65 void SetValue(char* string){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}66 void SetValue(char** stringarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}67 void SetValue(IssmDouble* IssmDoublearray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}68 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}69 void SetValue(Vector* vec){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}70 void SetValue(Matrix* mat){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}71 void SetValue(FILE* fid){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}72 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}62 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an int array");} 63 void SetValue(int* intarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an int array");} 64 void SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an IssmDouble");} 65 void SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");} 66 void SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");} 67 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");} 68 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");} 69 void SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");} 70 void SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");} 71 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 72 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 73 73 void UnitConversion(int direction_enum); 74 74 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Params/IntVecParam.h
r12832 r13101 44 44 /*Param virtual functions definitions: {{{*/ 45 45 int InstanceEnum(){return enum_type;} 46 void GetParameterValue(bool* pbool){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}47 void GetParameterValue(int* pinteger){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}46 void GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");} 47 void GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");} 48 48 void GetParameterValue(int** pintarray,int* pM); 49 void GetParameterValue(int** pintarray,int* pM,int* pN){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix");}50 void GetParameterValue(IssmDouble* pIssmDouble){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}51 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}52 void GetParameterValue(char** pstring){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}53 void GetParameterValue(char*** pstringarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array (maybe in serial?)");}55 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}56 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}57 void GetParameterValue(Vector** pvec){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}58 void GetParameterValue(Matrix** pmat){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}59 void GetParameterValue(FILE** pfid){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}49 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix");} 50 void GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");} 51 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");} 52 void GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");} 53 void GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");} 54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array (maybe in serial?)");} 55 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 56 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");} 57 void GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");} 58 void GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");} 59 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");} 60 60 61 void SetValue(bool boolean){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}62 void SetValue(int integer){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}63 void SetValue(IssmDouble scalar){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}64 void SetValue(char* string){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}65 void SetValue(char** stringarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}66 void SetValue(IssmDouble* IssmDoublearray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");}67 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");}61 void SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");} 62 void SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");} 63 void SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");} 64 void SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");} 65 void SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");} 66 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");} 67 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble mat array");} 68 68 void SetValue(int* intarray,int M); 69 void SetValue(int* pintarray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");}70 void SetValue(Vector* vec){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}71 void SetValue(Matrix* mat){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}72 void SetValue(FILE* fid){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}73 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}69 void SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");} 70 void SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");} 71 void SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");} 72 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 73 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 74 74 void UnitConversion(int direction_enum); 75 75 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Params/MatrixParam.h
r12832 r13101 43 43 /*Param vritual function definitions: {{{*/ 44 44 int InstanceEnum(){return enum_type;} 45 void GetParameterValue(bool* pbool){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}46 void GetParameterValue(int* pinteger){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}47 void GetParameterValue(int** pintarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}48 void GetParameterValue(int** pintarray,int* pM,int* pN){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}49 void GetParameterValue(IssmDouble* pIssmDouble){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}50 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}51 void GetParameterValue(char** pstring){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}52 void GetParameterValue(char*** pstringarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}55 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}56 void GetParameterValue(Vector** pvec){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a vec");}45 void GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");} 46 void GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");} 47 void GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");} 48 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");} 49 void GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");} 50 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");} 51 void GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");} 52 void GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");} 53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 55 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");} 56 void GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a vec");} 57 57 void GetParameterValue(Matrix** poutput); 58 void GetParameterValue(FILE** pfid){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}58 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");} 59 59 60 void SetValue(bool boolean){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}61 void SetValue(int integer){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}62 void SetValue(IssmDouble scalar){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}63 void SetValue(char* string){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}64 void SetValue(char** stringarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}65 void SetValue(IssmDouble* IssmDoublearray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}66 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}67 void SetValue(int* intarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}68 void SetValue(int* pintarray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}69 void SetValue(Vector* vec){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}60 void SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");} 61 void SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");} 62 void SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");} 63 void SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");} 64 void SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");} 65 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");} 66 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");} 67 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");} 68 void SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");} 69 void SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");} 70 70 void SetValue(Matrix* mat); 71 void SetValue(FILE* fid){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}72 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}71 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 72 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 73 73 void UnitConversion(int direction_enum); 74 74 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Params/StringArrayParam.h
r12832 r13101 45 45 /*Param vritual function definitions: {{{*/ 46 46 int InstanceEnum(){return enum_type;} 47 void GetParameterValue(bool* pbool){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}48 void GetParameterValue(int* pinteger){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}49 void GetParameterValue(int** pintarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}50 void GetParameterValue(int** pintarray,int* pM,int* pN){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}51 void GetParameterValue(IssmDouble* pIssmDouble){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}52 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}53 void GetParameterValue(char** pstring){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}47 void GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");} 48 void GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");} 49 void GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");} 50 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");} 51 void GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");} 52 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");} 53 void GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");} 54 54 void GetParameterValue(char*** pstringarray,int* pM); 55 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}56 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}57 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error 2_("Vec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}58 void GetParameterValue(Vector** pvec){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}59 void GetParameterValue(Matrix** pmat){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}60 void GetParameterValue(FILE** pfid){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}55 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 56 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 57 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Vec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");} 58 void GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");} 59 void GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");} 60 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");} 61 61 62 void SetValue(bool boolean){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}63 void SetValue(int integer){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}64 void SetValue(IssmDouble scalar){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}65 void SetValue(char* string){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}62 void SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");} 63 void SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");} 64 void SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");} 65 void SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");} 66 66 void SetValue(char** stringarray,int M); 67 void SetValue(IssmDouble* IssmDoublearray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}68 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}69 void SetValue(int* intarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}70 void SetValue(int* pintarray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}71 void SetValue(Vector* vec){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}72 void SetValue(Matrix* mat){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}73 void SetValue(FILE* fid){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}74 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}67 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");} 68 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");} 69 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");} 70 void SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");} 71 void SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");} 72 void SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");} 73 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 74 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 75 75 void UnitConversion(int direction_enum); 76 76 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Params/StringParam.h
r12832 r13101 43 43 /*Param vritual function definitions: {{{*/ 44 44 int InstanceEnum(){return enum_type;} 45 void GetParameterValue(bool* pbool){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}46 void GetParameterValue(int* pinteger){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}47 void GetParameterValue(int** pintarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}48 void GetParameterValue(int** pintarray,int* pM,int* pN){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}49 void GetParameterValue(IssmDouble* pIssmDouble){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}50 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}45 void GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");} 46 void GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");} 47 void GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");} 48 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");} 49 void GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");} 50 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");} 51 51 void GetParameterValue(char** pstring); 52 void GetParameterValue(char*** pstringarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}55 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}56 void GetParameterValue(Vector** pvec){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}57 void GetParameterValue(Matrix** pmat){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}58 void GetParameterValue(FILE** pfid){_error 2_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}52 void GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");} 53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 55 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");} 56 void GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");} 57 void GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");} 58 void GetParameterValue(FILE** pfid){_error_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");} 59 59 60 void SetValue(bool boolean){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}61 void SetValue(int integer){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}62 void SetValue(IssmDouble scalar){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}60 void SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");} 61 void SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");} 62 void SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");} 63 63 void SetValue(char* string); 64 void SetValue(char** stringarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}65 void SetValue(IssmDouble* IssmDoublearray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}66 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}67 void SetValue(int* intarray,int M){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}68 void SetValue(int* pintarray,int M,int N){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}69 void SetValue(Vector* vec){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}70 void SetValue(Matrix* mat){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}71 void SetValue(FILE* fid){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}72 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}64 void SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");} 65 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");} 66 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");} 67 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");} 68 void SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");} 69 void SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");} 70 void SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");} 71 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 72 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 73 73 void UnitConversion(int direction_enum); 74 74 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Params/TransientParam.cpp
r12832 r13101 99 99 void TransientParam::GetParameterValue(IssmDouble* pdouble,IssmDouble time){ 100 100 101 double output;101 IssmDouble output; 102 102 bool found; 103 103 … … 136 136 } 137 137 } 138 if(!found)_error 2_("did not find time interval on which to interpolate values");138 if(!found)_error_("did not find time interval on which to interpolate values"); 139 139 *pdouble=output; 140 140 } -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Params/TransientParam.h
r12832 r13101 44 44 /*Param vritual function definitions: {{{*/ 45 45 int InstanceEnum(){return enum_type;} 46 void GetParameterValue(bool* pbool){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a bool");}47 void GetParameterValue(int* pinteger){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot return an integer");}48 void GetParameterValue(int** pintarray,int* pM){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot return an array of integers");}49 void GetParameterValue(int** pintarray,int* pM,int* pN){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a array of integers");}50 void GetParameterValue(IssmDouble* pIssmDouble){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble");}46 void GetParameterValue(bool* pbool){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a bool");} 47 void GetParameterValue(int* pinteger){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return an integer");} 48 void GetParameterValue(int** pintarray,int* pM){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return an array of integers");} 49 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a array of integers");} 50 void GetParameterValue(IssmDouble* pIssmDouble){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble");} 51 51 void GetParameterValue(IssmDouble* pdouble,IssmDouble time); 52 void GetParameterValue(char** pstring){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a string");}53 void GetParameterValue(char*** pstringarray,int* pM){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a string array");}54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble array");}55 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble array");}56 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a matrix array");}57 void GetParameterValue(Vector** pvec){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Vec");}58 void GetParameterValue(Matrix** pmat){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Mat");}59 void GetParameterValue(FILE** pfid){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot return a FILE");}52 void GetParameterValue(char** pstring){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a string");} 53 void GetParameterValue(char*** pstringarray,int* pM){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a string array");} 54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 55 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 56 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a matrix array");} 57 void GetParameterValue(Vector** pvec){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Vec");} 58 void GetParameterValue(Matrix** pmat){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Mat");} 59 void GetParameterValue(FILE** pfid){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a FILE");} 60 60 61 void SetValue(bool boolean){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a boolean");}62 void SetValue(int integer){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold an integer");}63 void SetValue(IssmDouble scalar){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a scalar");}64 void SetValue(char* string){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a string");}65 void SetValue(char** stringarray,int M){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a string array");}66 void SetValue(IssmDouble* IssmDoublearray,int M){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}67 void SetValue(IssmDouble* IssmDoublearray,int M,int N){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}68 void SetValue(int* intarray,int M){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int vec array");}69 void SetValue(int* intarray,int M,int N){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int mat array");};70 void SetValue(Vector* vec){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Vec");}71 void SetValue(Matrix* mat){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Mat");}72 void SetValue(FILE* fid){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a FILE");}73 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error 2_("Parameter " <<EnumToStringx(enum_type) << " cannot hold an array of matrices");}61 void SetValue(bool boolean){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a boolean");} 62 void SetValue(int integer){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold an integer");} 63 void SetValue(IssmDouble scalar){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a scalar");} 64 void SetValue(char* string){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a string");} 65 void SetValue(char** stringarray,int M){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a string array");} 66 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");} 67 void SetValue(IssmDouble* IssmDoublearray,int M,int N){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a IssmDouble array");} 68 void SetValue(int* intarray,int M){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int vec array");} 69 void SetValue(int* intarray,int M,int N){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int mat array");}; 70 void SetValue(Vector* vec){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Vec");} 71 void SetValue(Matrix* mat){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Mat");} 72 void SetValue(FILE* fid){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a FILE");} 73 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold an array of matrices");} 74 74 void UnitConversion(int direction_enum); 75 75 -
issm/branches/trunk-jpl-damage/src/c/classes/objects/Params/VectorParam.h
r12832 r13101 43 43 /*Param vritual function definitions: {{{*/ 44 44 int InstanceEnum(){return enum_type;} 45 void GetParameterValue(bool* pbool){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}46 void GetParameterValue(int* pinteger){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}47 void GetParameterValue(int** pintarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}48 void GetParameterValue(int** pintarray,int* pM,int* pN){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}49 void GetParameterValue(IssmDouble* pIssmDouble){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}50 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}51 void GetParameterValue(char** pstring){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}52 void GetParameterValue(char*** pstringarray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}55 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}56 void GetParameterValue(Matrix** pmat){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}45 void GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");} 46 void GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");} 47 void GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");} 48 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");} 49 void GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");} 50 void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");} 51 void GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");} 52 void GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");} 53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 55 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");} 56 void GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");} 57 57 void GetParameterValue(Vector** poutput); 58 void GetParameterValue(FILE** pfid){_error 2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}58 void GetParameterValue(FILE** pfid){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");} 59 59 60 void SetValue(bool boolean){_error 2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a boolean");}61 void SetValue(int integer){_error 2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an integer");}62 void SetValue(IssmDouble scalar){_error 2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a scalar");}63 void SetValue(char* string){_error 2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string");}64 void SetValue(char** stringarray,int M){_error 2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string array");}65 void SetValue(IssmDouble* IssmDoublearray,int M){_error 2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}66 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error 2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");}67 void SetValue(int* intarray,int M){_error 2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}68 void SetValue(int* pintarray,int M,int N){_error 2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}60 void SetValue(bool boolean){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a boolean");} 61 void SetValue(int integer){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an integer");} 62 void SetValue(IssmDouble scalar){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a scalar");} 63 void SetValue(char* string){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string");} 64 void SetValue(char** stringarray,int M){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a string array");} 65 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");} 66 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a IssmDouble array");} 67 void SetValue(int* intarray,int M){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");} 68 void SetValue(int* pintarray,int M,int N){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");} 69 69 void SetValue(Vector* vec); 70 void SetValue(Matrix* mat){_error 2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}71 void SetValue(FILE* fid){_error 2_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}72 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error 2_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}70 void SetValue(Matrix* mat){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");} 71 void SetValue(FILE* fid){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");} 72 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 73 73 void UnitConversion(int direction_enum); 74 74 -
issm/branches/trunk-jpl-damage/src/c/include/macros.h
r12878 r13101 23 23 #define _printf_(flag,...) do{if(flag) PrintfFunction(__VA_ARGS__);}while(0) 24 24 /*}}}*/ 25 /* _error_ {{{*/26 /*Error exception macro*/27 #ifdef _INTEL_WIN_28 #define _error_(...)\29 throw ErrorException(exprintf(__VA_ARGS__))30 #else31 #define _error_(...)\32 throw ErrorException(__FILE__,__func__,__LINE__,exprintf(__VA_ARGS__))33 #endif34 /*}}}*/35 25 /* _error2_ {{{*/ 36 26 /*new Error exception macro*/ 37 27 #ifdef _INTEL_WIN_ 38 #define _error 2_(StreamArgs)\28 #define _error_(StreamArgs)\ 39 29 do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \ 40 30 aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \ 41 31 throw ErrorException(aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0) 42 32 #else 43 #define _error 2_(StreamArgs)\33 #define _error_(StreamArgs)\ 44 34 do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \ 45 35 aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \ … … 75 65 #ifdef _ISSM_DEBUG_ 76 66 #define _assert_(statement)\ 77 if (!(statement)) _error_("Assertion \" %s\" failed, please report bug to %s",#statement,PACKAGE_BUGREPORT)67 if (!(statement)) _error_("Assertion \""<<#statement<<"\" failed, please report bug to "<<PACKAGE_BUGREPORT) 78 68 #else 79 69 #define _assert_(ignore)\ -
issm/branches/trunk-jpl-damage/src/c/io/Disk/pfclose.cpp
r12878 r13101 18 18 extern int my_rank; 19 19 _assert_(fid); 20 if(fclose(fid)!=0)_error 2_("could not close file " << filename);20 if(fclose(fid)!=0)_error_("could not close file " << filename); 21 21 } -
issm/branches/trunk-jpl-damage/src/c/io/Disk/pfopen.cpp
r12878 r13101 20 20 /*Open handle to data on disk: */ 21 21 fid=fopen(filename,format); 22 if(fid==NULL) _error 2_("could not open file " << filename << " for binary reading or writing");22 if(fid==NULL) _error_("could not open file " << filename << " for binary reading or writing"); 23 23 24 24 return fid; -
issm/branches/trunk-jpl-damage/src/c/matlab/io/CheckNumMatlabArguments.cpp
r12878 r13101 22 22 /* special case: */ 23 23 function(); 24 _error 2_("usage: see above");24 _error_("usage: see above"); 25 25 } 26 26 else if (nlhs!=NLHS || nrhs!=NRHS ) { 27 27 function(); 28 _error 2_("usage error.");28 _error_("usage error."); 29 29 } 30 30 return 1; -
issm/branches/trunk-jpl-damage/src/c/matlab/io/FetchMatlabData.cpp
r12878 r13101 48 48 else{ 49 49 /*This is an error: we don't have the correct input!: */ 50 _error 2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");50 _error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet"); 51 51 } 52 52 … … 89 89 else{ 90 90 /*This is an error: we don't have the correct input!: */ 91 _error 2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");91 _error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet"); 92 92 } 93 93 … … 134 134 else{ 135 135 /*This is an error: we don't have the correct input!: */ 136 _error 2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");136 _error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet"); 137 137 } 138 138 … … 176 176 else{ 177 177 /*This is an error: we don't have the correct input!: */ 178 _error 2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");178 _error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet"); 179 179 } 180 180 … … 238 238 else{ 239 239 /*This is an error: we don't have the correct input!: */ 240 _error 2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");240 _error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet"); 241 241 } 242 242 … … 269 269 else{ 270 270 /*This is an error: we don't have the correct input!: */ 271 _error 2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");271 _error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet"); 272 272 } 273 273 … … 301 301 else{ 302 302 /*This is an error: we don't have the correct input!: */ 303 _error 2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");303 _error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet"); 304 304 } 305 305 … … 333 333 else{ 334 334 /*This is an error: we don't have the correct input!: */ 335 _error 2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");335 _error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet"); 336 336 } 337 337 … … 365 365 else{ 366 366 /*This is an error: we don't have the correct input!: */ 367 _error 2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");367 _error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet"); 368 368 } 369 369 … … 381 381 /*Ok, the string should be coming directly from the matlab workspace: */ 382 382 if (!mxIsClass(dataref,"char")){ 383 _error 2_("input data_type is not a string!");383 _error_("input data_type is not a string!"); 384 384 } 385 385 else{ … … 416 416 else{ 417 417 /*This is an error: we don't have the correct input!: */ 418 _error 2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");418 _error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet"); 419 419 } 420 420 … … 434 434 435 435 if (!mxIsClass(dataref,"double")){ 436 _error 2_("input data_type is not a double!");436 _error_("input data_type is not a double!"); 437 437 } 438 438 else{ … … 451 451 452 452 if (!mxIsClass(dataref,"double")){ 453 _error 2_("input data_type is not a scalar!");453 _error_("input data_type is not a scalar!"); 454 454 } 455 455 else{ … … 468 468 469 469 if (mxIsClass(dataref,"logical")){ 470 if(mxGetM(dataref)!=1) _error 2_("input data is not of size 1x1");471 if(mxGetN(dataref)!=1) _error 2_("input data is not of size 1x1");470 if(mxGetM(dataref)!=1) _error_("input data is not of size 1x1"); 471 if(mxGetN(dataref)!=1) _error_("input data is not of size 1x1"); 472 472 mxbool_ptr=mxGetLogicals(dataref); 473 473 } 474 474 else{ 475 _error 2_("input data_type is not a bool!");475 _error_("input data_type is not a bool!"); 476 476 } 477 477 … … 495 495 else{ 496 496 /*This is an error: we don't have the correct input!: */ 497 _error 2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");497 _error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet"); 498 498 } 499 499 … … 519 519 else{ 520 520 /*This is an error: we don't have the correct input!: */ 521 _error 2_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");521 _error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet"); 522 522 } 523 523 … … 620 620 /*Fetch all options*/ 621 621 for (int i=istart; i<nrhs; i=i+2){ 622 if (!mxIsClass(pdataref[i],"char")) _error 2_("Argument " << i+1 << " must be name of option");622 if (!mxIsClass(pdataref[i],"char")) _error_("Argument " << i+1 << " must be name of option"); 623 623 624 624 FetchData(&name,pdataref[i]); 625 if(i+1 == nrhs) _error 2_("Argument " << i+2 << " must exist and be value of option \"" << name << "\".");625 if(i+1 == nrhs) _error_("Argument " << i+2 << " must exist and be value of option \"" << name << "\"."); 626 626 627 627 option=(Option*)OptionParse(name,&pdataref[i+1]); -
issm/branches/trunk-jpl-damage/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp
r12878 r13101 119 119 } 120 120 else{ 121 _error 2_("Matlab matrix type Not implemented yet");121 _error_("Matlab matrix type Not implemented yet"); 122 122 } 123 123 -
issm/branches/trunk-jpl-damage/src/c/matlab/io/MatlabVectorToDoubleVector.cpp
r12878 r13101 46 46 47 47 /*Check that input is actualy a vector*/ 48 if (cols!=1) _error 2_("input vector of size " << rows << "x" << cols << " should have only one column");48 if (cols!=1) _error_("input vector of size " << rows << "x" << cols << " should have only one column"); 49 49 50 50 nz=(int)((double)nnz/(double)rows); … … 77 77 78 78 /*Check that input is actualy a vector*/ 79 if (cols!=1) _error 2_("input vector of size " << rows << "x" << cols << " should have only one column");79 if (cols!=1) _error_("input vector of size " << rows << "x" << cols << " should have only one column"); 80 80 81 81 /*allocate and memcpy*/ -
issm/branches/trunk-jpl-damage/src/c/matlab/io/OptionParse.cpp
r12878 r13101 27 27 /*check and parse the value */ 28 28 if (!mxIsClass(prhs[0],"double")){ 29 _error 2_("Value of option \"" << odouble->name << "\" must be class \"double\", not class \"" << mxGetClassName(prhs[0]) <<"\".");29 _error_("Value of option \"" << odouble->name << "\" must be class \"double\", not class \"" << mxGetClassName(prhs[0]) <<"\"."); 30 30 } 31 31 FetchData(&odouble->values,&odouble->numel,&odouble->ndims,&odouble->size,prhs[0]); … … 45 45 /*check and parse the value */ 46 46 if (!mxIsClass(prhs[0],"logical")){ 47 _error 2_("Value of option \"" << ological->name << "\" must be class \"logical\", not class \"" << mxGetClassName(prhs[0]) <<"\".");47 _error_("Value of option \"" << ological->name << "\" must be class \"logical\", not class \"" << mxGetClassName(prhs[0]) <<"\"."); 48 48 } 49 49 FetchData(&ological->values,&ological->numel,&ological->ndims,&ological->size,prhs[0]); … … 63 63 /*check and parse the value */ 64 64 if (!mxIsClass(prhs[0],"char")){ 65 _error 2_("Value of option \"" << ochar->name << "\" must be class \"char\", not class \"" << mxGetClassName(prhs[0]) <<"\".");65 _error_("Value of option \"" << ochar->name << "\" must be class \"char\", not class \"" << mxGetClassName(prhs[0]) <<"\"."); 66 66 } 67 67 FetchData(&ochar->values,&ochar->numel,&ochar->ndims,&ochar->size,prhs[0]); … … 87 87 /*check and parse the value */ 88 88 if (!mxIsClass(prhs[0],"struct")){ 89 _error 2_("Value of option \"" << ostruct->name << "\" must be class \"struct\", not class \"" << mxGetClassName(prhs[0]) <<"\".");89 _error_("Value of option \"" << ostruct->name << "\" must be class \"struct\", not class \"" << mxGetClassName(prhs[0]) <<"\"."); 90 90 } 91 91 ostruct->numel=mxGetNumberOfElements(prhs[0]); … … 133 133 /*check and parse the value */ 134 134 if (!mxIsClass(prhs[0],"cell")){ 135 _error 2_("Value of option \"" << ocell->name << "\" must be class \"cell\", not class \"" << mxGetClassName(prhs[0]) <<"\".");135 _error_("Value of option \"" << ocell->name << "\" must be class \"cell\", not class \"" << mxGetClassName(prhs[0]) <<"\"."); 136 136 } 137 137 … … 181 181 mxDestroyArray(lhs[0]); 182 182 } 183 else _error 2_("Second argument value of option \""<< name <<"\" is of unrecognized class \""<< mxGetClassName(prhs[0]) <<"\".");183 else _error_("Second argument value of option \""<< name <<"\" is of unrecognized class \""<< mxGetClassName(prhs[0]) <<"\"."); 184 184 } 185 185 -
issm/branches/trunk-jpl-damage/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.cpp
r12878 r13101 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void ControlInputScaleGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, double* norm_list,int step){11 void ControlInputScaleGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,IssmDouble* norm_list,int step){ 12 12 13 13 /*Intermediaries*/ 14 14 int i,j,num_controls; 15 15 int *control_type = NULL; 16 double *scalar_list = NULL;17 double scalar;16 IssmDouble *scalar_list = NULL; 17 IssmDouble scalar; 18 18 19 19 … … 38 38 /*Clean up and return*/ 39 39 xDelete<int>(control_type); 40 xDelete< double>(scalar_list);40 xDelete<IssmDouble>(scalar_list); 41 41 } -
issm/branches/trunk-jpl-damage/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h
r12878 r13101 8 8 #include "../../Container/Container.h" 9 9 10 void ControlInputScaleGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters, double* norm_list,int step);10 void ControlInputScaleGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,IssmDouble* norm_list,int step); 11 11 12 12 #endif -
issm/branches/trunk-jpl-damage/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp
r12878 r13101 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, double* gradient){11 void ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,IssmDouble* gradient){ 12 12 13 13 /*Intermediaries*/ … … 33 33 34 34 /*Serialize gradient*/ 35 double* serial_gradient=NULL;35 IssmDouble* serial_gradient=NULL; 36 36 serial_gradient=gradient->ToMPISerial(); 37 37 … … 39 39 40 40 /*Clean up and return*/ 41 xDelete< double>(serial_gradient);41 xDelete<IssmDouble>(serial_gradient); 42 42 } -
issm/branches/trunk-jpl-damage/src/c/modules/CostFunctionx/CostFunctionx.cpp
r12878 r13101 11 11 #include "../Responsex/Responsex.h" 12 12 13 void CostFunctionx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters){13 void CostFunctionx(IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters){ 14 14 15 15 /*Intermediary*/ 16 16 int i; 17 17 int num_responses; 18 double S;19 18 Element *element = NULL; 20 19 int *responses = NULL; 21 20 22 21 /*output: */ 23 double J,Jplus;22 IssmDouble J,Jplus; 24 23 25 24 /*Recover parameters*/ -
issm/branches/trunk-jpl-damage/src/c/modules/CostFunctionx/CostFunctionx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void CostFunctionx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters);12 void CostFunctionx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters); 13 13 14 14 #endif -
issm/branches/trunk-jpl-damage/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp
r12878 r13101 86 86 } 87 87 else if (flag==NodalEnum){ 88 _error 2_("nodal response functions not supported yet!");88 _error_("nodal response functions not supported yet!"); 89 89 90 90 /*increment response_pointer :*/ … … 104 104 } 105 105 } 106 else _error 2_("flag type " << flag << " not supported yet for response analysis");106 else _error_("flag type " << flag << " not supported yet for response analysis"); 107 107 } 108 108 -
issm/branches/trunk-jpl-damage/src/c/modules/Dakotax/DescriptorIndex.cpp
r12878 r13101 23 23 /*retrieve first token, separated by underscore: */ 24 24 pch = strtok (descriptor,"_"); 25 if(!pch)_error 2_("descriptor " << descriptor << " is not correctly formatted!");25 if(!pch)_error_("descriptor " << descriptor << " is not correctly formatted!"); 26 26 27 27 if (strncmp(pch,"scaled",6)==0){ 28 28 /*we have a scaled variable. recover the root: */ 29 29 pch = strtok (NULL, "_"); 30 if(!pch)_error 2_("scaled descriptor " << descriptor << " is not correctly formatted!");30 if(!pch)_error_("scaled descriptor " << descriptor << " is not correctly formatted!"); 31 31 memcpy(root,pch,(strlen(pch)+1)*sizeof(char)); 32 32 … … 44 44 /*we have an indexed variable. recover the root: */ 45 45 pch = strtok (NULL, "_"); 46 if(!pch)_error 2_("indexed descriptor " << descriptor << " is not correctly formatted!");46 if(!pch)_error_("indexed descriptor " << descriptor << " is not correctly formatted!"); 47 47 memcpy(root,pch,(strlen(pch)+1)*sizeof(char)); 48 48 /*now recover the index: */ 49 49 pch = strtok (NULL, "_"); 50 if(!pch)_error 2_("indexed descriptor " << descriptor << " is not correctly formatted!");50 if(!pch)_error_("indexed descriptor " << descriptor << " is not correctly formatted!"); 51 51 sscanf(pch,"%i",pindex); 52 52 return IndexedEnum; … … 55 55 /*we have an indexed variable. recover the root: */ 56 56 pch = strtok (NULL, "_"); 57 if(!pch)_error 2_("nodal descriptor " << descriptor << " is not correctly formatted!");57 if(!pch)_error_("nodal descriptor " << descriptor << " is not correctly formatted!"); 58 58 memcpy(root,pch,(strlen(pch)+1)*sizeof(char)); 59 59 /*now recover the index: */ 60 60 pch = strtok (NULL, "_"); 61 if(!pch)_error 2_("nodal descriptor " << descriptor << " is not correctly formatted!");61 if(!pch)_error_("nodal descriptor " << descriptor << " is not correctly formatted!"); 62 62 sscanf(pch,"%i",pindex); 63 63 return NodalEnum; -
issm/branches/trunk-jpl-damage/src/c/modules/Dakotax/SpawnCoreParallel.cpp
r12878 r13101 72 72 if(control_analysis)solutioncore=&control_core; 73 73 #else 74 _error 2_("ISSM was not compiled with control capabilities, exiting!");74 _error_("ISSM was not compiled with control capabilities, exiting!"); 75 75 #endif 76 76 -
issm/branches/trunk-jpl-damage/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp
r12168 r13101 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void DragCoefficientAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){12 void DragCoefficientAbsGradientx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){ 13 13 14 14 /*Intermediary*/ … … 17 17 18 18 /*output: */ 19 double J=0;20 double J_sum;19 IssmDouble J=0; 20 IssmDouble J_sum; 21 21 22 22 /*Compute Misfit: */ -
issm/branches/trunk-jpl-damage/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void DragCoefficientAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);12 void DragCoefficientAbsGradientx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index); 13 13 14 14 #endif -
issm/branches/trunk-jpl-damage/src/c/modules/ElementResponsex/ElementResponsex.cpp
r12878 r13101 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void ElementResponsex( double* presponse, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,int response_enum,bool process_units){12 void ElementResponsex( IssmDouble* presponse, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,int response_enum,bool process_units){ 13 13 14 14 … … 20 20 int cpu_found=-1; 21 21 int index; 22 double response;22 IssmDouble response; 23 23 Element* element=NULL; 24 24 … … 39 39 #ifdef _HAVE_MPI_ 40 40 MPI_Allreduce ( &found,&sumfound,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD); 41 if(!sumfound)_error 2_("could not find material with id" << index << " to compute ElementResponse");41 if(!sumfound)_error_("could not find material with id" << index << " to compute ElementResponse"); 42 42 #endif 43 43 -
issm/branches/trunk-jpl-damage/src/c/modules/ElementResponsex/ElementResponsex.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void ElementResponsex( double* presponse, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,int response_enum,bool process_units);12 void ElementResponsex( IssmDouble* presponse, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,int response_enum,bool process_units); 13 13 14 14 #endif /* _ELEMENTRESPONSEX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/EnumToStringx/EnumToStringx.cpp
r12946 r13101 17 17 switch(en){ 18 18 19 case AutodiffForwardEnum : return "AutodiffForward";20 19 case AutodiffIsautodiffEnum : return "AutodiffIsautodiff"; 21 case AutodiffReverseEnum : return "AutodiffReverse";22 20 case BalancethicknessSpcthicknessEnum : return "BalancethicknessSpcthickness"; 23 21 case BalancethicknessStabilizationEnum : return "BalancethicknessStabilization"; … … 55 53 case FlowequationElementEquationEnum : return "FlowequationElementEquation"; 56 54 case FlowequationIshutterEnum : return "FlowequationIshutter"; 55 case FlowequationIsl1l2Enum : return "FlowequationIsl1l2"; 57 56 case FlowequationIsmacayealpattynEnum : return "FlowequationIsmacayealpattyn"; 58 57 case FlowequationIsstokesEnum : return "FlowequationIsstokes"; … … 239 238 case TransientSolutionEnum : return "TransientSolution"; 240 239 case ApproximationEnum : return "Approximation"; 240 case NoneApproximationEnum : return "NoneApproximation"; 241 241 case HutterApproximationEnum : return "HutterApproximation"; 242 242 case MacAyealApproximationEnum : return "MacAyealApproximation"; 243 243 case MacAyealPattynApproximationEnum : return "MacAyealPattynApproximation"; 244 244 case MacAyealStokesApproximationEnum : return "MacAyealStokesApproximation"; 245 case NoneApproximationEnum : return "NoneApproximation";245 case L1L2ApproximationEnum : return "L1L2Approximation"; 246 246 case PattynApproximationEnum : return "PattynApproximation"; 247 247 case PattynStokesApproximationEnum : return "PattynStokesApproximation"; … … 283 283 case NumericalfluxEnum : return "Numericalflux"; 284 284 case ParamEnum : return "Param"; 285 case L1L2IceFrontEnum : return "L1L2IceFront"; 285 286 case PattynIceFrontEnum : return "PattynIceFront"; 286 287 case PengridEnum : return "Pengrid"; … … 376 377 case EnthalpyPicardEnum : return "EnthalpyPicard"; 377 378 case ThicknessAbsGradientEnum : return "ThicknessAbsGradient"; 379 case ThicknessAlongGradientEnum : return "ThicknessAlongGradient"; 380 case ThicknessAcrossGradientEnum : return "ThicknessAcrossGradient"; 378 381 case StepResponsesEnum : return "StepResponses"; 379 382 case IntMatParamEnum : return "IntMatParam"; … … 396 399 case StressTensoryzEnum : return "StressTensoryz"; 397 400 case StressTensorzzEnum : return "StressTensorzz"; 398 case IceVolumeEnum : return "IceVolume";399 case TotalSmbEnum : return "TotalSmb";400 case ThicknessAlongGradientEnum : return "ThicknessAlongGradient";401 case ThicknessAcrossGradientEnum : return "ThicknessAcrossGradient";402 401 case P0Enum : return "P0"; 403 402 case P1Enum : return "P1"; … … 433 432 case MaxVzEnum : return "MaxVz"; 434 433 case MaxAbsVzEnum : return "MaxAbsVz"; 434 case IceVolumeEnum : return "IceVolume"; 435 case TotalSmbEnum : return "TotalSmb"; 435 436 case RelativeEnum : return "Relative"; 436 437 case AbsoluteEnum : return "Absolute"; -
issm/branches/trunk-jpl-damage/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp
r12878 r13101 55 55 56 56 if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy,&closed,filexp)) 57 _error 2_("Error reading exp file.");57 _error_("Error reading exp file."); 58 58 _pprintLine_("Exp2Kmlx -- Reading " << nprof << " exp profiles from file \"" << filexp << "\"."); 59 59 // for (i=0; i<nprof; i++) -
issm/branches/trunk-jpl-damage/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp
r12878 r13101 26 26 /*Get size of vector: */ 27 27 gsize=nodes->NumberOfDofs(configuration_type,GsetEnum); 28 if (gsize==0) _error 2_("Allocating a Vec of size 0 as gsize=0 for configuration: " << EnumToStringx(configuration_type));28 if (gsize==0) _error_("Allocating a Vec of size 0 as gsize=0 for configuration: " << EnumToStringx(configuration_type)); 29 29 30 30 /*Initialize solution: */ -
issm/branches/trunk-jpl-damage/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp
r12878 r13101 36 36 } 37 37 38 void GetVectorFromControlInputsx( double** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, const char* data){38 void GetVectorFromControlInputsx( IssmDouble** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, const char* data){ 39 39 40 40 /*output: */ 41 double* vector=NULL;41 IssmDouble* vector=NULL; 42 42 43 43 /*intermediary: */ -
issm/branches/trunk-jpl-damage/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h
r12878 r13101 10 10 /* local prototypes: */ 11 11 void GetVectorFromControlInputsx( Vector** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,const char* data="value"); 12 void GetVectorFromControlInputsx( double** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,const char* data="value");12 void GetVectorFromControlInputsx( IssmDouble** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,const char* data="value"); 13 13 14 14 #endif /* _GETVECTORFROMCONTROLINPUTSXX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp
r12878 r13101 32 32 } 33 33 else{ 34 _error 2_("vector type: " << EnumToStringx(type) << " not supported yet!");34 _error_("vector type: " << EnumToStringx(type) << " not supported yet!"); 35 35 } 36 36 -
issm/branches/trunk-jpl-damage/src/c/modules/Gradjx/Gradjx.cpp
r12878 r13101 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void Gradjx(Vector** pgradient, double** pnorm_list, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){12 void Gradjx(Vector** pgradient,IssmDouble** pnorm_list, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){ 13 13 14 14 int i,j,numberofvertices; 15 15 int num_controls; 16 double norm_inf;17 double *norm_list = NULL;16 IssmDouble norm_inf; 17 IssmDouble *norm_list = NULL; 18 18 int *control_type = NULL; 19 19 Vector *gradient = NULL; … … 27 27 /*Allocate gradient_list */ 28 28 gradient_list = xNew<Vector*>(num_controls); 29 norm_list = xNew< double>(num_controls);29 norm_list = xNew<IssmDouble>(num_controls); 30 30 for(i=0;i<num_controls;i++){ 31 31 gradient_list[i]=new Vector(num_controls*numberofvertices); … … 54 54 /*Check that gradient is clean*/ 55 55 norm_inf=gradient->Norm(NORM_INF); 56 if(norm_inf<=0) _error 2_("||∂J/∂α||∞ = 0 gradient norm is zero");57 if(xIsNan<IssmDouble>(norm_inf))_error 2_("||∂J/∂α||∞ = NaN gradient norm is NaN");56 if(norm_inf<=0) _error_("||∂J/∂α||∞ = 0 gradient norm is zero"); 57 if(xIsNan<IssmDouble>(norm_inf))_error_("||∂J/∂α||∞ = NaN gradient norm is NaN"); 58 58 59 59 /*Clean-up and assign output pointer*/ … … 62 62 } 63 63 else{ 64 xDelete< double>(norm_list);64 xDelete<IssmDouble>(norm_list); 65 65 } 66 66 if(pgradient) *pgradient=gradient; -
issm/branches/trunk-jpl-damage/src/c/modules/Gradjx/Gradjx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void Gradjx(Vector** pgrad_g, double** pgrad_norm,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters);12 void Gradjx(Vector** pgrad_g,IssmDouble** pgrad_norm,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters); 13 13 14 14 #endif /* _GRADJX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
r12878 r13101 14 14 15 15 int i, migration_style,analysis_type; 16 double* vertices_potentially_ungrounding = NULL;17 double* vertices_ungrounding = NULL;18 double* old_floatingice = NULL;16 IssmDouble* vertices_potentially_ungrounding = NULL; 17 IssmDouble* vertices_ungrounding = NULL; 18 IssmDouble* old_floatingice = NULL; 19 19 Vector* vec_old_floatingice = NULL; 20 20 Element* element = NULL; … … 27 27 28 28 if(migration_style==NoneEnum) return; 29 if(migration_style!=AgressiveMigrationEnum && migration_style!=SoftMigrationEnum) _error 2_(EnumToStringx(migration_style) << " not supported yet!");29 if(migration_style!=AgressiveMigrationEnum && migration_style!=SoftMigrationEnum) _error_(EnumToStringx(migration_style) << " not supported yet!"); 30 30 31 31 if(migration_style==SoftMigrationEnum){ … … 49 49 /*free ressouces: */ 50 50 xdelete(&vec_old_floatingice); 51 xDelete< double>(vertices_potentially_ungrounding);52 xDelete< double>(vertices_ungrounding);53 xDelete< double>(old_floatingice);51 xDelete<IssmDouble>(vertices_potentially_ungrounding); 52 xDelete<IssmDouble>(vertices_ungrounding); 53 xDelete<IssmDouble>(old_floatingice); 54 54 } 55 55 … … 82 82 /*%}}}*/ 83 83 /*FUNCTION PotentialSheetUngrounding {{{*/ 84 double* PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters){84 IssmDouble* PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters){ 85 85 86 86 int i,numberofvertices; 87 double* vertices_potentially_ungrounding = NULL;87 IssmDouble* vertices_potentially_ungrounding = NULL; 88 88 Vector* vec_vertices_potentially_ungrounding = NULL; 89 89 Element* element = NULL; … … 109 109 /*}}}*/ 110 110 /*FUNCTION PropagateFloatingiceToGroundedNeighbors {{{*/ 111 double* PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding){111 IssmDouble* PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,IssmDouble* vertices_potentially_ungrounding){ 112 112 113 113 int i,analysis_type; 114 114 int numberofvertices; 115 115 int nflipped,local_nflipped; 116 double* nodes_on_floatingice = NULL;117 double* elements_neighboring_floatingce = NULL;116 IssmDouble* nodes_on_floatingice = NULL; 117 IssmDouble* elements_neighboring_floatingce = NULL; 118 118 Vector* vec_elements_neighboring_floatingice = NULL; 119 119 Vector* vec_nodes_on_floatingice = NULL; … … 150 150 for(i=0;i<elements->Size();i++){ 151 151 element=(Element*)elements->GetObjectByOffset(i); 152 if( elements_neighboring_floatingce[element->Sid()]){152 if(reCast<int,IssmDouble>(elements_neighboring_floatingce[element->Sid()])){ 153 153 local_nflipped+=element->UpdatePotentialSheetUngrounding(vertices_potentially_ungrounding,vec_nodes_on_floatingice,nodes_on_floatingice); 154 154 } … … 164 164 165 165 /*Avoid leaks: */ 166 xDelete< double>(elements_neighboring_floatingce);167 xDelete< double>(nodes_on_floatingice);166 xDelete<IssmDouble>(elements_neighboring_floatingce); 167 xDelete<IssmDouble>(nodes_on_floatingice); 168 168 169 169 /*Assemble and serialize:*/ … … 174 174 /*Free ressources:*/ 175 175 xdelete(&vec_nodes_on_floatingice); 176 xDelete< double>(elements_neighboring_floatingce);176 xDelete<IssmDouble>(elements_neighboring_floatingce); 177 177 178 178 return nodes_on_floatingice; -
issm/branches/trunk-jpl-damage/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.h
r11708 r13101 15 15 16 16 Vector* CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type); 17 double* PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters);18 double* PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding);17 IssmDouble* PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters); 18 IssmDouble* PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,IssmDouble* vertices_potentially_ungrounding); 19 19 #endif /* _GROUNDINGLINEMIGRATIONX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/IceVolumex/IceVolumex.cpp
r12168 r13101 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void IceVolumex( double* pV, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){12 void IceVolumex(IssmDouble* pV, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){ 13 13 14 double local_ice_volume = 0;15 double total_ice_volume;14 IssmDouble local_ice_volume = 0; 15 IssmDouble total_ice_volume; 16 16 17 17 for(int i=0;i<elements->Size();i++){ -
issm/branches/trunk-jpl-damage/src/c/modules/IceVolumex/IceVolumex.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void IceVolumex( double* pV, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);12 void IceVolumex(IssmDouble* pV, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units); 13 13 14 14 #endif -
issm/branches/trunk-jpl-damage/src/c/modules/InputControlUpdatex/InputControlUpdatex.cpp
r4967 r13101 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void InputControlUpdatex(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters, double scalar,bool save_parameter){11 void InputControlUpdatex(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters,IssmDouble scalar,bool save_parameter){ 12 12 13 13 /*Go through elemnets, and ask to carry out the operation on inputs: */ -
issm/branches/trunk-jpl-damage/src/c/modules/InputControlUpdatex/InputControlUpdatex.h
r4967 r13101 9 9 10 10 /* local prototypes: */ 11 void InputControlUpdatex(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters, double scalar,bool save_parameter);11 void InputControlUpdatex(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters, IssmDouble scalar,bool save_parameter); 12 12 13 13 #endif -
issm/branches/trunk-jpl-damage/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp
r12878 r13101 95 95 } 96 96 else if (strncmp(descriptor,"indexed_",8)==0){ 97 _error 2_("indexed variables not supported yet!");97 _error_("indexed variables not supported yet!"); 98 98 } 99 99 else if (strncmp(descriptor,"nodal_",8)==0){ 100 _error 2_("nodal variables not supported yet!");100 _error_("nodal variables not supported yet!"); 101 101 } 102 102 else{ -
issm/branches/trunk-jpl-damage/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp
r12878 r13101 37 37 /*Some checks on arguments: */ 38 38 if ((M<2) || (N<2) || (nods<=0)){ 39 _error 2_("nothing to be done according to the dimensions of input matrices and vectors.");39 _error_("nothing to be done according to the dimensions of input matrices and vectors."); 40 40 } 41 41 if (x_in[1]-x_in[0]<0){ 42 _error 2_("x coordinate vector should be increasing.\n use Matlab's command x=flipud(x), also flip the data matrix data=fliplr(data)");42 _error_("x coordinate vector should be increasing.\n use Matlab's command x=flipud(x), also flip the data matrix data=fliplr(data)"); 43 43 } 44 44 if (y_in[1]-y_in[0]<0){ 45 _error 2_("y coordinate vector should be increasing.\n use Matlab's command y=flipud(y), also flip the data matrix data=flipud(data)");45 _error_("y coordinate vector should be increasing.\n use Matlab's command y=flipud(y), also flip the data matrix data=flipud(data)"); 46 46 } 47 47 … … 69 69 } 70 70 else{ 71 _error 2_("x and y vectors length should be 1 or 0 more than data number of rows.");71 _error_("x and y vectors length should be 1 or 0 more than data number of rows."); 72 72 } 73 73 -
issm/branches/trunk-jpl-damage/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp
r12878 r13101 40 40 /*some checks*/ 41 41 if (nels_data<1 || nods_data<3 || nods_prime==0){ 42 _error 2_("nothing to be done according to the mesh given in input");42 _error_("nothing to be done according to the mesh given in input"); 43 43 } 44 44 … … 54 54 } 55 55 else{ 56 _error 2_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");56 _error_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!"); 57 57 } 58 58 59 59 if((numcontours) && (interpolation_type==2)){ 60 _error 2_("element interpolation_type with contours not supported yet!");60 _error_("element interpolation_type with contours not supported yet!"); 61 61 } 62 62 -
issm/branches/trunk-jpl-damage/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp
r12878 r13101 30 30 /*some checks*/ 31 31 if (nels<1 || nods<3 || nlines<1 || ncols<1 || xposting==0 || yposting==0){ 32 _error 2_("nothing to be done according to the mesh given in input");32 _error_("nothing to be done according to the mesh given in input"); 33 33 } 34 34 … … 41 41 } 42 42 else{ 43 _error 2_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");43 _error_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!"); 44 44 } 45 45 -
issm/branches/trunk-jpl-damage/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp
r12878 r13101 35 35 /*Checks*/ 36 36 if (M_data!=nods_data && M_data!=nels_data){ 37 _error 2_("data provided should have either " << nods_data << " or " << nels_data << " lines (not " << M_data << ")");37 _error_("data provided should have either " << nods_data << " or " << nels_data << " lines (not " << M_data << ")"); 38 38 } 39 39 … … 138 138 for (j=0;j<N_data;j++){ 139 139 if (it<0 || it>=nels_data){ 140 _error 2_("Triangle number " << it << " not in [0 " << nels_data << "], report bug to developers");140 _error_("Triangle number " << it << " not in [0 " << nels_data << "], report bug to developers"); 141 141 } 142 142 data_interp[i*N_data+j]=data[N_data*it+j]; -
issm/branches/trunk-jpl-damage/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp
r12878 r13101 27 27 /*some checks*/ 28 28 if (nels_data<1 || nods_data<6 || nods_prime==0){ 29 _error 2_("nothing to be done according to the mesh given in input");29 _error_("nothing to be done according to the mesh given in input"); 30 30 } 31 31 … … 41 41 } 42 42 else{ 43 _error 2_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!");43 _error_("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!"); 44 44 } 45 45 -
issm/branches/trunk-jpl-damage/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp
r12878 r13101 38 38 fid=iomodel->SetFilePointerToData(&code, &vector_layout,vector_enum); 39 39 40 if(code!=7)_error 2_("expecting a IssmDouble vector for constraints with enum " << EnumToStringx(vector_enum));41 if(vector_layout!=1)_error 2_("expecting a nodal vector for constraints with enum " << EnumToStringx(vector_enum));40 if(code!=7)_error_("expecting a IssmDouble vector for constraints with enum " << EnumToStringx(vector_enum)); 41 if(vector_layout!=1)_error_("expecting a nodal vector for constraints with enum " << EnumToStringx(vector_enum)); 42 42 43 43 /*Fetch vector:*/ … … 99 99 } 100 100 else{ 101 _error 2_("Size of field " << EnumToStringx(vector_enum) << " not supported");101 _error_("Size of field " << EnumToStringx(vector_enum) << " not supported"); 102 102 } 103 103 -
issm/branches/trunk-jpl-damage/src/c/modules/KMLMeshWritex/KMLMeshWritex.cpp
r12878 r13101 133 133 } 134 134 else 135 _error 2_("Nodal connectivity table needs more than specified " << mxepg << " columns.\n");135 _error_("Nodal connectivity table needs more than specified " << mxepg << " columns.\n"); 136 136 } 137 137 jpt++; … … 173 173 174 174 else 175 _error 2_("Data matrix has incorrect number of " << mdata << " rows.\n");175 _error_("Data matrix has incorrect number of " << mdata << " rows.\n"); 176 176 } 177 177 -
issm/branches/trunk-jpl-damage/src/c/modules/Kml2Expx/Kml2Expx.cpp
r12878 r13101 44 44 fidi=fopen(filkml,"r"); 45 45 if (!(kobj=KMLFileReadx(fidi))) 46 _error 2_("Error reading kml file.");46 _error_("Error reading kml file."); 47 47 fclose(fidi); 48 48 -
issm/branches/trunk-jpl-damage/src/c/modules/Krigingx/Krigingx.cpp
r12878 r13101 138 138 } 139 139 else{ 140 _error 2_("output '" << output << "' not supported yet");140 _error_("output '" << output << "' not supported yet"); 141 141 } 142 142 … … 305 305 else if(strcmp(model,"spherical")==0) variogram = new SphericalVariogram(options); 306 306 else if(strcmp(model,"power")==0) variogram = new PowerVariogram(options); 307 else _error 2_("variogram " << model << " not supported yet (list of supported variogram: gaussian, exponential, spherical and power)");307 else _error_("variogram " << model << " not supported yet (list of supported variogram: gaussian, exponential, spherical and power)"); 308 308 } 309 309 else variogram = new GaussianVariogram(options); -
issm/branches/trunk-jpl-damage/src/c/modules/Krigingx/pKrigingx.cpp
r12878 r13101 103 103 } 104 104 else{ 105 _error 2_("output '" << output << "' not supported yet");105 _error_("output '" << output << "' not supported yet"); 106 106 } 107 107 … … 126 126 else if(strcmp(model,"spherical")==0) variogram = new SphericalVariogram(options); 127 127 else if(strcmp(model,"power")==0) variogram = new PowerVariogram(options); 128 else _error 2_("variogram " << model << " not supported yet (list of supported variogram: gaussian, exponential, spherical and power)");128 else _error_("variogram " << model << " not supported yet (list of supported variogram: gaussian, exponential, spherical and power)"); 129 129 } 130 130 else variogram = new GaussianVariogram(options); -
issm/branches/trunk-jpl-damage/src/c/modules/Ll2xyx/Ll2xyx.cpp
r12878 r13101 52 52 double T,rho,sl,tc,mc; 53 53 54 if((sgn!=1) && (sgn!=-1)) _error 2_("Sign should be either +1 or -1.\n");54 if((sgn!=1) && (sgn!=-1)) _error_("Sign should be either +1 or -1.\n"); 55 55 56 56 delta = central_meridian; … … 123 123 if(flag) _pprintLine_("Info: creating coordinates in polar stereographic (Std Latitude: 71S Meridian: 0)."); 124 124 } 125 else _error 2_("Sign should be either +1 or -1.\n");125 else _error_("Sign should be either +1 or -1.\n"); 126 126 127 127 return; -
issm/branches/trunk-jpl-damage/src/c/modules/MassFluxx/MassFluxx.cpp
r12878 r13101 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void MassFluxx( double* pmass_flux, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,bool process_units){12 void MassFluxx(IssmDouble* pmass_flux, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,bool process_units){ 13 13 14 14 int i,j; … … 20 20 21 21 /*output: */ 22 double mass_flux=0;23 double all_mass_flux=0;22 IssmDouble mass_flux=0; 23 IssmDouble all_mass_flux=0; 24 24 25 25 int counter; 26 26 27 27 /*all segments: */ 28 double** array=NULL;28 IssmDouble** array=NULL; 29 29 int M; 30 30 int* mdims_array=NULL; … … 32 32 33 33 /*our segments of interest: */ 34 double* segments=NULL;34 IssmDouble* segments=NULL; 35 35 int num_segments; 36 36 … … 48 48 * When we find one, use the element to compute the mass flux on the segment: */ 49 49 for(i=0;i<num_segments;i++){ 50 element_id= (int)*(segments+5*i+4);50 element_id=reCast<int,IssmDouble>(*(segments+5*i+4)); 51 51 for(j=0;j<elements->Size();j++){ 52 52 element=(Element*)elements->GetObjectByOffset(j); … … 66 66 /*Free ressources:*/ 67 67 for(j=0;j<M;j++){ 68 double* matrix=array[j];69 xDelete< double>(matrix);68 IssmDouble* matrix=array[j]; 69 xDelete<IssmDouble>(matrix); 70 70 } 71 71 xDelete<int>(mdims_array); 72 72 xDelete<int>(ndims_array); 73 xDelete< double*>(array);73 xDelete<IssmDouble*>(array); 74 74 75 75 /*Assign output pointers: */ -
issm/branches/trunk-jpl-damage/src/c/modules/MassFluxx/MassFluxx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void MassFluxx( double* pmass_flux, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,bool process_units);12 void MassFluxx(IssmDouble* pmass_flux, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,bool process_units); 13 13 14 14 -
issm/branches/trunk-jpl-damage/src/c/modules/MaxAbsVxx/MaxAbsVxx.cpp
r12168 r13101 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void MaxAbsVxx( double* pmaxabsvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){11 void MaxAbsVxx( IssmDouble* pmaxabsvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){ 12 12 13 13 int i; 14 double maxabsvx;15 double node_maxabsvx;16 double element_maxabsvx;14 IssmDouble maxabsvx; 15 IssmDouble node_maxabsvx; 16 IssmDouble element_maxabsvx; 17 17 18 18 /*Go through elements, and request velocity: */ -
issm/branches/trunk-jpl-damage/src/c/modules/MaxAbsVxx/MaxAbsVxx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void MaxAbsVxx( double* pmaxabsvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);12 void MaxAbsVxx( IssmDouble* pmaxabsvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units); 13 13 14 14 #endif /* _MAXABSVXX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/MaxAbsVyx/MaxAbsVyx.cpp
r12168 r13101 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void MaxAbsVyx( double* pmaxabsvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){11 void MaxAbsVyx( IssmDouble* pmaxabsvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){ 12 12 13 13 int i; 14 double maxabsvy;15 double node_maxabsvy;16 double element_maxabsvy;14 IssmDouble maxabsvy; 15 IssmDouble node_maxabsvy; 16 IssmDouble element_maxabsvy; 17 17 18 18 -
issm/branches/trunk-jpl-damage/src/c/modules/MaxAbsVyx/MaxAbsVyx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void MaxAbsVyx( double* pmaxabsvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);12 void MaxAbsVyx( IssmDouble* pmaxabsvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units); 13 13 14 14 #endif /* _MAXABSVYX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/MaxAbsVzx/MaxAbsVzx.cpp
r12168 r13101 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void MaxAbsVzx( double* pmaxabsvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){11 void MaxAbsVzx( IssmDouble* pmaxabsvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){ 12 12 13 13 int i; 14 double maxabsvz;15 double node_maxabsvz;16 double element_maxabsvz;14 IssmDouble maxabsvz; 15 IssmDouble node_maxabsvz; 16 IssmDouble element_maxabsvz; 17 17 18 18 /*Go through elements, and request velocity: */ -
issm/branches/trunk-jpl-damage/src/c/modules/MaxAbsVzx/MaxAbsVzx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void MaxAbsVzx( double* pmaxabsvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);12 void MaxAbsVzx( IssmDouble* pmaxabsvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units); 13 13 14 14 #endif /* _MAXABSVZX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/MaxVelx/MaxVelx.cpp
r12168 r13101 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void MaxVelx( double* pmaxvel, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){12 void MaxVelx( IssmDouble* pmaxvel, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){ 13 13 14 14 int i; 15 double maxvel;16 double node_maxvel;17 double element_maxvel;15 IssmDouble maxvel; 16 IssmDouble node_maxvel; 17 IssmDouble element_maxvel; 18 18 19 19 /*Go through elements, and request velocity: */ -
issm/branches/trunk-jpl-damage/src/c/modules/MaxVelx/MaxVelx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void MaxVelx( double* pmaxvel, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);12 void MaxVelx( IssmDouble* pmaxvel, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units); 13 13 14 14 #endif /* _MAXVELX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/MaxVxx/MaxVxx.cpp
r12168 r13101 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void MaxVxx( double* pmaxvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){11 void MaxVxx( IssmDouble* pmaxvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){ 12 12 13 13 int i; 14 double maxvx;15 double node_maxvx;16 double element_maxvx;14 IssmDouble maxvx; 15 IssmDouble node_maxvx; 16 IssmDouble element_maxvx; 17 17 18 18 /*Go through elements, and request velocity: */ -
issm/branches/trunk-jpl-damage/src/c/modules/MaxVxx/MaxVxx.h
r12878 r13101 9 9 10 10 /* local prototypes: */ 11 void MaxVxx( double* pmaxvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);11 void MaxVxx( IssmDouble* pmaxvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units); 12 12 13 13 #endif /* _MAXVXX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/MaxVyx/MaxVyx.cpp
r12168 r13101 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void MaxVyx( double* pmaxvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){11 void MaxVyx( IssmDouble* pmaxvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){ 12 12 13 13 int i; 14 double maxvy;15 double node_maxvy;16 double element_maxvy;14 IssmDouble maxvy; 15 IssmDouble node_maxvy; 16 IssmDouble element_maxvy; 17 17 18 18 /*Go through elements, and request velocity: */ -
issm/branches/trunk-jpl-damage/src/c/modules/MaxVyx/MaxVyx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void MaxVyx( double* pmaxvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);12 void MaxVyx( IssmDouble* pmaxvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units); 13 13 14 14 #endif /* _MAXVYX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/MaxVzx/MaxVzx.cpp
r12168 r13101 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void MaxVzx( double* pmaxvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){12 void MaxVzx( IssmDouble* pmaxvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){ 13 13 14 14 int i; 15 double maxvz;16 double node_maxvz;17 double element_maxvz;15 IssmDouble maxvz; 16 IssmDouble node_maxvz; 17 IssmDouble element_maxvz; 18 18 19 19 /*Go through elements, and request velocity: */ -
issm/branches/trunk-jpl-damage/src/c/modules/MaxVzx/MaxVzx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void MaxVzx( double* pmaxvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);12 void MaxVzx( IssmDouble* pmaxvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units); 13 13 14 14 #endif /* _MAXVZX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/MeshPartitionx/MeshPartitionx.cpp
r12878 r13101 51 51 for (i=0;i<numberofnodes;i++) npart[i]=0; 52 52 } 53 else _error 2_("At least one processor is required");53 else _error_("At least one processor is required"); 54 54 } 55 55 else{ … … 78 78 for (i=0;i<numberofnodes2d;i++) npart2d[i]=0; 79 79 } 80 else _error 2_("At least one processor is required");80 else _error_("At least one processor is required"); 81 81 82 82 /*Extrude epart2d to epart, using numlayers: */ -
issm/branches/trunk-jpl-damage/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp
r12878 r13101 38 38 if( (edge1==IntersectEnum) && (edge2==IntersectEnum) && (edge3==IntersectEnum) ){ 39 39 /*This case is impossible: */ 40 _error 2_("error: a line cannot go through 3 different vertices!");40 _error_("error: a line cannot go through 3 different vertices!"); 41 41 } 42 42 else if( ((edge1==IntersectEnum) && (edge2==IntersectEnum)) || ((edge2==IntersectEnum) && (edge3==IntersectEnum)) || ((edge3==IntersectEnum) && (edge1==IntersectEnum)) ){ -
issm/branches/trunk-jpl-damage/src/c/modules/MinVelx/MinVelx.cpp
r12168 r13101 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void MinVelx( double* pminvel, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){12 void MinVelx( IssmDouble* pminvel, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){ 13 13 14 14 int i; 15 double minvel;16 double node_minvel;17 double element_minvel;15 IssmDouble minvel; 16 IssmDouble node_minvel; 17 IssmDouble element_minvel; 18 18 19 19 /*Go through elements, and request velocity: */ -
issm/branches/trunk-jpl-damage/src/c/modules/MinVelx/MinVelx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void MinVelx( double* pminvel, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);12 void MinVelx( IssmDouble* pminvel, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units); 13 13 14 14 #endif /* _MINVELX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/MinVxx/MinVxx.cpp
r12168 r13101 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void MinVxx( double* pminvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){11 void MinVxx( IssmDouble* pminvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){ 12 12 13 13 int i; 14 double minvx;15 double node_minvx;16 double element_minvx;14 IssmDouble minvx; 15 IssmDouble node_minvx; 16 IssmDouble element_minvx; 17 17 18 18 /*Go through elements, and request velocity: */ -
issm/branches/trunk-jpl-damage/src/c/modules/MinVxx/MinVxx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void MinVxx( double* pminvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);12 void MinVxx( IssmDouble* pminvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units); 13 13 14 14 #endif /* _MINVX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/MinVyx/MinVyx.cpp
r12168 r13101 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void MinVyx( double* pminvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){11 void MinVyx( IssmDouble* pminvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){ 12 12 13 13 int i; 14 double minvy;15 double node_minvy;16 double element_minvy;14 IssmDouble minvy; 15 IssmDouble node_minvy; 16 IssmDouble element_minvy; 17 17 18 18 /*Go through elements, and request velocity: */ -
issm/branches/trunk-jpl-damage/src/c/modules/MinVyx/MinVyx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void MinVyx( double* pminvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);12 void MinVyx( IssmDouble* pminvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units); 13 13 14 14 #endif /* _MINVYX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/MinVzx/MinVzx.cpp
r12168 r13101 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void MinVzx( double* pminvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){11 void MinVzx( IssmDouble* pminvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){ 12 12 13 13 int i; 14 double minvz;15 double node_minvz;16 double element_minvz;14 IssmDouble minvz; 15 IssmDouble node_minvz; 16 IssmDouble element_minvz; 17 17 18 18 /*Go through elements, and request velocity: */ -
issm/branches/trunk-jpl-damage/src/c/modules/MinVzx/MinVzx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void MinVzx( double* pminvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);12 void MinVzx( IssmDouble* pminvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units); 13 13 14 14 #endif /* _MINVZX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp
r12878 r13101 42 42 43 43 /*Get left and right elements*/ 44 element= (int)iomodel->Data(MeshEdgesEnum)[4*i+2]-1; //edges are [node1 node2 elem1 elem2]44 element=reCast<int,IssmDouble>(iomodel->Data(MeshEdgesEnum)[4*i+2])-1; //edges are [node1 node2 elem1 elem2] 45 45 46 46 /*Now, if this element is not in the partition, pass: */ -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp
r12878 r13101 46 46 47 47 /*Check in 3d*/ 48 if(stabilization==3 && dim==3) _error 2_("DG 3d not implemented yet");48 if(stabilization==3 && dim==3) _error_("DG 3d not implemented yet"); 49 49 50 50 /*First fetch data: */ … … 72 72 73 73 //Get index of the vertex on which the current node is located 74 vertex_id= (int)*(iomodel->Data(MeshElementsEnum)+3*i+j); //(Matlab indexing)74 vertex_id=reCast<int,IssmDouble>(*(iomodel->Data(MeshElementsEnum)+3*i+j)); //(Matlab indexing) 75 75 io_index=vertex_id-1; //(C indexing) 76 76 _assert_(vertex_id>0 && vertex_id<=numberofvertices); -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp
r12878 r13101 21 21 int num_cm_responses; 22 22 int *control_type = NULL; 23 double *cm_responses = NULL;24 double *cm_jump = NULL;25 double *optscal = NULL;26 double *maxiter = NULL;23 IssmDouble *cm_responses = NULL; 24 IssmDouble *cm_jump = NULL; 25 IssmDouble *optscal = NULL; 26 IssmDouble *maxiter = NULL; 27 27 28 28 /*Get parameters: */ … … 64 64 65 65 xDelete<int>(control_type); 66 xDelete< double>(cm_responses);67 xDelete< double>(cm_jump);68 xDelete< double>(optscal);69 xDelete< double>(maxiter);66 xDelete<IssmDouble>(cm_responses); 67 xDelete<IssmDouble>(cm_jump); 68 xDelete<IssmDouble>(optscal); 69 xDelete<IssmDouble>(maxiter); 70 70 } 71 71 -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
r12878 r13101 42 42 iomodel->FetchData(4,InversionControlParametersEnum,InversionCostFunctionsCoefficientsEnum,InversionMinParametersEnum,InversionMaxParametersEnum); 43 43 for(i=0;i<num_control_type;i++){ 44 switch( (int)iomodel->Data(InversionControlParametersEnum)[i]){44 switch(reCast<int,IssmDouble>(iomodel->Data(InversionControlParametersEnum)[i])){ 45 45 case BalancethicknessThickeningRateEnum: iomodel->FetchData(1,BalancethicknessThickeningRateEnum); break; 46 46 case VxEnum: iomodel->FetchData(1,VxEnum); break; … … 49 49 case MaterialsRheologyBbarEnum: iomodel->FetchData(1,MaterialsRheologyBEnum); break; 50 50 case MaterialsRheologyZbarEnum: iomodel->FetchData(1,MaterialsRheologyZEnum); break; 51 default: _error_("Control %s not implemented yet",EnumToStringx((int)iomodel->Data(InversionControlParametersEnum)[i]));51 default: _error_("Control " << EnumToStringx(reCast<int,IssmDouble>(iomodel->Data(InversionControlParametersEnum)[i])) << " not implemented yet"); 52 52 } 53 53 } -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/CreateDataSets.cpp
r12878 r13101 124 124 125 125 default: 126 _error 2_("analysis_type: " << EnumToStringx(analysis_type) << " not supported yet!");126 _error_("analysis_type: " << EnumToStringx(analysis_type) << " not supported yet!"); 127 127 } 128 128 -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/CreateParameters.cpp
r12878 r13101 36 36 parameters->AddObject(iomodel->CopyConstantObject(FlowequationIshutterEnum)); 37 37 parameters->AddObject(iomodel->CopyConstantObject(FlowequationIsmacayealpattynEnum)); 38 parameters->AddObject(iomodel->CopyConstantObject(FlowequationIsl1l2Enum)); 38 39 parameters->AddObject(iomodel->CopyConstantObject(FlowequationIsstokesEnum)); 39 40 parameters->AddObject(iomodel->CopyConstantObject(SettingsOutputFrequencyEnum)); … … 85 86 parameters->AddObject(iomodel->CopyConstantObject(MaterialsRheologyLawEnum)); 86 87 parameters->AddObject(iomodel->CopyConstantObject(AutodiffIsautodiffEnum)); 87 parameters->AddObject(iomodel->CopyConstantObject(AutodiffForwardEnum));88 parameters->AddObject(iomodel->CopyConstantObject(AutodiffReverseEnum));89 88 parameters->AddObject(iomodel->CopyConstantObject(QmuIsdakotaEnum)); 90 89 parameters->AddObject(iomodel->CopyConstantObject(InversionIscontrolEnum)); -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp
r12878 r13101 153 153 /*Fetch the mass flux segments necessary to compute the mass fluxes. Build a DoubleMatArrayParam object out of them: */ 154 154 iomodel->FetchData(&array,&mdims_array,&ndims_array,&qmu_mass_flux_num_profiles,QmuMassFluxSegmentsEnum); 155 if(qmu_mass_flux_num_profiles==0)_error 2_("qmu_mass_flux_num_profiles is 0, when MassFlux computations were requested!");155 if(qmu_mass_flux_num_profiles==0)_error_("qmu_mass_flux_num_profiles is 0, when MassFlux computations were requested!"); 156 156 157 157 /*Go through segments, and extract those that belong to this cpu: */ -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp
r12878 r13101 16 16 int i,j; 17 17 int count; 18 double yts;19 double g;20 double rho_ice;21 double stokesreconditioning;22 bool isstokes,is macayealpattyn;18 IssmDouble yts; 19 IssmDouble g; 20 IssmDouble rho_ice; 21 IssmDouble stokesreconditioning; 22 bool isstokes,isl1l2,ismacayealpattyn; 23 23 bool spcpresent=false; 24 24 int Mx,Nx; 25 25 int My,Ny; 26 26 int Mz,Nz; 27 double *spcvx = NULL;28 double *spcvy = NULL;29 double *spcvz = NULL;30 double *nodeonmacayeal = NULL;31 double *nodeonpattyn = NULL;32 double *nodeonstokes = NULL;33 double *nodeonbed = NULL;34 double *nodeonicesheet = NULL;35 double *vertices_type = NULL;36 double *surface = NULL;37 double *z = NULL;38 double *timesx=NULL;39 double *timesy=NULL;40 double *timesz=NULL;41 double* values=NULL;27 IssmDouble *spcvx = NULL; 28 IssmDouble *spcvy = NULL; 29 IssmDouble *spcvz = NULL; 30 IssmDouble *nodeonmacayeal = NULL; 31 IssmDouble *nodeonpattyn = NULL; 32 IssmDouble *nodeonstokes = NULL; 33 IssmDouble *nodeonbed = NULL; 34 IssmDouble *nodeonicesheet = NULL; 35 IssmDouble *vertices_type = NULL; 36 IssmDouble *surface = NULL; 37 IssmDouble *z = NULL; 38 IssmDouble *timesx=NULL; 39 IssmDouble *timesy=NULL; 40 IssmDouble *timesz=NULL; 41 IssmDouble* values=NULL; 42 42 43 43 /*Output*/ … … 56 56 iomodel->Constant(&stokesreconditioning,DiagnosticStokesreconditioningEnum); 57 57 iomodel->Constant(&isstokes,FlowequationIsstokesEnum); 58 iomodel->Constant(&isl1l2,FlowequationIsl1l2Enum); 58 59 iomodel->Constant(&ismacayealpattyn,FlowequationIsmacayealpattynEnum); 59 60 … … 65 66 66 67 /*Now, is the flag macayaealpattyn on? otherwise, do nothing: */ 67 if (!ismacayealpattyn & !isstokes){68 if(!ismacayealpattyn & !isstokes & !isl1l2){ 68 69 *pconstraints=constraints; 69 70 return; … … 87 88 88 89 /*figure out times: */ 89 timesx=xNew< double>(Nx);90 timesx=xNew<IssmDouble>(Nx); 90 91 for(j=0;j<Nx;j++){ 91 92 timesx[j]=spcvx[(Mx-1)*Nx+j]; … … 94 95 UnitConversion(timesx,Nx,ExtToIuEnum,TimeEnum); 95 96 /*figure out times: */ 96 timesy=xNew< double>(Ny);97 timesy=xNew<IssmDouble>(Ny); 97 98 for(j=0;j<Ny;j++){ 98 99 timesy[j]=spcvy[(My-1)*Ny+j]; … … 101 102 UnitConversion(timesy,Ny,ExtToIuEnum,TimeEnum); 102 103 /*figure out times: */ 103 timesz=xNew< double>(Nz);104 timesz=xNew<IssmDouble>(Nz); 104 105 for(j=0;j<Nz;j++){ 105 106 timesz[j]=spcvz[(Mz-1)*Nz+j]; … … 113 114 114 115 /*Start with adding spcs of coupling: zero at the border macayeal/pattyn for the appropriate dofs*/ 115 if ( (int)vertices_type[i]==MacAyealPattynApproximationEnum){116 if (reCast<int,IssmDouble>(vertices_type[i]==MacAyealPattynApproximationEnum)){ 116 117 /*If grionmacayeal, spc pattyn dofs: 3 & 4*/ 117 if ( (int)nodeonpattyn[i]){118 if (reCast<int,IssmDouble>(nodeonpattyn[i])){ 118 119 constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx. 119 120 count++; … … 130 131 131 132 } 132 else if ( (int)nodeonmacayeal[i]){133 else if (reCast<int,IssmDouble>(nodeonmacayeal[i])){ 133 134 constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx. 134 135 count++; … … 145 146 146 147 } 147 else _error 2_("if vertices_type is MacAyealPattyn, you shoud have nodeonpattyn or nodeonmacayeal");148 else _error_("if vertices_type is MacAyealPattyn, you shoud have nodeonpattyn or nodeonmacayeal"); 148 149 } 149 150 /*Also add spcs of coupling: zero at the border pattyn/stokes for the appropriate dofs*/ 150 else if ( (int)vertices_type[i]==PattynStokesApproximationEnum){151 else if (reCast<int,IssmDouble>(vertices_type[i])==PattynStokesApproximationEnum){ 151 152 /*If grion,pattyn spc stokes dofs: 3 4 & 5*/ 152 if ( (int)nodeonpattyn[i]){153 if (reCast<int,IssmDouble>(nodeonpattyn[i])){ 153 154 constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx. 154 155 count++; … … 167 168 168 169 } 169 else if ( (int)nodeonstokes[i]){ //spc pattyn nodes: 1 & 2170 else if (reCast<int,IssmDouble>(nodeonstokes[i])){ //spc pattyn nodes: 1 & 2 170 171 constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx. 171 172 count++; … … 185 186 } 186 187 } 187 else _error 2_("if vertices_type is PattynStokes, you shoud have nodeonpattyn or nodeonstokes");188 else _error_("if vertices_type is PattynStokes, you shoud have nodeonpattyn or nodeonstokes"); 188 189 } 189 190 /*Also add spcs of coupling: zero at the border pattyn/stokes for the appropriate dofs*/ 190 else if ( (int)vertices_type[i]==MacAyealStokesApproximationEnum){191 else if (reCast<int,IssmDouble>(vertices_type[i])==MacAyealStokesApproximationEnum){ 191 192 /*If grion,pattyn spc stokes dofs: 3 4 & 5*/ 192 if ( (int)nodeonmacayeal[i]){193 if (reCast<int,IssmDouble>(nodeonmacayeal[i])){ 193 194 constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx. 194 195 count++; … … 207 208 208 209 } 209 else if ( (int)nodeonstokes[i]){ //spc macayeal nodes: 1 & 2210 else if (reCast<int,IssmDouble>(nodeonstokes[i])){ //spc macayeal nodes: 1 & 2 210 211 constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx. 211 212 count++; … … 225 226 } 226 227 } 227 else _error 2_("if vertices_type is MacAyealStokes, you shoud have nodeonmacayeal or nodeonstokes");228 else _error_("if vertices_type is MacAyealStokes, you shoud have nodeonmacayeal or nodeonstokes"); 228 229 } 229 230 /*Now add the regular spcs*/ … … 235 236 else if (Mx==numberofvertices+1) { 236 237 /*figure out times and values: */ 237 values=xNew< double>(Nx);238 values=xNew<IssmDouble>(Nx); 238 239 spcpresent=false; 239 240 for(j=0;j<Nx;j++){ … … 246 247 count++; 247 248 } 248 xDelete< double>(values);249 xDelete<IssmDouble>(values); 249 250 } 250 251 else if (vertices_type[i]==HutterApproximationEnum){ … … 259 260 else if (My==numberofvertices+1){ 260 261 /*figure out times and values: */ 261 values=xNew< double>(Ny);262 values=xNew<IssmDouble>(Ny); 262 263 spcpresent=false; 263 264 for(j=0;j<Ny;j++){ … … 269 270 count++; 270 271 } 271 xDelete< double>(values);272 xDelete<IssmDouble>(values); 272 273 } 273 274 else if (vertices_type[i]==HutterApproximationEnum){ … … 276 277 } 277 278 278 if ( (int)vertices_type[i]==StokesApproximationEnum || ((int)vertices_type[i]==NoneApproximationEnum)){279 if (reCast<int,IssmDouble>(vertices_type[i])==StokesApproximationEnum || (reCast<int,IssmDouble>(vertices_type[i])==NoneApproximationEnum)){ 279 280 if (Mz==numberofvertices && !xIsNan<IssmDouble>(spcvz[i])){ 280 281 constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,spcvz[i]/yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 2 to vy … … 283 284 else if (Mz==numberofvertices+1){ 284 285 /*figure out times and values: */ 285 values=xNew< double>(Nz);286 values=xNew<IssmDouble>(Nz); 286 287 spcpresent=false; 287 288 for(j=0;j<Nz;j++){ … … 293 294 count++; 294 295 } 295 xDelete< double>(values);296 } 297 298 } 299 if ( (int)vertices_type[i]==NoneApproximationEnum){296 xDelete<IssmDouble>(values); 297 } 298 299 } 300 if (reCast<int,IssmDouble>(vertices_type[i])==NoneApproximationEnum){ 300 301 constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,4,g*rho_ice*(surface[i]-z[i])/stokesreconditioning,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 2 to vy 301 302 count++; … … 304 305 305 306 /*Constraint at the bedrock interface (v.n = vz = 0) (Coordinates will be updated according to the bed slope)*/ 306 if (dim==3) if( nodeonbed[i] && nodeonicesheet[i] && nodeonstokes[i]){307 switch( (int)vertices_type[i]){307 if (dim==3) if(reCast<int,IssmDouble>(nodeonbed[i]) && reCast<int,IssmDouble>(nodeonicesheet[i]) && reCast<int,IssmDouble>(nodeonstokes[i])){ 308 switch(reCast<int,IssmDouble>(vertices_type[i])){ 308 309 case MacAyealStokesApproximationEnum: 309 310 constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,5,0.,DiagnosticHorizAnalysisEnum)); … … 318 319 count++; 319 320 break; 320 default: _error 2_("Vertex approximation " << EnumToStringx((int)vertices_type[i]) << " not supported");321 default: _error_("Vertex approximation " << EnumToStringx(reCast<int,IssmDouble>(vertices_type[i])) << " not supported"); 321 322 } 322 323 } … … 325 326 326 327 /*Free data: */ 327 xDelete< double>(spcvx);328 xDelete< double>(spcvy);329 xDelete< double>(spcvz);330 xDelete< double>(nodeonmacayeal);331 xDelete< double>(nodeonpattyn);332 xDelete< double>(nodeonstokes);333 xDelete< double>(nodeonicesheet);334 xDelete< double>(nodeonbed);335 xDelete< double>(vertices_type);336 xDelete< double>(surface);337 xDelete< double>(z);328 xDelete<IssmDouble>(spcvx); 329 xDelete<IssmDouble>(spcvy); 330 xDelete<IssmDouble>(spcvz); 331 xDelete<IssmDouble>(nodeonmacayeal); 332 xDelete<IssmDouble>(nodeonpattyn); 333 xDelete<IssmDouble>(nodeonstokes); 334 xDelete<IssmDouble>(nodeonicesheet); 335 xDelete<IssmDouble>(nodeonbed); 336 xDelete<IssmDouble>(vertices_type); 337 xDelete<IssmDouble>(surface); 338 xDelete<IssmDouble>(z); 338 339 339 340 /*Free resources:*/ 340 xDelete< double>(timesx);341 xDelete< double>(timesy);342 xDelete< double>(timesz);343 xDelete< double>(values);341 xDelete<IssmDouble>(timesx); 342 xDelete<IssmDouble>(timesy); 343 xDelete<IssmDouble>(timesz); 344 xDelete<IssmDouble>(values); 344 345 345 346 /*Assign output pointer: */ -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp
r12878 r13101 27 27 int dim; 28 28 int numberofvertices; 29 bool ismacayealpattyn,isstokes ;29 bool ismacayealpattyn,isstokes,isl1l2; 30 30 int numpenalties,numberofpressureloads,numrifts,numriftsegments; 31 double *pressureload = NULL;32 double *elements_type = NULL;33 double *nodeoniceshelf = NULL;34 double *riftinfo = NULL;35 double *nodeonbed = NULL;36 double *nodeonstokes = NULL;37 double *nodeonicesheet = NULL;38 double *vertices_type = NULL;39 double *penalties = NULL;31 IssmDouble *pressureload = NULL; 32 IssmDouble *elements_type = NULL; 33 IssmDouble *nodeoniceshelf = NULL; 34 IssmDouble *riftinfo = NULL; 35 IssmDouble *nodeonbed = NULL; 36 IssmDouble *nodeonstokes = NULL; 37 IssmDouble *nodeonicesheet = NULL; 38 IssmDouble *vertices_type = NULL; 39 IssmDouble *penalties = NULL; 40 40 41 41 /*Fetch parameters: */ 42 42 iomodel->Constant(&dim,MeshDimensionEnum); 43 43 iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum); 44 iomodel->Constant(&isl1l2,FlowequationIsl1l2Enum); 44 45 iomodel->Constant(&isstokes,FlowequationIsstokesEnum); 45 46 iomodel->Constant(&ismacayealpattyn,FlowequationIsmacayealpattynEnum); … … 53 54 54 55 /*Now, is the flag macayaealpattyn on? otherwise, do nothing: */ 55 if (!ismacayealpattyn & !isstokes){56 if(!ismacayealpattyn & !isstokes & !isl1l2){ 56 57 *ploads=loads; 57 58 return; … … 73 74 if (dim==2) segment_width=4; 74 75 else segment_width=6; 75 element= (int)(*(pressureload+segment_width*i+segment_width-2)-1); //element is in the penultimate column (node1 node2 ... elem fill)76 element=reCast<int,IssmDouble>(*(pressureload+segment_width*i+segment_width-2)-1); //element is in the penultimate column (node1 node2 ... elem fill) 76 77 77 78 /*Now, if this element is not in the partition, pass: */ … … 79 80 80 81 /*Do not create ice front if Hutter or Stokes elements*/ 81 if ( (int)*(elements_type+element)==HutterApproximationEnum) continue;82 if (reCast<int,IssmDouble>(*(elements_type+element))==HutterApproximationEnum) continue; 82 83 83 84 /*Create and add load: */ 84 if ( (int)*(elements_type+element)==(MacAyealApproximationEnum) && dim==2){85 if (reCast<int,IssmDouble>(*(elements_type+element))==(MacAyealApproximationEnum) && dim==2){ 85 86 loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,MacAyeal2dIceFrontEnum,DiagnosticHorizAnalysisEnum)); 86 87 count++; 87 88 } 88 else if ( (int)*(elements_type+element)==(MacAyealApproximationEnum) && dim==3){89 else if (reCast<int,IssmDouble>(*(elements_type+element))==(MacAyealApproximationEnum) && dim==3){ 89 90 loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,MacAyeal3dIceFrontEnum,DiagnosticHorizAnalysisEnum)); 90 91 count++; 91 92 } 92 else if ((int)*(elements_type+element)==(PattynApproximationEnum)){ 93 else if (reCast<int,IssmDouble>(*(elements_type+element))==(L1L2ApproximationEnum)){ 94 loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,MacAyeal3dIceFrontEnum,DiagnosticHorizAnalysisEnum)); 95 count++; 96 } 97 else if (reCast<int,IssmDouble>(*(elements_type+element))==(PattynApproximationEnum)){ 93 98 loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,PattynIceFrontEnum,DiagnosticHorizAnalysisEnum)); 94 99 count++; 95 100 } 96 else if ((int)*(elements_type+element)==(StokesApproximationEnum)){ 101 else if (reCast<int,IssmDouble>(*(elements_type+element))==(L1L2ApproximationEnum)){ 102 loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,L1L2IceFrontEnum,DiagnosticHorizAnalysisEnum)); 103 count++; 104 } 105 else if (reCast<int,IssmDouble>(*(elements_type+element))==(StokesApproximationEnum)){ 97 106 loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,StokesIceFrontEnum,DiagnosticHorizAnalysisEnum)); 98 107 count++; 99 108 } 100 else if ( (int)*(elements_type+element)==(MacAyealPattynApproximationEnum)){109 else if (reCast<int,IssmDouble>(*(elements_type+element))==(MacAyealPattynApproximationEnum)){ 101 110 loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,MacAyeal3dIceFrontEnum,DiagnosticHorizAnalysisEnum)); 102 111 count++; … … 104 113 count++; 105 114 } 106 else if ( (int)*(elements_type+element)==(PattynStokesApproximationEnum)){115 else if (reCast<int,IssmDouble>(*(elements_type+element))==(PattynStokesApproximationEnum)){ 107 116 loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,PattynIceFrontEnum,DiagnosticHorizAnalysisEnum)); 108 117 count++; … … 110 119 count++; 111 120 } 112 else if ( (int)*(elements_type+element)==(MacAyealStokesApproximationEnum)){121 else if (reCast<int,IssmDouble>(*(elements_type+element))==(MacAyealStokesApproximationEnum)){ 113 122 loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,MacAyeal3dIceFrontEnum,DiagnosticHorizAnalysisEnum)); 114 123 count++; … … 120 129 /*Free data: */ 121 130 iomodel->DeleteData(3,DiagnosticIcefrontEnum,ThicknessEnum,BedEnum); 122 xDelete< double>(elements_type);123 xDelete< double>(pressureload);131 xDelete<IssmDouble>(elements_type); 132 xDelete<IssmDouble>(pressureload); 124 133 125 134 /*Create Penpair for penalties: */ … … 128 137 for(i=0;i<numpenalties;i++){ 129 138 130 if(iomodel->my_vertices[ (int)penalties[2*i+0]-1]){139 if(iomodel->my_vertices[reCast<int,IssmDouble>(penalties[2*i+0]-1)]){ 131 140 132 141 /*In debugging mode, check that the second node is in the same cpu*/ … … 134 143 135 144 /*Get node ids*/ 136 penpair_ids[0]=iomodel->nodecounter+ (int)penalties[2*i+0];137 penpair_ids[1]=iomodel->nodecounter+ (int)penalties[2*i+1];145 penpair_ids[0]=iomodel->nodecounter+reCast<int,IssmDouble>(penalties[2*i+0]); 146 penpair_ids[1]=iomodel->nodecounter+reCast<int,IssmDouble>(penalties[2*i+1]); 138 147 139 148 /*Create Load*/ … … 144 153 145 154 /*free ressources: */ 146 xDelete< double>(penalties);155 xDelete<IssmDouble>(penalties); 147 156 148 157 /*Create Riffront loads for rifts: */ … … 151 160 iomodel->FetchData(5,RiftsRiftstructEnum,ThicknessEnum,BedEnum,SurfaceEnum,MaskVertexonfloatingiceEnum); 152 161 for(i=0;i<numriftsegments;i++){ 153 if(iomodel->my_elements[ (int)*(riftinfo+RIFTINFOSIZE*i+2)-1]){162 if(iomodel->my_elements[reCast<int,IssmDouble>(*(riftinfo+RIFTINFOSIZE*i+2))-1]){ 154 163 loads->AddObject(new Riftfront(iomodel->loadcounter+count+1,i,iomodel,DiagnosticHorizAnalysisEnum)); 155 164 count++; -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp
r12878 r13101 19 19 bool continuous_galerkin=true; 20 20 int numberofvertices; 21 bool isstokes,is macayealpattyn;21 bool isstokes,isl1l2,ismacayealpattyn; 22 22 23 23 /*DataSets: */ … … 27 27 iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum); 28 28 iomodel->Constant(&isstokes,FlowequationIsstokesEnum); 29 iomodel->Constant(&isl1l2,FlowequationIsl1l2Enum); 29 30 iomodel->Constant(&ismacayealpattyn,FlowequationIsmacayealpattynEnum); 30 31 … … 36 37 37 38 /*Now, is the flag macayaealpattyn on? otherwise, do nothing: */ 38 if(!ismacayealpattyn & !isstokes ){39 if(!ismacayealpattyn & !isstokes & !isl1l2){ 39 40 *pnodes=nodes; 40 41 return; -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp
r12878 r13101 19 19 int numberofelements; 20 20 bool ismacayealpattyn; 21 bool isl1l2; 21 22 bool isstokes; 22 23 bool control_analysis; … … 25 26 /*Fetch constants needed: */ 26 27 iomodel->Constant(&isstokes,FlowequationIsstokesEnum); 28 iomodel->Constant(&isl1l2,FlowequationIsl1l2Enum); 27 29 iomodel->Constant(&ismacayealpattyn,FlowequationIsmacayealpattynEnum); 28 30 iomodel->Constant(&dim,MeshDimensionEnum); … … 32 34 33 35 /*Now, is the flag macayaealpattyn on? otherwise, do nothing: */ 34 if(!ismacayealpattyn & !isstokes ) return;36 if(!ismacayealpattyn & !isstokes &!isl1l2) return; 35 37 36 38 /*Fetch data needed: */ -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp
r12878 r13101 16 16 int i; 17 17 int count; 18 double yts;18 IssmDouble yts; 19 19 int numberofvertices; 20 20 bool ishutter; … … 51 51 /*keep only this partition's nodes:*/ 52 52 if((iomodel->my_vertices[i])){ 53 if (! (int)iomodel->Data(FlowequationVertexEquationEnum)[i]==HutterApproximationEnum){53 if (!reCast<int,IssmDouble>(iomodel->Data(FlowequationVertexEquationEnum)[i])==HutterApproximationEnum){ 54 54 55 55 constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,DiagnosticHutterAnalysisEnum)); -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp
r12878 r13101 17 17 int dim; 18 18 int count; 19 double yts;19 IssmDouble yts; 20 20 int numberofvertices; 21 21 … … 52 52 if(iomodel->my_vertices[i]){ 53 53 54 if ( (int)iomodel->Data(FlowequationBorderstokesEnum)[i]){54 if (reCast<int,IssmDouble>(iomodel->Data(FlowequationBorderstokesEnum)[i])){ 55 55 constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,DiagnosticVertAnalysisEnum)); //spc to zero as vertical velocity is done in Horiz for Stokes 56 56 count++; -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp
r12878 r13101 19 19 if (analysis_type==DiagnosticHorizAnalysisEnum){ 20 20 if (vertices_type[0]==MacAyealApproximationEnum){ 21 numdofs=2; 22 } 23 else if (vertices_type[0]==L1L2ApproximationEnum){ 21 24 numdofs=2; 22 25 } … … 61 64 doftype[5]=StokesApproximationEnum; 62 65 } 63 else _error 2_("Approximationtype " << reCast<int>(*vertices_type) << " (" << EnumToStringx(reCast<int>(*vertices_type)) << ") not implemented yet for DiagnosticHoriz");66 else _error_("Approximationtype " << reCast<int>(*vertices_type) << " (" << EnumToStringx(reCast<int>(*vertices_type)) << ") not implemented yet for DiagnosticHoriz"); 64 67 } 65 68 else if (analysis_type==DiagnosticVertAnalysisEnum){ … … 90 93 numdofs=1; 91 94 } 92 else _error 2_("analysis type: " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not implemented yet");95 else _error_("analysis type: " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not implemented yet"); 93 96 94 97 /*Now initialize the index*/ -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp
r12878 r13101 21 21 int numberofvertices; 22 22 bool spcpresent=false; 23 double heatcapacity;24 double referencetemperature;23 IssmDouble heatcapacity; 24 IssmDouble referencetemperature; 25 25 26 26 /*Output*/ … … 106 106 } 107 107 else{ 108 _error 2_("Size of field " << EnumToStringx(ThermalSpctemperatureEnum) << " not supported");108 _error_("Size of field " << EnumToStringx(ThermalSpctemperatureEnum) << " not supported"); 109 109 } 110 110 -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp
r12878 r13101 26 26 27 27 /*if 2d: Error*/ 28 if (dim==2) _error 2_("2d meshes not supported yet");28 if (dim==2) _error_("2d meshes not supported yet"); 29 29 30 30 /*Recover pointer: */ … … 40 40 for (i=0;i<numberofvertices;i++){ 41 41 if((iomodel->my_vertices[i]==1)){ 42 if ( iomodel->Data(MeshVertexonbedEnum)[i]){42 if (reCast<int>(iomodel->Data(MeshVertexonbedEnum)[i])){ 43 43 loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,MeltingAnalysisEnum)); 44 44 } -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/NodesPartitioning.cpp
r12878 r13101 103 103 } 104 104 else{ 105 _error 2_("not implemented yet");105 _error_("not implemented yet"); 106 106 } 107 107 … … 111 111 iomodel->FetchData(&edges,&numberofedges,&cols,MeshEdgesEnum); 112 112 iomodel->FetchData(&elements,NULL,NULL,MeshElementsEnum); 113 if (cols!=4) _error 2_("field edges should have 4 columns");113 if (cols!=4) _error_("field edges should have 4 columns"); 114 114 115 115 /*!All elements have been partitioned above, only create elements for this CPU: */ … … 152 152 } 153 153 else{ 154 _error 2_("Problem in edges creation");154 _error_("Problem in edges creation"); 155 155 } 156 156 } -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp
r12878 r13101 46 46 47 47 /*Check in 3d*/ 48 if(stabilization==3 && dim==3) _error 2_("DG 3d not implemented yet");48 if(stabilization==3 && dim==3) _error_("DG 3d not implemented yet"); 49 49 50 50 /*First fetch data: */ -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp
r12878 r13101 23 23 bool ispdd; 24 24 bool isdelta18o; 25 IssmDouble *size, Delta18oTimeSerie,Delta18oSurfaceTimeSerie ;26 25 27 26 /*Fetch data needed: */ -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp
r12878 r13101 33 33 34 34 /*return if 2d mesh*/ 35 if (dim==2) _error 2_("2d meshes not supported yet");35 if (dim==2) _error_("2d meshes not supported yet"); 36 36 37 37 //create penalties for nodes: no node can have a temperature over the melting point -
issm/branches/trunk-jpl-damage/src/c/modules/NodalValuex/NodalValuex.cpp
r12878 r13101 38 38 #ifdef _HAVE_MPI_ 39 39 MPI_Allreduce ( &found,&sumfound,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD); 40 if(!sumfound)_error 2_("could not find element with vertex with id" << index << " to compute nodal value " << EnumToStringx(natureofdataenum));40 if(!sumfound)_error_("could not find element with vertex with id" << index << " to compute nodal value " << EnumToStringx(natureofdataenum)); 41 41 #endif 42 42 -
issm/branches/trunk-jpl-damage/src/c/modules/NodeConnectivityx/NodeConnectivityx.cpp
r12878 r13101 71 71 * warn the user to increase the connectivity width: */ 72 72 for(i=0;i<nods;i++){ 73 if (*(connectivity+width*i+maxels)>maxels)_error 2_("max connectivity width reached (" << *(connectivity+width*i+maxels) << ")! increase width of connectivity table");73 if (*(connectivity+width*i+maxels)>maxels)_error_("max connectivity width reached (" << *(connectivity+width*i+maxels) << ")! increase width of connectivity table"); 74 74 } 75 75 -
issm/branches/trunk-jpl-damage/src/c/modules/Orthx/Orthx.cpp
r11708 r13101 11 11 12 12 /*intermediary:*/ 13 double norm_new,norm_old,dot_product;;13 IssmDouble norm_new,norm_old,dot_product;; 14 14 15 15 /*Initialize output*/ -
issm/branches/trunk-jpl-damage/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp
r12878 r13101 106 106 char* string=strings[i]; 107 107 if(my_rank==0){ 108 if(string==NULL) _error 2_("PETSc options for analysis " << EnumToStringx(reCast<int>(analyses[i])) << " have been declared but were not found");108 if(string==NULL) _error_("PETSc options for analysis " << EnumToStringx(reCast<int>(analyses[i])) << " have been declared but were not found"); 109 109 } 110 110 if(my_rank==0)stringlength=(strlen(string)+1)*sizeof(char); -
issm/branches/trunk-jpl-damage/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp
r12878 r13101 30 30 * management routine, otherwise, skip : */ 31 31 if (RiftIsPresent(loads,analysis_type)){ 32 _error 2_("rift constraints reset not supported yet!");32 _error_("rift constraints reset not supported yet!"); 33 33 } 34 34 else if(ThermalIsPresent(loads,analysis_type)){ -
issm/branches/trunk-jpl-damage/src/c/modules/Responsex/Responsex.cpp
r12946 r13101 49 49 case VelEnum:ElementResponsex(responses, elements,nodes, vertices, loads, materials, parameters,VelEnum,process_units); break; 50 50 case FrictionCoefficientEnum:NodalValuex(responses, FrictionCoefficientEnum,elements,nodes, vertices, loads, materials, parameters,process_units); break; 51 default: _error 2_("response descriptor \"" << response_descriptor << "\" not supported yet!"); break;51 default: _error_("response descriptor \"" << response_descriptor << "\" not supported yet!"); break; 52 52 #else 53 default: _error 2_("ISSM was not compiled with responses capabilities, exiting!");53 default: _error_("ISSM was not compiled with responses capabilities, exiting!"); 54 54 #endif 55 55 } -
issm/branches/trunk-jpl-damage/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp
r12168 r13101 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void RheologyBbarAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){12 void RheologyBbarAbsGradientx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){ 13 13 14 14 /*Intermediary*/ … … 17 17 18 18 /*output: */ 19 double J=0;20 double J_sum;19 IssmDouble J=0; 20 IssmDouble J_sum; 21 21 22 22 /*Compute Misfit: */ -
issm/branches/trunk-jpl-damage/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void RheologyBbarAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);12 void RheologyBbarAbsGradientx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index); 13 13 14 14 #endif -
issm/branches/trunk-jpl-damage/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp
r12878 r13101 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, double* vector){11 void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,IssmDouble* vector){ 12 12 13 13 int num_controls; … … 30 30 void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* vector){ 31 31 32 double* serial_vector=NULL;32 IssmDouble* serial_vector=NULL; 33 33 34 34 serial_vector=vector->ToMPISerial(); … … 37 37 38 38 /*Free ressources:*/ 39 xDelete< double>(serial_vector);39 xDelete<IssmDouble>(serial_vector); 40 40 } -
issm/branches/trunk-jpl-damage/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h
r12878 r13101 10 10 /* local prototypes: */ 11 11 void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vector* vector); 12 void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters, double* vector);12 void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,IssmDouble* vector); 13 13 14 14 #endif -
issm/branches/trunk-jpl-damage/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp
r12878 r13101 75 75 76 76 hSHP = SHPOpen( filshp, "rb" ); 77 if (!hSHP) _error 2_("Error opening shp/shx files.");77 if (!hSHP) _error_("Error opening shp/shx files."); 78 78 79 79 /* read header and print out file bounds */ -
issm/branches/trunk-jpl-damage/src/c/modules/Solverx/Solverx.cpp
r12946 r13101 44 44 break;} 45 45 default: 46 _error 2_("Matrix type: " << Kff->type << " not supported yet!");46 _error_("Matrix type: " << Kff->type << " not supported yet!"); 47 47 } 48 48 -
issm/branches/trunk-jpl-damage/src/c/modules/Solverx/Solverx.h
r12878 r13101 25 25 void SolverxSeq(SeqVec** puf,SeqMat* Kff, SeqVec* pf); 26 26 void SolverxSeq(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n); 27 void SolverxSeq(double** pX,double* A,double* B,int n); 27 28 28 29 #endif /* _SOLVERX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/Solverx/SolverxPetsc.cpp
r12878 r13101 96 96 #if _PETSC_MAJOR_ >=3 97 97 #ifndef _HAVE_MUMPS_ 98 _error 2_("requested MUMPS solver, which was not compiled into ISSM!\n");98 _error_("requested MUMPS solver, which was not compiled into ISSM!\n"); 99 99 #endif 100 100 #endif … … 120 120 if (solver_type==StokesSolverEnum){ 121 121 /*Make indices out of doftypes: */ 122 if(!df)_error 2_("need doftypes for Stokes solver!\n");122 if(!df)_error_("need doftypes for Stokes solver!\n"); 123 123 DofTypesToIndexSet(&isv,&isp,df,StokesSolverEnum); 124 124 … … 151 151 /*Check convergence*/ 152 152 KSPGetIterationNumber(ksp,&iteration_number); 153 if (iteration_number<0) _error 2_("Solver diverged at iteration number: " << -iteration_number);153 if (iteration_number<0) _error_("Solver diverged at iteration number: " << -iteration_number); 154 154 155 155 /*Free resources:*/ -
issm/branches/trunk-jpl-damage/src/c/modules/Solverx/SolverxSeq.cpp
r12878 r13101 30 30 pf->GetSize(&N2); 31 31 32 if(N!=N2)_error 2_("Right hand side vector of size " << N2 << ", when matrix is of size " << M << "-" << N << " !");33 if(M!=N)_error 2_("Stiffness matrix should be square!");32 if(N!=N2)_error_("Right hand side vector of size " << N2 << ", when matrix is of size " << M << "-" << N << " !"); 33 if(M!=N)_error_("Stiffness matrix should be square!"); 34 34 35 35 SolverxSeq(&x,Kff->matrix,pf->vector,N); … … 40 40 41 41 #else 42 _error 2_("GSL support not compiled in!");42 _error_("GSL support not compiled in!"); 43 43 #endif 44 44 45 45 }/*}}}*/ 46 void SolverxSeq(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n){/*{{{*/ 46 #ifdef _HAVE_ADOLC_ 47 void SolverxSeq(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n){//{{{ 48 /* if we use Adol-C then the IssmDouble will be an adouble 49 and the calls to gsl_... will not work. 50 We therefore call a wrapped solver instead. 51 */ 47 52 53 /*Output: */ 54 IssmDouble* X=NULL; 55 56 /*Intermediary: */ 57 int i; 58 IssmPDouble* pdoubleA=NULL; 59 IssmPDouble* pdoubleB=NULL; 60 IssmPDouble* pdoubleX=NULL; 61 62 /*First, transfer from IssmDouble to double all our matrices and vectors: */ 63 pdoubleA=xNew<double>(n*n); 64 pdoubleB=xNew<double>(n); 65 for(i=0;i<n*n;i++)pdoubleA[i]=reCast<IssmPDouble>(A[i]); 66 for(i=0;i<n;i++)pdoubleB[i]=reCast<IssmPDouble>(B[i]); 67 68 /*Call wrapped solver: */ 69 SolverxSeq(&pdoubleX,pdoubleA, pdoubleB, n); 70 71 /*Transfer solution vector from double to IssmDouble: */ 72 X = xNew<IssmDouble>(n); 73 for(i=0;i<n;i++)X[i]=reCast<IssmDouble>(pdoubleX[i]); 74 75 /*Free ressources:*/ 76 xDelete<IssmPDouble>(pdoubleA); 77 xDelete<IssmPDouble>(pdoubleB); 78 79 /*Assign output pointers: */ 80 *pX=X; 81 } 82 /*}}}*/ 83 #endif 84 void SolverxSeq(IssmPDouble** pX,IssmPDouble* A,IssmPDouble* B,int n){ //{{{ 48 85 #ifdef _HAVE_GSL_ 49 /*GSL Matrices and vectors: */ 50 int s; 51 gsl_matrix_view a; 52 gsl_vector_view b; 53 gsl_vector *x = NULL; 54 gsl_permutation *p = NULL; 55 #ifdef _HAVE_ADOLC_ 56 // if we use Adol-C then the IssmDouble will be an adouble 57 // and the calls to gsl_... will not work 58 // and we should call a suitable wrapped solve instead 59 _error2_("SolverxSeq: should not be here with Adol-C"); 60 #else 61 /*A will be modified by LU decomposition. Use copy*/ 62 IssmDouble* Acopy = xNew<IssmDouble>(n*n); 63 xMemCpy<IssmDouble>(Acopy,A,n*n); 86 /*GSL Matrices and vectors: */ 87 int s; 88 gsl_matrix_view a; 89 gsl_vector_view b; 90 gsl_vector *x = NULL; 91 gsl_permutation *p = NULL; 92 /*A will be modified by LU decomposition. Use copy*/ 93 double* Acopy = xNew<double>(n*n); 94 xMemCpy<double>(Acopy,A,n*n); 64 95 65 66 67 68 96 /*Initialize gsl matrices and vectors: */ 97 a = gsl_matrix_view_array (Acopy,n,n); 98 b = gsl_vector_view_array (B,n); 99 x = gsl_vector_alloc (n); 69 100 70 71 72 73 101 /*Run LU and solve: */ 102 p = gsl_permutation_alloc (n); 103 gsl_linalg_LU_decomp (&a.matrix, p, &s); 104 gsl_linalg_LU_solve (&a.matrix, p, &b.vector, x); 74 105 75 76 106 //printf ("x = \n"); 107 //gsl_vector_fprintf (stdout, x, "%g"); 77 108 78 79 IssmDouble* X = xNew<IssmDouble>(n);80 memcpy(X,gsl_vector_ptr(x,0),n*sizeof(IssmDouble));109 /*Copy result*/ 110 double* X = xNew<double>(n); 111 memcpy(X,gsl_vector_ptr(x,0),n*sizeof(double)); 81 112 82 /*Clean up and assign output pointer*/ 83 xDelete<IssmDouble>(Acopy); 84 gsl_permutation_free(p); 85 gsl_vector_free(x); 86 *pX=X; 87 #endif 113 /*Clean up and assign output pointer*/ 114 xDelete<double>(Acopy); 115 gsl_permutation_free(p); 116 gsl_vector_free(x); 117 *pX=X; 88 118 #endif 89 }/*}}}*/ 119 } 120 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/modules/StringToEnumx/StringToEnumx.cpp
r12946 r13101 18 18 19 19 if(stage==1){ 20 if (strcmp(name,"AutodiffForward")==0) return AutodiffForwardEnum; 21 else if (strcmp(name,"AutodiffIsautodiff")==0) return AutodiffIsautodiffEnum; 22 else if (strcmp(name,"AutodiffReverse")==0) return AutodiffReverseEnum; 20 if (strcmp(name,"AutodiffIsautodiff")==0) return AutodiffIsautodiffEnum; 23 21 else if (strcmp(name,"BalancethicknessSpcthickness")==0) return BalancethicknessSpcthicknessEnum; 24 22 else if (strcmp(name,"BalancethicknessStabilization")==0) return BalancethicknessStabilizationEnum; … … 56 54 else if (strcmp(name,"FlowequationElementEquation")==0) return FlowequationElementEquationEnum; 57 55 else if (strcmp(name,"FlowequationIshutter")==0) return FlowequationIshutterEnum; 56 else if (strcmp(name,"FlowequationIsl1l2")==0) return FlowequationIsl1l2Enum; 58 57 else if (strcmp(name,"FlowequationIsmacayealpattyn")==0) return FlowequationIsmacayealpattynEnum; 59 58 else if (strcmp(name,"FlowequationIsstokes")==0) return FlowequationIsstokesEnum; … … 138 137 else if (strcmp(name,"MiscellaneousName")==0) return MiscellaneousNameEnum; 139 138 else if (strcmp(name,"PrognosticHydrostaticAdjustment")==0) return PrognosticHydrostaticAdjustmentEnum; 139 else if (strcmp(name,"PrognosticMinThickness")==0) return PrognosticMinThicknessEnum; 140 140 else stage=2; 141 141 } 142 142 if(stage==2){ 143 if (strcmp(name,"PrognosticMinThickness")==0) return PrognosticMinThicknessEnum; 144 else if (strcmp(name,"PrognosticPenaltyFactor")==0) return PrognosticPenaltyFactorEnum; 143 if (strcmp(name,"PrognosticPenaltyFactor")==0) return PrognosticPenaltyFactorEnum; 145 144 else if (strcmp(name,"PrognosticSpcthickness")==0) return PrognosticSpcthicknessEnum; 146 145 else if (strcmp(name,"PrognosticStabilization")==0) return PrognosticStabilizationEnum; … … 243 242 else if (strcmp(name,"TransientSolution")==0) return TransientSolutionEnum; 244 243 else if (strcmp(name,"Approximation")==0) return ApproximationEnum; 244 else if (strcmp(name,"NoneApproximation")==0) return NoneApproximationEnum; 245 245 else if (strcmp(name,"HutterApproximation")==0) return HutterApproximationEnum; 246 246 else if (strcmp(name,"MacAyealApproximation")==0) return MacAyealApproximationEnum; 247 247 else if (strcmp(name,"MacAyealPattynApproximation")==0) return MacAyealPattynApproximationEnum; 248 248 else if (strcmp(name,"MacAyealStokesApproximation")==0) return MacAyealStokesApproximationEnum; 249 else if (strcmp(name," NoneApproximation")==0) return NoneApproximationEnum;249 else if (strcmp(name,"L1L2Approximation")==0) return L1L2ApproximationEnum; 250 250 else if (strcmp(name,"PattynApproximation")==0) return PattynApproximationEnum; 251 251 else if (strcmp(name,"PattynStokesApproximation")==0) return PattynStokesApproximationEnum; … … 290 290 else if (strcmp(name,"Numericalflux")==0) return NumericalfluxEnum; 291 291 else if (strcmp(name,"Param")==0) return ParamEnum; 292 else if (strcmp(name,"L1L2IceFront")==0) return L1L2IceFrontEnum; 292 293 else if (strcmp(name,"PattynIceFront")==0) return PattynIceFrontEnum; 293 294 else if (strcmp(name,"Pengrid")==0) return PengridEnum; … … 383 384 else if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum; 384 385 else if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum; 385 else if (strcmp(name,"StepResponses")==0) return StepResponsesEnum;386 386 else stage=4; 387 387 } 388 388 if(stage==4){ 389 if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum; 389 if (strcmp(name,"ThicknessAlongGradient")==0) return ThicknessAlongGradientEnum; 390 else if (strcmp(name,"ThicknessAcrossGradient")==0) return ThicknessAcrossGradientEnum; 391 else if (strcmp(name,"StepResponses")==0) return StepResponsesEnum; 392 else if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum; 390 393 else if (strcmp(name,"RheologyBbarAbsGradient")==0) return RheologyBbarAbsGradientEnum; 391 394 else if (strcmp(name,"DragCoefficientAbsGradient")==0) return DragCoefficientAbsGradientEnum; … … 406 409 else if (strcmp(name,"StressTensoryz")==0) return StressTensoryzEnum; 407 410 else if (strcmp(name,"StressTensorzz")==0) return StressTensorzzEnum; 408 else if (strcmp(name,"IceVolume")==0) return IceVolumeEnum;409 else if (strcmp(name,"TotalSmb")==0) return TotalSmbEnum;410 else if (strcmp(name,"ThicknessAlongGradient")==0) return ThicknessAlongGradientEnum;411 else if (strcmp(name,"ThicknessAcrossGradient")==0) return ThicknessAcrossGradientEnum;412 411 else if (strcmp(name,"P0")==0) return P0Enum; 413 412 else if (strcmp(name,"P1")==0) return P1Enum; … … 443 442 else if (strcmp(name,"MaxVz")==0) return MaxVzEnum; 444 443 else if (strcmp(name,"MaxAbsVz")==0) return MaxAbsVzEnum; 444 else if (strcmp(name,"IceVolume")==0) return IceVolumeEnum; 445 else if (strcmp(name,"TotalSmb")==0) return TotalSmbEnum; 445 446 else if (strcmp(name,"Relative")==0) return RelativeEnum; 446 447 else if (strcmp(name,"Absolute")==0) return AbsoluteEnum; … … 492 493 } 493 494 /*If we reach this point, the string provided has not been found*/ 494 _error 2_("Enum " << name << " not found");495 _error_("Enum " << name << " not found"); 495 496 } -
issm/branches/trunk-jpl-damage/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp
r12168 r13101 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void SurfaceAbsVelMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units,int weight_index){12 void SurfaceAbsVelMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units,int weight_index){ 13 13 14 14 /*Intermediary*/ … … 17 17 18 18 /*output: */ 19 double J=0;20 double J_sum;19 IssmDouble J=0; 20 IssmDouble J_sum; 21 21 22 22 /*Compute Misfit: */ -
issm/branches/trunk-jpl-damage/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void SurfaceAbsVelMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);12 void SurfaceAbsVelMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index); 13 13 14 14 #endif -
issm/branches/trunk-jpl-damage/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp
r12168 r13101 11 11 #include "../SurfaceAreax/SurfaceAreax.h" 12 12 13 void SurfaceAverageVelMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units,int weight_index){13 void SurfaceAverageVelMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units,int weight_index){ 14 14 15 15 /*Intermediary*/ … … 18 18 19 19 /*output: */ 20 double J=0;21 double J_sum;20 IssmDouble J=0; 21 IssmDouble J_sum; 22 22 23 23 /*Compute surface area and add to elements inputs */ -
issm/branches/trunk-jpl-damage/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void SurfaceAverageVelMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);12 void SurfaceAverageVelMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index); 13 13 14 14 #endif -
issm/branches/trunk-jpl-damage/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp
r12168 r13101 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void SurfaceLogVelMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units,int weight_index){12 void SurfaceLogVelMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units,int weight_index){ 13 13 14 14 /*Intermediary*/ … … 17 17 18 18 /*output: */ 19 double J=0;20 double J_sum;19 IssmDouble J=0; 20 IssmDouble J_sum; 21 21 22 22 /*Compute Misfit: */ -
issm/branches/trunk-jpl-damage/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void SurfaceLogVelMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);12 void SurfaceLogVelMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index); 13 13 14 14 #endif -
issm/branches/trunk-jpl-damage/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp
r12168 r13101 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void SurfaceLogVxVyMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units,int weight_index){12 void SurfaceLogVxVyMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units,int weight_index){ 13 13 14 14 /*Intermediary*/ … … 17 17 18 18 /*output: */ 19 double J=0;20 double J_sum;19 IssmDouble J=0; 20 IssmDouble J_sum; 21 21 22 22 /*Compute Misfit: */ -
issm/branches/trunk-jpl-damage/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void SurfaceLogVxVyMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);12 void SurfaceLogVxVyMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index); 13 13 14 14 #endif -
issm/branches/trunk-jpl-damage/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp
r12168 r13101 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void SurfaceRelVelMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units,int weight_index){12 void SurfaceRelVelMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units,int weight_index){ 13 13 14 14 /*Intermediary*/ … … 17 17 18 18 /*output: */ 19 double J=0;20 double J_sum;19 IssmDouble J=0; 20 IssmDouble J_sum; 21 21 22 22 /*Compute Misfit: */ -
issm/branches/trunk-jpl-damage/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void SurfaceRelVelMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);12 void SurfaceRelVelMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index); 13 13 14 14 #endif -
issm/branches/trunk-jpl-damage/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.cpp
r12168 r13101 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void ThicknessAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){12 void ThicknessAbsGradientx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){ 13 13 14 14 /*Intermediary*/ … … 17 17 18 18 /*output: */ 19 double J=0;20 double J_sum;19 IssmDouble J=0; 20 IssmDouble J_sum; 21 21 22 22 /*Compute Misfit: */ -
issm/branches/trunk-jpl-damage/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void ThicknessAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);12 void ThicknessAbsGradientx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index); 13 13 14 14 #endif -
issm/branches/trunk-jpl-damage/src/c/modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.cpp
r12168 r13101 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void ThicknessAbsMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){12 void ThicknessAbsMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){ 13 13 14 14 /*Intermediary*/ … … 17 17 18 18 /*output: */ 19 double J=0;20 double J_sum;19 IssmDouble J=0; 20 IssmDouble J_sum; 21 21 22 22 /*Compute Misfit: */ -
issm/branches/trunk-jpl-damage/src/c/modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.h
r12878 r13101 10 10 11 11 /* local prototypes: */ 12 void ThicknessAbsMisfitx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);12 void ThicknessAbsMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index); 13 13 14 14 #endif -
issm/branches/trunk-jpl-damage/src/c/modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.cpp
r12927 r13101 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void ThicknessAcrossGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){12 void ThicknessAcrossGradientx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){ 13 13 14 14 /*Intermediary*/ … … 17 17 18 18 /*output: */ 19 double J=0;20 double J_sum;19 IssmDouble J=0; 20 IssmDouble J_sum; 21 21 22 22 /*Compute Misfit: */ -
issm/branches/trunk-jpl-damage/src/c/modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.h
r12927 r13101 10 10 11 11 /* local prototypes: */ 12 void ThicknessAcrossGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);12 void ThicknessAcrossGradientx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index); 13 13 14 14 #endif -
issm/branches/trunk-jpl-damage/src/c/modules/ThicknessAlongGradientx/ThicknessAlongGradientx.cpp
r12927 r13101 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void ThicknessAlongGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){12 void ThicknessAlongGradientx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){ 13 13 14 14 /*Intermediary*/ … … 17 17 18 18 /*output: */ 19 double J=0;20 double J_sum;19 IssmDouble J=0; 20 IssmDouble J_sum; 21 21 22 22 /*Compute Misfit: */ -
issm/branches/trunk-jpl-damage/src/c/modules/ThicknessAlongGradientx/ThicknessAlongGradientx.h
r12927 r13101 10 10 11 11 /* local prototypes: */ 12 void ThicknessAlongGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);12 void ThicknessAlongGradientx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index); 13 13 14 14 #endif -
issm/branches/trunk-jpl-damage/src/c/modules/TotalSmbx/TotalSmbx.cpp
r12773 r13101 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void TotalSmbx( double* pSmb, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){12 void TotalSmbx(IssmDouble* pSmb, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){ 13 13 14 double local_smb = 0;15 double total_smb;14 IssmDouble local_smb = 0; 15 IssmDouble total_smb; 16 16 17 17 for(int i=0;i<elements->Size();i++){ -
issm/branches/trunk-jpl-damage/src/c/modules/TotalSmbx/TotalSmbx.h
r12832 r13101 10 10 11 11 /* local prototypes: */ 12 void TotalSmbx( double* pSmb, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);12 void TotalSmbx(IssmDouble* pSmb, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units); 13 13 14 14 #endif -
issm/branches/trunk-jpl-damage/src/c/modules/Xy2llx/Xy2llx.cpp
r12878 r13101 53 53 double sl,rho,cm,T,chi; 54 54 55 if((sgn!=1) && (sgn!=-1)) _error 2_("Sign should be either +1 or -1.\n");55 if((sgn!=1) && (sgn!=-1)) _error_("Sign should be either +1 or -1.\n"); 56 56 57 57 delta = central_meridian; … … 131 131 if(flag) _pprintLine_("Warning: expecting coordinates in polar stereographic (Std Latitude: 71S Meridian: 0)."); 132 132 } 133 else _error 2_("Sign should be either +1 or -1.\n");133 else _error_("Sign should be either +1 or -1.\n"); 134 134 135 135 return; -
issm/branches/trunk-jpl-damage/src/c/python/io/CheckNumPythonArguments.cpp
r12878 r13101 27 27 if (size==0){ 28 28 function(); 29 _error 2_("usage: see above");29 _error_("usage: see above"); 30 30 } 31 31 else if (size!=NRHS ) { 32 32 function(); 33 _error 2_("usage error.");33 _error_("usage error."); 34 34 } 35 35 return 1; -
issm/branches/trunk-jpl-damage/src/c/python/io/FetchPythonData.cpp
r12878 r13101 48 48 49 49 /*check this is indeed a subtype of long type: */ 50 if(!PyBool_Check(py_boolean))_error 2_("expecting a boolean in input!");50 if(!PyBool_Check(py_boolean))_error_("expecting a boolean in input!"); 51 51 52 52 /*extract boolean: */ … … 69 69 /*retrive dimensions: */ 70 70 ndim=PyArray_NDIM((const PyArrayObject*)py_matrix); 71 if(ndim!=2)_error 2_("expecting an MxN matrix in input!");71 if(ndim!=2)_error_("expecting an MxN matrix in input!"); 72 72 dims=PyArray_DIMS((PyArrayObject*)py_matrix); 73 73 M=dims[0]; N=dims[1]; … … 97 97 /*retrive dimensions: */ 98 98 ndim=PyArray_NDIM((const PyArrayObject*)py_matrix); 99 if(ndim!=2)_error 2_("expecting an MxN matrix in input!");99 if(ndim!=2)_error_("expecting an MxN matrix in input!"); 100 100 dims=PyArray_DIMS((PyArrayObject*)py_matrix); 101 101 M=dims[0]; N=dims[1]; … … 125 125 /*retrive dimensions: */ 126 126 ndim=PyArray_NDIM((const PyArrayObject*)py_vector); 127 if(ndim!=1)_error 2_("expecting an Mx1 vector in input!");127 if(ndim!=1)_error_("expecting an Mx1 vector in input!"); 128 128 dims=PyArray_DIMS((PyArrayObject*)py_vector); 129 129 M=dims[0]; -
issm/branches/trunk-jpl-damage/src/c/python/io/WritePythonData.cpp
r12878 r13101 21 21 22 22 23 /*FUNCTION WriteData(PyObject* py_tuple,int index,int integer){{{*/ 24 void WriteData(PyObject* py_tuple, int index, int integer){ 25 26 PyTuple_SetItem(py_tuple, index, PyInt_FromSsize_t(integer)); 27 28 }/*}}}*/ 23 29 /*FUNCTION WriteData(PyObject* py_tuple,int index,char* string){{{*/ 24 30 void WriteData(PyObject* py_tuple, int index, char* string){ -
issm/branches/trunk-jpl-damage/src/c/python/io/pythonio.h
r12878 r13101 28 28 //void WriteData(DataHandle* py_tuple,Parameters* parameters); 29 29 void WriteData(PyObject* py_tuple, int index, double* matrix, int M,int N); 30 void WriteData(PyObject* py_tuple, int index, int integer); 30 31 void WriteData(PyObject* py_tuple, int index, char* string); 31 32 void WriteData(PyObject* py_tuple, int index, Matrix* matrix); -
issm/branches/trunk-jpl-damage/src/c/shared/Alloc/alloc.cpp
r12878 r13101 31 31 void* memptr=NULL; 32 32 33 if(!size)_error 2_("attempting to 0 size allocation!");33 if(!size)_error_("attempting to 0 size allocation!"); 34 34 35 35 /* Use the c library to do the allocation: */ 36 36 memptr=malloc(size); 37 if(!memptr) _error 2_("memory allocation failed!");37 if(!memptr) _error_("memory allocation failed!"); 38 38 39 39 return memptr; … … 44 44 void* memptr=NULL; 45 45 46 if(!size)_error 2_("attempting to 0 size allocation!");46 if(!size)_error_("attempting to 0 size allocation!"); 47 47 48 48 /* Use the c library to do the allocation: */ 49 49 memptr=calloc(n,size); 50 if(!memptr) _error 2_("memory allocation failed!");50 if(!memptr) _error_("memory allocation failed!"); 51 51 52 52 return memptr; … … 88 88 register void* value=NULL; 89 89 90 if(!size)_error 2_("attempting to realloc to zero");90 if(!size)_error_("attempting to realloc to zero"); 91 91 value = (void*)realloc(pv,size); 92 92 93 93 if (value == NULL) { 94 _error 2_("virtual memory exhausted");94 _error_("virtual memory exhausted"); 95 95 } 96 96 return value; -
issm/branches/trunk-jpl-damage/src/c/shared/Elements/CoordinateSystemTransform.cpp
r12878 r13101 22 22 case XYEnum: numdofs+=2; break; 23 23 case XYZPEnum: numdofs+=4; break; 24 default: _error 2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");24 default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet"); 25 25 } 26 26 } … … 67 67 break; 68 68 default: 69 _error 2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");69 _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet"); 70 70 } 71 71 } -
issm/branches/trunk-jpl-damage/src/c/shared/Elements/PddSurfaceMassBalance.cpp
r12878 r13101 80 80 if (tstar < PDup){ 81 81 pd = 1.; 82 if (tstar >= -siglimc){ pd = pds[ int(tstar/DT + siglim0c)];}}82 if (tstar >= -siglimc){ pd = pds[reCast<int,IssmDouble>(tstar/DT + siglim0c)];}} 83 83 else { 84 84 pd = 0.;} … … 100 100 if (tstar >= siglim) {pdd = pdd + tstar*deltm;} 101 101 else if (tstar> -siglim){ 102 pddsig=pdds[ int(tstar/DT + siglim0)];102 pddsig=pdds[reCast<int,IssmDouble>(tstar/DT + siglim0)]; 103 103 pdd = pdd + pddsig*deltm; 104 104 frzndd = frzndd - (tstar-pddsig)*deltm;} -
issm/branches/trunk-jpl-damage/src/c/shared/Elements/TransformInvStiffnessMatrixCoord.cpp
r12878 r13101 31 31 case XYEnum: numdofs+=2; break; 32 32 case XYZPEnum: numdofs+=4; break; 33 default: _error 2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");33 default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet"); 34 34 } 35 35 } -
issm/branches/trunk-jpl-damage/src/c/shared/Elements/TransformLoadVectorCoord.cpp
r12878 r13101 30 30 case XYEnum: numdofs+=2; break; 31 31 case XYZPEnum: numdofs+=4; break; 32 default: _error 2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");32 default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet"); 33 33 } 34 34 } -
issm/branches/trunk-jpl-damage/src/c/shared/Elements/TransformSolutionCoord.cpp
r12878 r13101 31 31 case XYEnum: numdofs+=2; break; 32 32 case XYZPEnum: numdofs+=4; break; 33 default: _error 2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");33 default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet"); 34 34 } 35 35 } -
issm/branches/trunk-jpl-damage/src/c/shared/Elements/TransformStiffnessMatrixCoord.cpp
r12878 r13101 31 31 case XYEnum: numdofs+=2; break; 32 32 case XYZPEnum: numdofs+=4; break; 33 default: _error 2_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");33 default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet"); 34 34 } 35 35 } -
issm/branches/trunk-jpl-damage/src/c/shared/Exp/DomainOutlineRead.cpp
r12878 r13101 39 39 /*open domain outline file for reading: */ 40 40 if ((fid=fopen(domainname,"r"))==NULL){ 41 _error 2_("could not find domain file " << domainname);41 _error_("could not find domain file " << domainname); 42 42 } 43 43 -
issm/branches/trunk-jpl-damage/src/c/shared/Exp/DomainOutlineWrite.cpp
r12878 r13101 23 23 /*open domain outline file for writing: */ 24 24 if ((fid=fopen(domainname,"w"))==NULL){ 25 _error 2_("could not open domain file " << domainname);25 _error_("could not open domain file " << domainname); 26 26 noerr=0; goto cleanupandreturn; 27 27 } -
issm/branches/trunk-jpl-damage/src/c/shared/Matrix/MatrixUtils.cpp
r12878 r13101 36 36 if (!itrnb) { 37 37 if (nrowb != idimb) { 38 _error 2_("Matrix A and B inner vectors not equal size.");38 _error_("Matrix A and B inner vectors not equal size."); 39 39 } 40 40 idimc=ncolb; … … 42 42 else { 43 43 if (ncolb != idimb) { 44 _error 2_("Matrix A and B inner vectors not equal size.");44 _error_("Matrix A and B inner vectors not equal size."); 45 45 } 46 46 idimc=nrowb; … … 49 49 if (!itrnc) { 50 50 if (nrowc != idimc) { 51 _error 2_("Matrix B and C inner vectors not equal size.");51 _error_("Matrix B and C inner vectors not equal size."); 52 52 } 53 53 idimd=ncolc; … … 55 55 else { 56 56 if (ncolc != idimc) { 57 _error 2_("Matrix B and C inner vectors not equal size.");57 _error_("Matrix B and C inner vectors not equal size."); 58 58 } 59 59 idimd=nrowc; … … 124 124 125 125 if (ntrma != ntrmb) { 126 _error 2_("Matrix A and B inner vectors not equal size");126 _error_("Matrix A and B inner vectors not equal size"); 127 127 noerr=0; 128 128 return noerr; … … 175 175 176 176 if (!b && nvec) { 177 _error 2_("No right-hand side for nvec=" << nvec << ".");177 _error_("No right-hand side for nvec=" << nvec << "."); 178 178 noerr=0; 179 179 return noerr; … … 214 214 xDelete<int>(pivrc2); 215 215 xDelete<int>(pindx); 216 _error 2_("Pivot " << pivot << " less than machine epsilon");216 _error_("Pivot " << pivot << " less than machine epsilon"); 217 217 noerr=0; 218 218 return noerr; … … 349 349 /*Compute determinant*/ 350 350 Matrix2x2Determinant(&det,A); 351 if (fabs(det) < DBL_EPSILON) _error 2_("Determinant smaller that machine epsilon");351 if (fabs(det) < DBL_EPSILON) _error_("Determinant smaller that machine epsilon"); 352 352 353 353 /*Compute invert*/ … … 374 374 /*Compute determinant*/ 375 375 Matrix3x3Determinant(&det,A); 376 if (fabs(det) < DBL_EPSILON) _error 2_("Determinant smaller that machine epsilon");376 if (fabs(det) < DBL_EPSILON) _error_("Determinant smaller that machine epsilon"); 377 377 378 378 /*Compute invert*/ -
issm/branches/trunk-jpl-damage/src/c/shared/Numerics/BrentSearch.cpp
r12878 r13101 44 44 iter=0; 45 45 fxmin = (*f)(xmin,optargs); 46 if (xIsNan<IssmDouble>(fxmin)) _error 2_("Function evaluation returned NaN");46 if (xIsNan<IssmDouble>(fxmin)) _error_("Function evaluation returned NaN"); 47 47 cout<<setprecision(5); 48 48 if(VerboseControl()) _pprintLine_(""); … … 51 51 if(VerboseControl()) _pprintLine_(" N/A "<<setw(12)<<xmin<<" "<<setw(12)<<fxmin<<" N/A boundary"); 52 52 fxmax = (*f)(xmax,optargs); 53 if (xIsNan<IssmDouble>(fxmax)) _error 2_("Function evaluation returned NaN");53 if (xIsNan<IssmDouble>(fxmax)) _error_("Function evaluation returned NaN"); 54 54 if(VerboseControl()) _pprintLine_(" N/A "<<setw(12)<<xmax<<" "<<setw(12)<<fxmax<<" N/A boundary"); 55 55 … … 75 75 /*2: call the function to be evaluated*/ 76 76 fxbest = (*f)(x,optargs); 77 if(xIsNan<IssmDouble>(fxbest)) _error 2_("Function evaluation returned NaN");77 if(xIsNan<IssmDouble>(fxbest)) _error_("Function evaluation returned NaN"); 78 78 iter=iter+1; 79 79 … … 159 159 //evaluate function on x 160 160 fx = (*f)(x,optargs); 161 if(xIsNan<IssmDouble>(fx)) _error 2_("Function evaluation returned NaN");161 if(xIsNan<IssmDouble>(fx)) _error_("Function evaluation returned NaN"); 162 162 iter=iter+1; 163 163 -
issm/branches/trunk-jpl-damage/src/c/shared/Numerics/GaussPoints.cpp
r12878 r13101 1670 1670 if (iter >= MAX_GAUS_ITER) { 1671 1671 xDelete<IssmPDouble>(work); 1672 _error 2_("Max iterations exceeded for l=" << MAX_GAUS_ITER);1672 _error_("Max iterations exceeded for l=" << MAX_GAUS_ITER); 1673 1673 } 1674 1674 } -
issm/branches/trunk-jpl-damage/src/c/shared/Numerics/IsInputConverged.cpp
r12878 r13101 53 53 else eps=0; 54 54 } 55 else _error 2_("convergence criterion " << EnumToStringx(criterion_enum) << " not supported yet!");55 else _error_("convergence criterion " << EnumToStringx(criterion_enum) << " not supported yet!"); 56 56 57 57 /*Assign output pointers:*/ -
issm/branches/trunk-jpl-damage/src/c/shared/Numerics/OptimalSearch.cpp
r12878 r13101 41 41 //get the value of the function at the first boundary 42 42 fx1= (*f)(x1,optargs); 43 if (xIsNan<IssmDouble>(fx1)) _error 2_("Function evaluation returned NaN");43 if (xIsNan<IssmDouble>(fx1)) _error_("Function evaluation returned NaN"); 44 44 cout<<setprecision(5); 45 45 if(VerboseControl()) _pprintLine_(""); … … 57 57 iter++; 58 58 fx2 = (*f)(x2,optargs); 59 if (xIsNan<IssmDouble>(fx2)) _error 2_("Function evaluation returned NaN");59 if (xIsNan<IssmDouble>(fx2)) _error_("Function evaluation returned NaN"); 60 60 if(VerboseControl()) 61 61 _pprintLine_(" "<<setw(5)<<iter<<" "<<setw(12)<<x2<<" "<<setw(12)<<fx2<<" "<<(fabs(x2-x1)>fabs(fx2-fx1)?fabs(fx2-fx1):fabs(x2-x1))); -
issm/branches/trunk-jpl-damage/src/c/shared/Numerics/OptionsFromAnalysis.cpp
r12878 r13101 57 57 if (found==-1){ 58 58 /*ok, we did not find anything, this is not good! error out: */ 59 _error 2_("could find neither a default analysis nor analysis " << EnumToStringx(analysis_type));59 _error_("could find neither a default analysis nor analysis " << EnumToStringx(analysis_type)); 60 60 } 61 61 -
issm/branches/trunk-jpl-damage/src/c/shared/Numerics/UnitConversion.cpp
r12946 r13101 29 29 if(direction_enum==IuToExtEnum) for(i=0;i<numvalues;i++)values[i]=values[i]*scale; 30 30 else if(direction_enum==ExtToIuEnum) for(i=0;i<numvalues;i++)values[i]=values[i]/scale; 31 else _error 2_("wrong direction for unit conversion, either IuToExtEnum or ExtToIuEnum. ");31 else _error_("wrong direction for unit conversion, either IuToExtEnum or ExtToIuEnum. "); 32 32 33 33 } -
issm/branches/trunk-jpl-damage/src/c/shared/Numerics/Verbosity.cpp
r12878 r13101 34 34 void SetVerbosityLevel(int level){ 35 35 36 if(level<0) _error 2_("vebosity level should be a positive integer (user provided " << level << ")");36 if(level<0) _error_("vebosity level should be a positive integer (user provided " << level << ")"); 37 37 38 38 verbositylevel = level; -
issm/branches/trunk-jpl-damage/src/c/shared/Numerics/numerics.h
r12878 r13101 17 17 struct OptPars; 18 18 19 IssmDouble min(IssmDouble a,IssmDouble b); 20 IssmDouble max(IssmDouble a,IssmDouble b); 21 int min(int a,int b); 22 int max(int a,int b); 23 IssmDouble OptFunc(IssmDouble scalar, OptArgs* optargs); 24 void BrentSearch(IssmDouble* psearch_scalar,IssmDouble* pJ,OptPars* optpars,IssmDouble (*f)(IssmDouble,OptArgs*), OptArgs* optargs); 25 void OptimalSearch(IssmDouble* psearch_scalar,IssmDouble* pJ,OptPars* optpars,IssmDouble (*f)(IssmDouble,OptArgs*), OptArgs* optargs); 26 void cross(IssmDouble* result,IssmDouble* vector1,IssmDouble* vector2); 27 void IsInputConverged(IssmDouble* peps, Input** new_inputs,Input** old_inputs,int num_inputs,int criterion_enum); 28 void UnitConversion(IssmDouble* values, int numvalues,int direction_enum, int type_enum); 29 IssmDouble UnitConversion(IssmDouble value, int direction_enum, int type_enum); 30 char* OptionsFromAnalysis(Parameters* parameters,int analysis_type); 31 void XZvectorsToCoordinateSystem(IssmDouble* T,IssmDouble* xzvectors); 19 IssmDouble min(IssmDouble a,IssmDouble b); 20 IssmDouble max(IssmDouble a,IssmDouble b); 21 int min(int a,int b); 22 int max(int a,int b); 23 IssmDouble OptFunc(IssmDouble scalar, OptArgs *optargs); 24 void BrentSearch(IssmDouble *psearch_scalar,IssmDouble*pJ,OptPars*optpars,IssmDouble (*f)(IssmDouble,OptArgs*), OptArgs*optargs); 25 void OptimalSearch(IssmDouble *psearch_scalar,IssmDouble*pJ,OptPars*optpars,IssmDouble (*f)(IssmDouble,OptArgs*), OptArgs*optargs); 26 void cross(IssmDouble *result,IssmDouble*vector1,IssmDouble*vector2); 27 void IsInputConverged(IssmDouble *peps, Input**new_inputs,Input**old_inputs,int num_inputs,int criterion_enum); 28 void UnitConversion(IssmDouble *values, int numvalues,int direction_enum, int type_enum); 29 IssmDouble UnitConversion(IssmDouble value, int direction_enum, int type_enum); 30 char *OptionsFromAnalysis(Parameters *parameters,int analysis_type); 31 void XZvectorsToCoordinateSystem(IssmDouble *T,IssmDouble*xzvectors); 32 int cubic(IssmDouble a, IssmDouble b, IssmDouble c, IssmDouble d, double X[3], int *num); 32 33 #ifdef _HAVE_PETSC_ 33 34 void PetscOptionsFromAnalysis(Parameters* parameters,int analysis_type); -
issm/branches/trunk-jpl-damage/src/c/shared/String/DescriptorIndex.cpp
r12878 r13101 23 23 /*retrieve first token, separated by underscore: */ 24 24 pch = strtok (descriptor,"_"); 25 if(!pch)_error 2_("descriptor " << descriptor << " is not correctly formatted!");25 if(!pch)_error_("descriptor " << descriptor << " is not correctly formatted!"); 26 26 27 27 if (strncmp(pch,"scaled",6)==0){ 28 28 /*we have a scaled variable. recover the root: */ 29 29 pch = strtok (NULL, "_"); 30 if(!pch)_error 2_("scaled descriptor " << descriptor << " is not correctly formatted!");30 if(!pch)_error_("scaled descriptor " << descriptor << " is not correctly formatted!"); 31 31 memcpy(root,pch,(strlen(pch)+1)*sizeof(char)); 32 32 … … 44 44 /*we have an indexed variable. recover the root: */ 45 45 pch = strtok (NULL, "_"); 46 if(!pch)_error 2_("indexed descriptor " << descriptor << " is not correctly formatted!");46 if(!pch)_error_("indexed descriptor " << descriptor << " is not correctly formatted!"); 47 47 memcpy(root,pch,(strlen(pch)+1)*sizeof(char)); 48 48 /*now recover the index: */ 49 49 pch = strtok (NULL, "_"); 50 if(!pch)_error 2_("indexed descriptor " << descriptor << " is not correctly formatted!");50 if(!pch)_error_("indexed descriptor " << descriptor << " is not correctly formatted!"); 51 51 sscanf(pch,"%i",pindex); 52 52 return IndexedEnum; … … 55 55 /*we have an indexed variable. recover the root: */ 56 56 pch = strtok (NULL, "_"); 57 if(!pch)_error 2_("nodal descriptor " << descriptor << " is not correctly formatted!");57 if(!pch)_error_("nodal descriptor " << descriptor << " is not correctly formatted!"); 58 58 memcpy(root,pch,(strlen(pch)+1)*sizeof(char)); 59 59 /*now recover the index: */ 60 60 pch = strtok (NULL, "_"); 61 if(!pch)_error 2_("nodal descriptor " << descriptor << " is not correctly formatted!");61 if(!pch)_error_("nodal descriptor " << descriptor << " is not correctly formatted!"); 62 62 sscanf(pch,"%i",pindex); 63 63 return NodalEnum; -
issm/branches/trunk-jpl-damage/src/c/shared/Threads/LaunchThread.cpp
r12878 r13101 44 44 45 45 if(pthread_create(threads+i,NULL,function,(void*)(handles+i))){ 46 _error 2_("pthread_create error");46 _error_("pthread_create error"); 47 47 } 48 48 } 49 49 for(i=0;i<num_threads;i++){ 50 50 if(pthread_join(threads[i],(void**)&status)){ 51 _error 2_("pthread_join error");51 _error_("pthread_join error"); 52 52 } 53 53 } -
issm/branches/trunk-jpl-damage/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp
r12878 r13101 35 35 break; 36 36 default: 37 _error 2_("No adjoint has been implemented for solution " << EnumToStringx(solutiontype) << " yet");37 _error_("No adjoint has been implemented for solution " << EnumToStringx(solutiontype) << " yet"); 38 38 break; 39 39 } -
issm/branches/trunk-jpl-damage/src/c/solutions/AnalysisConfiguration.cpp
r12878 r13101 110 110 111 111 default: 112 _error 2_("solution type: " << EnumToStringx(solutiontype) << " not supported yet!");112 _error_("solution type: " << EnumToStringx(solutiontype) << " not supported yet!"); 113 113 break; 114 114 } -
issm/branches/trunk-jpl-damage/src/c/solutions/CorePointerFromSolutionEnum.cpp
r12878 r13101 29 29 solutioncore=&diagnostic_core; 30 30 #else 31 _error 2_("ISSM was not compiled with diagnostic capabilities. Exiting");31 _error_("ISSM was not compiled with diagnostic capabilities. Exiting"); 32 32 #endif 33 33 break; … … 36 36 solutioncore=&steadystate_core; 37 37 #else 38 _error 2_("ISSM was not compiled with steady state capabilities. Exiting");38 _error_("ISSM was not compiled with steady state capabilities. Exiting"); 39 39 #endif 40 40 break; … … 43 43 solutioncore=&thermal_core; 44 44 #else 45 _error 2_("ISSM was not compiled with thermal capabilities. Exiting");45 _error_("ISSM was not compiled with thermal capabilities. Exiting"); 46 46 #endif 47 47 break; … … 50 50 solutioncore=&enthalpy_core; 51 51 #else 52 _error 2_("ISSM was not compiled with thermal capabilities. Exiting");52 _error_("ISSM was not compiled with thermal capabilities. Exiting"); 53 53 #endif 54 54 break; … … 57 57 solutioncore=&balancethickness_core; 58 58 #else 59 _error 2_("ISSM was not compiled with balanced capabilities. Exiting");59 _error_("ISSM was not compiled with balanced capabilities. Exiting"); 60 60 #endif 61 61 break; … … 64 64 solutioncore=&hydrology_core; 65 65 #else 66 _error 2_("ISSM was not compiled with hydrology capabilities. Exiting");66 _error_("ISSM was not compiled with hydrology capabilities. Exiting"); 67 67 #endif 68 68 break; … … 71 71 solutioncore=&surfaceslope_core; 72 72 #else 73 _error 2_("ISSM was not compiled with slope capabilities. Exiting");73 _error_("ISSM was not compiled with slope capabilities. Exiting"); 74 74 #endif 75 75 break; … … 78 78 solutioncore=&bedslope_core; 79 79 #else 80 _error 2_("ISSM was not compiled with slope capabilities. Exiting");80 _error_("ISSM was not compiled with slope capabilities. Exiting"); 81 81 #endif 82 82 break; … … 85 85 solutioncore=&transient_core; 86 86 #else 87 _error 2_("ISSM was not compiled with transient capabilities. Exiting");87 _error_("ISSM was not compiled with transient capabilities. Exiting"); 88 88 #endif 89 89 break; … … 92 92 solutioncore=&prognostic_core; 93 93 #else 94 _error 2_("ISSM was not compiled with prognostic capabilities. Exiting");94 _error_("ISSM was not compiled with prognostic capabilities. Exiting"); 95 95 #endif 96 96 break; 97 97 default: 98 _error 2_("solution type: " << EnumToStringx(solutiontype) << " not supported yet!");98 _error_("solution type: " << EnumToStringx(solutiontype) << " not supported yet!"); 99 99 break; 100 100 } -
issm/branches/trunk-jpl-damage/src/c/solutions/ProcessArguments.cpp
r12878 r13101 17 17 char *lockfilename = NULL; 18 18 19 if(argc<2)_error 2_("Usage error: no solution requested");19 if(argc<2)_error_("Usage error: no solution requested"); 20 20 *solution_type=StringToEnumx(argv[1]); 21 if(argc<3)_error 2_("Usage error: missing model name");21 if(argc<3)_error_("Usage error: missing model name"); 22 22 modelname=argv[3]; 23 23 binfilename = xNew<char>(strlen(modelname)+strlen(".bin") +1); sprintf(binfilename, "%s%s",modelname,".bin"); -
issm/branches/trunk-jpl-damage/src/c/solutions/WriteLockFile.cpp
r12878 r13101 17 17 if(my_rank==0){ 18 18 fid=fopen(filename,"w"); 19 if(fid==NULL) _error 2_("error message: could not open lock file " << filename);19 if(fid==NULL) _error_("error message: could not open lock file " << filename); 20 20 21 21 /*Close file: */ 22 if(fclose(fid)!=0) _error 2_("could not close lock file " << filename);22 if(fclose(fid)!=0) _error_("could not close lock file " << filename); 23 23 } 24 24 -
issm/branches/trunk-jpl-damage/src/c/solutions/control_core.cpp
r12878 r13101 82 82 /*Display info*/ 83 83 if(VerboseControl()) _pprintLine_("\n" << " control method step " << n+1 << "/" << nsteps); 84 for(i=0;i<num_responses;i++) step_responses[i]= (int)responses[n*num_responses+i];84 for(i=0;i<num_responses;i++) step_responses[i]=reCast<int,IssmDouble>(responses[n*num_responses+i]); 85 85 femmodel->parameters->SetParam(step_responses,1,num_responses,StepResponsesEnum); 86 86 … … 99 99 100 100 if(VerboseControl()) _pprintLine_(" optimizing along gradient direction"); 101 optpars.maxiter= (int)maxiter[n]; optpars.cm_jump=cm_jump[n];101 optpars.maxiter=reCast<int,IssmDouble>(maxiter[n]); optpars.cm_jump=cm_jump[n]; 102 102 BrentSearch(&search_scalar,J+n,&optpars,&objectivefunction,&optargs); 103 103 -
issm/branches/trunk-jpl-damage/src/c/solutions/controltao_core.cpp
r12946 r13101 13 13 #include "../solvers/solvers.h" 14 14 15 #if defined (_HAVE_TAO_) && defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ == 2)15 #if defined (_HAVE_TAO_) && defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ > 1) 16 16 #include <tao.h> 17 17 … … 42 42 PetscGetArgs(&argc,&args); 43 43 ierr = TaoInitialize(&argc,&args,(char*)0,""); 44 if(ierr) _error 2_("Could not initialize Tao");44 if(ierr) _error_("Could not initialize Tao"); 45 45 46 46 /*Recover some parameters*/ … … 75 75 xdelete(&XU); 76 76 77 user.J= (double*)xcalloc((maxiter+5),sizeof(double));77 user.J=xNewZeroInit<double>(maxiter+5); 78 78 user.femmodel=femmodel; 79 79 TaoSetObjectiveAndGradientRoutine(tao,FormFunctionGradient,(void*)&user); … … 185 185 #else 186 186 void controltao_core(FemModel* femmodel){ 187 _error 2_("TAO not installed or PETSc version not supported");187 _error_("TAO not installed or PETSc version not supported"); 188 188 } 189 189 #endif //_HAVE_TAO_ -
issm/branches/trunk-jpl-damage/src/c/solutions/convergence.cpp
r12878 r13101 72 72 if (xIsNan<IssmDouble>(res)){ 73 73 _pprintLine_("norm nf = " << nF << "f and norm kuold = " << nKUoldF << "f"); 74 _error 2_("mechanical equilibrium convergence criterion is NaN!");74 _error_("mechanical equilibrium convergence criterion is NaN!"); 75 75 } 76 76 … … 81 81 //print 82 82 if(res<eps_res){ 83 if(VerboseConvergence()) _pprintLine_(setw(50) << left << " mechanical equilibrium convergence criterion" << res*100 << " < " << eps_res*100 <<" %");83 if(VerboseConvergence()) _pprintLine_(setw(50)<<left<<" mechanical equilibrium convergence criterion"<<res*100<< " < "<<eps_res*100<<" %"); 84 84 converged=true; 85 85 } 86 86 else{ 87 if(VerboseConvergence()) _pprintLine_(setw(50) << left << " mechanical equilibrium convergence criterion" << res*100 << " > " << eps_res*100 <<" %");87 if(VerboseConvergence()) _pprintLine_(setw(50)<<left<<" mechanical equilibrium convergence criterion"<<res*100<<" > "<<eps_res*100<<" %"); 88 88 converged=false; 89 89 } … … 96 96 ndu=duf->Norm(NORM_TWO); nu=old_uf->Norm(NORM_TWO); 97 97 98 if (xIsNan<IssmDouble>(ndu) || xIsNan<IssmDouble>(nu)) _error 2_("convergence criterion is NaN!");98 if (xIsNan<IssmDouble>(ndu) || xIsNan<IssmDouble>(nu)) _error_("convergence criterion is NaN!"); 99 99 100 100 //clean up … … 121 121 duf=old_uf->Duplicate(); old_uf->Copy(duf); duf->AYPX(uf,-1.0); 122 122 ndu=duf->Norm(NORM_TWO); nduinf=duf->Norm(NORM_INF); 123 if (xIsNan<IssmDouble>(ndu) || xIsNan<IssmDouble>(nu)) _error 2_("convergence criterion is NaN!");123 if (xIsNan<IssmDouble>(ndu) || xIsNan<IssmDouble>(nu)) _error_("convergence criterion is NaN!"); 124 124 125 125 //clean up -
issm/branches/trunk-jpl-damage/src/c/solutions/diagnostic_core.cpp
r12878 r13101 20 20 bool ishutter = false; 21 21 bool ismacayealpattyn = false; 22 bool isl1l2 = false; 22 23 bool isstokes = false; 23 24 bool isnewton = false; … … 33 34 femmodel->parameters->FindParam(&ishutter,FlowequationIshutterEnum); 34 35 femmodel->parameters->FindParam(&ismacayealpattyn,FlowequationIsmacayealpattynEnum); 36 femmodel->parameters->FindParam(&isl1l2,FlowequationIsl1l2Enum); 35 37 femmodel->parameters->FindParam(&isstokes,FlowequationIsstokesEnum); 36 38 femmodel->parameters->FindParam(&isnewton,DiagnosticIsnewtonEnum); … … 70 72 } 71 73 72 if ( ismacayealpattyn^ isstokes){ // ^ = xor74 if ((ismacayealpattyn || isl1l2) ^ isstokes){ // ^ = xor 73 75 74 76 if(VerboseSolution()) _pprintLine_(" computing velocities"); -
issm/branches/trunk-jpl-damage/src/c/solutions/gradient_core.cpp
r12878 r13101 37 37 /*Check that gradient is clean*/ 38 38 norm_inf=new_gradient->Norm(NORM_INF); 39 if(norm_inf<=0) _error 2_("||∂J/∂α||∞ = 0 gradient norm is zero");40 if(xIsNan<IssmDouble>(norm_inf))_error 2_("||∂J/∂α||∞ = NaN gradient norm is NaN");39 if(norm_inf<=0) _error_("||∂J/∂α||∞ = 0 gradient norm is zero"); 40 if(xIsNan<IssmDouble>(norm_inf))_error_("||∂J/∂α||∞ = NaN gradient norm is NaN"); 41 41 42 42 /*plug back into inputs: */ -
issm/branches/trunk-jpl-damage/src/c/solutions/hydrology_core.cpp
r12878 r13101 39 39 nsteps=1; 40 40 } 41 else nsteps= (int)((final_time-starttime)/dt);41 else nsteps=reCast<int,IssmDouble>((final_time-starttime)/dt); 42 42 time=starttime; 43 43 -
issm/branches/trunk-jpl-damage/src/c/solutions/issm.cpp
r12878 r13101 14 14 bool dakota_analysis,control_analysis,tao_analysis; 15 15 16 /*AD: */ 17 bool autodiff=false; 18 #if _ADOLC_VERSION_ == 2 19 int tape_stats[11]; 20 #else 21 size_t tape_stats[11]; 22 #endif 23 16 24 /*FemModel: */ 17 25 FemModel *femmodel = NULL; … … 42 50 ISSMBOOT(); 43 51 52 44 53 /*Initialize environments: Petsc, MPI, etc...: */ 45 54 #ifdef _HAVE_PETSC_ 46 55 ierr=PetscInitialize(&argc,&argv,(char*)0,""); 47 if(ierr) _error 2_("Could not initialize Petsc");56 if(ierr) _error_("Could not initialize Petsc"); 48 57 #else 49 58 #ifdef _HAVE_MPI_ … … 100 109 femmodel->parameters->FindParam(&tao_analysis,InversionTaoEnum); 101 110 femmodel->parameters->FindParam(&profiling,DebugProfilingEnum); 111 femmodel->parameters->FindParam(&autodiff,AutodiffIsautodiffEnum); 102 112 103 113 #ifdef _HAVE_MPI_ … … 105 115 #else 106 116 finish_init=(IssmPDouble)clock(); 117 #endif 118 119 /*If running AD, then initialize the tape: */ 120 #ifdef _HAVE_ADOLC_ 121 if(autodiff) trace_on(1); 107 122 #endif 108 123 … … 120 135 Dakotax(femmodel); 121 136 #else 122 _error 2_("ISSM was not compiled with dakota support, cannot carry out dakota analysis!");137 _error_("ISSM was not compiled with dakota support, cannot carry out dakota analysis!"); 123 138 #endif 124 139 } … … 130 145 control_core(femmodel); 131 146 #else 132 _error 2_("ISSM was not compiled with control support, cannot carry out dakota analysis!");147 _error_("ISSM was not compiled with control support, cannot carry out dakota analysis!"); 133 148 #endif 134 149 } … … 153 168 _pprintLine_("write results to disk:"); 154 169 OutputResultsx(femmodel->elements, femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,femmodel->results); 170 171 /*If running AD, close our tape, print statistics: {{{*/ 172 #ifdef _HAVE_ADOLC_ 173 if(autodiff){ 174 trace_off(); 175 tapestats(1,tape_stats); //reading of tape statistics 176 _pprintLine_(" ADOLC statistics: "); 177 _pprintLine_(" "<<setw(45)<<left<<"Number of independents: " <<tape_stats[0]); 178 _pprintLine_(" "<<setw(45)<<left<<"Number of dependents: " <<tape_stats[1]); 179 _pprintLine_(" "<<setw(45)<<left<<"Maximal number of live active variables: " <<tape_stats[2]); 180 _pprintLine_(" "<<setw(45)<<left<<"Size of value stack (number of overwrites): " <<tape_stats[3]); 181 _pprintLine_(" "<<setw(45)<<left<<"Buffer size (a multiple of eight): " <<tape_stats[4]); 182 _pprintLine_(" "<<setw(45)<<left<<"Total number of operations recorded: " <<tape_stats[5]); 183 } 184 #endif /*}}}*/ 155 185 156 186 /*Close output and petsc options file and write lock file if requested*/ … … 200 230 #endif 201 231 #endif 232 202 233 203 234 /*end module: */ -
issm/branches/trunk-jpl-damage/src/c/solutions/kriging.cpp
r12878 r13101 40 40 #ifdef _HAVE_PETSC_ 41 41 int ierr=PetscInitialize(&argc,&argv,(char*)0,""); 42 if(ierr) _error 2_("Could not initialize Petsc");42 if(ierr) _error_("Could not initialize Petsc"); 43 43 #else 44 44 #ifdef _HAVE_MPI_ … … 122 122 char *lockfilename = NULL; 123 123 124 if(argc<2)_error 2_("Usage error: missing model name");124 if(argc<2)_error_("Usage error: missing model name"); 125 125 modelname=argv[2]; 126 126 binfilename = xNew<char>((strlen(modelname)+strlen(".bin") +1)); sprintf(binfilename, "%s%s",modelname,".bin"); -
issm/branches/trunk-jpl-damage/src/c/solutions/objectivefunction.cpp
r12878 r13101 49 49 } 50 50 else{ 51 _error 2_("Solution " << EnumToStringx(solution_type) << " not implemented yet");51 _error_("Solution " << EnumToStringx(solution_type) << " not implemented yet"); 52 52 } 53 53 … … 66 66 } 67 67 else{ 68 _error 2_("Solution " << EnumToStringx(solution_type) << " not implemented yet");68 _error_("Solution " << EnumToStringx(solution_type) << " not implemented yet"); 69 69 } 70 70 -
issm/branches/trunk-jpl-damage/src/c/solutions/steadystate_core.cpp
r12878 r13101 52 52 } 53 53 #else 54 _error 2_("ISSM was not compiled with thermal capabilities. Exiting");54 _error_("ISSM was not compiled with thermal capabilities. Exiting"); 55 55 #endif 56 56 -
issm/branches/trunk-jpl-damage/src/c/solutions/transient_core.cpp
r12946 r13101 104 104 } 105 105 #else 106 _error 2_("ISSM was not compiled with thermal capabilities. Exiting");106 _error_("ISSM was not compiled with thermal capabilities. Exiting"); 107 107 #endif 108 108 } … … 113 113 diagnostic_core(femmodel); 114 114 #else 115 _error 2_("ISSM was not compiled with diagnostic capabilities. Exiting");115 _error_("ISSM was not compiled with diagnostic capabilities. Exiting"); 116 116 #endif 117 117 } … … 129 129 GroundinglineMigrationx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters); 130 130 #else 131 _error 2_("ISSM was not compiled with grounding line migration capabilities. Exiting");131 _error_("ISSM was not compiled with grounding line migration capabilities. Exiting"); 132 132 #endif 133 133 } -
issm/branches/trunk-jpl-damage/src/c/toolkits/issm/SeqMat.cpp
r12878 r13101 119 119 break; 120 120 default: 121 _error 2_("unknown norm !");121 _error_("unknown norm !"); 122 122 break; 123 123 } … … 150 150 AX->GetSize(&AXM); 151 151 152 if(M!=AXM)_error 2_("A and AX should have the same number of rows!");153 if(N!=XM)_error 2_("A and X should have the same number of columns!");152 if(M!=AXM)_error_("A and AX should have the same number of rows!"); 153 if(N!=XM)_error_("A and X should have the same number of columns!"); 154 154 155 155 for(i=0;i<M;i++){ … … 197 197 break; 198 198 default: 199 _error 2_("unknown insert mode!");199 _error_("unknown insert mode!"); 200 200 break; 201 201 } -
issm/branches/trunk-jpl-damage/src/c/toolkits/issm/SeqVec.cpp
r12878 r13101 85 85 break; 86 86 default: 87 _error 2_("unknown insert mode!");87 _error_("unknown insert mode!"); 88 88 break; 89 89 } … … 102 102 break; 103 103 default: 104 _error 2_("unknown insert mode!");104 _error_("unknown insert mode!"); 105 105 break; 106 106 } … … 204 204 break; 205 205 default: 206 _error 2_("unknown norm !");206 _error_("unknown norm !"); 207 207 break; 208 208 } -
issm/branches/trunk-jpl-damage/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp
r12878 r13101 60 60 61 61 #else 62 _error 2_("METIS version not supported yet");62 _error_("METIS version not supported yet"); 63 63 #endif 64 64 } -
issm/branches/trunk-jpl-damage/src/c/toolkits/petsc/patches/ISSMToPetscInsertMode.cpp
r12878 r13101 30 30 break; 31 31 default: 32 _error 2_("unknown insert mode!");32 _error_("unknown insert mode!"); 33 33 break; 34 34 } -
issm/branches/trunk-jpl-damage/src/c/toolkits/petsc/patches/ISSMToPetscMatrixType.cpp
r12878 r13101 30 30 break; 31 31 default: 32 _error 2_("unknown matrix type !");32 _error_("unknown matrix type !"); 33 33 break; 34 34 } -
issm/branches/trunk-jpl-damage/src/c/toolkits/petsc/patches/ISSMToPetscNormMode.cpp
r12878 r13101 30 30 break; 31 31 default: 32 _error 2_("unknown norm !");32 _error_("unknown norm !"); 33 33 break; 34 34 } -
issm/branches/trunk-jpl-damage/src/c/toolkits/petsc/patches/MatInvert.cpp
r12878 r13101 29 29 /*Some checks: */ 30 30 MatGetSize(matrix,&M,&N); 31 if(M!=N) _error 2_("trying to invert a non square matrix!");31 if(M!=N) _error_("trying to invert a non square matrix!"); 32 32 33 33 /*Create identitiy matrix: */ -
issm/branches/trunk-jpl-damage/src/c/toolkits/petsc/patches/MatPartition.cpp
r12878 r13101 62 62 } 63 63 else{ 64 _error 2_("MatType " << type << " not supported yet");64 _error_("MatType " << type << " not supported yet"); 65 65 } 66 66 /*Assemble*/ -
issm/branches/trunk-jpl-damage/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp
r12878 r13101 55 55 if(first[0]!='-'){ 56 56 /*This is not good, the option does not have '-'! Get out*/ 57 _error 2_("Option " << first << " should be preceded by '-'!");57 _error_("Option " << first << " should be preceded by '-'!"); 58 58 } 59 59 /*Reduce first to bare option value*/ -
issm/branches/trunk-jpl-damage/src/c/toolkits/petsc/patches/VecMerge.cpp
r12878 r13101 35 35 /*If the dimension of the partitioning vector is not the same as that of vector B, we have a problem: */ 36 36 if ( (row_partition_size !=MB) ){ 37 _error 2_("Dimensions of partitioning vector incompatible with dimensions of input vector\n");37 _error_("Dimensions of partitioning vector incompatible with dimensions of input vector\n"); 38 38 } 39 39 -
issm/branches/trunk-jpl-damage/src/c/toolkits/plapack/patches/PlapackInvertMatrix.cpp
r12878 r13101 51 51 52 52 /*Some dimensions checks: */ 53 if (mA!=nA) _error 2_("trying to take the invert of a non-square matrix!");53 if (mA!=nA) _error_("trying to take the invert of a non-square matrix!"); 54 54 55 55 /* Set default Plapack parameters */ -
issm/branches/trunk-jpl-damage/src/m/Makefile.am
r12946 r13101 1 bin_SCRIPTS=./classes/*.m \ 2 ./classes/model/*.m \ 3 ./classes/clusters/*.m \ 4 ./enum/*.m \ 5 ./kml/*.m \ 6 ./model/*.m \ 7 ./model/plot/*.m \ 8 ./model/mesh/*.m \ 9 ./model/display/*.m \ 10 ./model/parameterization/*.m \ 11 ./model/partition/*.m \ 12 ./model/solvers/*.m \ 13 ./qmu/*.m \ 14 ./utils/*.m \ 15 ./utils/Array/*.m \ 16 ./utils/BC/*.m \ 17 ./utils/Basins/*.m \ 18 ./utils/Cluster/*.m \ 19 ./utils/DataProcessing/*.m \ 20 ./utils/Ecco3/*.m \ 21 ./utils/Exp/*.m \ 22 ./utils/Exp/manipulation/*.m \ 23 ./utils/Exp/readwrite/*.m \ 24 ./utils/Geometry/*.m \ 25 ./utils/ImageProcessing/*.m \ 26 ./utils/Interp/*.m \ 27 ./utils/Kml/*.m \ 28 ./utils/LatLong/*.m \ 29 ./utils/Math/*.m \ 30 ./utils/Meca/*.m \ 31 ./utils/Mesh/*.m \ 32 ./utils/Miscellaneous/*.m \ 33 ./utils/Model/*.m \ 34 ./utils/Numerics/*.m \ 35 ./utils/OS/*.m \ 36 ./utils/Plot/*.m \ 37 ./utils/Shell/*.m \ 38 ./utils/String/*.m \ 39 ./utils/consistency/*.m \ 40 ./utils/qmu/*.m 1 #To generate list of directories 2 # 3 #find . -type d -exec ls -d {} \; 4 5 bin_SCRIPTS= ./qmu/*.m \ 6 ./qmu/setupdesign/*.m \ 7 ./qmu/plot/*.m \ 8 ./qmu/examples/*.m \ 9 ./kml/*.m \ 10 ./enum/*.m \ 11 ./classes/*.m \ 12 ./classes/qmu/*.m \ 13 ./classes/qmu/@dakota_method/*.m \ 14 ./classes/clusters/*.m \ 15 ./classes/model/*.m \ 16 ./consistency/*.m \ 17 ./array/*.m \ 18 ./boundaryconditions/*.m \ 19 ./exp/*.m \ 20 ./exp/manipulation/*.m \ 21 ./geometry/*.m \ 22 ./interp/*.m \ 23 ./latlong/*.m \ 24 ./meca/*.m \ 25 ./mesh/*.m \ 26 ./mesh/planet/*.m \ 27 ./mesh/rifts/*.m \ 28 ./miscellaneous/*.m \ 29 ./os/*.m \ 30 ./plot/*.m \ 31 ./plot/colormaps/*.m \ 32 ./string/*.m \ 33 ./contrib/massbalance/*.m \ 34 ./contrib/ecco/*.m \ 35 ./contrib/hydrology/*.m \ 36 ./contrib/hack/*.m \ 37 ./contrib/gslib/*.m \ 38 ./contrib/uci/*.m \ 39 ./contrib/oasis/*.m \ 40 ./contrib/bamg/*.m \ 41 ./extrusion/*.m \ 42 ./inversions/*.m \ 43 ./io/*.m \ 44 ./parameterization/*.m \ 45 ./partition/*.m \ 46 ./print/*.m \ 47 ./regional/*.m \ 48 ./solve/*.m \ 49 ./solvers/*.m \ 50 ./materials/*.m -
issm/branches/trunk-jpl-damage/src/m/classes/autodiff.m
r12878 r13101 7 7 properties (SetAccess=public) 8 8 isautodiff = false; 9 forward = true;10 reverse = false;11 9 end 12 10 methods … … 29 27 30 28 fielddisplay(obj,'isautodiff','indicates if the automatic differentiation is activated'); 31 fielddisplay(obj,'forward','forward differentiation');32 fielddisplay(obj,'reverse','backward differentiation');33 29 34 30 end % }}} 35 31 function marshall(obj,fid) % {{{ 36 32 WriteData(fid,'object',obj,'fieldname','isautodiff','format','Boolean'); 37 WriteData(fid,'object',obj,'fieldname','forward','format','Boolean');38 WriteData(fid,'object',obj,'fieldname','reverse','format','Boolean');39 33 end % }}} 40 34 end -
issm/branches/trunk-jpl-damage/src/m/classes/autodiff.py
r12168 r13101 1 1 #module imports 2 2 from fielddisplay import fielddisplay 3 from EnumDefinitions import * 4 from checkfield import * 5 from WriteData import * 3 6 4 class autodiff: 7 class autodiff(object): 8 """ 9 AUTODIFF class definition 10 11 Usage: 12 autodiff=autodiff(); 13 """ 14 5 15 #properties 6 16 def __init__(self): 7 17 # {{{ Properties 8 18 self.isautodiff = False 9 self.forward = True10 self.reverse = False11 19 12 20 #set defaults … … 14 22 15 23 #}}} 16 def __repr__( obj):24 def __repr__(self): 17 25 # {{{ Display 18 26 string=' automatic differentiation parameters:' 19 string="%s\n%s"%(string,fielddisplay(obj,'isautodiff','indicates if the automatic differentiation is activated')) 20 string="%s\n%s"%(string,fielddisplay(obj,'forward','forward differentiation')) 21 string="%s\n%s"%(string,fielddisplay(obj,'reverse','backward differentiation')) 27 string="%s\n%s"%(string,fielddisplay(self,'isautodiff','indicates if the automatic differentiation is activated')) 22 28 return string 23 29 #}}} 24 def setdefaultparameters( obj):30 def setdefaultparameters(self): 25 31 # {{{setdefaultparameters 26 return obj32 return self 27 33 #}}} 28 34 35 def checkconsistency(self,md,solution,analyses): # {{{ 36 return md 37 # }}} 38 39 def marshall(self,fid): # {{{ 40 WriteData(fid,'object',self,'fieldname','isautodiff','format','Boolean') 41 # }}} 42 -
issm/branches/trunk-jpl-damage/src/m/classes/balancethickness.m
r12878 r13101 27 27 function md = checkconsistency(obj,md,solution,analyses) % {{{ 28 28 %Early return 29 if solution~=BalancethicknessSolutionEnum , return; end29 if solution~=BalancethicknessSolutionEnum(), return; end 30 30 31 31 md = checkfield(md,'balancethickness.spcthickness','forcing',1); -
issm/branches/trunk-jpl-damage/src/m/classes/balancethickness.py
r12168 r13101 1 1 #module imports 2 2 from fielddisplay import fielddisplay 3 class balancethickness: 3 from EnumDefinitions import * 4 from checkfield import * 5 from WriteData import * 6 7 class balancethickness(object): 8 """ 9 BALANCETHICKNESS class definition 10 11 Usage: 12 balancethickness=balancethickness(); 13 """ 14 4 15 #properties 5 16 def __init__(self): 6 17 # {{{ Properties 7 self.spcthickness = float('NaN')8 self.thickening_rate 9 self.stabilization 18 self.spcthickness = float('NaN') 19 self.thickening_rate = float('NaN') 20 self.stabilization = 0 10 21 11 22 #set defaults … … 13 24 14 25 #}}} 15 def __repr__( obj):26 def __repr__(self): 16 27 # {{{ Display 17 28 18 29 string=' balance thickness solution parameters:' 19 30 20 string="%s\n\n%s"%(string,fielddisplay( obj,'spcthickness','thickness constraints (NaN means no constraint)'))21 string="%s\n%s"%(string,fielddisplay( obj,'thickening_rate','ice thickening rate used in the mass conservation (dh/dt)'))22 string="%s\n%s"%(string,fielddisplay( obj,'stabilization','0: None, 1: SU, 2: MacAyeal''s artificial diffusivity, 3:DG'))31 string="%s\n\n%s"%(string,fielddisplay(self,'spcthickness','thickness constraints (NaN means no constraint)')) 32 string="%s\n%s"%(string,fielddisplay(self,'thickening_rate','ice thickening rate used in the mass conservation (dh/dt)')) 33 string="%s\n%s"%(string,fielddisplay(self,'stabilization',"0: None, 1: SU, 2: MacAyeal's artificial diffusivity, 3:DG")) 23 34 return string 24 35 #}}} 25 def setdefaultparameters( obj):36 def setdefaultparameters(self): 26 37 # {{{setdefaultparameters 27 38 28 39 #Type of stabilization used 29 obj.stabilization=140 self.stabilization=1 30 41 31 return obj42 return self 32 43 #}}} 33 44 45 def checkconsistency(self,md,solution,analyses): # {{{ 46 #Early return 47 if not solution==BalancethicknessSolutionEnum(): 48 return md 49 50 md = checkfield(md,'balancethickness.spcthickness','forcing',1) 51 md = checkfield(md,'balancethickness.thickening_rate','size',[md.mesh.numberofvertices],'NaN',1) 52 md = checkfield(md,'balancethickness.stabilization','size',[1],'values',[0,1,2,3]) 53 54 return md 55 # }}} 56 57 def marshall(self,fid): # {{{ 58 WriteData(fid,'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1) 59 WriteData(fid,'object',self,'fieldname','thickening_rate','format','DoubleMat','mattype',1) 60 WriteData(fid,'object',self,'fieldname','stabilization','format','Integer') 61 # }}} 62 -
issm/branches/trunk-jpl-damage/src/m/classes/basalforcings.m
r12878 r13101 24 24 function md = checkconsistency(obj,md,solution,analyses) % {{{ 25 25 26 if ismember(PrognosticAnalysisEnum ,analyses) & ~(solution==TransientSolutionEnum& md.transient.isprognostic==0),26 if ismember(PrognosticAnalysisEnum(),analyses) & ~(solution==TransientSolutionEnum() & md.transient.isprognostic==0), 27 27 md = checkfield(md,'basalforcings.melting_rate','NaN',1,'forcing',1); 28 28 end 29 if ismember(BalancethicknessAnalysisEnum ,analyses),29 if ismember(BalancethicknessAnalysisEnum(),analyses), 30 30 md = checkfield(md,'basalforcings.melting_rate','NaN',1,'size',[md.mesh.numberofvertices 1]); 31 31 end 32 if ismember(ThermalAnalysisEnum ,analyses) & ~(solution==TransientSolutionEnum& md.transient.isthermal==0),32 if ismember(ThermalAnalysisEnum(),analyses) & ~(solution==TransientSolutionEnum() & md.transient.isthermal==0), 33 33 md = checkfield(md,'basalforcings.melting_rate','NaN',1,'forcing',1); 34 34 md = checkfield(md,'basalforcings.geothermalflux','NaN',1,'forcing',1,'>=',0); -
issm/branches/trunk-jpl-damage/src/m/classes/basalforcings.py
r12168 r13101 1 1 #module imports 2 2 from fielddisplay import fielddisplay 3 from EnumDefinitions import * 4 from checkfield import * 5 from WriteData import * 3 6 4 class basalforcings: 7 class basalforcings(object): 8 """ 9 BASAL FORCINGS class definition 10 11 Usage: 12 basalforcings=basalforcings(); 13 """ 14 5 15 #properties 6 16 def __init__(self): … … 14 24 15 25 #}}} 16 def __repr__( obj):26 def __repr__(self): 17 27 # {{{ Display 18 28 string=" basal forcings parameters:" 19 29 20 string="%s\n\n%s"%(string,fielddisplay( obj,"melting_rate","basal melting rate (positive if melting)"))21 string="%s\n%s"%(string,fielddisplay( obj,"melting_rate_correction","additional melting applied when the grounding line retreats"))22 string="%s\n%s"%(string,fielddisplay( obj,"geothermalflux","geothermal heat flux [W/m^2]"))30 string="%s\n\n%s"%(string,fielddisplay(self,"melting_rate","basal melting rate (positive if melting)")) 31 string="%s\n%s"%(string,fielddisplay(self,"melting_rate_correction","additional melting applied when the grounding line retreats")) 32 string="%s\n%s"%(string,fielddisplay(self,"geothermalflux","geothermal heat flux [W/m^2]")) 23 33 return string 24 34 #}}} 25 def setdefaultparameters( obj):35 def setdefaultparameters(self): 26 36 # {{{setdefaultparameters 27 return obj37 return self 28 38 #}}} 29 39 40 def checkconsistency(self,md,solution,analyses): # {{{ 41 42 if PrognosticAnalysisEnum() in analyses and not (solution==TransientSolutionEnum() and not md.transient.isprognostic): 43 md = checkfield(md,'basalforcings.melting_rate','NaN',1,'forcing',1) 44 45 if BalancethicknessAnalysisEnum() in analyses: 46 md = checkfield(md,'basalforcings.melting_rate','NaN',1,'size',[md.mesh.numberofvertices]) 47 48 if ThermalAnalysisEnum() in analyses and not (solution==TransientSolutionEnum() and not md.transient.isthermal): 49 md = checkfield(md,'basalforcings.melting_rate','NaN',1,'forcing',1) 50 md = checkfield(md,'basalforcings.geothermalflux','NaN',1,'forcing',1,'>=',0) 51 52 return md 53 # }}} 54 55 def marshall(self,fid): # {{{ 56 WriteData(fid,'object',self,'fieldname','melting_rate','format','DoubleMat','mattype',1) 57 WriteData(fid,'object',self,'fieldname','melting_rate_correction','format','DoubleMat','mattype',1) 58 WriteData(fid,'object',self,'fieldname','geothermalflux','format','DoubleMat','mattype',1) 59 # }}} 60 -
issm/branches/trunk-jpl-damage/src/m/classes/clusters/generic.m
r12878 r13101 77 77 %Add --gen-suppressions=all to get suppression lines 78 78 fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib); 79 fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',... 79 if ismac, 80 fprintf(fid,'mpiexec -np %i %s --leak-check=full --dsymutil=yes --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',... 80 81 cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname); 82 else 83 fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',... 84 cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname); 85 end 81 86 end 82 87 if ~io_gather, %concatenate the output files: -
issm/branches/trunk-jpl-damage/src/m/classes/clusters/generic.py
r12946 r13101 4 4 import platform 5 5 import subprocess 6 from EnumToString import EnumToString 6 7 from issmdir import * 7 8 from pairoptions import * … … 73 74 74 75 #write queuing script 75 if not 'Windows'in platform.system():76 if 'Windows' not in platform.system(): 76 77 77 78 fid=open(modelname+'.queue','w') … … 79 80 if not isvalgrind: 80 81 if self.interactive: 81 fid.write('mpiexec -np %i %s/issm.exe %s %s %s ' % (self.np,self.codepath,EnumToString(solution) ,self.executionpath,modelname))82 fid.write('mpiexec -np %i %s/issm.exe %s %s %s ' % (self.np,self.codepath,EnumToString(solution)[0],self.executionpath,modelname)) 82 83 else: 83 fid.write('mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ' % (self.np,self.codepath,EnumToString(solution) ,self.executionpath,modelname,modelname,modelname))84 fid.write('mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ' % (self.np,self.codepath,EnumToString(solution)[0],self.executionpath,modelname,modelname,modelname)) 84 85 elif isgprof: 85 86 fid.write('\n gprof %s/issm.exe gmon.out > %s.performance' % (self.codepath,modelname)) … … 88 89 fid.write('LD_PRELOAD=%s \\\n' % self.valgrindlib) 89 90 fid.write('mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ' % \ 90 (self.np,self.valgrind,self.valgrindsup,self.codepath,EnumToString(solution) ,self.executionpath,modelname,modelname,modelname))91 (self.np,self.valgrind,self.valgrindsup,self.codepath,EnumToString(solution)[0],self.executionpath,modelname,modelname,modelname)) 91 92 if not io_gather: #concatenate the output files: 92 93 fid.write('\ncat %s.outbin.* > %s.outbin' % (modelname,modelname)) … … 98 99 fid.write('@echo off\n') 99 100 if self.interactive: 100 fid.write('"%s/issm.exe" %s "%s" %s ' % (self.codepath,EnumToString(solution) ,self.executionpath,modelname))101 fid.write('"%s/issm.exe" %s "%s" %s ' % (self.codepath,EnumToString(solution)[0],self.executionpath,modelname)) 101 102 else: 102 103 fid.write('"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog' % \ 103 (self.codepath,EnumToString(solution) ,self.executionpath,modelname,modelname,modelname))104 (self.codepath,EnumToString(solution)[0],self.executionpath,modelname,modelname,modelname)) 104 105 fid.close() 105 106 … … 115 116 116 117 #write queuing script 117 if not 'Windows'in platform.system():118 if 'Windows' not in platform.system(): 118 119 119 120 fid=open(modelname+'.queue','w') … … 140 141 fid.write('@echo off\n') 141 142 if self.interactive: 142 fid.write('"%s/issm.exe" %s "%s" %s ' % (self.codepath,EnumToString(solution) ,self.executionpath,modelname))143 fid.write('"%s/issm.exe" %s "%s" %s ' % (self.codepath,EnumToString(solution)[0],self.executionpath,modelname)) 143 144 else: 144 145 fid.write('"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog' % \ 145 (self.codepath,EnumToString(solution) ,self.executionpath,modelname,modelname,modelname))146 (self.codepath,EnumToString(solution)[0],self.executionpath,modelname,modelname,modelname)) 146 147 fid.close() 147 148 -
issm/branches/trunk-jpl-damage/src/m/classes/constants.py
r12168 r13101 1 1 #module imports 2 2 from fielddisplay import fielddisplay 3 from EnumDefinitions import * 4 from checkfield import * 5 from WriteData import * 3 6 4 class constants: 7 class constants(object): 8 """ 9 CONSTANTS class definition 10 11 Usage: 12 constants=constants(); 13 """ 14 5 15 #properties 6 16 def __init__(self): … … 14 24 15 25 #}}} 16 def __repr__( obj):26 def __repr__(self): 17 27 # {{{ Display 18 28 string=" constants parameters:" 19 string="%s\n\n%s"%(string,fielddisplay( obj,"g","gravitational acceleration"))20 string="%s\n%s"%(string,fielddisplay( obj,"yts","number of seconds in a year"))21 string="%s\n%s"%(string,fielddisplay( obj,"referencetemperature","reference temperature used in the enthalpy model"))29 string="%s\n\n%s"%(string,fielddisplay(self,"g","gravitational acceleration")) 30 string="%s\n%s"%(string,fielddisplay(self,"yts","number of seconds in a year")) 31 string="%s\n%s"%(string,fielddisplay(self,"referencetemperature","reference temperature used in the enthalpy model")) 22 32 23 33 … … 25 35 #}}} 26 36 27 def setdefaultparameters( obj):37 def setdefaultparameters(self): 28 38 # {{{setdefaultparameters 29 39 30 40 #acceleration due to gravity (m/s^2) 31 obj.g=9.8141 self.g=9.81 32 42 33 43 #converstion from year to seconds 34 obj.yts=365*24*360044 self.yts=365*24*3600 35 45 36 46 #the reference temperature for enthalpy model (cf Aschwanden) 37 obj.referencetemperature=223.1547 self.referencetemperature=223.15 38 48 39 return obj49 return self 40 50 #}}} 41 51 52 def checkconsistency(self,md,solution,analyses): # {{{ 53 54 md = checkfield(md,'constants.g','>',0,'size',[1]) 55 md = checkfield(md,'constants.yts','>',0,'size',[1]) 56 md = checkfield(md,'constants.referencetemperature','size',[1]) 57 58 return md 59 # }}} 60 61 def marshall(self,fid): # {{{ 62 WriteData(fid,'object',self,'fieldname','g','format','Double') 63 WriteData(fid,'object',self,'fieldname','yts','format','Double') 64 WriteData(fid,'object',self,'fieldname','referencetemperature','format','Double') 65 # }}} 66 -
issm/branches/trunk-jpl-damage/src/m/classes/debug.py
r12168 r13101 1 1 #module imports 2 2 from fielddisplay import fielddisplay 3 from WriteData import * 3 4 4 class debug: 5 class debug(object): 6 """ 7 DEBUG class definition 8 9 Usage: 10 debug=debug(); 11 """ 12 5 13 #properties 6 14 def __init__(self): 7 15 # {{{ Properties 8 self.valgrind=False 9 self.gprof = False 16 self.valgrind = False 17 self.gprof = False 18 self.profiling = False 10 19 11 20 #set defaults … … 13 22 14 23 #}}} 15 def __repr__( obj):24 def __repr__(self): 16 25 # {{{ Display 17 26 string=" debug parameters:" 18 27 19 string="%s\n\n%s"%(string,fielddisplay(obj,"valgrind","use Valgrind to debug (0 or 1)")) 20 string="%s\n%s"%(string,fielddisplay(obj,"gprof","use gnu-profiler to find out where the time is spent")) 28 string="%s\n\n%s"%(string,fielddisplay(self,"valgrind","use Valgrind to debug (0 or 1)")) 29 string="%s\n%s"%(string,fielddisplay(self,"gprof","use gnu-profiler to find out where the time is spent")) 30 string="%s\n%s"%(string,fielddisplay(self,'profiling','enables profiling (memory, flops, time)')) 21 31 return string 22 32 #}}} 23 33 24 def setdefaultparameters( obj):34 def setdefaultparameters(self): 25 35 # {{{setdefaultparameters 26 return obj36 return self 27 37 #}}} 28 38 39 def marshall(self,fid): # {{{ 40 WriteData(fid,'object',self,'fieldname','profiling','format','Boolean') 41 # }}} 42 -
issm/branches/trunk-jpl-damage/src/m/classes/diagnostic.m
r12946 r13101 67 67 68 68 %Early return 69 if ~ismember(DiagnosticHorizAnalysisEnum ,analyses), return; end70 %if ~ismember(DiagnosticHorizAnalysisEnum ,analyses) | (solution==TransientSolutionEnum& md.transient.isdiagnostic==0), return; end69 if ~ismember(DiagnosticHorizAnalysisEnum(),analyses), return; end 70 %if ~ismember(DiagnosticHorizAnalysisEnum(),analyses) | (solution==TransientSolutionEnum() & md.transient.isdiagnostic==0), return; end 71 71 72 72 md = checkfield(md,'diagnostic.spcvx','forcing',1); … … 76 76 md = checkfield(md,'diagnostic.reltol','size',[1 1]); 77 77 md = checkfield(md,'diagnostic.abstol','size',[1 1]); 78 md = checkfield(md,'diagnostic.isnewton','numel', 1,'values',[0 1]);78 md = checkfield(md,'diagnostic.isnewton','numel',[1],'values',[0 1]); 79 79 md = checkfield(md,'diagnostic.stokesreconditioning','size',[1 1],'NaN',1); 80 80 md = checkfield(md,'diagnostic.viscosity_overshoot','size',[1 1],'NaN',1); … … 102 102 if any(sum(isnan(md.diagnostic.referential),2)==0), 103 103 pos=find(sum(isnan(md.diagnostic.referential),2)==0); 104 if any(abs(dot(md.diagnostic.referential(pos,1:3) ',md.diagnostic.referential(pos,4:6)'))>eps),105 md = checkmessage(md,['Vectors in diagnostic.referential (colum s 1 to 3 and 4 to 6) must be orthogonal']);104 if any(abs(dot(md.diagnostic.referential(pos,1:3),md.diagnostic.referential(pos,4:6),2))>eps), 105 md = checkmessage(md,['Vectors in diagnostic.referential (columns 1 to 3 and 4 to 6) must be orthogonal']); 106 106 end 107 107 end … … 168 168 %marshall ice front 169 169 data=obj.icefront; 170 pos=find(data(:,end)==0); data(pos,end)=AirEnum ;171 pos=find(data(:,end)==1); data(pos,end)=WaterEnum ;172 pos=find(data(:,end)==2); data(pos,end)=IceEnum ;173 WriteData(fid,'data',data,'enum',DiagnosticIcefrontEnum ,'format','DoubleMat','mattype',3);170 pos=find(data(:,end)==0); data(pos,end)=AirEnum(); 171 pos=find(data(:,end)==1); data(pos,end)=WaterEnum(); 172 pos=find(data(:,end)==2); data(pos,end)=IceEnum(); 173 WriteData(fid,'data',data,'enum',DiagnosticIcefrontEnum(),'format','DoubleMat','mattype',3); 174 174 end % }}} 175 175 end -
issm/branches/trunk-jpl-damage/src/m/classes/diagnostic.py
r12168 r13101 1 1 #module imports 2 import numpy 3 import sys 2 4 from fielddisplay import fielddisplay 5 from EnumDefinitions import * 6 from checkfield import * 7 from WriteData import * 3 8 4 class diagnostic: 9 class diagnostic(object): 10 """ 11 DIAGNOSTIC class definition 12 13 Usage: 14 diagnostic=diagnostic(); 15 """ 16 5 17 #properties 6 18 def __init__(self): … … 29 41 30 42 #}}} 31 def __repr__( obj):43 def __repr__(self): 32 44 # {{{ Display 33 34 45 35 46 string='\n Diagnostic solution parameters:' 36 47 string="%s\n\n%s"%(string,' Convergence criteria:') 37 48 38 string="%s\n%s"%(string,fielddisplay( obj,'restol','mechanical equilibrium residual convergence criterion'))39 string="%s\n%s"%(string,fielddisplay( obj,'reltol','velocity relative convergence criterion, NaN -> not applied'))40 string="%s\n%s"%(string,fielddisplay( obj,'abstol','velocity absolute convergence criterion, NaN -> not applied'))41 string="%s\n%s"%(string,fielddisplay( obj,'isnewton','Apply Newton''s method instead of a Picard fixed point method'))42 string="%s\n%s"%(string,fielddisplay( obj,'maxiter','maximum number of nonlinear iterations'))43 string="%s\n%s"%(string,fielddisplay( obj,'viscosity_overshoot','over-shooting constant new=new+C*(new-old)'))49 string="%s\n%s"%(string,fielddisplay(self,'restol','mechanical equilibrium residual convergence criterion')) 50 string="%s\n%s"%(string,fielddisplay(self,'reltol','velocity relative convergence criterion, NaN -> not applied')) 51 string="%s\n%s"%(string,fielddisplay(self,'abstol','velocity absolute convergence criterion, NaN -> not applied')) 52 string="%s\n%s"%(string,fielddisplay(self,'isnewton',"Apply Newton's method instead of a Picard fixed point method")) 53 string="%s\n%s"%(string,fielddisplay(self,'maxiter','maximum number of nonlinear iterations')) 54 string="%s\n%s"%(string,fielddisplay(self,'viscosity_overshoot','over-shooting constant new=new+C*(new-old)')) 44 55 45 56 string="%s\n%s"%(string,' boundary conditions:') 46 57 47 string="%s\n%s"%(string,fielddisplay( obj,'spcvx','x-axis velocity constraint (NaN means no constraint)'))48 string="%s\n%s"%(string,fielddisplay( obj,'spcvy','y-axis velocity constraint (NaN means no constraint)'))49 string="%s\n%s"%(string,fielddisplay( obj,'spcvz','z-axis velocity constraint (NaN means no constraint)'))50 string="%s\n%s"%(string,fielddisplay( obj,'icefront','segments on ice front list (last column 0-> Air, 1-> Water, 2->Ice'))58 string="%s\n%s"%(string,fielddisplay(self,'spcvx','x-axis velocity constraint (NaN means no constraint)')) 59 string="%s\n%s"%(string,fielddisplay(self,'spcvy','y-axis velocity constraint (NaN means no constraint)')) 60 string="%s\n%s"%(string,fielddisplay(self,'spcvz','z-axis velocity constraint (NaN means no constraint)')) 61 string="%s\n%s"%(string,fielddisplay(self,'icefront','segments on ice front list (last column 0-> Air, 1-> Water, 2->Ice')) 51 62 52 63 string="%s\n%s"%(string,' Rift options:') 53 string="%s\n%s"%(string,fielddisplay( obj,'rift_penalty_threshold','threshold for instability of mechanical constraints'))54 string="%s\n%s"%(string,fielddisplay( obj,'rift_penalty_lock','number of iterations before rift penalties are locked'))64 string="%s\n%s"%(string,fielddisplay(self,'rift_penalty_threshold','threshold for instability of mechanical constraints')) 65 string="%s\n%s"%(string,fielddisplay(self,'rift_penalty_lock','number of iterations before rift penalties are locked')) 55 66 56 67 string="%s\n%s"%(string,' Penalty options:') 57 string="%s\n%s"%(string,fielddisplay( obj,'penalty_factor','offset used by penalties: penalty = Kmax*10^offset'))58 string="%s\n%s"%(string,fielddisplay( obj,'vertex_pairing','pairs of vertices that are penalized'))68 string="%s\n%s"%(string,fielddisplay(self,'penalty_factor','offset used by penalties: penalty = Kmax*10^offset')) 69 string="%s\n%s"%(string,fielddisplay(self,'vertex_pairing','pairs of vertices that are penalized')) 59 70 60 71 string="%s\n%s"%(string,' Other:') 61 string="%s\n%s"%(string,fielddisplay( obj,'shelf_dampening','use dampening for floating ice ? Only for Stokes model'))62 string="%s\n%s"%(string,fielddisplay( obj,'stokesreconditioning','multiplier for incompressibility equation. Only for Stokes model'))63 string="%s\n%s"%(string,fielddisplay( obj,'referential','local referential'))64 string="%s\n%s"%(string,fielddisplay( obj,'requested_outputs','additional outputs requested'))72 string="%s\n%s"%(string,fielddisplay(self,'shelf_dampening','use dampening for floating ice ? Only for Stokes model')) 73 string="%s\n%s"%(string,fielddisplay(self,'stokesreconditioning','multiplier for incompressibility equation. Only for Stokes model')) 74 string="%s\n%s"%(string,fielddisplay(self,'referential','local referential')) 75 string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested')) 65 76 66 77 return string 67 78 #}}} 68 79 69 def setdefaultparameters( obj):80 def setdefaultparameters(self): 70 81 # {{{setdefaultparameters 71 82 #maximum of non-linear iterations. 72 obj.maxiter=10083 self.maxiter=100 73 84 74 85 #Convergence criterion: absolute, relative and residual 75 obj.restol=10**-4;76 obj.reltol=0.0177 obj.abstol=1086 self.restol=10**-4 87 self.reltol=0.01 88 self.abstol=10 78 89 79 obj.stokesreconditioning=10**1380 obj.shelf_dampening=090 self.stokesreconditioning=10**13 91 self.shelf_dampening=0 81 92 82 93 #Penalty factor applied kappa=max(stiffness matrix)*10^penalty_factor 83 obj.penalty_factor=394 self.penalty_factor=3 84 95 85 96 #coefficient to update the viscosity between each iteration of 86 97 #a diagnostic according to the following formula 87 98 #viscosity(n)=viscosity(n)+viscosity_overshoot(viscosity(n)-viscosity(n-1)) 88 obj.viscosity_overshoot=099 self.viscosity_overshoot=0 89 100 90 101 #Stop the iterations of rift if below a threshold 91 obj.rift_penalty_threshold=0102 self.rift_penalty_threshold=0 92 103 93 104 #in some solutions, it might be needed to stop a run when only 94 105 #a few constraints remain unstable. For thermal computation, this 95 106 #parameter is often used. 96 obj.rift_penalty_lock=10107 self.rift_penalty_lock=10 97 108 98 return obj109 return self 99 110 #}}} 111 112 def checkconsistency(self,md,solution,analyses): # {{{ 113 114 #Early return 115 if DiagnosticHorizAnalysisEnum() not in analyses: 116 return md 117 #if (DiagnosticHorizAnalysisEnum() not in analyses) | (solution==TransientSolutionEnum() and not md.transient.isdiagnostic): 118 # return md 119 120 md = checkfield(md,'diagnostic.spcvx','forcing',1) 121 md = checkfield(md,'diagnostic.spcvy','forcing',1) 122 if md.mesh.dimension==3: 123 md = checkfield(md,'diagnostic.spcvz','forcing',1) 124 md = checkfield(md,'diagnostic.restol','size',[1],'>',0) 125 md = checkfield(md,'diagnostic.reltol','size',[1]) 126 md = checkfield(md,'diagnostic.abstol','size',[1]) 127 md = checkfield(md,'diagnostic.isnewton','numel',[1],'values',[0,1]) 128 md = checkfield(md,'diagnostic.stokesreconditioning','size',[1],'NaN',1) 129 md = checkfield(md,'diagnostic.viscosity_overshoot','size',[1],'NaN',1) 130 if md.mesh.dimension==2: 131 md = checkfield(md,'diagnostic.icefront','size',[float('NaN'),4],'NaN',1) 132 else: 133 md = checkfield(md,'diagnostic.icefront','size',[float('NaN'),6],'NaN',1) 134 md = checkfield(md,'diagnostic.icefront[:,-1]','values',[0,1,2]) 135 md = checkfield(md,'diagnostic.maxiter','size',[1],'>=',1) 136 md = checkfield(md,'diagnostic.referential','size',[md.mesh.numberofvertices,6]) 137 if not md.diagnostic.requested_outputs: 138 md = checkfield(md,'diagnostic.requested_outputs','size',[float('NaN'),1]) 139 140 #singular solution 141 # if ~any((~isnan(md.diagnostic.spcvx)+~isnan(md.diagnostic.spcvy))==2), 142 if not numpy.any(numpy.logical_and(numpy.logical_not(numpy.isnan(md.diagnostic.spcvx)),numpy.logical_not(numpy.isnan(md.diagnostic.spcvy)))): 143 md.checkmessage("model is not well posed (singular). You need at least one node with fixed velocity!") 144 #CHECK THAT EACH LINES CONTAINS ONLY NAN VALUES OR NO NAN VALUES 145 # if any(sum(isnan(md.diagnostic.referential),2)~=0 & sum(isnan(md.diagnostic.referential),2)~=6), 146 if numpy.any(numpy.logical_and(numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)!=0,numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)!=6)): 147 md.checkmessage("Each line of diagnostic.referential should contain either only NaN values or no NaN values") 148 #CHECK THAT THE TWO VECTORS PROVIDED ARE ORTHOGONAL 149 # if any(sum(isnan(md.diagnostic.referential),2)==0), 150 if numpy.any(numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)==0): 151 pos=[i for i,item in enumerate(numpy.sum(numpy.isnan(md.diagnostic.referential),axis=1)) if item==0] 152 # numpy.inner (and numpy.dot) calculate all the dot product permutations, resulting in a full matrix multiply 153 # if numpy.any(numpy.abs(numpy.inner(md.diagnostic.referential[pos,0:2],md.diagnostic.referential[pos,3:5]).diagonal())>sys.float_info.epsilon): 154 # md.checkmessage("Vectors in diagnostic.referential (columns 1 to 3 and 4 to 6) must be orthogonal") 155 for item in md.diagnostic.referential[pos,:]: 156 if numpy.abs(numpy.inner(item[0:2],item[3:5]))>sys.float_info.epsilon: 157 md.checkmessage("Vectors in diagnostic.referential (columns 1 to 3 and 4 to 6) must be orthogonal") 158 #CHECK THAT NO rotation specified for FS Grounded ice at base 159 # if md.mesh.dimension==3 & md.flowequation.isstokes, 160 if md.mesh.dimension==3 and md.flowequation.isstokes: 161 pos=numpy.nonzero(numpy.logical_and(md.mask.vertexongroundedice,md.mesh.vertexonbed)) 162 if numpy.any(numpy.logical_not(numpy.isnan(md.diagnostic.referential[pos,:]))): 163 md.checkmessage("no referential should be specified for basal vertices of grounded ice") 164 165 return md 166 # }}} 167 168 def marshall(self,fid): # {{{ 169 WriteData(fid,'object',self,'fieldname','spcvx','format','DoubleMat','mattype',1) 170 WriteData(fid,'object',self,'fieldname','spcvy','format','DoubleMat','mattype',1) 171 WriteData(fid,'object',self,'fieldname','spcvz','format','DoubleMat','mattype',1) 172 WriteData(fid,'object',self,'fieldname','restol','format','Double') 173 WriteData(fid,'object',self,'fieldname','reltol','format','Double') 174 WriteData(fid,'object',self,'fieldname','abstol','format','Double') 175 WriteData(fid,'object',self,'fieldname','isnewton','format','Boolean') 176 WriteData(fid,'object',self,'fieldname','stokesreconditioning','format','Double') 177 WriteData(fid,'object',self,'fieldname','viscosity_overshoot','format','Double') 178 WriteData(fid,'object',self,'fieldname','maxiter','format','Integer') 179 WriteData(fid,'object',self,'fieldname','shelf_dampening','format','Integer') 180 WriteData(fid,'object',self,'fieldname','vertex_pairing','format','DoubleMat','mattype',3) 181 WriteData(fid,'object',self,'fieldname','penalty_factor','format','Double') 182 WriteData(fid,'object',self,'fieldname','rift_penalty_lock','format','Integer') 183 WriteData(fid,'object',self,'fieldname','rift_penalty_threshold','format','Integer') 184 WriteData(fid,'object',self,'fieldname','referential','format','DoubleMat','mattype',1) 185 WriteData(fid,'object',self,'fieldname','requested_outputs','format','DoubleMat','mattype',3) 186 187 #marshall ice front 188 data=self.icefront 189 data[[i for i,item in enumerate(data[:,-1]) if item==0],-1]=AirEnum() 190 data[[i for i,item in enumerate(data[:,-1]) if item==1],-1]=WaterEnum() 191 data[[i for i,item in enumerate(data[:,-1]) if item==2],-1]=IceEnum() 192 WriteData(fid,'data',data,'enum',DiagnosticIcefrontEnum(),'format','DoubleMat','mattype',3) 193 # }}} 194 -
issm/branches/trunk-jpl-damage/src/m/classes/flaim.m
r12878 r13101 35 35 36 36 %Early return 37 if solution~=FlaimSolutionEnum , return; end37 if solution~=FlaimSolutionEnum(), return; end 38 38 39 39 md = checkfield(md,'flaim.tracks','file',1); -
issm/branches/trunk-jpl-damage/src/m/classes/flaim.py
r12168 r13101 1 1 #module imports 2 import numpy 2 3 from fielddisplay import fielddisplay 4 from EnumDefinitions import * 5 from checkfield import * 6 from WriteData import * 3 7 4 class flaim: 8 class flaim(object): 9 """ 10 FLAIM class definition 11 12 Usage: 13 flaim=flaim(); 14 """ 15 5 16 #properties 6 17 def __init__(self): … … 20 31 self.opt_niter = 30000 21 32 #}}} 22 def __repr__( obj):33 def __repr__(self): 23 34 # {{{ Displa 24 35 string=' FLAIM - Flight Line Adaptation using Ice sheet Modeling:' 25 36 26 37 string="%s\n\n%s"%(string,' Input:') 27 string="%s\n%s"%(string,fielddisplay( obj,'targets' ,'name of kml output targets file '))28 string="%s\n%s"%(string,fielddisplay( obj,'tracks' ,'name of kml input tracks file '))29 string="%s\n%s"%(string,fielddisplay( obj,'flightreqs' ,'structure of kml flight requirements (not used yet)'))30 string="%s\n%s"%(string,fielddisplay( obj,'criterion' ,'element or nodal criterion for flight path evaluation (metric)'))38 string="%s\n%s"%(string,fielddisplay(self,'targets' ,'name of kml output targets file ')) 39 string="%s\n%s"%(string,fielddisplay(self,'tracks' ,'name of kml input tracks file ')) 40 string="%s\n%s"%(string,fielddisplay(self,'flightreqs' ,'structure of kml flight requirements (not used yet)')) 41 string="%s\n%s"%(string,fielddisplay(self,'criterion' ,'element or nodal criterion for flight path evaluation (metric)')) 31 42 32 43 string="%s\n\n%s"%(string,' Arguments:') 33 string="%s\n%s"%(string,fielddisplay( obj,'gridsatequator' ,'number of grids at equator (determines resolution)'))34 string="%s\n%s"%(string,fielddisplay( obj,'usevalueordering' ,'flag to consider target values for flight path evaluation'))35 string="%s\n%s"%(string,fielddisplay( obj,'split_antimeridian' ,'flag to split polygons on the antimeridian'))44 string="%s\n%s"%(string,fielddisplay(self,'gridsatequator' ,'number of grids at equator (determines resolution)')) 45 string="%s\n%s"%(string,fielddisplay(self,'usevalueordering' ,'flag to consider target values for flight path evaluation')) 46 string="%s\n%s"%(string,fielddisplay(self,'split_antimeridian' ,'flag to split polygons on the antimeridian')) 36 47 37 48 string="%s\n\n%s"%(string,' Optimization:') 38 string="%s\n%s"%(string,fielddisplay( obj,'path_optimize' ,'optimize? (default false)'))39 string="%s\n%s"%(string,fielddisplay( obj,'opt_ndir' ,['number of directions to test when moving a point. If this value = 1, a random direction is tested.',\49 string="%s\n%s"%(string,fielddisplay(self,'path_optimize' ,'optimize? (default false)')) 50 string="%s\n%s"%(string,fielddisplay(self,'opt_ndir' ,['number of directions to test when moving a point. If this value = 1, a random direction is tested.',\ 40 51 'A value > 1 results in directions equally spaced from [0, 2*PI] being tested.',\ 41 52 'For example, 4 would result in directions [0, PI/2, PI, 3PI/2].'])) 42 string="%s\n%s"%(string,fielddisplay( obj,'opt_dist' ,'specifies the distance in km (default 25) to move a randomly selected path point on each iteration'))43 string="%s\n%s"%(string,fielddisplay( obj,'opt_niter' ,['number of iterations (default 30,000) to run for flightplan optimization',\53 string="%s\n%s"%(string,fielddisplay(self,'opt_dist' ,'specifies the distance in km (default 25) to move a randomly selected path point on each iteration')) 54 string="%s\n%s"%(string,fielddisplay(self,'opt_niter' ,['number of iterations (default 30,000) to run for flightplan optimization',\ 44 55 'i.e. the number of times to randomly select a point and move it.'])) 45 56 46 57 string="%s\n\n%s"%(string,' Output:') 47 string="%s\n%s"%(string,fielddisplay( obj,'solution' ,'name of kml solution file'))48 string="%s\n%s"%(string,fielddisplay( obj,'quality' ,'quality of kml solution'))58 string="%s\n%s"%(string,fielddisplay(self,'solution' ,'name of kml solution file')) 59 string="%s\n%s"%(string,fielddisplay(self,'quality' ,'quality of kml solution')) 49 60 return string 50 61 #}}} 62 63 def checkconsistency(self,md,solution,analyses): # {{{ 64 65 #Early return 66 if not solution==FlaimSolutionEnum(): 67 return md 68 69 md = checkfield(md,'flaim.tracks','file',1) 70 if numpy.any(numpy.isnan(md.flaim.criterion)) or not md.flaim.criterion: 71 md = checkfield(md,'flaim.targets','file',1) 72 else: 73 md = checkfield(md,'flaim.criterion','numel',[md.mesh.numberofvertices,md.mesh.numberofelements]) 74 75 return md 76 # }}} 77 -
issm/branches/trunk-jpl-damage/src/m/classes/flowequation.m
r12878 r13101 8 8 ismacayealpattyn = 0; 9 9 ishutter = 0; 10 isl1l2 = 0; 10 11 isstokes = 0; 11 12 vertex_equation = NaN; … … 29 30 function md = checkconsistency(obj,md,solution,analyses) % {{{ 30 31 31 if ismember(DiagnosticHorizAnalysisEnum ,analyses),32 if ismember(DiagnosticHorizAnalysisEnum(),analyses), 32 33 33 md = checkfield(md,'flowequation.ismacayealpattyn','numel',1,'values',[0 1]); 34 md = checkfield(md,'flowequation.ishutter','numel',1,'values',[0 1]); 35 md = checkfield(md,'flowequation.isstokes','numel',1,'values',[0 1]); 34 md = checkfield(md,'flowequation.ismacayealpattyn','numel',[1],'values',[0 1]); 35 md = checkfield(md,'flowequation.ishutter','numel',[1],'values',[0 1]); 36 md = checkfield(md,'flowequation.isl1l2','numel',[1],'values',[0 1]); 37 md = checkfield(md,'flowequation.isstokes','numel',[1],'values',[0 1]); 36 38 md = checkfield(md,'flowequation.bordermacayeal','size',[md.mesh.numberofvertices 1],'values',[0 1]); 37 39 md = checkfield(md,'flowequation.borderpattyn','size',[md.mesh.numberofvertices 1],'values',[0 1]); … … 41 43 md = checkfield(md,'flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[1:2]); 42 44 else 43 md = checkfield(md,'flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[0: 7]);44 md = checkfield(md,'flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[0: 7]);45 md = checkfield(md,'flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[0:8]); 46 md = checkfield(md,'flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[0:8]); 45 47 end 46 if (md.flowequation.ismacayealpattyn==0 && md.flowequation.ishutter==0 && md.flowequation.isstokes==0),48 if ~(obj.ismacayealpattyn || obj.ishutter || obj.isstokes || obj.isl1l2), 47 49 md = checkmessage(md,['no element types set for this model. At least one of ismacayealpattyn, ishutter or isstokes need to be =1']); 48 50 end 49 51 end 50 if ismember(DiagnosticHutterAnalysisEnum ,analyses),51 if any( md.flowequation.element_equation==1),52 if( md.flowequation.element_equation & md.mask.elementonfloatingice),52 if ismember(DiagnosticHutterAnalysisEnum(),analyses), 53 if any(obj.element_equation==1), 54 if(obj.element_equation & md.mask.elementonfloatingice), 53 55 disp(sprintf('\n !!! Warning: Hutter''s model is not consistent on ice shelves !!!\n')); 54 56 end … … 62 64 fielddisplay(obj,'ismacayealpattyn','is the macayeal or pattyn approximation used ?'); 63 65 fielddisplay(obj,'ishutter','is the shallow ice approximation used ?'); 66 fielddisplay(obj,'isl1l2','is the l1l2 approximation used ?'); 64 67 fielddisplay(obj,'isstokes','are the Full-Stokes equations used ?'); 65 68 fielddisplay(obj,'vertex_equation','flow equation for each vertex'); … … 73 76 WriteData(fid,'object',obj,'fieldname','ismacayealpattyn','format','Boolean'); 74 77 WriteData(fid,'object',obj,'fieldname','ishutter','format','Boolean'); 78 WriteData(fid,'object',obj,'fieldname','isl1l2','format','Boolean'); 75 79 WriteData(fid,'object',obj,'fieldname','isstokes','format','Boolean'); 76 80 WriteData(fid,'object',obj,'fieldname','bordermacayeal','format','DoubleMat','mattype',1); … … 79 83 %convert approximations to enums 80 84 data=obj.vertex_equation; 81 pos=find(data==0); data(pos,end)=NoneApproximationEnum; 82 pos=find(data==1); data(pos,end)=HutterApproximationEnum; 83 pos=find(data==2); data(pos,end)=MacAyealApproximationEnum; 84 pos=find(data==3); data(pos,end)=PattynApproximationEnum; 85 pos=find(data==4); data(pos,end)=StokesApproximationEnum; 86 pos=find(data==5); data(pos,end)=MacAyealPattynApproximationEnum; 87 pos=find(data==6); data(pos,end)=MacAyealStokesApproximationEnum; 88 pos=find(data==7); data(pos,end)=PattynStokesApproximationEnum; 89 WriteData(fid,'data',data,'enum',FlowequationVertexEquationEnum,'format','DoubleMat','mattype',1); 85 pos=find(data==0); data(pos,end)=NoneApproximationEnum(); 86 pos=find(data==1); data(pos,end)=HutterApproximationEnum(); 87 pos=find(data==2); data(pos,end)=MacAyealApproximationEnum(); 88 pos=find(data==3); data(pos,end)=PattynApproximationEnum(); 89 pos=find(data==4); data(pos,end)=StokesApproximationEnum(); 90 pos=find(data==5); data(pos,end)=MacAyealPattynApproximationEnum(); 91 pos=find(data==6); data(pos,end)=MacAyealStokesApproximationEnum(); 92 pos=find(data==7); data(pos,end)=PattynStokesApproximationEnum(); 93 pos=find(data==8); data(pos,end)=L1L2ApproximationEnum(); 94 WriteData(fid,'data',data,'enum',FlowequationVertexEquationEnum(),'format','DoubleMat','mattype',1); 90 95 data=obj.element_equation; 91 pos=find(data==0); data(pos,end)=NoneApproximationEnum; 92 pos=find(data==1); data(pos,end)=HutterApproximationEnum; 93 pos=find(data==2); data(pos,end)=MacAyealApproximationEnum; 94 pos=find(data==3); data(pos,end)=PattynApproximationEnum; 95 pos=find(data==4); data(pos,end)=StokesApproximationEnum; 96 pos=find(data==5); data(pos,end)=MacAyealPattynApproximationEnum; 97 pos=find(data==6); data(pos,end)=MacAyealStokesApproximationEnum; 98 pos=find(data==7); data(pos,end)=PattynStokesApproximationEnum; 99 WriteData(fid,'data',data,'enum',FlowequationElementEquationEnum,'format','DoubleMat','mattype',2); 96 pos=find(data==0); data(pos,end)=NoneApproximationEnum(); 97 pos=find(data==1); data(pos,end)=HutterApproximationEnum(); 98 pos=find(data==2); data(pos,end)=MacAyealApproximationEnum(); 99 pos=find(data==3); data(pos,end)=PattynApproximationEnum(); 100 pos=find(data==4); data(pos,end)=StokesApproximationEnum(); 101 pos=find(data==5); data(pos,end)=MacAyealPattynApproximationEnum(); 102 pos=find(data==6); data(pos,end)=MacAyealStokesApproximationEnum(); 103 pos=find(data==7); data(pos,end)=PattynStokesApproximationEnum(); 104 pos=find(data==8); data(pos,end)=L1L2ApproximationEnum(); 105 WriteData(fid,'data',data,'enum',FlowequationElementEquationEnum(),'format','DoubleMat','mattype',2); 100 106 end % }}} 101 107 end -
issm/branches/trunk-jpl-damage/src/m/classes/flowequation.py
r12168 r13101 1 1 #module imports 2 import numpy 2 3 from fielddisplay import fielddisplay 4 from EnumDefinitions import * 5 from checkfield import * 6 from WriteData import * 3 7 4 class flowequation: 8 class flowequation(object): 9 """ 10 FLOWEQUATION class definition 11 12 Usage: 13 flowequation=flowequation(); 14 """ 15 5 16 #properties 6 17 def __init__(self): … … 9 20 self.ismacayealpattyn = 0; 10 21 self.ishutter = 0; 22 self.isl1l2 = 0; 11 23 self.isstokes = 0; 12 24 self.vertex_equation = float('NaN') … … 20 32 21 33 #}}} 22 def __repr__( obj):34 def __repr__(self): 23 35 # {{{ Display 24 36 string=' flow equation parameters:' 25 37 26 string="%s\n\n%s"%(string,fielddisplay(obj,'ismacayealpattyn','is the macayeal or pattyn approximation used ?')) 27 string="%s\n%s"%(string,fielddisplay(obj,'ishutter','is the shallow ice approximation used ?')) 28 string="%s\n%s"%(string,fielddisplay(obj,'isstokes','are the Full-Stokes equations used ?')) 29 string="%s\n%s"%(string,fielddisplay(obj,'vertex_equation','flow equation for each vertex')) 30 string="%s\n%s"%(string,fielddisplay(obj,'element_equation','flow equation for each element')) 31 string="%s\n%s"%(string,fielddisplay(obj,'bordermacayeal','vertices on MacAyeal''s border (for tiling)')) 32 string="%s\n%s"%(string,fielddisplay(obj,'borderpattyn','vertices on Pattyn''s border (for tiling)')) 33 string="%s\n%s"%(string,fielddisplay(obj,'borderstokes','vertices on Stokes'' border (for tiling)')) 38 string="%s\n\n%s"%(string,fielddisplay(self,'ismacayealpattyn','is the macayeal or pattyn approximation used ?')) 39 string="%s\n%s"%(string,fielddisplay(self,'ishutter','is the shallow ice approximation used ?')) 40 string="%s\n%s"%(string,fielddisplay(self,'isl1l2','are l1l2 equations used ?')) 41 string="%s\n%s"%(string,fielddisplay(self,'isstokes','are the Full-Stokes equations used ?')) 42 string="%s\n%s"%(string,fielddisplay(self,'vertex_equation','flow equation for each vertex')) 43 string="%s\n%s"%(string,fielddisplay(self,'element_equation','flow equation for each element')) 44 string="%s\n%s"%(string,fielddisplay(self,'bordermacayeal','vertices on MacAyeal''s border (for tiling)')) 45 string="%s\n%s"%(string,fielddisplay(self,'borderpattyn','vertices on Pattyn''s border (for tiling)')) 46 string="%s\n%s"%(string,fielddisplay(self,'borderstokes','vertices on Stokes'' border (for tiling)')) 34 47 return string 35 48 #}}} 36 49 37 def setdefaultparameters( obj):50 def setdefaultparameters(self): 38 51 # {{{setdefaultparameters 39 return obj52 return self 40 53 #}}} 41 54 55 def checkconsistency(self,md,solution,analyses): # {{{ 56 57 if DiagnosticHorizAnalysisEnum() in analyses: 58 md = checkfield(md,'flowequation.ismacayealpattyn','numel',[1],'values',[0,1]) 59 md = checkfield(md,'flowequation.ishutter','numel',[1],'values',[0,1]) 60 md = checkfield(md,'flowequation.isl1l2','numel',[1],'values',[0,1]) 61 md = checkfield(md,'flowequation.isstokes','numel',[1],'values',[0,1]) 62 md = checkfield(md,'flowequation.bordermacayeal','size',[md.mesh.numberofvertices],'values',[0,1]) 63 md = checkfield(md,'flowequation.borderpattyn','size',[md.mesh.numberofvertices],'values',[0,1]) 64 md = checkfield(md,'flowequation.borderstokes','size',[md.mesh.numberofvertices],'values',[0,1]) 65 if md.mesh.dimension==2: 66 md = checkfield(md,'flowequation.vertex_equation','size',[md.mesh.numberofvertices],'values',[1,2]) 67 md = checkfield(md,'flowequation.element_equation','size',[md.mesh.numberofelements],'values',[1,2]) 68 else: 69 md = checkfield(md,'flowequation.vertex_equation','size',[md.mesh.numberofvertices],'values',range(0,7+1)) 70 md = checkfield(md,'flowequation.element_equation','size',[md.mesh.numberofelements],'values',range(0,7+1)) 71 if not (self.ismacayealpattyn or self.ishutter or self.isstokes or self.isl1l2): 72 md.checkmessage("no element types set for this model. At least one of ismacayealpattyn, ishutter or isstokes need to be =1") 73 74 if DiagnosticHutterAnalysisEnum() in analyses: 75 if any(self.element_equation==1): 76 if numpy.any(numpy.logical_and(self.element_equation,md.mask.elementonfloatingice)): 77 print "\n !!! Warning: Hutter's model is not consistent on ice shelves !!!\n" 78 79 return md 80 # }}} 81 82 def marshall(self,fid): # {{{ 83 WriteData(fid,'object',self,'fieldname','ismacayealpattyn','format','Boolean') 84 WriteData(fid,'object',self,'fieldname','ishutter','format','Boolean') 85 WriteData(fid,'object',self,'fieldname','isl1l2','format','Boolean') 86 WriteData(fid,'object',self,'fieldname','isstokes','format','Boolean') 87 WriteData(fid,'object',self,'fieldname','bordermacayeal','format','DoubleMat','mattype',1) 88 WriteData(fid,'object',self,'fieldname','borderpattyn','format','DoubleMat','mattype',1) 89 WriteData(fid,'object',self,'fieldname','borderstokes','format','DoubleMat','mattype',1) 90 #convert approximations to enums 91 data=self.vertex_equation 92 data[[i for i,item in enumerate(data) if item==0]]=NoneApproximationEnum() 93 data[[i for i,item in enumerate(data) if item==1]]=HutterApproximationEnum() 94 data[[i for i,item in enumerate(data) if item==2]]=MacAyealApproximationEnum() 95 data[[i for i,item in enumerate(data) if item==3]]=PattynApproximationEnum() 96 data[[i for i,item in enumerate(data) if item==4]]=StokesApproximationEnum() 97 data[[i for i,item in enumerate(data) if item==5]]=MacAyealPattynApproximationEnum() 98 data[[i for i,item in enumerate(data) if item==6]]=MacAyealStokesApproximationEnum() 99 data[[i for i,item in enumerate(data) if item==7]]=PattynStokesApproximationEnum() 100 data[[i for i,item in enumerate(data) if item==8]]=L1L2ApproximationEnum() 101 WriteData(fid,'data',data,'enum',FlowequationVertexEquationEnum(),'format','DoubleMat','mattype',1) 102 data=self.element_equation 103 data[[i for i,item in enumerate(data) if item==0]]=NoneApproximationEnum() 104 data[[i for i,item in enumerate(data) if item==1]]=HutterApproximationEnum() 105 data[[i for i,item in enumerate(data) if item==2]]=MacAyealApproximationEnum() 106 data[[i for i,item in enumerate(data) if item==3]]=PattynApproximationEnum() 107 data[[i for i,item in enumerate(data) if item==4]]=StokesApproximationEnum() 108 data[[i for i,item in enumerate(data) if item==5]]=MacAyealPattynApproximationEnum() 109 data[[i for i,item in enumerate(data) if item==6]]=MacAyealStokesApproximationEnum() 110 data[[i for i,item in enumerate(data) if item==7]]=PattynStokesApproximationEnum() 111 data[[i for i,item in enumerate(data) if item==8]]=L1L2ApproximationEnum() 112 WriteData(fid,'data',data,'enum',FlowequationElementEquationEnum(),'format','DoubleMat','mattype',2) 113 # }}} 114 -
issm/branches/trunk-jpl-damage/src/m/classes/friction.m
r12878 r13101 25 25 26 26 %Early return 27 if ~ismember(DiagnosticHorizAnalysisEnum ,analyses) & ~ismember(ThermalAnalysisEnum,analyses), return; end27 if ~ismember(DiagnosticHorizAnalysisEnum(),analyses) & ~ismember(ThermalAnalysisEnum(),analyses), return; end 28 28 29 29 md = checkfield(md,'friction.coefficient','NaN',1,'size',[md.mesh.numberofvertices 1]); -
issm/branches/trunk-jpl-damage/src/m/classes/friction.py
r12168 r13101 1 1 #module imports 2 2 from fielddisplay import fielddisplay 3 from EnumDefinitions import * 4 from checkfield import * 5 from WriteData import * 3 6 4 class friction: 7 class friction(object): 8 """ 9 FRICTION class definition 10 11 Usage: 12 friction=friction(); 13 """ 14 5 15 #properties 6 16 def __init__(self): … … 14 24 15 25 #}}} 16 def __repr__( obj):26 def __repr__(self): 17 27 # {{{ Display 18 28 string="Sigma= drag^2 * Neff ^r * u ^s, with Neff=rho_ice*g*thickness+rho_water*g*bed, r=q/p and s=1/p" 19 string="%s\n\n%s"%(string,fielddisplay( obj,"coefficient","friction coefficient [SI]"))20 string="%s\n%s"%(string,fielddisplay( obj,"p","p exponent"))21 string="%s\n%s"%(string,fielddisplay( obj,"q","q exponent"))29 string="%s\n\n%s"%(string,fielddisplay(self,"coefficient","friction coefficient [SI]")) 30 string="%s\n%s"%(string,fielddisplay(self,"p","p exponent")) 31 string="%s\n%s"%(string,fielddisplay(self,"q","q exponent")) 22 32 return string 23 33 #}}} 24 34 25 def setdefaultparameters( obj):35 def setdefaultparameters(self): 26 36 # {{{setdefaultparameters 27 return obj37 return self 28 38 #}}} 29 39 40 def checkconsistency(self,md,solution,analyses): # {{{ 41 42 #Early return 43 if DiagnosticHorizAnalysisEnum() not in analyses and ThermalAnalysisEnum() not in analyses: 44 return md 45 46 md = checkfield(md,'friction.coefficient','NaN',1,'size',[md.mesh.numberofvertices]) 47 md = checkfield(md,'friction.q','NaN',1,'size',[md.mesh.numberofelements]) 48 md = checkfield(md,'friction.p','NaN',1,'size',[md.mesh.numberofelements]) 49 50 return md 51 # }}} 52 53 def marshall(self,fid): # {{{ 54 WriteData(fid,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1) 55 WriteData(fid,'object',self,'fieldname','p','format','DoubleMat','mattype',2) 56 WriteData(fid,'object',self,'fieldname','q','format','DoubleMat','mattype',2) 57 # }}} 58 -
issm/branches/trunk-jpl-damage/src/m/classes/geometry.m
r12878 r13101 32 32 md = checkmessage(md,['equality thickness=surface-bed violated']); 33 33 end 34 if solution==TransientSolutionEnum & md.transient.isgroundingline,34 if solution==TransientSolutionEnum() & md.transient.isgroundingline, 35 35 md = checkfield(md,'geometry.bathymetry','NaN',1,'size',[md.mesh.numberofvertices 1]); 36 36 end … … 47 47 end % }}} 48 48 function marshall(obj,fid) % {{{ 49 WriteData(fid,'data',obj.surface,'format','DoubleMat','mattype',1,'enum',SurfaceEnum );50 WriteData(fid,'data',obj.thickness,'format','DoubleMat','mattype',1,'enum',ThicknessEnum );51 WriteData(fid,'data',obj.bed,'format','DoubleMat','mattype',1,'enum',BedEnum );52 WriteData(fid,'data',obj.bathymetry,'format','DoubleMat','mattype',1,'enum',BathymetryEnum );49 WriteData(fid,'data',obj.surface,'format','DoubleMat','mattype',1,'enum',SurfaceEnum()); 50 WriteData(fid,'data',obj.thickness,'format','DoubleMat','mattype',1,'enum',ThicknessEnum()); 51 WriteData(fid,'data',obj.bed,'format','DoubleMat','mattype',1,'enum',BedEnum()); 52 WriteData(fid,'data',obj.bathymetry,'format','DoubleMat','mattype',1,'enum',BathymetryEnum()); 53 53 WriteData(fid,'object',obj,'fieldname','hydrostatic_ratio','format','DoubleMat','mattype',1); 54 54 end % }}} -
issm/branches/trunk-jpl-damage/src/m/classes/geometry.py
r12168 r13101 1 1 #module imports 2 2 from fielddisplay import fielddisplay 3 from EnumDefinitions import * 4 from checkfield import * 5 from WriteData import * 3 6 4 class geometry: 7 class geometry(object): 8 """ 9 GEOMETRY class definition 10 11 Usage: 12 geometry=geometry(); 13 """ 14 5 15 #properties 6 16 def __init__(self): … … 16 26 17 27 #}}} 18 def __repr__( obj):28 def __repr__(self): 19 29 # {{{ Display 20 30 21 31 string=" geometry parameters:" 22 32 23 string="%s\n\n%s"%(string,fielddisplay( obj,'surface','surface elevation'))24 string="%s\n%s"%(string,fielddisplay( obj,'thickness','ice thickness'))25 string="%s\n%s"%(string,fielddisplay( obj,'bed','bed elevation'))26 string="%s\n%s"%(string,fielddisplay( obj,'bathymetry','bathymetry elevation'))27 string="%s\n%s"%(string,fielddisplay( obj,'hydrostatic_ratio','coefficient for ice shelves'' thickness correction: hydrostatic_ratio H_obs+ (1-hydrostatic_ratio) H_hydro'))33 string="%s\n\n%s"%(string,fielddisplay(self,'surface','surface elevation')) 34 string="%s\n%s"%(string,fielddisplay(self,'thickness','ice thickness')) 35 string="%s\n%s"%(string,fielddisplay(self,'bed','bed elevation')) 36 string="%s\n%s"%(string,fielddisplay(self,'bathymetry','bathymetry elevation')) 37 string="%s\n%s"%(string,fielddisplay(self,'hydrostatic_ratio','coefficient for ice shelves'' thickness correction: hydrostatic_ratio H_obs+ (1-hydrostatic_ratio) H_hydro')) 28 38 return string 29 39 #}}} 30 40 31 def setdefaultparameters( obj):41 def setdefaultparameters(self): 32 42 # {{{setdefaultparameters 33 return obj43 return self 34 44 #}}} 35 45 46 def checkconsistency(self,md,solution,analyses): # {{{ 47 48 md = checkfield(md,'geometry.surface' ,'NaN',1,'size',[md.mesh.numberofvertices]) 49 md = checkfield(md,'geometry.bed' ,'NaN',1,'size',[md.mesh.numberofvertices]) 50 md = checkfield(md,'geometry.thickness','NaN',1,'size',[md.mesh.numberofvertices],'>',0) 51 if any((self.thickness-self.surface+self.bed)>10**-9): 52 md.checkmessage("equality thickness=surface-bed violated") 53 if solution==TransientSolutionEnum() and md.transient.isgroundingline: 54 md = checkfield(md,'geometry.bathymetry','NaN',1,'size',[md.mesh.numberofvertices]) 55 56 return md 57 # }}} 58 59 def marshall(self,fid): # {{{ 60 WriteData(fid,'data',self.surface,'format','DoubleMat','mattype',1,'enum',SurfaceEnum()) 61 WriteData(fid,'data',self.thickness,'format','DoubleMat','mattype',1,'enum',ThicknessEnum()) 62 WriteData(fid,'data',self.bed,'format','DoubleMat','mattype',1,'enum',BedEnum()) 63 WriteData(fid,'data',self.bathymetry,'format','DoubleMat','mattype',1,'enum',BathymetryEnum()) 64 WriteData(fid,'object',self,'fieldname','hydrostatic_ratio','format','DoubleMat','mattype',1) 65 # }}} 66 -
issm/branches/trunk-jpl-damage/src/m/classes/groundingline.m
r12878 r13101 36 36 md = checkmessage(md,['requesting grounding line migration, but bathymetry is absent!']); 37 37 end 38 pos=find(md.mask.vertexongroundedice); 38 pos=find(md.mask.vertexongroundedice); 39 39 if any(abs(md.geometry.bed(pos)-md.geometry.bathymetry(pos))>10^-10), 40 md = checkmessage(md,['bathymetry not equal to bed on grounded ice 40 md = checkmessage(md,['bathymetry not equal to bed on grounded ice!']); 41 41 end 42 pos=find(md.mask.vertexonfloatingice); 42 pos=find(md.mask.vertexonfloatingice); 43 43 if any(md.geometry.bathymetry(pos)-md.geometry.bed(pos)>10^-9), 44 md = checkmessage(md,['bathymetry superior to bed on floating ice 44 md = checkmessage(md,['bathymetry superior to bed on floating ice!']); 45 45 end 46 46 end … … 55 55 end % }}} 56 56 function marshall(obj,fid) % {{{ 57 WriteData(fid,'data',StringToEnum(obj.migration),'enum',GroundinglineMigrationEnum ,'format','Integer');57 WriteData(fid,'data',StringToEnum(obj.migration),'enum',GroundinglineMigrationEnum(),'format','Integer'); 58 58 WriteData(fid,'object',obj,'fieldname','melting_rate','format','Double'); 59 59 end % }}} -
issm/branches/trunk-jpl-damage/src/m/classes/groundingline.py
r12168 r13101 1 1 #module imports 2 import numpy 2 3 from fielddisplay import fielddisplay 4 from EnumDefinitions import * 5 from StringToEnum import StringToEnum 6 from checkfield import * 7 from WriteData import * 8 from MatlabFuncs import * 3 9 4 class groundingline: 10 class groundingline(object): 11 """ 12 CONSTANTS class definition 13 14 Usage: 15 groundingline=groundingline(); 16 """ 17 5 18 #properties 6 19 def __init__(self): … … 13 26 14 27 #}}} 15 def __repr__( obj):28 def __repr__(self): 16 29 # {{{ Display 17 30 string=' grounding line solution parameters:' 18 31 19 string="%s\n\n%s"%(string,fielddisplay( obj,'migration','type of grounding line migration: ''SoftMigration'',''AgressiveMigration'' or ''None'''))20 string="%s\n%s"%(string,fielddisplay( obj,'melting_rate','melting rate applied when previously grounded parts start floating'))32 string="%s\n\n%s"%(string,fielddisplay(self,'migration','type of grounding line migration: ''SoftMigration'',''AgressiveMigration'' or ''None''')) 33 string="%s\n%s"%(string,fielddisplay(self,'melting_rate','melting rate applied when previously grounded parts start floating')) 21 34 return string 22 35 #}}} 23 def setdefaultparameters( obj):36 def setdefaultparameters(self): 24 37 # {{{setdefaultparameters 25 38 26 39 #Type of migration 27 obj.migration='None'40 self.migration='None' 28 41 29 42 #basal melting rate correction: 30 obj.melting_rate=0;43 self.melting_rate=0; 31 44 32 return obj45 return self 33 46 #}}} 34 47 48 def checkconsistency(self,md,solution,analyses): # {{{ 49 50 md = checkfield(md,'groundingline.migration','values',['None','AgressiveMigration','SoftMigration']) 51 52 if not strcmp(self.migration,'None'): 53 if numpy.any(numpy.isnan(md.geometry.bathymetry)): 54 md.checkmessage("requesting grounding line migration, but bathymetry is absent!") 55 pos=numpy.nonzero(md.mask.vertexongroundedice) 56 if any(numpy.abs(md.geometry.bed[pos]-md.geometry.bathymetry[pos])>10**-10): 57 md.checkmessage("bathymetry not equal to bed on grounded ice!") 58 pos=numpy.nonzero(md.mask.vertexonfloatingice) 59 if any(md.geometry.bathymetry[pos]-md.geometry.bed[pos]>10**-9): 60 md.checkmessage("bathymetry superior to bed on floating ice!") 61 62 return md 63 # }}} 64 65 def marshall(self,fid): # {{{ 66 WriteData(fid,'data',StringToEnum(self.migration)[0],'enum',GroundinglineMigrationEnum(),'format','Integer') 67 WriteData(fid,'object',self,'fieldname','melting_rate','format','Double') 68 # }}} 69 -
issm/branches/trunk-jpl-damage/src/m/classes/hydrology.m
r12878 r13101 38 38 39 39 %Early return 40 if ~ismember(HydrologyAnalysisEnum ,analyses), return; end40 if ~ismember(HydrologyAnalysisEnum(),analyses), return; end 41 41 42 42 md = checkfield(md,'hydrology.spcwatercolumn','forcing',1); … … 57 57 function marshall(obj,fid) % {{{ 58 58 WriteData(fid,'object',obj,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1); 59 WriteData(fid,'object',obj,'fieldname','n','format','Double'); 59 WriteData(fid,'object',obj,'fieldname','n','format','Double'); 60 60 WriteData(fid,'object',obj,'fieldname','CR','format','Double'); 61 61 WriteData(fid,'object',obj,'fieldname','p','format','Double'); -
issm/branches/trunk-jpl-damage/src/m/classes/hydrology.py
r12168 r13101 1 1 #module imports 2 2 from fielddisplay import fielddisplay 3 from EnumDefinitions import * 4 from checkfield import * 5 from WriteData import * 3 6 4 class hydrology: 7 class hydrology(object): 8 """ 9 HYDROLOGY class definition 10 11 Usage: 12 hydrology=hydrology(); 13 """ 14 5 15 #properties 6 16 def __init__(self): … … 17 27 self.setdefaultparameters() 18 28 19 20 29 #}}} 21 def __repr__( obj):30 def __repr__(self): 22 31 # {{{ Display 23 32 24 33 string=' hydrology solution parameters:' 25 string="%s\n\n%s"%(string,fielddisplay( obj,'spcwatercolumn','water thickness constraints (NaN means no constraint)'))26 string="%s\n%s"%(string,fielddisplay( obj,'n','Manning roughness coefficient'))27 string="%s\n%s"%(string,fielddisplay( obj,'CR','tortuosity parameter'))28 string="%s\n%s"%(string,fielddisplay( obj,'p','dimensionless exponent in Manning velocity formula'))29 string="%s\n%s"%(string,fielddisplay( obj,'q','dimensionless exponent in Manning velocity formula'))30 string="%s\n%s"%(string,fielddisplay( obj,'kn','parameter in effective pressure formula'))31 string="%s\n%s"%(string,fielddisplay( obj,'stabilization','artificial diffusivity (default is 1). can be more than 1 to increase diffusivity.'))34 string="%s\n\n%s"%(string,fielddisplay(self,'spcwatercolumn','water thickness constraints (NaN means no constraint)')) 35 string="%s\n%s"%(string,fielddisplay(self,'n','Manning roughness coefficient')) 36 string="%s\n%s"%(string,fielddisplay(self,'CR','tortuosity parameter')) 37 string="%s\n%s"%(string,fielddisplay(self,'p','dimensionless exponent in Manning velocity formula')) 38 string="%s\n%s"%(string,fielddisplay(self,'q','dimensionless exponent in Manning velocity formula')) 39 string="%s\n%s"%(string,fielddisplay(self,'kn','parameter in effective pressure formula')) 40 string="%s\n%s"%(string,fielddisplay(self,'stabilization','artificial diffusivity (default is 1). can be more than 1 to increase diffusivity.')) 32 41 return string 33 42 #}}} 34 43 35 def setdefaultparameters( obj):44 def setdefaultparameters(self): 36 45 # {{{setdefaultparameters 37 46 38 47 #Parameters from Johnson's 2002 thesis, section 3.5.4 39 obj.n=.0240 obj.CR=.0141 obj.p=242 obj.q=143 obj.kn=048 self.n=.02 49 self.CR=.01 50 self.p=2 51 self.q=1 52 self.kn=0 44 53 45 54 #Type of stabilization to use 0:nothing 1:artificial_diffusivity 46 obj.stabilization=155 self.stabilization=1 47 56 48 return obj57 return self 49 58 #}}} 50 59 60 def checkconsistency(self,md,solution,analyses): # {{{ 61 62 #Early return 63 if HydrologyAnalysisEnum() not in analyses: 64 return md 65 66 md = checkfield(md,'hydrology.spcwatercolumn','forcing',1) 67 md = checkfield(md,'hydrology.stabilization','>=',0) 68 69 return md 70 # }}} 71 72 def marshall(self,fid): # {{{ 73 WriteData(fid,'object',self,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1) 74 WriteData(fid,'object',self,'fieldname','n','format','Double') 75 WriteData(fid,'object',self,'fieldname','CR','format','Double') 76 WriteData(fid,'object',self,'fieldname','p','format','Double') 77 WriteData(fid,'object',self,'fieldname','q','format','Double') 78 WriteData(fid,'object',self,'fieldname','kn','format','Double') 79 WriteData(fid,'object',self,'fieldname','stabilization','format','Double') 80 # }}} 81 -
issm/branches/trunk-jpl-damage/src/m/classes/initialization.m
r12917 r13101 30 30 end % }}} 31 31 function md = checkconsistency(obj,md,solution,analyses) % {{{ 32 if ismember(DiagnosticHorizAnalysisEnum ,analyses)33 if ~ isnan(md.initialization.vx) & ~isnan(md.initialization.vy),32 if ismember(DiagnosticHorizAnalysisEnum(),analyses) 33 if ~(isnan(md.initialization.vx) | isnan(md.initialization.vy)), 34 34 md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices 1]); 35 35 md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices 1]); 36 36 end 37 37 end 38 if ismember(PrognosticAnalysisEnum ,analyses),38 if ismember(PrognosticAnalysisEnum(),analyses), 39 39 md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices 1]); 40 40 md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices 1]); 41 41 end 42 if ismember(HydrologyAnalysisEnum ,analyses),42 if ismember(HydrologyAnalysisEnum(),analyses), 43 43 md = checkfield(md,'initialization.watercolumn','NaN',1,'size',[md.mesh.numberofvertices 1]); 44 44 end 45 if ismember(BalancethicknessAnalysisEnum ,analyses),45 if ismember(BalancethicknessAnalysisEnum(),analyses), 46 46 md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices 1]); 47 47 md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices 1]); … … 51 51 end 52 52 end 53 if ismember(ThermalAnalysisEnum ,analyses),53 if ismember(ThermalAnalysisEnum(),analyses), 54 54 md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices 1]); 55 55 md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices 1]); … … 57 57 md = checkfield(md,'initialization.pressure','NaN',1,'size',[md.mesh.numberofvertices 1]); 58 58 end 59 if (ismember(EnthalpyAnalysisEnum ,analyses) & md.thermal.isenthalpy) | solution==EnthalpySolutionEnum,59 if (ismember(EnthalpyAnalysisEnum(),analyses) & md.thermal.isenthalpy) | solution==EnthalpySolutionEnum(), 60 60 md = checkfield(md,'initialization.waterfraction','>=',0,'size',[md.mesh.numberofvertices 1]); 61 61 end -
issm/branches/trunk-jpl-damage/src/m/classes/initialization.py
r12168 r13101 1 1 #module imports 2 import numpy 2 3 from fielddisplay import fielddisplay 4 from EnumDefinitions import * 5 from checkfield import * 6 from WriteData import * 3 7 4 class initialization: 8 class initialization(object): 9 """ 10 INITIALIZATION class definition 11 12 Usage: 13 initialization=initialization(); 14 """ 15 5 16 #properties 6 17 def __init__(self): … … 20 31 21 32 #}}} 22 def __repr__( obj):33 def __repr__(self): 23 34 # {{{ Display 24 35 string=' initial field values:' 25 36 26 string="%s\n%s"%(string,fielddisplay( obj,'vx','x component of velocity'))27 string="%s\n%s"%(string,fielddisplay( obj,'vy','y component of velocity'))28 string="%s\n%s"%(string,fielddisplay( obj,'vz','z component of velocity'))29 string="%s\n%s"%(string,fielddisplay( obj,'vel','velocity norm'))30 string="%s\n%s"%(string,fielddisplay( obj,'pressure','pressure field'))31 string="%s\n%s"%(string,fielddisplay( obj,'temperature','temperature in Kelvins'))32 string="%s\n%s"%(string,fielddisplay( obj,'watercolumn','thickness of subglacial water'))33 string="%s\n%s"%(string,fielddisplay( obj,'waterfraction','fraction of water in the ice'))37 string="%s\n%s"%(string,fielddisplay(self,'vx','x component of velocity')) 38 string="%s\n%s"%(string,fielddisplay(self,'vy','y component of velocity')) 39 string="%s\n%s"%(string,fielddisplay(self,'vz','z component of velocity')) 40 string="%s\n%s"%(string,fielddisplay(self,'vel','velocity norm')) 41 string="%s\n%s"%(string,fielddisplay(self,'pressure','pressure field')) 42 string="%s\n%s"%(string,fielddisplay(self,'temperature','temperature in Kelvins')) 43 string="%s\n%s"%(string,fielddisplay(self,'watercolumn','thickness of subglacial water')) 44 string="%s\n%s"%(string,fielddisplay(self,'waterfraction','fraction of water in the ice')) 34 45 35 46 return string 36 47 #}}} 37 48 38 def setdefaultparameters( obj):49 def setdefaultparameters(self): 39 50 # {{{setdefaultparameters 40 return obj51 return self 41 52 #}}} 42 53 54 def checkconsistency(self,md,solution,analyses): # {{{ 55 if DiagnosticHorizAnalysisEnum() in analyses: 56 if not numpy.any(numpy.logical_or(numpy.isnan(md.initialization.vx),numpy.isnan(md.initialization.vy))): 57 md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices]) 58 md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices]) 59 if PrognosticAnalysisEnum() in analyses: 60 md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices]) 61 md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices]) 62 if HydrologyAnalysisEnum() in analyses: 63 md = checkfield(md,'initialization.watercolumn','NaN',1,'size',[md.mesh.numberofvertices]) 64 if BalancethicknessAnalysisEnum() in analyses: 65 md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices]) 66 md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices]) 67 #Triangle with zero velocity 68 if numpy.any(numpy.logical_and(numpy.sum(numpy.abs(md.initialization.vx[md.mesh.elements.astype(int)-1]),axis=1)==0,\ 69 numpy.sum(numpy.abs(md.initialization.vy[md.mesh.elements.astype(int)-1]),axis=1)==0)): 70 md.checkmessage("at least one triangle has all its vertices with a zero velocity") 71 if ThermalAnalysisEnum() in analyses: 72 md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices]) 73 md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices]) 74 md = checkfield(md,'initialization.vz','NaN',1,'size',[md.mesh.numberofvertices]) 75 md = checkfield(md,'initialization.pressure','NaN',1,'size',[md.mesh.numberofvertices]) 76 if (EnthalpyAnalysisEnum() in analyses and md.thermal.isenthalpy) or solution==EnthalpySolutionEnum(): 77 md = checkfield(md,'initialization.waterfraction','>=',0,'size',[md.mesh.numberofvertices]) 78 79 return md 80 # }}} 81 82 def marshall(self,fid): # {{{ 83 WriteData(fid,'data',self.vx,'format','DoubleMat','mattype',1,'enum',VxEnum()) 84 WriteData(fid,'data',self.vy,'format','DoubleMat','mattype',1,'enum',VyEnum()) 85 WriteData(fid,'data',self.vz,'format','DoubleMat','mattype',1,'enum',VzEnum()) 86 WriteData(fid,'data',self.pressure,'format','DoubleMat','mattype',1,'enum',PressureEnum()) 87 WriteData(fid,'data',self.temperature,'format','DoubleMat','mattype',1,'enum',TemperatureEnum()) 88 WriteData(fid,'data',self.watercolumn,'format','DoubleMat','mattype',1,'enum',WatercolumnEnum()) 89 WriteData(fid,'data',self.waterfraction,'format','DoubleMat','mattype',1,'enum',WaterfractionEnum()) 90 # }}} 91 -
issm/branches/trunk-jpl-damage/src/m/classes/inversion.m
r12878 r13101 1 % CONSTANTSclass definition1 %INVERSION class definition 2 2 % 3 3 % Usage: … … 97 97 checkfield(md,'inversion.max_parameters','size',[md.mesh.numberofvertices num_controls]); 98 98 99 if solution==BalancethicknessSolutionEnum 99 if solution==BalancethicknessSolutionEnum() 100 100 md = checkfield(md,'inversion.thickness_obs','size',[md.mesh.numberofvertices 1],'NaN',1); 101 101 else … … 159 159 data(i)=StringToEnum(obj.control_parameters{i}); 160 160 end 161 WriteData(fid,'data',data,'enum',InversionControlParametersEnum ,'format','DoubleMat','mattype',3);162 WriteData(fid,'data',num_control_parameters,'enum',InversionNumControlParametersEnum ,'format','Integer');161 WriteData(fid,'data',data,'enum',InversionControlParametersEnum(),'format','DoubleMat','mattype',3); 162 WriteData(fid,'data',num_control_parameters,'enum',InversionNumControlParametersEnum(),'format','Integer'); 163 163 164 164 %process cost functions 165 165 num_cost_functions=size(obj.cost_functions,2); 166 166 data=obj.cost_functions; 167 pos=find(data==101); data(pos)=SurfaceAbsVelMisfitEnum; 168 pos=find(data==102); data(pos)=SurfaceRelVelMisfitEnum; 169 pos=find(data==103); data(pos)=SurfaceLogVelMisfitEnum; 170 pos=find(data==104); data(pos)=SurfaceLogVxVyMisfitEnum; 171 pos=find(data==105); data(pos)=SurfaceAverageVelMisfitEnum; 172 pos=find(data==201); data(pos)=ThicknessAbsMisfitEnum; 173 pos=find(data==501); data(pos)=DragCoefficientAbsGradientEnum; 174 pos=find(data==502); data(pos)=RheologyBbarAbsGradientEnum; 175 pos=find(data==503); data(pos)=ThicknessAbsGradientEnum; 176 WriteData(fid,'data',data,'enum',InversionCostFunctionsEnum,'format','DoubleMat','mattype',3); 177 WriteData(fid,'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum,'format','Integer'); 167 pos=find(data==101); data(pos)=SurfaceAbsVelMisfitEnum(); 168 pos=find(data==102); data(pos)=SurfaceRelVelMisfitEnum(); 169 pos=find(data==103); data(pos)=SurfaceLogVelMisfitEnum(); 170 pos=find(data==104); data(pos)=SurfaceLogVxVyMisfitEnum(); 171 pos=find(data==105); data(pos)=SurfaceAverageVelMisfitEnum(); 172 pos=find(data==201); data(pos)=ThicknessAbsMisfitEnum(); 173 pos=find(data==501); data(pos)=DragCoefficientAbsGradientEnum(); 174 pos=find(data==502); data(pos)=RheologyBbarAbsGradientEnum(); 175 pos=find(data==503); data(pos)=ThicknessAbsGradientEnum(); 176 pos=find(data==504); data(pos)=ThicknessAlongGradientEnum(); 177 pos=find(data==505); data(pos)=ThicknessAcrossGradientEnum(); 178 WriteData(fid,'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3); 179 WriteData(fid,'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer'); 178 180 end % }}} 179 181 end -
issm/branches/trunk-jpl-damage/src/m/classes/inversion.py
r12168 r13101 1 1 #module imports 2 import numpy 2 3 from fielddisplay import fielddisplay 4 from EnumDefinitions import * 5 from StringToEnum import StringToEnum 6 from checkfield import * 7 from WriteData import * 3 8 4 class inversion: 9 class inversion(object): 10 """ 11 INVERSION class definition 12 13 Usage: 14 inversion=inversion(); 15 """ 16 5 17 #properties 6 18 def __init__(self): … … 25 37 self.vel_obs = float('NaN') 26 38 self.thickness_obs = float('NaN') 39 40 #set defaults 41 self.setdefaultparameters() 42 27 43 #}}} 28 def __repr__( obj):44 def __repr__(self): 29 45 # {{{ Display 30 46 string='\n Inversion parameters:' 31 string="%s\n%s"%(string,fielddisplay( obj,'iscontrol','is inversion activated?'))32 string="%s\n%s"%(string,fielddisplay( obj,'incomplete_adjoint','do we assume linear viscosity?'))33 string="%s\n%s"%(string,fielddisplay( obj,'control_parameters','parameter where inverse control is carried out; ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}'))34 string="%s\n%s"%(string,fielddisplay( obj,'nsteps','number of optimization searches'))35 string="%s\n%s"%(string,fielddisplay( obj,'cost_functions','indicate the type of response for each optimization step'))36 string="%s\n%s"%(string,fielddisplay( obj,'cost_functions_coefficients','cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter'))37 string="%s\n%s"%(string,fielddisplay( obj,'cost_function_threshold','misfit convergence criterion. Default is 1%, NaN if not applied'))38 string="%s\n%s"%(string,fielddisplay( obj,'maxiter_per_step','maximum iterations during each optimization step'))39 string="%s\n%s"%(string,fielddisplay( obj,'gradient_scaling','scaling factor on gradient direction during optimization, for each optimization step'))40 string="%s\n%s"%(string,fielddisplay( obj,'step_threshold','decrease threshold for misfit, default is 30%'))41 string="%s\n%s"%(string,fielddisplay( obj,'min_parameters','absolute minimum acceptable value of the inversed parameter on each vertex'))42 string="%s\n%s"%(string,fielddisplay( obj,'max_parameters','absolute maximum acceptable value of the inversed parameter on each vertex'))43 string="%s\n%s"%(string,fielddisplay( obj,'gradient_only','stop control method solution at gradient'))44 string="%s\n%s"%(string,fielddisplay( obj,'vx_obs','observed velocity x component [m/a]'))45 string="%s\n%s"%(string,fielddisplay( obj,'vy_obs','observed velocity y component [m/a]'))46 string="%s\n%s"%(string,fielddisplay( obj,'vel_obs','observed velocity magnitude [m/a]'))47 string="%s\n%s"%(string,fielddisplay( obj,'thickness_obs','observed thickness [m]'))47 string="%s\n%s"%(string,fielddisplay(self,'iscontrol','is inversion activated?')) 48 string="%s\n%s"%(string,fielddisplay(self,'incomplete_adjoint','do we assume linear viscosity?')) 49 string="%s\n%s"%(string,fielddisplay(self,'control_parameters','parameter where inverse control is carried out; ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}')) 50 string="%s\n%s"%(string,fielddisplay(self,'nsteps','number of optimization searches')) 51 string="%s\n%s"%(string,fielddisplay(self,'cost_functions','indicate the type of response for each optimization step')) 52 string="%s\n%s"%(string,fielddisplay(self,'cost_functions_coefficients','cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter')) 53 string="%s\n%s"%(string,fielddisplay(self,'cost_function_threshold','misfit convergence criterion. Default is 1%, NaN if not applied')) 54 string="%s\n%s"%(string,fielddisplay(self,'maxiter_per_step','maximum iterations during each optimization step')) 55 string="%s\n%s"%(string,fielddisplay(self,'gradient_scaling','scaling factor on gradient direction during optimization, for each optimization step')) 56 string="%s\n%s"%(string,fielddisplay(self,'step_threshold','decrease threshold for misfit, default is 30%')) 57 string="%s\n%s"%(string,fielddisplay(self,'min_parameters','absolute minimum acceptable value of the inversed parameter on each vertex')) 58 string="%s\n%s"%(string,fielddisplay(self,'max_parameters','absolute maximum acceptable value of the inversed parameter on each vertex')) 59 string="%s\n%s"%(string,fielddisplay(self,'gradient_only','stop control method solution at gradient')) 60 string="%s\n%s"%(string,fielddisplay(self,'vx_obs','observed velocity x component [m/a]')) 61 string="%s\n%s"%(string,fielddisplay(self,'vy_obs','observed velocity y component [m/a]')) 62 string="%s\n%s"%(string,fielddisplay(self,'vel_obs','observed velocity magnitude [m/a]')) 63 string="%s\n%s"%(string,fielddisplay(self,'thickness_obs','observed thickness [m]')) 48 64 string="%s\n%s"%(string,'Available cost functions:') 49 65 string="%s\n%s"%(string,' 101: SurfaceAbsVelMisfit') … … 59 75 #}}} 60 76 61 def setdefaultparameters(obj): 62 # {{{setdefaultparameters 77 def setdefaultparameters(self): # {{{ 63 78 64 79 #default is incomplete adjoint for now 65 obj.incomplete_adjoint=180 self.incomplete_adjoint=1 66 81 67 82 #parameter to be inferred by control methods (only 68 83 #drag and B are supported yet) 69 obj.control_parameters=['FrictionCoefficient']84 self.control_parameters='FrictionCoefficient' 70 85 71 86 #number of steps in the control methods 72 obj.nsteps=2087 self.nsteps=20 73 88 74 89 #maximum number of iteration in the optimization algorithm for 75 90 #each step 76 obj.maxiter_per_step=20*ones(obj.nsteps)91 self.maxiter_per_step=20*numpy.ones(self.nsteps) 77 92 78 93 #the inversed parameter is updated as follows: … … 81 96 #inversed parameter (10^8 for B, 50 for drag) and can be decreased 82 97 #after the first iterations 83 obj.gradient_scaling=50*ones(obj.nsteps)98 self.gradient_scaling=50*numpy.ones(self.nsteps) 84 99 85 100 #several responses can be used: 86 obj.cost_functions=101*ones(obj.nsteps)101 self.cost_functions=101*numpy.ones(self.nsteps) 87 102 88 103 #step_threshold is used to speed up control method. When 89 #misfit(1)/misfit(0) < obj.step_threshold, we go directly to104 #misfit(1)/misfit(0) < self.step_threshold, we go directly to 90 105 #the next step 91 obj.step_threshold=.7*ones(obj.nsteps) #30 per cent decrement106 self.step_threshold=.7*numpy.ones(self.nsteps) #30 per cent decrement 92 107 93 108 #stop control solution at the gradient computation and return it? 94 obj.gradient_only=0109 self.gradient_only=0 95 110 96 111 #cost_function_threshold is a criteria to stop the control methods. 97 112 #if J[n]-J[n-1]/J[n] < criteria, the control run stops 98 113 #NaN if not applied 99 obj.cost_function_threshold=NaN#not activated114 self.cost_function_threshold=float('NaN') #not activated 100 115 101 return obj102 116 return self 117 #}}} 103 118 119 def checkconsistency(self,md,solution,analyses): # {{{ 104 120 121 #Early return 122 if not self.iscontrol: 123 return md 124 125 num_controls=numpy.size(md.inversion.control_parameters) 126 num_costfunc=numpy.size(md.inversion.cost_functions,1) 127 128 md = checkfield(md,'inversion.iscontrol','values',[0,1]) 129 md = checkfield(md,'inversion.tao','values',[0,1]) 130 md = checkfield(md,'inversion.incomplete_adjoint','values',[0,1]) 131 md = checkfield(md,'inversion.control_parameters','cell',1,'values',['BalancethicknessThickeningRate','FrictionCoefficient','MaterialsRheologyBbar','Vx','Vy']) 132 md = checkfield(md,'inversion.nsteps','numel',[1],'>=',1) 133 md = checkfield(md,'inversion.maxiter_per_step','size',[md.inversion.nsteps],'>=',0) 134 md = checkfield(md,'inversion.step_threshold','size',[md.inversion.nsteps]) 135 md = checkfield(md,'inversion.cost_functions','size',[md.inversion.nsteps,num_costfunc],'values',[101,102,103,104,105,201,501,502,503,504,505]) 136 md = checkfield(md,'inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices,num_costfunc],'>=',0) 137 md = checkfield(md,'inversion.gradient_only','values',[0,1]) 138 md = checkfield(md,'inversion.gradient_scaling','size',[md.inversion.nsteps,num_controls]) 139 md = checkfield(md,'inversion.min_parameters','size',[md.mesh.numberofvertices,num_controls]) 140 md = checkfield(md,'inversion.max_parameters','size',[md.mesh.numberofvertices,num_controls]) 141 142 if solution==BalancethicknessSolutionEnum(): 143 md = checkfield(md,'inversion.thickness_obs','size',[md.mesh.numberofvertices],'NaN',1) 144 else: 145 md = checkfield(md,'inversion.vx_obs','size',[md.mesh.numberofvertices],'NaN',1) 146 md = checkfield(md,'inversion.vy_obs','size',[md.mesh.numberofvertices],'NaN',1) 147 148 return md 149 # }}} 150 151 def marshall(self,fid): # {{{ 152 153 WriteData(fid,'object',self,'fieldname','iscontrol','format','Boolean') 154 WriteData(fid,'object',self,'fieldname','tao','format','Boolean') 155 WriteData(fid,'object',self,'fieldname','incomplete_adjoint','format','Boolean') 156 if not self.iscontrol: 157 return 158 WriteData(fid,'object',self,'fieldname','nsteps','format','Integer') 159 WriteData(fid,'object',self,'fieldname','maxiter_per_step','format','DoubleMat','mattype',3) 160 WriteData(fid,'object',self,'fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1) 161 WriteData(fid,'object',self,'fieldname','gradient_scaling','format','DoubleMat','mattype',3) 162 WriteData(fid,'object',self,'fieldname','cost_function_threshold','format','Double') 163 WriteData(fid,'object',self,'fieldname','min_parameters','format','DoubleMat','mattype',3) 164 WriteData(fid,'object',self,'fieldname','max_parameters','format','DoubleMat','mattype',3) 165 WriteData(fid,'object',self,'fieldname','step_threshold','format','DoubleMat','mattype',3) 166 WriteData(fid,'object',self,'fieldname','gradient_only','format','Boolean') 167 WriteData(fid,'object',self,'fieldname','vx_obs','format','DoubleMat','mattype',1) 168 WriteData(fid,'object',self,'fieldname','vy_obs','format','DoubleMat','mattype',1) 169 WriteData(fid,'object',self,'fieldname','vz_obs','format','DoubleMat','mattype',1) 170 WriteData(fid,'object',self,'fieldname','thickness_obs','format','DoubleMat','mattype',1) 171 172 #process control parameters 173 num_control_parameters=numpy.size(self.control_parameters) 174 data=[StringToEnum(self.control_parameters[i])[0] for i in xrange(0,num_control_parameters)] 175 WriteData(fid,'data',data,'enum',InversionControlParametersEnum(),'format','DoubleMat','mattype',3) 176 WriteData(fid,'data',num_control_parameters,'enum',InversionNumControlParametersEnum(),'format','Integer') 177 178 #process cost functions 179 num_cost_functions=size(self.cost_functions,1) 180 data=self.cost_functions 181 data[[i for i,item in enumerate(data) if item==101]]=SurfaceAbsVelMisfitEnum() 182 data[[i for i,item in enumerate(data) if item==102]]=SurfaceRelVelMisfitEnum() 183 data[[i for i,item in enumerate(data) if item==103]]=SurfaceLogVelMisfitEnum() 184 data[[i for i,item in enumerate(data) if item==104]]=SurfaceLogVxVyMisfitEnum() 185 data[[i for i,item in enumerate(data) if item==105]]=SurfaceAverageVelMisfitEnum() 186 data[[i for i,item in enumerate(data) if item==201]]=ThicknessAbsMisfitEnum() 187 data[[i for i,item in enumerate(data) if item==501]]=DragCoefficientAbsGradientEnum() 188 data[[i for i,item in enumerate(data) if item==502]]=RheologyBbarAbsGradientEnum() 189 data[[i for i,item in enumerate(data) if item==503]]=ThicknessAbsGradientEnum() 190 data[[i for i,item in enumerate(data) if item==504]]=ThicknessAlongGradientEnum() 191 data[[i for i,item in enumerate(data) if item==505]]=ThicknessAcrossGradientEnum() 192 WriteData(fid,'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3) 193 WriteData(fid,'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer') 194 # }}} 195 -
issm/branches/trunk-jpl-damage/src/m/classes/mask.py
r12168 r13101 1 1 #module imports 2 2 from fielddisplay import fielddisplay 3 from EnumDefinitions import * 4 from checkfield import * 5 from WriteData import * 3 6 4 class mask: 7 class mask(object): 8 """ 9 MASK class definition 10 11 Usage: 12 mask=mask(); 13 """ 14 5 15 #properties 6 16 def __init__(self): … … 17 27 18 28 #}}} 19 def __repr__( obj):29 def __repr__(self): 20 30 # {{{ Display 21 31 22 32 string=""; 23 string="%s\n%s"%(string,fielddisplay( obj,"elementonfloatingice","element on floating ice flags list"))24 string="%s\n%s"%(string,fielddisplay( obj,"vertexonfloatingice","vertex on floating ice flags list"))25 string="%s\n%s"%(string,fielddisplay( obj,"elementongroundedice","element on grounded ice list"))26 string="%s\n%s"%(string,fielddisplay( obj,"vertexongroundedice","vertex on grounded ice flags list"))27 string="%s\n%s"%(string,fielddisplay( obj,"elementonwater","element on water flags list"))28 string="%s\n%s"%(string,fielddisplay( obj,"vertexonwater","vertex on water flags list"))33 string="%s\n%s"%(string,fielddisplay(self,"elementonfloatingice","element on floating ice flags list")) 34 string="%s\n%s"%(string,fielddisplay(self,"vertexonfloatingice","vertex on floating ice flags list")) 35 string="%s\n%s"%(string,fielddisplay(self,"elementongroundedice","element on grounded ice list")) 36 string="%s\n%s"%(string,fielddisplay(self,"vertexongroundedice","vertex on grounded ice flags list")) 37 string="%s\n%s"%(string,fielddisplay(self,"elementonwater","element on water flags list")) 38 string="%s\n%s"%(string,fielddisplay(self,"vertexonwater","vertex on water flags list")) 29 39 return string 30 40 #}}} 31 41 32 def setdefaultparameters( obj):42 def setdefaultparameters(self): 33 43 # {{{setdefaultparameters 34 return obj44 return self 35 45 #}}} 36 46 47 def checkconsistency(self,md,solution,analyses): # {{{ 48 49 md = checkfield(md,'mask.elementonfloatingice','size',[md.mesh.numberofelements],'values',[0,1]) 50 md = checkfield(md,'mask.elementongroundedice','size',[md.mesh.numberofelements],'values',[0,1]) 51 md = checkfield(md,'mask.elementonwater' ,'size',[md.mesh.numberofelements],'values',[0,1]) 52 md = checkfield(md,'mask.vertexonfloatingice' ,'size',[md.mesh.numberofvertices],'values',[0,1]) 53 md = checkfield(md,'mask.vertexongroundedice' ,'size',[md.mesh.numberofvertices],'values',[0,1]) 54 md = checkfield(md,'mask.vertexonwater' ,'size',[md.mesh.numberofvertices],'values',[0,1]) 55 56 return md 57 # }}} 58 59 def marshall(self,fid): # {{{ 60 WriteData(fid,'object',self,'fieldname','elementonfloatingice','format','BooleanMat','mattype',2) 61 WriteData(fid,'object',self,'fieldname','elementongroundedice','format','BooleanMat','mattype',2) 62 WriteData(fid,'object',self,'fieldname','elementonwater','format','BooleanMat','mattype',2) 63 WriteData(fid,'object',self,'fieldname','vertexonfloatingice','format','DoubleMat','mattype',1) 64 WriteData(fid,'object',self,'fieldname','vertexongroundedice','format','DoubleMat','mattype',1) 65 WriteData(fid,'object',self,'fieldname','vertexonwater','format','DoubleMat','mattype',1) 66 # }}} 67 -
issm/branches/trunk-jpl-damage/src/m/classes/materials.m
r12897 r13101 6 6 classdef materials 7 7 properties (SetAccess=public) 8 rho_ice = 0 ;9 rho_water = 0 ;10 rho_freshwater = 0 ;11 mu_water = 0 ;12 heatcapacity = 0 ;13 latentheat = 0 ;14 thermalconductivity = 0 ;15 meltingpoint = 0 ;16 beta = 0 ;17 mixed_layer_capacity = 0 ;18 thermal_exchange_velocity = 0 ;8 rho_ice = 0.; 9 rho_water = 0.; 10 rho_freshwater = 0.; 11 mu_water = 0.; 12 heatcapacity = 0.; 13 latentheat = 0.; 14 thermalconductivity = 0.; 15 meltingpoint = 0.; 16 beta = 0.; 17 mixed_layer_capacity = 0.; 18 thermal_exchange_velocity = 0.; 19 19 rheology_B = NaN; 20 20 rheology_n = NaN; … … 34 34 35 35 %ice density (kg/m^3) 36 obj.rho_ice=917 ;36 obj.rho_ice=917.; 37 37 38 38 %ocean water density (kg/m^3) 39 obj.rho_water=1023 ;39 obj.rho_water=1023.; 40 40 41 41 %fresh water density (kg/m^3) 42 obj.rho_freshwater=1000 ;42 obj.rho_freshwater=1000.; 43 43 44 44 %water viscosity (N.s/m^2) … … 46 46 47 47 %ice heat capacity cp (J/kg/K) 48 obj.heatcapacity=2093 ;48 obj.heatcapacity=2093.; 49 49 50 50 %ice latent heat of fusion L (J/kg) … … 61 61 62 62 %mixed layer (ice-water interface) heat capacity (J/kg/K) 63 obj.mixed_layer_capacity=3974 ;63 obj.mixed_layer_capacity=3974.; 64 64 65 65 %thermal exchange velocity (ice-water interface) (m/s) … … 114 114 WriteData(fid,'object',obj,'fieldname','rheology_n','format','DoubleMat','mattype',2); 115 115 WriteData(fid,'object',obj,'fieldname','rheology_Z','format','DoubleMat','mattype',1); 116 WriteData(fid,'data',StringToEnum(obj.rheology_law),'enum',MaterialsRheologyLawEnum ,'format','Integer');116 WriteData(fid,'data',StringToEnum(obj.rheology_law),'enum',MaterialsRheologyLawEnum(),'format','Integer'); 117 117 end % }}} 118 118 end -
issm/branches/trunk-jpl-damage/src/m/classes/materials.py
r12168 r13101 1 1 #module imports 2 2 from fielddisplay import fielddisplay 3 from EnumDefinitions import * 4 from StringToEnum import StringToEnum 5 from checkfield import * 6 from WriteData import * 3 7 4 class materials: 8 class materials(object): 9 """ 10 MATERIALS class definition 11 12 Usage: 13 materials=materials(); 14 """ 15 5 16 #properties 6 17 def __init__(self): 7 18 # {{{ Properties 8 self.rho_ice = 0; 9 self.rho_water = 0; 10 self.mu_water = 0; 11 self.heatcapacity = 0; 12 self.latentheat = 0; 13 self.thermalconductivity = 0; 14 self.meltingpoint = 0; 15 self.beta = 0; 16 self.mixed_layer_capacity = 0; 17 self.thermal_exchange_velocity = 0; 19 self.rho_ice = 0. 20 self.rho_water = 0. 21 self.rho_freshwater = 0. 22 self.mu_water = 0. 23 self.heatcapacity = 0. 24 self.latentheat = 0. 25 self.thermalconductivity = 0. 26 self.meltingpoint = 0. 27 self.beta = 0. 28 self.mixed_layer_capacity = 0. 29 self.thermal_exchange_velocity = 0. 18 30 self.rheology_B = float('NaN') 19 31 self.rheology_n = float('NaN') 20 self.rheology_law = "";32 self.rheology_law = '' 21 33 22 34 self.setdefaultparameters() 23 35 #}}} 24 def __repr__( obj):36 def __repr__(self): 25 37 # {{{ Display 26 38 string=" Materials:" 27 39 28 string="%s\n\n%s"%(string,fielddisplay(obj,"rho_ice","ice density [kg/m^3]")) 29 string="%s\n%s"%(string,fielddisplay(obj,"rho_water","water density [kg/m^3]")) 30 string="%s\n%s"%(string,fielddisplay(obj,"mu_water","water viscosity [N s/m^2]")) 31 string="%s\n%s"%(string,fielddisplay(obj,"heatcapacity","heat capacity [J/kg/K]")) 32 string="%s\n%s"%(string,fielddisplay(obj,"thermalconductivity","ice thermal conductivity [W/m/K]")) 33 string="%s\n%s"%(string,fielddisplay(obj,"meltingpoint","melting point of ice at 1atm in K")) 34 string="%s\n%s"%(string,fielddisplay(obj,"latentheat","latent heat of fusion [J/m^3]")) 35 string="%s\n%s"%(string,fielddisplay(obj,"beta","rate of change of melting point with pressure [K/Pa]")) 36 string="%s\n%s"%(string,fielddisplay(obj,"mixed_layer_capacity","mixed layer capacity [W/kg/K]")) 37 string="%s\n%s"%(string,fielddisplay(obj,"thermal_exchange_velocity","thermal exchange velocity [m/s]")) 38 string="%s\n%s"%(string,fielddisplay(obj,"rheology_B","flow law parameter [Pa/s^(1/n)]")) 39 string="%s\n%s"%(string,fielddisplay(obj,"rheology_n","Glen""s flow law exponent")) 40 string="%s\n%s"%(string,fielddisplay(obj,"rheology_law","law for the temperature dependance of the rheology: ""None"", ""Paterson"" or ""Arrhenius""")) 40 string="%s\n\n%s"%(string,fielddisplay(self,"rho_ice","ice density [kg/m^3]")) 41 string="%s\n%s"%(string,fielddisplay(self,"rho_water","water density [kg/m^3]")) 42 string="%s\n%s"%(string,fielddisplay(self,"rho_freshwater","fresh water density [kg/m^3]")) 43 string="%s\n%s"%(string,fielddisplay(self,"mu_water","water viscosity [N s/m^2]")) 44 string="%s\n%s"%(string,fielddisplay(self,"heatcapacity","heat capacity [J/kg/K]")) 45 string="%s\n%s"%(string,fielddisplay(self,"thermalconductivity","ice thermal conductivity [W/m/K]")) 46 string="%s\n%s"%(string,fielddisplay(self,"meltingpoint","melting point of ice at 1atm in K")) 47 string="%s\n%s"%(string,fielddisplay(self,"latentheat","latent heat of fusion [J/m^3]")) 48 string="%s\n%s"%(string,fielddisplay(self,"beta","rate of change of melting point with pressure [K/Pa]")) 49 string="%s\n%s"%(string,fielddisplay(self,"mixed_layer_capacity","mixed layer capacity [W/kg/K]")) 50 string="%s\n%s"%(string,fielddisplay(self,"thermal_exchange_velocity","thermal exchange velocity [m/s]")) 51 string="%s\n%s"%(string,fielddisplay(self,"rheology_B","flow law parameter [Pa/s^(1/n)]")) 52 string="%s\n%s"%(string,fielddisplay(self,"rheology_n","Glen's flow law exponent")) 53 string="%s\n%s"%(string,fielddisplay(self,"rheology_law","law for the temperature dependance of the rheology: 'None', 'Paterson' or 'Arrhenius'")) 41 54 42 55 return string 43 56 #}}} 44 def setdefaultparameters( obj):57 def setdefaultparameters(self): 45 58 # {{{setdefaultparameters 46 59 #ice density (kg/m^3) 47 obj.rho_ice=91760 self.rho_ice=917. 48 61 49 #water density (kg/m^3) 50 obj.rho_water=1023 62 #ocean water density (kg/m^3) 63 self.rho_water=1023. 64 65 #fresh water density (kg/m^3) 66 self.rho_freshwater=1000. 51 67 52 68 #water viscosity (N.s/m^2) 53 obj.mu_water=0.00178769 self.mu_water=0.001787 54 70 55 71 #ice heat capacity cp (J/kg/K) 56 obj.heatcapacity=209372 self.heatcapacity=2093. 57 73 58 74 #ice latent heat of fusion L (J/kg) 59 obj.latentheat=3.34*10**575 self.latentheat=3.34*10**5 60 76 61 77 #ice thermal conductivity (W/m/K) 62 obj.thermalconductivity=2.478 self.thermalconductivity=2.4 63 79 64 80 #the melting point of ice at 1 atmosphere of pressure in K 65 obj.meltingpoint=273.1581 self.meltingpoint=273.15 66 82 67 83 #rate of change of melting point with pressure (K/Pa) 68 obj.beta=9.8*10**-884 self.beta=9.8*10**-8 69 85 70 86 #mixed layer (ice-water interface) heat capacity (J/kg/K) 71 obj.mixed_layer_capacity=397487 self.mixed_layer_capacity=3974. 72 88 73 89 #thermal exchange velocity (ice-water interface) (m/s) 74 obj.thermal_exchange_velocity=1.00*10**-490 self.thermal_exchange_velocity=1.00*10**-4 75 91 76 92 #Rheology law: what is the temperature dependence of B with T 77 93 #available: none, paterson and arrhenius 78 obj.rheology_law='Paterson'79 return obj94 self.rheology_law='Paterson' 95 return self 80 96 #}}} 97 98 def checkconsistency(self,md,solution,analyses): # {{{ 99 md = checkfield(md,'materials.rho_ice','>',0) 100 md = checkfield(md,'materials.rho_water','>',0) 101 md = checkfield(md,'materials.rho_freshwater','>',0) 102 md = checkfield(md,'materials.mu_water','>',0) 103 md = checkfield(md,'materials.rheology_B','>',0,'size',[md.mesh.numberofvertices]) 104 md = checkfield(md,'materials.rheology_n','>',0,'size',[md.mesh.numberofelements]) 105 md = checkfield(md,'materials.rheology_law','values',['None','Paterson','Arrhenius']) 106 return md 107 # }}} 108 109 def marshall(self,fid): # {{{ 110 WriteData(fid,'object',self,'fieldname','rho_ice','format','Double') 111 WriteData(fid,'object',self,'fieldname','rho_water','format','Double') 112 WriteData(fid,'object',self,'fieldname','rho_freshwater','format','Double') 113 WriteData(fid,'object',self,'fieldname','mu_water','format','Double') 114 WriteData(fid,'object',self,'fieldname','heatcapacity','format','Double') 115 WriteData(fid,'object',self,'fieldname','latentheat','format','Double') 116 WriteData(fid,'object',self,'fieldname','thermalconductivity','format','Double') 117 WriteData(fid,'object',self,'fieldname','meltingpoint','format','Double') 118 WriteData(fid,'object',self,'fieldname','beta','format','Double') 119 WriteData(fid,'object',self,'fieldname','mixed_layer_capacity','format','Double') 120 WriteData(fid,'object',self,'fieldname','thermal_exchange_velocity','format','Double') 121 WriteData(fid,'object',self,'fieldname','rheology_B','format','DoubleMat','mattype',1) 122 WriteData(fid,'object',self,'fieldname','rheology_n','format','DoubleMat','mattype',2) 123 WriteData(fid,'data',StringToEnum(self.rheology_law)[0],'enum',MaterialsRheologyLawEnum(),'format','Integer') 124 # }}} 125 -
issm/branches/trunk-jpl-damage/src/m/classes/mesh.m
r12946 r13101 87 87 md = checkfield(md,'mesh.vertexonbed','size',[md.mesh.numberofvertices 1],'values',[0 1]); 88 88 md = checkfield(md,'mesh.vertexonsurface','size',[md.mesh.numberofvertices 1],'values',[0 1]); 89 if (md.mesh.dimension==3), 90 md = checkfield(md,'mesh.z','>=',md.geometry.bed-10^-10,'message','''mesh.z'' lower than bedrock'); 91 md = checkfield(md,'mesh.z','<=',md.geometry.surface+10^-10,'message','''mesh.z'' higher than surface elevation'); 92 end 89 93 if (md.mesh.dimension==2), 90 94 md = checkfield(md,'mesh.average_vertex_connectivity','>=',9,'message','''mesh.average_vertex_connectivity'' should be at least 9 in 2d'); … … 96 100 %Solution specific checks 97 101 switch(solution), 98 case PrognosticSolutionEnum ,102 case PrognosticSolutionEnum(), 99 103 if md.prognostic.stabilization==3, 100 104 md = checkfield(md,'mesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d meshes'); … … 102 106 md = checkfield(md,'mesh.edges(:,1:3)','>',0); 103 107 end 104 case BalancethicknessSolutionEnum ,108 case BalancethicknessSolutionEnum(), 105 109 if md.balancethickness.stabilization==3, 106 110 md = checkfield(md,'mesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d meshes'); … … 108 112 md = checkfield(md,'mesh.edges(:,1:3)','>',0); 109 113 end 110 case TransientSolutionEnum ,114 case TransientSolutionEnum(), 111 115 if md.transient.isprognostic & md.prognostic.stabilization==3, 112 116 md = checkfield(md,'mesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d meshes'); … … 114 118 md = checkfield(md,'mesh.edges(:,1:3)','>',0); 115 119 end 116 case ThermalSolutionEnum ,120 case ThermalSolutionEnum(), 117 121 md = checkfield(md,'mesh.dimension','values',3,'message','thermal solution only supported on 3d meshes'); 118 122 end -
issm/branches/trunk-jpl-damage/src/m/classes/mesh.py
r12946 r13101 2 2 import numpy 3 3 from fielddisplay import fielddisplay 4 from EnumDefinitions import * 4 5 from checkfield import * 5 from EnumDefinitions import *6 6 from MatlabFuncs import * 7 7 8 class mesh: 8 class mesh(object): 9 """ 10 MESH class definition 11 12 Usage: 13 mesh=mesh(); 14 """ 15 9 16 #properties 10 17 def __init__(self): … … 54 61 55 62 #}}} 56 def __repr__( obj):63 def __repr__(self): 57 64 # {{{ Display 58 65 59 if obj.dimension==3:66 if self.dimension==3: 60 67 string="\n%s"%(" Elements and vertices of the original 2d mesh:") 61 68 62 string="%s\n%s"%(string,fielddisplay( obj,"numberofelements2d","number of elements"))63 string="%s\n%s"%(string,fielddisplay( obj,"numberofvertices2d","number of vertices"))64 string="%s\n%s"%(string,fielddisplay( obj,"elements2d","index into (x,y,z), coordinates of the vertices"))65 string="%s\n%s"%(string,fielddisplay( obj,"x2d","vertices x coordinate"))66 string="%s\n%s"%(string,fielddisplay( obj,"y2d","vertices y coordinate"))69 string="%s\n%s"%(string,fielddisplay(self,"numberofelements2d","number of elements")) 70 string="%s\n%s"%(string,fielddisplay(self,"numberofvertices2d","number of vertices")) 71 string="%s\n%s"%(string,fielddisplay(self,"elements2d","index into (x,y,z), coordinates of the vertices")) 72 string="%s\n%s"%(string,fielddisplay(self,"x2d","vertices x coordinate")) 73 string="%s\n%s"%(string,fielddisplay(self,"y2d","vertices y coordinate")) 67 74 68 75 string="%s\n%s" %(string,"Elements and vertices of the extruded 3d mesh:") 69 76 else: 70 77 string="\n%s"%(" Elements and vertices:") 71 string="%s\n%s"%(string,fielddisplay( obj,"numberofelements","number of elements"))72 string="%s\n%s"%(string,fielddisplay( obj,"numberofvertices","number of vertices"))73 string="%s\n%s"%(string,fielddisplay( obj,"elements","index into (x,y,z), coordinates of the vertices"))74 string="%s\n%s"%(string,fielddisplay( obj,"x","vertices x coordinate"))75 string="%s\n%s"%(string,fielddisplay( obj,"y","vertices y coordinate"))76 string="%s\n%s"%(string,fielddisplay( obj,"z","vertices z coordinate"))77 string="%s\n%s"%(string,fielddisplay( obj,"edges","edges of the 2d mesh (vertex1 vertex2 element1 element2)"))78 string="%s\n%s"%(string,fielddisplay( obj,"numberofedges","number of edges of the 2d mesh"))78 string="%s\n%s"%(string,fielddisplay(self,"numberofelements","number of elements")) 79 string="%s\n%s"%(string,fielddisplay(self,"numberofvertices","number of vertices")) 80 string="%s\n%s"%(string,fielddisplay(self,"elements","index into (x,y,z), coordinates of the vertices")) 81 string="%s\n%s"%(string,fielddisplay(self,"x","vertices x coordinate")) 82 string="%s\n%s"%(string,fielddisplay(self,"y","vertices y coordinate")) 83 string="%s\n%s"%(string,fielddisplay(self,"z","vertices z coordinate")) 84 string="%s\n%s"%(string,fielddisplay(self,"edges","edges of the 2d mesh (vertex1 vertex2 element1 element2)")) 85 string="%s\n%s"%(string,fielddisplay(self,"numberofedges","number of edges of the 2d mesh")) 79 86 80 87 string="%s%s"%(string,"\n Properties:") 81 string="%s\n%s"%(string,fielddisplay( obj,"dimension","mesh dimension (2d or 3d)"))82 string="%s\n%s"%(string,fielddisplay( obj,"numberoflayers","number of extrusion layers"))83 string="%s\n%s"%(string,fielddisplay( obj,"vertexonbed","lower vertices flags list"))84 string="%s\n%s"%(string,fielddisplay( obj,"elementonbed","lower elements flags list"))85 string="%s\n%s"%(string,fielddisplay( obj,"vertexonsurface","upper vertices flags list"))86 string="%s\n%s"%(string,fielddisplay( obj,"elementonsurface","upper elements flags list"))87 string="%s\n%s"%(string,fielddisplay( obj,"uppervertex","upper vertex list (NaN for vertex on the upper surface)"))88 string="%s\n%s"%(string,fielddisplay( obj,"upperelements","upper element list (NaN for element on the upper layer)"))89 string="%s\n%s"%(string,fielddisplay( obj,"lowervertex","lower vertex list (NaN for vertex on the lower surface)"))90 string="%s\n%s"%(string,fielddisplay( obj,"lowerelements","lower element list (NaN for element on the lower layer"))91 string="%s\n%s"%(string,fielddisplay( obj,"vertexonboundary","vertices on the boundary of the domain flag list"))92 string="%s\n%s"%(string,fielddisplay( obj,"segments","edges on domain boundary (vertex1 vertex2 element)"))93 string="%s\n%s"%(string,fielddisplay( obj,"segmentmarkers","number associated to each segment"))94 string="%s\n%s"%(string,fielddisplay( obj,"vertexconnectivity","list of vertices connected to vertex_i"))95 string="%s\n%s"%(string,fielddisplay( obj,"elementconnectivity","list of vertices connected to element_i"))96 string="%s\n%s"%(string,fielddisplay( obj,"average_vertex_connectivity","average number of vertices connected to one vertex"))88 string="%s\n%s"%(string,fielddisplay(self,"dimension","mesh dimension (2d or 3d)")) 89 string="%s\n%s"%(string,fielddisplay(self,"numberoflayers","number of extrusion layers")) 90 string="%s\n%s"%(string,fielddisplay(self,"vertexonbed","lower vertices flags list")) 91 string="%s\n%s"%(string,fielddisplay(self,"elementonbed","lower elements flags list")) 92 string="%s\n%s"%(string,fielddisplay(self,"vertexonsurface","upper vertices flags list")) 93 string="%s\n%s"%(string,fielddisplay(self,"elementonsurface","upper elements flags list")) 94 string="%s\n%s"%(string,fielddisplay(self,"uppervertex","upper vertex list (NaN for vertex on the upper surface)")) 95 string="%s\n%s"%(string,fielddisplay(self,"upperelements","upper element list (NaN for element on the upper layer)")) 96 string="%s\n%s"%(string,fielddisplay(self,"lowervertex","lower vertex list (NaN for vertex on the lower surface)")) 97 string="%s\n%s"%(string,fielddisplay(self,"lowerelements","lower element list (NaN for element on the lower layer")) 98 string="%s\n%s"%(string,fielddisplay(self,"vertexonboundary","vertices on the boundary of the domain flag list")) 99 string="%s\n%s"%(string,fielddisplay(self,"segments","edges on domain boundary (vertex1 vertex2 element)")) 100 string="%s\n%s"%(string,fielddisplay(self,"segmentmarkers","number associated to each segment")) 101 string="%s\n%s"%(string,fielddisplay(self,"vertexconnectivity","list of vertices connected to vertex_i")) 102 string="%s\n%s"%(string,fielddisplay(self,"elementconnectivity","list of vertices connected to element_i")) 103 string="%s\n%s"%(string,fielddisplay(self,"average_vertex_connectivity","average number of vertices connected to one vertex")) 97 104 98 105 string="%s%s"%(string,"\n Extracted model:") 99 string="%s\n%s"%(string,fielddisplay( obj,"extractedvertices","vertices extracted from the model"))100 string="%s\n%s"%(string,fielddisplay( obj,"extractedelements","elements extracted from the model"))106 string="%s\n%s"%(string,fielddisplay(self,"extractedvertices","vertices extracted from the model")) 107 string="%s\n%s"%(string,fielddisplay(self,"extractedelements","elements extracted from the model")) 101 108 102 109 string="%s%s"%(string,"\n Projection:") 103 string="%s\n%s"%(string,fielddisplay( obj,"lat","vertices latitude"))104 string="%s\n%s"%(string,fielddisplay( obj,"long","vertices longitude"))105 string="%s\n%s"%(string,fielddisplay( obj,"hemisphere","Indicate hemisphere ""n"" or ""s"""))110 string="%s\n%s"%(string,fielddisplay(self,"lat","vertices latitude")) 111 string="%s\n%s"%(string,fielddisplay(self,"long","vertices longitude")) 112 string="%s\n%s"%(string,fielddisplay(self,"hemisphere","Indicate hemisphere 'n' or 's'")) 106 113 return string 107 114 #}}} 108 115 109 def setdefaultparameters( obj):116 def setdefaultparameters(self): 110 117 # {{{setdefaultparameters 111 118 … … 115 122 #give a good memory/time ration. This value can be checked in 116 123 #trunk/test/Miscellaneous/runme.m 117 obj.average_vertex_connectivity=25118 119 return obj124 self.average_vertex_connectivity=25 125 126 return self 120 127 #}}} 121 128 … … 130 137 else: 131 138 md = checkfield(md,'mesh.elements','size',[md.mesh.numberofelements,6]) 132 if any(numpy.logical_not(ismember(range(1,md.mesh.numberofvertices+1),md.mesh.elements))):133 md = checkmessage(md,"orphan nodes have been found. Check the mesh outline")139 if numpy.any(numpy.logical_not(ismember(range(1,md.mesh.numberofvertices+1),md.mesh.elements))): 140 md.checkmessage("orphan nodes have been found. Check the mesh outline") 134 141 md = checkfield(md,'mesh.dimension','values',[2,3]) 135 142 md = checkfield(md,'mesh.numberoflayers','>=',0) … … 148 155 149 156 #Solution specific checks 150 if solution==PrognosticSolutionEnum :157 if solution==PrognosticSolutionEnum(): 151 158 if md.prognostic.stabilization==3: 152 159 md = checkfield(md,'mesh.dimension','values',2,'message',"Discontinuous Galerkin only supported for 2d meshes") 153 160 md = checkfield(md,'mesh.edges','size',[float('NaN'),4]) 154 161 md = checkfield(md,'mesh.edges[:,1:3]','>',0) 155 elif solution==BalancethicknessSolutionEnum :162 elif solution==BalancethicknessSolutionEnum(): 156 163 if md.balancethickness.stabilization==3: 157 164 md = checkfield(md,'mesh.dimension','values',2,'message',"Discontinuous Galerkin only supported for 2d meshes") 158 165 md = checkfield(md,'mesh.edges','size',[float('NaN'),4]) 159 166 md = checkfield(md,'mesh.edges[:,1:3]','>',0) 160 elif solution==TransientSolutionEnum :167 elif solution==TransientSolutionEnum(): 161 168 if md.transient.isprognostic and md.prognostic.stabilization==3: 162 169 md = checkfield(md,'mesh.dimension','values',2,'message',"Discontinuous Galerkin only supported for 2d meshes") 163 170 md = checkfield(md,'mesh.edges','size',[float('NaN'),4]) 164 171 md = checkfield(md,'mesh.edges[:,1:3]','>',0) 165 elif solution==ThermalSolutionEnum :172 elif solution==ThermalSolutionEnum(): 166 173 md = checkfield(md,'mesh.dimension','values',3,'message','thermal solution only supported on 3d meshes') 167 174 -
issm/branches/trunk-jpl-damage/src/m/classes/miscellaneous.m
r12878 r13101 1 %MISCEL ANEOUS class definition1 %MISCELLANEOUS class definition 2 2 % 3 3 % Usage: -
issm/branches/trunk-jpl-damage/src/m/classes/miscellaneous.py
r12168 r13101 1 1 #module imports 2 2 from fielddisplay import fielddisplay 3 from EnumDefinitions import * 4 from checkfield import * 5 from WriteData import * 3 6 4 class miscellaneous: 7 class miscellaneous(object): 8 """ 9 MISCELLANEOUS class definition 10 11 Usage: 12 miscellaneous=miscellaneous(); 13 """ 14 5 15 #properties 6 16 def __init__(self): … … 14 24 15 25 #}}} 16 def __repr__( obj):26 def __repr__(self): 17 27 # {{{ Display 18 28 string=' miscellaneous parameters:' 19 29 20 string="%s\n\n%s"%(string,fielddisplay( obj,'notes','notes in a cell of strings'))21 string="%s\n%s"%(string,fielddisplay( obj,'name','model name'))22 string="%s\n%s"%(string,fielddisplay( obj,'dummy','empty field to store some data'))30 string="%s\n\n%s"%(string,fielddisplay(self,'notes','notes in a cell of strings')) 31 string="%s\n%s"%(string,fielddisplay(self,'name','model name')) 32 string="%s\n%s"%(string,fielddisplay(self,'dummy','empty field to store some data')) 23 33 return string 24 34 #}}} 25 35 26 def setdefaultparameters( obj):36 def setdefaultparameters(self): 27 37 # {{{setdefaultparameters 28 return obj38 return self 29 39 #}}} 30 40 41 def checkconsistency(self,md,solution,analyses): # {{{ 42 md = checkfield(md,'miscellaneous.name','empty',1) 43 return md 44 # }}} 45 46 def marshall(self,fid): # {{{ 47 WriteData(fid,'object',self,'fieldname','name','format','String') 48 # }}} 49 -
issm/branches/trunk-jpl-damage/src/m/classes/model/model.m
r12878 r13101 91 91 end 92 92 %}}} 93 function md = collapse(md)% {{{ 94 %COLLAPSE - collapses a 3d mesh into a 2d mesh 95 % 96 % This routine collapses a 3d model into a 2d model 97 % and collapses all the fileds of the 3d model by 98 % taking their depth-averaged values 99 % 100 % Usage: 101 % md=collapse(md) 102 % 103 % See also: EXTRUDE, MODELEXTRACT 104 105 %Check that the model is really a 3d model 106 if ~md.mesh.dimension==3, 107 error('collapse error message: only 3d mesh can be collapsed') 108 end 109 110 %Start with changing alle the fields from the 3d mesh 111 112 %drag is limited to nodes that are on the bedrock. 113 md.friction.coefficient=project2d(md,md.friction.coefficient,1); 114 115 %p and q (same deal, except for element that are on the bedrock: ) 116 md.friction.p=project2d(md,md.friction.p,1); 117 md.friction.q=project2d(md,md.friction.q,1); 118 119 %observations 120 if ~isnan(md.inversion.vx_obs), md.inversion.vx_obs=project2d(md,md.inversion.vx_obs,md.mesh.numberoflayers); end; 121 if ~isnan(md.inversion.vy_obs), md.inversion.vy_obs=project2d(md,md.inversion.vy_obs,md.mesh.numberoflayers); end; 122 if ~isnan(md.inversion.vel_obs), md.inversion.vel_obs=project2d(md,md.inversion.vel_obs,md.mesh.numberoflayers); end; 123 if ~isnan(md.inversion.cost_functions_coefficients), md.inversion.cost_functions_coefficients=project2d(md,md.inversion.cost_functions_coefficients,md.mesh.numberoflayers); end; 124 if numel(md.inversion.min_parameters)>1, md.inversion.min_parameters=project2d(md,md.inversion.min_parameters,md.mesh.numberoflayers); end; 125 if numel(md.inversion.max_parameters)>1, md.inversion.max_parameters=project2d(md,md.inversion.max_parameters,md.mesh.numberoflayers); end; 126 if ~isnan(md.surfaceforcings.mass_balance), 127 md.surfaceforcings.mass_balance=project2d(md,md.surfaceforcings.mass_balance,md.mesh.numberoflayers); 128 end; 129 if ~isnan(md.balancethickness.thickening_rate), md.balancethickness.thickening_rate=project2d(md,md.balancethickness.thickening_rate,md.mesh.numberoflayers); end; 130 131 %results 132 if ~isnan(md.initialization.vx),md.initialization.vx=DepthAverage(md,md.initialization.vx);end; 133 if ~isnan(md.initialization.vy),md.initialization.vy=DepthAverage(md,md.initialization.vy);end; 134 if ~isnan(md.initialization.vz),md.initialization.vz=DepthAverage(md,md.initialization.vz);end; 135 if ~isnan(md.initialization.vel),md.initialization.vel=DepthAverage(md,md.initialization.vel);end; 136 if ~isnan(md.initialization.temperature),md.initialization.temperature=DepthAverage(md,md.initialization.temperature);end; 137 138 %bedinfo and surface info 139 md.mesh.elementonbed=ones(md.mesh.numberofelements2d,1); 140 md.mesh.elementonsurface=ones(md.mesh.numberofelements2d,1); 141 md.mesh.vertexonbed=ones(md.mesh.numberofvertices2d,1); 142 md.mesh.vertexonsurface=ones(md.mesh.numberofvertices2d,1); 143 144 %elementstype 145 if ~isnan(md.flowequation.element_equation) 146 md.flowequation.element_equation=project2d(md,md.flowequation.element_equation,1); 147 md.flowequation.vertex_equation=project2d(md,md.flowequation.vertex_equation,1); 148 md.flowequation.bordermacayeal=project2d(md,md.flowequation.bordermacayeal,1); 149 md.flowequation.borderpattyn=project2d(md,md.flowequation.borderpattyn,1); 150 md.flowequation.borderstokes=project2d(md,md.flowequation.borderstokes,1); 151 end 152 153 %boundary conditions 154 md.diagnostic.spcvx=project2d(md,md.diagnostic.spcvx,md.mesh.numberoflayers); 155 md.diagnostic.spcvy=project2d(md,md.diagnostic.spcvy,md.mesh.numberoflayers); 156 md.diagnostic.spcvz=project2d(md,md.diagnostic.spcvz,md.mesh.numberoflayers); 157 md.diagnostic.referential=project2d(md,md.diagnostic.referential,md.mesh.numberoflayers); 158 md.prognostic.spcthickness=project2d(md,md.prognostic.spcthickness,md.mesh.numberoflayers); 159 md.thermal.spctemperature=project2d(md,md.thermal.spctemperature,md.mesh.numberoflayers); 160 161 %Extrusion of Neumann BC 162 if ~isnan(md.diagnostic.icefront), 163 numberofneumann2d=size(md.diagnostic.icefront,1)/(md.mesh.numberoflayers-1); 164 md.diagnostic.icefront=[md.diagnostic.icefront(1:numberofneumann2d,1:2) md.diagnostic.icefront(1:numberofneumann2d,5:6)]; %Add two columns on the first layer 165 end 166 167 %materials 168 md.materials.rheology_B=DepthAverage(md,md.materials.rheology_B); 169 md.materials.rheology_n=project2d(md,md.materials.rheology_n,1); 170 171 %special for thermal modeling: 172 md.basalforcings.melting_rate=project2d(md,md.basalforcings.melting_rate,1); 173 md.basalforcings.geothermalflux=project2d(md,md.basalforcings.geothermalflux,1); %bedrock only gets geothermal flux 174 175 %update of connectivity matrix 176 md.mesh.average_vertex_connectivity=25; 177 178 %Collapse the mesh 179 nodes2d=md.mesh.numberofvertices2d; 180 elements2d=md.mesh.numberofelements2d; 181 182 %parameters 183 md.geometry.surface=project2d(md,md.geometry.surface,1); 184 md.geometry.thickness=project2d(md,md.geometry.thickness,1); 185 md.geometry.bed=project2d(md,md.geometry.bed,1); 186 md.geometry.bathymetry=project2d(md,md.geometry.bathymetry,1); 187 md.mesh.vertexonboundary=project2d(md,md.mesh.vertexonboundary,1); 188 md.mesh.elementconnectivity=project2d(md,md.mesh.elementconnectivity,1); 189 md.mask.elementonfloatingice=project2d(md,md.mask.elementonfloatingice,1); 190 md.mask.vertexonfloatingice=project2d(md,md.mask.vertexonfloatingice,1); 191 md.mask.elementongroundedice=project2d(md,md.mask.elementongroundedice,1); 192 md.mask.vertexongroundedice=project2d(md,md.mask.vertexongroundedice,1); 193 md.mask.elementonwater=project2d(md,md.mask.elementonwater,1); 194 md.mask.vertexonwater=project2d(md,md.mask.vertexonwater,1); 195 196 %lat long 197 if numel(md.mesh.lat) ==md.mesh.numberofvertices, md.mesh.lat=project2d(md,md.mesh.lat,1); end 198 if numel(md.mesh.long)==md.mesh.numberofvertices, md.mesh.long=project2d(md,md.mesh.long,1); end 199 200 %Initialize with the 2d mesh 201 md.mesh.x=md.mesh.x2d; 202 md.mesh.y=md.mesh.y2d; 203 md.mesh.z=zeros(size(md.mesh.x2d)); 204 md.mesh.numberofvertices=md.mesh.numberofvertices2d; 205 md.mesh.numberofelements=md.mesh.numberofelements2d; 206 md.mesh.elements=md.mesh.elements2d; 207 208 %Keep a trace of lower and upper nodes 209 md.mesh.lowervertex=NaN; 210 md.mesh.uppervertex=NaN; 211 md.mesh.lowerelements=NaN; 212 md.mesh.upperelements=NaN; 213 214 %Remove old mesh 215 md.mesh.x2d=NaN; 216 md.mesh.y2d=NaN; 217 md.mesh.elements2d=NaN; 218 md.mesh.numberofelements2d=md.mesh.numberofelements; 219 md.mesh.numberofvertices2d=md.mesh.numberofvertices; 220 md.mesh.numberoflayers=0; 221 222 %Update mesh type 223 md.mesh.dimension=2; 224 end % }}} 225 function md2 = extract(md,area) % {{{ 226 %extract - extract a model according to an Argus contour or flag list 227 % 228 % This routine extracts a submodel from a bigger model with respect to a given contour 229 % md must be followed by the corresponding exp file or flags list 230 % It can either be a domain file (argus type, .exp extension), or an array of element flags. 231 % If user wants every element outside the domain to be 232 % extract2d, add '~' to the name of the domain file (ex: '~Pattyn.exp'); 233 % an empty string '' will be considered as an empty domain 234 % a string 'all' will be considered as the entire domain 235 % add an argument 0 if you do not want the elements to be checked (faster) 236 % 237 % Usage: 238 % md2=extract(md,area); 239 % 240 % Examples: 241 % md2=extract(md,'Domain.exp'); 242 % md2=extract(md,md.mask.elementonfloatingice); 243 % 244 % See also: EXTRUDE, COLLAPSE 245 246 %copy model 247 md1=md; 248 249 %some checks 250 if ((nargin~=2) | (nargout~=1)), 251 help extract 252 error('extract error message: bad usage'); 253 end 254 255 %get check option 256 if (nargin==3 & varargin{1}==0), 257 checkoutline=0; 258 else 259 checkoutline=1; 260 end 261 262 %get elements that are inside area 263 flag_elem=FlagElements(md1,area); 264 if ~any(flag_elem), 265 error('extracted model is empty'); 266 end 267 268 %kick out all elements with 3 dirichlets 269 spc_elem=find(~flag_elem); 270 spc_node=sort(unique(md1.mesh.elements(spc_elem,:))); 271 flag=ones(md1.mesh.numberofvertices,1); 272 flag(spc_node)=0; 273 pos=find(sum(flag(md1.mesh.elements),2)==0); 274 flag_elem(pos)=0; 275 276 %extracted elements and nodes lists 277 pos_elem=find(flag_elem); 278 pos_node=sort(unique(md1.mesh.elements(pos_elem,:))); 279 280 %keep track of some fields 281 numberofvertices1=md1.mesh.numberofvertices; 282 numberofelements1=md1.mesh.numberofelements; 283 numberofvertices2=length(pos_node); 284 numberofelements2=length(pos_elem); 285 flag_node=zeros(numberofvertices1,1); 286 flag_node(pos_node)=1; 287 288 %Create Pelem and Pnode (transform old nodes in new nodes and same thing for the elements) 289 Pelem=zeros(numberofelements1,1); 290 Pelem(pos_elem)=[1:numberofelements2]'; 291 Pnode=zeros(numberofvertices1,1); 292 Pnode(pos_node)=[1:numberofvertices2]'; 293 294 %renumber the elements (some node won't exist anymore) 295 elements_1=md1.mesh.elements; 296 elements_2=elements_1(pos_elem,:); 297 elements_2(:,1)=Pnode(elements_2(:,1)); 298 elements_2(:,2)=Pnode(elements_2(:,2)); 299 elements_2(:,3)=Pnode(elements_2(:,3)); 300 if md1.mesh.dimension==3, 301 elements_2(:,4)=Pnode(elements_2(:,4)); 302 elements_2(:,5)=Pnode(elements_2(:,5)); 303 elements_2(:,6)=Pnode(elements_2(:,6)); 304 end 305 306 %OK, now create the new model ! 307 308 %take every fields from model 309 md2=md1; 310 311 %automatically modify fields 312 313 %loop over model fields 314 model_fields=fields(md1); 315 for i=1:length(model_fields), 316 %get field 317 field=md1.(model_fields{i}); 318 fieldsize=size(field); 319 if isobject(field), %recursive call 320 object_fields=fields(md1.(model_fields{i})); 321 for j=1:length(object_fields), 322 %get field 323 field=md1.(model_fields{i}).(object_fields{j}); 324 fieldsize=size(field); 325 %size = number of nodes * n 326 if fieldsize(1)==numberofvertices1 327 md2.(model_fields{i}).(object_fields{j})=field(pos_node,:); 328 elseif (fieldsize(1)==numberofvertices1+1) 329 md2.(model_fields{i}).(object_fields{j})=[field(pos_node,:); field(end,:)]; 330 %size = number of elements * n 331 elseif fieldsize(1)==numberofelements1 332 md2.(model_fields{i}).(object_fields{j})=field(pos_elem,:); 333 end 334 end 335 else 336 %size = number of nodes * n 337 if fieldsize(1)==numberofvertices1 338 md2.(model_fields{i})=field(pos_node,:); 339 elseif (fieldsize(1)==numberofvertices1+1) 340 md2.(model_fields{i})=[field(pos_node,:); field(end,:)]; 341 %size = number of elements * n 342 elseif fieldsize(1)==numberofelements1 343 md2.(model_fields{i})=field(pos_elem,:); 344 end 345 end 346 end 347 348 %modify some specific fields 349 350 %Mesh 351 md2.mesh.numberofelements=numberofelements2; 352 md2.mesh.numberofvertices=numberofvertices2; 353 md2.mesh.elements=elements_2; 354 355 %mesh.uppervertex mesh.lowervertex 356 if md1.mesh.dimension==3 357 md2.mesh.uppervertex=md1.mesh.uppervertex(pos_node); 358 pos=find(~isnan(md2.mesh.uppervertex)); 359 md2.mesh.uppervertex(pos)=Pnode(md2.mesh.uppervertex(pos)); 360 361 md2.mesh.lowervertex=md1.mesh.lowervertex(pos_node); 362 pos=find(~isnan(md2.mesh.lowervertex)); 363 md2.mesh.lowervertex(pos)=Pnode(md2.mesh.lowervertex(pos)); 364 365 md2.mesh.upperelements=md1.mesh.upperelements(pos_elem); 366 pos=find(~isnan(md2.mesh.upperelements)); 367 md2.mesh.upperelements(pos)=Pelem(md2.mesh.upperelements(pos)); 368 369 md2.mesh.lowerelements=md1.mesh.lowerelements(pos_elem); 370 pos=find(~isnan(md2.mesh.lowerelements)); 371 md2.mesh.lowerelements(pos)=Pelem(md2.mesh.lowerelements(pos)); 372 end 373 374 %Initial 2d mesh 375 if md1.mesh.dimension==3 376 flag_elem_2d=flag_elem(1:md1.mesh.numberofelements2d); 377 pos_elem_2d=find(flag_elem_2d); 378 flag_node_2d=flag_node(1:md1.mesh.numberofvertices2d); 379 pos_node_2d=find(flag_node_2d); 380 381 md2.mesh.numberofelements2d=length(pos_elem_2d); 382 md2.mesh.numberofvertices2d=length(pos_node_2d); 383 md2.mesh.elements2d=md1.mesh.elements2d(pos_elem_2d,:); 384 md2.mesh.elements2d(:,1)=Pnode(md2.mesh.elements2d(:,1)); 385 md2.mesh.elements2d(:,2)=Pnode(md2.mesh.elements2d(:,2)); 386 md2.mesh.elements2d(:,3)=Pnode(md2.mesh.elements2d(:,3)); 387 388 md2.mesh.x2d=md1.mesh.x(pos_node_2d); 389 md2.mesh.y2d=md1.mesh.y(pos_node_2d); 390 end 391 392 %Edges 393 if size(md2.mesh.edges,2)>1, %do not use ~isnan because there are some NaNs... 394 %renumber first two columns 395 pos=find(md2.mesh.edges(:,4)~=-1); 396 md2.mesh.edges(: ,1)=Pnode(md2.mesh.edges(:,1)); 397 md2.mesh.edges(: ,2)=Pnode(md2.mesh.edges(:,2)); 398 md2.mesh.edges(: ,3)=Pelem(md2.mesh.edges(:,3)); 399 md2.mesh.edges(pos,4)=Pelem(md2.mesh.edges(pos,4)); 400 %remove edges when the 2 vertices are not in the domain. 401 md2.mesh.edges=md2.mesh.edges(find(md2.mesh.edges(:,1) & md2.mesh.edges(:,2)),:); 402 %Replace all zeros by -1 in the last two columns; 403 pos=find(md2.mesh.edges(:,3)==0); 404 md2.mesh.edges(pos,3)=-1; 405 pos=find(md2.mesh.edges(:,4)==0); 406 md2.mesh.edges(pos,4)=-1; 407 %Invert -1 on the third column with last column (Also invert first two columns!!) 408 pos=find(md2.mesh.edges(:,3)==-1); 409 md2.mesh.edges(pos,3)=md2.mesh.edges(pos,4); 410 md2.mesh.edges(pos,4)=-1; 411 values=md2.mesh.edges(pos,2); 412 md2.mesh.edges(pos,2)=md2.mesh.edges(pos,1); 413 md2.mesh.edges(pos,1)=values; 414 %Finally remove edges that do not belong to any element 415 pos=find(md2.mesh.edges(:,3)==-1 & md2.mesh.edges(:,4)==-1); 416 md2.mesh.edges(pos,:)=[]; 417 end 418 419 %Penalties 420 if ~isnan(md2.diagnostic.vertex_pairing), 421 for i=1:size(md1.diagnostic.vertex_pairing,1); 422 md2.diagnostic.vertex_pairing(i,:)=Pnode(md1.diagnostic.vertex_pairing(i,:)); 423 end 424 md2.diagnostic.vertex_pairing=md2.diagnostic.vertex_pairing(find(md2.diagnostic.vertex_pairing(:,1)),:); 425 end 426 if ~isnan(md2.prognostic.vertex_pairing), 427 for i=1:size(md1.prognostic.vertex_pairing,1); 428 md2.prognostic.vertex_pairing(i,:)=Pnode(md1.prognostic.vertex_pairing(i,:)); 429 end 430 md2.prognostic.vertex_pairing=md2.prognostic.vertex_pairing(find(md2.prognostic.vertex_pairing(:,1)),:); 431 end 432 433 %recreate segments 434 if md1.mesh.dimension==2 435 md2.mesh.vertexconnectivity=NodeConnectivity(md2.mesh.elements,md2.mesh.numberofvertices); 436 md2.mesh.elementconnectivity=ElementConnectivity(md2.mesh.elements,md2.mesh.vertexconnectivity); 437 md2.mesh.segments=contourenvelope(md2); 438 md2.mesh.vertexonboundary=zeros(numberofvertices2,1); md2.mesh.vertexonboundary(md2.mesh.segments(:,1:2))=1; 439 else 440 %First do the connectivity for the contourenvelope in 2d 441 md2.mesh.vertexconnectivity=NodeConnectivity(md2.mesh.elements2d,md2.mesh.numberofvertices2d); 442 md2.mesh.elementconnectivity=ElementConnectivity(md2.mesh.elements2d,md2.mesh.vertexconnectivity); 443 md2.mesh.segments=contourenvelope(md2); 444 md2.mesh.vertexonboundary=zeros(numberofvertices2/md2.mesh.numberoflayers,1); md2.mesh.vertexonboundary(md2.mesh.segments(:,1:2))=1; 445 md2.mesh.vertexonboundary=repmat(md2.mesh.vertexonboundary,md2.mesh.numberoflayers,1); 446 %Then do it for 3d as usual 447 md2.mesh.vertexconnectivity=NodeConnectivity(md2.mesh.elements,md2.mesh.numberofvertices); 448 md2.mesh.elementconnectivity=ElementConnectivity(md2.mesh.elements,md2.mesh.vertexconnectivity); 449 end 450 451 %Boundary conditions: Dirichlets on new boundary 452 %Catch the elements that have not been extracted 453 orphans_elem=find(~flag_elem); 454 orphans_node=unique(md1.mesh.elements(orphans_elem,:))'; 455 %Figure out which node are on the boundary between md2 and md1 456 nodestoflag1=intersect(orphans_node,pos_node); 457 nodestoflag2=Pnode(nodestoflag1); 458 if numel(md1.diagnostic.spcvx)>1 & numel(md1.diagnostic.spcvy)>2 & numel(md1.diagnostic.spcvz)>2, 459 if numel(md1.inversion.vx_obs)>1 & numel(md1.inversion.vy_obs)>1 460 md2.diagnostic.spcvx(nodestoflag2)=md2.inversion.vx_obs(nodestoflag2); 461 md2.diagnostic.spcvy(nodestoflag2)=md2.inversion.vy_obs(nodestoflag2); 462 else 463 md2.diagnostic.spcvx(nodestoflag2)=NaN; 464 md2.diagnostic.spcvy(nodestoflag2)=NaN; 465 disp(' ') 466 disp('!! extract warning: spc values should be checked !!') 467 disp(' ') 468 end 469 %put 0 for vz 470 md2.diagnostic.spcvz(nodestoflag2)=0; 471 end 472 if ~isnan(md1.thermal.spctemperature), 473 md2.thermal.spctemperature(nodestoflag2,1)=1; 474 end 475 476 %Diagnostic 477 if ~isnan(md2.diagnostic.icefront) 478 md2.diagnostic.icefront(:,1)=Pnode(md1.diagnostic.icefront(:,1)); 479 md2.diagnostic.icefront(:,2)=Pnode(md1.diagnostic.icefront(:,2)); 480 md2.diagnostic.icefront(:,end-1)=Pelem(md1.diagnostic.icefront(:,end-1)); 481 if md1.mesh.dimension==3 482 md2.diagnostic.icefront(:,3)=Pnode(md1.diagnostic.icefront(:,3)); 483 md2.diagnostic.icefront(:,4)=Pnode(md1.diagnostic.icefront(:,4)); 484 end 485 md2.diagnostic.icefront=md2.diagnostic.icefront(find(md2.diagnostic.icefront(:,1) & md2.diagnostic.icefront(:,2) & md2.diagnostic.icefront(:,end)),:); 486 end 487 488 %Results fields 489 if isstruct(md1.results), 490 md2.results=struct(); 491 solutionfields=fields(md1.results); 492 for i=1:length(solutionfields), 493 %get subfields 494 solutionsubfields=fields(md1.results.(solutionfields{i})); 495 for j=1:length(solutionsubfields), 496 field=md1.results.(solutionfields{i}).(solutionsubfields{j}); 497 if length(field)==numberofvertices1, 498 md2.results.(solutionfields{i}).(solutionsubfields{j})=field(pos_node); 499 elseif length(field)==numberofelements1, 500 md2.results.(solutionfields{i}).(solutionsubfields{j})=field(pos_elem); 501 else 502 md2.results.(solutionfields{i}).(solutionsubfields{j})=field; 503 end 504 end 505 end 506 end 507 508 %Keep track of pos_node and pos_elem 509 md2.mesh.extractedvertices=pos_node; 510 md2.mesh.extractedelements=pos_elem; 511 end % }}} 512 function md = extrude(md,varargin) % {{{ 513 %EXTRUDE - vertically extrude a 2d mesh 514 % 515 % vertically extrude a 2d mesh and create corresponding 3d mesh. 516 % The vertical distribution can: 517 % - follow a polynomial law 518 % - follow two polynomial laws, one for the lower part and one for the upper part of the mesh 519 % - be discribed by a list of coefficients (between 0 and 1) 520 % 521 % 522 % Usage: 523 % md=extrude(md,numlayers,extrusionexponent); 524 % md=extrude(md,numlayers,lowerexponent,upperexponent); 525 % md=extrude(md,listofcoefficients); 526 % 527 % Example: 528 % md=extrude(md,8,3); 529 % md=extrude(md,8,3,2); 530 % md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1]); 531 % 532 % See also: MODELEXTRACT, COLLAPSE 533 534 %some checks on list of arguments 535 if ((nargin>4) | (nargin<2) | (nargout~=1)), 536 help extrude; 537 error('extrude error message'); 538 end 539 540 %Extrude the mesh 541 if nargin==2, %list of coefficients 542 list=varargin{1}; 543 if any(list<0) | any(list>1), 544 error('extrusioncoefficients must be between 0 and 1'); 545 end 546 extrusionlist=sort(unique([list(:);0;1])); 547 numlayers=length(extrusionlist); 548 elseif nargin==3, %one polynomial law 549 if varargin{2}<=0, 550 help extrude; 551 error('extrusionexponent must be >=0'); 552 end 553 numlayers=varargin{1}; 554 extrusionlist=((0:1:numlayers-1)/(numlayers-1)).^varargin{2}; 555 elseif nargin==4, %two polynomial laws 556 numlayers=varargin{1}; 557 lowerexp=varargin{2}; 558 upperexp=varargin{3}; 559 560 if varargin{2}<=0 | varargin{3}<=0, 561 help extrude; 562 error('lower and upper extrusionexponents must be >=0'); 563 end 564 565 lowerextrusionlist=[(0:2/(numlayers-1):1).^lowerexp]/2; 566 upperextrusionlist=[(0:2/(numlayers-1):1).^upperexp]/2; 567 extrusionlist=sort(unique([lowerextrusionlist 1-upperextrusionlist])); 568 569 end 570 571 if numlayers<2, 572 error('number of layers should be at least 2'); 573 end 574 if md.mesh.dimension==3, 575 error('Cannot extrude a 3d mesh (extrude cannot be called more than once)'); 576 end 577 578 %Initialize with the 2d mesh 579 x3d=[]; 580 y3d=[]; 581 z3d=[]; %the lower node is on the bed 582 thickness3d=md.geometry.thickness; %thickness and bed for these nodes 583 bed3d=md.geometry.bed; 584 585 %Create the new layers 586 for i=1:numlayers, 587 x3d=[x3d; md.mesh.x]; 588 y3d=[y3d; md.mesh.y]; 589 %nodes are distributed between bed and surface accordingly to the given exponent 590 z3d=[z3d; bed3d+thickness3d*extrusionlist(i)]; 591 end 592 number_nodes3d=size(x3d,1); %number of 3d nodes for the non extruded part of the mesh 593 594 %Extrude elements 595 elements3d=[]; 596 for i=1:numlayers-1, 597 elements3d=[elements3d;[md.mesh.elements+(i-1)*md.mesh.numberofvertices md.mesh.elements+i*md.mesh.numberofvertices]]; %Create the elements of the 3d mesh for the non extruded part 598 end 599 number_el3d=size(elements3d,1); %number of 3d nodes for the non extruded part of the mesh 600 601 %Keep a trace of lower and upper nodes 602 mesh.lowervertex=NaN*ones(number_nodes3d,1); 603 mesh.uppervertex=NaN*ones(number_nodes3d,1); 604 mesh.lowervertex(md.mesh.numberofvertices+1:end)=1:(numlayers-1)*md.mesh.numberofvertices; 605 mesh.uppervertex(1:(numlayers-1)*md.mesh.numberofvertices)=md.mesh.numberofvertices+1:number_nodes3d; 606 md.mesh.lowervertex=mesh.lowervertex; 607 md.mesh.uppervertex=mesh.uppervertex; 608 609 %same for lower and upper elements 610 mesh.lowerelements=NaN*ones(number_el3d,1); 611 mesh.upperelements=NaN*ones(number_el3d,1); 612 mesh.lowerelements(md.mesh.numberofelements+1:end)=1:(numlayers-2)*md.mesh.numberofelements; 613 mesh.upperelements(1:(numlayers-2)*md.mesh.numberofelements)=md.mesh.numberofelements+1:(numlayers-1)*md.mesh.numberofelements; 614 md.mesh.lowerelements=mesh.lowerelements; 615 md.mesh.upperelements=mesh.upperelements; 616 617 %Save old mesh 618 md.mesh.x2d=md.mesh.x; 619 md.mesh.y2d=md.mesh.y; 620 md.mesh.elements2d=md.mesh.elements; 621 md.mesh.numberofelements2d=md.mesh.numberofelements; 622 md.mesh.numberofvertices2d=md.mesh.numberofvertices; 623 624 %Update mesh type 625 md.mesh.dimension=3; 626 627 %Build global 3d mesh 628 md.mesh.elements=elements3d; 629 md.mesh.x=x3d; 630 md.mesh.y=y3d; 631 md.mesh.z=z3d; 632 md.mesh.numberofelements=number_el3d; 633 md.mesh.numberofvertices=number_nodes3d; 634 md.mesh.numberoflayers=numlayers; 635 636 %Ok, now deal with the other fields from the 2d mesh: 637 638 %lat long 639 md.mesh.lat=project3d(md,'vector',md.mesh.lat,'type','node'); 640 md.mesh.long=project3d(md,'vector',md.mesh.long,'type','node'); 641 642 %drag coefficient is limited to nodes that are on the bedrock. 643 md.friction.coefficient=project3d(md,'vector',md.friction.coefficient,'type','node','layer',1); 644 645 %p and q (same deal, except for element that are on the bedrock: ) 646 md.friction.p=project3d(md,'vector',md.friction.p,'type','element'); 647 md.friction.q=project3d(md,'vector',md.friction.q,'type','element'); 648 649 %observations 650 md.inversion.vx_obs=project3d(md,'vector',md.inversion.vx_obs,'type','node'); 651 md.inversion.vy_obs=project3d(md,'vector',md.inversion.vy_obs,'type','node'); 652 md.inversion.vel_obs=project3d(md,'vector',md.inversion.vel_obs,'type','node'); 653 md.surfaceforcings.mass_balance=project3d(md,'vector',md.surfaceforcings.mass_balance,'type','node'); 654 md.surfaceforcings.precipitation=project3d(md,'vector',md.surfaceforcings.precipitation,'type','node'); 655 md.balancethickness.thickening_rate=project3d(md,'vector',md.balancethickness.thickening_rate,'type','node'); 656 md.surfaceforcings.monthlytemperatures=project3d(md,'vector',md.surfaceforcings.monthlytemperatures,'type','node'); 657 658 %results 659 if ~isnan(md.initialization.vx),md.initialization.vx=project3d(md,'vector',md.initialization.vx,'type','node');end; 660 if ~isnan(md.initialization.vy),md.initialization.vy=project3d(md,'vector',md.initialization.vy,'type','node');end; 661 if ~isnan(md.initialization.vz),md.initialization.vz=project3d(md,'vector',md.initialization.vz,'type','node');end; 662 if ~isnan(md.initialization.vel),md.initialization.vel=project3d(md,'vector',md.initialization.vel,'type','node');end; 663 if ~isnan(md.initialization.temperature),md.initialization.temperature=project3d(md,'vector',md.initialization.temperature,'type','node');end; 664 if ~isnan(md.initialization.waterfraction),md.initialization.waterfraction=project3d(md,'vector',md.initialization.waterfraction,'type','node');end; 665 666 %bedinfo and surface info 667 md.mesh.elementonbed=project3d(md,'vector',ones(md.mesh.numberofelements2d,1),'type','element','layer',1); 668 md.mesh.elementonsurface=project3d(md,'vector',ones(md.mesh.numberofelements2d,1),'type','element','layer',md.mesh.numberoflayers-1); 669 md.mesh.vertexonbed=project3d(md,'vector',ones(md.mesh.numberofvertices2d,1),'type','node','layer',1); 670 md.mesh.vertexonsurface=project3d(md,'vector',ones(md.mesh.numberofvertices2d,1),'type','node','layer',md.mesh.numberoflayers); 671 672 %elementstype 673 if ~isnan(md.flowequation.element_equation) 674 oldelements_type=md.flowequation.element_equation; 675 md.flowequation.element_equation=zeros(number_el3d,1); 676 md.flowequation.element_equation=project3d(md,'vector',oldelements_type,'type','element'); 677 end 678 679 %verticestype 680 if ~isnan(md.flowequation.vertex_equation) 681 oldvertices_type=md.flowequation.vertex_equation; 682 md.flowequation.vertex_equation=zeros(number_nodes3d,1); 683 md.flowequation.vertex_equation=project3d(md,'vector',oldvertices_type,'type','node'); 684 end 685 md.flowequation.bordermacayeal=project3d(md,'vector',md.flowequation.bordermacayeal,'type','node'); 686 md.flowequation.borderpattyn=project3d(md,'vector',md.flowequation.borderpattyn,'type','node'); 687 md.flowequation.borderstokes=project3d(md,'vector',md.flowequation.borderstokes,'type','node'); 688 689 %boundary conditions 690 md.diagnostic.spcvx=project3d(md,'vector',md.diagnostic.spcvx,'type','node'); 691 md.diagnostic.spcvy=project3d(md,'vector',md.diagnostic.spcvy,'type','node'); 692 md.diagnostic.spcvz=project3d(md,'vector',md.diagnostic.spcvz,'type','node'); 693 md.thermal.spctemperature=project3d(md,'vector',md.thermal.spctemperature,'type','node','layer',md.mesh.numberoflayers,'padding',NaN); 694 md.prognostic.spcthickness=project3d(md,'vector',md.prognostic.spcthickness,'type','node'); 695 md.balancethickness.spcthickness=project3d(md,'vector',md.balancethickness.spcthickness,'type','node'); 696 md.diagnostic.referential=project3d(md,'vector',md.diagnostic.referential,'type','node'); 697 698 %in 3d, pressureload: [node1 node2 node3 node4 element] 699 pressureload_layer1=[md.diagnostic.icefront(:,1:2) md.diagnostic.icefront(:,2)+md.mesh.numberofvertices2d md.diagnostic.icefront(:,1)+md.mesh.numberofvertices2d md.diagnostic.icefront(:,3:4)]; %Add two columns on the first layer 700 pressureload=[]; 701 for i=1:numlayers-1, 702 pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.mesh.numberofvertices2d pressureload_layer1(:,5)+(i-1)*md.mesh.numberofelements2d pressureload_layer1(:,6)]; 703 end 704 md.diagnostic.icefront=pressureload; 705 706 %connectivity 707 md.mesh.elementconnectivity=repmat(md.mesh.elementconnectivity,numlayers-1,1); 708 md.mesh.elementconnectivity(find(md.mesh.elementconnectivity==0))=NaN; 709 for i=2:numlayers-1, 710 md.mesh.elementconnectivity((i-1)*md.mesh.numberofelements2d+1:(i)*md.mesh.numberofelements2d,:)... 711 =md.mesh.elementconnectivity((i-1)*md.mesh.numberofelements2d+1:(i)*md.mesh.numberofelements2d,:)+md.mesh.numberofelements2d; 712 end 713 md.mesh.elementconnectivity(find(isnan(md.mesh.elementconnectivity)))=0; 714 715 %materials 716 md.materials.rheology_B=project3d(md,'vector',md.materials.rheology_B,'type','node'); 717 md.materials.rheology_n=project3d(md,'vector',md.materials.rheology_n,'type','element'); 718 719 %parameters 720 md.geometry.surface=project3d(md,'vector',md.geometry.surface,'type','node'); 721 md.geometry.thickness=project3d(md,'vector',md.geometry.thickness,'type','node'); 722 md.geometry.hydrostatic_ratio=project3d(md,'vector',md.geometry.hydrostatic_ratio,'type','node'); 723 md.geometry.bed=project3d(md,'vector',md.geometry.bed,'type','node'); 724 md.geometry.bathymetry=project3d(md,'vector',md.geometry.bathymetry,'type','node'); 725 md.mesh.vertexonboundary=project3d(md,'vector',md.mesh.vertexonboundary,'type','node'); 726 md.mask.elementonfloatingice=project3d(md,'vector',md.mask.elementonfloatingice,'type','element'); 727 md.mask.vertexonfloatingice=project3d(md,'vector',md.mask.vertexonfloatingice,'type','node'); 728 md.mask.elementongroundedice=project3d(md,'vector',md.mask.elementongroundedice,'type','element'); 729 md.mask.vertexongroundedice=project3d(md,'vector',md.mask.vertexongroundedice,'type','node'); 730 md.mask.elementonwater=project3d(md,'vector',md.mask.elementonwater,'type','element'); 731 md.mask.vertexonwater=project3d(md,'vector',md.mask.vertexonwater,'type','node'); 732 if ~isnan(md.inversion.cost_functions_coefficients),md.inversion.cost_functions_coefficients=project3d(md,'vector',md.inversion.cost_functions_coefficients,'type','node');end; 733 if ~isnan(md.inversion.min_parameters),md.inversion.min_parameters=project3d(md,'vector',md.inversion.min_parameters,'type','node');end; 734 if ~isnan(md.inversion.max_parameters),md.inversion.max_parameters=project3d(md,'vector',md.inversion.max_parameters,'type','node');end; 735 if ~isnan(md.qmu.partition),md.qmu.partition=project3d(md,'vector',md.qmu.partition','type','node');end 736 if(md.surfaceforcings.isdelta18o),md.surfaceforcings.temperatures_lgm=project3d(md,'vector',md.surfaceforcings.temperatures_lgm,'type','node');end 737 if(md.surfaceforcings.isdelta18o),md.surfaceforcings.temperatures_presentday=project3d(md,'vector',md.surfaceforcings.temperatures_presentday,'type','node');end 738 if(md.surfaceforcings.isdelta18o),md.surfaceforcings.precipitations_presentday=project3d(md,'vector',md.surfaceforcings.precipitations_presentday,'type','node');end 739 740 %Put lithostatic pressure if there is an existing pressure 741 if ~isnan(md.initialization.pressure), 742 md.initialization.pressure=md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.z); 743 end 744 745 %special for thermal modeling: 746 md.basalforcings.melting_rate=project3d(md,'vector',md.basalforcings.melting_rate,'type','node','layer',1); 747 if ~isnan(md.basalforcings.geothermalflux) 748 md.basalforcings.geothermalflux=project3d(md,'vector',md.basalforcings.geothermalflux,'type','node','layer',1); %bedrock only gets geothermal flux 749 end 750 751 %increase connectivity if less than 25: 752 if md.mesh.average_vertex_connectivity<=25, 753 md.mesh.average_vertex_connectivity=100; 754 end 755 end % }}} 93 756 function md = structtomodel(md,structmd) % {{{ 94 757 … … 385 1048 md.settings = settings(); 386 1049 md.solver = solver(); 387 if ismumps ,388 md.solver = addoptions(md.solver,DiagnosticVertAnalysisEnum ,mumpsoptions);1050 if ismumps(), 1051 md.solver = addoptions(md.solver,DiagnosticVertAnalysisEnum(),mumpsoptions()); 389 1052 else 390 md.solver = addoptions(md.solver,DiagnosticVertAnalysisEnum ,iluasmoptions);1053 md.solver = addoptions(md.solver,DiagnosticVertAnalysisEnum(),iluasmoptions()); 391 1054 end 392 1055 md.cluster = generic(); -
issm/branches/trunk-jpl-damage/src/m/classes/model/model.py
r12946 r13101 33 33 from private import private 34 34 from EnumDefinitions import * 35 from ismumps import * 36 from mumpsoptions import * 37 from iluasmoptions import * 35 38 #}}} 36 39 … … 56 59 self.settings = settings() 57 60 self.solver = solver() 58 # need EnumToString for these to work 59 # if ismumps: 60 # md.solver.addoptions(DiagnosticVertAnalysisEnum(),mumpsoptions) 61 # else: 62 # md.solver.addoptions(DiagnosticVertAnalysisEnum(),iluasmoptions) 61 if ismumps(): 62 self.solver.addoptions(DiagnosticVertAnalysisEnum(),mumpsoptions()) 63 else: 64 self.solver.addoptions(DiagnosticVertAnalysisEnum(),iluasmoptions()) 63 65 self.cluster = generic() 64 66 … … 116 118 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("inversion","[%s,%s]" % ("1x1",obj.inversion.__class__.__name__),"parameters for inverse methods")) 117 119 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("qmu","[%s,%s]" % ("1x1",obj.qmu.__class__.__name__),"dakota properties")) 118 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("results","[%s,%s]" % ("1x1",obj.results.__class__.__name__),"model results '"))120 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("results","[%s,%s]" % ("1x1",obj.results.__class__.__name__),"model results")) 119 121 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("radaroverlay","[%s,%s]" % ("1x1",obj.radaroverlay.__class__.__name__),"radar image for plot overlay")) 120 122 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("miscellaneous","[%s,%s]" % ("1x1",obj.miscellaneous.__class__.__name__),"miscellaneous fields")) -
issm/branches/trunk-jpl-damage/src/m/classes/model/planet.m
r12878 r13101 6 6 classdef planet < model 7 7 properties (SetAccess=public) %Planet fields 8 % {{{ 9 %Planet specific fields 10 r=NaN; 11 theta=NaN; 12 phi=NaN; 8 end 9 methods 10 function md = planet(varargin) % {{{ 11 12 switch nargin 13 case 0 14 md=setdefaultparameters(md); 15 otherwise 16 error('planet constructor error message: 0 of 1 argument only in input.'); 17 end 18 end 19 %}}} 20 function md = setdefaultparameters(md) % {{{ 21 22 %initialize subclasses 23 md.mesh = planetmesh(); 24 md.mask = mask(); 25 md.constants = constants(); 26 md.geometry = geometry(); 27 md.initialization = initialization(); 28 md.surfaceforcings = surfaceforcings(); 29 md.basalforcings = basalforcings(); 30 md.friction = friction(); 31 md.rifts = rifts(); 32 md.timestepping = timestepping(); 33 md.groundingline = groundingline(); 34 md.materials = materials(); 35 md.flowequation = flowequation(); 36 md.debug = debug(); 37 md.verbose = verbose('solution',true,'qmu',true,'control',true); 38 md.settings = settings(); 39 md.solver = solver(); 40 if ismumps(), 41 md.solver = addoptions(md.solver,DiagnosticVertAnalysisEnum(),mumpsoptions()); 42 else 43 md.solver = addoptions(md.solver,DiagnosticVertAnalysisEnum(),iluasmoptions()); 44 end 45 md.cluster = generic(); 46 md.balancethickness = balancethickness(); 47 md.diagnostic = diagnostic(); 48 md.hydrology = hydrology(); 49 md.prognostic = prognostic(); 50 md.thermal = thermal(); 51 md.steadystate = steadystate(); 52 md.transient = transient(); 53 md.autodiff = autodiff(); 54 md.flaim = flaim(); 55 md.inversion = inversion(); 56 md.qmu = qmu(); 57 md.radaroverlay = radaroverlay(); 58 md.results = struct(); 59 md.miscellaneous = miscellaneous(); 60 md.private = private(); 61 end 13 62 %}}} 14 63 end 15 methods16 function md=planetmesh(md,varargin) % {{{17 %PLANETMESH: build 2d shell mesh18 %19 % Usage: md=planetmesh(md,'method','mixed','radius',6378000,'angleresol',1);20 % md=planetmesh(md,'method','tria','shape','iso','radius',6378000,'refinement',5);21 %22 23 %recover options24 options=pairoptions(varargin{:});25 26 method=getfieldvalue(options,'method','mixed');27 28 if strcmpi(method,'mixed'),29 %recover radius and angleresol:30 radius=getfieldvalue(options,'radius',6378000); %earth radius as default31 angleresol=getfieldvalue(options,'angleresol',10); %10 degree resolution32 33 %call mixed mesh34 md=planetmixedmesh(md,radius,angleresol);35 else36 %recover radius, shape and level of refinmenet37 radius=getfieldvalue(options,'radius',6378000); %earth radius as default38 refinement=getfieldvalue(options,'refinement',5); %refine 5 times39 shape=getfieldvalue(options,'shape','ico');40 41 %call triangular mesh42 md=planettrimesh(md,shape,radius,refinement);43 end44 45 end46 % }}}47 end48 64 end -
issm/branches/trunk-jpl-damage/src/m/classes/modellist.m
r12168 r13101 10 10 end 11 11 methods 12 function md_list=modelsextract(md,flags,minel,varargin) % {{{ 13 %modelsextract - extract several self contained models according to a list of element flags. 14 % 15 % The difference between this routine and the modelextract.m routine (without an 's') is that 16 % as many models are extracted as there are closed contours defined in area. 17 % This routine is needed for example when doing data assimilation of ice shelves in Antarctica. 18 % Many independent ice shelves are present, and we don't want data assimilation on one ice shelf 19 % to be hindered by another totally independent ice shelf. 20 % 21 % Usage: 22 % md_list=modelsextract(md,elementfalgs,minel); 23 % 24 % Examples: 25 % md_list=modelsextract(md,md.mask.elementonfloatingice,1000); 26 % 27 % See also: EXTRUDE, COLLAPSE, MODELEXTRACT 28 29 disp('selecting pools of elements'); 30 %go through flags and build as many independent element flags as there are groups of connected 1s 31 %in flags. 32 33 %2D or 3D? 34 if md.mesh.dimension==3, 35 numberofelements=md.mesh.numberofelements2d; %this will be forgotten when we get out. 36 flags=project2d(md,flags,1); 37 else 38 numberofelements=md.mesh.numberofelements; 39 end 40 41 %recover extra arguments: 42 distance=0; 43 if nargin==4, 44 distance=varargin{1}; 45 end 46 47 flag_list=cell(0,1); 48 49 for i=1:size(flags,1), 50 51 if (flags(i)), 52 53 %ok, we are sure element i is part of a new pool. 54 pool=zeros(numberofelements,1); 55 pool=PropagateFlagsFromConnectivity(md.mesh.elementconnectivity,pool,i,flags); 56 flag_list{end+1,1}=pool; 57 58 %speed up rest of computation by taking pool out of flags: 59 pos=find(pool);flags(pos)=0; 60 61 end 62 end 63 64 %go through flag_list and discard any pool of less than minel elements: 65 ex_pos=[]; 66 for i=1:length(flag_list), 67 if length(find(flag_list{i}))<minel, 68 ex_pos=[ex_pos; i]; 69 end 70 end 71 flag_list(ex_pos)=[]; 72 73 %now, if distance was specified, expand the flag_list by distance km: 74 if distance, 75 for i=1:length(flag_list), 76 flag_list{i}=PropagateFlagsUntilDistance(md,flag_list{i},distance); 77 end 78 end 79 80 %now, go use the pools of flags to extract models: 81 disp(['extracting ' num2str(size(flag_list,1)) ' models']); 82 models=cell(0,1); 83 84 for i=1:size(flag_list,1), 85 disp([' ' num2str(i) '/' num2str(size(flag_list,1))]); 86 if md.mesh.dimension==3, 87 flags2d=flag_list{i}; 88 realflags=project3d(md,flags2d,'element'); 89 else 90 realflags=flag_list{i}; 91 end 92 models{end+1,1}=modelextract(md,realflags); 93 end 94 95 %return model list 96 md_list=modellist(models); 97 98 end %end of this function }}} 99 function md_list=modelsextractfromdomains(md,directory) % {{{ 100 %modelsextractfromdomains- extract several self contained models according to a list of domains 101 % 102 % Usage: 103 % md_list=modelsextractfromdomains(md,'Basins/'); 104 % 105 % Examples: 106 % md_list=modelsextract(md,'Basins/'); 107 % 108 % See also: MODELSEXTRACTS, MODELEXTRACT 109 110 %go into directory and get list of files. 111 cd(directory); 112 basins=listfiles; 113 cd .. 114 115 models=cell(0,1); 116 for i=1:length(basins), 117 models{end+1,1}=modelextract(md,[directory '/' basins{i}]); 118 end 119 120 %return model list: 121 md_list=modellist(models); 122 123 end % }}} 12 124 function obj = modellist(varargin) % {{{ 13 125 … … 180 292 end 181 293 end 294 295 function BuildMultipleQueueingScript(cluster,name,executionpath,codepath)% {{{ 296 %BUILDMULTIPLEQUEUEINGSCRIPT - 297 % 298 % Usage: 299 % BuildMultipleQueueingScript(executionpath,codepath) 300 301 disp('building queueing script'); 302 303 %First try and figure out if there is a special script for this particular cluster 304 function_name=['BuildMultipleQueueingScript' cluster]; 305 306 %some specific treatment of identical cluster, gemini, castor and pollux 307 if strcmpi(cluster,'castor') || strcmpi(cluster,'pollux'), 308 function_name='BuildMultipleQueueingScriptgemini'; 309 end 310 311 if exist(function_name,'file'), 312 %Call this function: 313 eval([function_name '(name,executionpath,codepath);']); 314 else 315 %Call the generic BuildQueueingScript: 316 BuildMultipleQueueingScriptGeneric(name,executionpath,codepath); 317 end 318 end % }}} 319 function BuildQueueingScriptgemini(name,executionpath,codepath)% {{{ 320 %BUILDQUEUEINGSCRIPTGEMINI - ... 321 % 322 % Usage: 323 % BuildQueueingScriptgemini(md,executionpath,codepath) 324 325 scriptname=[name '.queue']; 326 327 fid=fopen(scriptname,'w'); 328 if fid==-1, 329 error(['BuildQueueingScriptgeminierror message: could not open ' scriptname ' file for ascii writing']); 330 end 331 332 fprintf(fid,'#!/bin/sh\n'); 333 fprintf(fid,'cd %s\n',executionpath); 334 fprintf(fid,'mkdir %s\n',name); 335 fprintf(fid,'cd %s\n',name); 336 fprintf(fid,'mv ../ModelList.tar.gz ./\n'); 337 fprintf(fid,'tar -zxvf ModelList.tar.gz\n'); 338 fprintf(fid,'foreach i (%s-*vs*.queue)\n',name); 339 fprintf(fid,'qsub $i\n'); 340 fprintf(fid,'end\n'); 341 fclose(fid); 342 end% }}} 343 function LaunchMultipleQueueJob(cluster,name,executionpath)% {{{ 344 %LAUNCHMULTIPLEQUEUEJOB - ... 345 % 346 % Usage: 347 % LaunchMultipleQueueJob(executionpath) 348 349 %First try and figure out if there is a special script for thie particular cluster 350 function_name=['LaunchMultipleQueueJob' cluster]; 351 352 %some specific treatment of identical cluster, gemini, castor and pollux 353 if strcmpi(cluster,'castor') || strcmpi(cluster,'pollux'), 354 function_name='LaunchMultipleQueueJobgemini'; 355 end 356 357 if exist(function_name,'file'), 358 %Call this function: 359 eval([function_name '(cluster,name,executionpath);']); 360 else 361 %Call the generic LaunchMultipleQueueJob: 362 LaunchMultipleQueueJobGeneric(cluster,name,executionpath); 363 end 364 end% }}} 365 function md=LaunchMultipleQueueJobgemini(cluster,name,executionpath)% {{{ 366 %LAUNCHMULTIPLEQUEUEJOBGEMINI - Launch multiple queueing script on Gemini cluster 367 % 368 % Usage: 369 % LaunchMultipleQueueJobgemini(cluster,name,executionpath) 370 371 372 %first, check we have the binary file and the queueing script 373 if ~exist([ name '.queue'],'file'), 374 error('LaunchMultipleQueueJobgemini error message: queueing script issing, cannot go forward'); 375 end 376 377 if ~exist('ModelList.tar.gz','file'), 378 error('LaunchMultipleQueueJobgemini error message: inputs models file missing, cannot go forward'); 379 end 380 381 %upload both files to cluster 382 disp('uploading input file, queueing script and variables script'); 383 eval(['!scp ModelList.tar.gz ' name '.queue ' cluster ':' executionpath]); 384 385 disp('launching solution sequence on remote cluster'); 386 issmssh(cluster,login,['"cd ' executionpath ' && source ' name '.queue "']); 387 end% }}} -
issm/branches/trunk-jpl-damage/src/m/classes/pairoptions.py
r12946 r13101 36 36 #go through arg and build list of objects 37 37 for i in xrange(numoptions): 38 if isinstance(arg[2*i], str):38 if isinstance(arg[2*i],(str,unicode)): 39 39 self.list[arg[2*i]] = arg[2*i+1]; 40 40 else: … … 45 45 def addfield(self,field,value): # {{{ 46 46 """ADDFIELD - add a field to an options list""" 47 if isinstance(field, str):47 if isinstance(field,(str,unicode)): 48 48 if field in self.list: 49 49 print "WARNING: field '%s' with value=%s exists and will be overwritten with value=%s." % (field,str(self.list[field]),str(value)) … … 53 53 def addfielddefault(self,field,value): # {{{ 54 54 """ADDFIELDDEFAULT - add a field to an options list if it does not exist""" 55 if isinstance(field, str):56 if not fieldin self.list:55 if isinstance(field,(str,unicode)): 56 if field not in self.list: 57 57 self.list[field] = value 58 58 # }}} … … 100 100 s+=" list: (%ix%i)\n\n" % (len(self.list),2) 101 101 for item in self.list.iteritems(): 102 if isinstance(item[1], str):102 if isinstance(item[1],(str,unicode)): 103 103 s+=" field: %-10s value: '%s'\n" % (item[0],item[1]) 104 104 elif isinstance(item[1],(bool,int,long,float)): … … 117 117 if field == None or field == '': 118 118 raise ValueError('exist error message: bad usage'); 119 if not isinstance(field, str):119 if not isinstance(field,(str,unicode)): 120 120 raise TypeError("exist error message: field '%s' should be a string." % str(field)); 121 121 … … 157 157 if field == None or field == '': 158 158 raise ValueError('getfieldvalue error message: bad usage'); 159 if not isinstance(field, str):159 if not isinstance(field,(str,unicode)): 160 160 raise TypeError("getfieldvalue error message: field '%s' should be a string." % str(field)); 161 161 … … 204 204 205 205 #Write option value 206 if isinstance(value, str):206 if isinstance(value,(str,unicode)): 207 207 WriteData(fid,'enum',(firstindex-1)+2*i+2,'data',value,'format','String') 208 208 elif isinstance(value,(bool,int,long,float)): -
issm/branches/trunk-jpl-damage/src/m/classes/planetmesh.m
r12946 r13101 6 6 classdef planetmesh 7 7 properties (SetAccess=public) 8 x = NaN; 9 y = NaN; 10 z = NaN; 8 11 r = NaN; 9 12 theta = NaN; … … 42 45 function md = checkconsistency(obj,md,solution,analyses) % {{{ 43 46 47 md = checkfield(md,'planetmesh.x','NaN',1,'size',[md.planetmesh.numberofvertices 1]); 48 md = checkfield(md,'planetmesh.y','NaN',1,'size',[md.planetmesh.numberofvertices 1]); 49 md = checkfield(md,'planetmesh.z','NaN',1,'size',[md.planetmesh.numberofvertices 1]); 44 50 md = checkfield(md,'planetmesh.r','NaN',1,'size',[md.planetmesh.numberofvertices 1]); 45 51 md = checkfield(md,'planetmesh.theta','NaN',1,'size',[md.planetmesh.numberofvertices 1]); … … 68 74 %Solution specific checks 69 75 switch(solution), 70 case PrognosticSolutionEnum ,76 case PrognosticSolutionEnum(), 71 77 if md.prognostic.stabilization==3, 72 78 md = checkfield(md,'planetmesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d planetmeshes'); 73 79 end 74 case TransientSolutionEnum ,80 case TransientSolutionEnum(), 75 81 if md.transient.isprognostic & md.prognostic.stabilization==3, 76 82 md = checkfield(md,'planetmesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d planetmeshes'); 77 83 end 78 case ThermalSolutionEnum ,84 case ThermalSolutionEnum(), 79 85 md = checkfield(md,'planetmesh.dimension','values',3,'message','thermal solution only supported on 3d planetmeshes'); 80 86 end … … 87 93 fielddisplay(obj,'numberofvertices','number of vertices'); 88 94 fielddisplay(obj,'elements','index into (x,y,z), coordinates of the vertices'); 95 fielddisplay(obj,'x','vertices x coordinate'); 96 fielddisplay(obj,'y','vertices y coordinate'); 97 fielddisplay(obj,'z','vertices z coordinate'); 89 98 fielddisplay(obj,'r','vertices r coordinate'); 90 99 fielddisplay(obj,'theta','vertices theta coordinate'); … … 101 110 end % }}} 102 111 function marshall(obj,fid) % {{{ 112 WriteData(fid,'object',obj,'fieldname','x','format','DoubleMat','mattype',1); 113 WriteData(fid,'object',obj,'fieldname','y','format','DoubleMat','mattype',1); 114 WriteData(fid,'object',obj,'fieldname','z','format','DoubleMat','mattype',1); 103 115 WriteData(fid,'object',obj,'fieldname','r','format','DoubleMat','mattype',1); 104 116 WriteData(fid,'object',obj,'fieldname','theta','format','DoubleMat','mattype',1); -
issm/branches/trunk-jpl-damage/src/m/classes/private.py
r12946 r13101 1 1 #module imports 2 2 from fielddisplay import fielddisplay 3 from EnumDefinitions import * 4 from checkfield import * 3 5 4 class private: 6 class private(object): 7 """ 8 PRIVATE class definition 9 10 Usage: 11 private=private(); 12 """ 13 5 14 #properties 6 15 def __init__(self): 7 16 # {{{ Properties 8 self.isconsistent = True ;17 self.isconsistent = True 9 18 self.runtimename = '' 10 19 self.bamg = {} 11 self.solution = '' ;20 self.solution = '' 12 21 13 22 #set defaults … … 15 24 16 25 #}}} 17 def __repr__( obj):26 def __repr__(self): 18 27 # {{{ Display 19 28 string=' private parameters: do not change' 20 29 21 string="%s\n%s"%(string,fielddisplay( obj,'isconsistent','is model self consistent'))22 string="%s\n%s"%(string,fielddisplay( obj,'runtimename','name of the run launched'))23 string="%s\n%s"%(string,fielddisplay( obj,'bamg','structure with mesh properties constructed if bamg is used to mesh the domain'))24 string="%s\n%s"%(string,fielddisplay( obj,'solution','type of solution launched'))30 string="%s\n%s"%(string,fielddisplay(self,'isconsistent','is model self consistent')) 31 string="%s\n%s"%(string,fielddisplay(self,'runtimename','name of the run launched')) 32 string="%s\n%s"%(string,fielddisplay(self,'bamg','structure with mesh properties constructed if bamg is used to mesh the domain')) 33 string="%s\n%s"%(string,fielddisplay(self,'solution','type of solution launched')) 25 34 return string 26 35 #}}} 27 36 28 def setdefaultparameters( obj):37 def setdefaultparameters(self): 29 38 # {{{setdefaultparameters 30 return obj39 return self 31 40 #}}} 32 41 42 def checkconsistency(self,md,solution,analyses): # {{{ 43 return md 44 # }}} 45 -
issm/branches/trunk-jpl-damage/src/m/classes/prognostic.m
r12878 r13101 38 38 function md = checkconsistency(obj,md,solution,analyses) % {{{ 39 39 40 %Early return ,41 if ~ismember(PrognosticAnalysisEnum ,analyses) | (solution==TransientSolutionEnum& md.transient.isprognostic==0), return; end40 %Early return 41 if ~ismember(PrognosticAnalysisEnum(),analyses) | (solution==TransientSolutionEnum() & md.transient.isprognostic==0), return; end 42 42 43 43 md = checkfield(md,'prognostic.spcthickness','forcing',1); … … 62 62 WriteData(fid,'object',obj,'fieldname','spcthickness','format','DoubleMat','mattype',1); 63 63 WriteData(fid,'object',obj,'fieldname','min_thickness','format','Double'); 64 WriteData(fid,'data',StringToEnum(obj.hydrostatic_adjustment),'format','Integer','enum',PrognosticHydrostaticAdjustmentEnum );64 WriteData(fid,'data',StringToEnum(obj.hydrostatic_adjustment),'format','Integer','enum',PrognosticHydrostaticAdjustmentEnum()); 65 65 WriteData(fid,'object',obj,'fieldname','stabilization','format','Integer'); 66 66 WriteData(fid,'object',obj,'fieldname','vertex_pairing','format','DoubleMat','mattype',3); -
issm/branches/trunk-jpl-damage/src/m/classes/prognostic.py
r12168 r13101 1 1 #module imports 2 2 from fielddisplay import fielddisplay 3 from EnumDefinitions import * 4 from StringToEnum import StringToEnum 5 from checkfield import * 6 from WriteData import * 3 7 4 class prognostic: 8 class prognostic(object): 9 """ 10 PROGNOSTIC class definition 11 12 Usage: 13 prognostic=prognostic(); 14 """ 15 5 16 #properties 6 17 def __init__(self): … … 17 28 18 29 #}}} 19 def __repr__( obj):30 def __repr__(self): 20 31 # {{{ Display 21 32 string=' Prognostic solution parameters:' 22 string="%s\n\n%s"%(string,fielddisplay( obj,'spcthickness','thickness constraints (NaN means no constraint)'))23 string="%s\n%s"%(string,fielddisplay( obj,'min_thickness','minimum ice thickness allowed'))24 string="%s\n%s"%(string,fielddisplay( obj,'hydrostatic_adjustment','adjustment of ice shelves surface and bed elevations: ''Incremental'' or ''Absolute'' '))25 string="%s\n%s"%(string,fielddisplay( obj,'stabilization','0->no, 1->artificial_diffusivity, 2->streamline upwinding, 3->discontinuous Galerkin'))33 string="%s\n\n%s"%(string,fielddisplay(self,'spcthickness','thickness constraints (NaN means no constraint)')) 34 string="%s\n%s"%(string,fielddisplay(self,'min_thickness','minimum ice thickness allowed')) 35 string="%s\n%s"%(string,fielddisplay(self,'hydrostatic_adjustment','adjustment of ice shelves surface and bed elevations: ''Incremental'' or ''Absolute'' ')) 36 string="%s\n%s"%(string,fielddisplay(self,'stabilization','0->no, 1->artificial_diffusivity, 2->streamline upwinding, 3->discontinuous Galerkin')) 26 37 27 38 return string 28 39 #}}} 29 40 30 def setdefaultparameters( obj):41 def setdefaultparameters(self): 31 42 # {{{setdefaultparameters 32 43 33 44 #Type of stabilization to use 0:nothing 1:artificial_diffusivity 3:Discontinuous Galerkin 34 obj.stabilization=145 self.stabilization=1 35 46 36 47 #Factor applied to compute the penalties kappa=max(stiffness matrix)*10^penalty_factor 37 obj.penalty_factor=348 self.penalty_factor=3 38 49 39 50 #Minimum ice thickness that can be used 40 obj.min_thickness=151 self.min_thickness=1 41 52 42 53 #Hydrostatic adjustment 43 obj.hydrostatic_adjustment='Absolute'54 self.hydrostatic_adjustment='Absolute' 44 55 45 return obj56 return self 46 57 #}}} 47 58 59 def checkconsistency(self,md,solution,analyses): # {{{ 60 61 #Early return 62 if (PrognosticAnalysisEnum() not in analyses) or (solution==TransientSolutionEnum() and not md.transient.isprognostic): 63 return md 64 65 md = checkfield(md,'prognostic.spcthickness','forcing',1) 66 md = checkfield(md,'prognostic.hydrostatic_adjustment','values',['Absolute','Incremental']) 67 md = checkfield(md,'prognostic.stabilization','values',[0,1,2,3]) 68 md = checkfield(md,'prognostic.min_thickness','>',0) 69 70 return md 71 # }}} 72 73 def marshall(self,fid): # {{{ 74 WriteData(fid,'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1) 75 WriteData(fid,'object',self,'fieldname','min_thickness','format','Double') 76 WriteData(fid,'data',StringToEnum(self.hydrostatic_adjustment)[0],'format','Integer','enum',PrognosticHydrostaticAdjustmentEnum()) 77 WriteData(fid,'object',self,'fieldname','stabilization','format','Integer') 78 WriteData(fid,'object',self,'fieldname','vertex_pairing','format','DoubleMat','mattype',3) 79 WriteData(fid,'object',self,'fieldname','penalty_factor','format','Double') 80 # }}} 81 -
issm/branches/trunk-jpl-damage/src/m/classes/qmu.m
r12878 r13101 47 47 md = checkmessage(md,['user supplied partition for qmu analysis should have size md.mesh.numberofvertices x 1 ']); 48 48 end 49 if find(md.qmu.partition)>=md.mesh.numberofvertices,50 md = checkmessage(md,['user supplied partition should be indexed from 0 (c-convention)']);51 end52 49 if min(md.qmu.partition)~=0, 53 50 md = checkmessage(md,['partition vector not indexed from 0 on']); 54 end55 if max(md.qmu.partition)>=md.mesh.numberofvertices,56 md = checkmessage(md,['partition vector cannot have maximum index larger than number of nodes']);57 end58 if ~isempty(find(md.qmu.partition<0)),59 md = checkmessage(md,['partition vector cannot have values less than 0']);60 end61 if ~isempty(find(md.qmu.partition>=md.qmu.numberofpartitions)),62 md = checkmessage(md,['partition vector cannot have values more than md.qmu.numberofpartitions-1']);63 51 end 64 52 if max(md.qmu.partition)>=md.qmu.numberofpartitions, … … 140 128 end 141 129 end 142 fielddisplay(obj,'partition','user provided mesh partitioni tion, defaults to metis if not specified')143 fielddisplay(obj,'numberofpartitions','number of partitions for semi-d escrete qmu')130 fielddisplay(obj,'partition','user provided mesh partitioning, defaults to metis if not specified') 131 fielddisplay(obj,'numberofpartitions','number of partitions for semi-discrete qmu') 144 132 fielddisplay(obj,'variabledescriptors',''); 145 133 fielddisplay(obj,'responsedescriptors',''); -
issm/branches/trunk-jpl-damage/src/m/classes/qmu.py
r12168 r13101 1 1 #module imports 2 import numpy 2 3 from fielddisplay import fielddisplay 4 from EnumDefinitions import * 5 from checkfield import * 6 from WriteData import * 7 from MatlabFuncs import * 3 8 4 class qmu: 9 class qmu(object): 10 """ 11 QMU class definition 12 13 Usage: 14 qmu=qmu(); 15 """ 16 5 17 #properties 6 18 def __init__(self): … … 27 39 28 40 #}}} 29 def __repr__(obj): 30 # {{{ Display 31 string=" qmu parameters: not implemented yet!" 32 return string 33 #}}} 34 35 def setdefaultparameters(obj): 41 42 def setdefaultparameters(self): 36 43 # {{{setdefaultparameters 37 return obj44 return self 38 45 #}}} 39 46 47 def checkconsistency(self,md,solution,analyses): # {{{ 48 49 #Early return 50 if not md.qmu.isdakota: 51 return 52 53 if not md.qmu.params.evaluation_concurrency==1: 54 md.checkmessage("concurrency should be set to 1 when running dakota in library mode") 55 if md.qmu.partition: 56 if not numpy.size(md.qmu.partition)==md.mesh.numberofvertices: 57 md.checkmessage("user supplied partition for qmu analysis should have size md.mesh.numberofvertices x 1") 58 if not min(md.qmu.partition)==0: 59 md.checkmessage("partition vector not indexed from 0 on") 60 if max(md.qmu.partition)>=md.qmu.numberofpartitions: 61 md.checkmessage("for qmu analysis, partitioning vector cannot go over npart, number of partition areas") 62 63 if not strcmpi(md.cluster.name,'none'): 64 if not md.settings.waitonlock: 65 md.checkmessage("waitonlock should be activated when running qmu in parallel mode!") 66 67 return md 68 # }}} 69 70 def __repr__(self): # {{{ 71 s =' qmu parameters:\n' 72 73 s+="%s\n" % fielddisplay(self,'isdakota','is qmu analysis activated?') 74 for i,variable in enumerate(self.variables): 75 s+=" variables%s: (arrays of each variable class)\n" % \ 76 string_dim(self.variables,i) 77 fnames=vars(variable) 78 maxlen=0 79 for fname in fnames: 80 maxlen=max(maxlen,len(fname)) 81 82 for fname in fnames: 83 s+="' %-*s: [%ix%i] '%s'\n" % \ 84 (maxlen+1,fname,size(getattr(variable,fname)),type(getattr(variable,fname))) 85 86 for i,response in enumerate(self.responses): 87 s+=" responses%s: (arrays of each response class)\n" % \ 88 string_dim(self.responses,i) 89 fnames=vars(response) 90 maxlen=0 91 for fname in fnames: 92 maxlen=max(maxlen,len(fname)) 93 94 for fname in fnames: 95 s+=" %-*s: [%ix%i] '%s'\n" % \ 96 (maxlen+1,fname,size(getattr(response,fname)),type(getattr(response,fname))) 97 98 s+="%s\n" % fielddisplay(self,'numberofresponses','number of responses') 99 100 for i,method in enumerate(self.method): 101 if isinstance(method,'dakota_method'): 102 s+=" method%s : '%s'\n" % \ 103 (string_dim(method,i),method.method) 104 105 for i,param in enumerate(self.params): 106 s+=" params%s: (array of method-independent parameters)\n" % \ 107 string_dim(self.params,i) 108 fnames=vars(param) 109 maxlen=0 110 for fname in fnames: 111 maxlen=max(maxlen,len(fname)) 112 113 for fname in fnames: 114 s+=" %-*s: %s\n" % \ 115 (maxlen+1,fname,any2str(getattr(param,fname))) 116 117 for i,result in enumerate(self.results): 118 s+=" results%s: (information from dakota files)\n" % \ 119 string_dim(self.results,i) 120 fnames=vars(result) 121 maxlen=0 122 for fname in fnames: 123 maxlen=max(maxlen,len(fname)) 124 125 for fname in fnames: 126 s+=" %-*s: [%ix%i] '%s'\n" % \ 127 (maxlen+1,fname,size(getattr(result,fname)),type(getattr(result,fname))) 128 129 s+="%s\n" % fielddisplay(self,'partition','user provided mesh partitioning, defaults to metis if not specified') 130 s+="%s\n" % fielddisplay(self,'numberofpartitions','number of partitions for semi-discrete qmu') 131 s+="%s\n" % fielddisplay(self,'variabledescriptors','') 132 s+="%s\n" % fielddisplay(self,'responsedescriptors','') 133 s+="%s\n" % fielddisplay(self,'method','array of dakota_method class') 134 s+="%s\n" % fielddisplay(self,'mass_flux_profile_directory','directory for mass flux profiles') 135 s+="%s\n" % fielddisplay(self,'mass_flux_profiles','list of mass_flux profiles') 136 s+="%s\n" % fielddisplay(self,'mass_flux_segments','') 137 s+="%s\n" % fielddisplay(self,'adjacency','') 138 s+="%s\n" % fielddisplay(self,'vertex_weight','weight applied to each mesh vertex') 139 140 return s 141 # }}} 142 143 def marshall(self,fid): # {{{ 144 WriteData(fid,'object',self,'fieldname','isdakota','format','Boolean') 145 if not self.isdakota: 146 return 147 WriteData(fid,'object',self,'fieldname','partition','format','DoubleMat','mattype',2) 148 WriteData(fid,'object',self,'fieldname','numberofpartitions','format','Integer') 149 WriteData(fid,'object',self,'fieldname','numberofresponses','format','Integer') 150 WriteData(fid,'object',self,'fieldname','variabledescriptors','format','StringArray') 151 WriteData(fid,'object',self,'fieldname','responsedescriptors','format','StringArray') 152 WriteData(fid,'object',self,'fieldname','mass_flux_segments','format','MatArray') 153 # }}} 154 -
issm/branches/trunk-jpl-damage/src/m/classes/radaroverlay.py
r12168 r13101 2 2 from fielddisplay import fielddisplay 3 3 4 class radaroverlay: 4 class radaroverlay(object): 5 """ 6 RADAROVERLAY class definition 7 8 Usage: 9 radaroverlay=radaroverlay(); 10 """ 11 5 12 #properties 6 13 def __init__(self): … … 14 21 15 22 #}}} 16 def __repr__( obj):23 def __repr__(self): 17 24 # {{{ Display 18 25 string=' radaroverlay parameters:' 19 string="%s\n\n%s"%(string,fielddisplay( obj,'pwr','radar power image (matrix)'))20 string="%s\n%s"%(string,fielddisplay( obj,'x','corresponding x coordinates'))21 string="%s\n%s"%(string,fielddisplay( obj,'y','corresponding y coordinates'))26 string="%s\n\n%s"%(string,fielddisplay(self,'pwr','radar power image (matrix)')) 27 string="%s\n%s"%(string,fielddisplay(self,'x','corresponding x coordinates')) 28 string="%s\n%s"%(string,fielddisplay(self,'y','corresponding y coordinates')) 22 29 return string 23 30 #}}} 24 31 25 def setdefaultparameters( obj):32 def setdefaultparameters(self): 26 33 # {{{setdefaultparameters 27 return obj34 return self 28 35 #}}} 29 36 -
issm/branches/trunk-jpl-damage/src/m/classes/rifts.m
r12878 r13101 79 79 end 80 80 81 WriteData(fid,'data',numrifts,'enum',RiftsNumriftsEnum ,'format','Integer');82 WriteData(fid,'data',data,'enum',RiftsRiftstructEnum ,'format','DoubleMat','mattype',3);81 WriteData(fid,'data',numrifts,'enum',RiftsNumriftsEnum(),'format','Integer'); 82 WriteData(fid,'data',data,'enum',RiftsRiftstructEnum(),'format','DoubleMat','mattype',3); 83 83 end % }}} 84 84 end -
issm/branches/trunk-jpl-damage/src/m/classes/rifts.py
r12168 r13101 1 1 #module imports 2 import numpy 2 3 from fielddisplay import fielddisplay 4 from EnumDefinitions import * 5 from checkfield import * 6 from WriteData import * 7 from isnans import * 3 8 4 class rifts: 9 class rifts(object): 10 """ 11 RIFTS class definition 12 13 Usage: 14 rifts=rifts(); 15 """ 16 5 17 #properties 6 18 def __init__(self): … … 13 25 14 26 #}}} 15 def __repr__( obj):27 def __repr__(self): 16 28 # {{{ Display 17 29 string=' rifts parameters:' 18 30 19 string="%s\n\n%s"%(string,fielddisplay( obj,'riftstruct','structure containing all rift information (vertices coordinates, segments, type of melange, ...)'))20 string="%s\n%s"%(string,fielddisplay( obj,'riftproperties',''))31 string="%s\n\n%s"%(string,fielddisplay(self,'riftstruct','structure containing all rift information (vertices coordinates, segments, type of melange, ...)')) 32 string="%s\n%s"%(string,fielddisplay(self,'riftproperties','')) 21 33 return string 22 34 #}}} 23 35 24 def setdefaultparameters( obj):36 def setdefaultparameters(self): 25 37 # {{{setdefaultparameters 26 return obj38 return self 27 39 #}}} 28 40 41 def checkconsistency(self,md,solution,analyses): # {{{ 42 if (not self.riftstruct) or numpy.any(isnans(self.riftstruct)): 43 numrifts=0 44 else: 45 numrifts=len(self.riftstruct) 46 47 if numrifts: 48 if not md.mesh.dimension==2: 49 md.checkmessage("models with rifts are only supported in 2d for now!") 50 if not isinstance(self.riftstruct,list): 51 md.checkmessage("rifts.riftstruct should be a structure!") 52 if numpy.any(md.mesh.segmentmarkers>=2): 53 #We have segments with rift markers, but no rift structure! 54 md.checkmessage("model should be processed for rifts (run meshprocessrifts)!") 55 md = checkfield(md,'rifts.riftstruct.fill','values',[WaterEnum(),AirEnum(),IceEnum(),MelangeEnum()]) 56 else: 57 if numpy.any(numpy.logical_not(isnans(self.riftstruct))): 58 md.checkmessage("riftstruct shoud be NaN since numrifts is 0!") 59 60 return md 61 # }}} 62 63 def marshall(self,fid): # {{{ 64 65 #Process rift info 66 if (not self.riftstruct) or numpy.any(isnans(self.riftstruct)): 67 numrifts=0 68 else: 69 numrifts=len(self.riftstruct) 70 71 numpairs=0 72 for i in xrange(0,numrifts): 73 numpairs+=numpy.size(self.riftstruct[i].penaltypairs,0) 74 75 # 2 for nodes + 2 for elements+ 2 for normals + 1 for length + 1 for fill + 1 for friction + 1 for fraction + 1 for fractionincrement + 1 for state. 76 data=numpy.zeros((numpairs,12)) 77 count=0 78 for i in xrange(0,numrifts): 79 numpairsforthisrift=numpy.size(self.riftstruct[i]['penaltypairs'],0) 80 data[count:count+numpairsforthisrift-1,0:6]=self.riftstruct[i]['penaltypairs'] 81 data[count:count+numpairsforthisrift-1,7]=self.riftstruct[i]['fill'] 82 data[count:count+numpairsforthisrift-1,8]=self.riftstruct[i]['friction'] 83 data[count:count+numpairsforthisrift-1,9]=self.riftstruct[i]['fraction'] 84 data[count:count+numpairsforthisrift-1,10]=self.riftstruct[i]['fractionincrement'] 85 data[count:count+numpairsforthisrift-1,11]=self.riftstruct[i]['state'] 86 count+=numpairsforthisrift 87 88 WriteData(fid,'data',numrifts,'enum',RiftsNumriftsEnum(),'format','Integer') 89 WriteData(fid,'data',data,'enum',RiftsRiftstructEnum(),'format','DoubleMat','mattype',3) 90 # }}} 91 -
issm/branches/trunk-jpl-damage/src/m/classes/settings.m
r12878 r13101 43 43 function md = checkconsistency(obj,md,solution,analyses) % {{{ 44 44 45 md = checkfield(md,'settings.io_gather','numel', 1,'values',[0 1]);46 md = checkfield(md,'settings.lowmem','numel', 1,'values',[0 1]);47 md = checkfield(md,'settings.results_as_patches','numel', 1,'values',[0 1]);48 md = checkfield(md,'settings.output_frequency','numel', 1,'>=',1);49 md = checkfield(md,'settings.waitonlock','numel', 1);45 md = checkfield(md,'settings.io_gather','numel',[1],'values',[0 1]); 46 md = checkfield(md,'settings.lowmem','numel',[1],'values',[0 1]); 47 md = checkfield(md,'settings.results_as_patches','numel',[1],'values',[0 1]); 48 md = checkfield(md,'settings.output_frequency','numel',[1],'>=',1); 49 md = checkfield(md,'settings.waitonlock','numel',[1]); 50 50 51 51 end % }}} -
issm/branches/trunk-jpl-damage/src/m/classes/settings.py
r12168 r13101 1 1 #module imports 2 2 from fielddisplay import fielddisplay 3 from EnumDefinitions import * 4 from checkfield import * 5 from WriteData import * 3 6 4 class settings: 7 class settings(object): 8 """ 9 SETTINGS class definition 10 11 Usage: 12 settings=settings(); 13 """ 14 5 15 #properties 6 16 def __init__(self): … … 16 26 17 27 #}}} 18 def __repr__( obj):28 def __repr__(self): 19 29 # {{{ Display 20 30 string=" general settings parameters:" 21 31 22 string="%s\n%s"%(string,fielddisplay( obj,"io_gather","I/O gathering strategy for result outputs (default 1)"))23 string="%s\n%s"%(string,fielddisplay( obj,"lowmem","is the memory limited ? (0 or 1)"))24 string="%s\n%s"%(string,fielddisplay( obj,"results_as_patches","provide results as patches for each element (0 or 1)"))25 string="%s\n%s"%(string,fielddisplay( obj,"output_frequency","frequency at which results are saved in all solutions with multiple time_steps"))26 string="%s\n%s"%(string,fielddisplay( obj,"waitonlock","maximum number of minutes to wait for batch results, or return 0"))32 string="%s\n%s"%(string,fielddisplay(self,"io_gather","I/O gathering strategy for result outputs (default 1)")) 33 string="%s\n%s"%(string,fielddisplay(self,"lowmem","is the memory limited ? (0 or 1)")) 34 string="%s\n%s"%(string,fielddisplay(self,"results_as_patches","provide results as patches for each element (0 or 1)")) 35 string="%s\n%s"%(string,fielddisplay(self,"output_frequency","frequency at which results are saved in all solutions with multiple time_steps")) 36 string="%s\n%s"%(string,fielddisplay(self,"waitonlock","maximum number of minutes to wait for batch results, or return 0")) 27 37 return string 28 38 #}}} 29 39 30 def setdefaultparameters( obj):40 def setdefaultparameters(self): 31 41 # {{{setdefaultparameters 32 42 33 43 #are we short in memory ? (0 faster but requires more memory) 34 obj.lowmem=044 self.lowmem=0 35 45 36 46 #i/o: 37 obj.io_gather=147 self.io_gather=1 38 48 39 49 #results frequency by default every step 40 obj.output_frequency=150 self.output_frequency=1 41 51 42 52 #do not use patches by default (difficult to plot) 43 obj.results_as_patches=053 self.results_as_patches=0 44 54 45 55 #this option can be activated to load automatically the results … … 47 57 #N minutes that is generated once the solution has converged 48 58 #0 to desactivate 49 obj.waitonlock=float('Inf')59 self.waitonlock=float('Inf') 50 60 51 return obj61 return self 52 62 #}}} 53 63 64 def checkconsistency(self,md,solution,analyses): # {{{ 65 md = checkfield(md,'settings.io_gather','numel',[1],'values',[0,1]) 66 md = checkfield(md,'settings.lowmem','numel',[1],'values',[0,1]) 67 md = checkfield(md,'settings.results_as_patches','numel',[1],'values',[0,1]) 68 md = checkfield(md,'settings.output_frequency','numel',[1],'>=',1) 69 md = checkfield(md,'settings.waitonlock','numel',[1]) 70 71 return md 72 # }}} 73 74 def marshall(self,fid): # {{{ 75 WriteData(fid,'object',self,'fieldname','io_gather','format','Boolean') 76 WriteData(fid,'object',self,'fieldname','lowmem','format','Boolean') 77 WriteData(fid,'object',self,'fieldname','results_as_patches','format','Boolean') 78 WriteData(fid,'object',self,'fieldname','output_frequency','format','Integer') 79 WriteData(fid,'object',self,'fieldname','waitonlock','format','Boolean') 80 # }}} 81 -
issm/branches/trunk-jpl-damage/src/m/classes/solver.m
r12878 r13101 20 20 function obj = addoptions(obj,analysis,varargin) % {{{ 21 21 % Usage example: 22 % md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum ,stokesoptions());23 % md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum );22 % md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum(),stokesoptions()); 23 % md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum()); 24 24 25 25 %Convert analysis from enum to string … … 38 38 39 39 %MUMPS is the default solver 40 if ismumps ,41 obj.NoneAnalysis=mumpsoptions ;40 if ismumps(), 41 obj.NoneAnalysis=mumpsoptions(); 42 42 else 43 obj.NoneAnalysis=iluasmoptions ;43 obj.NoneAnalysis=iluasmoptions(); 44 44 end 45 45 -
issm/branches/trunk-jpl-damage/src/m/classes/solver.py
r12168 r13101 1 #module imports {{{ 2 import fielddisplay 3 import ismumps 4 from mumpsoptions import * 5 from iluasmoptions import * 6 #}}} 7 class solver: 8 #properties 9 def __init__(self): 10 # {{{ Properties 11 if ismumps: 12 self.options=[["NoneAnalysis",mumpsoptions()]] 1 from ismumps import * 2 from mumpsoptions import * 3 from iluasmoptions import * 4 from EnumToString import EnumToString 5 from MatlabFuncs import * 6 from EnumDefinitions import * 7 from checkfield import * 8 9 class solver(object): 10 """ 11 SOLVER class definition 12 13 Usage: 14 obj=solver(); 15 """ 16 17 def __init__(self): # {{{ 18 #MUMPS is the default solver 19 if ismumps(): 20 self.NoneAnalysis=mumpsoptions() 13 21 else: 14 self.options=[["NoneAnalysis",iluasmoptions()]] 15 #}}} 16 def __repr__(obj): 17 # {{{ Display 18 19 string2=" solver parameters:" 20 for i in range(len(obj.options)): 21 option=obj.options[i] 22 analysis=option[0] 23 ioptions=option[1] 22 self.NoneAnalysis=iluasmoptions() 24 23 25 string="" 26 for i in range(len(ioptions)): 27 option=ioptions[i] 28 if not option: 29 #do nothing 30 pass 31 elif len(option)==1: 24 #The other properties are dynamic 25 # }}} 26 27 def addoptions(self,analysis,*args): # {{{ 28 # Usage example: 29 # md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum(),stokesoptions()); 30 # md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum()); 31 32 #Convert analysis from enum to string 33 [analysis]=EnumToString(analysis) 34 35 #Create dynamic property if property does not exist yet 36 if not hasattr(self,analysis): 37 # exec("self.%s = None" % analysis) 38 setattr(self,analysis,None) 39 40 #Add solver options to analysis 41 if len(args)==1: 42 setattr(self,analysis,args[0]) 43 44 return self 45 # }}} 46 47 def __repr__(self): # {{{ 48 s ="List of solver options per analysis:\n\n" 49 for analysis in vars(self).iterkeys(): 50 s+="%s :\n" % analysis 51 s+="%s\n" % getattr(self,analysis) 52 53 return s 54 # }}} 55 56 def checkconsistency(self,md,solution,analyses): # {{{ 57 for analysis in vars(self).iterkeys(): 58 if not getattr(self,analysis): 59 md.checkmessage("md.solver.%s is empty" % analysis) 60 61 return md 62 # }}} 63 64 def PetscFile(self,filename): # {{{ 65 """ 66 PETSCFILE - build petsc file 67 68 Build a Petsc compatible options file, from the solver model field + return options string 69 70 Usage: PetscFile(solver,filename); 71 """ 72 73 #open file for writing 74 try: 75 fid=open(filename,'w') 76 except IOError as e: 77 raise IOError("PetscFile error: could not open '%s' for writing." % filename) 78 79 #write header 80 fid.write("%s%s%s\n" % ('%Petsc options file: ',filename,' written from Matlab solver array')) 81 82 #start writing options 83 for analysis in vars(self).iterkeys(): 84 options=getattr(self,analysis) 85 86 #first write analysis: 87 fid.write("\n+%s\n" % analysis) #append a + to recognize it's an analysis enum 88 89 #now, write options 90 for optionname,optionvalue in options.iteritems(): 91 92 if not optionvalue: 32 93 #this option has only one argument 33 string="%s%s%s"%(string," -",option[0])34 el if len(option)==2:94 fid.write("-%s\n" % optionname) 95 else: 35 96 #option with value. value can be string or scalar 36 if isinstance(option[1],float): 37 string="%s%s%s%s%s"%(string," -",option[0]," ","%g"%(option[1])) 38 elif isinstance(option[1],str): 39 string="%s%s%s%s%s"%(string," -",option[0]," ",option[1]) 40 elif isinstance(option[1],int): 41 string="%s%s%s%s%s"%(string," -",option[0]," ","%i"%(option[1])) 97 if isinstance(optionvalue,(bool,int,long,float)): 98 fid.write("-%s %g\n" % (optionname,optionvalue)) 99 elif isinstance(optionvalue,(str,unicode)): 100 fid.write("-%s %s\n" % (optionname,optionvalue)) 42 101 else: 43 raise RuntimeError("%s%s%s"%("PetscString error: option #","%i"%(i)," is not well formatted")) 44 else: 45 raise RuntimeError("%s%s%s"%("PetscString error: option #","%i"%(i)," is not well formatted")) 102 raise TypeError("PetscFile error: option '%s' is not well formatted." % optionname) 46 103 47 string2="%s\n%s"%(string2," %s -> '%s'"%(analysis,string))48 return string249 #}}} 104 fid.close() 105 # }}} 106 -
issm/branches/trunk-jpl-damage/src/m/classes/steadystate.m
r12878 r13101 29 29 30 30 %Early return 31 if solution~=SteadystateSolutionEnum , return; end;31 if solution~=SteadystateSolutionEnum(), return; end; 32 32 33 33 if md.timestepping.time_step~=0, -
issm/branches/trunk-jpl-damage/src/m/classes/steadystate.py
r12168 r13101 1 1 #module imports 2 import numpy 2 3 from fielddisplay import fielddisplay 4 from EnumDefinitions import * 5 from checkfield import * 6 from WriteData import * 3 7 4 class steadystate: 8 class steadystate(object): 9 """ 10 STEADYSTATE class definition 11 12 Usage: 13 steadystate=steadystate(); 14 """ 15 5 16 #properties 6 17 def __init__(self): … … 14 25 15 26 #}}} 16 def __repr__( obj):27 def __repr__(self): 17 28 # {{{ Display 18 29 string=' steadystate solution parameters:' 19 string="%s\n%s"%(string,fielddisplay( obj,'reltol','relative tolerance criterion'))20 string="%s\n%s"%(string,fielddisplay( obj,'maxiter','maximum number of iterations'))21 string="%s\n%s"%(string,fielddisplay( obj,'requested_outputs','additional requested outputs'))30 string="%s\n%s"%(string,fielddisplay(self,'reltol','relative tolerance criterion')) 31 string="%s\n%s"%(string,fielddisplay(self,'maxiter','maximum number of iterations')) 32 string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional requested outputs')) 22 33 return string 23 34 #}}} 24 35 25 def setdefaultparameters( obj):36 def setdefaultparameters(self): 26 37 # {{{setdefaultparameters 27 38 28 39 #maximum of steady state iterations 29 obj.maxiter=10040 self.maxiter=100 30 41 31 42 #Relative tolerance for the steadystate convertgence 32 obj.reltol=0.0143 self.reltol=0.01 33 44 34 return obj45 return self 35 46 #}}} 36 47 48 def checkconsistency(self,md,solution,analyses): # {{{ 49 50 #Early return 51 if not solution==SteadystateSolutionEnum(): 52 return md 53 54 if not md.timestepping.time_step==0: 55 md.checkmessage("for a steadystate computation, timestepping.time_step must be zero.") 56 57 if numpy.isnan(md.diagnostic.reltol): 58 md.checkmessage("for a steadystate computation, diagnostic.reltol (relative convergence criterion) must be defined!") 59 60 return md 61 # }}} 62 63 def marshall(self,fid): # {{{ 64 WriteData(fid,'object',self,'fieldname','reltol','format','Double') 65 WriteData(fid,'object',self,'fieldname','maxiter','format','Integer') 66 WriteData(fid,'object',self,'fieldname','requested_outputs','format','DoubleMat','mattype',3) 67 # }}} 68 -
issm/branches/trunk-jpl-damage/src/m/classes/surfaceforcings.m
r12878 r13101 11 11 issmbgradients = 0; 12 12 isdelta18o = 0; 13 13 hc = NaN; 14 14 smb_pos_max = NaN; 15 15 smb_pos_min = NaN; … … 44 44 function md = checkconsistency(obj,md,solution,analyses) % {{{ 45 45 46 if ismember(PrognosticAnalysisEnum ,analyses),47 md = checkfield(md,'surfaceforcings.ispdd','numel', 1,'values',[0 1]);48 checkfield(md,'surfaceforcings.issmbgradients','numel',1,'values',[0 1]);46 if ismember(PrognosticAnalysisEnum(),analyses), 47 md = checkfield(md,'surfaceforcings.ispdd','numel',[1],'values',[0 1]); 48 md = checkfield(md,'surfaceforcings.issmbgradients','numel',[1],'values',[0 1]); 49 49 if(obj.ispdd) 50 51 52 53 54 55 56 57 58 59 50 if(obj.isdelta18o==0) 51 md = checkfield(md,'surfaceforcings.monthlytemperatures','forcing',1,'NaN',1); 52 md = checkfield(md,'surfaceforcings.precipitation','forcing',1,'NaN',1); 53 else 54 md = checkfield(md,'surfaceforcings.delta18o','NaN',1); 55 md = checkfield(md,'surfaceforcings.delta18o_surface','NaN',1); 56 md = checkfield(md,'surfaceforcings.temperatures_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1); 57 md = checkfield(md,'surfaceforcings.temperatures_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1); 58 md = checkfield(md,'surfaceforcings.precipitations_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1); 59 end 60 60 elseif(obj.issmbgradients) 61 checkfield(md,'surfaceforcings.hc','forcing',1,'NaN',1);62 checkfield(md,'surfaceforcings.smb_pos_max','forcing',1,'NaN',1);63 checkfield(md,'surfaceforcings.smb_pos_min','forcing',1,'NaN',1);64 checkfield(md,'surfaceforcings.a_pos','forcing',1,'NaN',1);65 checkfield(md,'surfaceforcings.b_pos','forcing',1,'NaN',1);66 checkfield(md,'surfaceforcings.a_neg','forcing',1,'NaN',1);67 checkfield(md,'surfaceforcings.b_neg','forcing',1,'NaN',1);61 md = checkfield(md,'surfaceforcings.hc','forcing',1,'NaN',1); 62 md = checkfield(md,'surfaceforcings.smb_pos_max','forcing',1,'NaN',1); 63 md = checkfield(md,'surfaceforcings.smb_pos_min','forcing',1,'NaN',1); 64 md = checkfield(md,'surfaceforcings.a_pos','forcing',1,'NaN',1); 65 md = checkfield(md,'surfaceforcings.b_pos','forcing',1,'NaN',1); 66 md = checkfield(md,'surfaceforcings.a_neg','forcing',1,'NaN',1); 67 md = checkfield(md,'surfaceforcings.b_neg','forcing',1,'NaN',1); 68 68 else 69 69 md = checkfield(md,'surfaceforcings.mass_balance','forcing',1,'NaN',1); 70 70 end 71 71 end 72 if ismember(BalancethicknessAnalysisEnum ,analyses),72 if ismember(BalancethicknessAnalysisEnum(),analyses), 73 73 md = checkfield(md,'surfaceforcings.mass_balance','size',[md.mesh.numberofvertices 1],'NaN',1); 74 74 end … … 103 103 WriteData(fid,'object',obj,'fieldname','isdelta18o','format','Boolean'); 104 104 if obj.ispdd, 105 106 107 108 109 110 111 112 WriteData(fid,'object',obj,'fieldname','monthlytemperatures','format','DoubleMat','mattype',1);113 WriteData(fid,'object',obj,'fieldname','precipitation','format','DoubleMat','mattype',1);114 105 if obj.isdelta18o 106 WriteData(fid,'object',obj,'fieldname','temperatures_presentday','format','DoubleMat','mattype',1); 107 WriteData(fid,'object',obj,'fieldname','temperatures_lgm','format','DoubleMat','mattype',1); 108 WriteData(fid,'object',obj,'fieldname','precipitations_presentday','format','DoubleMat','mattype',1); 109 WriteData(fid,'object',obj,'fieldname','delta18o_surface','format','DoubleMat','mattype',1); 110 WriteData(fid,'object',obj,'fieldname','delta18o','format','DoubleMat','mattype',1); 111 else 112 WriteData(fid,'object',obj,'fieldname','monthlytemperatures','format','DoubleMat','mattype',1); 113 WriteData(fid,'object',obj,'fieldname','precipitation','format','DoubleMat','mattype',1); 114 end 115 115 end 116 116 WriteData(fid,'object',obj,'fieldname','issmbgradients','format','Boolean'); -
issm/branches/trunk-jpl-damage/src/m/classes/surfaceforcings.py
r12168 r13101 1 1 #module imports 2 2 from fielddisplay import fielddisplay 3 from EnumDefinitions import * 4 from checkfield import * 5 from WriteData import * 3 6 4 class surfaceforcings: 7 class surfaceforcings(object): 8 """ 9 SURFACEFORCING Class definition 10 11 Usage: 12 surfaceforcings=surfaceforcings(); 13 """ 14 5 15 #properties 6 16 def __init__(self): … … 8 18 self.precipitation = float('NaN') 9 19 self.mass_balance = float('NaN') 20 self.ispdd = 0 21 self.issmbgradients = 0 22 self.isdelta18o = 0 23 self.hc = float('NaN') 24 self.smb_pos_max = float('NaN') 25 self.smb_pos_min = float('NaN') 26 self.a_pos = float('NaN') 27 self.b_pos = float('NaN') 28 self.a_neg = float('NaN') 29 self.b_neg = float('NaN') 30 self.monthlytemperatures = float('NaN') 31 self.delta18o = float('NaN') 32 self.delta18o_surface = float('NaN') 33 self.temperatures_presentday = float('NaN') 34 self.temperatures_lgm = float('NaN') 35 self.precipitations_presentday = float('NaN') 10 36 11 37 #set defaults … … 13 39 14 40 #}}} 15 def __repr__( obj):41 def __repr__(self): 16 42 # {{{ Display 17 43 string=" surface forcings parameters:" 18 44 19 string="%s\n\n%s"%(string,fielddisplay(obj,'precipitation','surface precipitation [m/yr water eq]')) 20 string="%s\n%s"%(string,fielddisplay(obj,'mass_balance','surface mass balance [m/yr ice eq]')) 45 string="%s\n\n%s"%(string,fielddisplay(self,'precipitation','surface precipitation [m/yr water eq]')) 46 string="%s\n%s"%(string,fielddisplay(self,'mass_balance','surface mass balance [m/yr ice eq]')) 47 string="%s\n%s"%(string,fielddisplay(self,'ispdd','is pdd activated (0 or 1, default is 0)')) 48 string="%s\n%s"%(string,fielddisplay(self,'isdelta18o','is temperature and precipitation delta18o parametrisation activated (0 or 1, default is 0)')) 49 string="%s\n%s"%(string,fielddisplay(self,'monthlytemperatures','monthly surface temperatures [Kelvin], required if pdd is activated and delta18o not activated')) 50 string="%s\n%s"%(string,fielddisplay(self,'precipitation','surface precipitation [m/yr water eq]')) 51 string="%s\n%s"%(string,fielddisplay(self,'temperatures_presentday','monthly present day surface temperatures [Kelvin], required if pdd is activated and delta18o activated')) 52 string="%s\n%s"%(string,fielddisplay(self,'temperatures_lgm','monthly LGM surface temperatures [Kelvin], required if pdd is activated and delta18o activated')) 53 string="%s\n%s"%(string,fielddisplay(self,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if pdd is activated and delta18o activated')) 54 string="%s\n%s"%(string,fielddisplay(self,'delta18o','delta18o, required if pdd is activated and delta18o activated')) 55 string="%s\n%s"%(string,fielddisplay(self,'delta18o_surface','surface elevation of the delta18o site, required if pdd is activated and delta18o activated')) 56 string="%s\n%s"%(string,fielddisplay(self,'issmbgradients','is smb gradients method activated (0 or 1, default is 0)')) 57 string="%s\n%s"%(string,fielddisplay(self,'hc',' elevation of intersection between accumulation and ablation regime required if smb gradients is activated')) 58 string="%s\n%s"%(string,fielddisplay(self,'smb_pos_max',' maximum value of positive smb required if smb gradients is activated')) 59 string="%s\n%s"%(string,fielddisplay(self,'smb_pos_min',' minimum value of positive smb required if smb gradients is activated')) 60 string="%s\n%s"%(string,fielddisplay(self,'a_pos',' intercept of hs - smb regression line for accumulation regime required if smb gradients is activated')) 61 string="%s\n%s"%(string,fielddisplay(self,'b_pos',' slope of hs - smb regression line for accumulation regime required if smb gradients is activated')) 62 string="%s\n%s"%(string,fielddisplay(self,'a_neg',' intercept of hs - smb regression line for ablation regime required if smb gradients is activated')) 63 string="%s\n%s"%(string,fielddisplay(self,'b_neg',' slope of hs - smb regression line for ablation regime required if smb gradients is activated')) 21 64 22 65 return string 23 66 #}}} 24 67 25 def setdefaultparameters( obj):68 def setdefaultparameters(self): 26 69 # {{{setdefaultparameters 27 return obj 70 71 #pdd method not used in default mode 72 self.ispdd=0 73 self.issmbgradients=0 74 self.isdelta18o=0 75 76 return self 28 77 #}}} 29 78 79 def checkconsistency(self,md,solution,analyses): # {{{ 80 81 if PrognosticAnalysisEnum() in analyses: 82 md = checkfield(md,'surfaceforcings.ispdd','numel',[1],'values',[0,1]) 83 md = checkfield(md,'surfaceforcings.issmbgradients','numel',[1],'values',[0,1]) 84 if self.ispdd: 85 if not self.isdelta18o: 86 md = checkfield(md,'surfaceforcings.monthlytemperatures','forcing',1,'NaN',1) 87 md = checkfield(md,'surfaceforcings.precipitation','forcing',1,'NaN',1) 88 else: 89 md = checkfield(md,'surfaceforcings.delta18o','NaN',1) 90 md = checkfield(md,'surfaceforcings.delta18o_surface','NaN',1) 91 md = checkfield(md,'surfaceforcings.temperatures_presentday','size',[md.mesh.numberofvertices+1,12],'NaN',1) 92 md = checkfield(md,'surfaceforcings.temperatures_lgm','size',[md.mesh.numberofvertices+1,12],'NaN',1) 93 md = checkfield(md,'surfaceforcings.precipitations_presentday','size',[md.mesh.numberofvertices+1,12],'NaN',1) 94 elif self.issmbgradients: 95 md = checkfield(md,'surfaceforcings.hc','forcing',1,'NaN',1) 96 md = checkfield(md,'surfaceforcings.smb_pos_max','forcing',1,'NaN',1) 97 md = checkfield(md,'surfaceforcings.smb_pos_min','forcing',1,'NaN',1) 98 md = checkfield(md,'surfaceforcings.a_pos','forcing',1,'NaN',1) 99 md = checkfield(md,'surfaceforcings.b_pos','forcing',1,'NaN',1) 100 md = checkfield(md,'surfaceforcings.a_neg','forcing',1,'NaN',1) 101 md = checkfield(md,'surfaceforcings.b_neg','forcing',1,'NaN',1) 102 else: 103 md = checkfield(md,'surfaceforcings.mass_balance','forcing',1,'NaN',1) 104 105 if BalancethicknessAnalysisEnum() in analyses: 106 md = checkfield(md,'surfaceforcings.mass_balance','size',[md.mesh.numberofvertices],'NaN',1) 107 108 return md 109 # }}} 110 111 def marshall(self,fid): # {{{ 112 WriteData(fid,'object',self,'fieldname','precipitation','format','DoubleMat','mattype',1) 113 WriteData(fid,'object',self,'fieldname','mass_balance','format','DoubleMat','mattype',1) 114 WriteData(fid,'object',self,'fieldname','ispdd','format','Boolean') 115 WriteData(fid,'object',self,'fieldname','isdelta18o','format','Boolean') 116 117 if self.ispdd: 118 if self.isdelta18o: 119 WriteData(fid,'object',self,'fieldname','temperatures_presentday','format','DoubleMat','mattype',1) 120 WriteData(fid,'object',self,'fieldname','temperatures_lgm','format','DoubleMat','mattype',1) 121 WriteData(fid,'object',self,'fieldname','precipitations_presentday','format','DoubleMat','mattype',1) 122 WriteData(fid,'object',self,'fieldname','delta18o_surface','format','DoubleMat','mattype',1) 123 WriteData(fid,'object',self,'fieldname','delta18o','format','DoubleMat','mattype',1) 124 else: 125 WriteData(fid,'object',self,'fieldname','monthlytemperatures','format','DoubleMat','mattype',1) 126 WriteData(fid,'object',self,'fieldname','precipitation','format','DoubleMat','mattype',1) 127 128 WriteData(fid,'object',self,'fieldname','issmbgradients','format','Boolean') 129 130 if self.issmbgradients: 131 WriteData(fid,'object',self,'fieldname','hc','format','DoubleMat','mattype',1) 132 WriteData(fid,'object',self,'fieldname','smb_pos_max','format','DoubleMat','mattype',1) 133 WriteData(fid,'object',self,'fieldname','smb_pos_min','format','DoubleMat','mattype',1) 134 WriteData(fid,'object',self,'fieldname','a_pos','format','DoubleMat','mattype',1) 135 WriteData(fid,'object',self,'fieldname','b_pos','format','DoubleMat','mattype',1) 136 WriteData(fid,'object',self,'fieldname','a_neg','format','DoubleMat','mattype',1) 137 WriteData(fid,'object',self,'fieldname','b_neg','format','DoubleMat','mattype',1) 138 # }}} 139 -
issm/branches/trunk-jpl-damage/src/m/classes/thermal.m
r12878 r13101 43 43 44 44 %Early return 45 if (~ismember(ThermalAnalysisEnum ,analyses) & ~ismember(EnthalpyAnalysisEnum,analyses)) | (solution==TransientSolutionEnum& md.transient.isthermal==0), return; end45 if (~ismember(ThermalAnalysisEnum(),analyses) & ~ismember(EnthalpyAnalysisEnum(),analyses)) | (solution==TransientSolutionEnum() & md.transient.isthermal==0), return; end 46 46 47 md = checkfield(md,'thermal.stabilization','numel', 1,'values',[0 1 2]);47 md = checkfield(md,'thermal.stabilization','numel',[1],'values',[0 1 2]); 48 48 md = checkfield(md,'thermal.spctemperature','forcing',1); 49 if (ismember(EnthalpyAnalysisEnum ,analyses) & md.thermal.isenthalpy & md.mesh.dimension==3),50 md = checkfield(md,'thermal.spctemperature','<',md.materials.meltingpoint-md.materials.beta*md.materials.rho_ice*md.constants.g*(md.geometry.surface-md.mesh.z),'message','spctemperature should be below the adjusted melting point');51 md = checkfield(md,'thermal.isenthalpy','numel',1,'values',[0 1]);49 if (ismember(EnthalpyAnalysisEnum(),analyses) & md.thermal.isenthalpy & md.mesh.dimension==3), 50 md = checkfield(md,'thermal.spctemperature','<',md.materials.meltingpoint-md.materials.beta*md.materials.rho_ice*md.constants.g*(md.geometry.surface-md.mesh.z),'message','spctemperature should be below the adjusted melting point'); 51 md = checkfield(md,'thermal.isenthalpy','numel',[1],'values',[0 1]); 52 52 end 53 53 end % }}} -
issm/branches/trunk-jpl-damage/src/m/classes/thermal.py
r12168 r13101 1 1 #module imports 2 2 from fielddisplay import fielddisplay 3 from EnumDefinitions import * 4 from checkfield import * 5 from WriteData import * 3 6 4 class thermal: 7 class thermal(object): 8 """ 9 THERMAL class definition 10 11 Usage: 12 thermal=thermal(); 13 """ 14 5 15 #properties 6 16 def __init__(self): … … 18 28 19 29 #}}} 20 def __repr__( obj):30 def __repr__(self): 21 31 # {{{ Display 22 32 string=' Thermal solution parameters:' 23 string="%s\n\n%s"%(string,fielddisplay( obj,'spctemperature','temperature constraints (NaN means no constraint)'))24 string="%s\n%s"%(string,fielddisplay( obj,'stabilization','0->no, 1->artificial_diffusivity, 2->SUPG'))25 string="%s\n%s"%(string,fielddisplay( obj,'maxiter','maximum number of non linear iterations'))26 string="%s\n%s"%(string,fielddisplay( obj,'penalty_lock','stabilize unstable thermal constraints that keep zigzagging after n iteration (default is 0, no stabilization)'))27 string="%s\n%s"%(string,fielddisplay( obj,'penalty_threshold','threshold to declare convergence of thermal solution (default is 0)'))28 string="%s\n%s"%(string,fielddisplay( obj,'isenthalpy','use an enthalpy formulation to include temperate ice (default is 0)'))33 string="%s\n\n%s"%(string,fielddisplay(self,'spctemperature','temperature constraints (NaN means no constraint)')) 34 string="%s\n%s"%(string,fielddisplay(self,'stabilization','0->no, 1->artificial_diffusivity, 2->SUPG')) 35 string="%s\n%s"%(string,fielddisplay(self,'maxiter','maximum number of non linear iterations')) 36 string="%s\n%s"%(string,fielddisplay(self,'penalty_lock','stabilize unstable thermal constraints that keep zigzagging after n iteration (default is 0, no stabilization)')) 37 string="%s\n%s"%(string,fielddisplay(self,'penalty_threshold','threshold to declare convergence of thermal solution (default is 0)')) 38 string="%s\n%s"%(string,fielddisplay(self,'isenthalpy','use an enthalpy formulation to include temperate ice (default is 0)')) 29 39 return string 30 40 #}}} 31 41 32 def setdefaultparameters( obj):42 def setdefaultparameters(self): 33 43 # {{{setdefaultparameters 34 44 35 45 #Number of unstable constraints acceptable 36 obj.penalty_threshold=046 self.penalty_threshold=0 37 47 38 48 #Type of stabilization used 39 obj.stabilization=149 self.stabilization=1 40 50 41 51 #Maximum number of iterations 42 obj.maxiter=10052 self.maxiter=100 43 53 44 54 #factor used to compute the values of the penalties: kappa=max(stiffness matrix)*10^penalty_factor 45 obj.penalty_factor=355 self.penalty_factor=3 46 56 47 57 #Should we use cold ice (default) or enthalpy formulation 48 obj.isenthalpy=058 self.isenthalpy=0 49 59 50 return obj60 return self 51 61 #}}} 52 62 63 def checkconsistency(self,md,solution,analyses): # {{{ 64 65 #Early return 66 if (ThermalAnalysisEnum() not in analyses and EnthalpyAnalysisEnum() not in analyses) or (solution==TransientSolutionEnum() and not md.transient.isthermal): 67 return md 68 69 md = checkfield(md,'thermal.stabilization','numel',[1],'values',[0,1,2]) 70 md = checkfield(md,'thermal.spctemperature','forcing',1) 71 if EnthalpyAnalysisEnum() in analyses and md.thermal.isenthalpy and md.mesh.dimension==3: 72 md = checkfield(md,'thermal.spctemperature','<',md.materials.meltingpoint-md.materials.beta*md.materials.rho_ice*md.constants.g*(md.geometry.surface-md.mesh.z),'message',"spctemperature should be below the adjusted melting point") 73 md = checkfield(md,'thermal.isenthalpy','numel',[1],'values',[0,1]) 74 75 return md 76 # }}} 77 78 def marshall(self,fid): # {{{ 79 WriteData(fid,'object',self,'fieldname','spctemperature','format','DoubleMat','mattype',1) 80 WriteData(fid,'object',self,'fieldname','penalty_threshold','format','Integer') 81 WriteData(fid,'object',self,'fieldname','stabilization','format','Integer') 82 WriteData(fid,'object',self,'fieldname','maxiter','format','Integer') 83 WriteData(fid,'object',self,'fieldname','penalty_lock','format','Integer') 84 WriteData(fid,'object',self,'fieldname','penalty_factor','format','Double') 85 WriteData(fid,'object',self,'fieldname','isenthalpy','format','Boolean') 86 # }}} 87 -
issm/branches/trunk-jpl-damage/src/m/classes/timestepping.m
r12878 r13101 35 35 function md = checkconsistency(obj,md,solution,analyses) % {{{ 36 36 37 md = checkfield(md,'timestepping.start_time','numel', 1,'NaN',1);38 md = checkfield(md,'timestepping.final_time','numel', 1,'NaN',1);39 md = checkfield(md,'timestepping.time_step','numel', 1,'>=',0,'NaN',1);40 md = checkfield(md,'timestepping.time_adapt','numel', 1,'values',[0 1]);41 md = checkfield(md,'timestepping.cfl_coefficient','numel', 1,'>',0,'<=',1);37 md = checkfield(md,'timestepping.start_time','numel',[1],'NaN',1); 38 md = checkfield(md,'timestepping.final_time','numel',[1],'NaN',1); 39 md = checkfield(md,'timestepping.time_step','numel',[1],'>=',0,'NaN',1); 40 md = checkfield(md,'timestepping.time_adapt','numel',[1],'values',[0 1]); 41 md = checkfield(md,'timestepping.cfl_coefficient','numel',[1],'>',0,'<=',1); 42 42 if obj.final_time-obj.start_time<0, 43 43 md = checkmessage(md,'timestepping.final_time should be larger than timestepping.start_time'); -
issm/branches/trunk-jpl-damage/src/m/classes/timestepping.py
r12168 r13101 1 1 #module imports 2 2 from fielddisplay import fielddisplay 3 from EnumDefinitions import * 4 from checkfield import * 5 from WriteData import * 3 6 4 class timestepping: 7 class timestepping(object): 8 """ 9 TIMESTEPPING Class definition 10 11 Usage: 12 timestepping=timestepping(); 13 """ 14 5 15 #properties 6 16 def __init__(self): 7 17 # {{{ Properties 18 self.start_time = 0 19 self.final_time = 0 8 20 self.time_step = 0 9 self.final_time = 010 21 self.time_adapt = 0 11 22 self.cfl_coefficient = 0 … … 15 26 16 27 #}}} 17 def __repr__( obj):28 def __repr__(self): 18 29 # {{{ Display 19 30 string=" timestepping parameters:" 20 string="%s\n\n%s"%(string,fielddisplay(obj,"time_step","length of time steps [yrs]")) 21 string="%s\n%s"%(string,fielddisplay(obj,"final_time","final time to stop the simulation [yrs]")) 22 string="%s\n%s"%(string,fielddisplay(obj,"time_adapt","use cfl condition to define time step ? (0 or 1) ")) 23 string="%s\n%s"%(string,fielddisplay(obj,"cfl_coefficient","coefficient applied to cfl condition")) 31 string="%s\n\n%s"%(string,fielddisplay(self,"start_time","simulation starting time [yrs]")) 32 string="%s\n%s"%(string,fielddisplay(self,"final_time","final time to stop the simulation [yrs]")) 33 string="%s\n%s"%(string,fielddisplay(self,"time_step","length of time steps [yrs]")) 34 string="%s\n%s"%(string,fielddisplay(self,"time_adapt","use cfl condition to define time step ? (0 or 1) ")) 35 string="%s\n%s"%(string,fielddisplay(self,"cfl_coefficient","coefficient applied to cfl condition")) 24 36 return string 25 37 #}}} 26 38 27 def setdefaultparameters( obj):39 def setdefaultparameters(self): 28 40 # {{{setdefaultparameters 29 41 30 42 #time between 2 time steps 31 obj.time_step=1/243 self.time_step=1/2 32 44 33 45 #final time 34 obj.final_time=10*obj.time_step46 self.final_time=10*self.time_step 35 47 36 48 #time adaptation? 37 obj.time_adapt=038 obj.cfl_coefficient=.549 self.time_adapt=0 50 self.cfl_coefficient=.5 39 51 40 return obj52 return self 41 53 #}}} 54 55 def checkconsistency(self,md,solution,analyses): # {{{ 56 57 md = checkfield(md,'timestepping.start_time','numel',[1],'NaN',1) 58 md = checkfield(md,'timestepping.final_time','numel',[1],'NaN',1) 59 md = checkfield(md,'timestepping.time_step','numel',[1],'>=',0,'NaN',1) 60 md = checkfield(md,'timestepping.time_adapt','numel',[1],'values',[0,1]) 61 md = checkfield(md,'timestepping.cfl_coefficient','numel',[1],'>',0,'<=',1) 62 if self.final_time-self.start_time<0: 63 md.checkmessage("timestepping.final_time should be larger than timestepping.start_time") 64 65 return md 66 # }}} 67 68 def marshall(self,fid): # {{{ 69 WriteData(fid,'object',self,'fieldname','start_time','format','Double') 70 WriteData(fid,'object',self,'fieldname','final_time','format','Double') 71 WriteData(fid,'object',self,'fieldname','time_step','format','Double') 72 WriteData(fid,'object',self,'fieldname','time_adapt','format','Boolean') 73 WriteData(fid,'object',self,'fieldname','cfl_coefficient','format','Double') 74 # }}} 75 -
issm/branches/trunk-jpl-damage/src/m/classes/transient.m
r12878 r13101 33 33 34 34 %Early return 35 if solution~=TransientSolutionEnum , return; end35 if solution~=TransientSolutionEnum(), return; end 36 36 37 md = checkfield(md,'transient.isprognostic','numel', 1,'values',[0 1]);38 md = checkfield(md,'transient.isdiagnostic','numel', 1,'values',[0 1]);39 md = checkfield(md,'transient.isthermal','numel', 1,'values',[0 1]);40 md = checkfield(md,'transient.isgroundingline','numel', 1,'values',[0 1]);37 md = checkfield(md,'transient.isprognostic','numel',[1],'values',[0 1]); 38 md = checkfield(md,'transient.isdiagnostic','numel',[1],'values',[0 1]); 39 md = checkfield(md,'transient.isthermal','numel',[1],'values',[0 1]); 40 md = checkfield(md,'transient.isgroundingline','numel',[1],'values',[0 1]); 41 41 md = checkfield(md,'transient.requested_outputs','size',[NaN 1]); 42 42 -
issm/branches/trunk-jpl-damage/src/m/classes/transient.py
r12168 r13101 1 1 #module imports 2 2 from fielddisplay import fielddisplay 3 from EnumDefinitions import * 4 from checkfield import * 5 from WriteData import * 3 6 4 class transient: 7 class transient(object): 8 """ 9 TRANSIENT class definition 10 11 Usage: 12 transient=transient(); 13 """ 14 5 15 #properties 6 16 def __init__(self): … … 16 26 17 27 #}}} 18 def __repr__( obj):28 def __repr__(self): 19 29 # {{{ Display 20 30 string=' transient solution parameters:' 21 string="%s\n%s"%(string,fielddisplay( obj,'isprognostic','indicates if a prognostic solution is used in the transient'))22 string="%s\n%s"%(string,fielddisplay( obj,'isthermal','indicates if a thermal solution is used in the transient'))23 string="%s\n%s"%(string,fielddisplay( obj,'isdiagnostic','indicates if a diagnostic solution is used in the transient'))24 string="%s\n%s"%(string,fielddisplay( obj,'isgroundingline','indicates if a groundingline migration is used in the transient'))25 string="%s\n%s"%(string,fielddisplay( obj,'requested_outputs','list of additional outputs requested'))31 string="%s\n%s"%(string,fielddisplay(self,'isprognostic','indicates if a prognostic solution is used in the transient')) 32 string="%s\n%s"%(string,fielddisplay(self,'isthermal','indicates if a thermal solution is used in the transient')) 33 string="%s\n%s"%(string,fielddisplay(self,'isdiagnostic','indicates if a diagnostic solution is used in the transient')) 34 string="%s\n%s"%(string,fielddisplay(self,'isgroundingline','indicates if a groundingline migration is used in the transient')) 35 string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','list of additional outputs requested')) 26 36 return string 27 37 #}}} 28 38 29 def setdefaultparameters( obj):39 def setdefaultparameters(self): 30 40 # {{{setdefaultparameters 31 41 32 42 #full analysis: Diagnostic, Prognostic and Thermal but no groundingline migration for now 33 obj.isprognostic=134 obj.isdiagnostic=135 obj.isthermal=136 obj.isgroundingline=043 self.isprognostic=1 44 self.isdiagnostic=1 45 self.isthermal=1 46 self.isgroundingline=0 37 47 38 return obj48 return self 39 49 #}}} 40 50 51 def checkconsistency(self,md,solution,analyses): # {{{ 52 53 #Early return 54 if not solution==TransientSolutionEnum(): 55 return md 56 57 md = checkfield(md,'transient.isprognostic','numel',[1],'values',[0,1]) 58 md = checkfield(md,'transient.isdiagnostic','numel',[1],'values',[0,1]) 59 md = checkfield(md,'transient.isthermal','numel',[1],'values',[0,1]) 60 md = checkfield(md,'transient.isgroundingline','numel',[1],'values',[0,1]) 61 md = checkfield(md,'transient.requested_outputs','size',[float('NaN')]) 62 63 64 return md 65 # }}} 66 67 def marshall(self,fid): # {{{ 68 WriteData(fid,'object',self,'fieldname','isprognostic','format','Boolean') 69 WriteData(fid,'object',self,'fieldname','isdiagnostic','format','Boolean') 70 WriteData(fid,'object',self,'fieldname','isthermal','format','Boolean') 71 WriteData(fid,'object',self,'fieldname','isgroundingline','format','Boolean') 72 WriteData(fid,'object',self,'fieldname','requested_outputs','format','DoubleMat','mattype',3) 73 # }}} 74 -
issm/branches/trunk-jpl-damage/src/m/classes/verbose.m
r12946 r13101 120 120 %}}} 121 121 function marshall(obj,fid) % {{{ 122 WriteData(fid,'data',VerboseToBinary(obj),'enum',VerboseEnum ,'format','Integer');122 WriteData(fid,'data',VerboseToBinary(obj),'enum',VerboseEnum(),'format','Integer'); 123 123 end % }}} 124 124 end -
issm/branches/trunk-jpl-damage/src/m/classes/verbose.py
r12946 r13101 1 1 from pairoptions import * 2 2 from MatlabFuncs import * 3 from EnumDefinitions import * 3 4 from WriteData import * 4 from EnumDefinitions import *5 5 6 6 class verbose(object): … … 44 44 elif len(args) == 1: 45 45 binary=args[0] 46 if isinstance(binary, str):46 if isinstance(binary,(str,unicode)): 47 47 if strcmpi(binary,'all'): 48 48 binary=2**11-1 #all ones … … 52 52 binary=int(binary,2) 53 53 self.BinaryToVerbose(binary) 54 elif isinstance(binary,(int, float)):54 elif isinstance(binary,(int,long,float)): 55 55 self.BinaryToVerbose(int(binary)) 56 56 … … 62 62 listproperties=vars(self) 63 63 for [fieldname,fieldvalue] in listproperties.iteritems(): 64 if isinstance(fieldvalue,bool) or isinstance(fieldvalue,(int, float)):64 if isinstance(fieldvalue,bool) or isinstance(fieldvalue,(int,long,float)): 65 65 setattr(self,fieldname,bool(fieldvalue)) 66 66 else: … … 125 125 126 126 def marshall(self,fid): # {{{ 127 WriteData(fid,'data', VerboseToBinary(self),'enum',VerboseEnum,'format','Integer')127 WriteData(fid,'data',self.VerboseToBinary(),'enum',VerboseEnum(),'format','Integer') 128 128 # }}} 129 129 -
issm/branches/trunk-jpl-damage/src/m/enum/EnumDefinitions.py
r12947 r13101 1 from StringToEnum import StringToEnum 2 1 3 """ 2 4 … … 7 9 """ 8 10 9 def AutodiffForwardEnum():10 """11 AUTODIFFFORWARDENUM - Enum of AutodiffForward12 13 Usage:14 macro=AutodiffForwardEnum()15 """16 17 return StringToEnum('AutodiffForward')18 19 11 def AutodiffIsautodiffEnum(): 20 12 """ … … 25 17 """ 26 18 27 return StringToEnum('AutodiffIsautodiff') 28 29 def AutodiffReverseEnum(): 30 """ 31 AUTODIFFREVERSEENUM - Enum of AutodiffReverse 32 33 Usage: 34 macro=AutodiffReverseEnum() 35 """ 36 37 return StringToEnum('AutodiffReverse') 19 return StringToEnum('AutodiffIsautodiff')[0] 38 20 39 21 def BalancethicknessSpcthicknessEnum(): … … 45 27 """ 46 28 47 return StringToEnum('BalancethicknessSpcthickness') 29 return StringToEnum('BalancethicknessSpcthickness')[0] 48 30 49 31 def BalancethicknessStabilizationEnum(): … … 55 37 """ 56 38 57 return StringToEnum('BalancethicknessStabilization') 39 return StringToEnum('BalancethicknessStabilization')[0] 58 40 59 41 def BalancethicknessThickeningRateEnum(): … … 65 47 """ 66 48 67 return StringToEnum('BalancethicknessThickeningRate') 49 return StringToEnum('BalancethicknessThickeningRate')[0] 68 50 69 51 def BasalforcingsGeothermalfluxEnum(): … … 75 57 """ 76 58 77 return StringToEnum('BasalforcingsGeothermalflux') 59 return StringToEnum('BasalforcingsGeothermalflux')[0] 78 60 79 61 def BasalforcingsMeltingRateCorrectionEnum(): … … 85 67 """ 86 68 87 return StringToEnum('BasalforcingsMeltingRateCorrection') 69 return StringToEnum('BasalforcingsMeltingRateCorrection')[0] 88 70 89 71 def BasalforcingsMeltingRateEnum(): … … 95 77 """ 96 78 97 return StringToEnum('BasalforcingsMeltingRate') 79 return StringToEnum('BasalforcingsMeltingRate')[0] 98 80 99 81 def BathymetryEnum(): … … 105 87 """ 106 88 107 return StringToEnum('Bathymetry') 89 return StringToEnum('Bathymetry')[0] 108 90 109 91 def BedEnum(): … … 115 97 """ 116 98 117 return StringToEnum('Bed') 99 return StringToEnum('Bed')[0] 118 100 119 101 def ConstantsGEnum(): … … 125 107 """ 126 108 127 return StringToEnum('ConstantsG') 109 return StringToEnum('ConstantsG')[0] 128 110 129 111 def ConstantsReferencetemperatureEnum(): … … 135 117 """ 136 118 137 return StringToEnum('ConstantsReferencetemperature') 119 return StringToEnum('ConstantsReferencetemperature')[0] 138 120 139 121 def ConstantsYtsEnum(): … … 145 127 """ 146 128 147 return StringToEnum('ConstantsYts') 129 return StringToEnum('ConstantsYts')[0] 148 130 149 131 def DiagnosticAbstolEnum(): … … 155 137 """ 156 138 157 return StringToEnum('DiagnosticAbstol') 139 return StringToEnum('DiagnosticAbstol')[0] 158 140 159 141 def DiagnosticIcefrontEnum(): … … 165 147 """ 166 148 167 return StringToEnum('DiagnosticIcefront') 149 return StringToEnum('DiagnosticIcefront')[0] 168 150 169 151 def DiagnosticIsnewtonEnum(): … … 175 157 """ 176 158 177 return StringToEnum('DiagnosticIsnewton') 159 return StringToEnum('DiagnosticIsnewton')[0] 178 160 179 161 def DiagnosticMaxiterEnum(): … … 185 167 """ 186 168 187 return StringToEnum('DiagnosticMaxiter') 169 return StringToEnum('DiagnosticMaxiter')[0] 188 170 189 171 def DiagnosticNumRequestedOutputsEnum(): … … 195 177 """ 196 178 197 return StringToEnum('DiagnosticNumRequestedOutputs') 179 return StringToEnum('DiagnosticNumRequestedOutputs')[0] 198 180 199 181 def DiagnosticPenaltyFactorEnum(): … … 205 187 """ 206 188 207 return StringToEnum('DiagnosticPenaltyFactor') 189 return StringToEnum('DiagnosticPenaltyFactor')[0] 208 190 209 191 def DiagnosticReferentialEnum(): … … 215 197 """ 216 198 217 return StringToEnum('DiagnosticReferential') 199 return StringToEnum('DiagnosticReferential')[0] 218 200 219 201 def DiagnosticReltolEnum(): … … 225 207 """ 226 208 227 return StringToEnum('DiagnosticReltol') 209 return StringToEnum('DiagnosticReltol')[0] 228 210 229 211 def DiagnosticRequestedOutputsEnum(): … … 235 217 """ 236 218 237 return StringToEnum('DiagnosticRequestedOutputs') 219 return StringToEnum('DiagnosticRequestedOutputs')[0] 238 220 239 221 def DiagnosticRestolEnum(): … … 245 227 """ 246 228 247 return StringToEnum('DiagnosticRestol') 229 return StringToEnum('DiagnosticRestol')[0] 248 230 249 231 def DiagnosticRiftPenaltyLockEnum(): … … 255 237 """ 256 238 257 return StringToEnum('DiagnosticRiftPenaltyLock') 239 return StringToEnum('DiagnosticRiftPenaltyLock')[0] 258 240 259 241 def DiagnosticRiftPenaltyThresholdEnum(): … … 265 247 """ 266 248 267 return StringToEnum('DiagnosticRiftPenaltyThreshold') 249 return StringToEnum('DiagnosticRiftPenaltyThreshold')[0] 268 250 269 251 def DiagnosticShelfDampeningEnum(): … … 275 257 """ 276 258 277 return StringToEnum('DiagnosticShelfDampening') 259 return StringToEnum('DiagnosticShelfDampening')[0] 278 260 279 261 def DiagnosticSpcvxEnum(): … … 285 267 """ 286 268 287 return StringToEnum('DiagnosticSpcvx') 269 return StringToEnum('DiagnosticSpcvx')[0] 288 270 289 271 def DiagnosticSpcvyEnum(): … … 295 277 """ 296 278 297 return StringToEnum('DiagnosticSpcvy') 279 return StringToEnum('DiagnosticSpcvy')[0] 298 280 299 281 def DiagnosticSpcvzEnum(): … … 305 287 """ 306 288 307 return StringToEnum('DiagnosticSpcvz') 289 return StringToEnum('DiagnosticSpcvz')[0] 308 290 309 291 def DiagnosticStokesreconditioningEnum(): … … 315 297 """ 316 298 317 return StringToEnum('DiagnosticStokesreconditioning') 299 return StringToEnum('DiagnosticStokesreconditioning')[0] 318 300 319 301 def DiagnosticVertexPairingEnum(): … … 325 307 """ 326 308 327 return StringToEnum('DiagnosticVertexPairing') 309 return StringToEnum('DiagnosticVertexPairing')[0] 328 310 329 311 def DiagnosticViscosityOvershootEnum(): … … 335 317 """ 336 318 337 return StringToEnum('DiagnosticViscosityOvershoot') 319 return StringToEnum('DiagnosticViscosityOvershoot')[0] 338 320 339 321 def FlowequationBordermacayealEnum(): … … 345 327 """ 346 328 347 return StringToEnum('FlowequationBordermacayeal') 329 return StringToEnum('FlowequationBordermacayeal')[0] 348 330 349 331 def FlowequationBorderpattynEnum(): … … 355 337 """ 356 338 357 return StringToEnum('FlowequationBorderpattyn') 339 return StringToEnum('FlowequationBorderpattyn')[0] 358 340 359 341 def FlowequationBorderstokesEnum(): … … 365 347 """ 366 348 367 return StringToEnum('FlowequationBorderstokes') 349 return StringToEnum('FlowequationBorderstokes')[0] 368 350 369 351 def FlowequationElementEquationEnum(): … … 375 357 """ 376 358 377 return StringToEnum('FlowequationElementEquation') 359 return StringToEnum('FlowequationElementEquation')[0] 378 360 379 361 def FlowequationIshutterEnum(): … … 385 367 """ 386 368 387 return StringToEnum('FlowequationIshutter') 369 return StringToEnum('FlowequationIshutter')[0] 370 371 def FlowequationIsl1l2Enum(): 372 """ 373 FLOWEQUATIONISL1L2ENUM - Enum of FlowequationIsl1l2 374 375 Usage: 376 macro=FlowequationIsl1l2Enum() 377 """ 378 379 return StringToEnum('FlowequationIsl1l2')[0] 388 380 389 381 def FlowequationIsmacayealpattynEnum(): … … 395 387 """ 396 388 397 return StringToEnum('FlowequationIsmacayealpattyn') 389 return StringToEnum('FlowequationIsmacayealpattyn')[0] 398 390 399 391 def FlowequationIsstokesEnum(): … … 405 397 """ 406 398 407 return StringToEnum('FlowequationIsstokes') 399 return StringToEnum('FlowequationIsstokes')[0] 408 400 409 401 def FlowequationVertexEquationEnum(): … … 415 407 """ 416 408 417 return StringToEnum('FlowequationVertexEquation') 409 return StringToEnum('FlowequationVertexEquation')[0] 418 410 419 411 def FrictionCoefficientEnum(): … … 425 417 """ 426 418 427 return StringToEnum('FrictionCoefficient') 419 return StringToEnum('FrictionCoefficient')[0] 428 420 429 421 def FrictionPEnum(): … … 435 427 """ 436 428 437 return StringToEnum('FrictionP') 429 return StringToEnum('FrictionP')[0] 438 430 439 431 def FrictionQEnum(): … … 445 437 """ 446 438 447 return StringToEnum('FrictionQ') 439 return StringToEnum('FrictionQ')[0] 448 440 449 441 def GeometryHydrostaticRatioEnum(): … … 455 447 """ 456 448 457 return StringToEnum('GeometryHydrostaticRatio') 449 return StringToEnum('GeometryHydrostaticRatio')[0] 458 450 459 451 def HydrologyCREnum(): … … 465 457 """ 466 458 467 return StringToEnum('HydrologyCR') 459 return StringToEnum('HydrologyCR')[0] 468 460 469 461 def HydrologyKnEnum(): … … 475 467 """ 476 468 477 return StringToEnum('HydrologyKn') 469 return StringToEnum('HydrologyKn')[0] 478 470 479 471 def HydrologyNEnum(): … … 485 477 """ 486 478 487 return StringToEnum('HydrologyN') 479 return StringToEnum('HydrologyN')[0] 488 480 489 481 def HydrologyPEnum(): … … 495 487 """ 496 488 497 return StringToEnum('HydrologyP') 489 return StringToEnum('HydrologyP')[0] 498 490 499 491 def HydrologyQEnum(): … … 505 497 """ 506 498 507 return StringToEnum('HydrologyQ') 499 return StringToEnum('HydrologyQ')[0] 508 500 509 501 def HydrologySpcwatercolumnEnum(): … … 515 507 """ 516 508 517 return StringToEnum('HydrologySpcwatercolumn') 509 return StringToEnum('HydrologySpcwatercolumn')[0] 518 510 519 511 def HydrologyStabilizationEnum(): … … 525 517 """ 526 518 527 return StringToEnum('HydrologyStabilization') 519 return StringToEnum('HydrologyStabilization')[0] 528 520 529 521 def InversionControlParametersEnum(): … … 535 527 """ 536 528 537 return StringToEnum('InversionControlParameters') 529 return StringToEnum('InversionControlParameters')[0] 538 530 539 531 def InversionCostFunctionEnum(): … … 545 537 """ 546 538 547 return StringToEnum('InversionCostFunction') 539 return StringToEnum('InversionCostFunction')[0] 548 540 549 541 def InversionCostFunctionThresholdEnum(): … … 555 547 """ 556 548 557 return StringToEnum('InversionCostFunctionThreshold') 549 return StringToEnum('InversionCostFunctionThreshold')[0] 558 550 559 551 def InversionCostFunctionsCoefficientsEnum(): … … 565 557 """ 566 558 567 return StringToEnum('InversionCostFunctionsCoefficients') 559 return StringToEnum('InversionCostFunctionsCoefficients')[0] 568 560 569 561 def InversionCostFunctionsEnum(): … … 575 567 """ 576 568 577 return StringToEnum('InversionCostFunctions') 569 return StringToEnum('InversionCostFunctions')[0] 578 570 579 571 def InversionGradientOnlyEnum(): … … 585 577 """ 586 578 587 return StringToEnum('InversionGradientOnly') 579 return StringToEnum('InversionGradientOnly')[0] 588 580 589 581 def InversionGradientScalingEnum(): … … 595 587 """ 596 588 597 return StringToEnum('InversionGradientScaling') 589 return StringToEnum('InversionGradientScaling')[0] 598 590 599 591 def InversionIscontrolEnum(): … … 605 597 """ 606 598 607 return StringToEnum('InversionIscontrol') 599 return StringToEnum('InversionIscontrol')[0] 608 600 609 601 def InversionTaoEnum(): … … 615 607 """ 616 608 617 return StringToEnum('InversionTao') 609 return StringToEnum('InversionTao')[0] 618 610 619 611 def InversionIncompleteAdjointEnum(): … … 625 617 """ 626 618 627 return StringToEnum('InversionIncompleteAdjoint') 619 return StringToEnum('InversionIncompleteAdjoint')[0] 628 620 629 621 def InversionMaxParametersEnum(): … … 635 627 """ 636 628 637 return StringToEnum('InversionMaxParameters') 629 return StringToEnum('InversionMaxParameters')[0] 638 630 639 631 def InversionMaxiterPerStepEnum(): … … 645 637 """ 646 638 647 return StringToEnum('InversionMaxiterPerStep') 639 return StringToEnum('InversionMaxiterPerStep')[0] 648 640 649 641 def InversionMinParametersEnum(): … … 655 647 """ 656 648 657 return StringToEnum('InversionMinParameters') 649 return StringToEnum('InversionMinParameters')[0] 658 650 659 651 def InversionNstepsEnum(): … … 665 657 """ 666 658 667 return StringToEnum('InversionNsteps') 659 return StringToEnum('InversionNsteps')[0] 668 660 669 661 def InversionNumControlParametersEnum(): … … 675 667 """ 676 668 677 return StringToEnum('InversionNumControlParameters') 669 return StringToEnum('InversionNumControlParameters')[0] 678 670 679 671 def InversionNumCostFunctionsEnum(): … … 685 677 """ 686 678 687 return StringToEnum('InversionNumCostFunctions') 679 return StringToEnum('InversionNumCostFunctions')[0] 688 680 689 681 def InversionStepThresholdEnum(): … … 695 687 """ 696 688 697 return StringToEnum('InversionStepThreshold') 689 return StringToEnum('InversionStepThreshold')[0] 698 690 699 691 def InversionThicknessObsEnum(): … … 705 697 """ 706 698 707 return StringToEnum('InversionThicknessObs') 699 return StringToEnum('InversionThicknessObs')[0] 708 700 709 701 def InversionVelObsEnum(): … … 715 707 """ 716 708 717 return StringToEnum('InversionVelObs') 709 return StringToEnum('InversionVelObs')[0] 718 710 719 711 def InversionVxObsEnum(): … … 725 717 """ 726 718 727 return StringToEnum('InversionVxObs') 719 return StringToEnum('InversionVxObs')[0] 728 720 729 721 def InversionVyObsEnum(): … … 735 727 """ 736 728 737 return StringToEnum('InversionVyObs') 729 return StringToEnum('InversionVyObs')[0] 738 730 739 731 def InversionVzObsEnum(): … … 745 737 """ 746 738 747 return StringToEnum('InversionVzObs') 739 return StringToEnum('InversionVzObs')[0] 748 740 749 741 def MaskElementonfloatingiceEnum(): … … 755 747 """ 756 748 757 return StringToEnum('MaskElementonfloatingice') 749 return StringToEnum('MaskElementonfloatingice')[0] 758 750 759 751 def MaskElementongroundediceEnum(): … … 765 757 """ 766 758 767 return StringToEnum('MaskElementongroundedice') 759 return StringToEnum('MaskElementongroundedice')[0] 768 760 769 761 def MaskElementonwaterEnum(): … … 775 767 """ 776 768 777 return StringToEnum('MaskElementonwater') 769 return StringToEnum('MaskElementonwater')[0] 778 770 779 771 def MaskVertexonfloatingiceEnum(): … … 785 777 """ 786 778 787 return StringToEnum('MaskVertexonfloatingice') 779 return StringToEnum('MaskVertexonfloatingice')[0] 788 780 789 781 def MaskVertexongroundediceEnum(): … … 795 787 """ 796 788 797 return StringToEnum('MaskVertexongroundedice') 789 return StringToEnum('MaskVertexongroundedice')[0] 798 790 799 791 def MaskVertexonwaterEnum(): … … 805 797 """ 806 798 807 return StringToEnum('MaskVertexonwater') 799 return StringToEnum('MaskVertexonwater')[0] 808 800 809 801 def MaterialsBetaEnum(): … … 815 807 """ 816 808 817 return StringToEnum('MaterialsBeta') 809 return StringToEnum('MaterialsBeta')[0] 818 810 819 811 def MaterialsHeatcapacityEnum(): … … 825 817 """ 826 818 827 return StringToEnum('MaterialsHeatcapacity') 819 return StringToEnum('MaterialsHeatcapacity')[0] 828 820 829 821 def MaterialsLatentheatEnum(): … … 835 827 """ 836 828 837 return StringToEnum('MaterialsLatentheat') 829 return StringToEnum('MaterialsLatentheat')[0] 838 830 839 831 def MaterialsMeltingpointEnum(): … … 845 837 """ 846 838 847 return StringToEnum('MaterialsMeltingpoint') 839 return StringToEnum('MaterialsMeltingpoint')[0] 848 840 849 841 def MaterialsMixedLayerCapacityEnum(): … … 855 847 """ 856 848 857 return StringToEnum('MaterialsMixedLayerCapacity') 849 return StringToEnum('MaterialsMixedLayerCapacity')[0] 858 850 859 851 def MaterialsRheologyBEnum(): … … 865 857 """ 866 858 867 return StringToEnum('MaterialsRheologyB') 859 return StringToEnum('MaterialsRheologyB')[0] 868 860 869 861 def MaterialsRheologyBbarEnum(): … … 875 867 """ 876 868 877 return StringToEnum('MaterialsRheologyBbar') 869 return StringToEnum('MaterialsRheologyBbar')[0] 878 870 879 871 def MaterialsRheologyLawEnum(): … … 885 877 """ 886 878 887 return StringToEnum('MaterialsRheologyLaw') 879 return StringToEnum('MaterialsRheologyLaw')[0] 888 880 889 881 def MaterialsRheologyNEnum(): … … 895 887 """ 896 888 897 return StringToEnum('MaterialsRheologyN') 889 return StringToEnum('MaterialsRheologyN')[0] 898 890 899 891 def MaterialsRheologyZEnum(): … … 905 897 """ 906 898 907 return StringToEnum('MaterialsRheologyZ') 899 return StringToEnum('MaterialsRheologyZ')[0] 908 900 909 901 def MaterialsRheologyZbarEnum(): … … 915 907 """ 916 908 917 return StringToEnum('MaterialsRheologyZbar') 909 return StringToEnum('MaterialsRheologyZbar')[0] 918 910 919 911 def MaterialsRhoIceEnum(): … … 925 917 """ 926 918 927 return StringToEnum('MaterialsRhoIce') 919 return StringToEnum('MaterialsRhoIce')[0] 928 920 929 921 def MaterialsRhoWaterEnum(): … … 935 927 """ 936 928 937 return StringToEnum('MaterialsRhoWater') 929 return StringToEnum('MaterialsRhoWater')[0] 938 930 939 931 def MaterialsRhoFreshwaterEnum(): … … 945 937 """ 946 938 947 return StringToEnum('MaterialsRhoFreshwater') 939 return StringToEnum('MaterialsRhoFreshwater')[0] 948 940 949 941 def MaterialsMuWaterEnum(): … … 955 947 """ 956 948 957 return StringToEnum('MaterialsMuWater') 949 return StringToEnum('MaterialsMuWater')[0] 958 950 959 951 def MaterialsThermalExchangeVelocityEnum(): … … 965 957 """ 966 958 967 return StringToEnum('MaterialsThermalExchangeVelocity') 959 return StringToEnum('MaterialsThermalExchangeVelocity')[0] 968 960 969 961 def MaterialsThermalconductivityEnum(): … … 975 967 """ 976 968 977 return StringToEnum('MaterialsThermalconductivity') 969 return StringToEnum('MaterialsThermalconductivity')[0] 978 970 979 971 def MeshAverageVertexConnectivityEnum(): … … 985 977 """ 986 978 987 return StringToEnum('MeshAverageVertexConnectivity') 979 return StringToEnum('MeshAverageVertexConnectivity')[0] 988 980 989 981 def MeshDimensionEnum(): … … 995 987 """ 996 988 997 return StringToEnum('MeshDimension') 989 return StringToEnum('MeshDimension')[0] 998 990 999 991 def MeshEdgesEnum(): … … 1005 997 """ 1006 998 1007 return StringToEnum('MeshEdges') 999 return StringToEnum('MeshEdges')[0] 1008 1000 1009 1001 def MeshElementconnectivityEnum(): … … 1015 1007 """ 1016 1008 1017 return StringToEnum('MeshElementconnectivity') 1009 return StringToEnum('MeshElementconnectivity')[0] 1018 1010 1019 1011 def MeshElementonbedEnum(): … … 1025 1017 """ 1026 1018 1027 return StringToEnum('MeshElementonbed') 1019 return StringToEnum('MeshElementonbed')[0] 1028 1020 1029 1021 def MeshElementonsurfaceEnum(): … … 1035 1027 """ 1036 1028 1037 return StringToEnum('MeshElementonsurface') 1029 return StringToEnum('MeshElementonsurface')[0] 1038 1030 1039 1031 def MeshElements2dEnum(): … … 1045 1037 """ 1046 1038 1047 return StringToEnum('MeshElements2d') 1039 return StringToEnum('MeshElements2d')[0] 1048 1040 1049 1041 def MeshElementsEnum(): … … 1055 1047 """ 1056 1048 1057 return StringToEnum('MeshElements') 1049 return StringToEnum('MeshElements')[0] 1058 1050 1059 1051 def MeshLowerelementsEnum(): … … 1065 1057 """ 1066 1058 1067 return StringToEnum('MeshLowerelements') 1059 return StringToEnum('MeshLowerelements')[0] 1068 1060 1069 1061 def MeshNumberofedgesEnum(): … … 1075 1067 """ 1076 1068 1077 return StringToEnum('MeshNumberofedges') 1069 return StringToEnum('MeshNumberofedges')[0] 1078 1070 1079 1071 def MeshNumberofelements2dEnum(): … … 1085 1077 """ 1086 1078 1087 return StringToEnum('MeshNumberofelements2d') 1079 return StringToEnum('MeshNumberofelements2d')[0] 1088 1080 1089 1081 def MeshNumberofelementsEnum(): … … 1095 1087 """ 1096 1088 1097 return StringToEnum('MeshNumberofelements') 1089 return StringToEnum('MeshNumberofelements')[0] 1098 1090 1099 1091 def MeshNumberoflayersEnum(): … … 1105 1097 """ 1106 1098 1107 return StringToEnum('MeshNumberoflayers') 1099 return StringToEnum('MeshNumberoflayers')[0] 1108 1100 1109 1101 def MeshNumberofvertices2dEnum(): … … 1115 1107 """ 1116 1108 1117 return StringToEnum('MeshNumberofvertices2d') 1109 return StringToEnum('MeshNumberofvertices2d')[0] 1118 1110 1119 1111 def MeshNumberofverticesEnum(): … … 1125 1117 """ 1126 1118 1127 return StringToEnum('MeshNumberofvertices') 1119 return StringToEnum('MeshNumberofvertices')[0] 1128 1120 1129 1121 def MeshUpperelementsEnum(): … … 1135 1127 """ 1136 1128 1137 return StringToEnum('MeshUpperelements') 1129 return StringToEnum('MeshUpperelements')[0] 1138 1130 1139 1131 def MeshVertexonbedEnum(): … … 1145 1137 """ 1146 1138 1147 return StringToEnum('MeshVertexonbed') 1139 return StringToEnum('MeshVertexonbed')[0] 1148 1140 1149 1141 def MeshVertexonsurfaceEnum(): … … 1155 1147 """ 1156 1148 1157 return StringToEnum('MeshVertexonsurface') 1149 return StringToEnum('MeshVertexonsurface')[0] 1158 1150 1159 1151 def MeshXEnum(): … … 1165 1157 """ 1166 1158 1167 return StringToEnum('MeshX') 1159 return StringToEnum('MeshX')[0] 1168 1160 1169 1161 def MeshYEnum(): … … 1175 1167 """ 1176 1168 1177 return StringToEnum('MeshY') 1169 return StringToEnum('MeshY')[0] 1178 1170 1179 1171 def MeshZEnum(): … … 1185 1177 """ 1186 1178 1187 return StringToEnum('MeshZ') 1179 return StringToEnum('MeshZ')[0] 1188 1180 1189 1181 def MiscellaneousNameEnum(): … … 1195 1187 """ 1196 1188 1197 return StringToEnum('MiscellaneousName') 1189 return StringToEnum('MiscellaneousName')[0] 1198 1190 1199 1191 def PrognosticHydrostaticAdjustmentEnum(): … … 1205 1197 """ 1206 1198 1207 return StringToEnum('PrognosticHydrostaticAdjustment') 1199 return StringToEnum('PrognosticHydrostaticAdjustment')[0] 1208 1200 1209 1201 def PrognosticMinThicknessEnum(): … … 1215 1207 """ 1216 1208 1217 return StringToEnum('PrognosticMinThickness') 1209 return StringToEnum('PrognosticMinThickness')[0] 1218 1210 1219 1211 def PrognosticPenaltyFactorEnum(): … … 1225 1217 """ 1226 1218 1227 return StringToEnum('PrognosticPenaltyFactor') 1219 return StringToEnum('PrognosticPenaltyFactor')[0] 1228 1220 1229 1221 def PrognosticSpcthicknessEnum(): … … 1235 1227 """ 1236 1228 1237 return StringToEnum('PrognosticSpcthickness') 1229 return StringToEnum('PrognosticSpcthickness')[0] 1238 1230 1239 1231 def PrognosticStabilizationEnum(): … … 1245 1237 """ 1246 1238 1247 return StringToEnum('PrognosticStabilization') 1239 return StringToEnum('PrognosticStabilization')[0] 1248 1240 1249 1241 def PrognosticVertexPairingEnum(): … … 1255 1247 """ 1256 1248 1257 return StringToEnum('PrognosticVertexPairing') 1249 return StringToEnum('PrognosticVertexPairing')[0] 1258 1250 1259 1251 def QmuIsdakotaEnum(): … … 1265 1257 """ 1266 1258 1267 return StringToEnum('QmuIsdakota') 1259 return StringToEnum('QmuIsdakota')[0] 1268 1260 1269 1261 def QmuMassFluxSegmentsEnum(): … … 1275 1267 """ 1276 1268 1277 return StringToEnum('QmuMassFluxSegments') 1269 return StringToEnum('QmuMassFluxSegments')[0] 1278 1270 1279 1271 def QmuNumberofpartitionsEnum(): … … 1285 1277 """ 1286 1278 1287 return StringToEnum('QmuNumberofpartitions') 1279 return StringToEnum('QmuNumberofpartitions')[0] 1288 1280 1289 1281 def QmuNumberofresponsesEnum(): … … 1295 1287 """ 1296 1288 1297 return StringToEnum('QmuNumberofresponses') 1289 return StringToEnum('QmuNumberofresponses')[0] 1298 1290 1299 1291 def QmuPartitionEnum(): … … 1305 1297 """ 1306 1298 1307 return StringToEnum('QmuPartition') 1299 return StringToEnum('QmuPartition')[0] 1308 1300 1309 1301 def QmuResponsedescriptorsEnum(): … … 1315 1307 """ 1316 1308 1317 return StringToEnum('QmuResponsedescriptors') 1309 return StringToEnum('QmuResponsedescriptors')[0] 1318 1310 1319 1311 def QmuVariabledescriptorsEnum(): … … 1325 1317 """ 1326 1318 1327 return StringToEnum('QmuVariabledescriptors') 1319 return StringToEnum('QmuVariabledescriptors')[0] 1328 1320 1329 1321 def RiftsNumriftsEnum(): … … 1335 1327 """ 1336 1328 1337 return StringToEnum('RiftsNumrifts') 1329 return StringToEnum('RiftsNumrifts')[0] 1338 1330 1339 1331 def RiftsRiftstructEnum(): … … 1345 1337 """ 1346 1338 1347 return StringToEnum('RiftsRiftstruct') 1339 return StringToEnum('RiftsRiftstruct')[0] 1348 1340 1349 1341 def SettingsIoGatherEnum(): … … 1355 1347 """ 1356 1348 1357 return StringToEnum('SettingsIoGather') 1349 return StringToEnum('SettingsIoGather')[0] 1358 1350 1359 1351 def SettingsLowmemEnum(): … … 1365 1357 """ 1366 1358 1367 return StringToEnum('SettingsLowmem') 1359 return StringToEnum('SettingsLowmem')[0] 1368 1360 1369 1361 def SettingsOutputFrequencyEnum(): … … 1375 1367 """ 1376 1368 1377 return StringToEnum('SettingsOutputFrequency') 1369 return StringToEnum('SettingsOutputFrequency')[0] 1378 1370 1379 1371 def SettingsResultsAsPatchesEnum(): … … 1385 1377 """ 1386 1378 1387 return StringToEnum('SettingsResultsAsPatches') 1379 return StringToEnum('SettingsResultsAsPatches')[0] 1388 1380 1389 1381 def SettingsWaitonlockEnum(): … … 1395 1387 """ 1396 1388 1397 return StringToEnum('SettingsWaitonlock') 1389 return StringToEnum('SettingsWaitonlock')[0] 1398 1390 1399 1391 def SurfaceforcingsDelta18oEnum(): … … 1405 1397 """ 1406 1398 1407 return StringToEnum('SurfaceforcingsDelta18o') 1399 return StringToEnum('SurfaceforcingsDelta18o')[0] 1408 1400 1409 1401 def SurfaceforcingsDelta18oSurfaceEnum(): … … 1415 1407 """ 1416 1408 1417 return StringToEnum('SurfaceforcingsDelta18oSurface') 1409 return StringToEnum('SurfaceforcingsDelta18oSurface')[0] 1418 1410 1419 1411 def SurfaceforcingsIsdelta18oEnum(): … … 1425 1417 """ 1426 1418 1427 return StringToEnum('SurfaceforcingsIsdelta18o') 1419 return StringToEnum('SurfaceforcingsIsdelta18o')[0] 1428 1420 1429 1421 def SurfaceforcingsPrecipitationsPresentdayEnum(): … … 1435 1427 """ 1436 1428 1437 return StringToEnum('SurfaceforcingsPrecipitationsPresentday') 1429 return StringToEnum('SurfaceforcingsPrecipitationsPresentday')[0] 1438 1430 1439 1431 def SurfaceforcingsTemperaturesPresentdayEnum(): … … 1445 1437 """ 1446 1438 1447 return StringToEnum('SurfaceforcingsTemperaturesPresentday') 1439 return StringToEnum('SurfaceforcingsTemperaturesPresentday')[0] 1448 1440 1449 1441 def SurfaceforcingsTemperaturesLgmEnum(): … … 1455 1447 """ 1456 1448 1457 return StringToEnum('SurfaceforcingsTemperaturesLgm') 1449 return StringToEnum('SurfaceforcingsTemperaturesLgm')[0] 1458 1450 1459 1451 def DebugProfilingEnum(): … … 1465 1457 """ 1466 1458 1467 return StringToEnum('DebugProfiling') 1459 return StringToEnum('DebugProfiling')[0] 1468 1460 1469 1461 def ProfilingCurrentMemEnum(): … … 1475 1467 """ 1476 1468 1477 return StringToEnum('ProfilingCurrentMem') 1469 return StringToEnum('ProfilingCurrentMem')[0] 1478 1470 1479 1471 def ProfilingCurrentFlopsEnum(): … … 1485 1477 """ 1486 1478 1487 return StringToEnum('ProfilingCurrentFlops') 1479 return StringToEnum('ProfilingCurrentFlops')[0] 1488 1480 1489 1481 def ProfilingSolutionTimeEnum(): … … 1495 1487 """ 1496 1488 1497 return StringToEnum('ProfilingSolutionTime') 1489 return StringToEnum('ProfilingSolutionTime')[0] 1498 1490 1499 1491 def MaxIterationConvergenceFlagEnum(): … … 1505 1497 """ 1506 1498 1507 return StringToEnum('MaxIterationConvergenceFlag') 1499 return StringToEnum('MaxIterationConvergenceFlag')[0] 1508 1500 1509 1501 def SteadystateMaxiterEnum(): … … 1515 1507 """ 1516 1508 1517 return StringToEnum('SteadystateMaxiter') 1509 return StringToEnum('SteadystateMaxiter')[0] 1518 1510 1519 1511 def SteadystateNumRequestedOutputsEnum(): … … 1525 1517 """ 1526 1518 1527 return StringToEnum('SteadystateNumRequestedOutputs') 1519 return StringToEnum('SteadystateNumRequestedOutputs')[0] 1528 1520 1529 1521 def SteadystateReltolEnum(): … … 1535 1527 """ 1536 1528 1537 return StringToEnum('SteadystateReltol') 1529 return StringToEnum('SteadystateReltol')[0] 1538 1530 1539 1531 def SteadystateRequestedOutputsEnum(): … … 1545 1537 """ 1546 1538 1547 return StringToEnum('SteadystateRequestedOutputs') 1539 return StringToEnum('SteadystateRequestedOutputs')[0] 1548 1540 1549 1541 def SurfaceEnum(): … … 1555 1547 """ 1556 1548 1557 return StringToEnum('Surface') 1549 return StringToEnum('Surface')[0] 1558 1550 1559 1551 def SurfaceforcingsPrecipitationEnum(): … … 1565 1557 """ 1566 1558 1567 return StringToEnum('SurfaceforcingsPrecipitation') 1559 return StringToEnum('SurfaceforcingsPrecipitation')[0] 1568 1560 1569 1561 def SurfaceforcingsMassBalanceEnum(): … … 1575 1567 """ 1576 1568 1577 return StringToEnum('SurfaceforcingsMassBalance') 1569 return StringToEnum('SurfaceforcingsMassBalance')[0] 1578 1570 1579 1571 def SurfaceforcingsIspddEnum(): … … 1585 1577 """ 1586 1578 1587 return StringToEnum('SurfaceforcingsIspdd') 1579 return StringToEnum('SurfaceforcingsIspdd')[0] 1588 1580 1589 1581 def SurfaceforcingsIssmbgradientsEnum(): … … 1595 1587 """ 1596 1588 1597 return StringToEnum('SurfaceforcingsIssmbgradients') 1589 return StringToEnum('SurfaceforcingsIssmbgradients')[0] 1598 1590 1599 1591 def SurfaceforcingsMonthlytemperaturesEnum(): … … 1605 1597 """ 1606 1598 1607 return StringToEnum('SurfaceforcingsMonthlytemperatures') 1599 return StringToEnum('SurfaceforcingsMonthlytemperatures')[0] 1608 1600 1609 1601 def SurfaceforcingsHcEnum(): … … 1615 1607 """ 1616 1608 1617 return StringToEnum('SurfaceforcingsHc') 1609 return StringToEnum('SurfaceforcingsHc')[0] 1618 1610 1619 1611 def SurfaceforcingsSmbPosMaxEnum(): … … 1625 1617 """ 1626 1618 1627 return StringToEnum('SurfaceforcingsSmbPosMax') 1619 return StringToEnum('SurfaceforcingsSmbPosMax')[0] 1628 1620 1629 1621 def SurfaceforcingsSmbPosMinEnum(): … … 1635 1627 """ 1636 1628 1637 return StringToEnum('SurfaceforcingsSmbPosMin') 1629 return StringToEnum('SurfaceforcingsSmbPosMin')[0] 1638 1630 1639 1631 def SurfaceforcingsAPosEnum(): … … 1645 1637 """ 1646 1638 1647 return StringToEnum('SurfaceforcingsAPos') 1639 return StringToEnum('SurfaceforcingsAPos')[0] 1648 1640 1649 1641 def SurfaceforcingsBPosEnum(): … … 1655 1647 """ 1656 1648 1657 return StringToEnum('SurfaceforcingsBPos') 1649 return StringToEnum('SurfaceforcingsBPos')[0] 1658 1650 1659 1651 def SurfaceforcingsANegEnum(): … … 1665 1657 """ 1666 1658 1667 return StringToEnum('SurfaceforcingsANeg') 1659 return StringToEnum('SurfaceforcingsANeg')[0] 1668 1660 1669 1661 def SurfaceforcingsBNegEnum(): … … 1675 1667 """ 1676 1668 1677 return StringToEnum('SurfaceforcingsBNeg') 1669 return StringToEnum('SurfaceforcingsBNeg')[0] 1678 1670 1679 1671 def ThermalMaxiterEnum(): … … 1685 1677 """ 1686 1678 1687 return StringToEnum('ThermalMaxiter') 1679 return StringToEnum('ThermalMaxiter')[0] 1688 1680 1689 1681 def ThermalPenaltyFactorEnum(): … … 1695 1687 """ 1696 1688 1697 return StringToEnum('ThermalPenaltyFactor') 1689 return StringToEnum('ThermalPenaltyFactor')[0] 1698 1690 1699 1691 def ThermalPenaltyLockEnum(): … … 1705 1697 """ 1706 1698 1707 return StringToEnum('ThermalPenaltyLock') 1699 return StringToEnum('ThermalPenaltyLock')[0] 1708 1700 1709 1701 def ThermalPenaltyThresholdEnum(): … … 1715 1707 """ 1716 1708 1717 return StringToEnum('ThermalPenaltyThreshold') 1709 return StringToEnum('ThermalPenaltyThreshold')[0] 1718 1710 1719 1711 def ThermalSpctemperatureEnum(): … … 1725 1717 """ 1726 1718 1727 return StringToEnum('ThermalSpctemperature') 1719 return StringToEnum('ThermalSpctemperature')[0] 1728 1720 1729 1721 def ThermalStabilizationEnum(): … … 1735 1727 """ 1736 1728 1737 return StringToEnum('ThermalStabilization') 1729 return StringToEnum('ThermalStabilization')[0] 1738 1730 1739 1731 def ThermalIsenthalpyEnum(): … … 1745 1737 """ 1746 1738 1747 return StringToEnum('ThermalIsenthalpy') 1739 return StringToEnum('ThermalIsenthalpy')[0] 1748 1740 1749 1741 def ThicknessEnum(): … … 1755 1747 """ 1756 1748 1757 return StringToEnum('Thickness') 1749 return StringToEnum('Thickness')[0] 1758 1750 1759 1751 def TimesteppingStartTimeEnum(): … … 1765 1757 """ 1766 1758 1767 return StringToEnum('TimesteppingStartTime') 1759 return StringToEnum('TimesteppingStartTime')[0] 1768 1760 1769 1761 def TimesteppingFinalTimeEnum(): … … 1775 1767 """ 1776 1768 1777 return StringToEnum('TimesteppingFinalTime') 1769 return StringToEnum('TimesteppingFinalTime')[0] 1778 1770 1779 1771 def TimesteppingCflCoefficientEnum(): … … 1785 1777 """ 1786 1778 1787 return StringToEnum('TimesteppingCflCoefficient') 1779 return StringToEnum('TimesteppingCflCoefficient')[0] 1788 1780 1789 1781 def TimesteppingTimeAdaptEnum(): … … 1795 1787 """ 1796 1788 1797 return StringToEnum('TimesteppingTimeAdapt') 1789 return StringToEnum('TimesteppingTimeAdapt')[0] 1798 1790 1799 1791 def TimesteppingTimeStepEnum(): … … 1805 1797 """ 1806 1798 1807 return StringToEnum('TimesteppingTimeStep') 1799 return StringToEnum('TimesteppingTimeStep')[0] 1808 1800 1809 1801 def TransientIsdiagnosticEnum(): … … 1815 1807 """ 1816 1808 1817 return StringToEnum('TransientIsdiagnostic') 1809 return StringToEnum('TransientIsdiagnostic')[0] 1818 1810 1819 1811 def TransientIsgroundinglineEnum(): … … 1825 1817 """ 1826 1818 1827 return StringToEnum('TransientIsgroundingline') 1819 return StringToEnum('TransientIsgroundingline')[0] 1828 1820 1829 1821 def TransientIsprognosticEnum(): … … 1835 1827 """ 1836 1828 1837 return StringToEnum('TransientIsprognostic') 1829 return StringToEnum('TransientIsprognostic')[0] 1838 1830 1839 1831 def TransientIsthermalEnum(): … … 1845 1837 """ 1846 1838 1847 return StringToEnum('TransientIsthermal') 1839 return StringToEnum('TransientIsthermal')[0] 1848 1840 1849 1841 def TransientNumRequestedOutputsEnum(): … … 1855 1847 """ 1856 1848 1857 return StringToEnum('TransientNumRequestedOutputs') 1849 return StringToEnum('TransientNumRequestedOutputs')[0] 1858 1850 1859 1851 def TransientRequestedOutputsEnum(): … … 1865 1857 """ 1866 1858 1867 return StringToEnum('TransientRequestedOutputs') 1859 return StringToEnum('TransientRequestedOutputs')[0] 1868 1860 1869 1861 def SolutionTypeEnum(): … … 1875 1867 """ 1876 1868 1877 return StringToEnum('SolutionType') 1869 return StringToEnum('SolutionType')[0] 1878 1870 1879 1871 def AnalysisTypeEnum(): … … 1885 1877 """ 1886 1878 1887 return StringToEnum('AnalysisType') 1879 return StringToEnum('AnalysisType')[0] 1888 1880 1889 1881 def ConfigurationTypeEnum(): … … 1895 1887 """ 1896 1888 1897 return StringToEnum('ConfigurationType') 1889 return StringToEnum('ConfigurationType')[0] 1898 1890 1899 1891 def AdjointBalancethicknessAnalysisEnum(): … … 1905 1897 """ 1906 1898 1907 return StringToEnum('AdjointBalancethicknessAnalysis') 1899 return StringToEnum('AdjointBalancethicknessAnalysis')[0] 1908 1900 1909 1901 def AdjointHorizAnalysisEnum(): … … 1915 1907 """ 1916 1908 1917 return StringToEnum('AdjointHorizAnalysis') 1909 return StringToEnum('AdjointHorizAnalysis')[0] 1918 1910 1919 1911 def AdjointSolutionEnum(): … … 1925 1917 """ 1926 1918 1927 return StringToEnum('AdjointSolution') 1919 return StringToEnum('AdjointSolution')[0] 1928 1920 1929 1921 def AnalysisCounterEnum(): … … 1935 1927 """ 1936 1928 1937 return StringToEnum('AnalysisCounter') 1929 return StringToEnum('AnalysisCounter')[0] 1938 1930 1939 1931 def BalancethicknessAnalysisEnum(): … … 1945 1937 """ 1946 1938 1947 return StringToEnum('BalancethicknessAnalysis') 1939 return StringToEnum('BalancethicknessAnalysis')[0] 1948 1940 1949 1941 def BalancethicknessSolutionEnum(): … … 1955 1947 """ 1956 1948 1957 return StringToEnum('BalancethicknessSolution') 1949 return StringToEnum('BalancethicknessSolution')[0] 1958 1950 1959 1951 def BedSlopeAnalysisEnum(): … … 1965 1957 """ 1966 1958 1967 return StringToEnum('BedSlopeAnalysis') 1959 return StringToEnum('BedSlopeAnalysis')[0] 1968 1960 1969 1961 def BedSlopeSolutionEnum(): … … 1975 1967 """ 1976 1968 1977 return StringToEnum('BedSlopeSolution') 1969 return StringToEnum('BedSlopeSolution')[0] 1978 1970 1979 1971 def BedSlopeXAnalysisEnum(): … … 1985 1977 """ 1986 1978 1987 return StringToEnum('BedSlopeXAnalysis') 1979 return StringToEnum('BedSlopeXAnalysis')[0] 1988 1980 1989 1981 def BedSlopeYAnalysisEnum(): … … 1995 1987 """ 1996 1988 1997 return StringToEnum('BedSlopeYAnalysis') 1989 return StringToEnum('BedSlopeYAnalysis')[0] 1998 1990 1999 1991 def DiagnosticHorizAnalysisEnum(): … … 2005 1997 """ 2006 1998 2007 return StringToEnum('DiagnosticHorizAnalysis') 1999 return StringToEnum('DiagnosticHorizAnalysis')[0] 2008 2000 2009 2001 def DiagnosticHutterAnalysisEnum(): … … 2015 2007 """ 2016 2008 2017 return StringToEnum('DiagnosticHutterAnalysis') 2009 return StringToEnum('DiagnosticHutterAnalysis')[0] 2018 2010 2019 2011 def DiagnosticSolutionEnum(): … … 2025 2017 """ 2026 2018 2027 return StringToEnum('DiagnosticSolution') 2019 return StringToEnum('DiagnosticSolution')[0] 2028 2020 2029 2021 def DiagnosticVertAnalysisEnum(): … … 2035 2027 """ 2036 2028 2037 return StringToEnum('DiagnosticVertAnalysis') 2029 return StringToEnum('DiagnosticVertAnalysis')[0] 2038 2030 2039 2031 def EnthalpyAnalysisEnum(): … … 2045 2037 """ 2046 2038 2047 return StringToEnum('EnthalpyAnalysis') 2039 return StringToEnum('EnthalpyAnalysis')[0] 2048 2040 2049 2041 def EnthalpySolutionEnum(): … … 2055 2047 """ 2056 2048 2057 return StringToEnum('EnthalpySolution') 2049 return StringToEnum('EnthalpySolution')[0] 2058 2050 2059 2051 def FlaimAnalysisEnum(): … … 2065 2057 """ 2066 2058 2067 return StringToEnum('FlaimAnalysis') 2059 return StringToEnum('FlaimAnalysis')[0] 2068 2060 2069 2061 def FlaimSolutionEnum(): … … 2075 2067 """ 2076 2068 2077 return StringToEnum('FlaimSolution') 2069 return StringToEnum('FlaimSolution')[0] 2078 2070 2079 2071 def HydrologyAnalysisEnum(): … … 2085 2077 """ 2086 2078 2087 return StringToEnum('HydrologyAnalysis') 2079 return StringToEnum('HydrologyAnalysis')[0] 2088 2080 2089 2081 def HydrologySolutionEnum(): … … 2095 2087 """ 2096 2088 2097 return StringToEnum('HydrologySolution') 2089 return StringToEnum('HydrologySolution')[0] 2098 2090 2099 2091 def MeltingAnalysisEnum(): … … 2105 2097 """ 2106 2098 2107 return StringToEnum('MeltingAnalysis') 2099 return StringToEnum('MeltingAnalysis')[0] 2108 2100 2109 2101 def NoneAnalysisEnum(): … … 2115 2107 """ 2116 2108 2117 return StringToEnum('NoneAnalysis') 2109 return StringToEnum('NoneAnalysis')[0] 2118 2110 2119 2111 def PrognosticAnalysisEnum(): … … 2125 2117 """ 2126 2118 2127 return StringToEnum('PrognosticAnalysis') 2119 return StringToEnum('PrognosticAnalysis')[0] 2128 2120 2129 2121 def PrognosticSolutionEnum(): … … 2135 2127 """ 2136 2128 2137 return StringToEnum('PrognosticSolution') 2129 return StringToEnum('PrognosticSolution')[0] 2138 2130 2139 2131 def SteadystateSolutionEnum(): … … 2145 2137 """ 2146 2138 2147 return StringToEnum('SteadystateSolution') 2139 return StringToEnum('SteadystateSolution')[0] 2148 2140 2149 2141 def SurfaceSlopeAnalysisEnum(): … … 2155 2147 """ 2156 2148 2157 return StringToEnum('SurfaceSlopeAnalysis') 2149 return StringToEnum('SurfaceSlopeAnalysis')[0] 2158 2150 2159 2151 def SurfaceSlopeSolutionEnum(): … … 2165 2157 """ 2166 2158 2167 return StringToEnum('SurfaceSlopeSolution') 2159 return StringToEnum('SurfaceSlopeSolution')[0] 2168 2160 2169 2161 def SurfaceSlopeXAnalysisEnum(): … … 2175 2167 """ 2176 2168 2177 return StringToEnum('SurfaceSlopeXAnalysis') 2169 return StringToEnum('SurfaceSlopeXAnalysis')[0] 2178 2170 2179 2171 def SurfaceSlopeYAnalysisEnum(): … … 2185 2177 """ 2186 2178 2187 return StringToEnum('SurfaceSlopeYAnalysis') 2179 return StringToEnum('SurfaceSlopeYAnalysis')[0] 2188 2180 2189 2181 def ThermalAnalysisEnum(): … … 2195 2187 """ 2196 2188 2197 return StringToEnum('ThermalAnalysis') 2189 return StringToEnum('ThermalAnalysis')[0] 2198 2190 2199 2191 def ThermalSolutionEnum(): … … 2205 2197 """ 2206 2198 2207 return StringToEnum('ThermalSolution') 2199 return StringToEnum('ThermalSolution')[0] 2208 2200 2209 2201 def TransientSolutionEnum(): … … 2215 2207 """ 2216 2208 2217 return StringToEnum('TransientSolution') 2209 return StringToEnum('TransientSolution')[0] 2218 2210 2219 2211 def ApproximationEnum(): … … 2225 2217 """ 2226 2218 2227 return StringToEnum('Approximation') 2219 return StringToEnum('Approximation')[0] 2220 2221 def NoneApproximationEnum(): 2222 """ 2223 NONEAPPROXIMATIONENUM - Enum of NoneApproximation 2224 2225 Usage: 2226 macro=NoneApproximationEnum() 2227 """ 2228 2229 return StringToEnum('NoneApproximation')[0] 2228 2230 2229 2231 def HutterApproximationEnum(): … … 2235 2237 """ 2236 2238 2237 return StringToEnum('HutterApproximation') 2239 return StringToEnum('HutterApproximation')[0] 2238 2240 2239 2241 def MacAyealApproximationEnum(): … … 2245 2247 """ 2246 2248 2247 return StringToEnum('MacAyealApproximation') 2249 return StringToEnum('MacAyealApproximation')[0] 2248 2250 2249 2251 def MacAyealPattynApproximationEnum(): … … 2255 2257 """ 2256 2258 2257 return StringToEnum('MacAyealPattynApproximation') 2259 return StringToEnum('MacAyealPattynApproximation')[0] 2258 2260 2259 2261 def MacAyealStokesApproximationEnum(): … … 2265 2267 """ 2266 2268 2267 return StringToEnum('MacAyealStokesApproximation') 2268 2269 def NoneApproximationEnum():2270 """ 2271 NONEAPPROXIMATIONENUM - Enum of NoneApproximation2272 2273 Usage: 2274 macro= NoneApproximationEnum()2275 """ 2276 2277 return StringToEnum(' NoneApproximation')2269 return StringToEnum('MacAyealStokesApproximation')[0] 2270 2271 def L1L2ApproximationEnum(): 2272 """ 2273 L1L2APPROXIMATIONENUM - Enum of L1L2Approximation 2274 2275 Usage: 2276 macro=L1L2ApproximationEnum() 2277 """ 2278 2279 return StringToEnum('L1L2Approximation')[0] 2278 2280 2279 2281 def PattynApproximationEnum(): … … 2285 2287 """ 2286 2288 2287 return StringToEnum('PattynApproximation') 2289 return StringToEnum('PattynApproximation')[0] 2288 2290 2289 2291 def PattynStokesApproximationEnum(): … … 2295 2297 """ 2296 2298 2297 return StringToEnum('PattynStokesApproximation') 2299 return StringToEnum('PattynStokesApproximation')[0] 2298 2300 2299 2301 def StokesApproximationEnum(): … … 2305 2307 """ 2306 2308 2307 return StringToEnum('StokesApproximation') 2309 return StringToEnum('StokesApproximation')[0] 2308 2310 2309 2311 def ConstraintsEnum(): … … 2315 2317 """ 2316 2318 2317 return StringToEnum('Constraints') 2319 return StringToEnum('Constraints')[0] 2318 2320 2319 2321 def LoadsEnum(): … … 2325 2327 """ 2326 2328 2327 return StringToEnum('Loads') 2329 return StringToEnum('Loads')[0] 2328 2330 2329 2331 def MaterialsEnum(): … … 2335 2337 """ 2336 2338 2337 return StringToEnum('Materials') 2339 return StringToEnum('Materials')[0] 2338 2340 2339 2341 def NodesEnum(): … … 2345 2347 """ 2346 2348 2347 return StringToEnum('Nodes') 2349 return StringToEnum('Nodes')[0] 2348 2350 2349 2351 def ParametersEnum(): … … 2355 2357 """ 2356 2358 2357 return StringToEnum('Parameters') 2359 return StringToEnum('Parameters')[0] 2358 2360 2359 2361 def VerticesEnum(): … … 2365 2367 """ 2366 2368 2367 return StringToEnum('Vertices') 2369 return StringToEnum('Vertices')[0] 2368 2370 2369 2371 def ResultsEnum(): … … 2375 2377 """ 2376 2378 2377 return StringToEnum('Results') 2379 return StringToEnum('Results')[0] 2378 2380 2379 2381 def BoolInputEnum(): … … 2385 2387 """ 2386 2388 2387 return StringToEnum('BoolInput') 2389 return StringToEnum('BoolInput')[0] 2388 2390 2389 2391 def BoolParamEnum(): … … 2395 2397 """ 2396 2398 2397 return StringToEnum('BoolParam') 2399 return StringToEnum('BoolParam')[0] 2398 2400 2399 2401 def ContourEnum(): … … 2405 2407 """ 2406 2408 2407 return StringToEnum('Contour') 2409 return StringToEnum('Contour')[0] 2408 2410 2409 2411 def ControlInputEnum(): … … 2415 2417 """ 2416 2418 2417 return StringToEnum('ControlInput') 2419 return StringToEnum('ControlInput')[0] 2418 2420 2419 2421 def DatasetInputEnum(): … … 2425 2427 """ 2426 2428 2427 return StringToEnum('DatasetInput') 2429 return StringToEnum('DatasetInput')[0] 2428 2430 2429 2431 def DofIndexingEnum(): … … 2435 2437 """ 2436 2438 2437 return StringToEnum('DofIndexing') 2439 return StringToEnum('DofIndexing')[0] 2438 2440 2439 2441 def DoubleInputEnum(): … … 2445 2447 """ 2446 2448 2447 return StringToEnum('DoubleInput') 2449 return StringToEnum('DoubleInput')[0] 2448 2450 2449 2451 def DoubleMatArrayParamEnum(): … … 2455 2457 """ 2456 2458 2457 return StringToEnum('DoubleMatArrayParam') 2459 return StringToEnum('DoubleMatArrayParam')[0] 2458 2460 2459 2461 def DoubleMatParamEnum(): … … 2465 2467 """ 2466 2468 2467 return StringToEnum('DoubleMatParam') 2469 return StringToEnum('DoubleMatParam')[0] 2468 2470 2469 2471 def DoubleParamEnum(): … … 2475 2477 """ 2476 2478 2477 return StringToEnum('DoubleParam') 2479 return StringToEnum('DoubleParam')[0] 2478 2480 2479 2481 def DoubleVecParamEnum(): … … 2485 2487 """ 2486 2488 2487 return StringToEnum('DoubleVecParam') 2489 return StringToEnum('DoubleVecParam')[0] 2488 2490 2489 2491 def ElementEnum(): … … 2495 2497 """ 2496 2498 2497 return StringToEnum('Element') 2499 return StringToEnum('Element')[0] 2498 2500 2499 2501 def ElementResultEnum(): … … 2505 2507 """ 2506 2508 2507 return StringToEnum('ElementResult') 2509 return StringToEnum('ElementResult')[0] 2508 2510 2509 2511 def ExternalResultEnum(): … … 2515 2517 """ 2516 2518 2517 return StringToEnum('ExternalResult') 2519 return StringToEnum('ExternalResult')[0] 2518 2520 2519 2521 def FileParamEnum(): … … 2525 2527 """ 2526 2528 2527 return StringToEnum('FileParam') 2529 return StringToEnum('FileParam')[0] 2528 2530 2529 2531 def HookEnum(): … … 2535 2537 """ 2536 2538 2537 return StringToEnum('Hook') 2539 return StringToEnum('Hook')[0] 2538 2540 2539 2541 def IcefrontEnum(): … … 2545 2547 """ 2546 2548 2547 return StringToEnum('Icefront') 2549 return StringToEnum('Icefront')[0] 2548 2550 2549 2551 def InputEnum(): … … 2555 2557 """ 2556 2558 2557 return StringToEnum('Input') 2559 return StringToEnum('Input')[0] 2558 2560 2559 2561 def IntInputEnum(): … … 2565 2567 """ 2566 2568 2567 return StringToEnum('IntInput') 2569 return StringToEnum('IntInput')[0] 2568 2570 2569 2571 def IntParamEnum(): … … 2575 2577 """ 2576 2578 2577 return StringToEnum('IntParam') 2579 return StringToEnum('IntParam')[0] 2578 2580 2579 2581 def IntVecParamEnum(): … … 2585 2587 """ 2586 2588 2587 return StringToEnum('IntVecParam') 2589 return StringToEnum('IntVecParam')[0] 2588 2590 2589 2591 def TransientParamEnum(): … … 2595 2597 """ 2596 2598 2597 return StringToEnum('TransientParam') 2599 return StringToEnum('TransientParam')[0] 2598 2600 2599 2601 def MacAyeal2dIceFrontEnum(): … … 2605 2607 """ 2606 2608 2607 return StringToEnum('MacAyeal2dIceFront') 2609 return StringToEnum('MacAyeal2dIceFront')[0] 2608 2610 2609 2611 def MacAyeal3dIceFrontEnum(): … … 2615 2617 """ 2616 2618 2617 return StringToEnum('MacAyeal3dIceFront') 2619 return StringToEnum('MacAyeal3dIceFront')[0] 2618 2620 2619 2621 def MaticeEnum(): … … 2625 2627 """ 2626 2628 2627 return StringToEnum('Matice') 2629 return StringToEnum('Matice')[0] 2628 2630 2629 2631 def MatparEnum(): … … 2635 2637 """ 2636 2638 2637 return StringToEnum('Matpar') 2639 return StringToEnum('Matpar')[0] 2638 2640 2639 2641 def NodeEnum(): … … 2645 2647 """ 2646 2648 2647 return StringToEnum('Node') 2649 return StringToEnum('Node')[0] 2648 2650 2649 2651 def NumericalfluxEnum(): … … 2655 2657 """ 2656 2658 2657 return StringToEnum('Numericalflux') 2659 return StringToEnum('Numericalflux')[0] 2658 2660 2659 2661 def ParamEnum(): … … 2665 2667 """ 2666 2668 2667 return StringToEnum('Param') 2669 return StringToEnum('Param')[0] 2670 2671 def L1L2IceFrontEnum(): 2672 """ 2673 L1L2ICEFRONTENUM - Enum of L1L2IceFront 2674 2675 Usage: 2676 macro=L1L2IceFrontEnum() 2677 """ 2678 2679 return StringToEnum('L1L2IceFront')[0] 2668 2680 2669 2681 def PattynIceFrontEnum(): … … 2675 2687 """ 2676 2688 2677 return StringToEnum('PattynIceFront') 2689 return StringToEnum('PattynIceFront')[0] 2678 2690 2679 2691 def PengridEnum(): … … 2685 2697 """ 2686 2698 2687 return StringToEnum('Pengrid') 2699 return StringToEnum('Pengrid')[0] 2688 2700 2689 2701 def PenpairEnum(): … … 2695 2707 """ 2696 2708 2697 return StringToEnum('Penpair') 2709 return StringToEnum('Penpair')[0] 2698 2710 2699 2711 def PentaEnum(): … … 2705 2717 """ 2706 2718 2707 return StringToEnum('Penta') 2719 return StringToEnum('Penta')[0] 2708 2720 2709 2721 def PentaP1InputEnum(): … … 2715 2727 """ 2716 2728 2717 return StringToEnum('PentaP1Input') 2729 return StringToEnum('PentaP1Input')[0] 2718 2730 2719 2731 def MatrixParamEnum(): … … 2725 2737 """ 2726 2738 2727 return StringToEnum('MatrixParam') 2739 return StringToEnum('MatrixParam')[0] 2728 2740 2729 2741 def VectorParamEnum(): … … 2735 2747 """ 2736 2748 2737 return StringToEnum('VectorParam') 2749 return StringToEnum('VectorParam')[0] 2738 2750 2739 2751 def RiftfrontEnum(): … … 2745 2757 """ 2746 2758 2747 return StringToEnum('Riftfront') 2759 return StringToEnum('Riftfront')[0] 2748 2760 2749 2761 def SegmentEnum(): … … 2755 2767 """ 2756 2768 2757 return StringToEnum('Segment') 2769 return StringToEnum('Segment')[0] 2758 2770 2759 2771 def SegmentRiftfrontEnum(): … … 2765 2777 """ 2766 2778 2767 return StringToEnum('SegmentRiftfront') 2779 return StringToEnum('SegmentRiftfront')[0] 2768 2780 2769 2781 def SpcDynamicEnum(): … … 2775 2787 """ 2776 2788 2777 return StringToEnum('SpcDynamic') 2789 return StringToEnum('SpcDynamic')[0] 2778 2790 2779 2791 def SpcStaticEnum(): … … 2785 2797 """ 2786 2798 2787 return StringToEnum('SpcStatic') 2799 return StringToEnum('SpcStatic')[0] 2788 2800 2789 2801 def SpcTransientEnum(): … … 2795 2807 """ 2796 2808 2797 return StringToEnum('SpcTransient') 2809 return StringToEnum('SpcTransient')[0] 2798 2810 2799 2811 def StokesIceFrontEnum(): … … 2805 2817 """ 2806 2818 2807 return StringToEnum('StokesIceFront') 2819 return StringToEnum('StokesIceFront')[0] 2808 2820 2809 2821 def StringArrayParamEnum(): … … 2815 2827 """ 2816 2828 2817 return StringToEnum('StringArrayParam') 2829 return StringToEnum('StringArrayParam')[0] 2818 2830 2819 2831 def StringParamEnum(): … … 2825 2837 """ 2826 2838 2827 return StringToEnum('StringParam') 2839 return StringToEnum('StringParam')[0] 2828 2840 2829 2841 def TriaEnum(): … … 2835 2847 """ 2836 2848 2837 return StringToEnum('Tria') 2849 return StringToEnum('Tria')[0] 2838 2850 2839 2851 def TriaP1InputEnum(): … … 2845 2857 """ 2846 2858 2847 return StringToEnum('TriaP1Input') 2859 return StringToEnum('TriaP1Input')[0] 2848 2860 2849 2861 def VertexEnum(): … … 2855 2867 """ 2856 2868 2857 return StringToEnum('Vertex') 2869 return StringToEnum('Vertex')[0] 2858 2870 2859 2871 def AirEnum(): … … 2865 2877 """ 2866 2878 2867 return StringToEnum('Air') 2879 return StringToEnum('Air')[0] 2868 2880 2869 2881 def IceEnum(): … … 2875 2887 """ 2876 2888 2877 return StringToEnum('Ice') 2889 return StringToEnum('Ice')[0] 2878 2890 2879 2891 def MelangeEnum(): … … 2885 2897 """ 2886 2898 2887 return StringToEnum('Melange') 2899 return StringToEnum('Melange')[0] 2888 2900 2889 2901 def WaterEnum(): … … 2895 2907 """ 2896 2908 2897 return StringToEnum('Water') 2909 return StringToEnum('Water')[0] 2898 2910 2899 2911 def ClosedEnum(): … … 2905 2917 """ 2906 2918 2907 return StringToEnum('Closed') 2919 return StringToEnum('Closed')[0] 2908 2920 2909 2921 def FreeEnum(): … … 2915 2927 """ 2916 2928 2917 return StringToEnum('Free') 2929 return StringToEnum('Free')[0] 2918 2930 2919 2931 def OpenEnum(): … … 2925 2937 """ 2926 2938 2927 return StringToEnum('Open') 2939 return StringToEnum('Open')[0] 2928 2940 2929 2941 def AdjointpEnum(): … … 2935 2947 """ 2936 2948 2937 return StringToEnum('Adjointp') 2949 return StringToEnum('Adjointp')[0] 2938 2950 2939 2951 def AdjointxEnum(): … … 2945 2957 """ 2946 2958 2947 return StringToEnum('Adjointx') 2959 return StringToEnum('Adjointx')[0] 2948 2960 2949 2961 def AdjointyEnum(): … … 2955 2967 """ 2956 2968 2957 return StringToEnum('Adjointy') 2969 return StringToEnum('Adjointy')[0] 2958 2970 2959 2971 def AdjointzEnum(): … … 2965 2977 """ 2966 2978 2967 return StringToEnum('Adjointz') 2979 return StringToEnum('Adjointz')[0] 2968 2980 2969 2981 def BedSlopeXEnum(): … … 2975 2987 """ 2976 2988 2977 return StringToEnum('BedSlopeX') 2989 return StringToEnum('BedSlopeX')[0] 2978 2990 2979 2991 def BedSlopeYEnum(): … … 2985 2997 """ 2986 2998 2987 return StringToEnum('BedSlopeY') 2999 return StringToEnum('BedSlopeY')[0] 2988 3000 2989 3001 def BoundaryEnum(): … … 2995 3007 """ 2996 3008 2997 return StringToEnum('Boundary') 3009 return StringToEnum('Boundary')[0] 2998 3010 2999 3011 def ConstantEnum(): … … 3005 3017 """ 3006 3018 3007 return StringToEnum('Constant') 3019 return StringToEnum('Constant')[0] 3008 3020 3009 3021 def ConvergedEnum(): … … 3015 3027 """ 3016 3028 3017 return StringToEnum('Converged') 3029 return StringToEnum('Converged')[0] 3018 3030 3019 3031 def ExtToIuEnum(): … … 3025 3037 """ 3026 3038 3027 return StringToEnum('ExtToIu') 3039 return StringToEnum('ExtToIu')[0] 3028 3040 3029 3041 def FillEnum(): … … 3035 3047 """ 3036 3048 3037 return StringToEnum('Fill') 3049 return StringToEnum('Fill')[0] 3038 3050 3039 3051 def FractionIncrementEnum(): … … 3045 3057 """ 3046 3058 3047 return StringToEnum('FractionIncrement') 3059 return StringToEnum('FractionIncrement')[0] 3048 3060 3049 3061 def FrictionEnum(): … … 3055 3067 """ 3056 3068 3057 return StringToEnum('Friction') 3069 return StringToEnum('Friction')[0] 3058 3070 3059 3071 def GroundinglineMeltingRateEnum(): … … 3065 3077 """ 3066 3078 3067 return StringToEnum('GroundinglineMeltingRate') 3079 return StringToEnum('GroundinglineMeltingRate')[0] 3068 3080 3069 3081 def InternalEnum(): … … 3075 3087 """ 3076 3088 3077 return StringToEnum('Internal') 3089 return StringToEnum('Internal')[0] 3078 3090 3079 3091 def IuToExtEnum(): … … 3085 3097 """ 3086 3098 3087 return StringToEnum('IuToExt') 3099 return StringToEnum('IuToExt')[0] 3088 3100 3089 3101 def MassFluxEnum(): … … 3095 3107 """ 3096 3108 3097 return StringToEnum('MassFlux') 3109 return StringToEnum('MassFlux')[0] 3098 3110 3099 3111 def MaxPenetrationEnum(): … … 3105 3117 """ 3106 3118 3107 return StringToEnum('MaxPenetration') 3119 return StringToEnum('MaxPenetration')[0] 3108 3120 3109 3121 def MeltingOffsetEnum(): … … 3115 3127 """ 3116 3128 3117 return StringToEnum('MeltingOffset') 3129 return StringToEnum('MeltingOffset')[0] 3118 3130 3119 3131 def MisfitEnum(): … … 3125 3137 """ 3126 3138 3127 return StringToEnum('Misfit') 3139 return StringToEnum('Misfit')[0] 3128 3140 3129 3141 def NumberNodeToElementConnectivityEnum(): … … 3135 3147 """ 3136 3148 3137 return StringToEnum('NumberNodeToElementConnectivity') 3149 return StringToEnum('NumberNodeToElementConnectivity')[0] 3138 3150 3139 3151 def PressureEnum(): … … 3145 3157 """ 3146 3158 3147 return StringToEnum('Pressure') 3159 return StringToEnum('Pressure')[0] 3148 3160 3149 3161 def PressurePicardEnum(): … … 3155 3167 """ 3156 3168 3157 return StringToEnum('PressurePicard') 3169 return StringToEnum('PressurePicard')[0] 3158 3170 3159 3171 def QmuPressureEnum(): … … 3165 3177 """ 3166 3178 3167 return StringToEnum('QmuPressure') 3179 return StringToEnum('QmuPressure')[0] 3168 3180 3169 3181 def QmuVxEnum(): … … 3175 3187 """ 3176 3188 3177 return StringToEnum('QmuVx') 3189 return StringToEnum('QmuVx')[0] 3178 3190 3179 3191 def QmuVyEnum(): … … 3185 3197 """ 3186 3198 3187 return StringToEnum('QmuVy') 3199 return StringToEnum('QmuVy')[0] 3188 3200 3189 3201 def QmuVzEnum(): … … 3195 3207 """ 3196 3208 3197 return StringToEnum('QmuVz') 3209 return StringToEnum('QmuVz')[0] 3198 3210 3199 3211 def QmuThicknessEnum(): … … 3205 3217 """ 3206 3218 3207 return StringToEnum('QmuThickness') 3219 return StringToEnum('QmuThickness')[0] 3208 3220 3209 3221 def QmuBedEnum(): … … 3215 3227 """ 3216 3228 3217 return StringToEnum('QmuBed') 3229 return StringToEnum('QmuBed')[0] 3218 3230 3219 3231 def QmuSurfaceEnum(): … … 3225 3237 """ 3226 3238 3227 return StringToEnum('QmuSurface') 3239 return StringToEnum('QmuSurface')[0] 3228 3240 3229 3241 def QmuMeltingEnum(): … … 3235 3247 """ 3236 3248 3237 return StringToEnum('QmuMelting') 3249 return StringToEnum('QmuMelting')[0] 3238 3250 3239 3251 def ResetPenaltiesEnum(): … … 3245 3257 """ 3246 3258 3247 return StringToEnum('ResetPenalties') 3259 return StringToEnum('ResetPenalties')[0] 3248 3260 3249 3261 def SegmentOnIceShelfEnum(): … … 3255 3267 """ 3256 3268 3257 return StringToEnum('SegmentOnIceShelf') 3269 return StringToEnum('SegmentOnIceShelf')[0] 3258 3270 3259 3271 def SurfaceAbsVelMisfitEnum(): … … 3265 3277 """ 3266 3278 3267 return StringToEnum('SurfaceAbsVelMisfit') 3279 return StringToEnum('SurfaceAbsVelMisfit')[0] 3268 3280 3269 3281 def SurfaceAreaEnum(): … … 3275 3287 """ 3276 3288 3277 return StringToEnum('SurfaceArea') 3289 return StringToEnum('SurfaceArea')[0] 3278 3290 3279 3291 def SurfaceAverageVelMisfitEnum(): … … 3285 3297 """ 3286 3298 3287 return StringToEnum('SurfaceAverageVelMisfit') 3299 return StringToEnum('SurfaceAverageVelMisfit')[0] 3288 3300 3289 3301 def SurfaceLogVelMisfitEnum(): … … 3295 3307 """ 3296 3308 3297 return StringToEnum('SurfaceLogVelMisfit') 3309 return StringToEnum('SurfaceLogVelMisfit')[0] 3298 3310 3299 3311 def SurfaceLogVxVyMisfitEnum(): … … 3305 3317 """ 3306 3318 3307 return StringToEnum('SurfaceLogVxVyMisfit') 3319 return StringToEnum('SurfaceLogVxVyMisfit')[0] 3308 3320 3309 3321 def SurfaceRelVelMisfitEnum(): … … 3315 3327 """ 3316 3328 3317 return StringToEnum('SurfaceRelVelMisfit') 3329 return StringToEnum('SurfaceRelVelMisfit')[0] 3318 3330 3319 3331 def SurfaceSlopeXEnum(): … … 3325 3337 """ 3326 3338 3327 return StringToEnum('SurfaceSlopeX') 3339 return StringToEnum('SurfaceSlopeX')[0] 3328 3340 3329 3341 def SurfaceSlopeYEnum(): … … 3335 3347 """ 3336 3348 3337 return StringToEnum('SurfaceSlopeY') 3349 return StringToEnum('SurfaceSlopeY')[0] 3338 3350 3339 3351 def TemperatureEnum(): … … 3345 3357 """ 3346 3358 3347 return StringToEnum('Temperature') 3359 return StringToEnum('Temperature')[0] 3348 3360 3349 3361 def TemperatureOldEnum(): … … 3355 3367 """ 3356 3368 3357 return StringToEnum('TemperatureOld') 3369 return StringToEnum('TemperatureOld')[0] 3358 3370 3359 3371 def TemperaturePicardEnum(): … … 3365 3377 """ 3366 3378 3367 return StringToEnum('TemperaturePicard') 3379 return StringToEnum('TemperaturePicard')[0] 3368 3380 3369 3381 def TemperatureSurfaceEnum(): … … 3375 3387 """ 3376 3388 3377 return StringToEnum('TemperatureSurface') 3389 return StringToEnum('TemperatureSurface')[0] 3378 3390 3379 3391 def TemperatureBasalEnum(): … … 3385 3397 """ 3386 3398 3387 return StringToEnum('TemperatureBasal') 3399 return StringToEnum('TemperatureBasal')[0] 3388 3400 3389 3401 def ThicknessAbsMisfitEnum(): … … 3395 3407 """ 3396 3408 3397 return StringToEnum('ThicknessAbsMisfit') 3409 return StringToEnum('ThicknessAbsMisfit')[0] 3398 3410 3399 3411 def TypeEnum(): … … 3405 3417 """ 3406 3418 3407 return StringToEnum('Type') 3419 return StringToEnum('Type')[0] 3408 3420 3409 3421 def VelEnum(): … … 3415 3427 """ 3416 3428 3417 return StringToEnum('Vel') 3429 return StringToEnum('Vel')[0] 3418 3430 3419 3431 def VelocityEnum(): … … 3425 3437 """ 3426 3438 3427 return StringToEnum('Velocity') 3439 return StringToEnum('Velocity')[0] 3428 3440 3429 3441 def VxAverageEnum(): … … 3435 3447 """ 3436 3448 3437 return StringToEnum('VxAverage') 3449 return StringToEnum('VxAverage')[0] 3438 3450 3439 3451 def VxEnum(): … … 3445 3457 """ 3446 3458 3447 return StringToEnum('Vx') 3459 return StringToEnum('Vx')[0] 3448 3460 3449 3461 def VxPicardEnum(): … … 3455 3467 """ 3456 3468 3457 return StringToEnum('VxPicard') 3469 return StringToEnum('VxPicard')[0] 3458 3470 3459 3471 def VyAverageEnum(): … … 3465 3477 """ 3466 3478 3467 return StringToEnum('VyAverage') 3479 return StringToEnum('VyAverage')[0] 3468 3480 3469 3481 def VyEnum(): … … 3475 3487 """ 3476 3488 3477 return StringToEnum('Vy') 3489 return StringToEnum('Vy')[0] 3478 3490 3479 3491 def VyPicardEnum(): … … 3485 3497 """ 3486 3498 3487 return StringToEnum('VyPicard') 3499 return StringToEnum('VyPicard')[0] 3488 3500 3489 3501 def VzEnum(): … … 3495 3507 """ 3496 3508 3497 return StringToEnum('Vz') 3509 return StringToEnum('Vz')[0] 3498 3510 3499 3511 def VzMacAyealEnum(): … … 3505 3517 """ 3506 3518 3507 return StringToEnum('VzMacAyeal') 3519 return StringToEnum('VzMacAyeal')[0] 3508 3520 3509 3521 def VzPattynEnum(): … … 3515 3527 """ 3516 3528 3517 return StringToEnum('VzPattyn') 3529 return StringToEnum('VzPattyn')[0] 3518 3530 3519 3531 def VzPicardEnum(): … … 3525 3537 """ 3526 3538 3527 return StringToEnum('VzPicard') 3539 return StringToEnum('VzPicard')[0] 3528 3540 3529 3541 def VzStokesEnum(): … … 3535 3547 """ 3536 3548 3537 return StringToEnum('VzStokes') 3549 return StringToEnum('VzStokes')[0] 3538 3550 3539 3551 def VxMeshEnum(): … … 3545 3557 """ 3546 3558 3547 return StringToEnum('VxMesh') 3559 return StringToEnum('VxMesh')[0] 3548 3560 3549 3561 def VyMeshEnum(): … … 3555 3567 """ 3556 3568 3557 return StringToEnum('VyMesh') 3569 return StringToEnum('VyMesh')[0] 3558 3570 3559 3571 def VzMeshEnum(): … … 3565 3577 """ 3566 3578 3567 return StringToEnum('VzMesh') 3579 return StringToEnum('VzMesh')[0] 3568 3580 3569 3581 def EnthalpyEnum(): … … 3575 3587 """ 3576 3588 3577 return StringToEnum('Enthalpy') 3589 return StringToEnum('Enthalpy')[0] 3578 3590 3579 3591 def EnthalpyPicardEnum(): … … 3585 3597 """ 3586 3598 3587 return StringToEnum('EnthalpyPicard') 3599 return StringToEnum('EnthalpyPicard')[0] 3588 3600 3589 3601 def ThicknessAbsGradientEnum(): … … 3595 3607 """ 3596 3608 3597 return StringToEnum('ThicknessAbsGradient') 3609 return StringToEnum('ThicknessAbsGradient')[0] 3610 3611 def ThicknessAlongGradientEnum(): 3612 """ 3613 THICKNESSALONGGRADIENTENUM - Enum of ThicknessAlongGradient 3614 3615 Usage: 3616 macro=ThicknessAlongGradientEnum() 3617 """ 3618 3619 return StringToEnum('ThicknessAlongGradient')[0] 3620 3621 def ThicknessAcrossGradientEnum(): 3622 """ 3623 THICKNESSACROSSGRADIENTENUM - Enum of ThicknessAcrossGradient 3624 3625 Usage: 3626 macro=ThicknessAcrossGradientEnum() 3627 """ 3628 3629 return StringToEnum('ThicknessAcrossGradient')[0] 3598 3630 3599 3631 def StepResponsesEnum(): … … 3605 3637 """ 3606 3638 3607 return StringToEnum('StepResponses') 3639 return StringToEnum('StepResponses')[0] 3608 3640 3609 3641 def IntMatParamEnum(): … … 3615 3647 """ 3616 3648 3617 return StringToEnum('IntMatParam') 3649 return StringToEnum('IntMatParam')[0] 3618 3650 3619 3651 def RheologyBbarAbsGradientEnum(): … … 3625 3657 """ 3626 3658 3627 return StringToEnum('RheologyBbarAbsGradient') 3659 return StringToEnum('RheologyBbarAbsGradient')[0] 3628 3660 3629 3661 def DragCoefficientAbsGradientEnum(): … … 3635 3667 """ 3636 3668 3637 return StringToEnum('DragCoefficientAbsGradient') 3669 return StringToEnum('DragCoefficientAbsGradient')[0] 3638 3670 3639 3671 def TransientInputEnum(): … … 3645 3677 """ 3646 3678 3647 return StringToEnum('TransientInput') 3679 return StringToEnum('TransientInput')[0] 3648 3680 3649 3681 def OutputfilenameEnum(): … … 3655 3687 """ 3656 3688 3657 return StringToEnum('Outputfilename') 3689 return StringToEnum('Outputfilename')[0] 3658 3690 3659 3691 def WaterfractionEnum(): … … 3665 3697 """ 3666 3698 3667 return StringToEnum('Waterfraction') 3699 return StringToEnum('Waterfraction')[0] 3668 3700 3669 3701 def WatercolumnEnum(): … … 3675 3707 """ 3676 3708 3677 return StringToEnum('Watercolumn') 3709 return StringToEnum('Watercolumn')[0] 3678 3710 3679 3711 def BasalFrictionEnum(): … … 3685 3717 """ 3686 3718 3687 return StringToEnum('BasalFriction') 3719 return StringToEnum('BasalFriction')[0] 3688 3720 3689 3721 def ViscousHeatingEnum(): … … 3695 3727 """ 3696 3728 3697 return StringToEnum('ViscousHeating') 3729 return StringToEnum('ViscousHeating')[0] 3698 3730 3699 3731 def QmuTemperatureEnum(): … … 3705 3737 """ 3706 3738 3707 return StringToEnum('QmuTemperature') 3739 return StringToEnum('QmuTemperature')[0] 3708 3740 3709 3741 def HydrologyWaterVxEnum(): … … 3715 3747 """ 3716 3748 3717 return StringToEnum('HydrologyWaterVx') 3749 return StringToEnum('HydrologyWaterVx')[0] 3718 3750 3719 3751 def HydrologyWaterVyEnum(): … … 3725 3757 """ 3726 3758 3727 return StringToEnum('HydrologyWaterVy') 3759 return StringToEnum('HydrologyWaterVy')[0] 3728 3760 3729 3761 def StressTensorEnum(): … … 3735 3767 """ 3736 3768 3737 return StringToEnum('StressTensor') 3769 return StringToEnum('StressTensor')[0] 3738 3770 3739 3771 def StressTensorxxEnum(): … … 3745 3777 """ 3746 3778 3747 return StringToEnum('StressTensorxx') 3779 return StringToEnum('StressTensorxx')[0] 3748 3780 3749 3781 def StressTensorxyEnum(): … … 3755 3787 """ 3756 3788 3757 return StringToEnum('StressTensorxy') 3789 return StringToEnum('StressTensorxy')[0] 3758 3790 3759 3791 def StressTensorxzEnum(): … … 3765 3797 """ 3766 3798 3767 return StringToEnum('StressTensorxz') 3799 return StringToEnum('StressTensorxz')[0] 3768 3800 3769 3801 def StressTensoryyEnum(): … … 3775 3807 """ 3776 3808 3777 return StringToEnum('StressTensoryy') 3809 return StringToEnum('StressTensoryy')[0] 3778 3810 3779 3811 def StressTensoryzEnum(): … … 3785 3817 """ 3786 3818 3787 return StringToEnum('StressTensoryz') 3819 return StringToEnum('StressTensoryz')[0] 3788 3820 3789 3821 def StressTensorzzEnum(): … … 3795 3827 """ 3796 3828 3797 return StringToEnum('StressTensorzz') 3829 return StringToEnum('StressTensorzz')[0] 3830 3831 def P0Enum(): 3832 """ 3833 P0ENUM - Enum of P0 3834 3835 Usage: 3836 macro=P0Enum() 3837 """ 3838 3839 return StringToEnum('P0')[0] 3840 3841 def P1Enum(): 3842 """ 3843 P1ENUM - Enum of P1 3844 3845 Usage: 3846 macro=P1Enum() 3847 """ 3848 3849 return StringToEnum('P1')[0] 3850 3851 def P1DGEnum(): 3852 """ 3853 P1DGENUM - Enum of P1DG 3854 3855 Usage: 3856 macro=P1DGEnum() 3857 """ 3858 3859 return StringToEnum('P1DG')[0] 3860 3861 def SaveResultsEnum(): 3862 """ 3863 SAVERESULTSENUM - Enum of SaveResults 3864 3865 Usage: 3866 macro=SaveResultsEnum() 3867 """ 3868 3869 return StringToEnum('SaveResults')[0] 3870 3871 def BoolElementResultEnum(): 3872 """ 3873 BOOLELEMENTRESULTENUM - Enum of BoolElementResult 3874 3875 Usage: 3876 macro=BoolElementResultEnum() 3877 """ 3878 3879 return StringToEnum('BoolElementResult')[0] 3880 3881 def BoolExternalResultEnum(): 3882 """ 3883 BOOLEXTERNALRESULTENUM - Enum of BoolExternalResult 3884 3885 Usage: 3886 macro=BoolExternalResultEnum() 3887 """ 3888 3889 return StringToEnum('BoolExternalResult')[0] 3890 3891 def DoubleElementResultEnum(): 3892 """ 3893 DOUBLEELEMENTRESULTENUM - Enum of DoubleElementResult 3894 3895 Usage: 3896 macro=DoubleElementResultEnum() 3897 """ 3898 3899 return StringToEnum('DoubleElementResult')[0] 3900 3901 def DoubleExternalResultEnum(): 3902 """ 3903 DOUBLEEXTERNALRESULTENUM - Enum of DoubleExternalResult 3904 3905 Usage: 3906 macro=DoubleExternalResultEnum() 3907 """ 3908 3909 return StringToEnum('DoubleExternalResult')[0] 3910 3911 def DoubleMatExternalResultEnum(): 3912 """ 3913 DOUBLEMATEXTERNALRESULTENUM - Enum of DoubleMatExternalResult 3914 3915 Usage: 3916 macro=DoubleMatExternalResultEnum() 3917 """ 3918 3919 return StringToEnum('DoubleMatExternalResult')[0] 3920 3921 def DoubleVecExternalResultEnum(): 3922 """ 3923 DOUBLEVECEXTERNALRESULTENUM - Enum of DoubleVecExternalResult 3924 3925 Usage: 3926 macro=DoubleVecExternalResultEnum() 3927 """ 3928 3929 return StringToEnum('DoubleVecExternalResult')[0] 3930 3931 def IntExternalResultEnum(): 3932 """ 3933 INTEXTERNALRESULTENUM - Enum of IntExternalResult 3934 3935 Usage: 3936 macro=IntExternalResultEnum() 3937 """ 3938 3939 return StringToEnum('IntExternalResult')[0] 3940 3941 def JEnum(): 3942 """ 3943 JENUM - Enum of J 3944 3945 Usage: 3946 macro=JEnum() 3947 """ 3948 3949 return StringToEnum('J')[0] 3950 3951 def PatchEnum(): 3952 """ 3953 PATCHENUM - Enum of Patch 3954 3955 Usage: 3956 macro=PatchEnum() 3957 """ 3958 3959 return StringToEnum('Patch')[0] 3960 3961 def PatchNodesEnum(): 3962 """ 3963 PATCHNODESENUM - Enum of PatchNodes 3964 3965 Usage: 3966 macro=PatchNodesEnum() 3967 """ 3968 3969 return StringToEnum('PatchNodes')[0] 3970 3971 def PatchVerticesEnum(): 3972 """ 3973 PATCHVERTICESENUM - Enum of PatchVertices 3974 3975 Usage: 3976 macro=PatchVerticesEnum() 3977 """ 3978 3979 return StringToEnum('PatchVertices')[0] 3980 3981 def PentaP1ElementResultEnum(): 3982 """ 3983 PENTAP1ELEMENTRESULTENUM - Enum of PentaP1ElementResult 3984 3985 Usage: 3986 macro=PentaP1ElementResultEnum() 3987 """ 3988 3989 return StringToEnum('PentaP1ElementResult')[0] 3990 3991 def PetscVecExternalResultEnum(): 3992 """ 3993 PETSCVECEXTERNALRESULTENUM - Enum of PetscVecExternalResult 3994 3995 Usage: 3996 macro=PetscVecExternalResultEnum() 3997 """ 3998 3999 return StringToEnum('PetscVecExternalResult')[0] 4000 4001 def StringExternalResultEnum(): 4002 """ 4003 STRINGEXTERNALRESULTENUM - Enum of StringExternalResult 4004 4005 Usage: 4006 macro=StringExternalResultEnum() 4007 """ 4008 4009 return StringToEnum('StringExternalResult')[0] 4010 4011 def StepEnum(): 4012 """ 4013 STEPENUM - Enum of Step 4014 4015 Usage: 4016 macro=StepEnum() 4017 """ 4018 4019 return StringToEnum('Step')[0] 4020 4021 def TimeEnum(): 4022 """ 4023 TIMEENUM - Enum of Time 4024 4025 Usage: 4026 macro=TimeEnum() 4027 """ 4028 4029 return StringToEnum('Time')[0] 4030 4031 def TriaP1ElementResultEnum(): 4032 """ 4033 TRIAP1ELEMENTRESULTENUM - Enum of TriaP1ElementResult 4034 4035 Usage: 4036 macro=TriaP1ElementResultEnum() 4037 """ 4038 4039 return StringToEnum('TriaP1ElementResult')[0] 4040 4041 def WaterColumnOldEnum(): 4042 """ 4043 WATERCOLUMNOLDENUM - Enum of WaterColumnOld 4044 4045 Usage: 4046 macro=WaterColumnOldEnum() 4047 """ 4048 4049 return StringToEnum('WaterColumnOld')[0] 4050 4051 def MinVelEnum(): 4052 """ 4053 MINVELENUM - Enum of MinVel 4054 4055 Usage: 4056 macro=MinVelEnum() 4057 """ 4058 4059 return StringToEnum('MinVel')[0] 4060 4061 def MaxVelEnum(): 4062 """ 4063 MAXVELENUM - Enum of MaxVel 4064 4065 Usage: 4066 macro=MaxVelEnum() 4067 """ 4068 4069 return StringToEnum('MaxVel')[0] 4070 4071 def MinVxEnum(): 4072 """ 4073 MINVXENUM - Enum of MinVx 4074 4075 Usage: 4076 macro=MinVxEnum() 4077 """ 4078 4079 return StringToEnum('MinVx')[0] 4080 4081 def MaxVxEnum(): 4082 """ 4083 MAXVXENUM - Enum of MaxVx 4084 4085 Usage: 4086 macro=MaxVxEnum() 4087 """ 4088 4089 return StringToEnum('MaxVx')[0] 4090 4091 def MaxAbsVxEnum(): 4092 """ 4093 MAXABSVXENUM - Enum of MaxAbsVx 4094 4095 Usage: 4096 macro=MaxAbsVxEnum() 4097 """ 4098 4099 return StringToEnum('MaxAbsVx')[0] 4100 4101 def MinVyEnum(): 4102 """ 4103 MINVYENUM - Enum of MinVy 4104 4105 Usage: 4106 macro=MinVyEnum() 4107 """ 4108 4109 return StringToEnum('MinVy')[0] 4110 4111 def MaxVyEnum(): 4112 """ 4113 MAXVYENUM - Enum of MaxVy 4114 4115 Usage: 4116 macro=MaxVyEnum() 4117 """ 4118 4119 return StringToEnum('MaxVy')[0] 4120 4121 def MaxAbsVyEnum(): 4122 """ 4123 MAXABSVYENUM - Enum of MaxAbsVy 4124 4125 Usage: 4126 macro=MaxAbsVyEnum() 4127 """ 4128 4129 return StringToEnum('MaxAbsVy')[0] 4130 4131 def MinVzEnum(): 4132 """ 4133 MINVZENUM - Enum of MinVz 4134 4135 Usage: 4136 macro=MinVzEnum() 4137 """ 4138 4139 return StringToEnum('MinVz')[0] 4140 4141 def MaxVzEnum(): 4142 """ 4143 MAXVZENUM - Enum of MaxVz 4144 4145 Usage: 4146 macro=MaxVzEnum() 4147 """ 4148 4149 return StringToEnum('MaxVz')[0] 4150 4151 def MaxAbsVzEnum(): 4152 """ 4153 MAXABSVZENUM - Enum of MaxAbsVz 4154 4155 Usage: 4156 macro=MaxAbsVzEnum() 4157 """ 4158 4159 return StringToEnum('MaxAbsVz')[0] 3798 4160 3799 4161 def IceVolumeEnum(): … … 3805 4167 """ 3806 4168 3807 return StringToEnum('IceVolume') 4169 return StringToEnum('IceVolume')[0] 3808 4170 3809 4171 def TotalSmbEnum(): … … 3815 4177 """ 3816 4178 3817 return StringToEnum('TotalSmb') 3818 3819 def ThicknessAlongGradientEnum(): 3820 """ 3821 THICKNESSALONGGRADIENTENUM - Enum of ThicknessAlongGradient 3822 3823 Usage: 3824 macro=ThicknessAlongGradientEnum() 3825 """ 3826 3827 return StringToEnum('ThicknessAlongGradient') 3828 3829 def ThicknessAcrossGradientEnum(): 3830 """ 3831 THICKNESSACROSSGRADIENTENUM - Enum of ThicknessAcrossGradient 3832 3833 Usage: 3834 macro=ThicknessAcrossGradientEnum() 3835 """ 3836 3837 return StringToEnum('ThicknessAcrossGradient') 3838 3839 def P0Enum(): 3840 """ 3841 P0ENUM - Enum of P0 3842 3843 Usage: 3844 macro=P0Enum() 3845 """ 3846 3847 return StringToEnum('P0') 3848 3849 def P1Enum(): 3850 """ 3851 P1ENUM - Enum of P1 3852 3853 Usage: 3854 macro=P1Enum() 3855 """ 3856 3857 return StringToEnum('P1') 3858 3859 def P1DGEnum(): 3860 """ 3861 P1DGENUM - Enum of P1DG 3862 3863 Usage: 3864 macro=P1DGEnum() 3865 """ 3866 3867 return StringToEnum('P1DG') 3868 3869 def SaveResultsEnum(): 3870 """ 3871 SAVERESULTSENUM - Enum of SaveResults 3872 3873 Usage: 3874 macro=SaveResultsEnum() 3875 """ 3876 3877 return StringToEnum('SaveResults') 3878 3879 def BoolElementResultEnum(): 3880 """ 3881 BOOLELEMENTRESULTENUM - Enum of BoolElementResult 3882 3883 Usage: 3884 macro=BoolElementResultEnum() 3885 """ 3886 3887 return StringToEnum('BoolElementResult') 3888 3889 def BoolExternalResultEnum(): 3890 """ 3891 BOOLEXTERNALRESULTENUM - Enum of BoolExternalResult 3892 3893 Usage: 3894 macro=BoolExternalResultEnum() 3895 """ 3896 3897 return StringToEnum('BoolExternalResult') 3898 3899 def DoubleElementResultEnum(): 3900 """ 3901 DOUBLEELEMENTRESULTENUM - Enum of DoubleElementResult 3902 3903 Usage: 3904 macro=DoubleElementResultEnum() 3905 """ 3906 3907 return StringToEnum('DoubleElementResult') 3908 3909 def DoubleExternalResultEnum(): 3910 """ 3911 DOUBLEEXTERNALRESULTENUM - Enum of DoubleExternalResult 3912 3913 Usage: 3914 macro=DoubleExternalResultEnum() 3915 """ 3916 3917 return StringToEnum('DoubleExternalResult') 3918 3919 def DoubleMatExternalResultEnum(): 3920 """ 3921 DOUBLEMATEXTERNALRESULTENUM - Enum of DoubleMatExternalResult 3922 3923 Usage: 3924 macro=DoubleMatExternalResultEnum() 3925 """ 3926 3927 return StringToEnum('DoubleMatExternalResult') 3928 3929 def DoubleVecExternalResultEnum(): 3930 """ 3931 DOUBLEVECEXTERNALRESULTENUM - Enum of DoubleVecExternalResult 3932 3933 Usage: 3934 macro=DoubleVecExternalResultEnum() 3935 """ 3936 3937 return StringToEnum('DoubleVecExternalResult') 3938 3939 def IntExternalResultEnum(): 3940 """ 3941 INTEXTERNALRESULTENUM - Enum of IntExternalResult 3942 3943 Usage: 3944 macro=IntExternalResultEnum() 3945 """ 3946 3947 return StringToEnum('IntExternalResult') 3948 3949 def JEnum(): 3950 """ 3951 JENUM - Enum of J 3952 3953 Usage: 3954 macro=JEnum() 3955 """ 3956 3957 return StringToEnum('J') 3958 3959 def PatchEnum(): 3960 """ 3961 PATCHENUM - Enum of Patch 3962 3963 Usage: 3964 macro=PatchEnum() 3965 """ 3966 3967 return StringToEnum('Patch') 3968 3969 def PatchNodesEnum(): 3970 """ 3971 PATCHNODESENUM - Enum of PatchNodes 3972 3973 Usage: 3974 macro=PatchNodesEnum() 3975 """ 3976 3977 return StringToEnum('PatchNodes') 3978 3979 def PatchVerticesEnum(): 3980 """ 3981 PATCHVERTICESENUM - Enum of PatchVertices 3982 3983 Usage: 3984 macro=PatchVerticesEnum() 3985 """ 3986 3987 return StringToEnum('PatchVertices') 3988 3989 def PentaP1ElementResultEnum(): 3990 """ 3991 PENTAP1ELEMENTRESULTENUM - Enum of PentaP1ElementResult 3992 3993 Usage: 3994 macro=PentaP1ElementResultEnum() 3995 """ 3996 3997 return StringToEnum('PentaP1ElementResult') 3998 3999 def PetscVecExternalResultEnum(): 4000 """ 4001 PETSCVECEXTERNALRESULTENUM - Enum of PetscVecExternalResult 4002 4003 Usage: 4004 macro=PetscVecExternalResultEnum() 4005 """ 4006 4007 return StringToEnum('PetscVecExternalResult') 4008 4009 def StringExternalResultEnum(): 4010 """ 4011 STRINGEXTERNALRESULTENUM - Enum of StringExternalResult 4012 4013 Usage: 4014 macro=StringExternalResultEnum() 4015 """ 4016 4017 return StringToEnum('StringExternalResult') 4018 4019 def StepEnum(): 4020 """ 4021 STEPENUM - Enum of Step 4022 4023 Usage: 4024 macro=StepEnum() 4025 """ 4026 4027 return StringToEnum('Step') 4028 4029 def TimeEnum(): 4030 """ 4031 TIMEENUM - Enum of Time 4032 4033 Usage: 4034 macro=TimeEnum() 4035 """ 4036 4037 return StringToEnum('Time') 4038 4039 def TriaP1ElementResultEnum(): 4040 """ 4041 TRIAP1ELEMENTRESULTENUM - Enum of TriaP1ElementResult 4042 4043 Usage: 4044 macro=TriaP1ElementResultEnum() 4045 """ 4046 4047 return StringToEnum('TriaP1ElementResult') 4048 4049 def WaterColumnOldEnum(): 4050 """ 4051 WATERCOLUMNOLDENUM - Enum of WaterColumnOld 4052 4053 Usage: 4054 macro=WaterColumnOldEnum() 4055 """ 4056 4057 return StringToEnum('WaterColumnOld') 4058 4059 def MinVelEnum(): 4060 """ 4061 MINVELENUM - Enum of MinVel 4062 4063 Usage: 4064 macro=MinVelEnum() 4065 """ 4066 4067 return StringToEnum('MinVel') 4068 4069 def MaxVelEnum(): 4070 """ 4071 MAXVELENUM - Enum of MaxVel 4072 4073 Usage: 4074 macro=MaxVelEnum() 4075 """ 4076 4077 return StringToEnum('MaxVel') 4078 4079 def MinVxEnum(): 4080 """ 4081 MINVXENUM - Enum of MinVx 4082 4083 Usage: 4084 macro=MinVxEnum() 4085 """ 4086 4087 return StringToEnum('MinVx') 4088 4089 def MaxVxEnum(): 4090 """ 4091 MAXVXENUM - Enum of MaxVx 4092 4093 Usage: 4094 macro=MaxVxEnum() 4095 """ 4096 4097 return StringToEnum('MaxVx') 4098 4099 def MaxAbsVxEnum(): 4100 """ 4101 MAXABSVXENUM - Enum of MaxAbsVx 4102 4103 Usage: 4104 macro=MaxAbsVxEnum() 4105 """ 4106 4107 return StringToEnum('MaxAbsVx') 4108 4109 def MinVyEnum(): 4110 """ 4111 MINVYENUM - Enum of MinVy 4112 4113 Usage: 4114 macro=MinVyEnum() 4115 """ 4116 4117 return StringToEnum('MinVy') 4118 4119 def MaxVyEnum(): 4120 """ 4121 MAXVYENUM - Enum of MaxVy 4122 4123 Usage: 4124 macro=MaxVyEnum() 4125 """ 4126 4127 return StringToEnum('MaxVy') 4128 4129 def MaxAbsVyEnum(): 4130 """ 4131 MAXABSVYENUM - Enum of MaxAbsVy 4132 4133 Usage: 4134 macro=MaxAbsVyEnum() 4135 """ 4136 4137 return StringToEnum('MaxAbsVy') 4138 4139 def MinVzEnum(): 4140 """ 4141 MINVZENUM - Enum of MinVz 4142 4143 Usage: 4144 macro=MinVzEnum() 4145 """ 4146 4147 return StringToEnum('MinVz') 4148 4149 def MaxVzEnum(): 4150 """ 4151 MAXVZENUM - Enum of MaxVz 4152 4153 Usage: 4154 macro=MaxVzEnum() 4155 """ 4156 4157 return StringToEnum('MaxVz') 4158 4159 def MaxAbsVzEnum(): 4160 """ 4161 MAXABSVZENUM - Enum of MaxAbsVz 4162 4163 Usage: 4164 macro=MaxAbsVzEnum() 4165 """ 4166 4167 return StringToEnum('MaxAbsVz') 4179 return StringToEnum('TotalSmb')[0] 4168 4180 4169 4181 def RelativeEnum(): … … 4175 4187 """ 4176 4188 4177 return StringToEnum('Relative') 4189 return StringToEnum('Relative')[0] 4178 4190 4179 4191 def AbsoluteEnum(): … … 4185 4197 """ 4186 4198 4187 return StringToEnum('Absolute') 4199 return StringToEnum('Absolute')[0] 4188 4200 4189 4201 def IncrementalEnum(): … … 4195 4207 """ 4196 4208 4197 return StringToEnum('Incremental') 4209 return StringToEnum('Incremental')[0] 4198 4210 4199 4211 def AgressiveMigrationEnum(): … … 4205 4217 """ 4206 4218 4207 return StringToEnum('AgressiveMigration') 4219 return StringToEnum('AgressiveMigration')[0] 4208 4220 4209 4221 def NoneEnum(): … … 4215 4227 """ 4216 4228 4217 return StringToEnum('None') 4229 return StringToEnum('None')[0] 4218 4230 4219 4231 def SoftMigrationEnum(): … … 4225 4237 """ 4226 4238 4227 return StringToEnum('SoftMigration') 4239 return StringToEnum('SoftMigration')[0] 4228 4240 4229 4241 def StokesSolverEnum(): … … 4235 4247 """ 4236 4248 4237 return StringToEnum('StokesSolver') 4249 return StringToEnum('StokesSolver')[0] 4238 4250 4239 4251 def AdjointEnum(): … … 4245 4257 """ 4246 4258 4247 return StringToEnum('Adjoint') 4259 return StringToEnum('Adjoint')[0] 4248 4260 4249 4261 def ColinearEnum(): … … 4255 4267 """ 4256 4268 4257 return StringToEnum('Colinear') 4269 return StringToEnum('Colinear')[0] 4258 4270 4259 4271 def ControlSteadyEnum(): … … 4265 4277 """ 4266 4278 4267 return StringToEnum('ControlSteady') 4279 return StringToEnum('ControlSteady')[0] 4268 4280 4269 4281 def FsetEnum(): … … 4275 4287 """ 4276 4288 4277 return StringToEnum('Fset') 4289 return StringToEnum('Fset')[0] 4278 4290 4279 4291 def Gradient1Enum(): … … 4285 4297 """ 4286 4298 4287 return StringToEnum('Gradient1') 4299 return StringToEnum('Gradient1')[0] 4288 4300 4289 4301 def Gradient2Enum(): … … 4295 4307 """ 4296 4308 4297 return StringToEnum('Gradient2') 4309 return StringToEnum('Gradient2')[0] 4298 4310 4299 4311 def Gradient3Enum(): … … 4305 4317 """ 4306 4318 4307 return StringToEnum('Gradient3') 4319 return StringToEnum('Gradient3')[0] 4308 4320 4309 4321 def GradientEnum(): … … 4315 4327 """ 4316 4328 4317 return StringToEnum('Gradient') 4329 return StringToEnum('Gradient')[0] 4318 4330 4319 4331 def GroundinglineMigrationEnum(): … … 4325 4337 """ 4326 4338 4327 return StringToEnum('GroundinglineMigration') 4339 return StringToEnum('GroundinglineMigration')[0] 4328 4340 4329 4341 def GsetEnum(): … … 4335 4347 """ 4336 4348 4337 return StringToEnum('Gset') 4349 return StringToEnum('Gset')[0] 4338 4350 4339 4351 def IndexEnum(): … … 4345 4357 """ 4346 4358 4347 return StringToEnum('Index') 4359 return StringToEnum('Index')[0] 4348 4360 4349 4361 def IndexedEnum(): … … 4355 4367 """ 4356 4368 4357 return StringToEnum('Indexed') 4369 return StringToEnum('Indexed')[0] 4358 4370 4359 4371 def IntersectEnum(): … … 4365 4377 """ 4366 4378 4367 return StringToEnum('Intersect') 4379 return StringToEnum('Intersect')[0] 4368 4380 4369 4381 def NodalEnum(): … … 4375 4387 """ 4376 4388 4377 return StringToEnum('Nodal') 4389 return StringToEnum('Nodal')[0] 4378 4390 4379 4391 def OldGradientEnum(): … … 4385 4397 """ 4386 4398 4387 return StringToEnum('OldGradient') 4399 return StringToEnum('OldGradient')[0] 4388 4400 4389 4401 def OutputFilePointerEnum(): … … 4395 4407 """ 4396 4408 4397 return StringToEnum('OutputFilePointer') 4409 return StringToEnum('OutputFilePointer')[0] 4398 4410 4399 4411 def PetscOptionsAnalysesEnum(): … … 4405 4417 """ 4406 4418 4407 return StringToEnum('PetscOptionsAnalyses') 4419 return StringToEnum('PetscOptionsAnalyses')[0] 4408 4420 4409 4421 def PetscOptionsStringsEnum(): … … 4415 4427 """ 4416 4428 4417 return StringToEnum('PetscOptionsStrings') 4429 return StringToEnum('PetscOptionsStrings')[0] 4418 4430 4419 4431 def QmuErrNameEnum(): … … 4425 4437 """ 4426 4438 4427 return StringToEnum('QmuErrName') 4439 return StringToEnum('QmuErrName')[0] 4428 4440 4429 4441 def QmuInNameEnum(): … … 4435 4447 """ 4436 4448 4437 return StringToEnum('QmuInName') 4449 return StringToEnum('QmuInName')[0] 4438 4450 4439 4451 def QmuOutNameEnum(): … … 4445 4457 """ 4446 4458 4447 return StringToEnum('QmuOutName') 4459 return StringToEnum('QmuOutName')[0] 4448 4460 4449 4461 def RegularEnum(): … … 4455 4467 """ 4456 4468 4457 return StringToEnum('Regular') 4469 return StringToEnum('Regular')[0] 4458 4470 4459 4471 def ScaledEnum(): … … 4465 4477 """ 4466 4478 4467 return StringToEnum('Scaled') 4479 return StringToEnum('Scaled')[0] 4468 4480 4469 4481 def SeparateEnum(): … … 4475 4487 """ 4476 4488 4477 return StringToEnum('Separate') 4489 return StringToEnum('Separate')[0] 4478 4490 4479 4491 def SsetEnum(): … … 4485 4497 """ 4486 4498 4487 return StringToEnum('Sset') 4499 return StringToEnum('Sset')[0] 4488 4500 4489 4501 def VerboseEnum(): … … 4495 4507 """ 4496 4508 4497 return StringToEnum('Verbose') 4509 return StringToEnum('Verbose')[0] 4498 4510 4499 4511 def TriangleInterpEnum(): … … 4505 4517 """ 4506 4518 4507 return StringToEnum('TriangleInterp') 4519 return StringToEnum('TriangleInterp')[0] 4508 4520 4509 4521 def BilinearInterpEnum(): … … 4515 4527 """ 4516 4528 4517 return StringToEnum('BilinearInterp') 4529 return StringToEnum('BilinearInterp')[0] 4518 4530 4519 4531 def NearestInterpEnum(): … … 4525 4537 """ 4526 4538 4527 return StringToEnum('NearestInterp') 4539 return StringToEnum('NearestInterp')[0] 4528 4540 4529 4541 def XYEnum(): … … 4535 4547 """ 4536 4548 4537 return StringToEnum('XY') 4549 return StringToEnum('XY')[0] 4538 4550 4539 4551 def XYZPEnum(): … … 4545 4557 """ 4546 4558 4547 return StringToEnum('XYZP') 4559 return StringToEnum('XYZP')[0] 4548 4560 4549 4561 def OptionEnum(): … … 4555 4567 """ 4556 4568 4557 return StringToEnum('Option') 4569 return StringToEnum('Option')[0] 4558 4570 4559 4571 def OptionCellEnum(): … … 4565 4577 """ 4566 4578 4567 return StringToEnum('OptionCell') 4579 return StringToEnum('OptionCell')[0] 4568 4580 4569 4581 def OptionCharEnum(): … … 4575 4587 """ 4576 4588 4577 return StringToEnum('OptionChar') 4589 return StringToEnum('OptionChar')[0] 4578 4590 4579 4591 def OptionStructEnum(): … … 4585 4597 """ 4586 4598 4587 return StringToEnum('OptionStruct') 4599 return StringToEnum('OptionStruct')[0] 4588 4600 4589 4601 def OptionDoubleEnum(): … … 4595 4607 """ 4596 4608 4597 return StringToEnum('OptionDouble') 4609 return StringToEnum('OptionDouble')[0] 4598 4610 4599 4611 def OptionLogicalEnum(): … … 4605 4617 """ 4606 4618 4607 return StringToEnum('OptionLogical') 4619 return StringToEnum('OptionLogical')[0] 4608 4620 4609 4621 def PatersonEnum(): … … 4615 4627 """ 4616 4628 4617 return StringToEnum('Paterson') 4629 return StringToEnum('Paterson')[0] 4618 4630 4619 4631 def ArrheniusEnum(): … … 4625 4637 """ 4626 4638 4627 return StringToEnum('Arrhenius') 4639 return StringToEnum('Arrhenius')[0] 4628 4640 4629 4641 def MaximumNumberOfEnums(): … … 4635 4647 """ 4636 4648 4637 return 46 24638 4649 return 463 4650 -
issm/branches/trunk-jpl-damage/src/m/enum/MaximumNumberOfEnums.m
r12947 r13101 9 9 % macro=MaximumNumberOfEnums() 10 10 11 macro=46 2;11 macro=463; -
issm/branches/trunk-jpl-damage/src/modules/BamgConvertMesh/BamgConvertMesh.cpp
r12878 r13101 34 34 35 35 /*Check inputs*/ 36 if(nels<0) _error 2_("Number of elements must be positive, check index number of lines");37 if(nods<0) _error 2_("Number of nods must be positive, check x and y sizes");38 if(test1!=3) _error 2_("index should have 3 columns");39 if(test2!=nods) _error 2_("x and y do not have the same length");36 if(nels<0) _error_("Number of elements must be positive, check index number of lines"); 37 if(nods<0) _error_("Number of nods must be positive, check x and y sizes"); 38 if(test1!=3) _error_("index should have 3 columns"); 39 if(test2!=nods) _error_("x and y do not have the same length"); 40 40 41 41 /* Run core computations: */ -
issm/branches/trunk-jpl-damage/src/modules/BamgTriangulate/BamgTriangulate.cpp
r12878 r13101 32 32 33 33 /*Check inputs*/ 34 if(y_rows!=nods) _error 2_("x and y do not have the same length");35 if(x_cols>1 || y_cols>1) _error 2_("x and y should have only one column");36 if(nods<3) _error 2_("At least 3 points are required");34 if(y_rows!=nods) _error_("x and y do not have the same length"); 35 if(x_cols>1 || y_cols>1) _error_("x and y should have only one column"); 36 if(nods<3) _error_("At least 3 points are required"); 37 37 38 38 /* Run core computations: */ -
issm/branches/trunk-jpl-damage/src/modules/Chaco/Chaco.cpp
r12878 r13101 42 42 43 43 #ifndef _HAVE_CHACO_ //only works if dakota library has been compiled in. 44 _error 2_("Chaco not available! Cannot carry out Chaco partitioning!");44 _error_("Chaco not available! Cannot carry out Chaco partitioning!"); 45 45 #endif 46 46 … … 54 54 nvtxs = mxGetN(A_IN); 55 55 mwstart = mxGetJc(A_IN); 56 start= (int*)xmalloc((nvtxs+1)*sizeof(int));56 start=xNew<int>((nvtxs+1)); 57 57 for (i=0; i<nvtxs+1;i++)start[i]=(int)mwstart[i]; 58 58 59 59 mwadjacency = mxGetIr(A_IN); 60 adjacency = (int*)xmalloc(mxGetNzmax(A_IN)*sizeof(int));60 adjacency = xNew<int>(mxGetNzmax(A_IN)); 61 61 for (i=0; i<mxGetNzmax(A_IN); i++) adjacency[i]= (int)mwadjacency[i]; 62 62 63 63 nedges = start[nvtxs]; 64 64 if(!mxIsEmpty(EWGTS_IN)){ 65 ewgts = (float*)xcalloc(nedges, sizeof(float));65 ewgts = xNewZeroInit<float>(nedges); 66 66 doublepointer=mxGetPr(A_IN); 67 67 for (i = 0; i < nedges; i++)ewgts[i] = (float)doublepointer[i]; … … 77 77 for (i=0;i<(nterms<10?nterms:10);i++) options[i]=in_options[i]; //copy in_options into default options 78 78 FetchData(&npart,NPARTS_IN); 79 nparts= (int*)xmalloc(sizeof(int)); nparts[0]=npart; //weird Chacox interface ain't it?79 nparts=xNew<int>(1); nparts[0]=npart; //weird Chacox interface ain't it? 80 80 FetchData(&goal,&nterms,GOAL_IN); 81 81 … … 104 104 105 105 /*Allocate output: */ 106 assignment = (short*)xcalloc(nvtxs, sizeof(short));106 assignment = xNewZeroInit<short>(nvtxs); 107 107 108 108 /*Call core: */ … … 110 110 111 111 /*Output data: */ 112 doubleassignment= (double*)xmalloc(nvtxs*sizeof(double));112 doubleassignment=xNew<double>(nvtxs); 113 113 for(i=0;i<nvtxs;i++) doubleassignment[i]=(double)assignment[i]; 114 114 WriteData(ASSGN_OUT,doubleassignment,nvtxs); -
issm/branches/trunk-jpl-damage/src/modules/ContourToMesh/ContourToMesh.cpp
r12878 r13101 47 47 if(nlhs!=1 && nlhs!=2){ 48 48 ContourToMeshUsage(); 49 _error 2_("usage. See above");49 _error_("usage. See above"); 50 50 } 51 51 #endif … … 53 53 if(nrhs!=NRHS){ 54 54 ContourToMeshUsage(); 55 _error 2_("usage. See above");55 _error_("usage. See above"); 56 56 } 57 57 … … 82 82 WriteData(PLHS1,in_elem); 83 83 } 84 else _error 2_("wrong interpolation type");84 else _error_("wrong interpolation type"); 85 85 86 86 /*end module: */ -
issm/branches/trunk-jpl-damage/src/modules/ContourToNodes/ContourToNodes.cpp
r12878 r13101 68 68 69 69 numcontours=mxGetNumberOfElements(matlabstructure); 70 contours= (Contour**)xmalloc(numcontours*sizeof(Contour*));70 contours=xNew<Contour*>(numcontours); 71 71 for(i=0;i<numcontours;i++){ 72 72 //allocate 73 contouri= (Contour*)xmalloc(sizeof(Contour));73 contouri=xNew<Contour>(1); 74 74 //retrieve dimension of this contour. 75 75 contouri->nods=(int)mxGetScalar(mxGetField(matlabstructure,i,"nods")); -
issm/branches/trunk-jpl-damage/src/modules/EnumToString/EnumToString.cpp
r12878 r13101 5 5 #include "./EnumToString.h" 6 6 7 void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){7 WRAPPER(EnumToString){ 8 8 9 9 char *name = NULL; 10 10 int enum_in; 11 11 12 /*checks on arguments on the matlab side: */ 13 if(nrhs!=NRHS){ 14 EnumToStringUsage(); _error2_("usage. See above"); 15 } 12 /*Boot module: */ 13 MODULEBOOT(); 14 15 /*checks on arguments: */ 16 CHECKARGUMENTS(NLHS,NRHS,&EnumToStringUsage); 16 17 17 18 /*Fetch inputs: */ … … 23 24 /* output: */ 24 25 WriteData(NAME,name); 26 27 /*end module: */ 28 MODULEEND(); 25 29 } 26 30 -
issm/branches/trunk-jpl-damage/src/modules/EnumToString/EnumToString.h
r12013 r13101 6 6 #define _ENUMTOSTRING_H 7 7 8 /* local prototypes: */ 9 void EnumToStringUsage(void); 8 #ifdef HAVE_CONFIG_H 9 #include <config.h> 10 #else 11 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" 12 #endif 10 13 14 /*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/ 15 #ifdef _HAVE_PYTHON_ 16 #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol 17 #endif 18 19 /*Header files: */ 11 20 #include "../../c/include/globals.h" 12 21 #include "../../c/modules/modules.h" … … 15 24 #include "../../c/issm-binding.h" 16 25 26 #ifdef _HAVE_MATLAB_MODULES_ 17 27 /* serial input macros: */ 18 28 #define ENUMIN (mxArray*)prhs[0] 19 20 29 /* serial output macros: */ 21 30 #define NAME (mxArray**)&plhs[0] 31 #endif 32 33 #ifdef _HAVE_PYTHON_MODULES_ 34 /* serial input macros: */ 35 #define ENUMIN PyTuple_GetItem(args,0) 36 /* serial output macros: */ 37 #define NAME output,0 38 #endif 22 39 23 40 /* serial arg counts: */ … … 30 47 #define __FUNCT__ "EnumToString" 31 48 49 /* local prototypes: */ 50 void EnumToStringUsage(void); 51 32 52 #endif /* _TEST_H */ -
issm/branches/trunk-jpl-damage/src/modules/Exp2Kml/Exp2Kml.cpp
r12878 r13101 25 25 /*checks on arguments on the matlab side: */ 26 26 if (nlhs > NLHS) { 27 Exp2KmlUsage(); _error 2_("Exp2Kml usage error");27 Exp2KmlUsage(); _error_("Exp2Kml usage error"); 28 28 } 29 29 if (nrhs < NRHS) { 30 Exp2KmlUsage(); _error 2_("Exp2Kml usage error");30 Exp2KmlUsage(); _error_("Exp2Kml usage error"); 31 31 } 32 32 … … 49 49 50 50 /*some checks*/ 51 if (sgn !=+1 && sgn !=-1) _error 2_("Hemisphere sgn=" << sgn << " must be +1 (north) or -1 (south).");52 if (fabs(cm) > 180.) _error 2_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees.");53 if (sp < 0. || sp > 90.) _error 2_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere).");51 if (sgn !=+1 && sgn !=-1) _error_("Hemisphere sgn=" << sgn << " must be +1 (north) or -1 (south)."); 52 if (fabs(cm) > 180.) _error_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees."); 53 if (sp < 0. || sp > 90.) _error_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere)."); 54 54 55 55 /* Run core computations: */ -
issm/branches/trunk-jpl-damage/src/modules/InternalFront/InternalFront.cpp
r12878 r13101 26 26 /*Fetch required fields*/ 27 27 FetchData(&numberofelements,mxGetAssignedField(MODEL,0,"numberofelements")); 28 if(numberofelements<=0) _error 2_("No elements found in the model");28 if(numberofelements<=0) _error_("No elements found in the model"); 29 29 FetchData(&elements,&M,&N,mxGetAssignedField(MODEL,0,"elements")); 30 if(M!=numberofelements || N!=3) _error 2_("Field 'elements' should be of size [md.numberofelements 3]");30 if(M!=numberofelements || N!=3) _error_("Field 'elements' should be of size [md.numberofelements 3]"); 31 31 FetchData(&elementonwater,&M,&N,mxGetAssignedField(MODEL,0,"elementonwater")); 32 if(M!=numberofelements || N!=1) _error 2_("Field 'elementonwater' should be of size [md.numberofelements 1]");32 if(M!=numberofelements || N!=1) _error_("Field 'elementonwater' should be of size [md.numberofelements 1]"); 33 33 FetchData(&elementconnectivity,&M,&N,mxGetAssignedField(MODEL,0,"elementconnectivity")); 34 if(M!=numberofelements || N!=3) _error 2_("Field 'elementconnectivity' should be of size [md.numberofelements 3]");34 if(M!=numberofelements || N!=3) _error_("Field 'elementconnectivity' should be of size [md.numberofelements 3]"); 35 35 36 36 /*Allocate and initialize all variables*/ 37 37 numberofsegments=0; 38 front= (int*)xmalloc(3*numberofelements*4*sizeof(int));38 front=xNew<int>(3*numberofelements*4); 39 39 40 40 /*Loop over all elements on water*/ … … 81 81 /*Now that we know how many segments there is we can allocate the final matrix*/ 82 82 if(numberofsegments){ 83 front2= (double*)xmalloc(4*numberofsegments*sizeof(double));83 front2=xNew<double>(4*numberofsegments); 84 84 for(i=0;i<4*numberofsegments;i++) front2[i]=(double)front[i]; 85 85 } -
issm/branches/trunk-jpl-damage/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.cpp
r12878 r13101 46 46 if((nlhs!=NLHS) || (nrhs!=6 && nrhs!=7)){ 47 47 InterpFromGridToMeshUsage(); 48 _error 2_("usage. See above");48 _error_("usage. See above"); 49 49 } 50 50 -
issm/branches/trunk-jpl-damage/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp
r12878 r13101 69 69 if(nlhs!=NLHS){ 70 70 InterpFromMesh2dUsage(); 71 _error 2_("InterpFromMeshToMesh2dUsage usage error");71 _error_("InterpFromMeshToMesh2dUsage usage error"); 72 72 } 73 73 if((nrhs!=6) && (nrhs!=7) && (nrhs!=8)){ 74 74 InterpFromMesh2dUsage(); 75 _error 2_("InterpFromMeshToMesh2dUsage usage error");75 _error_("InterpFromMeshToMesh2dUsage usage error"); 76 76 } 77 77 … … 100 100 /*contours: */ 101 101 numcontours=mxGetNumberOfElements(matlabstructure); 102 contours= (Contour**)xmalloc(numcontours*sizeof(Contour*));102 contours=xNew<Contour*>(numcontours); 103 103 for(i=0;i<numcontours;i++){ 104 104 //allocate 105 contouri= (Contour*)xmalloc(sizeof(Contour));105 contouri=xNew<Contour>(1); 106 106 //retrieve dimension of this contour. 107 107 contouri->nods=(int)mxGetScalar(mxGetField(matlabstructure,i,"nods")); … … 131 131 /*some checks*/ 132 132 if (x_data_rows!=y_data_rows){ 133 _error 2_("vectors x and y should have the same length!");133 _error_("vectors x and y should have the same length!"); 134 134 } 135 135 if (x_prime_rows!=y_prime_rows){ 136 _error 2_("vectors x_prime and y_prime should have the same length!");136 _error_("vectors x_prime and y_prime should have the same length!"); 137 137 } 138 138 -
issm/branches/trunk-jpl-damage/src/modules/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp
r12878 r13101 28 28 if(nlhs!=NLHS){ 29 29 InterpFromMeshToMesh2dUsage(); 30 _error 2_("InterpFromMeshToMesh2dUsage usage error");30 _error_("InterpFromMeshToMesh2dUsage usage error"); 31 31 } 32 32 #endif … … 34 34 if(nrhs<NRHS){ 35 35 InterpFromMeshToMesh2dUsage(); 36 _error 2_("InterpFromMeshToMesh2dUsage usage error");36 _error_("InterpFromMeshToMesh2dUsage usage error"); 37 37 } 38 38 39 39 /*Fetch inputs: */ 40 FetchData(&index,&nels_data,&test,INDEX); if(test!=3) _error 2_("index should have 3 columns");41 FetchData(&x_data,&nods_data,X); if(nods_data<3) _error 2_("there should be at least three points");42 FetchData(&y_data,&test,Y); if(test!=nods_data) _error 2_("vectors x and y should have the same length");43 FetchData(&data,&M_data,&N_data,DATA); if(M_data*N_data<1) _error 2_("data is empty");44 FetchData(&x_interp,&N_interp,XINTERP); if(N_interp<1) _error 2_("no interpolation requested");45 FetchData(&y_interp,&test,YINTERP); if(test!=N_interp) _error 2_("vectors x_interp and y_interp should have the same length");40 FetchData(&index,&nels_data,&test,INDEX); if(test!=3) _error_("index should have 3 columns"); 41 FetchData(&x_data,&nods_data,X); if(nods_data<3) _error_("there should be at least three points"); 42 FetchData(&y_data,&test,Y); if(test!=nods_data) _error_("vectors x and y should have the same length"); 43 FetchData(&data,&M_data,&N_data,DATA); if(M_data*N_data<1) _error_("data is empty"); 44 FetchData(&x_interp,&N_interp,XINTERP); if(N_interp<1) _error_("no interpolation requested"); 45 FetchData(&y_interp,&test,YINTERP); if(test!=N_interp) _error_("vectors x_interp and y_interp should have the same length"); 46 46 FetchData(&options,NRHS,nrhs,ARGUMENTS); 47 47 -
issm/branches/trunk-jpl-damage/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp
r12878 r13101 76 76 /*some checks*/ 77 77 if (x_data_rows!=y_data_rows || x_data_rows!=z_data_rows){ 78 _error 2_("vectors x, y and z should have the same length!");78 _error_("vectors x, y and z should have the same length!"); 79 79 } 80 80 if (x_prime_rows!=y_prime_rows || x_prime_rows!=z_prime_rows){ 81 _error 2_("vectors x_prime, y_prime and z_prime should have the same length!");81 _error_("vectors x_prime, y_prime and z_prime should have the same length!"); 82 82 } 83 83 /*get number of elements and number of nodes in the data*/ -
issm/branches/trunk-jpl-damage/src/modules/KMLFileRead/KMLFileRead.cpp
r12878 r13101 45 45 /*checks on arguments on the matlab side: */ 46 46 if (nlhs > NLHS) { 47 KMLFileReadUsage(); _error 2_("KMLFileRead usage error");47 KMLFileReadUsage(); _error_("KMLFileRead usage error"); 48 48 } 49 49 if (nrhs < NRHS) { 50 KMLFileReadUsage(); _error 2_("KMLFileRead usage error");50 KMLFileReadUsage(); _error_("KMLFileRead usage error"); 51 51 } 52 52 -
issm/branches/trunk-jpl-damage/src/modules/KMLMeshWrite/KMLMeshWrite.cpp
r12878 r13101 40 40 /*checks on arguments on the matlab side: */ 41 41 if (nlhs > NLHS) { 42 KMLMeshWriteUsage(); _error 2_("KMLMeshWrite usage error");42 KMLMeshWriteUsage(); _error_("KMLMeshWrite usage error"); 43 43 } 44 44 if (nrhs < NRHS) { 45 KMLMeshWriteUsage(); _error 2_("KMLMeshWrite usage error");45 KMLMeshWriteUsage(); _error_("KMLMeshWrite usage error"); 46 46 } 47 47 … … 55 55 if (notesi && mxIsChar(notesi) && mxGetNumberOfElements(notesi)) { 56 56 if (!notes) { 57 notes= (char *) xmalloc((mxGetNumberOfElements(notesi)+1)*sizeof(char));57 notes=xNew<char>(mxGetNumberOfElements(notesi)+1); 58 58 mxGetString(notesi,notes,mxGetNumberOfElements(notesi)+1); 59 59 } … … 87 87 88 88 if (nodecon && (mncon != nnodes)) 89 {_error 2_("Nodal connectivity table, if supplied, must be supplied for all nodes.");}89 {_error_("Nodal connectivity table, if supplied, must be supplied for all nodes.");} 90 90 else if (!nodecon) 91 91 mncon=nnodes; 92 92 if ((llat != nnodes) || (llng != nnodes) || (llat != llng)) 93 _error 2_("Latitude and longitude vectors must be supplied for all nodes.");93 _error_("Latitude and longitude vectors must be supplied for all nodes."); 94 94 if (part && (lprt != nnodes)) 95 _error 2_("Partitioning vector, if supplied, must be supplied for all nodes.");95 _error_("Partitioning vector, if supplied, must be supplied for all nodes."); 96 96 if (data && !((mdata == nnodes) || (mdata == melem))) 97 _error 2_("Data matrix, if supplied, must be supplied for all nodes or all elements.");97 _error_("Data matrix, if supplied, must be supplied for all nodes or all elements."); 98 98 if (cmap && (ncmap != 3)) 99 _error 2_("Colormap matrix, if supplied, must have three columns for rgb.");99 _error_("Colormap matrix, if supplied, must have three columns for rgb."); 100 100 if (!strlen(filnam)) 101 101 strcpy(filnam,"stdout"); -
issm/branches/trunk-jpl-damage/src/modules/KMLOverlay/KMLOverlay.cpp
r12878 r13101 31 31 /*checks on arguments on the matlab side: */ 32 32 if(nlhs>NLHS){ 33 KMLOverlayUsage(); _error 2_("KMLOverlay usage error");33 KMLOverlayUsage(); _error_("KMLOverlay usage error"); 34 34 } 35 35 if(nrhs<NRHS){ 36 KMLOverlayUsage(); _error 2_("KMLOverlay usage error");36 KMLOverlayUsage(); _error_("KMLOverlay usage error"); 37 37 } 38 38 … … 51 51 52 52 /*some checks*/ 53 if (nlat !=2) _error 2_("Latitudinal axes \"lataxis\" require two double values, not " << nlat << ".");54 if (nlong!=2) _error 2_("Longitudinal axes \"longaxis\" require two double values, not " << nlong << ".");55 if (!nimages) _error 2_("No image files provided.");53 if (nlat !=2) _error_("Latitudinal axes \"lataxis\" require two double values, not " << nlat << "."); 54 if (nlong!=2) _error_("Longitudinal axes \"longaxis\" require two double values, not " << nlong << "."); 55 if (!nimages) _error_("No image files provided."); 56 56 57 57 if ((int)dzip){ … … 90 90 if (verbose) _printLine_(czip); 91 91 92 if (mexEvalString(czip)) _error 2_("Error zipping file \"" << filkmz << "\".");92 if (mexEvalString(czip)) _error_("Error zipping file \"" << filkmz << "\"."); 93 93 xfree((void**)&czip); 94 94 xfree((void**)&filkmz); -
issm/branches/trunk-jpl-damage/src/modules/Kml2Exp/Kml2Exp.cpp
r12878 r13101 22 22 /*checks on arguments on the matlab side: */ 23 23 if (nlhs > NLHS) { 24 Kml2ExpUsage(); _error 2_("Kml2Exp usage error");24 Kml2ExpUsage(); _error_("Kml2Exp usage error"); 25 25 } 26 26 if (nrhs < NRHS) { 27 Kml2ExpUsage(); _error 2_("Kml2Exp usage error");27 Kml2ExpUsage(); _error_("Kml2Exp usage error"); 28 28 } 29 29 … … 43 43 44 44 /*some checks*/ 45 if (sgn !=+1 && sgn!= -1) _error 2_("Hemisphere sgn=" << sgn << " must be +1 (north) or -1 (south).");46 if (fabs(cm) > 180.) _error 2_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees.");47 if (sp < 0. || sp > 90.) _error 2_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere).");45 if (sgn !=+1 && sgn!= -1) _error_("Hemisphere sgn=" << sgn << " must be +1 (north) or -1 (south)."); 46 if (fabs(cm) > 180.) _error_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees."); 47 if (sp < 0. || sp > 90.) _error_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere)."); 48 48 49 49 /* Run core computations: */ -
issm/branches/trunk-jpl-damage/src/modules/Kriging/Kriging.cpp
r12878 r13101 22 22 /*checks on arguments on the matlab side: */ 23 23 if (nrhs<NRHS || nlhs>NLHS){ 24 KrigingUsage(); _error 2_("Kriging usage error");24 KrigingUsage(); _error_("Kriging usage error"); 25 25 } 26 26 27 27 /*Fetch inputs: */ 28 28 FetchData(&x,&n_obs,X); 29 FetchData(&y,&N,Y); if(n_obs!=N) _error 2_("x and y should have the same size");30 FetchData(&observations,&N,OBSERVATIONS); if(n_obs!=N) _error 2_("x and observations should have the same size");29 FetchData(&y,&N,Y); if(n_obs!=N) _error_("x and y should have the same size"); 30 FetchData(&observations,&N,OBSERVATIONS); if(n_obs!=N) _error_("x and observations should have the same size"); 31 31 FetchData(&x_interp,&M_interp,&N_interp,XINTERP); 32 FetchData(&y_interp,&M,&N,YINTERP); if(N!=N_interp || M!=M_interp) _error 2_("x_interp and y_interp should have the same size");32 FetchData(&y_interp,&M,&N,YINTERP); if(N!=N_interp || M!=M_interp) _error_("x_interp and y_interp should have the same size"); 33 33 FetchData(&options,NRHS,nrhs,prhs); 34 34 -
issm/branches/trunk-jpl-damage/src/modules/Ll2xy/Ll2xy.cpp
r12878 r13101 25 25 /*checks on arguments on the matlab side: */ 26 26 if (nlhs > NLHS) { 27 Ll2xyUsage(); _error 2_("Ll2xy usage error");27 Ll2xyUsage(); _error_("Ll2xy usage error"); 28 28 } 29 29 if (nrhs < NRHS) { 30 Ll2xyUsage(); _error 2_("Ll2xy usage error");30 Ll2xyUsage(); _error_("Ll2xy usage error"); 31 31 } 32 32 … … 47 47 /*some checks*/ 48 48 if (verbose) _printLine_("Checking inputs:"); 49 if (nlat != nlon){_error 2_("Must have same number of lat[" << nlat << "] and lon[" << nlon << "] coordinates.");}49 if (nlat != nlon){_error_("Must have same number of lat[" << nlat << "] and lon[" << nlon << "] coordinates.");} 50 50 else ncoord=nlat; 51 if (sgn != +1 && sgn != -1) _error 2_("Hemisphere sgn=" << sgn << " must be +1 (north) or -1 (south).");52 if (fabs(cm) > 180.) _error 2_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees.");53 if (sp < 0. || sp > 90.) _error 2_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere).");51 if (sgn != +1 && sgn != -1) _error_("Hemisphere sgn=" << sgn << " must be +1 (north) or -1 (south)."); 52 if (fabs(cm) > 180.) _error_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees."); 53 if (sp < 0. || sp > 90.) _error_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere)."); 54 54 55 55 x=(double*)mxMalloc(ncoord*sizeof(double)); -
issm/branches/trunk-jpl-damage/src/modules/MeshPartition/MeshPartition.cpp
r12878 r13101 74 74 75 75 /*Post process node_partitioning and element_partitioning to be in double format. Metis needed them in int* format: */ 76 element_partitioning= (double*)xmalloc(numberofelements*sizeof(double));76 element_partitioning=xNew<double>(numberofelements); 77 77 for (i=0;i<numberofelements;i++){ 78 78 element_partitioning[i]=(double)int_element_partitioning[i]+1; //Metis indexing from 0, matlab from 1. 79 79 } 80 80 81 node_partitioning= (double*)xmalloc(numberofvertices*sizeof(double));81 node_partitioning=xNew<double>(numberofvertices); 82 82 for (i=0;i<numberofvertices;i++){ 83 83 node_partitioning[i]=(double)int_node_partitioning[i]+1; //Metis indexing from 0, matlab from 1. -
issm/branches/trunk-jpl-damage/src/modules/MeshProfileIntersection/MeshProfileIntersection.cpp
r12878 r13101 54 54 //index 55 55 FetchData(&double_index,&nel,&dummy,INDEX); 56 if(dummy!=3 && dummy!=6)_error 2_("element triangulation should be of 3 or 6 column width!");57 index= (int*)xmalloc(nel*3*sizeof(int));56 if(dummy!=3 && dummy!=6)_error_("element triangulation should be of 3 or 6 column width!"); 57 index=xNew<int>(nel*3); 58 58 for(i=0;i<nel;i++){ 59 59 for(j=0;j<3;j++){ … … 67 67 //contours 68 68 numcontours=mxGetNumberOfElements(matlabstructure); 69 contours= (Contour**)xmalloc(numcontours*sizeof(Contour*));69 contours=xNew<Contour*>(numcontours); 70 70 for(i=0;i<numcontours;i++){ 71 71 //allocate 72 contouri= (Contour*)xmalloc(sizeof(Contour));72 contouri=xNew<Contour>(1); 73 73 //retrieve dimension of this contour. 74 74 contouri->nods=(int)mxGetScalar(mxGetField(matlabstructure,i,"nods")); -
issm/branches/trunk-jpl-damage/src/modules/Scotch/Scotch.cpp
r12878 r13101 25 25 26 26 #ifndef _HAVE_SCOTCH_ //only works if scotch library has been compiled in. 27 _error 2_("Scotch not available! Cannot carry out Scotch partitioning!");27 _error_("Scotch not available! Cannot carry out Scotch partitioning!"); 28 28 #else 29 29 -
issm/branches/trunk-jpl-damage/src/modules/Shp2Kml/Shp2Kml.cpp
r12878 r13101 25 25 26 26 #ifndef _HAVE_SHAPELIB_ //only works if shapelib library has been compiled in. 27 _error 2_("Shapelib not available! Cannot carry out shp file translation!");27 _error_("Shapelib not available! Cannot carry out shp file translation!"); 28 28 #endif 29 29 … … 33 33 /*checks on arguments on the matlab side: */ 34 34 if (nlhs > NLHS) { 35 Shp2KmlUsage(); _error 2_("Shp2Kml usage error");35 Shp2KmlUsage(); _error_("Shp2Kml usage error"); 36 36 } 37 37 if (nrhs < NRHS) { 38 Shp2KmlUsage(); _error 2_("Shp2Kml usage error");38 Shp2KmlUsage(); _error_("Shp2Kml usage error"); 39 39 } 40 40 … … 54 54 55 55 /*some checks*/ 56 if (sgn < -1 || sgn > +1) _error 2_("Hemisphere sgn=" << sgn << " must be +1 (north), -1 (south), or 0 (no translation).");57 if (fabs(cm) > 180.) _error 2_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees.");58 if (sp < 0. || sp > 90.) _error 2_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere).");56 if (sgn < -1 || sgn > +1) _error_("Hemisphere sgn=" << sgn << " must be +1 (north), -1 (south), or 0 (no translation)."); 57 if (fabs(cm) > 180.) _error_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees."); 58 if (sp < 0. || sp > 90.) _error_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere)."); 59 59 60 60 /* Run core computations: */ -
issm/branches/trunk-jpl-damage/src/modules/StringToEnum/StringToEnum.cpp
r12878 r13101 5 5 #include "./StringToEnum.h" 6 6 7 void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){7 WRAPPER(StringToEnum){ 8 8 9 9 char *name = NULL; 10 10 int enum_out; 11 11 12 /*checks on arguments on the matlab side: */ 13 if(nrhs!=NRHS){ 14 StringToEnumUsage(); _error2_("usage. See above"); 15 } 12 /*Boot module: */ 13 MODULEBOOT(); 14 15 /*checks on arguments: */ 16 CHECKARGUMENTS(NLHS,NRHS,&StringToEnumUsage); 16 17 17 18 /*Fetch inputs: */ … … 23 24 /* output: */ 24 25 WriteData(ENUMOUT,enum_out); 26 27 /*end module: */ 28 MODULEEND(); 25 29 } 26 30 -
issm/branches/trunk-jpl-damage/src/modules/StringToEnum/StringToEnum.h
r12013 r13101 6 6 #define _STRINGTOENUM_H 7 7 8 /* local prototypes: */ 9 void StringToEnumUsage(void); 8 #ifdef HAVE_CONFIG_H 9 #include <config.h> 10 #else 11 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" 12 #endif 10 13 14 /*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/ 15 #ifdef _HAVE_PYTHON_ 16 #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol 17 #endif 18 19 /*Header files: */ 11 20 #include "../../c/include/globals.h" 12 21 #include "../../c/modules/modules.h" … … 15 24 #include "../../c/issm-binding.h" 16 25 26 #ifdef _HAVE_MATLAB_MODULES_ 17 27 /* serial input macros: */ 18 28 #define NAME (mxArray*)prhs[0] 19 20 29 /* serial output macros: */ 21 30 #define ENUMOUT (mxArray**)&plhs[0] 31 #endif 32 33 #ifdef _HAVE_PYTHON_MODULES_ 34 /* serial input macros: */ 35 #define NAME PyTuple_GetItem(args,0) 36 /* serial output macros: */ 37 #define ENUMOUT output,0 38 #endif 22 39 23 40 /* serial arg counts: */ … … 30 47 #define __FUNCT__ "StringToEnum" 31 48 49 /* local prototypes: */ 50 void StringToEnumUsage(void); 51 32 52 #endif /* _TEST_H */ -
issm/branches/trunk-jpl-damage/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp
r12878 r13101 73 73 nel=mxGetM(prhs[0]); 74 74 tindex_in=mxGetPr(prhs[0]); 75 index_in= (double*)xmalloc(nel*3*sizeof(double));75 index_in=xNew<double>(nel*3); 76 76 for (i=0;i<nel;i++){ 77 77 for (j=0;j<3;j++){ … … 88 88 nods=mxGetM(prhs[1]); 89 89 x_inm=mxGetPr(prhs[1]); 90 x_in= (double*)xmalloc(nods*sizeof(double));90 x_in=xNew<double>(nods); 91 91 for (i=0;i<nods;i++){ 92 92 x_in[i]=x_inm[i]; … … 100 100 if(mxIsDouble(prhs[2])){ 101 101 y_inm=mxGetPr(prhs[2]); 102 y_in= (double*)xmalloc(nods*sizeof(double));102 y_in=xNew<double>(nods); 103 103 for (i=0;i<nods;i++){ 104 104 y_in[i]=y_inm[i]; … … 113 113 num_seg=mxGetM(prhs[3]); 114 114 tsegments_in=mxGetPr(prhs[3]); 115 segments_in= (double*)xmalloc(num_seg*3*sizeof(double));115 segments_in=xNew<double>(num_seg*3); 116 116 for (i=0;i<num_seg;i++){ 117 117 for (j=0;j<3;j++){ … … 127 127 if(mxIsDouble(prhs[4])){ 128 128 tsegmentmarkers_in=mxGetPr(prhs[4]); 129 segmentmarkers_in= (double*)xmalloc(num_seg*sizeof(double));129 segmentmarkers_in=xNew<double>(num_seg); 130 130 for (i=0;i<num_seg;i++){ 131 131 segmentmarkers_in[i]=tsegmentmarkers_in[i]; -
issm/branches/trunk-jpl-damage/src/modules/Xy2ll/Xy2ll.cpp
r12878 r13101 24 24 /*checks on arguments on the matlab side: */ 25 25 if (nlhs > NLHS) { 26 Xy2llUsage(); _error 2_("Xy2ll usage error");26 Xy2llUsage(); _error_("Xy2ll usage error"); 27 27 } 28 28 if (nrhs < NRHS) { 29 Xy2llUsage(); _error 2_("Xy2ll usage error");29 Xy2llUsage(); _error_("Xy2ll usage error"); 30 30 } 31 31 … … 45 45 46 46 /*some checks*/ 47 if (nx != ny){_error 2_("Must have same number of x[" << nx << "] and y[" << ny << "] coordinates.");}47 if (nx != ny){_error_("Must have same number of x[" << nx << "] and y[" << ny << "] coordinates.");} 48 48 else ncoord=nx; 49 if (sgn != +1 && sgn != -1) _error 2_("Hemisphere sgn=" << sgn << " must be +1 (north) or -1 (south).");50 if (fabs(cm) > 180.) _error 2_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees.");51 if (sp < 0. || sp > 90.) _error 2_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere).");49 if (sgn != +1 && sgn != -1) _error_("Hemisphere sgn=" << sgn << " must be +1 (north) or -1 (south)."); 50 if (fabs(cm) > 180.) _error_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees."); 51 if (sp < 0. || sp > 90.) _error_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere)."); 52 52 53 53 lat=(double*)mxMalloc(ncoord*sizeof(double)); -
issm/branches/trunk-jpl-damage/src/modules/matlab/Makefile.am
r12878 r13101 1 INCLUDES = @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@ 1 AM_CPPFLAGS = @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@ 2 2 3 EXEEXT=$(MATLABWRAPPEREXT) 3 #Bin programs {{{1 4 5 #Modules {{{1 4 6 if MODULES 5 bin_PROGRAMS = AverageFilter\6 BamgMesher\7 BamgConvertMesh\8 BamgTriangulate\9 Chaco\10 ContourToMesh\11 ContourToNodes\12 ElementConnectivity\13 EnumToString\14 Exp2Kml\15 HoleFiller\16 InternalFront\17 InterpFromGridToMesh\18 InterpFromMeshToMesh2d\19 InterpFromMeshToMesh3d\20 InterpFromMeshToGrid\21 InterpFromMesh2d\22 KMLFileRead\23 KMLMeshWrite\24 KMLOverlay\25 Kml2Exp\26 Kriging\27 Ll2xy\28 NodeConnectivity\29 MeshPartition\30 MeshProfileIntersection\31 PointCloudFindNeighbors\32 PropagateFlagsFromConnectivity\33 Scotch\34 Shp2Kml\35 StringToEnum\36 TriaSearch\37 TriMesh\38 TriMeshProcessRifts\39 Xy2ll 7 lib_LTLIBRARIES = AverageFilter.la\ 8 BamgMesher.la\ 9 BamgConvertMesh.la\ 10 BamgTriangulate.la\ 11 ContourToMesh.la\ 12 ContourToNodes.la\ 13 ElementConnectivity.la\ 14 EnumToString.la\ 15 Exp2Kml.la\ 16 HoleFiller.la\ 17 InternalFront.la\ 18 InterpFromGridToMesh.la\ 19 InterpFromMeshToMesh2d.la\ 20 InterpFromMeshToMesh3d.la\ 21 InterpFromMeshToGrid.la\ 22 InterpFromMesh2d.la\ 23 KMLFileRead.la\ 24 KMLMeshWrite.la\ 25 KMLOverlay.la\ 26 Kml2Exp.la\ 27 Kriging.la\ 28 Ll2xy.la\ 29 NodeConnectivity.la\ 30 MeshPartition.la\ 31 MeshProfileIntersection.la\ 32 PointCloudFindNeighbors.la\ 33 PropagateFlagsFromConnectivity.la\ 34 Shp2Kml.la\ 35 StringToEnum.la\ 36 TriaSearch.la\ 37 TriMesh.la\ 38 TriMeshProcessRifts.la\ 39 Scotch.la\ 40 Xy2ll.la\ 41 Chaco.la 40 42 endif 41 43 #}}} 42 44 #Flags and libraries {{{1 43 LDADD = ../../c/libISSMCore.a ../../c/libISSMModules.a $(TRIANGLELIB) $(PETSCLIB) $(FLIBS) $(PLAPACKLIB) $(SPOOLESLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(SHAPELIBLIB) $(GSLLIB) 45 if SHAREDLIBS 46 deps = ../../c/libISSMCore.la ../../c/libISSMModules.la 47 else 48 deps = ../../c/libISSMCore.a ../../c/libISSMModules.a 49 endif 50 51 deps += $(MATHLIB) ${MEXLIB} 52 53 #$(TRIANGLELIB) $(PETSCLIB) $(FLIBS) $(PLAPACKLIB) $(SPOOLESLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(SHAPELIBLIB) $(GSLLIB) 44 54 45 55 #Triangle library … … 47 57 48 58 #Matlab part 49 AM_LDFLAGS = $(MEXLINK) 59 AM_LDFLAGS = $(MEXLINK) -shrext ${EXEEXT} -module 60 if VERSION 61 AM_LDFLAGS += 62 else 63 AM_LDFLAGS += -avoid-version 64 endif 65 if SHAREDLIBS 66 deps += ../../c/libISSMMatlab.la 67 else 68 deps += ../../c/libISSMMatlab.a 69 AM_LDFLAGS += --no-warnings 70 endif 71 50 72 AM_CXXFLAGS += -D_HAVE_MATLAB_MODULES_ -D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread 51 LDADD += $(MEXLIB) ../../c/libISSMMatlab.a 52 LDADD += ../../c/libISSMCore.a 53 if CIRCULAR_DEPENDENCIES 54 LDADD += $(TRIANGLELIB) $(PETSCLIB) $(FLIBS) $(PLAPACKLIB) $(SPOOLESLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(SHAPELIBLIB) $(GSLLIB) 55 endif 56 LDADD += ../../c/libISSMModules.a 73 74 ###################################################################################### 75 # Circular dependencies may not be necessary here. 76 #deps += ../../c/libISSMCore.a 77 #if CIRCULAR_DEPENDENCIES 78 #deps += $(TRIANGLELIB) $(PETSCLIB) $(FLIBS) $(PLAPACKLIB) $(SPOOLESLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(SHAPELIBLIB) $(GSLLIB) 79 #endif 80 ###################################################################################### 81 82 if SHAREDLIBS 83 deps += 84 else 85 deps += ../../c/libISSMModules.a ../../c/libISSMCore.a 86 endif 57 87 58 88 #Optimization flags: 59 89 AM_CXXFLAGS += $(CXXOPTFLAGS) 60 90 #}}} 91 61 92 #Bin sources {{{1 62 AverageFilter_ SOURCES = ../AverageFilter/AverageFilter.cpp\93 AverageFilter_la_SOURCES = ../AverageFilter/AverageFilter.cpp\ 63 94 ../AverageFilter/AverageFilter.h 64 65 BamgMesher_SOURCES = ../BamgMesher/BamgMesher.cpp\ 95 AverageFilter_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 96 97 BamgMesher_la_SOURCES = ../BamgMesher/BamgMesher.cpp\ 66 98 ../BamgMesher/BamgMesher.h 67 68 BamgConvertMesh_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp\ 99 BamgMesher_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 100 101 BamgConvertMesh_la_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp\ 69 102 ../BamgConvertMesh/BamgConvertMesh.h 70 71 BamgTriangulate_SOURCES = ../BamgTriangulate/BamgTriangulate.cpp\ 103 BamgConvertMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 104 105 BamgTriangulate_la_SOURCES = ../BamgTriangulate/BamgTriangulate.cpp\ 72 106 ../BamgTriangulate/BamgTriangulate.h 73 74 Chaco_SOURCES = ../Chaco/Chaco.cpp\ 107 BamgTriangulate_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 108 109 Chaco_la_SOURCES = ../Chaco/Chaco.cpp\ 75 110 ../Chaco/Chaco.h 76 77 ContourToMesh_SOURCES = ../ContourToMesh/ContourToMesh.cpp\ 78 ../ContourToMesh/ContourToMesh.h 79 80 ContourToNodes_SOURCES = ../ContourToNodes/ContourToNodes.cpp\ 111 Chaco_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(CHACOLIB) 112 113 ContourToMesh_la_SOURCES = ../ContourToMesh/ContourToMesh.cpp\ 114 ../ContourToMesh/ContourToMesh.h 115 ContourToMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB) 116 117 ContourToNodes_la_SOURCES = ../ContourToNodes/ContourToNodes.cpp\ 81 118 ../ContourToNodes/ContourToNodes.h 82 83 ElementConnectivity_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\ 119 ContourToNodes_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 120 121 ElementConnectivity_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\ 84 122 ../ElementConnectivity/ElementConnectivity.h 85 86 EnumToString_SOURCES = ../EnumToString/EnumToString.cpp\ 123 ElementConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 124 125 EnumToString_la_SOURCES = ../EnumToString/EnumToString.cpp\ 87 126 ../EnumToString/EnumToString.h 88 89 StringToEnum_SOURCES = ../StringToEnum/StringToEnum.cpp\ 127 EnumToString_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 128 129 StringToEnum_la_SOURCES = ../StringToEnum/StringToEnum.cpp\ 90 130 ../StringToEnum/StringToEnum.h 91 92 HoleFiller_SOURCES = ../HoleFiller/HoleFiller.cpp\ 131 StringToEnum_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 132 133 HoleFiller_la_SOURCES = ../HoleFiller/HoleFiller.cpp\ 93 134 ../HoleFiller/HoleFiller.h 94 95 InternalFront_SOURCES = ../InternalFront/InternalFront.cpp\ 135 HoleFiller_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 136 137 InternalFront_la_SOURCES = ../InternalFront/InternalFront.cpp\ 96 138 ../InternalFront/InternalFront.h 97 98 InterpFromGridToMesh_SOURCES = ../InterpFromGridToMesh/InterpFromGridToMesh.cpp\ 139 InternalFront_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 140 141 InterpFromGridToMesh_la_SOURCES = ../InterpFromGridToMesh/InterpFromGridToMesh.cpp\ 99 142 ../InterpFromGridToMesh/InterpFromGridToMesh.h 100 101 InterpFromMeshToMesh2d_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp\ 143 InterpFromGridToMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB) 144 145 InterpFromMeshToMesh2d_la_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp\ 102 146 ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h 103 104 InterpFromMeshToMesh3d_SOURCES = ../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp\ 147 InterpFromMeshToMesh2d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB) 148 149 InterpFromMeshToMesh3d_la_SOURCES = ../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp\ 105 150 ../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.h 106 107 InterpFromMeshToGrid_SOURCES = ../InterpFromMeshToGrid/InterpFromMeshToGrid.cpp\ 151 InterpFromMeshToMesh3d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 152 153 InterpFromMeshToGrid_la_SOURCES = ../InterpFromMeshToGrid/InterpFromMeshToGrid.cpp\ 108 154 ../InterpFromMeshToGrid/InterpFromMeshToGrid.h 109 110 InterpFromMesh2d_SOURCES = ../InterpFromMesh2d/InterpFromMesh2d.cpp\ 155 InterpFromMeshToGrid_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 156 157 InterpFromMesh2d_la_SOURCES = ../InterpFromMesh2d/InterpFromMesh2d.cpp\ 111 158 ../InterpFromMesh2d/InterpFromMesh2d.h 112 113 KMLFileRead_SOURCES = ../KMLFileRead/KMLFileRead.cpp\ 159 InterpFromMesh2d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB) 160 161 KMLFileRead_la_SOURCES = ../KMLFileRead/KMLFileRead.cpp\ 114 162 ../KMLFileRead/KMLFileRead.h 115 116 KMLMeshWrite_SOURCES = ../KMLMeshWrite/KMLMeshWrite.cpp\ 163 KMLFileRead_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 164 165 KMLMeshWrite_la_SOURCES = ../KMLMeshWrite/KMLMeshWrite.cpp\ 117 166 ../KMLMeshWrite/KMLMeshWrite.h 118 119 KMLOverlay_SOURCES = ../KMLOverlay/KMLOverlay.cpp\ 167 KMLMeshWrite_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 168 169 KMLOverlay_la_SOURCES = ../KMLOverlay/KMLOverlay.cpp\ 120 170 ../KMLOverlay/KMLOverlay.h 121 122 Xy2ll_SOURCES = ../Xy2ll/Xy2ll.cpp\ 171 KMLOverlay_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 172 173 Xy2ll_la_SOURCES = ../Xy2ll/Xy2ll.cpp\ 123 174 ../Xy2ll/Xy2ll.h 124 125 Ll2xy_SOURCES = ../Ll2xy/Ll2xy.cpp\ 175 Xy2ll_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 176 177 Ll2xy_la_SOURCES = ../Ll2xy/Ll2xy.cpp\ 126 178 ../Ll2xy/Ll2xy.h 127 128 Exp2Kml_SOURCES = ../Exp2Kml/Exp2Kml.cpp\ 179 Ll2xy_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 180 181 Exp2Kml_la_SOURCES = ../Exp2Kml/Exp2Kml.cpp\ 129 182 ../Exp2Kml/Exp2Kml.h 130 131 Kml2Exp_SOURCES = ../Kml2Exp/Kml2Exp.cpp\ 183 Exp2Kml_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 184 185 Kml2Exp_la_SOURCES = ../Kml2Exp/Kml2Exp.cpp\ 132 186 ../Kml2Exp/Kml2Exp.h 133 134 Kriging_SOURCES = ../Kriging/Kriging.cpp\ 187 Kml2Exp_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 188 189 Kriging_la_SOURCES = ../Kriging/Kriging.cpp\ 135 190 ../Kriging/Kriging.h 136 137 MeshPartition_SOURCES = ../MeshPartition/MeshPartition.cpp\ 191 Kriging_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB) 192 193 MeshPartition_la_SOURCES = ../MeshPartition/MeshPartition.cpp\ 138 194 ../MeshPartition/MeshPartition.h 139 140 MeshProfileIntersection_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp\ 195 MeshPartition_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 196 197 MeshProfileIntersection_la_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp\ 141 198 ../MeshProfileIntersection/MeshProfileIntersection.h 142 143 NodeConnectivity_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp\ 199 MeshProfileIntersection_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 200 201 NodeConnectivity_la_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp\ 144 202 ../NodeConnectivity/NodeConnectivity.h 145 146 PointCloudFindNeighbors_SOURCES = ../PointCloudFindNeighbors/PointCloudFindNeighbors.cpp\ 203 NodeConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 204 205 PointCloudFindNeighbors_la_SOURCES = ../PointCloudFindNeighbors/PointCloudFindNeighbors.cpp\ 147 206 ../PointCloudFindNeighbors/PointCloudFindNeighbors.h 148 149 PropagateFlagsFromConnectivity_SOURCES = ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp\ 207 PointCloudFindNeighbors_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB) 208 209 PropagateFlagsFromConnectivity_la_SOURCES = ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp\ 150 210 ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h 151 152 Scotch_SOURCES = ../Scotch/Scotch.cpp\ 153 ../Scotch/Scotch.h 154 155 Shp2Kml_SOURCES = ../Shp2Kml/Shp2Kml.cpp\ 156 ../Shp2Kml/Shp2Kml.h 157 158 TriaSearch_SOURCES = ../TriaSearch/TriaSearch.cpp\ 211 PropagateFlagsFromConnectivity_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 212 213 Scotch_la_SOURCES = ../Scotch/Scotch.cpp\ 214 ../Scotch/Scotch.h 215 Scotch_la_LIBADD = ${deps} $(SCOTCHLIB) 216 217 Shp2Kml_la_SOURCES = ../Shp2Kml/Shp2Kml.cpp\ 218 ../Shp2Kml/Shp2Kml.h 219 Shp2Kml_la_LIBADD = ${deps} 220 221 TriaSearch_la_SOURCES = ../TriaSearch/TriaSearch.cpp\ 159 222 ../TriaSearch/TriaSearch.h 160 161 TriMesh_SOURCES = ../TriMesh/TriMesh.cpp\ 162 ../TriMesh/TriMesh.h 163 164 TriMeshProcessRifts_SOURCES = ../TriMeshProcessRifts/TriMeshProcessRifts.cpp\ 223 TriaSearch_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 224 225 TriMesh_la_SOURCES = ../TriMesh/TriMesh.cpp\ 226 ../TriMesh/TriMesh.h 227 TriMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(TRIANGLELIB) 228 229 TriMeshProcessRifts_la_SOURCES = ../TriMeshProcessRifts/TriMeshProcessRifts.cpp\ 165 230 ../TriMeshProcessRifts/TriMeshProcessRifts.h 231 TriMeshProcessRifts_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 166 232 #}}} -
issm/branches/trunk-jpl-damage/src/modules/python/Makefile.am
r12878 r13101 1 INCLUDES = @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@1 AM_CPPFLAGS = @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @BOOSTINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@ 2 2 EXEEXT=$(PYTHONWRAPPEREXT) 3 3 #Bin programs {{{1 4 4 if MODULES 5 5 bin_PROGRAMS = ElementConnectivity\ 6 EnumToString\ 6 7 InterpFromMeshToMesh2d \ 7 8 NodeConnectivity\ 8 TriMesh 9 StringToEnum\ 10 TriMesh 9 11 endif 10 12 #}}} … … 32 34 ../ElementConnectivity/ElementConnectivity.h 33 35 36 EnumToString_SOURCES = ../EnumToString/EnumToString.cpp\ 37 ../EnumToString/EnumToString.h 38 34 39 InterpFromMeshToMesh2d_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp\ 35 40 ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h … … 38 43 ../NodeConnectivity/NodeConnectivity.h 39 44 45 StringToEnum_SOURCES = ../StringToEnum/StringToEnum.cpp\ 46 ../StringToEnum/StringToEnum.h 47 40 48 TriMesh_SOURCES = ../TriMesh/TriMesh.cpp\ 41 49 ../TriMesh/TriMesh.h -
issm/branches/trunk-jpl-damage/startup.m
r12168 r13101 27 27 28 28 %ISSM path 29 addpath([ISSM_DIR '/src/m/ utils/']); %loads recursivepath29 addpath([ISSM_DIR '/src/m/os/']); %loads recursivepath 30 30 addpath([ISSM_DIR '/bin']); 31 addpath([ISSM_DIR '/lib']); 31 32 addpath(recursivepath([ISSM_DIR '/src/m'])); 32 33 addpath(recursivepath([ISSM_DIR '/externalpackages/scotch'])); -
issm/branches/trunk-jpl-damage/test/NightlyRun/IdToName.py
r12946 r13101 67 67 234 : 'SquareShelfTranForceNeg2dDakotaSamp', 68 68 235 : 'SquareShelfTranForceNeg2dDakotaLocal', 69 236 : 'SquareShelfTranIspddIsdeltaM2d' ;70 237 : 'SquareShelfTranIspddIsdeltaM3d' ;69 236 : 'SquareShelfTranIspddIsdeltaM2d', 70 237 : 'SquareShelfTranIspddIsdeltaM3d', 71 71 301 : 'SquareSheetConstrainedDiagM2d', 72 72 302 : 'SquareSheetConstrainedDiagH2d', -
issm/branches/trunk-jpl-damage/test/NightlyRun/runme.m
r12878 r13101 72 72 % }}} 73 73 %GET ids {{{1 74 list=dir;%use dir, as it seems to act OS independent74 flist=dir;%use dir, as it seems to act OS independent 75 75 list_ids=[]; 76 for i=1:numel( list),77 if ( strncmp( list(i).name,'test',4) &... %File name must start with 'test'78 strncmp(fliplr( list(i).name),fliplr('.m'),2)&... %File name must end by '.m'79 ~strcmp( list(i).name,'test.m')) %File name must be different than 'test.m'80 list_ids(end+1)=eval( list(i).name(5:end-2)); %Keep test id only (skip 'test' and '.m')76 for i=1:numel(flist), 77 if ( strncmp(flist(i).name,'test',4) &... %File name must start with 'test' 78 strncmp(fliplr(flist(i).name),fliplr('.m'),2)&... %File name must end by '.m' 79 ~strcmp(flist(i).name,'test.m')) %File name must be different than 'test.m' 80 list_ids(end+1)=eval(flist(i).name(5:end-2)); %Keep test id only (skip 'test' and '.m') 81 81 end 82 82 end -
issm/branches/trunk-jpl-damage/test/NightlyRun/runme.py
r12878 r13101 42 42 from parallelrange import parallelrange 43 43 from IdToName import IdToName 44 from MatlabFuncs import * 44 45 45 46 #Get ISSM_DIR variable … … 49 50 #Process options 50 51 #GET benchmark {{{1 51 if not benchmark.lower() in ['all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing']:52 if not ismember(benchmark,['all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing']): 52 53 print "runme warning: benchmark '%s' not supported, defaulting to test 'nightly'." % benchmark 53 54 benchmark='nightly' 54 55 # }}} 55 56 #GET procedure {{{1 56 if not procedure.lower() in ['check','update']:57 if not ismember(procedure,['check','update']): 57 58 print "runme warning: procedure '%s' not supported, defaulting to test 'check'." % procedure 58 59 procedure='check' 59 60 # }}} 60 61 #GET output {{{1 61 if not output.lower() in ['nightly','daily','none']:62 if not ismember(output,['nightly','daily','none']): 62 63 print "runme warning: output '%s' not supported, defaulting to test 'none'." % output 63 64 output='none' … … 107 108 108 109 #Process Ids according to benchmarks {{{1 109 if benchmark.lower() == 'nightly':110 if strcmpi(benchmark,'nightly'): 110 111 test_ids=test_ids.intersection(set(range(1,1000))) 111 elif benchmark.lower() == 'ismip':112 elif strcmpi(benchmark,'ismip'): 112 113 test_ids=test_ids.intersection(set(range(1101,1200))) 113 elif benchmark.lower() == 'eismint':114 elif strcmpi(benchmark,'eismint'): 114 115 test_ids=test_ids.intersection(set(range(1201,1300))) 115 elif benchmark.lower() == 'thermal':116 elif strcmpi(benchmark,'thermal'): 116 117 test_ids=test_ids.intersection(set(range(1301,1400))) 117 elif benchmark.lower() == 'mesh':118 elif strcmpi(benchmark,'mesh'): 118 119 test_ids=test_ids.intersection(set(range(1401,1500))) 119 elif benchmark.lower() == 'validation':120 elif strcmpi(benchmark,'validation'): 120 121 test_ids=test_ids.intersection(set(range(1001,2000))) 121 elif benchmark.lower() == 'tranforcing':122 elif strcmpi(benchmark,'tranforcing'): 122 123 test_ids=test_ids.intersection(set(range(1501,1503))) 123 124 # print 'test_ids after benchmark =',test_ids … … 139 140 #UPDATE ARCHIVE? 140 141 archive_name='Archive'+str(id) 141 if procedure.lower() == 'update':142 143 if not s ocket.gethostname().lower().split('.')[0] == 'larsen':142 if strcmpi(procedure,'update'): 143 144 if not strcmp(socket.gethostname().lower().split('.')[0],'larsen'): 144 145 # raise RuntimeError("Nightly run archives must be saved on 'larsen' (hostname is '"+socket.gethostname()+"').") 145 146 print "Nightly run archives must be saved on 'larsen' (hostname is '"+socket.gethostname()+"')." … … 200 201 directory=os.getcwd().split('/') # not used? 201 202 message=me2 202 if output.lower() == 'nightly':203 if strcmpi(output,'nightly'): 203 204 fid=open(os.path.join(ISSM_DIR,'nightlylog','matlaberror.log'), 'a') 204 205 fid.write('%s' % message) … … 206 207 fid.close() 207 208 print 'FAILURE difference: N/A test id: %i test name: %s field: %s' % (id,id_string,fieldname) 208 elif output.lower() == 'daily':209 elif strcmpi(output,'daily'): 209 210 fid=open(os.path.join(ISSM_DIR,'dailylog','matlaberror.log'), 'a') 210 211 fid.write('%s' % message) … … 223 224 directory=os.getcwd().split('/') # not used? 224 225 message=me 225 if output.lower() == 'nightly':226 if strcmpi(output,'nightly'): 226 227 fid=open(os.path.join(ISSM_DIR+'nightlylog','matlaberror.log'), 'a') 227 228 fid.write('%s' % message) … … 229 230 fid.close() 230 231 print 'FAILURE difference: N/A test id: %i test name: %s field: %s' % (id,id_string,'N/A') 231 elif output.lower() == 'daily':232 elif strcmpi(output,'daily'): 232 233 fid=open(os.path.join(ISSM_DIR+'dailylog','matlaberror.log'), 'a') 233 234 fid.write('%s' % message) -
issm/branches/trunk-jpl-damage/test/NightlyRun/test101.py
r12946 r13101 14 14 md=setflowequation(md,'macayeal','all') 15 15 md.cluster=generic('name',oshostname(),'np',3) 16 md.diagnostic.requested_outputs=StressTensorEnum 17 md=solve(md,DiagnosticSolutionEnum )16 md.diagnostic.requested_outputs=StressTensorEnum() 17 md=solve(md,DiagnosticSolutionEnum()) 18 18 19 19 #Fields and tolerances to track changes -
issm/branches/trunk-jpl-damage/test/NightlyRun/test218.m
r12878 r13101 84 84 85 85 %Fields and tolerances to track changes 86 md =tres(md,'dakota');86 md.qmu.results=md.results.dakota; 87 87 md.results.dakota.importancefactors=importancefactors(md,'scaled_MaterialsRheologyB','MaxVel')'; 88 88 field_names ={'importancefactors'}; -
issm/branches/trunk-jpl-damage/test/NightlyRun/test225.m
r12878 r13101 2 2 md=setmask(md,'all',''); 3 3 md=parameterize(md,'../Par/SquareShelf.par'); 4 md.geometry.bed=md.geometry.bed+50; md.geometry.surface=md.geometry.surface+50; 4 5 md=extrude(md,3,1); 5 6 md=setflowequation(md,'pattyn','all'); 6 md.geometry.bed=md.geometry.bed+50; md.geometry.surface=md.geometry.surface+50;7 7 md.cluster=generic('name',oshostname(),'np',3); 8 8 md.prognostic.hydrostatic_adjustment='Incremental'; -
issm/branches/trunk-jpl-damage/test/NightlyRun/test234.m
r12878 r13101 56 56 %solve 57 57 md=solve(md,TransientSolutionEnum,'overwrite','y'); 58 md =tres(md,'dakota');58 md.qmu.results=md.results.dakota; 59 59 60 60 %Fields and tolerances to track changes -
issm/branches/trunk-jpl-damage/test/NightlyRun/test235.m
r12878 r13101 56 56 %solve 57 57 md=solve(md,TransientSolutionEnum,'overwrite','y'); 58 md =tres(md,'dakota');58 md.qmu.results=md.results.dakota; 59 59 60 60 %Fields and tolerances to track changes -
issm/branches/trunk-jpl-damage/test/NightlyRun/test412.m
r12878 r13101 36 36 37 37 %Fields and tolerances to track changes 38 md =tres(md,'dakota');38 md.qmu.results=md.results.dakota; 39 39 md.results.dakota.importancefactors=importancefactors(md,'scaled_FrictionCoefficient','MaxVel')'; 40 40 field_names ={'importancefactors'}; -
issm/branches/trunk-jpl-damage/test/NightlyRun/test413.m
r12878 r13101 37 37 38 38 %Fields and tolerances to track changes 39 md =tres(md,'dakota');39 md.qmu.results=md.results.dakota; 40 40 md.results.dakota.importancefactors=importancefactors(md,'scaled_FrictionCoefficient','MaxVel')'; 41 41 field_names ={'importancefactors'}; -
issm/branches/trunk-jpl-damage/test/NightlyRun/test414.m
r12878 r13101 49 49 %solve 50 50 md=solve(md,DiagnosticSolutionEnum,'overwrite','y'); 51 md =tres(md,'dakota');51 md.qmu.results=md.results.dakota; 52 52 53 53 %Fields and tolerances to track changes -
issm/branches/trunk-jpl-damage/test/NightlyRun/test417.m
r12878 r13101 53 53 54 54 %Fields and tolerances to track changes 55 md =tres(md,'dakota');55 md.qmu.results=md.results.dakota; 56 56 57 57 %ok, mass flux of 3 profiles should be -3 Gt/yr -3 Gt/yr and the sum, which is -6 Gt/yr -
issm/branches/trunk-jpl-damage/test/NightlyRun/test420.m
r12878 r13101 33 33 %solve 34 34 md=solve(md,DiagnosticSolutionEnum,'overwrite','y'); 35 md =tres(md,'dakota');35 md.qmu.results=md.results.dakota; 36 36 37 37 %test on thickness -
issm/branches/trunk-jpl-damage/test/NightlyRun/test511.m
r12878 r13101 8 8 md=extrude(md,3,1); 9 9 md=setflowequation(md,'stokes','all'); 10 md= modelextract(md,md.mask.elementonfloatingice);10 md=extract(md,md.mask.elementonfloatingice); 11 11 12 12 %control parameters -
issm/branches/trunk-jpl-damage/test/NightlyRun/test613.m
r12878 r13101 6 6 7 7 %Ice sheet only 8 md= modelextract(md,md.mask.elementongroundedice);8 md=extract(md,md.mask.elementongroundedice); 9 9 pos=find(md.mesh.vertexonboundary); 10 10 md.balancethickness.spcthickness(pos)=md.geometry.thickness(pos); -
issm/branches/trunk-jpl-damage/test/Par/SquareShelfConstrained.py
r12878 r13101 2 2 from verbose import * 3 3 import scipy.io as matio 4 import InterpFromMeshToMesh2d as im 5 from 4 from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d 5 from paterson import * 6 6 from SetIceShelfBC import * 7 7 import inspect 8 import os.path 8 9 9 10 #Start defining model parameters here … … 29 30 index=reshape(index.T,(len(index),3),order='F') 30 31 31 md.initialization.vx = im.InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)32 md.initialization.vy = im.InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)32 [md.initialization.vx] = InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y) 33 [md.initialization.vy] = InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y) 33 34 md.initialization.vz = zeros(md.mesh.numberofvertices) 34 35 md.initialization.pressure = zeros(md.mesh.numberofvertices) … … 62 63 #Change name so that no tests have the same name 63 64 if len(inspect.stack()) > 2: 64 md.miscellaneous.name = inspect.stack()[2][1].split('.')[0]65 md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0] 65 66
Note:
See TracChangeset
for help on using the changeset viewer.