Changeset 11684
- Timestamp:
- 03/12/12 14:40:42 (13 years ago)
- Location:
- issm/branches/trunk-jpl-damage
- Files:
-
- 3 deleted
- 119 edited
- 50 copied
Legend:
- Unmodified
- Added
- Removed
-
issm/branches/trunk-jpl-damage
-
issm/branches/trunk-jpl-damage/configure.ac
r11577 r11684 19 19 src/Makefile 20 20 src/c/Makefile 21 src/ad/Makefile22 21 src/mex/Makefile 23 22 src/m/Makefile … … 50 49 src/m/utils/Ecco3/Makefile 51 50 src/m/utils/Exp/Makefile 51 src/m/utils/Exp/manipulation/Makefile 52 src/m/utils/Exp/readwrite/Makefile 52 53 src/m/utils/Geometry/Makefile 53 54 src/m/utils/ImageProcessing/Makefile -
issm/branches/trunk-jpl-damage/cron
- Property svn:ignore
-
old new 1 trunk-jpl2 1 trunk-jpl-damage
-
- Property svn:ignore
-
issm/branches/trunk-jpl-damage/cron/configs/linux64_schlegel_daily
r11577 r11684 19 19 #COMPILATION CONFIGURATION FILE 20 20 COMPILE_CONFIG_FILE="config-linux64-astrid.sh" 21 22 #MATLAB path 23 MATLAB_PATH="/usr/local/pkgs/matlab-7.6/" 21 24 22 25 #----------------------# … … 57 60 #Corresponding list of installation files to use 58 61 EXTERNALPACKAGES_CONFIGS=" install.sh install.sh install.sh install-1.0.2-linux64.sh install-3.2-linux64.sh install-4.0-linux64.sh install-linux64.sh install-linux64-astrid.sh install.sh" 59 EXTERNALPACKAGES_NUMCPUS=" 8 8 8 8 8 8"60 62 61 63 #---------------------# … … 97 99 NROPTIONS="" 98 100 99 #------------------------#100 # 7: Matlab#101 #------------------------#102 103 #MATLAB path104 MATLAB_PATH="/usr/local/pkgs/matlab-7.6/"105 106 MATLABBIN="/usr/local/pkgs/matlab-7.6/bin/matlab" -
issm/branches/trunk-jpl-damage/cron/configs/linux64_schlegel_nightly
r11577 r11684 19 19 #COMPILATION CONFIGURATION FILE 20 20 COMPILE_CONFIG_FILE="config-linux64-astrid.sh" 21 22 #MATLAB path 23 MATLAB_PATH="/usr/local/pkgs/matlab-7.6/" 21 24 22 25 #----------------------# … … 57 60 #Corresponding list of installation files to use 58 61 EXTERNALPACKAGES_CONFIGS=" install.sh install.sh install.sh install-1.0.2-linux64.sh install-3.2-linux64.sh install-4.0-linux64.sh install-linux64.sh install-linux64-astrid.sh install.sh" 59 EXTERNALPACKAGES_NUMCPUS=" 1 1 1 1 1 1"60 62 61 63 #---------------------# … … 97 99 NROPTIONS="" 98 100 99 100 #------------------------#101 # 7: Matlab#102 #------------------------#103 104 #MATLAB path105 MATLAB_PATH="/usr/local/pkgs/matlab-7.6/"106 107 MATLABBIN="/usr/local/pkgs/matlab-7.6/bin/matlab" -
issm/branches/trunk-jpl-damage/cron/configs/linux64_schlegel_ucitrunk
r11307 r11684 16 16 #Machine configuration 17 17 MACHINE="astrid" 18 19 #COMPILATION CONFIGURATION FILE 20 COMPILE_CONFIG_FILE="config-linux64-astrid.sh" 18 21 19 22 #MATLAB path … … 55 58 EXTERNALPACKAGES="autoconf automake matlab mpich2 petsc metis triangle dakota chaco" 56 59 60 #Corresponding list of installation files to use 61 EXTERNALPACKAGES_CONFIGS=" install.sh install.sh install.sh install-1.0.2-linux64.sh install-3.2-linux64.sh install-4.0-linux64.sh install-linux64.sh install-linux64-astrid.sh install.sh" 62 57 63 #---------------------# 58 64 # 4: ISSM Compilation # -
issm/branches/trunk-jpl-damage/cron/configs/linux64_schlegel_validation
r11577 r11684 18 18 #COMPILATION CONFIGURATION FILE 19 19 COMPILE_CONFIG_FILE="config-linux64-astrid.sh" 20 21 #MATLAB path 22 MATLAB_PATH="/usr/local/pkgs/matlab-7.6/" 20 23 21 24 #----------------------# … … 55 58 56 59 #Corresponding list of installation files to use 57 EXTERNALPACKAGES_CONFIGS=" install.sh install.sh install.sh install-1.0.2-linux64.sh install-3.2-linux64.sh install-4.0-linux64.sh install-linux64.sh install-linux64-astrid.sh install.sh" 58 EXTERNALPACKAGES_NUMCPUS=" 1 1 1 1 1 1" 60 EXTERNALPACKAGES_CONFIGS=" install.sh install.sh install.sh install-1.0.2-linux64.sh install-3.2-linux64.sh install-4.0-linux64.sh install-linux64.sh install-linux64-astrid.sh install.sh install.sh" 59 61 60 62 #---------------------# … … 96 98 NROPTIONS="'benchmark','all'" 97 99 98 #------------------------#99 # 7: Matlab#100 #------------------------#101 102 #MATLAB path103 MATLAB_PATH="/usr/local/pkgs/matlab-7.6/"104 105 MATLABBIN="/usr/local/pkgs/matlab-7.6/bin/matlab" -
issm/branches/trunk-jpl-damage/cron/configs/macosx64_larour
r11577 r11684 48 48 # - "none" leave external packages as is 49 49 # ->skip to section 4 50 ISSM_EXTERNALPACKAGES=" install"50 ISSM_EXTERNALPACKAGES="copy" 51 51 EXTERNALPACKAGESDIR="/Users/larour/issm-uci/trunk-jpl/externalpackages" 52 52 … … 73 73 #Mail delivery. If SKIPMAIL="no", the html nightly run report will be 74 74 #sent to the adresses present in $ISSM_TIER/cron/mailinglist. 75 SKIPMAIL=" no"75 SKIPMAIL="yes" 76 76 77 77 #Sender email address 78 EMAIL_ADRESS=" schlegel@jpl.nasa.gov"78 EMAIL_ADRESS="eric.larour@jpl.nasa.gov" 79 79 80 80 #------------------------# … … 84 84 #number of cpus used in ISSM installation and compilation (one is usually 85 85 #safer as some packages are very sensitive to parallel compilation) 86 NUMCPUS_INSTALL= 186 NUMCPUS_INSTALL=4 87 87 88 88 #number of cpus used in the nightly runs. 89 NUMCPUS_RUN= 789 NUMCPUS_RUN=1 90 90 91 91 #Nightly run options. The matlab routine nightlyrun.m will be called … … 102 102 103 103 #MATLAB path 104 MATLAB_PATH="/ usr/local/pkgs/matlab-7.6/"104 MATLAB_PATH="/Applications/MATLAB_R2010a.app/" 105 105 106 MATLABBIN="/ usr/local/pkgs/matlab-7.6/bin/matlab"106 MATLABBIN="/Applications/MATLAB_R2010a.app/bin/matlab" -
issm/branches/trunk-jpl-damage/cron/cronfiles/mac_cronfile
r2092 r11684 1 1 #use /bin/bash to run commands, overriding the default set by cron 2 2 SHELL=/bin/bash 3 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin 3 4 4 #mail output to Helene5 MAILTO=eric.larour@jpl.nasa.gov,mathieu.morlighem@jpl.nasa.gov,helene.seroussi@jpl.nasa.gov 5 #mail output to issm 6 MAILTO=eric.larour@jpl.nasa.gov,mathieu.morlighem@jpl.nasa.gov,helene.seroussi@jpl.nasa.gov,Christopher.P.Borstad@jpl.nasa.gov,Nicole-Jeanne.Schlegel@jpl.nasa.gov,Feras.A.Habbal@jpl.nasa.gov 6 7 7 8 #cronjob: issm 9:00pm 8 50 9 * * * cd /Users/seroussi/Desktop/backup/svn/issm/trunk/cron/ && ./nightlyrun.sh configs/macosx32_seroussi 9 30 00 * * 1 cd /Users/schlegel/issmuci/trunk-jpl/cron/ && ./nightlyrun.sh configs/macosx64_schlegel -
issm/branches/trunk-jpl-damage/cron/nightlyrun.sh
r11577 r11684 122 122 cluster.executionpath='$EXECUTION_PATH'; 123 123 END 124 cat << END > $ISSM_TIER/externalpackages/matlab/install.sh 125 #!/bin/bash 126 rm -rf install 127 ln -s $MATLAB_PATH install 128 END 129 124 130 fi 125 131 #}}} … … 153 159 rm -rf externalpackages 154 160 cp -Rf $EXTERNALPACKAGESDIR ./ 161 162 elif [ "$ISSM_EXTERNALPACKAGES" == "link" ] 163 then 164 165 #erase externapackages, and link with externalpackages_dir 166 cd $ISSM_TIER 167 rm -rf externalpackages 168 ln -s $EXTERNALPACKAGESDIR . 155 169 156 170 elif [ "$ISSM_EXTERNALPACKAGES" == "none" ] … … 177 191 ./scripts/automakererun.sh 178 192 source ./configs/$COMPILE_CONFIG_FILE 193 194 #4: compile and install ISSM 195 if [ $NUMCPUS_INSTALL -gt 1 ] 196 then 197 echo "Making with " $NUMCPUS_INSTALL "cpus" 198 make -j $NUMCPUS_INSTALL install 199 else 200 make install 201 fi 202 179 203 make install 180 204 … … 259 283 cd $ISSM_TIER/nightlylog/ 260 284 285 MATLABBIN=$MATLAB_PATH/bin/matlab 261 286 #Start test 262 287 $MATLABBIN -nojvm -nosplash -r matlab_run$i -logfile matlab_log$i.log & … … 312 337 if [ "$MACHINE" = "win7" ] 313 338 then 314 echo $i 315 email -html -s "Nightly runs of $ISSM_RELEASE , configuration: $MACHINE, host: $HOST_NAME, user: $USER. " $i < $ISSM_TIER/nightlylog/report.html 339 email -html -s "Nightly runs on $HOST_NAME (version: $ISSM_RELEASE)" $i < $ISSM_TIER/nightlylog/report.html 316 340 else 317 341 if [ "$MACHINE" = "astrid" ] … … 320 344 From: "ISSM Nightly run" <$EMAIL_ADRESS> 321 345 To: $i 322 Subject: Nightly runs o f $ISSM_RELEASE, configuration: $MACHINE, host: $HOST_NAME, user: $USER.346 Subject: Nightly runs on $HOST_NAME (version: $ISSM_RELEASE) 323 347 Mime-Version: 1.0 324 348 Content-Type: text/html … … 328 352 From: "ISSM Nightly run" <$EMAIL_ADRESS> 329 353 To: $i 330 Subject: Nightly runs o f $ISSM_RELEASE, configuration: $MACHINE, host: $HOST_NAME, user: $USER.354 Subject: Nightly runs on $HOST_NAME (version: $ISSM_RELEASE) 331 355 Mime-Version: 1.0 332 356 Content-Type: text/html -
issm/branches/trunk-jpl-damage/etc/environment.sh
r11577 r11684 233 233 #CCCL 234 234 export PATH="$PATH:$CCCL_DIR/bin" 235 236 #PACKAGEMAKER 237 export PATH="$PATH:$PACKAGEMAKER_DIR" 238 239 #ANDROID_NDK: 240 export PATH="$PATH:$ANDROID_NDK_DIR/" 241 242 #ANDROID_SDK 243 export PATH="$PATH:$ANDROID_SDK_DIR/" 244 245 #ANDROID_ANT 246 export PATH="$PATH:$ANDROID_ANT_DIR/" -
issm/branches/trunk-jpl-damage/etc/environment_variables.sh
r11577 r11684 169 169 #cccl 170 170 CCCL_DIR="$ISSM_TIER/externalpackages/cccl/install" 171 172 #packagemaker 173 PACKAGEMAKER_DIR="$ISSM_TIER/externalpackages/packagemaker/install" 174 175 #android-ndk 176 ANDROID_NDK_DIR="$ISSM_TIER/externalpackages/android-ndk/install" 177 178 #android-sdk 179 ANDROID_SDK_DIR="$ISSM_TIER/externalpackages/android-sdk/install-sdk" 180 181 #android-ant 182 ANDROID_ANT_DIR="$ISSM_TIER/externalpackages/android-sdk/install-ant" -
issm/branches/trunk-jpl-damage/examples/SquareIceShelf/runme.m
r11012 r11684 4 4 md=parameterize(md,'Square.par'); 5 5 md=setflowequation(md,'macayeal','all'); 6 md.cluster=generic('name',oshostname,'np',2); 6 7 md=solve(md,DiagnosticSolutionEnum); -
issm/branches/trunk-jpl-damage/externalpackages/dakota/install-macosx64.sh
r11101 r11684 28 28 #Configure dakota 29 29 cd src 30 ./configure \ 31 --prefix="$ISSM_TIER/externalpackages/dakota/install" \ 32 --without-graphics \ 33 --with-pic \ 34 --disable-mpi 30 ./configure \ 31 --prefix="$ISSM_TIER/externalpackages/dakota/install" \ 32 --without-graphics \ 33 --with-pic \ 34 --disable-mpi \ 35 --with-blas="-L$ISSM_TIER/externalpackages/petsc/install/lib -lfblas " \ 36 --with-lapack="-L$ISSM_TIER/externalpackages/petsc/install/lib -lflapack -lPLAPACK " 35 37 cd .. 36 38 … … 44 46 mv temp ./src/methods/acro/packages/pebbl/src/Makefile 45 47 46 cat ./src/methods/hopspack/src-nappspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 48 cat ./src/methods/hopspack/src-nappspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp 47 49 mv temp ./src/methods/hopspack/src-nappspack/Makefile 48 50 … … 53 55 mv temp ./src/methods/hopspack/src-shared/Makefile 54 56 55 cat ./src/methods/hopspack/src-shared/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 57 cat ./src/methods/hopspack/src-shared/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp 56 58 mv temp ./src/methods/hopspack/src-shared/Makefile 57 59 … … 59 61 mv temp ./src/methods/hopspack/src-conveyor/Makefile 60 62 61 cat ./src/methods/hopspack/src-appspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 63 cat ./src/methods/hopspack/src-appspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp 62 64 mv temp ./src/methods/hopspack/src-appspack/Makefile 63 65 … … 74 76 mv temp ./src/methods/acro/packages/tpl/3po/Makefile 75 77 76 cat ./src/packages/ampl/Makefile | sed 's/CFLAGS = -g -O2 /CFLAGS = -g -O2 -fPIC/g' > temp78 cat ./src/packages/ampl/Makefile | sed 's/CFLAGS = -g -O2 -D_NONSTD_SOURCE/CFLAGS = -g -O2 -fPIC/g' > temp 77 79 mv temp ./src/packages/ampl/Makefile 78 80 -
issm/branches/trunk-jpl-damage/externalpackages/matlab/install.sh
r11577 r11684 10 10 ln -s /usr/local/matlab712/ install 11 11 #ln -s /usr/local/pkgs/matlab-7.6/ install 12 13 # Macintosh (OSX) simlink 12 14 #ln -s /Applications/MATLAB_R2008a/ install 13 15 #ln -s /Applications/MATLAB_R2009a.app/ install 14 16 #ln -s /Applications/MATLAB_R2010a.app/ install 15 17 #ln -s /Applications/MATLAB_R2011b.app/ install 18 #ln -s /Applications/MATLAB*.app/ install -
issm/branches/trunk-jpl-damage/m4/issm_options.m4
r11577 r11684 250 250 HAVE_DAKOTA=yes 251 251 DAKOTAINCL=-I$DAKOTA_ROOT/include 252 DAKOTALIB="-L$DAKOTA_ROOT/lib -ldakota -lteuchos -lpecos -lfftw3 -llhs -levidence -lsurfpack -lconmin -lddace -lfsudace -ljega -lcport -lopt -lpsuade -lnewmat -lncsuopt -lgsl -lquadrature -lcoliny -lcolin -lpebbl -lutilib -l3po -lnappspack -lappspack -lconveyor -lshared -lcdd -lamplsolver" 253 dnl DAKOTALIB="-L$DAKOTA_ROOT/lib -ldakota -lteuchos -lpecos -lfftw3 -llhs -levidence -lsurfpack -lconmin -lddace -lfsudace -ljega -lcport -lopt -lpsuade -lnewmat -lncsuopt -lgsl -lgslcblas -lquadrature -lcoliny -lcolin -lpebbl -lutilib -l3po -lnappspack -lappspack -lconveyor -lshared -lcdd -lamplsolver" 252 case "${host_os}" in 253 *cygwin*) 254 DAKOTALIB="-L$DAKOTA_ROOT/lib -ldakota -lteuchos -lpecos -lfftw3 -llhs -levidence -lsurfpack -lconmin -lddace -lfsudace -ljega -lcport -lopt -lpsuade -lnewmat -lncsuopt -lgsl -lquadrature -lcoliny -lcolin -lpebbl -lutilib -l3po -lnappspack -lappspack -lconveyor -lshared -lcdd -lamplsolver" 255 ;; 256 *linux*) 257 DAKOTALIB="-L$DAKOTA_ROOT/lib -ldakota -lteuchos -lpecos -lfftw3 -llhs -levidence -lsurfpack -lconmin -lddace -lfsudace -ljega -lcport -lopt -lpsuade -lnewmat -lncsuopt -lgsl -lquadrature -lcoliny -lcolin -lpebbl -lutilib -l3po -lnappspack -lappspack -lconveyor -lshared -lcdd -lamplsolver" 258 ;; 259 *darwin*) 260 DAKOTALIB="-L$DAKOTA_ROOT/lib -ldakota -lteuchos -lpecos -lfftw3 -llhs -levidence -lsurfpack -lconmin -lddace -lfsudace -ljega -lcport -lopt -lpsuade -lnewmat -lncsuopt -lgsl -lquadrature -lcoliny -lcolin -lpebbl -lutilib -l3po -lnappspack -lappspack -lconveyor -lshared -lcdd -lamplsolver" 261 dnl DAKOTALIB+= "-lgslcblas -L/usr/lib -lblas -llapack" 262 ;; 263 esac 254 264 AC_DEFINE([_HAVE_DAKOTA_],[1],[with Dakota in ISSM src]) 255 265 AC_SUBST([DAKOTAINCL]) … … 306 316 fi 307 317 AC_MSG_RESULT($HAVE_SCOTCH) 318 dnl }}} 319 dnl adolc{{{1 320 AC_ARG_WITH([adolc-dir], 321 AS_HELP_STRING([--with-adolc-dir = DIR], [adolc root directory.]), 322 [ADOLC_ROOT=$withval],[ADOLC_ROOT="no"]) 323 AC_MSG_CHECKING(for ADOLC) 324 325 if test "x$ADOLC_ROOT" = "xno"; then 326 HAVE_ADOLC=no 327 else 328 if test -d "$ADOLC_ROOT"; then 329 330 dnl defaults 331 HAVE_ADOLC=yes 332 ADOLCINCL="-I$ADOLC_ROOT/include/adolc -I$ADOLC_ROOT/include" 333 ADOLCLIB="-L$ADOLC_ROOT/lib64 -ladolc" 334 335 AC_DEFINE([_HAVE_ADOLC_],[1],[with adolc in ISSM src]) 336 AC_SUBST([ADOLCINCL]) 337 AC_SUBST([ADOLCLIB]) 338 339 else 340 echo "Specified directory does not exist!" 341 exit 1 342 fi 343 fi 344 AM_CONDITIONAL([ADOLC], [test x$HAVE_ADOLC = xyes]) 345 AC_MSG_RESULT($HAVE_ADOLC) 308 346 dnl }}} 309 347 dnl adic2{{{1 -
issm/branches/trunk-jpl-damage/src/Makefile.am
r11577 r11684 1 1 EXTRA_DIST = perl pro 2 2 SUBDIRS = c mex m 3 4 if ADIC25 SUBDIRS += ad6 endif7 8 -
issm/branches/trunk-jpl-damage/src/c/EnumDefinitions/EnumDefinitions.h
r11577 r11684 482 482 }; 483 483 484 /*Functions on enums: */485 const char *EnumToModelField(int en);486 487 484 #endif -
issm/branches/trunk-jpl-damage/src/c/EnumDefinitions/README
r8224 r11684 4 4 - EnumToStringx.cpp 5 5 - src/m/enum/* 6 all these files are automatically synchronized with EnumDefinitions.h and EnumToModelField.cpp6 all these files are automatically synchronized with EnumDefinitions.h 7 7 8 8 TO ADD AN ENUM: -
issm/branches/trunk-jpl-damage/src/c/EnumDefinitions/Synchronize.sh
r11407 r11684 13 13 NUMENUMS=$(wc -l temp | awk '{printf("%s",$1);}'); 14 14 15 #Take care of EnumToModelField.m first (easy)16 #Build EnumToModelField.m {{{117 cat <<END > $ISSM_TIER/src/m/enum/EnumToModelField.m18 function string=EnumToModelField(enum)19 %ENUMTOMODELFIELD - output string of model field associated to enum20 %21 % WARNING: DO NOT MODIFY THIS FILE22 % this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh23 % Please read src/c/EnumDefinitions/README for more information24 %25 % Usage:26 % string=EnumToModelField(enum)27 28 switch enum,29 30 END31 32 cat EnumToModelField.cpp | grep "case" | sed -e "s/Enum :/Enum(),/g" -e "s/\"/'/g" -e "s/return /string=/g" -e "s/;/; return/g" >> $ISSM_TIER/src/m/enum/EnumToModelField.m33 34 cat <<END >> $ISSM_TIER/src/m/enum/EnumToModelField.m35 otherwise, error(['Enum ' num2str(enum) ' not found associated to any model field']);36 37 end38 END39 #}}}40 15 #Build EnumToStringx.cpp {{{1 41 16 #Header -
issm/branches/trunk-jpl-damage/src/c/Makefile.am
r11577 r11684 1 INCLUDES = @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @MPIINCL@ @MATLABINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @BLASLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @TRIANGLEINCL@ @HYPREINCL@ @MLINCL@ @TAOINCL@ 1 INCLUDES = @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @MPIINCL@ @MATLABINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @BLASLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @TRIANGLEINCL@ @HYPREINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ 2 2 EXEEXT=$(ISSMEXT) 3 3 … … 120 120 ./objects/Numerics/ElementVector.h\ 121 121 ./objects/Numerics/ElementVector.cpp\ 122 ./objects/Numerics/Matrix.h\ 123 ./objects/Numerics/Matrix.cpp\ 124 ./objects/Numerics/Vector.h\ 125 ./objects/Numerics/Vector.cpp\ 122 126 ./objects/Params/Param.h\ 123 127 ./objects/Params/BoolParam.cpp\ … … 204 208 ./shared/Elements/GetGlobalDofList.cpp\ 205 209 ./shared/Elements/GetNumberOfDofs.cpp\ 206 ./shared/Elements/CoordinateSystemTransform.cpp\207 210 ./shared/String/sharedstring.h\ 208 211 ./toolkits/petsc\ … … 253 256 ./io/PrintfFunction.cpp\ 254 257 ./EnumDefinitions/EnumDefinitions.h\ 255 ./EnumDefinitions/EnumToModelField.cpp\256 258 ./modules/ModelProcessorx/ModelProcessorx.h\ 257 259 ./modules/ModelProcessorx/ModelProcessorx.cpp\ … … 342 344 ./modules/ResetCoordinateSystemx/ResetCoordinateSystemx.cpp\ 343 345 ./modules/Solverx/Solverx.cpp\ 346 ./modules/Solverx/SolverxPetsc.cpp\ 344 347 ./modules/Solverx/Solverx.h\ 345 348 ./modules/Solverx/DofTypesToIndexSet.cpp\ … … 503 506 ./modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp \ 504 507 ./modules/ModelProcessorx/DiagnosticHutter/CreateLoadsDiagnosticHutter.cpp \ 508 ./shared/Elements/CoordinateSystemTransform.cpp\ 505 509 ./shared/Elements/TransformLoadVectorCoord.cpp \ 506 510 ./shared/Elements/TransformStiffnessMatrixCoord.cpp \ … … 725 729 ./toolkits/matlab/matlabincludes.h\ 726 730 ./toolkits/matlab/MatlabNArrayToNArray.cpp\ 731 ./toolkits/matlab/MatlabMatrixToMatrix.cpp\ 732 ./toolkits/matlab/MatlabVectorToVector.cpp\ 727 733 ./io/Matlab/matlabio.h\ 728 734 ./io/Matlab/WriteMatlabData.cpp\ … … 816 822 817 823 #ISSM sources are a combination of core sources and sources related to specific capabilities (which can 818 #be activated by autotools conditionals {{{1 824 #be activated by autotools conditionals 825 #{{{1 819 826 820 827 #First the core … … 925 932 926 933 #External packages 927 LDADD += $(PETSCLIB) $(TAOLIB) $(FLIBS) $(PLAPACKLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $( ADIC2LIB) $(OSLIBS)934 LDADD += $(PETSCLIB) $(TAOLIB) $(FLIBS) $(PLAPACKLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) 928 935 929 936 issm_SOURCES = solutions/issm.cpp 930 937 issm_CXXFLAGS= -fPIC -D_PARALLEL_ $(CXXFLAGS) $(CXXOPTFLAGS) $(COPTFLAGS) 931 938 #}}} 939 #Automatic differentiation: append this fold to the end of the src/c/Makefile.am to get this Makefile.am {{{ 940 if ADIC2 941 lib_LIBRARIES += libAD.a libpISSMRose.a 942 943 #ADIC2 library, for automatic differentiation 944 #libAD_a_SOURCES = ./mini1.ad.c 945 libAD_a_SOURCES = 946 libAD_a_CFLAGS = -fPIC -D_PARALLEL_ -D_C_ $(COPTFLAGS) 947 948 949 950 #test rose preprocessing 951 %.r2cpp.cpp : %.cpp 952 testTranslator -rose:o $@ -rose:skipfinalCompileStep -DHAVE_CONFIG_H -D_PARALLEL_ -D_C_ -I. -I../.. $(INCLUDES) $< 953 libpISSMRose_a_SOURCES = $(libpISSM_a_SOURCES:.cpp=.r2cpp.cpp) 954 libpISSMRose_a_CXXFLAGS= -fPIC -D_PARALLEL_ -D_C_ $(CXXOPTFLAGS) 955 956 957 958 #Automatic differentiation rules: 959 %.ad.c: %.c 960 adic2 -mforward $< --nary 961 962 963 964 #Executable 965 bin_PROGRAMS += issmRose.exe 966 issmRose_exe_LDADD = ./libpISSMRose.a $(LDADD) 967 issmRose_exe_SOURCES = solutions/issm.cpp 968 issmRose_exe_CXXFLAGS= -fPIC -D_PARALLEL_ $(CXXOPTFLAGS) $(COPTFLAGS) 969 LDADD += $(ADIC2LIB) 970 971 endif #}}} -
issm/branches/trunk-jpl-damage/src/c/io/Matlab/FetchMatlabData.cpp
r9320 r11684 60 60 outmatrix=NULL; 61 61 } 62 else if (mxIsClass(dataref,"double") ){ 63 62 else if(mxIsClass(dataref,"double") || mxIsClass(dataref,"single")){ 64 63 /*Check dataref is not pointing to NaN: */ 65 64 if ( mxIsNaN(*(mxGetPr(dataref))) && (mxGetM(dataref)==1) && (mxGetN(dataref)==1) ){ … … 69 68 } 70 69 else{ 71 72 70 /*Convert matlab matrix to double* matrix: */ 73 71 MatlabMatrixToDoubleMatrix(&outmatrix,&outmatrix_rows,&outmatrix_cols,dataref); … … 305 303 } 306 304 /*}}}*/ 305 /*FUNCTION FetchMatlabData(Matrix** pmatrix,const mxArray* dataref){{{1*/ 306 void FetchMatlabData(Matrix** pmatrix,const mxArray* dataref){ 307 308 Matrix* outmatrix=NULL; 309 int dummy=0; 310 311 if (mxIsClass(dataref,"double") ){ 312 313 /*Check dataref is not pointing to NaN: */ 314 if ( mxIsNaN(*(mxGetPr(dataref))) && (mxGetM(dataref)==1) && (mxGetN(dataref)==1) ){ 315 outmatrix=NULL; 316 } 317 else{ 318 319 /*Convert matlab matrix to petsc matrix: */ 320 outmatrix=MatlabMatrixToMatrix(dataref); 321 } 322 } 323 else{ 324 /*This is an error: we don't have the correct input!: */ 325 _error_("Input parameter of class %s not supported yet",mxGetClassName(dataref)); 326 } 327 328 /*Assign output pointers:*/ 329 *pmatrix=outmatrix; 330 } 331 /*}}}*/ 307 332 /*FUNCTION FetchMatlabData(double** pvector,int* pM,const mxArray* dataref){{{1*/ 308 333 void FetchMatlabData(double** pvector,int* pM,const mxArray* dataref){ … … 442 467 /*Convert matlab vector to petsc vector: */ 443 468 MatlabVectorToPetscVector(&vector,&dummy,dataref); 469 } 470 else{ 471 /*This is an error: we don't have the correct input!: */ 472 _error_("Input parameter of class %s not supported yet",mxGetClassName(dataref)); 473 } 474 475 /*Assign output pointers:*/ 476 *pvector=vector; 477 } 478 /*}}}*/ 479 /*FUNCTION FetchMatlabData(Vector** pvector,const mxArray* dataref){{{1*/ 480 void FetchMatlabData(Vector** pvector,const mxArray* dataref){ 481 482 Vector* vector=NULL; 483 int dummy; 484 485 if(mxIsEmpty(dataref)){ 486 /*Nothing to pick up. Just initialize matrix pointer to NULL: */ 487 vector=NULL; 488 } 489 else if (mxIsClass(dataref,"double") ){ 490 491 /*Convert matlab vector to petsc vector: */ 492 vector=MatlabVectorToVector(dataref); 444 493 } 445 494 else{ -
issm/branches/trunk-jpl-damage/src/c/io/Matlab/WriteMatlabData.cpp
r11202 r11684 58 58 } 59 59 /*}}}*/ 60 /*FUNCTION WriteMatlabData(mxArray** pdataref,Matrix* matrix){{{1*/ 61 void WriteMatlabData(mxArray** pdataref,Matrix* matrix){ 62 63 mxArray* dataref=NULL; 64 65 if(matrix){ 66 67 /*call toolkit routine: */ 68 dataref=matrix->ToMatlabMatrix(); 69 } 70 else{ 71 dataref = mxCreateDoubleMatrix(0,0,mxREAL); 72 } 73 74 *pdataref=dataref; 75 } 76 /*}}}*/ 60 77 /*FUNCTION WriteMatlabData(mxArray** pdataref,double* matrix, int M,int N){{{1*/ 61 78 void WriteMatlabData(mxArray** pdataref,double* matrix, int M,int N){ … … 117 134 /*call toolkit routine: */ 118 135 PetscVectorToMatlabVector(&dataref,vector); 136 } 137 else{ 138 dataref = mxCreateDoubleMatrix(0,0,mxREAL); 139 } 140 *pdataref=dataref; 141 142 } 143 /*}}}*/ 144 /*FUNCTION WriteMatlabData(mxArray** pdataref,Vector* vector){{{1*/ 145 void WriteMatlabData(mxArray** pdataref,Vector* vector){ 146 147 mxArray* dataref=NULL; 148 149 if(vector){ 150 151 /*call toolkit routine: */ 152 dataref=vector->ToMatlabVector(); 119 153 } 120 154 else{ -
issm/branches/trunk-jpl-damage/src/c/io/Matlab/matlabio.h
r10205 r11684 17 17 void WriteMatlabData(mxArray** pdataref,DataSet* dataset); 18 18 void WriteMatlabData(mxArray** pdataref,Mat matrix); 19 void WriteMatlabData(mxArray** pdataref,Matrix* matrix); 19 20 void WriteMatlabData(mxArray** pdataref,double* matrix, int M,int N); 20 21 void WriteMatlabData(mxArray** pdataref,int* matrix, int M,int N); 21 22 void WriteMatlabData(mxArray** pdataref,Vec vector); 23 void WriteMatlabData(mxArray** pdataref,Vector* vector); 22 24 void WriteMatlabData(mxArray** pdataref,double* vector, int M); 23 25 void WriteMatlabData(mxArray** pdataref,int integer); … … 34 36 void FetchMatlabData(bool** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref); 35 37 void FetchMatlabData(Mat* pmatrix,const mxArray* dataref); 38 void FetchMatlabData(Matrix** pmatrix,const mxArray* dataref); 36 39 void FetchMatlabData(int** pvector,int* pM,const mxArray* dataref); 37 40 void FetchMatlabData(float** pvector,int* pM,const mxArray* dataref); … … 39 42 void FetchMatlabData(bool** pvector,int* pM,const mxArray* dataref); 40 43 void FetchMatlabData(Vec* pvector,const mxArray* dataref); 44 void FetchMatlabData(Vector** pvector,const mxArray* dataref); 41 45 void FetchMatlabData(char** pstring,const mxArray* dataref); 42 46 void FetchMatlabData(char** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref); -
issm/branches/trunk-jpl-damage/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp
r11327 r11684 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void CreateJacobianMatrixx(Mat * pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,double kmax){12 void CreateJacobianMatrixx(Matrix** pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,double kmax){ 13 13 14 14 int i,connectivity; … … 17 17 Element *element = NULL; 18 18 Load *load = NULL; 19 Mat 19 Matrix* Jff = NULL; 20 20 21 21 /*Checks*/ … … 29 29 30 30 /*Initialize Jacobian Matrix*/ 31 Jff= NewMat(fsize,fsize,connectivity,numberofdofspernode);31 Jff=new Matrix(fsize,fsize,connectivity,numberofdofspernode); 32 32 33 33 /*Create and assemble matrix*/ … … 41 41 if(load->InAnalysis(configuration_type)) load->PenaltyCreateJacobianMatrix(Jff,kmax); 42 42 } 43 MatAssemblyBegin(Jff,MAT_FINAL_ASSEMBLY); 44 MatAssemblyEnd(Jff,MAT_FINAL_ASSEMBLY); 43 Jff->Assemble(); 45 44 46 45 /*Assign output pointer*/ -
issm/branches/trunk-jpl-damage/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h
r11327 r11684 10 10 11 11 /* local prototypes: */ 12 void CreateJacobianMatrixx(Mat * pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,double kmax);12 void CreateJacobianMatrixx(Matrix** pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,double kmax); 13 13 14 14 #endif /* _CREATEJACOBIANMATRIXX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.cpp
r8816 r11684 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void CreateNodalConstraintsx( Vec * pys, Nodes* nodes,int configuration_type){12 void CreateNodalConstraintsx( Vector** pys, Nodes* nodes,int configuration_type){ 13 13 14 14 int i; … … 18 18 19 19 /*output: */ 20 Vec ys=NULL;20 Vector* ys=NULL; 21 21 22 22 /*figure out how many dofs we have: */ … … 24 24 25 25 /*allocate:*/ 26 ys= NewVec(numberofdofs);26 ys=new Vector(numberofdofs); 27 27 28 28 /*go through all nodes, and for the ones corresponding to this configuration_type, fill the … … 36 36 37 37 /*Assemble: */ 38 VecAssemblyBegin(ys); 39 VecAssemblyEnd(ys); 38 ys->Assemble(); 40 39 41 40 /*Assign output pointers: */ -
issm/branches/trunk-jpl-damage/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.h
r8816 r11684 9 9 10 10 /* local prototypes: */ 11 void CreateNodalConstraintsx( Vec * pys, Nodes* nodes,int configuration_type);11 void CreateNodalConstraintsx( Vector** pys, Nodes* nodes,int configuration_type); 12 12 13 13 #endif /* _CREATENODALCONSTRAINTSX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp
r8224 r11684 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void GetSolutionFromInputsx( Vec * psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters){11 void GetSolutionFromInputsx( Vector** psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters){ 12 12 13 13 /*intermediary: */ … … 19 19 20 20 /*output: */ 21 Vec solution=NULL;21 Vector* solution=NULL; 22 22 23 23 /*retrive parameters: */ … … 29 29 30 30 /*Initialize solution: */ 31 solution= NewVec(gsize);31 solution=new Vector(gsize); 32 32 33 33 /*Go through elements and plug solution: */ … … 38 38 39 39 /*Assemble vector: */ 40 VecAssemblyBegin(solution); 41 VecAssemblyEnd(solution); 40 solution->Assemble(); 42 41 43 42 /*Assign output pointers:*/ -
issm/branches/trunk-jpl-damage/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.h
r4236 r11684 10 10 11 11 /* local prototypes: */ 12 void GetSolutionFromInputsx( Vec * psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters);12 void GetSolutionFromInputsx( Vector** psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters); 13 13 14 14 #endif /* _GETSOLUTIONFROMINPUTSXX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.cpp
r4573 r11684 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vec solution){11 void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* solution){ 12 12 13 13 double* serial_solution=NULL; 14 14 15 15 /*Serialize solution, so that elements can index into it on every CPU: */ 16 VecToMPISerial(&serial_solution,solution);16 serial_solution=solution->ToMPISerial(); 17 17 18 18 /*Call overloaded form of InputUpdateFromSolutionx: */ -
issm/branches/trunk-jpl-damage/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.h
r4236 r11684 10 10 11 11 /* local prototypes: */ 12 void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vec solution);12 void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vector* solution); 13 13 void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,double* solution); 14 14 15 15 //with timestep 16 void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vec solution,int timestep);16 void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vector* solution,int timestep); 17 17 void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,double* solution, int timestep); 18 18 -
issm/branches/trunk-jpl-damage/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp
r9761 r11684 7 7 #include "./Mergesolutionfromftogx.h" 8 8 9 void Mergesolutionfromftogx( Vec * pug, Vec uf, Vecys, Nodes* nodes, Parameters* parameters, bool flag_ys0){9 void Mergesolutionfromftogx( Vector** pug, Vector* uf, Vector* ys, Nodes* nodes, Parameters* parameters, bool flag_ys0){ 10 10 11 11 /*output: */ 12 Vec ug=NULL;12 Vector* ug=NULL; 13 13 14 14 /*intermediary: */ … … 29 29 if(ssize){ 30 30 if(flag_ys0){ 31 VecSet(ys,0.0);31 ys->Set(0.0); 32 32 } 33 33 } 34 34 35 35 /*initialize ug: */ 36 ug= NewVec(gsize);36 ug=new Vector(gsize); 37 37 38 38 /*Merge f set back into g set: */ -
issm/branches/trunk-jpl-damage/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.h
r8799 r11684 9 9 10 10 /* local prototypes: */ 11 void Mergesolutionfromftogx( Vec * pug, Vec uf, Vecys, Nodes* nodes, Parameters* parameters, bool flag_ys0=false);11 void Mergesolutionfromftogx( Vector** pug, Vector* uf, Vector* ys, Nodes* nodes, Parameters* parameters, bool flag_ys0=false); 12 12 13 13 #endif /* _MERGESOLUTIONFROMFTOGX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/ModelProcessorx.cpp
r11347 r11684 64 64 if(solution_type==TransientSolutionEnum && analysis_type==DiagnosticVertAnalysisEnum && isdiagnostic==false) continue; 65 65 if(solution_type==TransientSolutionEnum && analysis_type==DiagnosticHutterAnalysisEnum && isdiagnostic==false) continue; 66 if(solution_type==SteadystateSolutionEnum && analysis_type==ThermalAnalysisEnum && isenthalpy==true) continue; 67 if(solution_type==SteadystateSolutionEnum && analysis_type==MeltingAnalysisEnum && isenthalpy==true) continue; 68 if(solution_type==SteadystateSolutionEnum && analysis_type==EnthalpyAnalysisEnum && isenthalpy==false) continue; 66 69 67 70 _printf_(VerboseMProcessor()," creating datasets for analysis %s\n",EnumToStringx(analysis_type)); -
issm/branches/trunk-jpl-damage/src/c/modules/Reduceloadx/Reduceloadx.cpp
r9761 r11684 12 12 #include "../../io/io.h" 13 13 14 void Reduceloadx( Vec pf, Mat Kfs, Vecy_s,bool flag_ys0){14 void Reduceloadx( Vector* pf, Matrix* Kfs, Vector* y_s,bool flag_ys0){ 15 15 16 16 /*intermediary*/ 17 Vec 18 Vec 17 Vector* y_s0 = NULL; 18 Vector* Kfsy_s = NULL; 19 19 int Kfsm,Kfsn; 20 20 int global_m,global_n; 21 PetscScalar a;22 21 bool fromlocalsize = true; 23 22 int verbose; … … 25 24 _printf_(VerboseModule()," Dirichlet lifting applied to load vector\n"); 26 25 27 MatGetSize(Kfs,&global_m,&global_n);26 Kfs->GetSize(&global_m,&global_n); 28 27 if(pf && global_m*global_n){ 29 28 … … 32 31 33 32 /*pf = pf - Kfs * y_s;*/ 34 MatGetLocalSize(Kfs,&Kfsm,&Kfsn);35 Kfsy_s= NewVec(Kfsm,fromlocalsize);33 Kfs->GetLocalSize(&Kfsm,&Kfsn); 34 Kfsy_s=new Vector(Kfsm,fromlocalsize); 36 35 if (flag_ys0){ 37 36 38 37 /*Create y_s0, full of 0: */ 39 VecDuplicate(y_s,&y_s0); 40 VecSet(y_s0,0.0); 41 VecAssemblyBegin(y_s0); 42 VecAssemblyEnd(y_s0); 38 y_s0=y_s->Duplicate(); 39 y_s0->Set(0.0); 40 y_s0->Assemble(); 43 41 44 MatMultPatch(Kfs,y_s0,Kfsy_s);42 Kfs->MatMult(y_s0,Kfsy_s); 45 43 } 46 44 else{ 47 MatMultPatch(Kfs,y_s,Kfsy_s);45 Kfs->MatMult(y_s,Kfsy_s); 48 46 } 49 47 50 a=-1; 51 VecAXPY(pf,a,Kfsy_s); 48 pf->AXPY(Kfsy_s,-1); 52 49 } 53 50 54 51 55 52 /*Free ressources and return*/ 56 VecFree(&y_s0);57 VecFree(&Kfsy_s);53 delete y_s0; 54 delete Kfsy_s; 58 55 59 56 } -
issm/branches/trunk-jpl-damage/src/c/modules/Reduceloadx/Reduceloadx.h
r6580 r11684 9 9 10 10 /* local prototypes: */ 11 void Reduceloadx( Vec pf, Mat Kfs, Vecys,bool flag_ys0=false);11 void Reduceloadx( Vector* pf, Matrix* Kfs, Vector* ys,bool flag_ys0=false); 12 12 13 13 #endif /* _REDUCELOADX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.cpp
r8817 r11684 6 6 #include "./Reducevectorgtofx.h" 7 7 8 void Reducevectorgtofx(Vec * puf, Vecug, Nodes* nodes,Parameters* parameters){8 void Reducevectorgtofx(Vector** puf, Vector* ug, Nodes* nodes,Parameters* parameters){ 9 9 10 10 /*output: */ 11 Vec uf=NULL;11 Vector* uf=NULL; 12 12 13 13 /*variables: */ … … 26 26 else{ 27 27 /*allocate: */ 28 uf= NewVec(fsize);28 uf=new Vector(fsize); 29 29 30 30 if(nodes->NumberOfNodes(configuration_type)){ 31 31 32 32 /*serialize ug, so nodes can index into it: */ 33 VecToMPISerial(&ug_serial,ug);33 ug_serial=ug->ToMPISerial(); 34 34 35 35 /*Go through all nodes, and ask them to retrieve values from ug, and plug them into uf: */ … … 47 47 } 48 48 /*Assemble vector: */ 49 VecAssemblyBegin(uf); 50 VecAssemblyEnd(uf); 49 uf->Assemble(); 51 50 } 52 51 -
issm/branches/trunk-jpl-damage/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.h
r8799 r11684 10 10 11 11 /* local prototypes: */ 12 void Reducevectorgtofx(Vec * puf, Vecug, Nodes* nodes,Parameters* parameters);12 void Reducevectorgtofx(Vector** puf, Vector* ug, Nodes* nodes,Parameters* parameters); 13 13 14 14 #endif /* _REDUCEVECTORGTOFX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.cpp
r8816 r11684 6 6 #include "./Reducevectorgtosx.h" 7 7 8 void Reducevectorgtosx(Vec * pys, Vecyg, Nodes* nodes,Parameters* parameters){8 void Reducevectorgtosx(Vector** pys, Vector* yg, Nodes* nodes,Parameters* parameters){ 9 9 10 10 /*output: */ 11 Vec ys=NULL;11 Vector* ys=NULL; 12 12 13 13 /*variables: */ … … 26 26 else{ 27 27 /*allocate: */ 28 ys= NewVec(ssize);28 ys=new Vector(ssize); 29 29 30 30 if(nodes->NumberOfNodes(configuration_type)){ 31 31 32 32 /*serialize yg, so nodes can index into it: */ 33 VecToMPISerial(&yg_serial,yg);33 yg_serial=yg->ToMPISerial(); 34 34 35 35 /*Go throygh all nodes, and ask them to retrieve values from yg, and plyg them into ys: */ … … 47 47 } 48 48 /*Assemble vector: */ 49 VecAssemblyBegin(ys); 50 VecAssemblyEnd(ys); 49 ys->Assemble(); 51 50 } 52 51 -
issm/branches/trunk-jpl-damage/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.h
r8799 r11684 10 10 11 11 /* local prototypes: */ 12 void Reducevectorgtosx(Vec * pys, Vecyg, Nodes* nodes,Parameters* parameters);12 void Reducevectorgtosx(Vector** pys, Vector* yg, Nodes* nodes,Parameters* parameters); 13 13 14 14 #endif /* _REDUCEVECTORGTOSX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/Solverx/Solverx.cpp
r11577 r11684 14 14 #endif 15 15 16 void Solverx(Vec * puf, Mat Kff, Vec pf, Vec uf0,Vecdf, Parameters* parameters){16 void Solverx(Vector** puf, Matrix* Kff, Vector* pf, Vector* uf0,Vector* df, Parameters* parameters){ 17 17 18 /*Output: */ 19 Vec uf = NULL; 18 /*output: */ 19 Vector* uf=NULL; 20 uf=new Vector(); 20 21 21 /*Intermediary: */22 int local_m,local_n,global_m,global_n;23 i nt analysis_type;22 #ifdef _HAVE_PETSC_ 23 Vec uf0_vector=NULL; 24 if (uf0)uf0_vector=uf0->vector; 24 25 25 /*Solver */ 26 KSP ksp = NULL; 27 PC pc = NULL; 28 int iteration_number; 29 int solver_type; 30 bool fromlocalsize = true; 31 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2) 32 PetscTruth flag,flg; 26 SolverxPetsc(&uf->vector, Kff->matrix, pf->vector, uf0_vector, df->vector, parameters); 27 VecGetSize(uf->vector,&uf->M); 33 28 #else 34 PetscBool flag,flg;29 _error_("not supported yet!"); 35 30 #endif 36 31 37 /*Stokes: */38 IS isv=NULL;39 IS isp=NULL;40 41 #if _PETSC_MAJOR_ >= 342 char ksp_type[50];43 #endif44 45 46 /*Display message*/47 _printf_(VerboseModule()," Solving\n");48 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)49 if(VerboseSolver())PetscOptionsPrint(stdout);50 #else51 if(VerboseSolver())PetscOptionsView(PETSC_VIEWER_STDOUT_WORLD);52 #endif53 54 /*First, check that f-set is not NULL, i.e. model is fully constrained: {{{*/55 _assert_(Kff);56 MatGetSize(Kff,&global_m,&global_n); _assert_(global_m==global_m);57 if(!global_n){58 *puf=NULL; return;59 }60 /*}}}*/61 /*Initial guess logic here: {{{1*/62 /*Now, check that we are not giving an initial guess to the solver, if we are running a direct solver: */63 #if _PETSC_MAJOR_ >= 364 PetscOptionsGetString(PETSC_NULL,"-ksp_type",ksp_type,49,&flg);65 if (strcmp(ksp_type,"preonly")==0)uf0=NULL;66 #endif67 68 /*If initial guess for the solution exists, use it to create uf, otherwise,69 * duplicate the right hand side so that the solution vector has the same structure*/70 if(uf0){71 VecDuplicate(uf0,&uf); VecCopy(uf0,uf);72 }73 else{74 MatGetLocalSize(Kff,&local_m,&local_n);uf=NewVec(local_n,fromlocalsize);75 }76 /*}}}*/77 /*Process petsc options to see if we are using special types of external solvers: {{{1*/78 PetscOptionsDetermineSolverType(&solver_type);79 80 /*In serial mode, the matrices have been loaded as MPIAIJ or AIJ matrices.81 We need to convert them if we are going to run the solvers successfully: */82 #ifdef _SERIAL_83 #if _PETSC_MAJOR_ == 284 if (solver_type==MUMPSPACKAGE_LU){85 /*Convert Kff to MATTAIJMUMPS: */86 MatConvert(Kff,MATAIJMUMPS,MAT_REUSE_MATRIX,&Kff);87 }88 if (solver_type==MUMPSPACKAGE_CHOL){89 /*Convert Kff to MATTSBAIJMUMPS: */90 MatConvert(Kff,MATSBAIJMUMPS,MAT_REUSE_MATRIX,&Kff);91 }92 if (solver_type==SPOOLESPACKAGE_LU){93 /*Convert Kff to MATTSBAIJMUMPS: */94 MatConvert(Kff,MATAIJSPOOLES,MAT_REUSE_MATRIX,&Kff);95 }96 if (solver_type==SPOOLESPACKAGE_CHOL){97 /*Convert Kff to MATTSBAIJMUMPS: */98 MatConvert(Kff,MATSBAIJSPOOLES,MAT_REUSE_MATRIX,&Kff);99 }100 if (solver_type==SUPERLUDISTPACKAGE){101 /*Convert Kff to MATTSBAIJMUMPS: */102 MatConvert(Kff,MATSUPERLU_DIST,MAT_REUSE_MATRIX,&Kff);103 }104 if (solver_type==StokesSolverEnum){105 _error_("Petsc 2 does not support multi-physics solvers");106 }107 #endif108 #endif109 /*}}}*/110 /*Check the solver is available: {{{1*/111 if(solver_type==MUMPSPACKAGE_LU || solver_type==MUMPSPACKAGE_CHOL){112 #if _PETSC_MAJOR_ >=3113 #ifndef _HAVE_MUMPS_114 _error_("requested MUMPS solver, which was not compiled into ISSM!\n");115 #endif116 117 #endif118 }119 /*}}}*/120 /*Prepare solver:{{{1*/121 KSPCreate(MPI_COMM_WORLD,&ksp);122 KSPSetOperators(ksp,Kff,Kff,DIFFERENT_NONZERO_PATTERN);123 KSPSetFromOptions(ksp);124 125 #if defined(_SERIAL_) && _PETSC_MAJOR_==3126 /*Specific solver?: */127 KSPGetPC(ksp,&pc);128 if (solver_type==MUMPSPACKAGE_LU){129 #if _PETSC_MINOR_==1130 PCFactorSetMatSolverPackage(pc,MAT_SOLVER_MUMPS);131 #else132 PCFactorSetMatSolverPackage(pc,MATSOLVERMUMPS);133 #endif134 }135 #endif136 137 #if defined(_PARALLEL_) && _PETSC_MAJOR_==3138 /*Stokes: */139 if (solver_type==StokesSolverEnum){140 /*Make indices out of doftypes: */141 if(!df)_error_("need doftypes for Stokes solver!\n");142 DofTypesToIndexSet(&isv,&isp,df,StokesSolverEnum);143 144 /*Set field splits: */145 KSPGetPC(ksp,&pc);146 #if _PETSC_MINOR_==1147 PCFieldSplitSetIS(pc,isv);148 PCFieldSplitSetIS(pc,isp);149 #else150 PCFieldSplitSetIS(pc,PETSC_NULL,isv);151 PCFieldSplitSetIS(pc,PETSC_NULL,isp);152 #endif153 154 }155 #endif156 157 /*}}}*/158 /*If there is an initial guess for the solution, use it, except if we are using the MUMPS direct solver, where any initial guess will crash Petsc: {{{1*/159 if (uf0){160 if( (solver_type!=MUMPSPACKAGE_LU) && (solver_type!=MUMPSPACKAGE_CHOL) && (solver_type!=SPOOLESPACKAGE_LU) && (solver_type!=SPOOLESPACKAGE_CHOL) && (solver_type!=SUPERLUDISTPACKAGE)){161 KSPSetInitialGuessNonzero(ksp,PETSC_TRUE);162 }163 }164 /*}}}*/165 166 if(VerboseSolver())KSPView(ksp,PETSC_VIEWER_STDOUT_WORLD);167 168 /*Solve: */169 KSPSolve(ksp,pf,uf);170 171 /*Check convergence*/172 KSPGetIterationNumber(ksp,&iteration_number);173 if (iteration_number<0) _error_("%s%i"," Solver diverged at iteration number: ",-iteration_number);174 175 /*Free resources:*/176 KSPFree(&ksp);177 178 32 /*Assign output pointers:*/ 179 33 *puf=uf; -
issm/branches/trunk-jpl-damage/src/c/modules/Solverx/Solverx.h
r7391 r11684 9 9 10 10 /* local prototypes: */ 11 void Solverx( Vec* puf, Mat Kff, Vec pf, Vec uf0,Vec df,Parameters* parameters); 11 void Solverx(Vector** puf, Matrix* Kff, Vector* pf, Vector* uf0,Vector* df, Parameters* parameters); 12 void SolverxPetsc(Vec* puf, Mat Kff, Vec pf, Vec uf0,Vec df, Parameters* parameters); 12 13 void DofTypesToIndexSet(IS* pisv, IS* pisp, Vec df,int typeenum); 13 14 #endif /* _SOLVERX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/StringToEnumx/StringToEnumx.cpp
r11683 r11684 137 137 else if (strcmp(name,"PrognosticHydrostaticAdjustment")==0) return PrognosticHydrostaticAdjustmentEnum; 138 138 else if (strcmp(name,"PrognosticMinThickness")==0) return PrognosticMinThicknessEnum; 139 else if (strcmp(name,"PrognosticPenaltyFactor")==0) return PrognosticPenaltyFactorEnum; 140 else if (strcmp(name,"PrognosticSpcthickness")==0) return PrognosticSpcthicknessEnum; 139 141 else stage=2; 140 142 } 141 143 if(stage==2){ 142 if (strcmp(name,"PrognosticPenaltyFactor")==0) return PrognosticPenaltyFactorEnum; 143 else if (strcmp(name,"PrognosticSpcthickness")==0) return PrognosticSpcthicknessEnum; 144 else if (strcmp(name,"PrognosticStabilization")==0) return PrognosticStabilizationEnum; 144 if (strcmp(name,"PrognosticStabilization")==0) return PrognosticStabilizationEnum; 145 145 else if (strcmp(name,"PrognosticVertexPairing")==0) return PrognosticVertexPairingEnum; 146 146 else if (strcmp(name,"QmuIsdakota")==0) return QmuIsdakotaEnum; -
issm/branches/trunk-jpl-damage/src/c/modules/SystemMatricesx/SystemMatricesx.cpp
r11324 r11684 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void SystemMatricesx(Mat * pKff, Mat* pKfs, Vec* ppf, Vec* pdf, double* pkmax,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,bool kflag,bool pflag,bool penalty_kflag,bool penalty_pflag){12 void SystemMatricesx(Matrix** pKff, Matrix** pKfs, Vector** ppf, Vector** pdf, double* pkmax,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,bool kflag,bool pflag,bool penalty_kflag,bool penalty_pflag){ 13 13 14 14 /*intermediary: */ … … 21 21 22 22 /*output: */ 23 Mat Kff = NULL;24 Mat Kfs = NULL;25 Vec pf = NULL;26 Vec df=NULL;23 Matrix* Kff = NULL; 24 Matrix* Kfs = NULL; 25 Vector* pf = NULL; 26 Vector* df=NULL; 27 27 double kmax = 0; 28 28 … … 49 49 if(kflag){ 50 50 51 Kff= NewMat(fsize,fsize,connectivity,numberofdofspernode);52 Kfs= NewMat(fsize,ssize,connectivity,numberofdofspernode);53 df= NewVec(fsize);51 Kff=new Matrix(fsize,fsize,connectivity,numberofdofspernode); 52 Kfs=new Matrix(fsize,ssize,connectivity,numberofdofspernode); 53 df=new Vector(fsize); 54 54 55 55 /*Fill stiffness matrix from elements: */ … … 66 66 67 67 /*Assemble matrix and doftypes and compress matrix to save memory: */ 68 MatAssemblyBegin(Kff,MAT_FINAL_ASSEMBLY); 69 MatAssemblyEnd(Kff,MAT_FINAL_ASSEMBLY); 70 #if _PETSC_MAJOR_ == 2 71 MatCompress(Kff); 72 #endif 68 Kff->Assemble(); 69 Kfs->Assemble(); 70 df->Assemble(); 73 71 74 MatAssemblyBegin(Kfs,MAT_FINAL_ASSEMBLY);75 MatAssemblyEnd(Kfs,MAT_FINAL_ASSEMBLY);76 #if _PETSC_MAJOR_ == 277 MatCompress(Kfs);78 #endif79 VecAssemblyBegin(df);80 VecAssemblyEnd(df);81 72 82 73 } … … 84 75 if(pflag){ 85 76 86 pf= NewVec(fsize);77 pf=new Vector(fsize); 87 78 88 79 /*Fill right hand side vector, from elements: */ … … 98 89 } 99 90 100 VecAssemblyBegin(pf); 101 VecAssemblyEnd(pf); 91 pf->Assemble(); 102 92 } 103 93 104 94 /*Now, figure out maximum value of K_gg, so that we can penalize it correctly: */ 105 MatNorm(Kff,NORM_INFINITY,&kmax);95 kmax=Kff->Norm(NORM_INFINITY); 106 96 107 97 /*Now, deal with penalties*/ … … 115 105 116 106 /*Assemble matrix and compress matrix to save memory: */ 117 MatAssemblyBegin(Kff,MAT_FINAL_ASSEMBLY); 118 MatAssemblyEnd(Kff,MAT_FINAL_ASSEMBLY); 119 #if _PETSC_MAJOR_ == 2 120 MatCompress(Kff); 121 #endif 122 123 MatAssemblyBegin(Kfs,MAT_FINAL_ASSEMBLY); 124 MatAssemblyEnd(Kfs,MAT_FINAL_ASSEMBLY); 125 #if _PETSC_MAJOR_ == 2 126 MatCompress(Kfs); 127 #endif 107 Kff->Assemble(); 108 Kfs->Assemble(); 128 109 } 129 110 … … 137 118 } 138 119 139 VecAssemblyBegin(pf);140 VecAssemblyEnd(pf);120 pf->Assemble(); 121 pf->Assemble(); 141 122 } 142 123 143 124 /*Assign output pointers: */ 144 125 if(pKff) *pKff=Kff; 145 else MatFree(&Kff);126 else delete Kff; 146 127 if(pKfs) *pKfs=Kfs; 147 else MatFree(&Kfs);128 else delete Kfs; 148 129 if(ppf) *ppf=pf; 149 else VecFree(&pf);130 else delete pf; 150 131 if(pdf) *pdf=df; 151 else VecFree(&df);132 else delete df; 152 133 if(pkmax) *pkmax=kmax; 153 134 } -
issm/branches/trunk-jpl-damage/src/c/modules/SystemMatricesx/SystemMatricesx.h
r8799 r11684 10 10 11 11 /* local prototypes: */ 12 void SystemMatricesx(Mat * pKff, Mat* pKfs, Vec* ppf, Vec* pdf, double* pkmax,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,12 void SystemMatricesx(Matrix** pKff, Matrix** pKfs, Vector** ppf, Vector** pdf, double* pkmax,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters, 13 13 bool kflag=true,bool pflag=true,bool penalty_kflag=true,bool penalty_pflag=true); 14 14 -
issm/branches/trunk-jpl-damage/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.cpp
r9883 r11684 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vec yg){12 void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vector* yg){ 13 13 14 14 int configuration_type; … … 19 19 20 20 /*serialize yg, so nodes can index into it: */ 21 VecToMPISerial(&yg_serial,yg);21 yg_serial=yg->ToMPISerial(); 22 22 23 23 for(int i=0;i<constraints->Size();i++){ -
issm/branches/trunk-jpl-damage/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.h
r9298 r11684 9 9 #include "../../objects/objects.h" 10 10 11 void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vec yg);11 void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vector* yg); 12 12 13 13 #endif /* _UPDATESPCSX_H */ -
issm/branches/trunk-jpl-damage/src/c/modules/VecMergex/VecMergex.cpp
r8809 r11684 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void VecMergex(Vec ug, Vecuf, Nodes* nodes, Parameters* parameters, int SetEnum){12 void VecMergex(Vector* ug, Vector* uf, Nodes* nodes, Parameters* parameters, int SetEnum){ 13 13 14 14 /*variables: */ … … 21 21 22 22 /*serialize uf: */ 23 VecToMPISerial(&uf_serial,uf); 23 uf_serial=uf->ToMPISerial(); 24 24 25 25 26 /*Do we have any nodes for this configuration? :*/ … … 43 44 44 45 /*Assemble vector: */ 45 VecAssemblyBegin(ug); 46 VecAssemblyEnd(ug); 47 46 ug->Assemble(); 48 47 } -
issm/branches/trunk-jpl-damage/src/c/modules/VecMergex/VecMergex.h
r8799 r11684 10 10 11 11 /* local prototypes: */ 12 void VecMergex(Vec ug, Vecuf, Nodes* nodes, Parameters* parameters, int SetEnum);12 void VecMergex(Vector* ug, Vector* uf, Nodes* nodes, Parameters* parameters, int SetEnum); 13 13 14 14 #endif /* _VECMERGEX_H */ -
issm/branches/trunk-jpl-damage/src/c/objects/Bamg/Mesh.cpp
r11093 r11684 1028 1028 Triangle &t=triangles[i]; 1029 1029 if (t.det>0 && !(t.Hidden(0)||t.Hidden(1) || t.Hidden(2) )){ 1030 index[num*3+0]=GetId(t[0])+1; //back to M indexing 1031 index[num*3+1]=GetId(t[1])+1; //back to M indexing 1032 index[num*3+2]=GetId(t[2])+1; //back to M indexing 1033 num=num+1; 1030 if(t.Anisotropy()<2 & t.Length()<1.e+5){ 1031 index[num*3+0]=GetId(t[0])+1; //back to M indexing 1032 index[num*3+1]=GetId(t[1])+1; //back to M indexing 1033 index[num*3+2]=GetId(t[2])+1; //back to M indexing 1034 num=num+1; 1035 } 1034 1036 } 1035 1037 } … … 1038 1040 /*Assign output pointers*/ 1039 1041 *pindex=index; 1040 *pnels= k;1042 *pnels=num; 1041 1043 } 1042 1044 /*}}}1*/ -
issm/branches/trunk-jpl-damage/src/c/objects/Bamg/Triangle.cpp
r9371 r11684 50 50 AdjacentTriangle Triangle::Adj(int i) const { 51 51 return AdjacentTriangle(adj[i],AdjEdgeIndex[i]&3); 52 };/*}}}*/ 53 /*FUNCTION Triangle::Anisotropy{{{1*/ 54 double Triangle::Anisotropy() const{ 55 56 double lmin,lmax; 57 58 /*Get three vertices A,B and C*/ 59 R2 A=*this->vertices[0]; 60 R2 B=*this->vertices[1]; 61 R2 C=*this->vertices[2]; 62 63 /*Compute edges*/ 64 R2 e1=B-A; 65 R2 e2=C-A; 66 R2 e3=B-C; 67 68 /*Compute edge length*/ 69 double l1=Norme2(e1); 70 double l2=Norme2(e2); 71 double l3=Norme2(e3); 72 73 lmin=l1; 74 lmin=min(lmin,l2); 75 lmin=min(lmin,l3); 76 lmax=l1; 77 lmax=max(lmax,l2); 78 lmax=max(lmax,l3); 79 80 return lmax/lmin; 81 };/*}}}*/ 82 /*FUNCTION Triangle::Length{{{1*/ 83 double Triangle::Length() const{ 84 85 double l; 86 87 /*Get three vertices A,B and C*/ 88 R2 A=*this->vertices[0]; 89 R2 B=*this->vertices[1]; 90 R2 C=*this->vertices[2]; 91 92 /*Compute edges*/ 93 R2 e1=B-A; 94 R2 e2=C-A; 95 R2 e3=B-C; 96 97 /*Compute edge length*/ 98 l=Norme2(e1); 99 l=max(l,Norme2(e2)); 100 l=max(l,Norme2(e3)); 101 102 return l; 52 103 };/*}}}*/ 53 104 /*FUNCTION Triangle::Echo {{{1*/ -
issm/branches/trunk-jpl-damage/src/c/objects/Bamg/Triangle.h
r9371 r11684 41 41 //Methods 42 42 void Echo(); 43 double Anisotropy() const; 44 double Length() const; 43 45 int swap(short a1,int=0); 44 46 long Optim(short a,int =0); -
issm/branches/trunk-jpl-damage/src/c/objects/Elements/Element.h
r11577 r11684 16 16 class Parameters; 17 17 class Patch; 18 class Matrix; 19 class Vector; 18 20 19 21 #include "../../toolkits/toolkits.h" … … 28 30 virtual void Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0; 29 31 virtual void SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0; 30 virtual void CreateKMatrix(Mat Kff, Mat Kfs,Vecdf)=0;31 virtual void CreatePVector(Vec pf)=0;32 virtual void CreateJacobianMatrix(Mat Jff)=0;33 virtual void GetSolutionFromInputs(Vec solution)=0;32 virtual void CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df)=0; 33 virtual void CreatePVector(Vector* pf)=0; 34 virtual void CreateJacobianMatrix(Matrix* Jff)=0; 35 virtual void GetSolutionFromInputs(Vector* solution)=0; 34 36 virtual int GetNodeIndex(Node* node)=0; 35 37 virtual int Sid()=0; … … 58 60 virtual void RequestedOutput(int output_enum,int step,double time)=0; 59 61 62 virtual int NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units)=0; 60 63 virtual void InputScale(int enum_type,double scale_factor)=0; 61 64 virtual void GetVectorFromInputs(Vec vector, int name_enum)=0; … … 88 91 virtual void ElementResponse(double* presponse,int response_enum,bool process_units)=0; 89 92 virtual double IceVolume(void)=0; 90 virtual int NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units)=0;91 93 #endif 92 94 -
issm/branches/trunk-jpl-damage/src/c/objects/Elements/Penta.cpp
r11577 r11684 567 567 /*}}}*/ 568 568 /*FUNCTION Penta::CreateKMatrix {{{1*/ 569 void Penta::CreateKMatrix(Mat Kff, Mat Kfs,Vecdf){569 void Penta::CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df){ 570 570 571 571 /*retrieve parameters: */ … … 671 671 /*}}}*/ 672 672 /*FUNCTION Penta::CreatePVector {{{1*/ 673 void Penta::CreatePVector(Vec pf){673 void Penta::CreatePVector(Vector* pf){ 674 674 675 675 /*retrive parameters: */ … … 773 773 /*}}}*/ 774 774 /*FUNCTION Penta::CreateJacobianMatrix{{{1*/ 775 void Penta::CreateJacobianMatrix(Mat Jff){775 void Penta::CreateJacobianMatrix(Matrix* Jff){ 776 776 777 777 /*retrieve parameters: */ … … 1091 1091 /*}}}*/ 1092 1092 /*FUNCTION Penta::GetSolutionFromInputs{{{1*/ 1093 void Penta::GetSolutionFromInputs(Vec solution){1093 void Penta::GetSolutionFromInputs(Vector* solution){ 1094 1094 1095 1095 int analysis_type; … … 2331 2331 extern int my_rank; 2332 2332 return my_rank; 2333 } 2334 /*}}}*/ 2335 /*FUNCTION Penta::NodalValue {{{1*/ 2336 int Penta::NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units){ 2337 2338 int i; 2339 int found=0; 2340 double value; 2341 Input* data=NULL; 2342 GaussPenta* gauss=NULL; 2343 2344 /*First, serarch the input: */ 2345 data=inputs->GetInput(natureofdataenum); 2346 2347 /*figure out if we have the vertex id: */ 2348 found=0; 2349 for(i=0;i<NUMVERTICES;i++){ 2350 if(index==nodes[i]->GetVertexId()){ 2351 /*Do we have natureofdataenum in our inputs? :*/ 2352 if(data){ 2353 /*ok, we are good. retrieve value of input at vertex :*/ 2354 gauss=new GaussPenta(); gauss->GaussVertex(i); 2355 data->GetInputValue(&value,gauss); 2356 found=1; 2357 break; 2358 } 2359 } 2360 } 2361 2362 if(found)*pvalue=value; 2363 return found; 2333 2364 } 2334 2365 /*}}}*/ … … 3008 3039 } 3009 3040 /*}}}*/ 3010 /*FUNCTION Penta::NodalValue {{{1*/3011 int Penta::NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units){3012 3013 int i;3014 int found=0;3015 double value;3016 Input* data=NULL;3017 GaussPenta* gauss=NULL;3018 3019 /*First, serarch the input: */3020 data=inputs->GetInput(natureofdataenum);3021 3022 /*figure out if we have the vertex id: */3023 found=0;3024 for(i=0;i<NUMVERTICES;i++){3025 if(index==nodes[i]->GetVertexId()){3026 /*Do we have natureofdataenum in our inputs? :*/3027 if(data){3028 /*ok, we are good. retrieve value of input at vertex :*/3029 gauss=new GaussPenta(); gauss->GaussVertex(i);3030 data->GetInputValue(&value,gauss);3031 found=1;3032 break;3033 }3034 }3035 }3036 3037 if(found)*pvalue=value;3038 return found;3039 }3040 /*}}}*/3041 3041 /*FUNCTION Penta::MinVel{{{1*/ 3042 3042 void Penta::MinVel(double* pminvel, bool process_units){ … … 4190 4190 /*}}}*/ 4191 4191 /*FUNCTION Penta::GetSolutionFromInputsThermal{{{1*/ 4192 void Penta::GetSolutionFromInputsThermal(Vec solution){4192 void Penta::GetSolutionFromInputsThermal(Vector* solution){ 4193 4193 4194 4194 const int numdof=NDOF1*NUMVERTICES; … … 4213 4213 4214 4214 /*Add value to global vector*/ 4215 VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);4215 solution->SetValues(numdof,doflist,values,INSERT_VALUES); 4216 4216 4217 4217 /*Free ressources:*/ … … 4221 4221 /*}}}*/ 4222 4222 /*FUNCTION Penta::GetSolutionFromInputsEnthalpy{{{1*/ 4223 void Penta::GetSolutionFromInputsEnthalpy(Vec solution){4223 void Penta::GetSolutionFromInputsEnthalpy(Vector* solution){ 4224 4224 4225 4225 const int numdof=NDOF1*NUMVERTICES; … … 4244 4244 4245 4245 /*Add value to global vector*/ 4246 VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);4246 solution->SetValues(numdof,doflist,values,INSERT_VALUES); 4247 4247 4248 4248 /*Free ressources:*/ … … 7862 7862 /*}}}*/ 7863 7863 /*FUNCTION Penta::GetSolutionFromInputsDiagnosticHoriz{{{1*/ 7864 void Penta::GetSolutionFromInputsDiagnosticHoriz(Vec solution){7864 void Penta::GetSolutionFromInputsDiagnosticHoriz(Vector* solution){ 7865 7865 7866 7866 const int numdof=NDOF2*NUMVERTICES; … … 7896 7896 7897 7897 /*Add value to global vector*/ 7898 VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);7898 solution->SetValues(numdof,doflist,values,INSERT_VALUES); 7899 7899 7900 7900 /*Free ressources:*/ … … 7904 7904 /*}}}*/ 7905 7905 /*FUNCTION Penta::GetSolutionFromInputsDiagnosticHutter{{{1*/ 7906 void Penta::GetSolutionFromInputsDiagnosticHutter(Vec solution){7906 void Penta::GetSolutionFromInputsDiagnosticHutter(Vector* solution){ 7907 7907 7908 7908 const int numdof=NDOF2*NUMVERTICES; … … 7932 7932 7933 7933 /*Add value to global vector*/ 7934 VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);7934 solution->SetValues(numdof,doflist,values,INSERT_VALUES); 7935 7935 7936 7936 /*Free ressources:*/ … … 7940 7940 /*}}}*/ 7941 7941 /*FUNCTION Penta::GetSolutionFromInputsDiagnosticVert{{{1*/ 7942 void Penta::GetSolutionFromInputsDiagnosticVert(Vec solution){7942 void Penta::GetSolutionFromInputsDiagnosticVert(Vector* solution){ 7943 7943 7944 7944 const int numdof=NDOF1*NUMVERTICES; … … 7965 7965 7966 7966 /*Add value to global vector*/ 7967 VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);7967 solution->SetValues(numdof,doflist,values,INSERT_VALUES); 7968 7968 7969 7969 /*Free ressources:*/ … … 7973 7973 /*}}}*/ 7974 7974 /*FUNCTION Penta::GetSolutionFromInputsDiagnosticStokes{{{1*/ 7975 void Penta::GetSolutionFromInputsDiagnosticStokes(Vec solution){7975 void Penta::GetSolutionFromInputsDiagnosticStokes(Vector* solution){ 7976 7976 7977 7977 const int numdof=NDOF4*NUMVERTICES; … … 8010 8010 8011 8011 /*Add value to global vector*/ 8012 VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);8012 solution->SetValues(numdof,doflist,values,INSERT_VALUES); 8013 8013 8014 8014 /*Free ressources:*/ -
issm/branches/trunk-jpl-damage/src/c/objects/Elements/Penta.h
r11577 r11684 86 86 void Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters); 87 87 void SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters); 88 void CreateKMatrix(Mat Kff, Mat Kfs,Vecdf);89 void CreatePVector(Vec pf);90 void CreateJacobianMatrix(Mat Jff);88 void CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df); 89 void CreatePVector(Vector* pf); 90 void CreateJacobianMatrix(Matrix* Jff); 91 91 void DeleteResults(void); 92 92 int GetNodeIndex(Node* node); 93 void GetSolutionFromInputs(Vec solution);93 void GetSolutionFromInputs(Vector* solution); 94 94 double GetZcoord(GaussPenta* gauss); 95 95 void GetVectorFromInputs(Vec vector,int name_enum); … … 118 118 void Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type); 119 119 int UpdatePotentialSheetUngrounding(double* potential_sheet_ungrounding,Vec vec_nodes_on_iceshelf,double* nodes_on_iceshelf); 120 int NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units); 120 121 double TimeAdapt(); 121 122 int* GetHorizontalNeighboorSids(void); … … 129 130 void MinVy(double* pminvy, bool process_units); 130 131 void MinVz(double* pminvz, bool process_units); 131 int NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units);132 132 double MassFlux(double* segment,bool process_units); 133 133 void MaxAbsVx(double* pmaxabsvx, bool process_units); … … 183 183 void GetInputValue(double* pvalue,Node* node,int enumtype); 184 184 void GetPhi(double* phi, double* epsilon, double viscosity); 185 void GetSolutionFromInputsEnthalpy(Vec solutiong);185 void GetSolutionFromInputsEnthalpy(Vector* solutiong); 186 186 double GetStabilizationParameter(double u, double v, double w, double diameter, double kappa); 187 187 void GetStrainRate3dPattyn(double* epsilon,double* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input); … … 250 250 void InputUpdateFromSolutionDiagnosticVert( double* solutiong); 251 251 void InputUpdateFromSolutionDiagnosticStokes( double* solutiong); 252 void GetSolutionFromInputsDiagnosticHoriz(Vec solutiong);253 void GetSolutionFromInputsDiagnosticHutter(Vec solutiong);254 void GetSolutionFromInputsDiagnosticStokes(Vec solutiong);255 void GetSolutionFromInputsDiagnosticVert(Vec solutiong);252 void GetSolutionFromInputsDiagnosticHoriz(Vector* solutiong); 253 void GetSolutionFromInputsDiagnosticHutter(Vector* solutiong); 254 void GetSolutionFromInputsDiagnosticStokes(Vector* solutiong); 255 void GetSolutionFromInputsDiagnosticVert(Vector* solutiong); 256 256 ElementVector* CreatePVectorCouplingMacAyealStokes(void); 257 257 ElementVector* CreatePVectorCouplingMacAyealStokesViscous(void); … … 307 307 ElementVector* CreatePVectorThermalShelf(void); 308 308 ElementVector* CreatePVectorThermalSheet(void); 309 void GetSolutionFromInputsThermal(Vec solutiong);309 void GetSolutionFromInputsThermal(Vector* solutiong); 310 310 void InputUpdateFromSolutionThermal( double* solutiong); 311 311 void InputUpdateFromSolutionEnthalpy( double* solutiong); -
issm/branches/trunk-jpl-damage/src/c/objects/Elements/Tria.cpp
r11577 r11684 319 319 /*}}}*/ 320 320 /*FUNCTION Tria::CreateKMatrix {{{1*/ 321 void Tria::CreateKMatrix(Mat Kff, Mat Kfs,Vecdf){321 void Tria::CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df){ 322 322 323 323 /*retreive parameters: */ … … 672 672 /*}}}*/ 673 673 /*FUNCTION Tria::CreatePVector {{{1*/ 674 void Tria::CreatePVector(Vec pf){674 void Tria::CreatePVector(Vector* pf){ 675 675 676 676 /*retrive parameters: */ … … 892 892 /*}}}*/ 893 893 /*FUNCTION Tria::CreateJacobianMatrix{{{1*/ 894 void Tria::CreateJacobianMatrix(Mat Jff){894 void Tria::CreateJacobianMatrix(Matrix* Jff){ 895 895 896 896 /*retrieve parameters: */ … … 1274 1274 /*}}}*/ 1275 1275 /*FUNCTION Tria::GetSolutionFromInputs{{{1*/ 1276 void Tria::GetSolutionFromInputs(Vec solution){1276 void Tria::GetSolutionFromInputs(Vector* solution){ 1277 1277 1278 1278 /*retrive parameters: */ … … 2124 2124 } 2125 2125 /*}}}*/ 2126 /*FUNCTION Tria::NodalValue {{{1*/ 2127 int Tria::NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units){ 2128 2129 int i; 2130 int found=0; 2131 double value; 2132 Input* data=NULL; 2133 GaussTria *gauss = NULL; 2134 2135 /*First, serarch the input: */ 2136 data=inputs->GetInput(natureofdataenum); 2137 2138 /*figure out if we have the vertex id: */ 2139 found=0; 2140 for(i=0;i<NUMVERTICES;i++){ 2141 if(index==nodes[i]->GetVertexId()){ 2142 /*Do we have natureofdataenum in our inputs? :*/ 2143 if(data){ 2144 /*ok, we are good. retrieve value of input at vertex :*/ 2145 gauss=new GaussTria(); gauss->GaussVertex(i); 2146 data->GetInputValue(&value,gauss); 2147 found=1; 2148 break; 2149 } 2150 } 2151 } 2152 2153 if(found)*pvalue=value; 2154 return found; 2155 } 2156 /*}}}*/ 2126 2157 /*FUNCTION Tria::PatchFill{{{1*/ 2127 2158 void Tria::PatchFill(int* prow, Patch* patch){ … … 2740 2771 } 2741 2772 /*}}}*/ 2742 /*FUNCTION Tria::NodalValue {{{1*/2743 int Tria::NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units){2744 2745 int i;2746 int found=0;2747 double value;2748 Input* data=NULL;2749 GaussTria *gauss = NULL;2750 2751 /*First, serarch the input: */2752 data=inputs->GetInput(natureofdataenum);2753 2754 /*figure out if we have the vertex id: */2755 found=0;2756 for(i=0;i<NUMVERTICES;i++){2757 if(index==nodes[i]->GetVertexId()){2758 /*Do we have natureofdataenum in our inputs? :*/2759 if(data){2760 /*ok, we are good. retrieve value of input at vertex :*/2761 gauss=new GaussTria(); gauss->GaussVertex(i);2762 data->GetInputValue(&value,gauss);2763 found=1;2764 break;2765 }2766 }2767 }2768 2769 if(found)*pvalue=value;2770 return found;2771 }2772 /*}}}*/2773 2773 /*FUNCTION Tria::ElementResponse{{{1*/ 2774 2774 void Tria::ElementResponse(double* presponse,int response_enum,bool process_units){ … … 3143 3143 /*}}}*/ 3144 3144 /*FUNCTION Tria::GetSolutionFromInputsDiagnosticHoriz{{{1*/ 3145 void Tria::GetSolutionFromInputsDiagnosticHoriz(Vec solution){3145 void Tria::GetSolutionFromInputsDiagnosticHoriz(Vector* solution){ 3146 3146 3147 3147 const int numdof=NDOF2*NUMVERTICES; … … 3174 3174 } 3175 3175 3176 VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);3176 solution->SetValues(numdof,doflist,values,INSERT_VALUES); 3177 3177 3178 3178 /*Free ressources:*/ … … 3182 3182 /*}}}*/ 3183 3183 /*FUNCTION Tria::GetSolutionFromInputsDiagnosticHutter{{{1*/ 3184 void Tria::GetSolutionFromInputsDiagnosticHutter(Vec solution){3184 void Tria::GetSolutionFromInputsDiagnosticHutter(Vector* solution){ 3185 3185 3186 3186 const int numdof=NDOF2*NUMVERTICES; … … 3213 3213 } 3214 3214 3215 VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);3215 solution->SetValues(numdof,doflist,values,INSERT_VALUES); 3216 3216 3217 3217 /*Free ressources:*/ … … 4985 4985 } 4986 4986 /*}}}*/ 4987 4987 4988 /*FUNCTION Tria::InputUpdateFromSolutionAdjointBalancethickness {{{1*/ 4988 4989 void Tria::InputUpdateFromSolutionAdjointBalancethickness(double* solution){ … … 5289 5290 /*}}}*/ 5290 5291 /*FUNCTION Tria::GetSolutionFromInputsHydrology{{{1*/ 5291 void Tria::GetSolutionFromInputsHydrology(Vec solution){5292 void Tria::GetSolutionFromInputsHydrology(Vector* solution){ 5292 5293 5293 5294 const int numdof=NDOF1*NUMVERTICES; … … 5317 5318 } 5318 5319 5319 VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);5320 solution->SetValues(numdof,doflist,values,INSERT_VALUES); 5320 5321 5321 5322 /*Free ressources:*/ -
issm/branches/trunk-jpl-damage/src/c/objects/Elements/Tria.h
r11577 r11684 82 82 void Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters); 83 83 void SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters); 84 void CreateKMatrix(Mat Kff, Mat Kfs,Vecdf);85 void CreatePVector(Vec pf);86 void CreateJacobianMatrix(Mat Jff);84 void CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df); 85 void CreatePVector(Vector* pf); 86 void CreateJacobianMatrix(Matrix* Jff); 87 87 int GetNodeIndex(Node* node); 88 88 int Sid(); … … 92 92 bool IsNodeOnShelfFromFlags(double* flags); 93 93 bool IsOnWater(); 94 void GetSolutionFromInputs(Vec solution);94 void GetSolutionFromInputs(Vector* solution); 95 95 void GetVectorFromInputs(Vec vector, int name_enum); 96 96 void GetVectorFromResults(Vec vector,int offset,int interp); … … 106 106 void MaterialUpdateFromTemperature(void){_error_("not implemented yet");}; 107 107 void MigrateGroundingLine(double* oldfloating,double* sheet_ungrounding); 108 int NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units); 108 109 void PotentialSheetUngrounding(Vec potential_sheet_ungrounding); 109 110 void PositiveDegreeDay(void); … … 127 128 void MinVy(double* pminvy, bool process_units); 128 129 void MinVz(double* pminvz, bool process_units); 129 int NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units);130 130 double MassFlux(double* segment,bool process_units); 131 131 void MaxAbsVx(double* pmaxabsvx, bool process_units); … … 212 212 ElementVector* CreatePVectorDiagnosticHutter(void); 213 213 ElementMatrix* CreateJacobianDiagnosticMacayeal(void); 214 void GetSolutionFromInputsDiagnosticHoriz(Vec solution);215 void GetSolutionFromInputsDiagnosticHutter(Vec solution);214 void GetSolutionFromInputsDiagnosticHoriz(Vector* solution); 215 void GetSolutionFromInputsDiagnosticHutter(Vector* solution); 216 216 void InputUpdateFromSolutionDiagnosticHoriz( double* solution); 217 217 void InputUpdateFromSolutionDiagnosticHutter( double* solution); … … 232 232 ElementVector* CreatePVectorHydrology(void); 233 233 void CreateHydrologyWaterVelocityInput(void); 234 void GetSolutionFromInputsHydrology(Vec solution);234 void GetSolutionFromInputsHydrology(Vector* solution); 235 235 void InputUpdateFromSolutionHydrology(double* solution); 236 236 #endif -
issm/branches/trunk-jpl-damage/src/c/objects/Loads/Icefront.cpp
r11332 r11684 316 316 /*}}}*/ 317 317 /*FUNCTION Icefront::CreateKMatrix {{{1*/ 318 void Icefront::CreateKMatrix(Mat Kff, MatKfs){318 void Icefront::CreateKMatrix(Matrix* Kff, Matrix* Kfs){ 319 319 320 320 /*No stiffness loads applied, do nothing: */ … … 324 324 /*}}}*/ 325 325 /*FUNCTION Icefront::CreatePVector {{{1*/ 326 void Icefront::CreatePVector(Vec pf){326 void Icefront::CreatePVector(Vector* pf){ 327 327 328 328 /*Checks in debugging mode*/ … … 362 362 /*}}}*/ 363 363 /*FUNCTION Icefront::CreateJacobianMatrix{{{1*/ 364 void Icefront::CreateJacobianMatrix(Mat Jff){364 void Icefront::CreateJacobianMatrix(Matrix* Jff){ 365 365 this->CreateKMatrix(Jff,NULL); 366 366 } 367 367 /*}}}1*/ 368 368 /*FUNCTION Icefront::PenaltyCreateKMatrix {{{1*/ 369 void Icefront::PenaltyCreateKMatrix(Mat Kff, MatKfs, double kmax){369 void Icefront::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs, double kmax){ 370 370 /*do nothing: */ 371 371 return; … … 373 373 /*}}}*/ 374 374 /*FUNCTION Icefront::PenaltyCreatePVector{{{1*/ 375 void Icefront::PenaltyCreatePVector(Vec pf,double kmax){375 void Icefront::PenaltyCreatePVector(Vector* pf,double kmax){ 376 376 /*do nothing: */ 377 377 return; … … 379 379 /*}}}*/ 380 380 /*FUNCTION Icefront::PenaltyCreateJacobianMatrix{{{1*/ 381 void Icefront::PenaltyCreateJacobianMatrix(Mat Jff,double kmax){381 void Icefront::PenaltyCreateJacobianMatrix(Matrix* Jff,double kmax){ 382 382 this->PenaltyCreateKMatrix(Jff,NULL,kmax); 383 383 } -
issm/branches/trunk-jpl-damage/src/c/objects/Loads/Icefront.h
r11332 r11684 74 74 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 75 75 void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 76 void CreateKMatrix(Mat Kff, MatKfs);77 void CreatePVector(Vec pf);78 void CreateJacobianMatrix(Mat Jff);79 void PenaltyCreateKMatrix(Mat Kff, Matkfs, double kmax);80 void PenaltyCreatePVector(Vec pf, double kmax);81 void PenaltyCreateJacobianMatrix(Mat Jff,double kmax);76 void CreateKMatrix(Matrix* Kff, Matrix* Kfs); 77 void CreatePVector(Vector* pf); 78 void CreateJacobianMatrix(Matrix* Jff); 79 void PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, double kmax); 80 void PenaltyCreatePVector(Vector* pf, double kmax); 81 void PenaltyCreateJacobianMatrix(Matrix* Jff,double kmax); 82 82 bool InAnalysis(int analysis_type); 83 83 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/objects/Loads/Load.h
r11327 r11684 12 12 /*{{{1*/ 13 13 class Object; 14 class Matrix; 15 class Vector; 14 16 15 17 #include "../Object.h" … … 27 29 virtual void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0; 28 30 virtual void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0; 29 virtual void CreateKMatrix(Mat Kff, MatKfs)=0;30 virtual void CreatePVector(Vec pf)=0;31 virtual void CreateJacobianMatrix(Mat Jff)=0;32 virtual void PenaltyCreateJacobianMatrix(Mat Jff,double kmax)=0;33 virtual void PenaltyCreateKMatrix(Mat Kff, MatKfs, double kmax)=0;34 virtual void PenaltyCreatePVector(Vec pf, double kmax)=0;31 virtual void CreateKMatrix(Matrix* Kff, Matrix* Kfs)=0; 32 virtual void CreatePVector(Vector* pf)=0; 33 virtual void CreateJacobianMatrix(Matrix* Jff)=0; 34 virtual void PenaltyCreateJacobianMatrix(Matrix* Jff,double kmax)=0; 35 virtual void PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs, double kmax)=0; 36 virtual void PenaltyCreatePVector(Vector* pf, double kmax)=0; 35 37 virtual bool InAnalysis(int analysis_type)=0; 36 38 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/objects/Loads/Numericalflux.cpp
r10135 r11684 334 334 /*}}}*/ 335 335 /*FUNCTION Numericalflux::CreateKMatrix {{{1*/ 336 void Numericalflux::CreateKMatrix(Mat Kff, MatKfs){336 void Numericalflux::CreateKMatrix(Matrix* Kff, Matrix* Kfs){ 337 337 338 338 /*recover some parameters*/ … … 365 365 /*}}}*/ 366 366 /*FUNCTION Numericalflux::CreatePVector {{{1*/ 367 void Numericalflux::CreatePVector(Vec pf){367 void Numericalflux::CreatePVector(Vector* pf){ 368 368 369 369 /*recover some parameters*/ … … 395 395 /*}}}*/ 396 396 /*FUNCTION Numericalflux::PenaltyCreateKMatrix {{{1*/ 397 void Numericalflux::PenaltyCreateKMatrix(Mat Kff, MatKfs,double kmax){397 void Numericalflux::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,double kmax){ 398 398 399 399 /*No stiffness loads applied, do nothing: */ … … 403 403 /*}}}*/ 404 404 /*FUNCTION Numericalflux::PenaltyCreatePVector{{{1*/ 405 void Numericalflux::PenaltyCreatePVector(Vec pf,double kmax){405 void Numericalflux::PenaltyCreatePVector(Vector* pf,double kmax){ 406 406 407 407 /*No penalty loads applied, do nothing: */ -
issm/branches/trunk-jpl-damage/src/c/objects/Loads/Numericalflux.h
r11327 r11684 70 70 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 71 71 void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 72 void CreateKMatrix(Mat Kff, MatKfs);73 void CreatePVector(Vec pf);74 void CreateJacobianMatrix(Mat Jff){_error_("Not implemented yet");};75 void PenaltyCreateJacobianMatrix(Mat Jff,double kmax){_error_("Not implemented yet");};76 void PenaltyCreateKMatrix(Mat Kff, Matkfs, double kmax);77 void PenaltyCreatePVector(Vec pf, double kmax);72 void CreateKMatrix(Matrix* Kff, Matrix* Kfs); 73 void CreatePVector(Vector* pf); 74 void CreateJacobianMatrix(Matrix* Jff){_error_("Not implemented yet");}; 75 void PenaltyCreateJacobianMatrix(Matrix* Jff,double kmax){_error_("Not implemented yet");}; 76 void PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, double kmax); 77 void PenaltyCreatePVector(Vector* pf, double kmax); 78 78 bool InAnalysis(int analysis_type); 79 79 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/objects/Loads/Pengrid.cpp
r10576 r11684 295 295 /*}}}1*/ 296 296 /*FUNCTION Pengrid::CreateKMatrix {{{1*/ 297 void Pengrid::CreateKMatrix(Mat Kff, MatKfs){297 void Pengrid::CreateKMatrix(Matrix* Kff, Matrix* Kfs){ 298 298 299 299 /*No loads applied, do nothing: */ … … 303 303 /*}}}1*/ 304 304 /*FUNCTION Pengrid::CreatePVector {{{1*/ 305 void Pengrid::CreatePVector(Vec pf){305 void Pengrid::CreatePVector(Vector* pf){ 306 306 307 307 /*No loads applied, do nothing: */ … … 311 311 /*}}}1*/ 312 312 /*FUNCTION Pengrid::PenaltyCreateMatrix {{{1*/ 313 void Pengrid::PenaltyCreateKMatrix(Mat Kff, MatKfs,double kmax){313 void Pengrid::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,double kmax){ 314 314 315 315 /*Retrieve parameters: */ … … 319 319 320 320 switch(analysis_type){ 321 #ifdef _HAVE_DIAGNOSTIC_ 321 322 case DiagnosticHorizAnalysisEnum: case AdjointHorizAnalysisEnum: 322 323 Ke=PenaltyCreateKMatrixDiagnosticStokes(kmax); 323 324 break; 325 #endif 326 #ifdef _HAVE_THERMAL_ 324 327 case ThermalAnalysisEnum: 325 328 Ke=PenaltyCreateKMatrixThermal(kmax); … … 328 331 Ke=PenaltyCreateKMatrixMelting(kmax); 329 332 break; 333 #endif 330 334 default: 331 335 _error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type)); … … 340 344 /*}}}1*/ 341 345 /*FUNCTION Pengrid::PenaltyCreatePVector {{{1*/ 342 void Pengrid::PenaltyCreatePVector(Vec pf,double kmax){346 void Pengrid::PenaltyCreatePVector(Vector* pf,double kmax){ 343 347 344 348 /*Retrieve parameters: */ … … 348 352 349 353 switch(analysis_type){ 354 #ifdef _HAVE_DIAGNOSTIC_ 350 355 case ThermalAnalysisEnum: 351 356 pe=PenaltyCreatePVectorThermal(kmax); 352 357 break; 358 #endif 359 #ifdef _HAVE_THERMAL_ 353 360 case MeltingAnalysisEnum: 354 361 pe=PenaltyCreatePVectorMelting(kmax); … … 356 363 case DiagnosticHorizAnalysisEnum: case AdjointHorizAnalysisEnum: 357 364 break; 365 #endif 358 366 default: 359 367 _error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type)); … … 539 547 } 540 548 /*}}}1*/ 549 #ifdef _HAVE_DIAGNOSTIC_ 541 550 /*FUNCTION Pengrid::PenaltyCreateKMatrixDiagnosticStokes {{{1*/ 542 551 ElementMatrix* Pengrid::PenaltyCreateKMatrixDiagnosticStokes(double kmax){ … … 571 580 } 572 581 /*}}}1*/ 582 #endif 583 #ifdef _HAVE_THERMAL_ 573 584 /*FUNCTION Pengrid::PenaltyCreateKMatrixMelting {{{1*/ 574 585 ElementMatrix* Pengrid::PenaltyCreateKMatrixMelting(double kmax){ … … 690 701 } 691 702 /*}}}1*/ 703 #endif 692 704 /*FUNCTION Pengrid::ResetConstraint {{{1*/ 693 705 void Pengrid::ResetConstraint(void){ -
issm/branches/trunk-jpl-damage/src/c/objects/Loads/Pengrid.h
r11327 r11684 75 75 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 76 76 void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 77 void CreateKMatrix(Mat Kff, MatKfs);78 void CreatePVector(Vec pf);79 void CreateJacobianMatrix(Mat Jff){_error_("Not implemented yet");};80 void PenaltyCreateJacobianMatrix(Mat Jff,double kmax){_error_("Not implemented yet");};81 void PenaltyCreateKMatrix(Mat Kff, Matkfs, double kmax);82 void PenaltyCreatePVector(Vec pf, double kmax);77 void CreateKMatrix(Matrix* Kff, Matrix* Kfs); 78 void CreatePVector(Vector* pf); 79 void CreateJacobianMatrix(Matrix* Jff){_error_("Not implemented yet");}; 80 void PenaltyCreateJacobianMatrix(Matrix* Jff,double kmax){_error_("Not implemented yet");}; 81 void PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, double kmax); 82 void PenaltyCreatePVector(Vector* pf, double kmax); 83 83 bool InAnalysis(int analysis_type); 84 84 /*}}}*/ 85 85 /*Pengrid management {{{1*/ 86 #ifdef _HAVE_DIAGNOSTIC_ 86 87 ElementMatrix* PenaltyCreateKMatrixDiagnosticStokes(double kmax); 88 #endif 89 #ifdef _HAVE_THERMAL_ 87 90 ElementMatrix* PenaltyCreateKMatrixThermal(double kmax); 88 91 ElementMatrix* PenaltyCreateKMatrixMelting(double kmax); 89 92 ElementVector* PenaltyCreatePVectorThermal(double kmax); 90 93 ElementVector* PenaltyCreatePVectorMelting(double kmax); 94 #endif 91 95 void ConstraintActivate(int* punstable); 92 96 void ConstraintActivateThermal(int* punstable); -
issm/branches/trunk-jpl-damage/src/c/objects/Loads/Penpair.cpp
r11332 r11684 199 199 /*}}}1*/ 200 200 /*FUNCTION Penpair::CreateKMatrix {{{1*/ 201 void Penpair::CreateKMatrix(Mat Kff, MatKfs){201 void Penpair::CreateKMatrix(Matrix* Kff, Matrix* Kfs){ 202 202 /*If you code this piece, don't forget that a penalty will be inactive if it is dealing with clone nodes*/ 203 203 /*No loads applied, do nothing: */ … … 207 207 /*}}}1*/ 208 208 /*FUNCTION Penpair::CreatePVector {{{1*/ 209 void Penpair::CreatePVector(Vec pf){209 void Penpair::CreatePVector(Vector* pf){ 210 210 211 211 /*No loads applied, do nothing: */ … … 215 215 /*}}}1*/ 216 216 /*FUNCTION Penpair::CreateJacobianMatrix{{{1*/ 217 void Penpair::CreateJacobianMatrix(Mat Jff){217 void Penpair::CreateJacobianMatrix(Matrix* Jff){ 218 218 this->CreateKMatrix(Jff,NULL); 219 219 } 220 220 /*}}}1*/ 221 221 /*FUNCTION Penpair::PenaltyCreateKMatrix {{{1*/ 222 void Penpair::PenaltyCreateKMatrix(Mat Kff, MatKfs,double kmax){222 void Penpair::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,double kmax){ 223 223 224 224 /*Retrieve parameters: */ … … 246 246 /*}}}1*/ 247 247 /*FUNCTION Penpair::PenaltyCreatePVector {{{1*/ 248 void Penpair::PenaltyCreatePVector(Vec pf,double kmax){248 void Penpair::PenaltyCreatePVector(Vector* pf,double kmax){ 249 249 /*No loads applied, do nothing: */ 250 250 return; … … 252 252 /*}}}1*/ 253 253 /*FUNCTION Penpair::PenaltyCreateJacobianMatrix{{{1*/ 254 void Penpair::PenaltyCreateJacobianMatrix(Mat Jff,double kmax){254 void Penpair::PenaltyCreateJacobianMatrix(Matrix* Jff,double kmax){ 255 255 this->PenaltyCreateKMatrix(Jff,NULL,kmax); 256 256 } -
issm/branches/trunk-jpl-damage/src/c/objects/Loads/Penpair.h
r11327 r11684 62 62 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 63 63 void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 64 void CreateKMatrix(Mat Kff, MatKfs);65 void CreatePVector(Vec pf);66 void CreateJacobianMatrix(Mat Jff);67 void PenaltyCreateKMatrix(Mat Kff,MatKfs,double kmax);68 void PenaltyCreatePVector(Vec pf, double kmax);69 void PenaltyCreateJacobianMatrix(Mat Jff,double kmax);64 void CreateKMatrix(Matrix* Kff, Matrix* Kfs); 65 void CreatePVector(Vector* pf); 66 void CreateJacobianMatrix(Matrix* Jff); 67 void PenaltyCreateKMatrix(Matrix* Kff,Matrix* Kfs,double kmax); 68 void PenaltyCreatePVector(Vector* pf, double kmax); 69 void PenaltyCreateJacobianMatrix(Matrix* Jff,double kmax); 70 70 bool InAnalysis(int analysis_type); 71 71 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/objects/Loads/Riftfront.cpp
r11294 r11684 428 428 /*}}}*/ 429 429 /*FUNCTION Riftfront::PenaltyCreateKMatrix {{{1*/ 430 void Riftfront::PenaltyCreateKMatrix(Mat Kff, MatKfs,double kmax){430 void Riftfront::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,double kmax){ 431 431 432 432 /*Retrieve parameters: */ … … 454 454 /*}}}1*/ 455 455 /*FUNCTION Riftfront::PenaltyCreatePVector {{{1*/ 456 void Riftfront::PenaltyCreatePVector(Vec pf,double kmax){456 void Riftfront::PenaltyCreatePVector(Vector* pf,double kmax){ 457 457 458 458 /*Retrieve parameters: */ … … 480 480 /*}}}1*/ 481 481 /*FUNCTION Riftfront::CreateKMatrix {{{1*/ 482 void Riftfront::CreateKMatrix(Mat Kff, MatKfs){482 void Riftfront::CreateKMatrix(Matrix* Kff, Matrix* Kfs){ 483 483 /*do nothing: */ 484 484 return; … … 486 486 /*}}}1*/ 487 487 /*FUNCTION Riftfront::CreatePVector {{{1*/ 488 void Riftfront::CreatePVector(Vec pf){488 void Riftfront::CreatePVector(Vector* pf){ 489 489 /*do nothing: */ 490 490 return; -
issm/branches/trunk-jpl-damage/src/c/objects/Loads/Riftfront.h
r11327 r11684 82 82 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 83 83 void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 84 void CreateKMatrix(Mat Kff, MatKfs);85 void CreatePVector(Vec pf);86 void CreateJacobianMatrix(Mat Jff){_error_("Not implemented yet");};87 void PenaltyCreateJacobianMatrix(Mat Jff,double kmax){_error_("Not implemented yet");};88 void PenaltyCreateKMatrix(Mat Kff, Matkfs, double kmax);89 void PenaltyCreatePVector(Vec pf, double kmax);84 void CreateKMatrix(Matrix* Kff, Matrix* Kfs); 85 void CreatePVector(Vector* pf); 86 void CreateJacobianMatrix(Matrix* Jff){_error_("Not implemented yet");}; 87 void PenaltyCreateJacobianMatrix(Matrix* Jff,double kmax){_error_("Not implemented yet");}; 88 void PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, double kmax); 89 void PenaltyCreatePVector(Vector* pf, double kmax); 90 90 bool InAnalysis(int analysis_type); 91 91 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/objects/Node.cpp
r11001 r11684 594 594 /*}}}*/ 595 595 /*FUNCTION Node::CreateNodalConstraints{{{1*/ 596 void Node::CreateNodalConstraints(Vec ys){596 void Node::CreateNodalConstraints(Vector* ys){ 597 597 598 598 int i; … … 613 613 614 614 /*Add values into constraint vector: */ 615 VecSetValues(ys,this->indexing.ssize,this->indexing.sdoflist,values,INSERT_VALUES);615 ys->SetValues(this->indexing.ssize,this->indexing.sdoflist,values,INSERT_VALUES); 616 616 } 617 617 … … 875 875 /*}}}*/ 876 876 /*FUNCTION Node::VecMerge {{{1*/ 877 void Node::VecMerge(Vec ug, double* vector_serial,int setenum){877 void Node::VecMerge(Vector* ug, double* vector_serial,int setenum){ 878 878 879 879 double* values=NULL; … … 897 897 898 898 /*Add values into ug: */ 899 VecSetValues(ug,this->indexing.fsize,indices,(const double*)values,INSERT_VALUES);899 ug->SetValues(this->indexing.fsize,indices,values,INSERT_VALUES); 900 900 } 901 901 } … … 915 915 916 916 /*Add values into ug: */ 917 VecSetValues(ug,this->indexing.ssize,indices,(const double*)values,INSERT_VALUES);917 ug->SetValues(this->indexing.ssize,indices,values,INSERT_VALUES); 918 918 } 919 919 } … … 926 926 /*}}}*/ 927 927 /*FUNCTION Node::VecReduce {{{1*/ 928 void Node::VecReduce(Vec vector, double* ug_serial,int setenum){928 void Node::VecReduce(Vector* vector, double* ug_serial,int setenum){ 929 929 930 930 double* values=NULL; … … 945 945 946 946 /*Add values into ug: */ 947 VecSetValues(vector,this->indexing.fsize,this->indexing.fdoflist,(const double*)values,INSERT_VALUES);947 vector->SetValues(this->indexing.fsize,this->indexing.fdoflist,values,INSERT_VALUES); 948 948 } 949 949 } … … 961 961 962 962 /*Add values into ug: */ 963 VecSetValues(vector,this->indexing.ssize,this->indexing.sdoflist,(const double*)values,INSERT_VALUES);963 vector->SetValues(this->indexing.ssize,this->indexing.sdoflist,values,INSERT_VALUES); 964 964 } 965 965 } -
issm/branches/trunk-jpl-damage/src/c/objects/Node.h
r10576 r11684 16 16 class DataSet; 17 17 class Vertices; 18 class Vector; 19 class Matrix; 18 20 #include "./Update.h" 19 21 /*}}}*/ … … 67 69 /*Node numerical routines {{{1*/ 68 70 void Configure(DataSet* nodes,Vertices* vertices); 69 void CreateNodalConstraints(Vec ys);71 void CreateNodalConstraints(Vector* ys); 70 72 void SetCurrentConfiguration(DataSet* nodes,Vertices* vertices); 71 73 int Sid(void); … … 101 103 int IsGrounded(); 102 104 void UpdateSpcs(double* ys); 103 void VecMerge(Vec ug, double* vector_serial,int setnum);104 void VecReduce(Vec vector, double* ug_serial,int setnum);105 void VecMerge(Vector* ug, double* vector_serial,int setenum); 106 void VecReduce(Vector* vector, double* ug_serial,int setnum); 105 107 106 108 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/objects/Numerics/ElementMatrix.cpp
r11327 r11684 245 245 246 246 /*ElementMatrix specific routines: */ 247 /*FUNCTION ElementMatrix::AddToGlobal(Mat Kff, MatKfs){{{1*/248 void ElementMatrix::AddToGlobal(Mat Kff, MatKfs){247 /*FUNCTION ElementMatrix::AddToGlobal(Matrix* Kff, Matrix* Kfs){{{1*/ 248 void ElementMatrix::AddToGlobal(Matrix* Kff, Matrix* Kfs){ 249 249 250 250 int i,j; … … 260 260 this->CheckConsistency(); 261 261 262 if(this->dofsymmetrical){ 263 /*only use row dofs to add values into global matrices: */ 264 265 if(this->row_fsize){ 266 /*first, retrieve values that are in the f-set from the g-set values matrix: */ 267 localvalues=(double*)xmalloc(this->row_fsize*this->row_fsize*sizeof(double)); 268 for(i=0;i<this->row_fsize;i++){ 269 for(j=0;j<this->row_fsize;j++){ 270 *(localvalues+this->row_fsize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]); 262 #ifdef _HAVE_PETSC_ 263 if(this->dofsymmetrical){ 264 /*only use row dofs to add values into global matrices: */ 265 266 if(this->row_fsize){ 267 /*first, retrieve values that are in the f-set from the g-set values matrix: */ 268 localvalues=(double*)xmalloc(this->row_fsize*this->row_fsize*sizeof(double)); 269 for(i=0;i<this->row_fsize;i++){ 270 for(j=0;j<this->row_fsize;j++){ 271 *(localvalues+this->row_fsize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]); 272 } 271 273 } 274 /*add local values into global matrix, using the fglobaldoflist: */ 275 MatSetValues(Kff->matrix,this->row_fsize,this->row_fglobaldoflist,this->row_fsize,this->row_fglobaldoflist,(const double*)localvalues,ADD_VALUES); 276 277 /*Free ressources:*/ 278 xfree((void**)&localvalues); 272 279 } 273 /*add local values into global matrix, using the fglobaldoflist: */ 274 MatSetValues(Kff,this->row_fsize,this->row_fglobaldoflist,this->row_fsize,this->row_fglobaldoflist,(const double*)localvalues,ADD_VALUES); 275 276 /*Free ressources:*/ 277 xfree((void**)&localvalues); 278 } 279 280 281 if((this->row_ssize!=0) && (this->row_fsize!=0)){ 282 /*first, retrieve values that are in the f and s-set from the g-set values matrix: */ 283 localvalues=(double*)xmalloc(this->row_fsize*this->row_ssize*sizeof(double)); 284 for(i=0;i<this->row_fsize;i++){ 285 for(j=0;j<this->row_ssize;j++){ 286 *(localvalues+this->row_ssize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_slocaldoflist[j]); 280 281 282 if((this->row_ssize!=0) && (this->row_fsize!=0)){ 283 /*first, retrieve values that are in the f and s-set from the g-set values matrix: */ 284 localvalues=(double*)xmalloc(this->row_fsize*this->row_ssize*sizeof(double)); 285 for(i=0;i<this->row_fsize;i++){ 286 for(j=0;j<this->row_ssize;j++){ 287 *(localvalues+this->row_ssize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_slocaldoflist[j]); 288 } 287 289 } 290 /*add local values into global matrix, using the fglobaldoflist: */ 291 MatSetValues(Kfs->matrix,this->row_fsize,this->row_fglobaldoflist,this->row_ssize,this->row_sglobaldoflist,(const double*)localvalues,ADD_VALUES); 292 293 /*Free ressources:*/ 294 xfree((void**)&localvalues); 288 295 } 289 /*add local values into global matrix, using the fglobaldoflist: */ 290 MatSetValues(Kfs,this->row_fsize,this->row_fglobaldoflist,this->row_ssize,this->row_sglobaldoflist,(const double*)localvalues,ADD_VALUES); 291 292 /*Free ressources:*/ 293 xfree((void**)&localvalues); 294 } 295 } 296 else{ 297 _error_(" non dofsymmetrical matrix AddToGlobal routine not support yet!"); 298 } 299 300 } 301 /*}}}*/ 302 /*FUNCTION ElementMatrix::AddToGlobal(Mat Jff){{{1*/ 303 void ElementMatrix::AddToGlobal(Mat Jff){ 296 } 297 else{ 298 _error_(" non dofsymmetrical matrix AddToGlobal routine not support yet!"); 299 } 300 #else 301 _error_("not supported yet!"); 302 #endif 303 304 } 305 /*}}}*/ 306 /*FUNCTION ElementMatrix::AddToGlobal(Matrix* Jff){{{1*/ 307 void ElementMatrix::AddToGlobal(Matrix* Jff){ 304 308 305 309 int i,j; … … 312 316 this->CheckConsistency(); 313 317 314 if(this->dofsymmetrical){ 315 /*only use row dofs to add values into global matrices: */ 316 317 if(this->row_fsize){ 318 /*first, retrieve values that are in the f-set from the g-set values matrix: */ 319 localvalues=(double*)xmalloc(this->row_fsize*this->row_fsize*sizeof(double)); 320 for(i=0;i<this->row_fsize;i++){ 321 for(j=0;j<this->row_fsize;j++){ 322 *(localvalues+this->row_fsize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]); 318 #ifdef _HAVE_PETSC_ 319 if(this->dofsymmetrical){ 320 /*only use row dofs to add values into global matrices: */ 321 322 if(this->row_fsize){ 323 /*first, retrieve values that are in the f-set from the g-set values matrix: */ 324 localvalues=(double*)xmalloc(this->row_fsize*this->row_fsize*sizeof(double)); 325 for(i=0;i<this->row_fsize;i++){ 326 for(j=0;j<this->row_fsize;j++){ 327 *(localvalues+this->row_fsize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]); 328 } 323 329 } 330 /*add local values into global matrix, using the fglobaldoflist: */ 331 MatSetValues(Jff->matrix,this->row_fsize,this->row_fglobaldoflist,this->row_fsize,this->row_fglobaldoflist,(const double*)localvalues,ADD_VALUES); 332 333 /*Free ressources:*/ 334 xfree((void**)&localvalues); 324 335 } 325 /*add local values into global matrix, using the fglobaldoflist: */ 326 MatSetValues(Jff,this->row_fsize,this->row_fglobaldoflist,this->row_fsize,this->row_fglobaldoflist,(const double*)localvalues,ADD_VALUES); 327 328 /*Free ressources:*/ 329 xfree((void**)&localvalues); 330 } 331 332 } 333 else{ 334 _error_(" non dofsymmetrical matrix AddToGlobal routine not support yet!"); 335 } 336 337 } 338 else{ 339 _error_(" non dofsymmetrical matrix AddToGlobal routine not support yet!"); 340 } 341 #else 342 _error_("not supported yet!"); 343 #endif 336 344 337 345 } -
issm/branches/trunk-jpl-damage/src/c/objects/Numerics/ElementMatrix.h
r11322 r11684 58 58 /*}}}*/ 59 59 /*ElementMatrix specific routines {{{1*/ 60 void AddToGlobal(Mat Kff, MatKfs);61 void AddToGlobal(Mat Jff);60 void AddToGlobal(Matrix* Kff, Matrix* Kfs); 61 void AddToGlobal(Matrix* Jff); 62 62 void Echo(void); 63 63 void CheckConsistency(void); -
issm/branches/trunk-jpl-damage/src/c/objects/Numerics/ElementVector.cpp
r9320 r11684 160 160 161 161 /*ElementVector specific routines: */ 162 /*FUNCTION ElementVector::AddToGlobal(Vec pf){{{1*/163 void ElementVector::AddToGlobal(Vec pf){162 /*FUNCTION ElementVector::AddToGlobal(Vector* pf){{{1*/ 163 void ElementVector::AddToGlobal(Vector* pf){ 164 164 165 165 int i; 166 166 double* localvalues=NULL; 167 167 168 if(this->fsize){ 169 /*first, retrieve values that are in the f-set from the g-set values vector: */ 170 localvalues=(double*)xmalloc(this->fsize*sizeof(double)); 171 for(i=0;i<this->fsize;i++){ 172 localvalues[i]=this->values[this->flocaldoflist[i]]; 173 } 174 /*add local values into global vector, using the fglobaldoflist: */ 175 VecSetValues(pf,this->fsize,this->fglobaldoflist,(const double*)localvalues,ADD_VALUES); 176 177 /*Free ressources:*/ 178 xfree((void**)&localvalues); 179 } 180 } 181 /*}}}*/ 182 /*FUNCTION ElementVector::InsertIntoGlobal(Vec pf){{{1*/ 183 void ElementVector::InsertIntoGlobal(Vec pf){ 168 #ifdef _HAVE_PETSC_ 169 if(this->fsize){ 170 /*first, retrieve values that are in the f-set from the g-set values vector: */ 171 localvalues=(double*)xmalloc(this->fsize*sizeof(double)); 172 for(i=0;i<this->fsize;i++){ 173 localvalues[i]=this->values[this->flocaldoflist[i]]; 174 } 175 /*add local values into global vector, using the fglobaldoflist: */ 176 VecSetValues(pf->vector,this->fsize,this->fglobaldoflist,(const double*)localvalues,ADD_VALUES); 177 178 /*Free ressources:*/ 179 xfree((void**)&localvalues); 180 } 181 #else 182 _error_("not supported yet!"); 183 #endif 184 185 } 186 /*}}}*/ 187 /*FUNCTION ElementVector::InsertIntoGlobal(Vector* pf){{{1*/ 188 void ElementVector::InsertIntoGlobal(Vector* pf){ 184 189 185 190 int i; 186 191 double* localvalues=NULL; 187 192 188 if(this->fsize){ 189 /*first, retrieve values that are in the f-set from the g-set values vector: */ 190 localvalues=(double*)xmalloc(this->fsize*sizeof(double)); 191 for(i=0;i<this->fsize;i++){ 192 localvalues[i]=this->values[this->flocaldoflist[i]]; 193 } 194 /*add local values into global vector, using the fglobaldoflist: */ 195 VecSetValues(pf,this->fsize,this->fglobaldoflist,(const double*)localvalues,INSERT_VALUES); 196 197 /*Free ressources:*/ 198 xfree((void**)&localvalues); 199 } 193 #ifdef _HAVE_PETSC_ 194 if(this->fsize){ 195 /*first, retrieve values that are in the f-set from the g-set values vector: */ 196 localvalues=(double*)xmalloc(this->fsize*sizeof(double)); 197 for(i=0;i<this->fsize;i++){ 198 localvalues[i]=this->values[this->flocaldoflist[i]]; 199 } 200 /*add local values into global vector, using the fglobaldoflist: */ 201 VecSetValues(pf->vector,this->fsize,this->fglobaldoflist,(const double*)localvalues,INSERT_VALUES); 202 203 /*Free ressources:*/ 204 xfree((void**)&localvalues); 205 } 206 #else 207 _error_("not supported yet!"); 208 #endif 209 200 210 } 201 211 /*}}}*/ -
issm/branches/trunk-jpl-damage/src/c/objects/Numerics/ElementVector.h
r8800 r11684 40 40 /*}}}*/ 41 41 /*ElementVector specific routines {{{1*/ 42 void AddToGlobal(Vec pf);43 void InsertIntoGlobal(Vec pf);42 void AddToGlobal(Vector* pf); 43 void InsertIntoGlobal(Vector* pf); 44 44 void Echo(void); 45 45 void Init(ElementVector* pe); -
issm/branches/trunk-jpl-damage/src/c/objects/objects.h
r11295 r11684 120 120 #include "./Numerics/ElementMatrix.h" 121 121 #include "./Numerics/ElementVector.h" 122 #include "./Numerics/Vector.h" 123 #include "./Numerics/Matrix.h" 122 124 123 125 /*Params: */ -
issm/branches/trunk-jpl-damage/src/c/shared/Alloc/alloc.cpp
r9320 r11684 29 29 #include "../Exceptions/exceptions.h" 30 30 #include "../../include/include.h" 31 #include "../../objects/objects.h" 31 32 32 33 void* xmalloc(int size){ … … 80 81 } 81 82 83 void xdelete( Matrix** pv){ 84 85 if (pv && *pv) { 86 87 delete *pv; 88 *pv=NULL; 89 } 90 } 91 92 void xdelete( Vector** pv){ 93 94 if (pv && *pv) { 95 96 delete *pv; 97 *pv=NULL; 98 } 99 } 100 101 82 102 void* xrealloc ( void* pv, int size){ 83 103 -
issm/branches/trunk-jpl-damage/src/c/shared/Alloc/alloc.h
r5768 r11684 5 5 #ifndef _ALLOC_H_ 6 6 #define _ALLOC_H_ 7 7 class Matrix; 8 class Vector; 8 9 void* xmalloc(int size); 9 10 void* xcalloc(int n,int size); 10 11 void xfree(void** pvptr); 11 12 void* xrealloc ( void* pv, int size); 13 void xdelete(Matrix** pvptr); 14 void xdelete(Vector** pvptr); 12 15 13 16 #endif -
issm/branches/trunk-jpl-damage/src/c/shared/Elements/elements.h
r11197 r11684 17 17 int* GetLocalDofList( Node** nodes,int numnodes,int setenum,int approximation_enum); 18 18 int* GetGlobalDofList(Node** nodes,int numnodes,int setenum,int approximation_enum); 19 #ifdef _HAVE_DIAGNOSTIC_ 19 20 void CoordinateSystemTransform(double** ptransform,Node** nodes,int numnodes,int* cs_array); 20 #ifdef _HAVE_DIAGNOSTIC_21 21 void TransformInvStiffnessMatrixCoord(ElementMatrix* Ke,Node** nodes,int numnodes,int cs_enum); 22 22 void TransformInvStiffnessMatrixCoord(ElementMatrix* Ke,Node** nodes,int numnodes,int* cs_array); -
issm/branches/trunk-jpl-damage/src/c/solutions/AnalysisConfiguration.cpp
r11354 r11684 38 38 39 39 case SteadystateSolutionEnum: 40 numanalyses= 7;40 numanalyses=8; 41 41 analyses=(int*)xmalloc(numanalyses*sizeof(int)); 42 42 analyses[0]=DiagnosticHorizAnalysisEnum; … … 45 45 analyses[3]=SurfaceSlopeAnalysisEnum; 46 46 analyses[4]=BedSlopeAnalysisEnum; 47 analyses[5]=ThermalAnalysisEnum; 48 analyses[6]=MeltingAnalysisEnum; 47 analyses[5]=EnthalpyAnalysisEnum; 48 analyses[6]=ThermalAnalysisEnum; 49 analyses[7]=MeltingAnalysisEnum; 49 50 break; 50 51 -
issm/branches/trunk-jpl-damage/src/c/solutions/ResetBoundaryConditions.cpp
r9761 r11684 11 11 12 12 /*variables: */ 13 Vec yg = NULL;13 Vector* yg = NULL; 14 14 Nodes *nodes = NULL; 15 15 int i; … … 30 30 31 31 /*Free ressources:*/ 32 VecFree(&yg);32 delete yg; 33 33 } -
issm/branches/trunk-jpl-damage/src/c/solutions/convergence.cpp
r11285 r11684 8 8 #include "../EnumDefinitions/EnumDefinitions.h" 9 9 10 void convergence(bool* pconverged, Mat Kff,Vec pf,Vec uf,Vecold_uf,Parameters* parameters){10 void convergence(bool* pconverged, Matrix* Kff,Vector* pf,Vector* uf,Vector* old_uf,Parameters* parameters){ 11 11 12 12 /*output*/ … … 14 14 15 15 /*intermediary*/ 16 Vec KU=NULL;17 Vec KUF=NULL;18 Vec KUold=NULL;19 Vec KUoldF=NULL;20 Vec duf=NULL;16 Vector* KU=NULL; 17 Vector* KUF=NULL; 18 Vector* KUold=NULL; 19 Vector* KUoldF=NULL; 20 Vector* duf=NULL; 21 21 double ndu,nduinf,nu; 22 22 double nKUF; … … 48 48 49 49 //compute KUF = KU - F = K*U - F 50 VecDuplicate(uf,&KU); MatMultPatch(Kff,uf,KU);51 VecDuplicate(KU,&KUF);VecCopy(KU,KUF); VecAYPX(KUF,-1.0,pf);50 KU=uf->Duplicate(); Kff->MatMult(uf,KU); 51 KUF=KU->Duplicate(); KU->Copy(KUF); KUF->AYPX(pf,-1.0); 52 52 53 53 //compute norm(KUF), norm(F) and residue 54 VecNorm(KUF,NORM_2,&nKUF);55 VecNorm(pf,NORM_2,&nF);54 nKUF=KUF->Norm(NORM_2); 55 nF=pf->Norm(NORM_2); 56 56 solver_residue=nKUF/nF; 57 57 _printf_(true,"\n%s%g\n"," solver residue: norm(KU-F)/norm(F)=",solver_residue); 58 58 59 59 //clean up 60 VecFree(&KU);61 VecFree(&KUF);60 delete KU; 61 delete KUF; 62 62 } 63 63 … … 65 65 66 66 //compute K[n]U[n-1]F = K[n]U[n-1] - F 67 VecDuplicate(uf,&KUold); MatMultPatch(Kff,old_uf,KUold);68 VecDuplicate(KUold,&KUoldF);VecCopy(KUold,KUoldF); VecAYPX(KUoldF,-1.0,pf);69 VecNorm(KUoldF,NORM_2,&nKUoldF);70 VecNorm(pf,NORM_2,&nF);67 KUold=uf->Duplicate(); Kff->MatMult(old_uf,KUold); 68 KUoldF=KUold->Duplicate();KUold->Copy(KUoldF); KUoldF->AYPX(pf,-1.0); 69 nKUoldF=KUoldF->Norm(NORM_2); 70 nF=pf->Norm(NORM_2); 71 71 res=nKUoldF/nF; 72 72 if (isnan(res)){ … … 76 76 77 77 //clean up 78 VecFree(&KUold);79 VecFree(&KUoldF);78 delete KUold; 79 delete KUoldF; 80 80 81 81 //print … … 93 93 94 94 //compute norm(du)/norm(u) 95 VecDuplicate(old_uf,&duf);VecCopy(old_uf,duf); VecAYPX(duf,-1.0,uf);96 VecNorm(duf,NORM_2,&ndu); VecNorm(old_uf,NORM_2,&nu);95 duf=old_uf->Duplicate(); old_uf->Copy(duf); duf->AYPX(uf,-1.0); 96 ndu=duf->Norm(NORM_2); nu=old_uf->Norm(NORM_2); 97 97 98 98 if (isnan(ndu) || isnan(nu)) _error_("convergence criterion is NaN!"); 99 99 100 100 //clean up 101 VecFree(&duf);101 delete duf; 102 102 103 103 //print … … 119 119 120 120 //compute max(du) 121 VecDuplicate(old_uf,&duf);VecCopy(old_uf,duf); VecAYPX(duf,-1.0,uf);122 VecNorm(duf,NORM_2,&ndu); VecNorm(duf,NORM_INFINITY,&nduinf);121 duf=old_uf->Duplicate(); old_uf->Copy(duf); duf->AYPX(uf,-1.0); 122 ndu=duf->Norm(NORM_2); nduinf=duf->Norm(NORM_INFINITY); 123 123 if (isnan(ndu) || isnan(nu)) _error_("convergence criterion is NaN!"); 124 124 125 125 //clean up 126 VecFree(&duf);126 delete duf; 127 127 128 128 //print -
issm/branches/trunk-jpl-damage/src/c/solutions/solutions.h
r11306 r11684 35 35 36 36 //convergence: 37 void convergence(bool* pconverged, Mat K_ff,Vec p_f,Vec u_f,Vecu_f_old,Parameters* parameters);37 void convergence(bool* pconverged, Matrix* K_ff,Vector* p_f,Vector* u_f,Vector* u_f_old,Parameters* parameters); 38 38 bool controlconvergence(double J,double tol_cm); 39 39 bool steadystateconvergence(FemModel* femmodel); -
issm/branches/trunk-jpl-damage/src/c/solutions/steadystate_core.cpp
r9880 r11684 25 25 26 26 /*parameters: */ 27 int dim;28 int solution_type;29 int maxiter;30 bool control_analysis;27 bool control_analysis,isenthalpy; 28 int dim; 29 int solution_type; 30 int maxiter; 31 31 int numoutputs = 0; 32 32 int *requested_outputs = NULL; … … 38 38 femmodel->parameters->FindParam(&maxiter,SteadystateMaxiterEnum); 39 39 femmodel->parameters->FindParam(&numoutputs,SteadystateNumRequestedOutputsEnum); 40 femmodel->parameters->FindParam(&isenthalpy,ThermalIsenthalpyEnum); 40 41 if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,SteadystateRequestedOutputsEnum); 41 42 … … 47 48 _printf_(VerboseSolution(),"%s%i\n"," computing temperature and velocity for step: ",step); 48 49 #ifdef _HAVE_THERMAL_ 49 thermal_core(femmodel); 50 if(isenthalpy==0){ 51 thermal_core(femmodel); 52 } 53 else{ 54 enthalpy_core(femmodel); 55 } 50 56 #else 51 57 _error_("ISSM was not compiled with thermal capabilities. Exiting"); … … 83 89 InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum); 84 90 InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,TemperatureEnum); 85 InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,BasalforcingsMeltingRateEnum); 91 if(isenthalpy) InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,WaterfractionEnum); 92 if(isenthalpy) InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,EnthalpyEnum); 93 if(!isenthalpy) InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,BasalforcingsMeltingRateEnum); 86 94 RequestedOutputsx(femmodel->results,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,requested_outputs,numoutputs); 87 95 } -
issm/branches/trunk-jpl-damage/src/c/solvers/solver_adjoint_linear.cpp
r9271 r11684 13 13 14 14 /*intermediary: */ 15 Mat Kff = NULL, Kfs = NULL; 16 Vec ug = NULL, uf = NULL; 17 Vec pf = NULL; 18 Vec df = NULL; 19 Vec ys = NULL; 15 Matrix* Kff = NULL; 16 Matrix* Kfs = NULL; 17 Vector* ug = NULL; 18 Vector* uf = NULL; 19 Vector* pf = NULL; 20 Vector* df = NULL; 21 Vector* ys = NULL; 20 22 int configuration_type; 21 23 … … 26 28 SystemMatricesx(&Kff, &Kfs, &pf, &df, NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters); 27 29 CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type); 28 Reduceloadx(pf, Kfs, ys,true); MatFree(&Kfs); //true means spc = 029 Solverx(&uf, Kff, pf, NULL, df, femmodel->parameters); MatFree(&Kff); VecFree(&pf); VecFree(&df);30 Mergesolutionfromftogx(&ug, uf,ys,femmodel->nodes,femmodel->parameters,true); VecFree(&uf);VecFree(&ys); //true means spc030 Reduceloadx(pf, Kfs, ys,true); xdelete(&Kfs); //true means spc = 0 31 Solverx(&uf, Kff, pf, NULL, df, femmodel->parameters); xdelete(&Kff); xdelete(&pf); xdelete(&df); 32 Mergesolutionfromftogx(&ug, uf,ys,femmodel->nodes,femmodel->parameters,true); xdelete(&uf);xdelete(&ys); //true means spc0 31 33 InputUpdateFromSolutionx(femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,ug); 32 VecFree(&ug); VecFree(&uf);34 xdelete(&ug); xdelete(&uf); 33 35 } -
issm/branches/trunk-jpl-damage/src/c/solvers/solver_linear.cpp
r9225 r11684 11 11 12 12 /*intermediary: */ 13 Mat Kff = NULL, Kfs = NULL; 14 Vec ug = NULL; 15 Vec uf = NULL; 16 Vec pf = NULL; 17 Vec df = NULL; 18 Vec ys = NULL; 13 Matrix* Kff = NULL; 14 Matrix* Kfs = NULL; 15 Vector* ug = NULL; 16 Vector* uf = NULL; 17 Vector* pf = NULL; 18 Vector* df = NULL; 19 Vector* ys = NULL; 19 20 int configuration_type; 20 21 … … 25 26 SystemMatricesx(&Kff, &Kfs, &pf, &df, NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters); 26 27 CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type); 27 Reduceloadx(pf, Kfs, ys); MatFree(&Kfs); 28 Solverx(&uf, Kff, pf, NULL, df, femmodel->parameters); MatFree(&Kff); VecFree(&pf); VecFree(&df); 29 Mergesolutionfromftogx(&ug, uf,ys,femmodel->nodes,femmodel->parameters);VecFree(&uf);VecFree(&ys); 28 Reduceloadx(pf, Kfs, ys); xdelete(&Kfs); 29 Solverx(&uf, Kff, pf, NULL, df, femmodel->parameters); 30 xdelete(&Kff); xdelete(&pf); xdelete(&df); 31 Mergesolutionfromftogx(&ug, uf,ys,femmodel->nodes,femmodel->parameters);xdelete(&uf); xdelete(&ys); 30 32 InputUpdateFromSolutionx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,ug); 31 VecFree(&ug); VecFree(&uf);33 xdelete(&ug); xdelete(&uf); 32 34 } -
issm/branches/trunk-jpl-damage/src/c/solvers/solver_newton.cpp
r11338 r11684 18 18 int count; 19 19 double kmax; 20 Mat Kff = NULL, Kfs = NULL, Jff = NULL; 21 Vec ug = NULL, old_ug = NULL; 22 Vec uf = NULL, old_uf = NULL, duf = NULL; 23 Vec pf = NULL, pJf = NULL; 24 Vec df = NULL; 25 Vec ys = NULL; 20 Matrix* Kff = NULL; 21 Matrix* Kfs = NULL; 22 Matrix* Jff = NULL; 23 Vector* ug = NULL; 24 Vector* old_ug = NULL; 25 Vector* uf = NULL; 26 Vector* old_uf = NULL; 27 Vector* duf = NULL; 28 Vector* pf = NULL; 29 Vector* pJf = NULL; 30 Vector* df = NULL; 31 Vector* ys = NULL; 26 32 27 33 /*parameters:*/ … … 47 53 for(;;){ 48 54 49 VecFree(&old_ug);old_ug=ug;50 VecFree(&old_uf);old_uf=uf;55 xdelete(&old_ug);old_ug=ug; 56 xdelete(&old_uf);old_uf=uf; 51 57 52 58 /*Solver forward model*/ 53 59 SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters); 54 60 CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type); 55 Reduceloadx(pf,Kfs,ys); MatFree(&Kfs);56 Solverx(&uf,Kff,pf,old_uf,df,femmodel->parameters); VecFree(&df);57 Mergesolutionfromftogx(&ug,uf,ys,femmodel->nodes,femmodel->parameters); VecFree(&ys);58 InputUpdateFromSolutionx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,ug); VecFree(&ug);61 Reduceloadx(pf,Kfs,ys);xdelete(&Kfs); 62 Solverx(&uf,Kff,pf,old_uf,df,femmodel->parameters);xdelete(&df); 63 Mergesolutionfromftogx(&ug,uf,ys,femmodel->nodes,femmodel->parameters);xdelete(&ys); 64 InputUpdateFromSolutionx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,ug);xdelete(&ug); 59 65 60 66 /*Check convergence*/ 61 67 convergence(&converged,Kff,pf,uf,old_uf,femmodel->parameters); 62 MatFree(&Kff);VecFree(&pf);68 xdelete(&Kff); xdelete(&pf); 63 69 if(converged==true) break; 64 70 if(count>=max_nonlinear_iterations){ … … 70 76 SystemMatricesx(&Kff,&Kfs,&pf,NULL,&kmax,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters); 71 77 CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type); 72 Reduceloadx(pf,Kfs,ys); MatFree(&Kfs);78 Reduceloadx(pf,Kfs,ys); xdelete(&Kfs); 73 79 74 VecDuplicate(pf,&pJf); 75 MatMultPatch(Kff,uf,pJf); MatFree(&Kff); 76 VecScale(pJf,-1.); 77 VecAXPY(pJf,+1.,pf); VecFree(&pf); 80 pJf=pf->Duplicate(); Kff->MatMult(uf,pJf); xdelete(&Kff); 81 pJf->Scale(-1.0); pJf->AXPY(pf,+1.0); xdelete(&pf); 78 82 79 83 CreateJacobianMatrixx(&Jff,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,kmax); 80 Solverx(&duf,Jff,pJf,NULL,NULL,femmodel->parameters); MatFree(&Jff);VecFree(&pJf);81 VecAXPY(uf,1.,duf); VecFree(&duf);82 Mergesolutionfromftogx(&ug,uf,ys,femmodel->nodes,femmodel->parameters); VecFree(&ys);84 Solverx(&duf,Jff,pJf,NULL,NULL,femmodel->parameters); xdelete(&Jff); xdelete(&pJf); 85 uf->AXPY(duf, 1.0); xdelete(&duf); 86 Mergesolutionfromftogx(&ug,uf,ys,femmodel->nodes,femmodel->parameters);xdelete(&ys); 83 87 InputUpdateFromSolutionx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,ug); 84 88 … … 89 93 90 94 /*clean-up*/ 91 VecFree(&uf);92 VecFree(&ug);93 VecFree(&old_ug);94 VecFree(&old_uf);95 xdelete(&uf); 96 xdelete(&ug); 97 xdelete(&old_ug); 98 xdelete(&old_uf); 95 99 } -
issm/branches/trunk-jpl-damage/src/c/solvers/solver_nonlinear.cpp
r11347 r11684 14 14 15 15 /*intermediary: */ 16 Mat Kff = NULL, Kfs = NULL; 17 Vec ug = NULL, old_ug = NULL; 18 Vec uf = NULL, old_uf = NULL; 19 Vec pf = NULL; 20 Vec df = NULL; 21 Vec ys = NULL; 16 Matrix* Kff = NULL; 17 Matrix* Kfs = NULL; 18 Vector* ug = NULL; 19 Vector* old_ug = NULL; 20 Vector* uf = NULL; 21 Vector* old_uf = NULL; 22 Vector* pf = NULL; 23 Vector* df = NULL; 24 Vector* ys = NULL; 22 25 23 26 Loads* loads=NULL; … … 56 59 57 60 //save pointer to old velocity 58 VecFree(&old_ug);old_ug=ug;59 VecFree(&old_uf);old_uf=uf;61 xdelete(&old_ug);old_ug=ug; 62 xdelete(&old_uf);old_uf=uf; 60 63 61 64 SystemMatricesx(&Kff, &Kfs, &pf, &df, NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,loads,femmodel->materials,femmodel->parameters); 62 65 CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type); 63 Reduceloadx(pf, Kfs, ys); MatFree(&Kfs);66 Reduceloadx(pf, Kfs, ys); xdelete(&Kfs); 64 67 Solverx(&uf, Kff, pf, old_uf, df, femmodel->parameters); 65 Mergesolutionfromftogx(&ug, uf,ys,femmodel->nodes,femmodel->parameters); VecFree(&ys);68 Mergesolutionfromftogx(&ug, uf,ys,femmodel->nodes,femmodel->parameters);xdelete(&ys); 66 69 67 convergence(&converged,Kff,pf,uf,old_uf,femmodel->parameters); MatFree(&Kff);VecFree(&pf); VecFree(&df);70 convergence(&converged,Kff,pf,uf,old_uf,femmodel->parameters); xdelete(&Kff); xdelete(&pf); xdelete(&df); 68 71 InputUpdateFromConstantx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,converged,ConvergedEnum); 69 72 InputUpdateFromSolutionx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,ug); … … 96 99 /*clean-up*/ 97 100 if(conserve_loads) delete loads; 98 VecFree(&uf);99 VecFree(&ug);100 VecFree(&old_ug);101 VecFree(&old_uf);101 xdelete(&uf); 102 xdelete(&ug); 103 xdelete(&old_ug); 104 xdelete(&old_uf); 102 105 } -
issm/branches/trunk-jpl-damage/src/c/solvers/solver_stokescoupling_nonlinear.cpp
r11284 r11684 14 14 15 15 /*intermediary: */ 16 Mat Kff_horiz = NULL, Kfs_horiz = NULL; 17 Vec ug_horiz = NULL, uf_horiz = NULL, old_uf_horiz = NULL; 18 Vec pf_horiz = NULL; 19 Vec df_horiz = NULL; 20 Mat Kff_vert = NULL, Kfs_vert = NULL; 21 Vec ug_vert = NULL, uf_vert = NULL; 22 Vec pf_vert = NULL; 23 Vec df_vert = NULL; 24 Vec ys = NULL; 16 Matrix* Kff_horiz = NULL; 17 Matrix* Kfs_horiz = NULL; 18 Vector* ug_horiz = NULL; 19 Vector* uf_horiz = NULL; 20 Vector* old_uf_horiz = NULL; 21 Vector* pf_horiz = NULL; 22 Vector* df_horiz = NULL; 23 Matrix* Kff_vert = NULL; 24 Matrix* Kfs_vert = NULL; 25 Vector* ug_vert = NULL; 26 Vector* uf_vert = NULL; 27 Vector* pf_vert = NULL; 28 Vector* df_vert = NULL; 29 Vector* ys = NULL; 25 30 bool converged; 26 31 int constraints_converged; … … 54 59 //Update once again the solution to make sure that vx and vxold are similar (for next step in transient or steadystate) 55 60 InputUpdateFromSolutionx(femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,ug_horiz); 56 VecFree(&ug_horiz);61 xdelete(&ug_horiz); 57 62 58 63 //save pointer to old velocity 59 VecFree(&old_uf_horiz);old_uf_horiz=uf_horiz;64 xdelete(&old_uf_horiz); old_uf_horiz=uf_horiz; 60 65 61 66 /*solve: */ 62 67 SystemMatricesx(&Kff_horiz, &Kfs_horiz, &pf_horiz, &df_horiz, NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters); 63 68 CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type); 64 Reduceloadx(pf_horiz, Kfs_horiz, ys); MatFree(&Kfs_horiz);69 Reduceloadx(pf_horiz, Kfs_horiz, ys); xdelete(&Kfs_horiz); 65 70 Solverx(&uf_horiz, Kff_horiz, pf_horiz, old_uf_horiz, df_horiz,femmodel->parameters); 66 Mergesolutionfromftogx(&ug_horiz, uf_horiz,ys,femmodel->nodes,femmodel->parameters); VecFree(&ys);71 Mergesolutionfromftogx(&ug_horiz, uf_horiz,ys,femmodel->nodes,femmodel->parameters); xdelete(&ys); 67 72 InputUpdateFromSolutionx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,ug_horiz); 68 73 69 convergence(&converged,Kff_horiz,pf_horiz,uf_horiz,old_uf_horiz,femmodel->parameters); MatFree(&Kff_horiz);VecFree(&pf_horiz); VecFree(&df_horiz);74 convergence(&converged,Kff_horiz,pf_horiz,uf_horiz,old_uf_horiz,femmodel->parameters); xdelete(&Kff_horiz); xdelete(&pf_horiz); xdelete(&df_horiz); 70 75 71 76 /*Second compute vertical velocity: */ … … 76 81 SystemMatricesx(&Kff_vert, &Kfs_vert, &pf_vert, &df_vert,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters); 77 82 CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type); 78 Reduceloadx(pf_vert, Kfs_vert, ys); MatFree(&Kfs_vert);79 Solverx(&uf_vert, Kff_vert, pf_vert, NULL, df_vert,femmodel->parameters); MatFree(&Kff_vert); VecFree(&pf_vert); VecFree(&df_vert);80 Mergesolutionfromftogx(&ug_vert, uf_vert,ys,femmodel->nodes,femmodel->parameters); VecFree(&uf_vert); VecFree(&ys);83 Reduceloadx(pf_vert, Kfs_vert, ys); xdelete(&Kfs_vert); 84 Solverx(&uf_vert, Kff_vert, pf_vert, NULL, df_vert,femmodel->parameters); xdelete(&Kff_vert); xdelete(&pf_vert); xdelete(&df_vert); 85 Mergesolutionfromftogx(&ug_vert, uf_vert,ys,femmodel->nodes,femmodel->parameters);xdelete(&uf_vert); xdelete(&ys); 81 86 InputUpdateFromSolutionx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,ug_vert); 82 VecFree(&ug_vert); VecFree(&uf_vert);87 xdelete(&ug_vert); xdelete(&uf_vert); 83 88 84 89 /*Increase count: */ … … 92 97 93 98 /*clean-up*/ 94 VecFree(&old_uf_horiz);95 VecFree(&uf_horiz);96 VecFree(&ug_horiz);97 VecFree(&ys);99 xdelete(&old_uf_horiz); 100 xdelete(&uf_horiz); 101 xdelete(&ug_horiz); 102 xdelete(&ys); 98 103 } -
issm/branches/trunk-jpl-damage/src/c/solvers/solver_thermal_nonlinear.cpp
r11197 r11684 12 12 13 13 /*solution : */ 14 Vec tg=NULL;15 Vec tf=NULL;16 Vec tf_old=NULL;17 Vec ys=NULL;14 Vector* tg=NULL; 15 Vector* tf=NULL; 16 Vector* tf_old=NULL; 17 Vector* ys=NULL; 18 18 double melting_offset; 19 19 20 20 /*intermediary: */ 21 Mat Kff=NULL;22 Mat Kfs=NULL;23 Vec pf=NULL;24 Vec df=NULL;21 Matrix* Kff=NULL; 22 Matrix* Kfs=NULL; 23 Vector* pf=NULL; 24 Vector* df=NULL; 25 25 26 26 bool converged; … … 56 56 SystemMatricesx(&Kff, &Kfs, &pf,&df, &melting_offset,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters); 57 57 CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type); 58 Reduceloadx(pf, Kfs, ys); MatFree(&Kfs); VecFree(&tf);58 Reduceloadx(pf, Kfs, ys); xdelete(&Kfs); xdelete(&tf); 59 59 Solverx(&tf, Kff, pf,tf_old, df, femmodel->parameters); 60 VecFree(&tf_old); VecDuplicatePatch(&tf_old,tf);61 MatFree(&Kff);VecFree(&pf);VecFree(&tg); VecFree(&df);62 Mergesolutionfromftogx(&tg, tf,ys,femmodel->nodes,femmodel->parameters); VecFree(&ys);60 xdelete(&tf_old); tf_old=tf->Duplicate(); 61 xdelete(&Kff);xdelete(&pf);xdelete(&tg); xdelete(&df); 62 Mergesolutionfromftogx(&tg, tf,ys,femmodel->nodes,femmodel->parameters); xdelete(&ys); 63 63 InputUpdateFromSolutionx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,tg); 64 64 … … 84 84 85 85 /*Free ressources: */ 86 VecFree(&tg);87 VecFree(&tf);88 VecFree(&tf_old);89 VecFree(&ys);86 xdelete(&tg); 87 xdelete(&tf); 88 xdelete(&tf_old); 89 xdelete(&ys); 90 90 } -
issm/branches/trunk-jpl-damage/src/c/toolkits/matlab/matlabincludes.h
r8901 r11684 8 8 #ifdef _SERIAL_ 9 9 #include <mex.h> 10 class Matrix; 11 class Vector; 12 10 13 int MatlabNArrayToNArray(double** pmatrix,int* pmatrix_numel,int* pmatrix_ndims,int** pmatrix_size,const mxArray* mxmatrix); 11 14 int MatlabNArrayToNArray(bool** pmatrix,int* pmatrix_numel,int* pmatrix_ndims,int** pmatrix_size,const mxArray* mxmatrix); 12 15 int MatlabNArrayToNArray(char** pmatrix,int* pmatrix_numel,int* pmatrix_ndims,int** pmatrix_size,const mxArray* mxmatrix); 16 Matrix* MatlabMatrixToMatrix(const mxArray* mxmatrix); 17 Vector* MatlabVectorToVector(const mxArray* mxvector); 13 18 #endif 14 19 -
issm/branches/trunk-jpl-damage/src/c/toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp
r9320 r11684 25 25 int MatlabMatrixToDoubleMatrix(double** pmatrix,int* pmatrix_rows,int* pmatrix_cols,const mxArray* mxmatrix){ 26 26 27 int rows, cols; 28 double* mxmatrix_ptr=NULL; 29 int ierr; 30 int i,j; 27 int i,j,count,rows,cols; 28 double *pmxdoublematrix = NULL; 29 float *pmxsinglematrix = NULL; 31 30 32 31 /*output: */ … … 36 35 mwIndex* ir=NULL; 37 36 mwIndex* jc=NULL; 38 double* pr=NULL;39 int count;40 int nnz;41 int nz;42 37 43 38 /*Ok, first check if we are dealing with a sparse or full matrix: */ … … 45 40 46 41 /*Dealing with sparse matrix: recover size first: */ 47 mxmatrix_ptr=(double*)mxGetPr(mxmatrix);42 pmxdoublematrix=(double*)mxGetPr(mxmatrix); 48 43 rows=mxGetM(mxmatrix); 49 44 cols=mxGetN(mxmatrix); 50 nnz=mxGetNzmax(mxmatrix);51 nz=(int)((double)nnz/(double)rows);52 53 45 matrix=(double*)xcalloc(rows*cols,sizeof(double)); 54 46 55 47 /*Now, get ir,jc and pr: */ 56 pr=mxGetPr(mxmatrix);57 48 ir=mxGetIr(mxmatrix); 58 49 jc=mxGetJc(mxmatrix); … … 62 53 for(i=0;i<cols;i++){ 63 54 for(j=0;j<(jc[i+1]-jc[i]);j++){ 64 *(matrix+rows*ir[count]+i)=pr[count];55 matrix[rows*ir[count]+i]=pmxdoublematrix[count]; 65 56 count++; 66 57 } … … 68 59 69 60 } 70 else{ 71 72 61 else if(mxIsClass(mxmatrix,"double")){ 73 62 /*Dealing with dense matrix: recover pointer and size: */ 74 mxmatrix_ptr=(double*)mxGetPr(mxmatrix);63 pmxdoublematrix=(double*)mxGetPr(mxmatrix); 75 64 rows=mxGetM(mxmatrix); 76 65 cols=mxGetN(mxmatrix); 77 78 66 79 67 /*Create serial matrix: */ … … 82 70 for(i=0;i<rows;i++){ 83 71 for(j=0;j<cols;j++){ 84 *(matrix+cols*i+j)=*(mxmatrix_ptr+rows*j+i);72 matrix[cols*i+j]=(double)pmxdoublematrix[rows*j+i]; 85 73 } 86 74 } 87 75 } 76 else if(mxIsClass(mxmatrix,"single")){ 77 /*Dealing with dense matrix: recover pointer and size: */ 78 pmxsinglematrix=(float*)mxGetPr(mxmatrix); 79 rows=mxGetM(mxmatrix); 80 cols=mxGetN(mxmatrix); 81 82 /*Create serial matrix: */ 83 matrix=(double*)xcalloc(rows*cols,sizeof(double)); 84 85 for(i=0;i<rows;i++){ 86 for(j=0;j<cols;j++){ 87 matrix[cols*i+j]=(double)pmxsinglematrix[rows*j+i]; 88 } 89 } 90 } 91 else{ 92 _error_("Matlab matrix type Not implemented yet"); 88 93 } 89 94 -
issm/branches/trunk-jpl-damage/src/m/classes/friction.m
r11135 r11684 39 39 end % }}} 40 40 function disp(obj) % {{{ 41 disp(sprintf('Sigma= drag^2 * Neff ^r * u ^s, with Neff=rho_ice*g*thickness+rho_ ice*g*bed, r=q/p and s=1/p'));41 disp(sprintf('Sigma= drag^2 * Neff ^r * u ^s, with Neff=rho_ice*g*thickness+rho_water*g*bed, r=q/p and s=1/p')); 42 42 fielddisplay(obj,'coefficient','friction coefficient [SI]'); 43 43 fielddisplay(obj,'p','p exponent'); -
issm/branches/trunk-jpl-damage/src/m/classes/inversion.m
r11577 r11684 92 92 checkfield(md,'inversion.iscontrol','values',[0 1]); 93 93 checkfield(md,'inversion.control_parameters','cell',1,'values',{'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'MaterialsRheologyZbar' 'Vx' 'Vy'}); 94 checkfield(md,'inversion.tao','values',[0 1]); 95 checkfield(md,'inversion.incomplete_adjoint','values',[0 1]); 96 checkfield(md,'inversion.control_parameters','cell',1,'values',{'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'Vx' 'Vy'}); 94 97 checkfield(md,'inversion.nsteps','numel',1,'>=',1); 95 98 checkfield(md,'inversion.maxiter_per_step','size',[md.inversion.nsteps 1],'>=',0); -
issm/branches/trunk-jpl-damage/src/m/classes/model/model.m
r11577 r11684 158 158 if isfield(structmd,'drag_p'), md.friction.p=structmd.drag_p; end 159 159 if isfield(structmd,'drag_q'), md.friction.q=structmd.drag_q; end 160 if isfield(structmd,'riftproperties'), 161 md.rifts=rifts ;160 if isfield(structmd,'riftproperties'), %old implementation 161 md.rifts=rifts(); 162 162 md.rifts.riftproperties=structmd.riftproperties; 163 md.rifts.riftstruct=structmd.rifts; 164 md.rifts.riftproperties=structmd.riftinfo; 163 165 end 164 166 if isfield(structmd,'bamg'), md.private.bamg=structmd.bamg; end … … 273 275 if isfield(structmd,'z'), md.mesh.z=structmd.z; end 274 276 if isfield(structmd,'mask'), md.flaim.criterion=structmd.mask; end 275 277 if isfield(structmd,'pressureload'), md.diagnostic.icefront=structmd.pressureload; end 276 278 if isfield(structmd,'diagnostic_ref'), md.diagnostic.referential=structmd.diagnostic_ref; end 279 277 280 278 281 %Field changes … … 359 362 pos=find(structmd.cm_responses==382); md.inversion.cost_functions(pos)=503; 360 363 end 364 361 365 if isfield(structmd,'artificial_diffusivity') & structmd.artificial_diffusivity==2, 362 366 md.thermal.stabilization=2; -
issm/branches/trunk-jpl-damage/src/m/enum/EnumToModelField.m
r11683 r11684 1 function string=EnumToModelField(enum)2 %ENUMTOMODELFIELD - output string of model field associated to enum3 %4 % WARNING: DO NOT MODIFY THIS FILE5 % this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh6 % Please read src/c/EnumDefinitions/README for more information7 %8 % Usage:9 % string=EnumToModelField(enum)10 11 switch enum,12 13 case ThicknessEnum(), string='thickness'; return14 case FrictionCoefficientEnum(), string='drag_coefficient'; return15 case MaterialsRheologyBEnum(), string='rheology_B'; return16 case MaterialsRheologyBbarEnum(), string='rheology_B'; return17 case MaterialsRheologyZEnum(), string='rheology_Z'; return18 case MaterialsRheologyZbarEnum(), string='rheology_Z'; return19 case BalancethicknessThickeningRateEnum: string='dhdt'; return20 case VxEnum(), string='vx'; return21 case InversionVxObsEnum(), string='vx_obs'; return22 case VyEnum(), string='vy'; return23 case InversionVyObsEnum(), string='vy_obs'; return24 case BasalforcingsMeltingRateEnum(), string='basal_melting_rate'; return25 case SurfaceforcingsMassBalanceEnum(), string='surface_mass_balance'; return26 otherwise, error(['Enum ' num2str(enum) ' not found associated to any model field']);27 28 end -
issm/branches/trunk-jpl-damage/src/m/model/SectionValues.m
r9734 r11684 82 82 83 83 %Interpolation of data on specified points 84 data_interp=InterpFromMeshToMesh2d(md.mesh.elements,md.mesh.x,md.mesh.y,data,X,Y); 84 data_interp=InterpFromMesh2d(md.mesh.elements,md.mesh.x,md.mesh.y,data,X,Y); 85 %data_interp=InterpFromMeshToMesh2d(md.mesh.elements,md.mesh.x,md.mesh.y,data,X,Y); 85 86 %data_interp=griddata(md.mesh.x,md.mesh.y,data,X,Y); 86 87 -
issm/branches/trunk-jpl-damage/src/m/model/collapse.m
r11462 r11684 93 93 md.geometry.bed=project2d(md,md.geometry.bed,1); 94 94 md.mesh.vertexonboundary=project2d(md,md.mesh.vertexonboundary,1); 95 md.mesh.elementconnectivity=project2d(md,md.mesh.elementconnectivity,1); 95 96 md.mask.elementonfloatingice=project2d(md,md.mask.elementonfloatingice,1); 96 97 md.mask.vertexonfloatingice=project2d(md,md.mask.vertexonfloatingice,1); … … 111 112 md.mesh.lowervertex=NaN; 112 113 md.mesh.uppervertex=NaN; 114 md.mesh.lowerelements=NaN; 115 md.mesh.upperelements=NaN; 113 116 114 117 %Remove old mesh -
issm/branches/trunk-jpl-damage/src/m/model/mesh/bamg.m
r11016 r11684 4 4 % Available options (for more details see ISSM website http://issm.jpl.nasa.gov/): 5 5 % 6 % - domain :followed by an ARGUS file that prescribes the domain outline7 % - hmin :minimum edge length (default is 10^-100)8 % - hmax : maximum esge length (default is 10^100)9 % - hVertices :imposed edge length for each vertex (geometry or mesh)10 % - hminVertices :minimum edge length for each vertex (mesh)11 % - hmaxVertices :maximum edge length for each vertex (mesh)12 % 13 % - anisomax : maximum rationbetween the smallest and largest edges (default is 10^30)14 % - coeff :coefficient applied to the metric (2-> twice as many elements, default is 1)15 % - cutoff :scalar used to compute the metric when metric type 2 or 3 are applied16 % - err :error used to generate the metric from a field17 % - errg : geometricalerror (default is 0.1)18 % - field :field of the model that will be used to compute the metric19 % to apply several fields, use one column per field20 % - gradation : maximum rationbetween two adjacent edges21 % - Hessiantype : 0 -> use double P2 projection (default)22 % 1 -> use Green formula23 % - KeepVertices :try to keep initial vertices when adaptation is done on an existing mesh (default 1)24 % - MaxCornerAngle : maximalangle of corners in degree (default is 10)25 % - maxnbv :maximum number of vertices used to allocate memory (default is 10^6)26 % - maxsubdiv :maximum subdivision of exisiting elements (default is 10)27 % - metric :matrix (numberofnodes x 3) used as a metric28 % - Metrictype :1 -> absolute error c/(err coeff^2) * Abs(H) (default)29 % 2 -> relative error c/(err coeff^2) * Abs(H)/max(s,cutoff*max(s))30 % 3 -> rescaled absolute error c/(err coeff^2) * Abs(H)/(smax-smin)31 % - nbjacoby :correction used by Hessiantype=1 (default is 1)32 % - nbsmooth :number of metric smoothing procedure (default is 3)33 % - omega :relaxation parameter of the smoothing procedure (default is 1.8)34 % - power :power applied to the metric (default is 1)35 % - splitcorners : split triangles whuch have 3 vertices on the outline (default is 1)36 % - geometricalmetric : Take the geometry into account to generate the metric (default is 0)37 % - verbose :level of verbosity (default is 1)38 % 39 % - rifts : followed by an ARGUS file that prescribes the rifts40 % - toltip :tolerance to move tip on an existing point of the domain outline41 % - tracks :followed by an ARGUS file that prescribes the tracks that the mesh will stick to42 % - RequiredVertices :mesh vertices that are required. [x,y,ref]; ref is optional43 % - tol :if the distance between 2 points of the domain outline is less than tol, they44 % will be merged6 % - domain : followed by an ARGUS file that prescribes the domain outline 7 % - hmin : minimum edge length (default is 10^-100) 8 % - hmax : maximum edge length (default is 10^100) 9 % - hVertices : imposed edge length for each vertex (geometry or mesh) 10 % - hminVertices : minimum edge length for each vertex (mesh) 11 % - hmaxVertices : maximum edge length for each vertex (mesh) 12 % 13 % - anisomax : maximum ratio between the smallest and largest edges (default is 10^30) 14 % - coeff : coefficient applied to the metric (2-> twice as many elements, default is 1) 15 % - cutoff : scalar used to compute the metric when metric type 2 or 3 are applied 16 % - err : error used to generate the metric from a field 17 % - errg : geometric error (default is 0.1) 18 % - field : field of the model that will be used to compute the metric 19 % to apply several fields, use one column per field 20 % - gradation : maximum ratio between two adjacent edges 21 % - Hessiantype : 0 -> use double P2 projection (default) 22 % 1 -> use Green formula 23 % - KeepVertices : try to keep initial vertices when adaptation is done on an existing mesh (default 1) 24 % - MaxCornerAngle : maximum angle of corners in degree (default is 10) 25 % - maxnbv : maximum number of vertices used to allocate memory (default is 10^6) 26 % - maxsubdiv : maximum subdivision of exisiting elements (default is 10) 27 % - metric : matrix (numberofnodes x 3) used as a metric 28 % - Metrictype : 1 -> absolute error c/(err coeff^2) * Abs(H) (default) 29 % 2 -> relative error c/(err coeff^2) * Abs(H)/max(s,cutoff*max(s)) 30 % 3 -> rescaled absolute error c/(err coeff^2) * Abs(H)/(smax-smin) 31 % - nbjacoby : correction used by Hessiantype=1 (default is 1) 32 % - nbsmooth : number of metric smoothing procedure (default is 3) 33 % - omega : relaxation parameter of the smoothing procedure (default is 1.8) 34 % - power : power applied to the metric (default is 1) 35 % - splitcorners : split triangles whuch have 3 vertices on the outline (default is 1) 36 % - geometricalmetric : take the geometry into account to generate the metric (default is 0) 37 % - verbose : level of verbosity (default is 1) 38 % 39 % - rifts : followed by an ARGUS file that prescribes the rifts 40 % - toltip : tolerance to move tip on an existing point of the domain outline 41 % - tracks : followed by an ARGUS file that prescribes the tracks that the mesh will stick to 42 % - RequiredVertices : mesh vertices that are required. [x,y,ref]; ref is optional 43 % - tol : if the distance between 2 points of the domain outline is less than tol, they 44 % will be merged 45 45 % 46 46 % Examples: -
issm/branches/trunk-jpl-damage/src/m/qmu/dakota_in_data.m
r5215 r11684 80 80 if strcmpi(params.analysis_driver,'matlab') && ... 81 81 isempty(params.analysis_components) 82 [pathstr,name,ext ,versn] = fileparts(filei);83 params.analysis_components=fullfile(pathstr,[name '.m' versn]);82 [pathstr,name,ext] = fileparts(filei); 83 params.analysis_components=fullfile(pathstr,[name '.m']); 84 84 end 85 85 -
issm/branches/trunk-jpl-damage/src/m/qmu/dakota_in_write.m
r5486 r11684 63 63 filei=input('Dakota input file to write? ','s'); 64 64 end 65 [pathstr,name,ext ,versn] = fileparts(filei);65 [pathstr,name,ext] = fileparts(filei); 66 66 if isempty(ext) 67 67 % fileparts only considers '.in' to be the extension, not '.qmu.in' 68 68 ext='.qmu.in'; 69 69 end 70 filei2=fullfile(pathstr,[name ext versn]);70 filei2=fullfile(pathstr,[name ext]); 71 71 72 72 display(sprintf('Opening Dakota input file ''%s''.',filei2)); … … 234 234 param_write(fidi,'\t ','evaluation_static_scheduling','','\n',params); 235 235 if ~isempty(params.analysis_components) 236 [pathstr,name,ext ,versn] = fileparts(params.analysis_components);236 [pathstr,name,ext] = fileparts(params.analysis_components); 237 237 if isempty(ext) 238 238 ext='.m'; 239 239 end 240 params.analysis_components=fullfile(pathstr,[name ext versn]);240 params.analysis_components=fullfile(pathstr,[name ext]); 241 241 param_write(fidi,'\t ','analysis_components',' = ''','''\n',params); 242 242 end -
issm/branches/trunk-jpl-damage/src/m/solutions/AnalysisConfiguration.m
r11354 r11684 14 14 15 15 case SteadystateSolutionEnum, 16 numanalyses= 7;17 analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum; ThermalAnalysisEnum;MeltingAnalysisEnum];16 numanalyses=8; 17 analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;EnthalpyAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum]; 18 18 19 19 case ThermalSolutionEnum, -
issm/branches/trunk-jpl-damage/src/m/solutions/steadystate_core.m
r9725 r11684 10 10 control_analysis=femmodel.parameters.InversionIscontrol; 11 11 solution_type=femmodel.parameters.SolutionType; 12 isenthalpy=femmodel.parameters.ThermalIsenthalpy; 12 13 13 14 %Initialize counter … … 17 18 18 19 issmprintf(VerboseSolution,'\n%s%i\n',' computing velocities and temperatures for step: ',step); 19 femmodel=thermal_core(femmodel); 20 if (isenthalpy==0), 21 femmodel=thermal_core(femmodel); 22 else 23 femmodel=enthalpy_core(femmodel); 24 end 20 25 21 26 issmprintf(VerboseSolution,'\n%s',[' computing new velocity']); … … 46 51 femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,PressureEnum); 47 52 femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,TemperatureEnum); 48 femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,BasalforcingsMeltingRateEnum); 49 end 53 if (isenthalpy), 54 femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,EnthalpyEnum); 55 femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,WaterfractionEnum); 56 else 57 femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,BasalforcingsMeltingRateEnum); 58 end 50 59 51 60 end %end of function -
issm/branches/trunk-jpl-damage/src/m/utils/Analysis/setcluster.m
r5961 r11684 5 5 % md=setcluster(md,cluster); 6 6 7 disp('Warning: setcluster is deprecated, use md.cluster=cluster instead'); 7 8 md.cluster=cluster; -
issm/branches/trunk-jpl-damage/src/m/utils/Exp/manipulation
-
Property svn:ignore
set to
Makefile
-
Property svn:ignore
set to
-
issm/branches/trunk-jpl-damage/src/m/utils/Exp/readwrite
-
Property svn:ignore
set to
Makefile
-
Property svn:ignore
set to
-
issm/branches/trunk-jpl-damage/src/mex/CreateJacobianMatrix/CreateJacobianMatrix.cpp
r11335 r11684 17 17 18 18 /* output datasets: */ 19 Mat Jff = NULL;19 Matrix* Jff = NULL; 20 20 21 21 /*Boot module: */ … … 53 53 delete materials; 54 54 delete parameters; 55 MatFree(&Jff);55 delete Jff; 56 56 57 57 /*end module: */ -
issm/branches/trunk-jpl-damage/src/mex/CreateNodalConstraints/CreateNodalConstraints.cpp
r8910 r11684 12 12 13 13 /* output datasets: */ 14 Vec ys=NULL;14 Vector* ys=NULL; 15 15 16 16 /*Boot module: */ … … 32 32 /*Free ressources: */ 33 33 delete nodes; 34 VecFree(&ys);34 delete ys; 35 35 36 36 /*end module: */ -
issm/branches/trunk-jpl-damage/src/mex/GetSolutionFromInputs/GetSolutionFromInputs.cpp
r8910 r11684 14 14 Materials* materials=NULL; 15 15 Parameters* parameters=NULL; 16 Vec ug=NULL;16 Vector* ug=NULL; 17 17 18 18 /* output datasets: elements and loads*/ -
issm/branches/trunk-jpl-damage/src/mex/InputUpdateFromSolution/InputUpdateFromSolution.cpp
r8910 r11684 14 14 Materials* materials=NULL; 15 15 Parameters* parameters=NULL; 16 Vec solution=NULL;16 Vector* solution=NULL; 17 17 18 18 /*Boot module: */ … … 50 50 delete materials; 51 51 delete parameters; 52 VecFree(&solution);52 delete solution; 53 53 54 54 /*end module: */ -
issm/branches/trunk-jpl-damage/src/mex/Mergesolutionfromftog/Mergesolutionfromftog.cpp
r8910 r11684 9 9 /*input datasets: */ 10 10 bool flag_ys0; 11 Vec uf = NULL;12 Vec ys = NULL;11 Vector* uf = NULL; 12 Vector* ys = NULL; 13 13 Nodes* nodes = NULL; 14 14 Parameters* parameters = NULL; 15 15 16 16 /* output datasets: */ 17 Vec ug=NULL;17 Vector* ug=NULL; 18 18 19 19 /*Boot module: */ … … 45 45 46 46 /*Free ressources: */ 47 VecFree(&uf);48 VecFree(&ug);49 VecFree(&ys);47 delete uf; 48 delete ug; 49 delete ys; 50 50 delete nodes; 51 51 delete parameters; -
issm/branches/trunk-jpl-damage/src/mex/Reduceload/Reduceload.cpp
r8910 r11684 8 8 9 9 /*input datasets: */ 10 Vec pf = NULL;11 Mat Kfs = NULL;12 Vec ys = NULL;10 Vector* pf = NULL; 11 Matrix* Kfs = NULL; 12 Vector* ys = NULL; 13 13 bool flag_ys0=false; 14 14 … … 40 40 41 41 /*Free ressources: */ 42 VecFree(&pf);43 MatFree(&Kfs);44 VecFree(&ys);42 delete pf; 43 delete Kfs; 44 delete ys; 45 45 46 46 MODULEEND(); -
issm/branches/trunk-jpl-damage/src/mex/Reducevectorgtof/Reducevectorgtof.cpp
r8910 r11684 8 8 9 9 /*input datasets: */ 10 Vec ug=NULL;10 Vector* ug=NULL; 11 11 Nodes* nodes=NULL; 12 12 Parameters* parameters=NULL; 13 13 14 14 /* output datasets: */ 15 Vec uf=NULL;15 Vector* uf=NULL; 16 16 17 17 /*Boot module: */ … … 35 35 delete nodes; 36 36 delete parameters; 37 VecFree(&ug);38 VecFree(&uf);37 delete ug; 38 delete uf; 39 39 40 40 /*end module: */ -
issm/branches/trunk-jpl-damage/src/mex/Reducevectorgtos/Reducevectorgtos.cpp
r8910 r11684 8 8 9 9 /*input datasets: */ 10 Vec yg=NULL;10 Vector* yg=NULL; 11 11 Nodes* nodes=NULL; 12 12 Parameters* parameters=NULL; 13 13 14 14 /* output datasets: */ 15 Vec ys=NULL;15 Vector* ys=NULL; 16 16 17 17 /*Boot module: */ … … 35 35 delete nodes; 36 36 delete parameters; 37 VecFree(&yg);38 VecFree(&ys);37 delete yg; 38 delete ys; 39 39 40 40 /*end module: */ -
issm/branches/trunk-jpl-damage/src/mex/Solver/Solver.cpp
r11252 r11684 8 8 9 9 /*input datasets: */ 10 Mat Kff = NULL;11 Vec pf = NULL;12 Vec uf0 = NULL;13 Vec uf = NULL;14 Vec df = NULL;10 Matrix* Kff = NULL; 11 Vector* pf = NULL; 12 Vector* uf0 = NULL; 13 Vector* uf = NULL; 14 Vector* df = NULL; 15 15 Parameters *parameters = NULL; 16 16 int analysis_type; … … 66 66 67 67 /*Free ressources: */ 68 MatFree(&Kff);69 VecFree(&pf);70 VecFree(&uf0);71 VecFree(&uf);72 VecFree(&df);68 delete Kff; 69 delete pf; 70 delete uf0; 71 delete uf; 72 delete df; 73 73 delete parameters; 74 74 -
issm/branches/trunk-jpl-damage/src/mex/SystemMatrices/SystemMatrices.cpp
r8910 r11684 17 17 18 18 /* output datasets: */ 19 Mat Kff = NULL;20 Mat Kfs = NULL;21 Vec pf = NULL;22 Vec df = NULL;19 Matrix* Kff = NULL; 20 Matrix* Kfs = NULL; 21 Vector* pf = NULL; 22 Vector* df = NULL; 23 23 24 24 double kmax; … … 72 72 delete materials; 73 73 delete parameters; 74 MatFree(&Kff);75 MatFree(&Kfs);76 VecFree(&pf);77 VecFree(&df);74 delete Kff; 75 delete Kfs; 76 delete pf; 77 delete df; 78 78 79 79 /*end module: */ -
issm/branches/trunk-jpl-damage/src/mex/UpdateDynamicConstraints/UpdateDynamicConstraints.cpp
r9302 r11684 11 11 Nodes *nodes = NULL; 12 12 Parameters *parameters = NULL; 13 Vec yg = NULL;13 Vector* yg = NULL; 14 14 15 15 /*Boot module: */ … … 32 32 33 33 /*Free ressources: */ 34 VecFree(&yg);34 delete yg; 35 35 delete constraints; 36 36 delete nodes; -
issm/branches/trunk-jpl-damage/test/NightlyRun/IdToName.m
r11348 r11684 224 224 case 453, name='SquareSheetShelfGroundingLine3dSoftSerial'; 225 225 case 454, name='SquareSheetShelfGroundingLine3dSoftParallel'; 226 case 455, name='SquareSheetShelfDiagM2dNewtonSerial'; 227 case 456, name='SquareSheetShelfDiagM2dNewtonParallel'; 228 case 457, name='SquareSheetShelfDiagP3dNewtonSerial'; 229 case 458, name='SquareSheetShelfDiagP3dNewtonParallel'; 230 case 459, name='SquareSheetShelfDiagS3dNewtonSerial'; 231 case 460, name='SquareSheetShelfDiagS3dNewtonParallel'; 232 case 461, name='SquareSheetShelfSteaEnthalpyM3dSerial'; 233 case 462, name='SquareSheetShelfSteaEnthalpyM3dParallel'; 234 case 463, name='SquareSheetShelfSteaEnthalpyP3dSerial'; 235 case 464, name='SquareSheetShelfSteaEnthalpyP3dParallel'; 226 236 case 501, name='PigDiagM2dSerial'; 227 237 case 502, name='PigDiagM2dParallel'; -
issm/branches/trunk-jpl-damage/test/NightlyRun/runme.m
r11254 r11684 180 180 disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,fieldname)); 181 181 else 182 disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,fieldname)); 182 183 rethrow(me2); 183 184 end … … 204 205 disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,'N/A')); 205 206 else 207 disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,'N/A')); 206 208 rethrow(me); 207 209 end
Note:
See TracChangeset
for help on using the changeset viewer.