Changeset 11684


Ignore:
Timestamp:
03/12/12 14:40:42 (13 years ago)
Author:
cborstad
Message:

merged revisions 11428:11680 from trunk-jpl into branches/trunk-jpl-damage

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  
    1919                        src/Makefile
    2020                        src/c/Makefile
    21                         src/ad/Makefile
    2221                        src/mex/Makefile
    2322                        src/m/Makefile
     
    5049                        src/m/utils/Ecco3/Makefile
    5150                        src/m/utils/Exp/Makefile
     51                        src/m/utils/Exp/manipulation/Makefile
     52                        src/m/utils/Exp/readwrite/Makefile
    5253                        src/m/utils/Geometry/Makefile
    5354                        src/m/utils/ImageProcessing/Makefile
  • issm/branches/trunk-jpl-damage/cron

    • Property svn:ignore
      •  

        old new  
        1 trunk-jpl
        21trunk-jpl-damage
  • issm/branches/trunk-jpl-damage/cron/configs/linux64_schlegel_daily

    r11577 r11684  
    1919#COMPILATION CONFIGURATION FILE
    2020COMPILE_CONFIG_FILE="config-linux64-astrid.sh"
     21
     22#MATLAB path
     23MATLAB_PATH="/usr/local/pkgs/matlab-7.6/"
    2124
    2225#----------------------#
     
    5760#Corresponding list of installation files to use
    5861EXTERNALPACKAGES_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"
    6062
    6163#---------------------#
     
    9799NROPTIONS=""
    98100
    99 #------------------------#
    100 # 7: Matlab#
    101 #------------------------#
    102 
    103 #MATLAB path
    104 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  
    1919#COMPILATION CONFIGURATION FILE
    2020COMPILE_CONFIG_FILE="config-linux64-astrid.sh"
     21
     22#MATLAB path
     23MATLAB_PATH="/usr/local/pkgs/matlab-7.6/"
    2124
    2225#----------------------#
     
    5760#Corresponding list of installation files to use
    5861EXTERNALPACKAGES_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"
    6062
    6163#---------------------#
     
    9799NROPTIONS=""
    98100
    99 
    100 #------------------------#
    101 # 7: Matlab#
    102 #------------------------#
    103 
    104 #MATLAB path
    105 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  
    1616#Machine configuration
    1717MACHINE="astrid"
     18
     19#COMPILATION CONFIGURATION FILE
     20COMPILE_CONFIG_FILE="config-linux64-astrid.sh"
    1821
    1922#MATLAB path
     
    5558EXTERNALPACKAGES="autoconf automake matlab mpich2 petsc metis triangle dakota chaco"
    5659
     60#Corresponding list of installation files to use
     61EXTERNALPACKAGES_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
    5763#---------------------#
    5864# 4: ISSM Compilation #
  • issm/branches/trunk-jpl-damage/cron/configs/linux64_schlegel_validation

    r11577 r11684  
    1818#COMPILATION CONFIGURATION FILE
    1919COMPILE_CONFIG_FILE="config-linux64-astrid.sh"
     20
     21#MATLAB path
     22MATLAB_PATH="/usr/local/pkgs/matlab-7.6/"
    2023
    2124#----------------------#
     
    5558
    5659#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"
     60EXTERNALPACKAGES_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"
    5961
    6062#---------------------#
     
    9698NROPTIONS="'benchmark','all'"
    9799
    98 #------------------------#
    99 # 7: Matlab#
    100 #------------------------#
    101 
    102 #MATLAB path
    103 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  
    4848# - "none"    leave external packages as is
    4949#             ->skip to section 4
    50 ISSM_EXTERNALPACKAGES="install"
     50ISSM_EXTERNALPACKAGES="copy"
    5151EXTERNALPACKAGESDIR="/Users/larour/issm-uci/trunk-jpl/externalpackages"
    5252
     
    7373#Mail delivery. If SKIPMAIL="no", the html nightly run report will be
    7474#sent to the adresses present in $ISSM_TIER/cron/mailinglist.
    75 SKIPMAIL="no"
     75SKIPMAIL="yes"
    7676
    7777#Sender email address
    78 EMAIL_ADRESS="schlegel@jpl.nasa.gov"
     78EMAIL_ADRESS="eric.larour@jpl.nasa.gov"
    7979
    8080#------------------------#
     
    8484#number of cpus used in ISSM installation and compilation (one is usually
    8585#safer as some packages are very sensitive to parallel compilation)
    86 NUMCPUS_INSTALL=1
     86NUMCPUS_INSTALL=4
    8787
    8888#number of cpus used in the nightly runs.
    89 NUMCPUS_RUN=7
     89NUMCPUS_RUN=1
    9090
    9191#Nightly run options. The matlab routine nightlyrun.m will be called
     
    102102
    103103#MATLAB path
    104 MATLAB_PATH="/usr/local/pkgs/matlab-7.6/"
     104MATLAB_PATH="/Applications/MATLAB_R2010a.app/"
    105105
    106 MATLABBIN="/usr/local/pkgs/matlab-7.6/bin/matlab"
     106MATLABBIN="/Applications/MATLAB_R2010a.app/bin/matlab"
  • issm/branches/trunk-jpl-damage/cron/cronfiles/mac_cronfile

    r2092 r11684  
    11#use /bin/bash to run commands, overriding the default set by cron
    22SHELL=/bin/bash
     3PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
    34
    4 #mail output to Helene
    5 MAILTO=eric.larour@jpl.nasa.gov,mathieu.morlighem@jpl.nasa.gov,helene.seroussi@jpl.nasa.gov
     5#mail output to issm
     6MAILTO=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
    67
    78#cronjob: issm 9:00pm
    8 50 9 * * * cd /Users/seroussi/Desktop/backup/svn/issm/trunk/cron/ && ./nightlyrun.sh configs/macosx32_seroussi
     930 00 * * 1 cd /Users/schlegel/issmuci/trunk-jpl/cron/ && ./nightlyrun.sh configs/macosx64_schlegel
  • issm/branches/trunk-jpl-damage/cron/nightlyrun.sh

    r11577 r11684  
    122122cluster.executionpath='$EXECUTION_PATH';
    123123END
     124   cat << END > $ISSM_TIER/externalpackages/matlab/install.sh
     125#!/bin/bash
     126rm -rf install
     127ln -s $MATLAB_PATH install
     128END
     129
    124130fi
    125131#}}}
     
    153159        rm -rf externalpackages
    154160        cp -Rf $EXTERNALPACKAGESDIR ./
     161
     162elif [ "$ISSM_EXTERNALPACKAGES" == "link" ]
     163then
     164
     165        #erase externapackages, and link with externalpackages_dir
     166        cd $ISSM_TIER
     167        rm -rf externalpackages
     168        ln -s  $EXTERNALPACKAGESDIR  .
    155169
    156170elif [ "$ISSM_EXTERNALPACKAGES" == "none" ]
     
    177191        ./scripts/automakererun.sh
    178192        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
    179203        make install
    180204
     
    259283        cd $ISSM_TIER/nightlylog/
    260284
     285        MATLABBIN=$MATLAB_PATH/bin/matlab
    261286        #Start test
    262287        $MATLABBIN  -nojvm -nosplash  -r matlab_run$i -logfile matlab_log$i.log &
     
    312337                if [ "$MACHINE" = "win7" ]
    313338                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
    316340                else
    317341                        if [ "$MACHINE" = "astrid" ]
     
    320344From: "ISSM Nightly run" <$EMAIL_ADRESS>
    321345To: $i
    322 Subject: Nightly runs of $ISSM_RELEASE, configuration: $MACHINE, host: $HOST_NAME, user: $USER.
     346Subject: Nightly runs on $HOST_NAME (version: $ISSM_RELEASE)
    323347Mime-Version: 1.0
    324348Content-Type: text/html
     
    328352From: "ISSM Nightly run" <$EMAIL_ADRESS>
    329353To: $i
    330 Subject: Nightly runs of $ISSM_RELEASE, configuration: $MACHINE, host: $HOST_NAME, user: $USER.
     354Subject: Nightly runs on $HOST_NAME (version: $ISSM_RELEASE)
    331355Mime-Version: 1.0
    332356Content-Type: text/html
  • issm/branches/trunk-jpl-damage/etc/environment.sh

    r11577 r11684  
    233233#CCCL
    234234export PATH="$PATH:$CCCL_DIR/bin"
     235
     236#PACKAGEMAKER
     237export PATH="$PATH:$PACKAGEMAKER_DIR"
     238
     239#ANDROID_NDK:
     240export PATH="$PATH:$ANDROID_NDK_DIR/"
     241
     242#ANDROID_SDK
     243export PATH="$PATH:$ANDROID_SDK_DIR/"
     244
     245#ANDROID_ANT
     246export PATH="$PATH:$ANDROID_ANT_DIR/"
  • issm/branches/trunk-jpl-damage/etc/environment_variables.sh

    r11577 r11684  
    169169#cccl
    170170CCCL_DIR="$ISSM_TIER/externalpackages/cccl/install"
     171
     172#packagemaker
     173PACKAGEMAKER_DIR="$ISSM_TIER/externalpackages/packagemaker/install"
     174
     175#android-ndk
     176ANDROID_NDK_DIR="$ISSM_TIER/externalpackages/android-ndk/install"
     177
     178#android-sdk
     179ANDROID_SDK_DIR="$ISSM_TIER/externalpackages/android-sdk/install-sdk"
     180
     181#android-ant
     182ANDROID_ANT_DIR="$ISSM_TIER/externalpackages/android-sdk/install-ant"
  • issm/branches/trunk-jpl-damage/examples/SquareIceShelf/runme.m

    r11012 r11684  
    44md=parameterize(md,'Square.par');
    55md=setflowequation(md,'macayeal','all');
     6md.cluster=generic('name',oshostname,'np',2);
    67md=solve(md,DiagnosticSolutionEnum);
  • issm/branches/trunk-jpl-damage/externalpackages/dakota/install-macosx64.sh

    r11101 r11684  
    2828#Configure dakota
    2929cd 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 "
    3537cd ..
    3638
     
    4446mv temp ./src/methods/acro/packages/pebbl/src/Makefile
    4547
    46 cat ./src/methods/hopspack/src-nappspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2  -fPIC/g' > temp
     48cat ./src/methods/hopspack/src-nappspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp
    4749mv temp ./src/methods/hopspack/src-nappspack/Makefile
    4850
     
    5355mv temp  ./src/methods/hopspack/src-shared/Makefile
    5456
    55 cat ./src/methods/hopspack/src-shared/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2  -fPIC/g' > temp
     57cat ./src/methods/hopspack/src-shared/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp
    5658mv temp  ./src/methods/hopspack/src-shared/Makefile
    5759
     
    5961mv temp  ./src/methods/hopspack/src-conveyor/Makefile
    6062
    61 cat ./src/methods/hopspack/src-appspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2  -fPIC/g' > temp
     63cat ./src/methods/hopspack/src-appspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp
    6264mv temp ./src/methods/hopspack/src-appspack/Makefile
    6365
     
    7476mv temp  ./src/methods/acro/packages/tpl/3po/Makefile
    7577
    76 cat ./src/packages/ampl/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
     78cat ./src/packages/ampl/Makefile | sed 's/CFLAGS = -g -O2 -D_NONSTD_SOURCE/CFLAGS = -g -O2 -fPIC/g' > temp
    7779mv temp  ./src/packages/ampl/Makefile
    7880
  • issm/branches/trunk-jpl-damage/externalpackages/matlab/install.sh

    r11577 r11684  
    1010ln -s /usr/local/matlab712/ install
    1111#ln -s /usr/local/pkgs/matlab-7.6/ install
     12
     13# Macintosh (OSX) simlink
    1214#ln -s /Applications/MATLAB_R2008a/ install
    1315#ln -s /Applications/MATLAB_R2009a.app/ install
    1416#ln -s /Applications/MATLAB_R2010a.app/ install
    1517#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  
    250250                HAVE_DAKOTA=yes
    251251                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
    254264                AC_DEFINE([_HAVE_DAKOTA_],[1],[with Dakota in ISSM src])
    255265                AC_SUBST([DAKOTAINCL])
     
    306316        fi
    307317        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)
    308346        dnl }}}
    309347        dnl adic2{{{1
  • issm/branches/trunk-jpl-damage/src/Makefile.am

    r11577 r11684  
    11EXTRA_DIST =  perl  pro
    22SUBDIRS = c mex m
    3 
    4 if ADIC2
    5 SUBDIRS += ad
    6 endif
    7 
    8 
  • issm/branches/trunk-jpl-damage/src/c/EnumDefinitions/EnumDefinitions.h

    r11577 r11684  
    482482};
    483483
    484 /*Functions on enums: */
    485 const char *EnumToModelField(int  en);
    486 
    487484#endif
  • issm/branches/trunk-jpl-damage/src/c/EnumDefinitions/README

    r8224 r11684  
    44- EnumToStringx.cpp
    55- src/m/enum/*
    6 all these files are automatically synchronized with EnumDefinitions.h and EnumToModelField.cpp
     6all these files are automatically synchronized with EnumDefinitions.h
    77
    88TO ADD AN ENUM:
  • issm/branches/trunk-jpl-damage/src/c/EnumDefinitions/Synchronize.sh

    r11407 r11684  
    1313NUMENUMS=$(wc -l temp | awk '{printf("%s",$1);}');
    1414
    15 #Take care of EnumToModelField.m first (easy)
    16 #Build EnumToModelField.m {{{1
    17 cat <<END > $ISSM_TIER/src/m/enum/EnumToModelField.m
    18 function string=EnumToModelField(enum)
    19 %ENUMTOMODELFIELD - output string of model field associated to enum
    20 %
    21 %   WARNING: DO NOT MODIFY THIS FILE
    22 %            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
    23 %            Please read src/c/EnumDefinitions/README for more information
    24 %
    25 %   Usage:
    26 %      string=EnumToModelField(enum)
    27 
    28 switch enum,
    29 
    30 END
    31 
    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.m
    33 
    34 cat <<END >> $ISSM_TIER/src/m/enum/EnumToModelField.m
    35                 otherwise, error(['Enum ' num2str(enum)  ' not found associated to any model field']);
    36 
    37 end
    38 END
    39 #}}}
    4015#Build EnumToStringx.cpp {{{1
    4116#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@
     1INCLUDES = @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @MPIINCL@ @MATLABINCL@  @METISINCL@  @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@  @BLASLAPACKINCL@ @MKLINCL@ @MUMPSINCL@  @TRIANGLEINCL@ @HYPREINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@
    22EXEEXT=$(ISSMEXT)
    33
     
    120120                                        ./objects/Numerics/ElementVector.h\
    121121                                        ./objects/Numerics/ElementVector.cpp\
     122                                        ./objects/Numerics/Matrix.h\
     123                                        ./objects/Numerics/Matrix.cpp\
     124                                        ./objects/Numerics/Vector.h\
     125                                        ./objects/Numerics/Vector.cpp\
    122126                                        ./objects/Params/Param.h\
    123127                                        ./objects/Params/BoolParam.cpp\
     
    204208                                        ./shared/Elements/GetGlobalDofList.cpp\
    205209                                        ./shared/Elements/GetNumberOfDofs.cpp\
    206                                         ./shared/Elements/CoordinateSystemTransform.cpp\
    207210                                        ./shared/String/sharedstring.h\
    208211                                        ./toolkits/petsc\
     
    253256                                        ./io/PrintfFunction.cpp\
    254257                                        ./EnumDefinitions/EnumDefinitions.h\
    255                                         ./EnumDefinitions/EnumToModelField.cpp\
    256258                                        ./modules/ModelProcessorx/ModelProcessorx.h\
    257259                                        ./modules/ModelProcessorx/ModelProcessorx.cpp\
     
    342344                                        ./modules/ResetCoordinateSystemx/ResetCoordinateSystemx.cpp\
    343345                                        ./modules/Solverx/Solverx.cpp\
     346                                        ./modules/Solverx/SolverxPetsc.cpp\
    344347                                        ./modules/Solverx/Solverx.h\
    345348                                        ./modules/Solverx/DofTypesToIndexSet.cpp\
     
    503506                                              ./modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp \
    504507                                              ./modules/ModelProcessorx/DiagnosticHutter/CreateLoadsDiagnosticHutter.cpp \
     508                                                        ./shared/Elements/CoordinateSystemTransform.cpp\
    505509                                                        ./shared/Elements/TransformLoadVectorCoord.cpp \
    506510                                                        ./shared/Elements/TransformStiffnessMatrixCoord.cpp \
     
    725729                                    ./toolkits/matlab/matlabincludes.h\
    726730                                    ./toolkits/matlab/MatlabNArrayToNArray.cpp\
     731                                    ./toolkits/matlab/MatlabMatrixToMatrix.cpp\
     732                                    ./toolkits/matlab/MatlabVectorToVector.cpp\
    727733                                    ./io/Matlab/matlabio.h\
    728734                                    ./io/Matlab/WriteMatlabData.cpp\
     
    816822
    817823#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
    819826
    820827#First the core
     
    925932
    926933#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)
     934LDADD += $(PETSCLIB) $(TAOLIB) $(FLIBS) $(PLAPACKLIB)  $(MUMPSLIB) $(SCALAPACKLIB)  $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB)  $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS)
    928935
    929936issm_SOURCES = solutions/issm.cpp
    930937issm_CXXFLAGS= -fPIC -D_PARALLEL_  $(CXXFLAGS) $(CXXOPTFLAGS) $(COPTFLAGS)
    931938#}}}
     939#Automatic differentiation: append this fold to the end of the src/c/Makefile.am to get this Makefile.am {{{
     940if ADIC2
     941lib_LIBRARIES += libAD.a libpISSMRose.a
     942
     943#ADIC2 library, for automatic differentiation
     944#libAD_a_SOURCES = ./mini1.ad.c
     945libAD_a_SOURCES =
     946libAD_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) $<
     953libpISSMRose_a_SOURCES = $(libpISSM_a_SOURCES:.cpp=.r2cpp.cpp)
     954libpISSMRose_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
     965bin_PROGRAMS +=  issmRose.exe
     966issmRose_exe_LDADD = ./libpISSMRose.a $(LDADD)
     967issmRose_exe_SOURCES = solutions/issm.cpp
     968issmRose_exe_CXXFLAGS= -fPIC -D_PARALLEL_  $(CXXOPTFLAGS) $(COPTFLAGS)
     969LDADD +=  $(ADIC2LIB)
     970
     971endif #}}}
  • issm/branches/trunk-jpl-damage/src/c/io/Matlab/FetchMatlabData.cpp

    r9320 r11684  
    6060                outmatrix=NULL;
    6161        }
    62         else if (mxIsClass(dataref,"double") ){
    63 
     62        else if(mxIsClass(dataref,"double") || mxIsClass(dataref,"single")){
    6463                /*Check dataref is not pointing to NaN: */
    6564                if ( mxIsNaN(*(mxGetPr(dataref))) && (mxGetM(dataref)==1) && (mxGetN(dataref)==1) ){
     
    6968                }
    7069                else{
    71 
    7270                        /*Convert matlab matrix to double* matrix: */
    7371                        MatlabMatrixToDoubleMatrix(&outmatrix,&outmatrix_rows,&outmatrix_cols,dataref);
     
    305303}
    306304/*}}}*/
     305/*FUNCTION FetchMatlabData(Matrix** pmatrix,const mxArray* dataref){{{1*/
     306void 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/*}}}*/
    307332/*FUNCTION FetchMatlabData(double** pvector,int* pM,const mxArray* dataref){{{1*/
    308333void FetchMatlabData(double** pvector,int* pM,const mxArray* dataref){
     
    442467                /*Convert matlab vector to petsc vector: */
    443468                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*/
     480void 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);
    444493        }
    445494        else{
  • issm/branches/trunk-jpl-damage/src/c/io/Matlab/WriteMatlabData.cpp

    r11202 r11684  
    5858}
    5959/*}}}*/
     60/*FUNCTION WriteMatlabData(mxArray** pdataref,Matrix* matrix){{{1*/
     61void 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/*}}}*/
    6077/*FUNCTION WriteMatlabData(mxArray** pdataref,double* matrix, int M,int N){{{1*/
    6178void WriteMatlabData(mxArray** pdataref,double* matrix, int M,int N){
     
    117134                /*call toolkit routine: */
    118135                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*/
     145void WriteMatlabData(mxArray** pdataref,Vector* vector){
     146       
     147        mxArray* dataref=NULL;
     148       
     149        if(vector){
     150               
     151                /*call toolkit routine: */
     152                dataref=vector->ToMatlabVector();
    119153        }
    120154        else{
  • issm/branches/trunk-jpl-damage/src/c/io/Matlab/matlabio.h

    r10205 r11684  
    1717void WriteMatlabData(mxArray** pdataref,DataSet* dataset);
    1818void WriteMatlabData(mxArray** pdataref,Mat matrix);
     19void WriteMatlabData(mxArray** pdataref,Matrix* matrix);
    1920void WriteMatlabData(mxArray** pdataref,double* matrix, int M,int N);
    2021void WriteMatlabData(mxArray** pdataref,int*    matrix, int M,int N);
    2122void WriteMatlabData(mxArray** pdataref,Vec vector);
     23void WriteMatlabData(mxArray** pdataref,Vector* vector);
    2224void WriteMatlabData(mxArray** pdataref,double* vector, int M);
    2325void WriteMatlabData(mxArray** pdataref,int integer);
     
    3436void FetchMatlabData(bool** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref);
    3537void FetchMatlabData(Mat* pmatrix,const mxArray* dataref);
     38void FetchMatlabData(Matrix** pmatrix,const mxArray* dataref);
    3639void FetchMatlabData(int** pvector,int* pM,const mxArray* dataref);
    3740void FetchMatlabData(float** pvector,int* pM,const mxArray* dataref);
     
    3942void FetchMatlabData(bool** pvector,int* pM,const mxArray* dataref);
    4043void FetchMatlabData(Vec* pvector,const mxArray* dataref);
     44void FetchMatlabData(Vector** pvector,const mxArray* dataref);
    4145void FetchMatlabData(char** pstring,const mxArray* dataref);
    4246void 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  
    1010#include "../../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void CreateJacobianMatrixx(Mat* pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,double kmax){
     12void CreateJacobianMatrixx(Matrix** pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,double kmax){
    1313       
    1414        int      i,connectivity;
     
    1717        Element *element = NULL;
    1818        Load    *load    = NULL;
    19         Mat      Jff     = NULL;
     19        Matrix*  Jff     = NULL;
    2020
    2121        /*Checks*/
     
    2929
    3030        /*Initialize Jacobian Matrix*/
    31         Jff=NewMat(fsize,fsize,connectivity,numberofdofspernode);
     31        Jff=new Matrix(fsize,fsize,connectivity,numberofdofspernode);
    3232       
    3333        /*Create and assemble matrix*/
     
    4141                if(load->InAnalysis(configuration_type)) load->PenaltyCreateJacobianMatrix(Jff,kmax);
    4242        }
    43         MatAssemblyBegin(Jff,MAT_FINAL_ASSEMBLY);
    44         MatAssemblyEnd(Jff,MAT_FINAL_ASSEMBLY);
     43        Jff->Assemble();
    4544
    4645        /*Assign output pointer*/
  • issm/branches/trunk-jpl-damage/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h

    r11327 r11684  
    1010
    1111/* local prototypes: */
    12 void CreateJacobianMatrixx(Mat* pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,double kmax);
     12void CreateJacobianMatrixx(Matrix** pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,double kmax);
    1313
    1414#endif  /* _CREATEJACOBIANMATRIXX_H */
  • issm/branches/trunk-jpl-damage/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.cpp

    r8816 r11684  
    1010#include "../../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void CreateNodalConstraintsx( Vec* pys, Nodes* nodes,int configuration_type){
     12void CreateNodalConstraintsx( Vector** pys, Nodes* nodes,int configuration_type){
    1313
    1414        int i;
     
    1818
    1919        /*output: */
    20         Vec ys=NULL;
     20        Vector* ys=NULL;
    2121
    2222        /*figure out how many dofs we have: */
     
    2424
    2525        /*allocate:*/
    26         ys=NewVec(numberofdofs);
     26        ys=new Vector(numberofdofs);
    2727
    2828        /*go through all nodes, and for the ones corresponding to this configuration_type, fill the
     
    3636
    3737        /*Assemble: */
    38         VecAssemblyBegin(ys);
    39         VecAssemblyEnd(ys);
     38        ys->Assemble();
    4039
    4140        /*Assign output pointers: */
  • issm/branches/trunk-jpl-damage/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.h

    r8816 r11684  
    99
    1010/* local prototypes: */
    11 void CreateNodalConstraintsx( Vec* pys, Nodes* nodes,int configuration_type);
     11void CreateNodalConstraintsx( Vector** pys, Nodes* nodes,int configuration_type);
    1212
    1313#endif  /* _CREATENODALCONSTRAINTSX_H */
  • issm/branches/trunk-jpl-damage/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp

    r8224 r11684  
    99#include "../../EnumDefinitions/EnumDefinitions.h"
    1010
    11 void    GetSolutionFromInputsx( Vec* psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters){
     11void    GetSolutionFromInputsx( Vector** psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters){
    1212
    1313        /*intermediary: */
     
    1919
    2020        /*output: */
    21         Vec solution=NULL;
     21        Vector* solution=NULL;
    2222
    2323        /*retrive parameters: */
     
    2929       
    3030        /*Initialize solution: */
    31         solution=NewVec(gsize);
     31        solution=new Vector(gsize);
    3232       
    3333        /*Go through elements and plug solution: */
     
    3838
    3939        /*Assemble vector: */
    40         VecAssemblyBegin(solution);
    41         VecAssemblyEnd(solution);
     40        solution->Assemble();
    4241
    4342        /*Assign output pointers:*/
  • issm/branches/trunk-jpl-damage/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.h

    r4236 r11684  
    1010
    1111/* local prototypes: */
    12 void GetSolutionFromInputsx( Vec* psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
     12void GetSolutionFromInputsx( Vector** psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
    1313
    1414#endif  /* _GETSOLUTIONFROMINPUTSXX_H */
  • issm/branches/trunk-jpl-damage/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.cpp

    r4573 r11684  
    99#include "../../EnumDefinitions/EnumDefinitions.h"
    1010
    11 void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vec solution){
     11void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* solution){
    1212
    1313        double* serial_solution=NULL;
    1414
    1515        /*Serialize solution, so that elements can index into it on every CPU: */
    16         VecToMPISerial(&serial_solution,solution);
     16        serial_solution=solution->ToMPISerial();
    1717
    1818        /*Call overloaded form of InputUpdateFromSolutionx: */
  • issm/branches/trunk-jpl-damage/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.h

    r4236 r11684  
    1010
    1111/* local prototypes: */
    12 void            InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vec solution);
     12void            InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector* solution);
    1313void        InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,double* solution);
    1414
    1515//with timestep
    16 void            InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vec solution,int timestep);
     16void            InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector* solution,int timestep);
    1717void        InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,double* solution, int timestep);
    1818
  • issm/branches/trunk-jpl-damage/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp

    r9761 r11684  
    77#include "./Mergesolutionfromftogx.h"
    88
    9 void    Mergesolutionfromftogx( Vec* pug, Vec uf, Vec ys, Nodes* nodes, Parameters* parameters, bool flag_ys0){
     9void    Mergesolutionfromftogx( Vector** pug, Vector* uf, Vector* ys, Nodes* nodes, Parameters* parameters, bool flag_ys0){
    1010
    1111        /*output: */
    12         Vec ug=NULL;
     12        Vector* ug=NULL;
    1313
    1414        /*intermediary: */
     
    2929        if(ssize){
    3030                if(flag_ys0){
    31                         VecSet(ys,0.0);
     31                        ys->Set(0.0);
    3232                }
    3333        }
    3434
    3535        /*initialize ug: */
    36         ug=NewVec(gsize);
     36        ug=new Vector(gsize);
    3737
    3838        /*Merge f set back into g set: */
  • issm/branches/trunk-jpl-damage/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.h

    r8799 r11684  
    99
    1010/* local prototypes: */
    11 void    Mergesolutionfromftogx( Vec* pug, Vec uf, Vec ys, Nodes* nodes, Parameters* parameters, bool flag_ys0=false);
     11void    Mergesolutionfromftogx( Vector** pug, Vector* uf, Vector* ys, Nodes* nodes, Parameters* parameters, bool flag_ys0=false);
    1212
    1313#endif  /* _MERGESOLUTIONFROMFTOGX_H */
  • issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/ModelProcessorx.cpp

    r11347 r11684  
    6464                if(solution_type==TransientSolutionEnum && analysis_type==DiagnosticVertAnalysisEnum && isdiagnostic==false) continue;
    6565                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;
    6669       
    6770                _printf_(VerboseMProcessor(),"   creating datasets for analysis %s\n",EnumToStringx(analysis_type));
  • issm/branches/trunk-jpl-damage/src/c/modules/Reduceloadx/Reduceloadx.cpp

    r9761 r11684  
    1212#include "../../io/io.h"
    1313
    14 void    Reduceloadx( Vec pf, Mat Kfs, Vec y_s,bool flag_ys0){
     14void    Reduceloadx( Vector* pf, Matrix* Kfs, Vector* y_s,bool flag_ys0){
    1515
    1616        /*intermediary*/
    17         Vec         y_s0   = NULL;
    18         Vec         Kfsy_s = NULL;
     17        Vector*     y_s0   = NULL;
     18        Vector*     Kfsy_s = NULL;
    1919        int         Kfsm,Kfsn;
    2020        int         global_m,global_n;
    21         PetscScalar a;
    2221        bool        fromlocalsize = true;
    2322        int         verbose;
     
    2524        _printf_(VerboseModule(),"   Dirichlet lifting applied to load vector\n");
    2625
    27         MatGetSize(Kfs,&global_m,&global_n);
     26        Kfs->GetSize(&global_m,&global_n);
    2827        if(pf && global_m*global_n){
    2928
     
    3231
    3332                /*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);
    3635                if (flag_ys0){
    3736
    3837                        /*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();
    4341
    44                         MatMultPatch(Kfs,y_s0,Kfsy_s);
     42                        Kfs->MatMult(y_s0,Kfsy_s);
    4543                }
    4644                else{
    47                         MatMultPatch(Kfs,y_s,Kfsy_s);
     45                        Kfs->MatMult(y_s,Kfsy_s);
    4846                }
    4947
    50                 a=-1;
    51                 VecAXPY(pf,a,Kfsy_s); 
     48                pf->AXPY(Kfsy_s,-1);
    5249        }
    5350
    5451
    5552        /*Free ressources and return*/
    56         VecFree(&y_s0);
    57         VecFree(&Kfsy_s);
     53        delete y_s0;
     54        delete Kfsy_s;
    5855
    5956}
  • issm/branches/trunk-jpl-damage/src/c/modules/Reduceloadx/Reduceloadx.h

    r6580 r11684  
    99
    1010/* local prototypes: */
    11 void    Reduceloadx( Vec pf, Mat Kfs, Vec ys,bool flag_ys0=false);
     11void    Reduceloadx( Vector* pf, Matrix* Kfs, Vector* ys,bool flag_ys0=false);
    1212
    1313#endif  /* _REDUCELOADX_H */
  • issm/branches/trunk-jpl-damage/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.cpp

    r8817 r11684  
    66#include "./Reducevectorgtofx.h"
    77 
    8 void Reducevectorgtofx(Vec* puf, Vec ug, Nodes* nodes,Parameters* parameters){
     8void Reducevectorgtofx(Vector** puf, Vector* ug, Nodes* nodes,Parameters* parameters){
    99
    1010        /*output: */
    11         Vec uf=NULL;
     11        Vector* uf=NULL;
    1212
    1313        /*variables: */
     
    2626        else{
    2727                /*allocate: */
    28                 uf=NewVec(fsize);
     28                uf=new Vector(fsize);
    2929
    3030                if(nodes->NumberOfNodes(configuration_type)){
    3131
    3232                        /*serialize ug, so nodes can index into it: */
    33                         VecToMPISerial(&ug_serial,ug);
     33                        ug_serial=ug->ToMPISerial();
    3434
    3535                        /*Go through all nodes, and ask them to retrieve values from ug, and plug them into uf: */
     
    4747                }
    4848                /*Assemble vector: */
    49                 VecAssemblyBegin(uf);
    50                 VecAssemblyEnd(uf);
     49                uf->Assemble();
    5150        }
    5251
  • issm/branches/trunk-jpl-damage/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.h

    r8799 r11684  
    1010
    1111/* local prototypes: */
    12 void Reducevectorgtofx(Vec* puf, Vec ug, Nodes* nodes,Parameters* parameters);
     12void Reducevectorgtofx(Vector** puf, Vector* ug, Nodes* nodes,Parameters* parameters);
    1313
    1414#endif  /* _REDUCEVECTORGTOFX_H */
  • issm/branches/trunk-jpl-damage/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.cpp

    r8816 r11684  
    66#include "./Reducevectorgtosx.h"
    77
    8 void Reducevectorgtosx(Vec* pys, Vec yg, Nodes* nodes,Parameters* parameters){
     8void Reducevectorgtosx(Vector** pys, Vector* yg, Nodes* nodes,Parameters* parameters){
    99
    1010        /*output: */
    11         Vec ys=NULL;
     11        Vector* ys=NULL;
    1212
    1313        /*variables: */
     
    2626        else{
    2727                /*allocate: */
    28                 ys=NewVec(ssize);
     28                ys=new Vector(ssize);
    2929
    3030                if(nodes->NumberOfNodes(configuration_type)){
    3131
    3232                        /*serialize yg, so nodes can index into it: */
    33                         VecToMPISerial(&yg_serial,yg);
     33                        yg_serial=yg->ToMPISerial();
    3434
    3535                        /*Go throygh all nodes, and ask them to retrieve values from yg, and plyg them into ys: */
     
    4747                }
    4848                /*Assemble vector: */
    49                 VecAssemblyBegin(ys);
    50                 VecAssemblyEnd(ys);
     49                ys->Assemble();
    5150        }
    5251
  • issm/branches/trunk-jpl-damage/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.h

    r8799 r11684  
    1010
    1111/* local prototypes: */
    12 void Reducevectorgtosx(Vec* pys, Vec yg, Nodes* nodes,Parameters* parameters);
     12void Reducevectorgtosx(Vector** pys, Vector* yg, Nodes* nodes,Parameters* parameters);
    1313
    1414#endif  /* _REDUCEVECTORGTOSX_H */
  • issm/branches/trunk-jpl-damage/src/c/modules/Solverx/Solverx.cpp

    r11577 r11684  
    1414#endif
    1515
    16 void    Solverx(Vec* puf, Mat Kff, Vec pf, Vec uf0,Vec df, Parameters* parameters){
     16void    Solverx(Vector** puf, Matrix* Kff, Vector* pf, Vector* uf0,Vector* df, Parameters* parameters){
    1717
    18         /*Output: */
    19         Vec        uf               = NULL;
     18        /*output: */
     19        Vector* uf=NULL;
     20        uf=new Vector();
    2021
    21         /*Intermediary: */
    22         int        local_m,local_n,global_m,global_n;
    23         int        analysis_type;
     22        #ifdef _HAVE_PETSC_
     23        Vec uf0_vector=NULL;
     24        if (uf0)uf0_vector=uf0->vector;
    2425
    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);
    3328        #else
    34         PetscBool flag,flg;
     29        _error_("not supported yet!");
    3530        #endif
    3631
    37         /*Stokes: */
    38         IS         isv=NULL;
    39         IS         isp=NULL;
    40 
    41         #if _PETSC_MAJOR_ >= 3
    42         char ksp_type[50];
    43         #endif
    44 
    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         #else
    51         if(VerboseSolver())PetscOptionsView(PETSC_VIEWER_STDOUT_WORLD);
    52         #endif
    53 
    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_ >= 3
    64         PetscOptionsGetString(PETSC_NULL,"-ksp_type",ksp_type,49,&flg);
    65         if (strcmp(ksp_type,"preonly")==0)uf0=NULL;
    66         #endif
    67 
    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_ == 2
    84         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         #endif
    108         #endif
    109         /*}}}*/
    110         /*Check the solver is available: {{{1*/
    111         if(solver_type==MUMPSPACKAGE_LU || solver_type==MUMPSPACKAGE_CHOL){
    112         #if _PETSC_MAJOR_ >=3
    113                 #ifndef _HAVE_MUMPS_
    114                 _error_("requested MUMPS solver, which was not compiled into ISSM!\n");
    115                 #endif
    116 
    117         #endif
    118         }
    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_==3
    126         /*Specific solver?: */
    127         KSPGetPC(ksp,&pc);
    128         if (solver_type==MUMPSPACKAGE_LU){
    129                 #if _PETSC_MINOR_==1
    130                 PCFactorSetMatSolverPackage(pc,MAT_SOLVER_MUMPS);
    131                 #else
    132                 PCFactorSetMatSolverPackage(pc,MATSOLVERMUMPS);
    133                 #endif
    134         }
    135         #endif
    136 
    137         #if defined(_PARALLEL_) && _PETSC_MAJOR_==3
    138         /*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_==1
    147                 PCFieldSplitSetIS(pc,isv);
    148                 PCFieldSplitSetIS(pc,isp);
    149                 #else
    150                 PCFieldSplitSetIS(pc,PETSC_NULL,isv);
    151                 PCFieldSplitSetIS(pc,PETSC_NULL,isp);
    152                 #endif
    153 
    154         }
    155         #endif
    156 
    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                
    17832        /*Assign output pointers:*/
    17933        *puf=uf;
  • issm/branches/trunk-jpl-damage/src/c/modules/Solverx/Solverx.h

    r7391 r11684  
    99
    1010/* local prototypes: */
    11 void    Solverx( Vec* puf, Mat Kff, Vec pf, Vec uf0,Vec df,Parameters* parameters);
     11void    Solverx(Vector** puf, Matrix* Kff, Vector* pf, Vector* uf0,Vector* df, Parameters* parameters);
     12void    SolverxPetsc(Vec* puf, Mat Kff, Vec pf, Vec uf0,Vec df, Parameters* parameters);
    1213void    DofTypesToIndexSet(IS* pisv, IS* pisp, Vec df,int typeenum);
    1314#endif  /* _SOLVERX_H */
  • issm/branches/trunk-jpl-damage/src/c/modules/StringToEnumx/StringToEnumx.cpp

    r11683 r11684  
    137137              else if (strcmp(name,"PrognosticHydrostaticAdjustment")==0) return PrognosticHydrostaticAdjustmentEnum;
    138138              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;
    139141         else stage=2;
    140142   }
    141143   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;
    145145              else if (strcmp(name,"PrognosticVertexPairing")==0) return PrognosticVertexPairingEnum;
    146146              else if (strcmp(name,"QmuIsdakota")==0) return QmuIsdakotaEnum;
  • issm/branches/trunk-jpl-damage/src/c/modules/SystemMatricesx/SystemMatricesx.cpp

    r11324 r11684  
    1010#include "../../EnumDefinitions/EnumDefinitions.h"
    1111
    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){
     12void 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){
    1313       
    1414        /*intermediary: */
     
    2121       
    2222        /*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;
    2727        double kmax = 0;
    2828
     
    4949        if(kflag){
    5050
    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);
    5454
    5555                /*Fill stiffness matrix from elements: */
     
    6666
    6767                /*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();
    7371
    74                 MatAssemblyBegin(Kfs,MAT_FINAL_ASSEMBLY);
    75                 MatAssemblyEnd(Kfs,MAT_FINAL_ASSEMBLY);
    76                 #if _PETSC_MAJOR_ == 2
    77                 MatCompress(Kfs);
    78                 #endif
    79                 VecAssemblyBegin(df);
    80                 VecAssemblyEnd(df);
    8172               
    8273        }
     
    8475        if(pflag){
    8576
    86                 pf=NewVec(fsize);
     77                pf=new Vector(fsize);
    8778
    8879                /*Fill right hand side vector, from elements: */
     
    9889                }
    9990
    100                 VecAssemblyBegin(pf);
    101                 VecAssemblyEnd(pf);
     91                pf->Assemble();
    10292        }
    10393
    10494        /*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);
    10696
    10797        /*Now, deal with penalties*/
     
    115105
    116106                /*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();
    128109        }
    129110
     
    137118                }
    138119
    139                 VecAssemblyBegin(pf);
    140                 VecAssemblyEnd(pf);
     120                pf->Assemble();
     121                pf->Assemble();
    141122        }
    142123
    143124        /*Assign output pointers: */
    144125        if(pKff) *pKff=Kff;
    145         else      MatFree(&Kff);
     126        else      delete Kff;
    146127        if(pKfs) *pKfs=Kfs;
    147         else      MatFree(&Kfs);
     128        else      delete Kfs;
    148129        if(ppf)  *ppf=pf;
    149         else      VecFree(&pf);
     130        else      delete pf;
    150131        if(pdf)  *pdf=df;
    151         else      VecFree(&df);
     132        else      delete df;
    152133        if(pkmax) *pkmax=kmax;
    153134}
  • issm/branches/trunk-jpl-damage/src/c/modules/SystemMatricesx/SystemMatricesx.h

    r8799 r11684  
    1010
    1111/* 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,
     12void SystemMatricesx(Matrix** pKff, Matrix** pKfs, Vector** ppf, Vector** pdf, double* pkmax,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,
    1313                        bool kflag=true,bool pflag=true,bool penalty_kflag=true,bool penalty_pflag=true);
    1414
  • issm/branches/trunk-jpl-damage/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.cpp

    r9883 r11684  
    1010#include "../../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vec yg){
     12void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vector* yg){
    1313       
    1414        int configuration_type;
     
    1919
    2020        /*serialize yg, so nodes can index into it: */
    21         VecToMPISerial(&yg_serial,yg);
     21        yg_serial=yg->ToMPISerial();
    2222
    2323        for(int i=0;i<constraints->Size();i++){
  • issm/branches/trunk-jpl-damage/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.h

    r9298 r11684  
    99#include "../../objects/objects.h"
    1010
    11 void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vec yg);
     11void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vector* yg);
    1212
    1313#endif  /* _UPDATESPCSX_H */
  • issm/branches/trunk-jpl-damage/src/c/modules/VecMergex/VecMergex.cpp

    r8809 r11684  
    1010#include "../../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void VecMergex(Vec ug, Vec uf, Nodes* nodes, Parameters* parameters, int SetEnum){
     12void VecMergex(Vector* ug, Vector* uf, Nodes* nodes, Parameters* parameters, int SetEnum){
    1313
    1414        /*variables: */
     
    2121       
    2222        /*serialize uf: */
    23         VecToMPISerial(&uf_serial,uf);
     23        uf_serial=uf->ToMPISerial();
     24
    2425
    2526        /*Do we have any nodes for this configuration? :*/
     
    4344
    4445        /*Assemble vector: */
    45         VecAssemblyBegin(ug);
    46         VecAssemblyEnd(ug);
    47 
     46        ug->Assemble();
    4847}
  • issm/branches/trunk-jpl-damage/src/c/modules/VecMergex/VecMergex.h

    r8799 r11684  
    1010
    1111/* local prototypes: */
    12 void VecMergex(Vec ug, Vec uf, Nodes* nodes, Parameters* parameters, int SetEnum);
     12void VecMergex(Vector* ug, Vector* uf, Nodes* nodes, Parameters* parameters, int SetEnum);
    1313
    1414#endif  /* _VECMERGEX_H */
  • issm/branches/trunk-jpl-damage/src/c/objects/Bamg/Mesh.cpp

    r11093 r11684  
    10281028                                Triangle &t=triangles[i];
    10291029                                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                                        }
    10341036                                }
    10351037                        }
     
    10381040                /*Assign output pointers*/
    10391041                *pindex=index;
    1040                 *pnels=k;
     1042                *pnels=num;
    10411043        }
    10421044        /*}}}1*/
  • issm/branches/trunk-jpl-damage/src/c/objects/Bamg/Triangle.cpp

    r9371 r11684  
    5050        AdjacentTriangle Triangle::Adj(int i)  const {
    5151                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;
    52103        };/*}}}*/
    53104        /*FUNCTION Triangle::Echo {{{1*/
  • issm/branches/trunk-jpl-damage/src/c/objects/Bamg/Triangle.h

    r9371 r11684  
    4141                        //Methods
    4242                        void              Echo();
     43                        double            Anisotropy() const;
     44                        double            Length() const;
    4345                        int               swap(short a1,int=0);
    4446                        long              Optim(short a,int =0);
  • issm/branches/trunk-jpl-damage/src/c/objects/Elements/Element.h

    r11577 r11684  
    1616class Parameters;
    1717class Patch;
     18class Matrix;
     19class Vector;
    1820
    1921#include "../../toolkits/toolkits.h"
     
    2830                virtual void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
    2931                virtual void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
    30                 virtual void   CreateKMatrix(Mat Kff, Mat Kfs,Vec df)=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;
    3436                virtual int    GetNodeIndex(Node* node)=0;
    3537                virtual int    Sid()=0;
     
    5860                virtual void   RequestedOutput(int output_enum,int step,double time)=0;
    5961               
     62                virtual int    NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units)=0;
    6063                virtual void   InputScale(int enum_type,double scale_factor)=0;
    6164                virtual void   GetVectorFromInputs(Vec vector, int name_enum)=0;
     
    8891                virtual void   ElementResponse(double* presponse,int response_enum,bool process_units)=0;
    8992                virtual double IceVolume(void)=0;
    90                 virtual int    NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units)=0;
    9193                #endif
    9294
  • issm/branches/trunk-jpl-damage/src/c/objects/Elements/Penta.cpp

    r11577 r11684  
    567567/*}}}*/
    568568/*FUNCTION Penta::CreateKMatrix {{{1*/
    569 void  Penta::CreateKMatrix(Mat Kff, Mat Kfs,Vec df){
     569void  Penta::CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df){
    570570
    571571        /*retrieve parameters: */
     
    671671/*}}}*/
    672672/*FUNCTION Penta::CreatePVector {{{1*/
    673 void  Penta::CreatePVector(Vec pf){
     673void  Penta::CreatePVector(Vector* pf){
    674674
    675675        /*retrive parameters: */
     
    773773/*}}}*/
    774774/*FUNCTION Penta::CreateJacobianMatrix{{{1*/
    775 void  Penta::CreateJacobianMatrix(Mat Jff){
     775void  Penta::CreateJacobianMatrix(Matrix* Jff){
    776776
    777777        /*retrieve parameters: */
     
    10911091/*}}}*/
    10921092/*FUNCTION Penta::GetSolutionFromInputs{{{1*/
    1093 void  Penta::GetSolutionFromInputs(Vec solution){
     1093void  Penta::GetSolutionFromInputs(Vector* solution){
    10941094
    10951095        int analysis_type;
     
    23312331        extern int my_rank;
    23322332        return my_rank;
     2333}
     2334/*}}}*/
     2335/*FUNCTION Penta::NodalValue {{{1*/
     2336int    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;
    23332364}
    23342365/*}}}*/
     
    30083039}
    30093040/*}}}*/
    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 /*}}}*/
    30413041/*FUNCTION Penta::MinVel{{{1*/
    30423042void  Penta::MinVel(double* pminvel, bool process_units){
     
    41904190/*}}}*/
    41914191/*FUNCTION Penta::GetSolutionFromInputsThermal{{{1*/
    4192 void  Penta::GetSolutionFromInputsThermal(Vec solution){
     4192void  Penta::GetSolutionFromInputsThermal(Vector* solution){
    41934193
    41944194        const int    numdof=NDOF1*NUMVERTICES;
     
    42134213
    42144214        /*Add value to global vector*/
    4215         VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);
     4215        solution->SetValues(numdof,doflist,values,INSERT_VALUES);
    42164216
    42174217        /*Free ressources:*/
     
    42214221/*}}}*/
    42224222/*FUNCTION Penta::GetSolutionFromInputsEnthalpy{{{1*/
    4223 void  Penta::GetSolutionFromInputsEnthalpy(Vec solution){
     4223void  Penta::GetSolutionFromInputsEnthalpy(Vector* solution){
    42244224
    42254225        const int    numdof=NDOF1*NUMVERTICES;
     
    42444244
    42454245        /*Add value to global vector*/
    4246         VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);
     4246        solution->SetValues(numdof,doflist,values,INSERT_VALUES);
    42474247
    42484248        /*Free ressources:*/
     
    78627862/*}}}*/
    78637863/*FUNCTION Penta::GetSolutionFromInputsDiagnosticHoriz{{{1*/
    7864 void  Penta::GetSolutionFromInputsDiagnosticHoriz(Vec solution){
     7864void  Penta::GetSolutionFromInputsDiagnosticHoriz(Vector* solution){
    78657865
    78667866        const int    numdof=NDOF2*NUMVERTICES;
     
    78967896
    78977897        /*Add value to global vector*/
    7898         VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);
     7898        solution->SetValues(numdof,doflist,values,INSERT_VALUES);
    78997899
    79007900        /*Free ressources:*/
     
    79047904/*}}}*/
    79057905/*FUNCTION Penta::GetSolutionFromInputsDiagnosticHutter{{{1*/
    7906 void  Penta::GetSolutionFromInputsDiagnosticHutter(Vec solution){
     7906void  Penta::GetSolutionFromInputsDiagnosticHutter(Vector* solution){
    79077907
    79087908        const int    numdof=NDOF2*NUMVERTICES;
     
    79327932
    79337933        /*Add value to global vector*/
    7934         VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);
     7934        solution->SetValues(numdof,doflist,values,INSERT_VALUES);
    79357935
    79367936        /*Free ressources:*/
     
    79407940/*}}}*/
    79417941/*FUNCTION Penta::GetSolutionFromInputsDiagnosticVert{{{1*/
    7942 void  Penta::GetSolutionFromInputsDiagnosticVert(Vec solution){
     7942void  Penta::GetSolutionFromInputsDiagnosticVert(Vector* solution){
    79437943
    79447944        const int    numdof=NDOF1*NUMVERTICES;
     
    79657965
    79667966        /*Add value to global vector*/
    7967         VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);
     7967        solution->SetValues(numdof,doflist,values,INSERT_VALUES);
    79687968
    79697969        /*Free ressources:*/
     
    79737973/*}}}*/
    79747974/*FUNCTION Penta::GetSolutionFromInputsDiagnosticStokes{{{1*/
    7975 void  Penta::GetSolutionFromInputsDiagnosticStokes(Vec solution){
     7975void  Penta::GetSolutionFromInputsDiagnosticStokes(Vector* solution){
    79767976
    79777977        const int    numdof=NDOF4*NUMVERTICES;
     
    80108010
    80118011        /*Add value to global vector*/
    8012         VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);
     8012        solution->SetValues(numdof,doflist,values,INSERT_VALUES);
    80138013
    80148014        /*Free ressources:*/
  • issm/branches/trunk-jpl-damage/src/c/objects/Elements/Penta.h

    r11577 r11684  
    8686                void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
    8787                void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
    88                 void   CreateKMatrix(Mat Kff, Mat Kfs,Vec df);
    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);
    9191                void   DeleteResults(void);
    9292                int    GetNodeIndex(Node* node);
    93                 void   GetSolutionFromInputs(Vec solution);
     93                void   GetSolutionFromInputs(Vector* solution);
    9494                double GetZcoord(GaussPenta* gauss);
    9595                void   GetVectorFromInputs(Vec vector,int name_enum);
     
    118118                void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
    119119                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);
    120121                double TimeAdapt();
    121122                int*   GetHorizontalNeighboorSids(void);
     
    129130                void   MinVy(double* pminvy, bool process_units);
    130131                void   MinVz(double* pminvz, bool process_units);
    131                 int    NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units);
    132132                double MassFlux(double* segment,bool process_units);
    133133                void   MaxAbsVx(double* pmaxabsvx, bool process_units);
     
    183183                void    GetInputValue(double* pvalue,Node* node,int enumtype);
    184184                void      GetPhi(double* phi, double*  epsilon, double viscosity);
    185                 void      GetSolutionFromInputsEnthalpy(Vec solutiong);
     185                void      GetSolutionFromInputsEnthalpy(Vector* solutiong);
    186186                double  GetStabilizationParameter(double u, double v, double w, double diameter, double kappa);
    187187                void    GetStrainRate3dPattyn(double* epsilon,double* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input);
     
    250250                void           InputUpdateFromSolutionDiagnosticVert( double* solutiong);
    251251                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);
    256256                ElementVector* CreatePVectorCouplingMacAyealStokes(void);
    257257                ElementVector* CreatePVectorCouplingMacAyealStokesViscous(void);
     
    307307                ElementVector* CreatePVectorThermalShelf(void);
    308308                ElementVector* CreatePVectorThermalSheet(void);
    309                 void           GetSolutionFromInputsThermal(Vec solutiong);
     309                void           GetSolutionFromInputsThermal(Vector* solutiong);
    310310                void           InputUpdateFromSolutionThermal( double* solutiong);
    311311                void           InputUpdateFromSolutionEnthalpy( double* solutiong);
  • issm/branches/trunk-jpl-damage/src/c/objects/Elements/Tria.cpp

    r11577 r11684  
    319319/*}}}*/
    320320/*FUNCTION Tria::CreateKMatrix {{{1*/
    321 void  Tria::CreateKMatrix(Mat Kff, Mat Kfs,Vec df){
     321void  Tria::CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df){
    322322
    323323        /*retreive parameters: */
     
    672672/*}}}*/
    673673/*FUNCTION Tria::CreatePVector {{{1*/
    674 void  Tria::CreatePVector(Vec pf){
     674void  Tria::CreatePVector(Vector* pf){
    675675
    676676        /*retrive parameters: */
     
    892892/*}}}*/
    893893/*FUNCTION Tria::CreateJacobianMatrix{{{1*/
    894 void  Tria::CreateJacobianMatrix(Mat Jff){
     894void  Tria::CreateJacobianMatrix(Matrix* Jff){
    895895
    896896        /*retrieve parameters: */
     
    12741274/*}}}*/
    12751275/*FUNCTION Tria::GetSolutionFromInputs{{{1*/
    1276 void  Tria::GetSolutionFromInputs(Vec solution){
     1276void  Tria::GetSolutionFromInputs(Vector* solution){
    12771277
    12781278        /*retrive parameters: */
     
    21242124}
    21252125/*}}}*/
     2126/*FUNCTION Tria::NodalValue {{{1*/
     2127int    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/*}}}*/
    21262157/*FUNCTION Tria::PatchFill{{{1*/
    21272158void  Tria::PatchFill(int* prow, Patch* patch){
     
    27402771}
    27412772/*}}}*/
    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 /*}}}*/
    27732773/*FUNCTION Tria::ElementResponse{{{1*/
    27742774void Tria::ElementResponse(double* presponse,int response_enum,bool process_units){
     
    31433143/*}}}*/
    31443144/*FUNCTION Tria::GetSolutionFromInputsDiagnosticHoriz{{{1*/
    3145 void  Tria::GetSolutionFromInputsDiagnosticHoriz(Vec solution){
     3145void  Tria::GetSolutionFromInputsDiagnosticHoriz(Vector* solution){
    31463146
    31473147        const int    numdof=NDOF2*NUMVERTICES;
     
    31743174        }
    31753175
    3176         VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);
     3176        solution->SetValues(numdof,doflist,values,INSERT_VALUES);
    31773177
    31783178        /*Free ressources:*/
     
    31823182/*}}}*/
    31833183/*FUNCTION Tria::GetSolutionFromInputsDiagnosticHutter{{{1*/
    3184 void  Tria::GetSolutionFromInputsDiagnosticHutter(Vec solution){
     3184void  Tria::GetSolutionFromInputsDiagnosticHutter(Vector* solution){
    31853185
    31863186        const int    numdof=NDOF2*NUMVERTICES;
     
    32133213        }
    32143214
    3215         VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);
     3215        solution->SetValues(numdof,doflist,values,INSERT_VALUES);
    32163216
    32173217        /*Free ressources:*/
     
    49854985}
    49864986/*}}}*/
     4987
    49874988/*FUNCTION Tria::InputUpdateFromSolutionAdjointBalancethickness {{{1*/
    49884989void  Tria::InputUpdateFromSolutionAdjointBalancethickness(double* solution){
     
    52895290/*}}}*/
    52905291/*FUNCTION Tria::GetSolutionFromInputsHydrology{{{1*/
    5291 void  Tria::GetSolutionFromInputsHydrology(Vec solution){
     5292void  Tria::GetSolutionFromInputsHydrology(Vector* solution){
    52925293
    52935294        const int    numdof=NDOF1*NUMVERTICES;
     
    53175318        }
    53185319
    5319         VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);
     5320        solution->SetValues(numdof,doflist,values,INSERT_VALUES);
    53205321
    53215322        /*Free ressources:*/
  • issm/branches/trunk-jpl-damage/src/c/objects/Elements/Tria.h

    r11577 r11684  
    8282                void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
    8383                void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
    84                 void   CreateKMatrix(Mat Kff, Mat Kfs,Vec df);
    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);
    8787                int    GetNodeIndex(Node* node);
    8888                int    Sid();
     
    9292                bool   IsNodeOnShelfFromFlags(double* flags);
    9393                bool   IsOnWater();
    94                 void   GetSolutionFromInputs(Vec solution);
     94                void   GetSolutionFromInputs(Vector* solution);
    9595                void   GetVectorFromInputs(Vec vector, int name_enum);
    9696                void   GetVectorFromResults(Vec vector,int offset,int interp);
     
    106106                void   MaterialUpdateFromTemperature(void){_error_("not implemented yet");};
    107107                void   MigrateGroundingLine(double* oldfloating,double* sheet_ungrounding);
     108                int    NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units);
    108109                void   PotentialSheetUngrounding(Vec potential_sheet_ungrounding);
    109110                void   PositiveDegreeDay(void);
     
    127128                void   MinVy(double* pminvy, bool process_units);
    128129                void   MinVz(double* pminvz, bool process_units);
    129                 int    NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units);
    130130                double MassFlux(double* segment,bool process_units);
    131131                void   MaxAbsVx(double* pmaxabsvx, bool process_units);
     
    212212                ElementVector* CreatePVectorDiagnosticHutter(void);
    213213                ElementMatrix* CreateJacobianDiagnosticMacayeal(void);
    214                 void      GetSolutionFromInputsDiagnosticHoriz(Vec solution);
    215                 void      GetSolutionFromInputsDiagnosticHutter(Vec solution);
     214                void      GetSolutionFromInputsDiagnosticHoriz(Vector* solution);
     215                void      GetSolutionFromInputsDiagnosticHutter(Vector* solution);
    216216                void      InputUpdateFromSolutionDiagnosticHoriz( double* solution);
    217217                void      InputUpdateFromSolutionDiagnosticHutter( double* solution);
     
    232232                ElementVector* CreatePVectorHydrology(void);
    233233                void      CreateHydrologyWaterVelocityInput(void);
    234                 void      GetSolutionFromInputsHydrology(Vec solution);
     234                void      GetSolutionFromInputsHydrology(Vector* solution);
    235235                void      InputUpdateFromSolutionHydrology(double* solution);
    236236                #endif
  • issm/branches/trunk-jpl-damage/src/c/objects/Loads/Icefront.cpp

    r11332 r11684  
    316316/*}}}*/
    317317/*FUNCTION Icefront::CreateKMatrix {{{1*/
    318 void  Icefront::CreateKMatrix(Mat Kff, Mat Kfs){
     318void  Icefront::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
    319319
    320320        /*No stiffness loads applied, do nothing: */
     
    324324/*}}}*/
    325325/*FUNCTION Icefront::CreatePVector {{{1*/
    326 void  Icefront::CreatePVector(Vec pf){
     326void  Icefront::CreatePVector(Vector* pf){
    327327
    328328        /*Checks in debugging mode*/
     
    362362/*}}}*/
    363363/*FUNCTION Icefront::CreateJacobianMatrix{{{1*/
    364 void  Icefront::CreateJacobianMatrix(Mat Jff){
     364void  Icefront::CreateJacobianMatrix(Matrix* Jff){
    365365        this->CreateKMatrix(Jff,NULL);
    366366}
    367367/*}}}1*/
    368368/*FUNCTION Icefront::PenaltyCreateKMatrix {{{1*/
    369 void  Icefront::PenaltyCreateKMatrix(Mat Kff, Mat Kfs, double kmax){
     369void  Icefront::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs, double kmax){
    370370        /*do nothing: */
    371371        return;
     
    373373/*}}}*/
    374374/*FUNCTION Icefront::PenaltyCreatePVector{{{1*/
    375 void  Icefront::PenaltyCreatePVector(Vec pf,double kmax){
     375void  Icefront::PenaltyCreatePVector(Vector* pf,double kmax){
    376376        /*do nothing: */
    377377        return;
     
    379379/*}}}*/
    380380/*FUNCTION Icefront::PenaltyCreateJacobianMatrix{{{1*/
    381 void  Icefront::PenaltyCreateJacobianMatrix(Mat Jff,double kmax){
     381void  Icefront::PenaltyCreateJacobianMatrix(Matrix* Jff,double kmax){
    382382        this->PenaltyCreateKMatrix(Jff,NULL,kmax);
    383383}
  • issm/branches/trunk-jpl-damage/src/c/objects/Loads/Icefront.h

    r11332 r11684  
    7474                void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    7575                void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    76                 void  CreateKMatrix(Mat Kff, Mat Kfs);
    77                 void  CreatePVector(Vec pf);
    78                 void  CreateJacobianMatrix(Mat Jff);
    79                 void  PenaltyCreateKMatrix(Mat Kff, Mat kfs, 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);
    8282                bool  InAnalysis(int analysis_type);
    8383                /*}}}*/
  • issm/branches/trunk-jpl-damage/src/c/objects/Loads/Load.h

    r11327 r11684  
    1212/*{{{1*/
    1313class Object;
     14class Matrix;
     15class Vector;
    1416
    1517#include "../Object.h"
     
    2729                virtual void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
    2830                virtual void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
    29                 virtual void  CreateKMatrix(Mat Kff, Mat Kfs)=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, Mat Kfs, 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;
    3537                virtual bool  InAnalysis(int analysis_type)=0;
    3638                /*}}}*/
  • issm/branches/trunk-jpl-damage/src/c/objects/Loads/Numericalflux.cpp

    r10135 r11684  
    334334/*}}}*/
    335335/*FUNCTION Numericalflux::CreateKMatrix {{{1*/
    336 void  Numericalflux::CreateKMatrix(Mat Kff, Mat Kfs){
     336void  Numericalflux::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
    337337
    338338        /*recover some parameters*/
     
    365365/*}}}*/
    366366/*FUNCTION Numericalflux::CreatePVector {{{1*/
    367 void  Numericalflux::CreatePVector(Vec pf){
     367void  Numericalflux::CreatePVector(Vector* pf){
    368368
    369369        /*recover some parameters*/
     
    395395/*}}}*/
    396396/*FUNCTION Numericalflux::PenaltyCreateKMatrix {{{1*/
    397 void  Numericalflux::PenaltyCreateKMatrix(Mat Kff, Mat Kfs,double kmax){
     397void  Numericalflux::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,double kmax){
    398398
    399399        /*No stiffness loads applied, do nothing: */
     
    403403/*}}}*/
    404404/*FUNCTION Numericalflux::PenaltyCreatePVector{{{1*/
    405 void  Numericalflux::PenaltyCreatePVector(Vec pf,double kmax){
     405void  Numericalflux::PenaltyCreatePVector(Vector* pf,double kmax){
    406406
    407407        /*No penalty loads applied, do nothing: */
  • issm/branches/trunk-jpl-damage/src/c/objects/Loads/Numericalflux.h

    r11327 r11684  
    7070                void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    7171                void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    72                 void  CreateKMatrix(Mat Kff, Mat Kfs);
    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, Mat kfs, 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);
    7878                bool  InAnalysis(int analysis_type);
    7979                /*}}}*/
  • issm/branches/trunk-jpl-damage/src/c/objects/Loads/Pengrid.cpp

    r10576 r11684  
    295295/*}}}1*/
    296296/*FUNCTION Pengrid::CreateKMatrix {{{1*/
    297 void  Pengrid::CreateKMatrix(Mat Kff, Mat Kfs){
     297void  Pengrid::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
    298298
    299299        /*No loads applied, do nothing: */
     
    303303/*}}}1*/
    304304/*FUNCTION Pengrid::CreatePVector {{{1*/
    305 void  Pengrid::CreatePVector(Vec pf){
     305void  Pengrid::CreatePVector(Vector* pf){
    306306
    307307        /*No loads applied, do nothing: */
     
    311311/*}}}1*/
    312312/*FUNCTION Pengrid::PenaltyCreateMatrix {{{1*/
    313 void  Pengrid::PenaltyCreateKMatrix(Mat Kff, Mat Kfs,double kmax){
     313void  Pengrid::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,double kmax){
    314314
    315315        /*Retrieve parameters: */
     
    319319
    320320        switch(analysis_type){
     321                #ifdef _HAVE_DIAGNOSTIC_
    321322                case DiagnosticHorizAnalysisEnum: case AdjointHorizAnalysisEnum:
    322323                        Ke=PenaltyCreateKMatrixDiagnosticStokes(kmax);
    323324                        break;
     325                #endif
     326                #ifdef _HAVE_THERMAL_
    324327                case ThermalAnalysisEnum:
    325328                        Ke=PenaltyCreateKMatrixThermal(kmax);
     
    328331                        Ke=PenaltyCreateKMatrixMelting(kmax);
    329332                        break;
     333                #endif
    330334                default:
    331335                        _error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
     
    340344/*}}}1*/
    341345/*FUNCTION Pengrid::PenaltyCreatePVector {{{1*/
    342 void  Pengrid::PenaltyCreatePVector(Vec pf,double kmax){
     346void  Pengrid::PenaltyCreatePVector(Vector* pf,double kmax){
    343347
    344348        /*Retrieve parameters: */
     
    348352
    349353        switch(analysis_type){
     354                #ifdef _HAVE_DIAGNOSTIC_
    350355                case ThermalAnalysisEnum:
    351356                        pe=PenaltyCreatePVectorThermal(kmax);
    352357                        break;
     358                #endif
     359                #ifdef _HAVE_THERMAL_
    353360                case MeltingAnalysisEnum:
    354361                        pe=PenaltyCreatePVectorMelting(kmax);
     
    356363                case DiagnosticHorizAnalysisEnum: case AdjointHorizAnalysisEnum:
    357364                        break;
     365                #endif
    358366                default:
    359367                        _error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
     
    539547}
    540548/*}}}1*/
     549#ifdef _HAVE_DIAGNOSTIC_
    541550/*FUNCTION Pengrid::PenaltyCreateKMatrixDiagnosticStokes {{{1*/
    542551ElementMatrix* Pengrid::PenaltyCreateKMatrixDiagnosticStokes(double kmax){
     
    571580}
    572581/*}}}1*/
     582#endif
     583#ifdef _HAVE_THERMAL_
    573584/*FUNCTION Pengrid::PenaltyCreateKMatrixMelting {{{1*/
    574585ElementMatrix* Pengrid::PenaltyCreateKMatrixMelting(double kmax){
     
    690701}
    691702/*}}}1*/
     703#endif
    692704/*FUNCTION Pengrid::ResetConstraint {{{1*/
    693705void  Pengrid::ResetConstraint(void){
  • issm/branches/trunk-jpl-damage/src/c/objects/Loads/Pengrid.h

    r11327 r11684  
    7575                void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    7676                void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    77                 void  CreateKMatrix(Mat Kff, Mat Kfs);
    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, Mat kfs, 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);
    8383                bool  InAnalysis(int analysis_type);
    8484                /*}}}*/
    8585                /*Pengrid management {{{1*/
     86                #ifdef _HAVE_DIAGNOSTIC_
    8687                ElementMatrix* PenaltyCreateKMatrixDiagnosticStokes(double kmax);
     88                #endif
     89                #ifdef _HAVE_THERMAL_
    8790                ElementMatrix* PenaltyCreateKMatrixThermal(double kmax);
    8891                ElementMatrix* PenaltyCreateKMatrixMelting(double kmax);
    8992                ElementVector* PenaltyCreatePVectorThermal(double kmax);
    9093                ElementVector* PenaltyCreatePVectorMelting(double kmax);
     94                #endif
    9195                void  ConstraintActivate(int* punstable);
    9296                void  ConstraintActivateThermal(int* punstable);
  • issm/branches/trunk-jpl-damage/src/c/objects/Loads/Penpair.cpp

    r11332 r11684  
    199199/*}}}1*/
    200200/*FUNCTION Penpair::CreateKMatrix {{{1*/
    201 void  Penpair::CreateKMatrix(Mat Kff, Mat Kfs){
     201void  Penpair::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
    202202        /*If you code this piece, don't forget that a penalty will be inactive if it is dealing with clone nodes*/
    203203        /*No loads applied, do nothing: */
     
    207207/*}}}1*/
    208208/*FUNCTION Penpair::CreatePVector {{{1*/
    209 void  Penpair::CreatePVector(Vec pf){
     209void  Penpair::CreatePVector(Vector* pf){
    210210
    211211        /*No loads applied, do nothing: */
     
    215215/*}}}1*/
    216216/*FUNCTION Penpair::CreateJacobianMatrix{{{1*/
    217 void  Penpair::CreateJacobianMatrix(Mat Jff){
     217void  Penpair::CreateJacobianMatrix(Matrix* Jff){
    218218        this->CreateKMatrix(Jff,NULL);
    219219}
    220220/*}}}1*/
    221221/*FUNCTION Penpair::PenaltyCreateKMatrix {{{1*/
    222 void  Penpair::PenaltyCreateKMatrix(Mat Kff, Mat Kfs,double kmax){
     222void  Penpair::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,double kmax){
    223223
    224224        /*Retrieve parameters: */
     
    246246/*}}}1*/
    247247/*FUNCTION Penpair::PenaltyCreatePVector {{{1*/
    248 void  Penpair::PenaltyCreatePVector(Vec pf,double kmax){
     248void  Penpair::PenaltyCreatePVector(Vector* pf,double kmax){
    249249        /*No loads applied, do nothing: */
    250250        return;
     
    252252/*}}}1*/
    253253/*FUNCTION Penpair::PenaltyCreateJacobianMatrix{{{1*/
    254 void  Penpair::PenaltyCreateJacobianMatrix(Mat Jff,double kmax){
     254void  Penpair::PenaltyCreateJacobianMatrix(Matrix* Jff,double kmax){
    255255        this->PenaltyCreateKMatrix(Jff,NULL,kmax);
    256256}
  • issm/branches/trunk-jpl-damage/src/c/objects/Loads/Penpair.h

    r11327 r11684  
    6262                void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    6363                void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    64                 void  CreateKMatrix(Mat Kff, Mat Kfs);
    65                 void  CreatePVector(Vec pf);
    66                 void  CreateJacobianMatrix(Mat Jff);
    67                 void  PenaltyCreateKMatrix(Mat Kff,Mat Kfs,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);
    7070                bool  InAnalysis(int analysis_type);
    7171                /*}}}*/
  • issm/branches/trunk-jpl-damage/src/c/objects/Loads/Riftfront.cpp

    r11294 r11684  
    428428/*}}}*/
    429429/*FUNCTION Riftfront::PenaltyCreateKMatrix {{{1*/
    430 void  Riftfront::PenaltyCreateKMatrix(Mat Kff, Mat Kfs,double kmax){
     430void  Riftfront::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,double kmax){
    431431
    432432        /*Retrieve parameters: */
     
    454454/*}}}1*/
    455455/*FUNCTION Riftfront::PenaltyCreatePVector {{{1*/
    456 void  Riftfront::PenaltyCreatePVector(Vec pf,double kmax){
     456void  Riftfront::PenaltyCreatePVector(Vector* pf,double kmax){
    457457
    458458        /*Retrieve parameters: */
     
    480480/*}}}1*/
    481481/*FUNCTION Riftfront::CreateKMatrix {{{1*/
    482 void  Riftfront::CreateKMatrix(Mat Kff, Mat Kfs){
     482void  Riftfront::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
    483483        /*do nothing: */
    484484        return;
     
    486486/*}}}1*/
    487487/*FUNCTION Riftfront::CreatePVector {{{1*/
    488 void  Riftfront::CreatePVector(Vec pf){
     488void  Riftfront::CreatePVector(Vector* pf){
    489489        /*do nothing: */
    490490        return;
  • issm/branches/trunk-jpl-damage/src/c/objects/Loads/Riftfront.h

    r11327 r11684  
    8282                void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    8383                void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    84                 void  CreateKMatrix(Mat Kff, Mat Kfs);
    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, Mat kfs, 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);
    9090                bool  InAnalysis(int analysis_type);
    9191                /*}}}*/
  • issm/branches/trunk-jpl-damage/src/c/objects/Node.cpp

    r11001 r11684  
    594594/*}}}*/
    595595/*FUNCTION Node::CreateNodalConstraints{{{1*/
    596 void  Node::CreateNodalConstraints(Vec ys){
     596void  Node::CreateNodalConstraints(Vector* ys){
    597597
    598598        int i;
     
    613613               
    614614                /*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);
    616616        }
    617617
     
    875875/*}}}*/
    876876/*FUNCTION Node::VecMerge {{{1*/
    877 void   Node::VecMerge(Vec ug, double* vector_serial,int setenum){
     877void   Node::VecMerge(Vector* ug, double* vector_serial,int setenum){
    878878
    879879        double* values=NULL;
     
    897897
    898898                        /*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);
    900900                }
    901901        }
     
    915915
    916916                        /*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);
    918918                }
    919919        }
     
    926926/*}}}*/
    927927/*FUNCTION Node::VecReduce {{{1*/
    928 void   Node::VecReduce(Vec vector, double* ug_serial,int setenum){
     928void   Node::VecReduce(Vector* vector, double* ug_serial,int setenum){
    929929
    930930        double* values=NULL;
     
    945945
    946946                        /*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);
    948948                }
    949949        }
     
    961961
    962962                        /*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);
    964964                }
    965965        }
  • issm/branches/trunk-jpl-damage/src/c/objects/Node.h

    r10576 r11684  
    1616class  DataSet;
    1717class  Vertices;
     18class  Vector;
     19class  Matrix;
    1820#include "./Update.h"
    1921/*}}}*/
     
    6769                /*Node numerical routines {{{1*/
    6870                void   Configure(DataSet* nodes,Vertices* vertices);
    69                 void   CreateNodalConstraints(Vec ys);
     71                void   CreateNodalConstraints(Vector* ys);
    7072                void   SetCurrentConfiguration(DataSet* nodes,Vertices* vertices);
    7173                int    Sid(void);
     
    101103                int    IsGrounded();
    102104                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);
    105107               
    106108                /*}}}*/
  • issm/branches/trunk-jpl-damage/src/c/objects/Numerics/ElementMatrix.cpp

    r11327 r11684  
    245245
    246246/*ElementMatrix specific routines: */
    247 /*FUNCTION ElementMatrix::AddToGlobal(Mat Kff, Mat Kfs){{{1*/
    248 void ElementMatrix::AddToGlobal(Mat Kff, Mat Kfs){
     247/*FUNCTION ElementMatrix::AddToGlobal(Matrix* Kff, Matrix* Kfs){{{1*/
     248void ElementMatrix::AddToGlobal(Matrix* Kff, Matrix* Kfs){
    249249
    250250        int i,j;
     
    260260        this->CheckConsistency();
    261261
    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                                        }
    271273                                }
     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);
    272279                        }
    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                                        }
    287289                                }
     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);
    288295                        }
    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*/
     307void ElementMatrix::AddToGlobal(Matrix* Jff){
    304308
    305309        int i,j;
     
    312316        this->CheckConsistency();
    313317
    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                                        }
    323329                                }
     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);
    324335                        }
    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
    336344
    337345}
  • issm/branches/trunk-jpl-damage/src/c/objects/Numerics/ElementMatrix.h

    r11322 r11684  
    5858                /*}}}*/
    5959                /*ElementMatrix specific routines {{{1*/
    60                 void AddToGlobal(Mat Kff, Mat Kfs);
    61                 void AddToGlobal(Mat Jff);
     60                void AddToGlobal(Matrix* Kff, Matrix* Kfs);
     61                void AddToGlobal(Matrix* Jff);
    6262                void Echo(void);
    6363                void CheckConsistency(void);
  • issm/branches/trunk-jpl-damage/src/c/objects/Numerics/ElementVector.cpp

    r9320 r11684  
    160160
    161161/*ElementVector specific routines: */
    162 /*FUNCTION ElementVector::AddToGlobal(Vec pf){{{1*/
    163 void ElementVector::AddToGlobal(Vec pf){
     162/*FUNCTION ElementVector::AddToGlobal(Vector* pf){{{1*/
     163void ElementVector::AddToGlobal(Vector* pf){
    164164
    165165        int i;
    166166        double* localvalues=NULL;
    167167
    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*/
     188void ElementVector::InsertIntoGlobal(Vector* pf){
    184189
    185190        int i;
    186191        double* localvalues=NULL;
    187192
    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
    200210}
    201211/*}}}*/
  • issm/branches/trunk-jpl-damage/src/c/objects/Numerics/ElementVector.h

    r8800 r11684  
    4040                /*}}}*/
    4141                /*ElementVector specific routines {{{1*/
    42                 void AddToGlobal(Vec pf);
    43                 void InsertIntoGlobal(Vec pf);
     42                void AddToGlobal(Vector* pf);
     43                void InsertIntoGlobal(Vector* pf);
    4444                void Echo(void);
    4545                void Init(ElementVector* pe);
  • issm/branches/trunk-jpl-damage/src/c/objects/objects.h

    r11295 r11684  
    120120#include "./Numerics/ElementMatrix.h"
    121121#include "./Numerics/ElementVector.h"
     122#include "./Numerics/Vector.h"
     123#include "./Numerics/Matrix.h"
    122124
    123125/*Params: */
  • issm/branches/trunk-jpl-damage/src/c/shared/Alloc/alloc.cpp

    r9320 r11684  
    2929#include "../Exceptions/exceptions.h"
    3030#include "../../include/include.h"
     31#include "../../objects/objects.h"
    3132
    3233void* xmalloc(int size){
     
    8081}
    8182
     83void xdelete( Matrix** pv){
     84
     85        if (pv && *pv) {
     86
     87                delete *pv;
     88                *pv=NULL;
     89        }
     90}
     91
     92void xdelete( Vector** pv){
     93
     94        if (pv && *pv) {
     95
     96                delete *pv;
     97                *pv=NULL;
     98        }
     99}
     100
     101
    82102void* xrealloc ( void* pv, int size){
    83103       
  • issm/branches/trunk-jpl-damage/src/c/shared/Alloc/alloc.h

    r5768 r11684  
    55#ifndef _ALLOC_H_
    66#define _ALLOC_H_
    7 
     7class Matrix;
     8class Vector;
    89void* xmalloc(int size);
    910void* xcalloc(int n,int size);
    1011void  xfree(void** pvptr);
    1112void* xrealloc ( void* pv, int size);
     13void xdelete(Matrix** pvptr);
     14void xdelete(Vector** pvptr);
    1215
    1316#endif
  • issm/branches/trunk-jpl-damage/src/c/shared/Elements/elements.h

    r11197 r11684  
    1717int*   GetLocalDofList( Node** nodes,int numnodes,int setenum,int approximation_enum);
    1818int*   GetGlobalDofList(Node** nodes,int numnodes,int setenum,int approximation_enum);
     19#ifdef _HAVE_DIAGNOSTIC_
    1920void   CoordinateSystemTransform(double** ptransform,Node** nodes,int numnodes,int* cs_array);
    20 #ifdef _HAVE_DIAGNOSTIC_
    2121void   TransformInvStiffnessMatrixCoord(ElementMatrix* Ke,Node** nodes,int numnodes,int cs_enum);
    2222void   TransformInvStiffnessMatrixCoord(ElementMatrix* Ke,Node** nodes,int numnodes,int* cs_array);
  • issm/branches/trunk-jpl-damage/src/c/solutions/AnalysisConfiguration.cpp

    r11354 r11684  
    3838
    3939                case SteadystateSolutionEnum:
    40                         numanalyses=7;
     40                        numanalyses=8;
    4141                        analyses=(int*)xmalloc(numanalyses*sizeof(int));
    4242                        analyses[0]=DiagnosticHorizAnalysisEnum;
     
    4545                        analyses[3]=SurfaceSlopeAnalysisEnum;
    4646                        analyses[4]=BedSlopeAnalysisEnum;
    47                         analyses[5]=ThermalAnalysisEnum;
    48                         analyses[6]=MeltingAnalysisEnum;
     47                        analyses[5]=EnthalpyAnalysisEnum;
     48                        analyses[6]=ThermalAnalysisEnum;
     49                        analyses[7]=MeltingAnalysisEnum;
    4950                        break;
    5051
  • issm/branches/trunk-jpl-damage/src/c/solutions/ResetBoundaryConditions.cpp

    r9761 r11684  
    1111       
    1212        /*variables: */
    13         Vec    yg    = NULL;
     13        Vector*    yg    = NULL;
    1414        Nodes *nodes = NULL;
    1515        int    i;
     
    3030
    3131        /*Free ressources:*/
    32         VecFree(&yg);
     32        delete yg;
    3333}
  • issm/branches/trunk-jpl-damage/src/c/solutions/convergence.cpp

    r11285 r11684  
    88#include "../EnumDefinitions/EnumDefinitions.h"
    99
    10 void convergence(bool* pconverged, Mat Kff,Vec pf,Vec uf,Vec old_uf,Parameters* parameters){
     10void convergence(bool* pconverged, Matrix* Kff,Vector* pf,Vector* uf,Vector* old_uf,Parameters* parameters){
    1111
    1212        /*output*/
     
    1414
    1515        /*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;
    2121        double ndu,nduinf,nu;
    2222        double nKUF;
     
    4848
    4949                //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);
    5252
    5353                //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);
    5656                solver_residue=nKUF/nF;
    5757                _printf_(true,"\n%s%g\n","   solver residue: norm(KU-F)/norm(F)=",solver_residue);
    5858
    5959                //clean up
    60                 VecFree(&KU);
    61                 VecFree(&KUF);
     60                delete KU;
     61                delete KUF;
    6262        }
    6363
     
    6565
    6666        //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);
    7171        res=nKUoldF/nF;
    7272        if (isnan(res)){
     
    7676
    7777        //clean up
    78         VecFree(&KUold);
    79         VecFree(&KUoldF);
     78        delete KUold;
     79        delete KUoldF;
    8080
    8181        //print
     
    9393
    9494                //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);
    9797
    9898                if (isnan(ndu) || isnan(nu)) _error_("convergence criterion is NaN!");
    9999
    100100                //clean up
    101                 VecFree(&duf);
     101                delete duf;
    102102
    103103                //print
     
    119119
    120120                //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);
    123123                if (isnan(ndu) || isnan(nu)) _error_("convergence criterion is NaN!");
    124124
    125125                //clean up
    126                 VecFree(&duf);
     126                delete duf;
    127127
    128128                //print
  • issm/branches/trunk-jpl-damage/src/c/solutions/solutions.h

    r11306 r11684  
    3535
    3636//convergence:
    37 void convergence(bool* pconverged, Mat K_ff,Vec p_f,Vec u_f,Vec u_f_old,Parameters* parameters);
     37void convergence(bool* pconverged, Matrix* K_ff,Vector* p_f,Vector* u_f,Vector* u_f_old,Parameters* parameters);
    3838bool controlconvergence(double J,double tol_cm);
    3939bool steadystateconvergence(FemModel* femmodel);
  • issm/branches/trunk-jpl-damage/src/c/solutions/steadystate_core.cpp

    r9880 r11684  
    2525
    2626        /*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;
    3131        int  numoutputs         = 0;
    3232        int  *requested_outputs = NULL;
     
    3838        femmodel->parameters->FindParam(&maxiter,SteadystateMaxiterEnum);
    3939        femmodel->parameters->FindParam(&numoutputs,SteadystateNumRequestedOutputsEnum);
     40        femmodel->parameters->FindParam(&isenthalpy,ThermalIsenthalpyEnum);
    4041        if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,SteadystateRequestedOutputsEnum);
    4142
     
    4748                _printf_(VerboseSolution(),"%s%i\n","   computing temperature and velocity for step: ",step);
    4849                #ifdef _HAVE_THERMAL_
    49                 thermal_core(femmodel);
     50                if(isenthalpy==0){
     51                        thermal_core(femmodel);
     52                }
     53                else{
     54                        enthalpy_core(femmodel);
     55                }
    5056                #else
    5157                _error_("ISSM was not compiled with thermal capabilities. Exiting");
     
    8389                InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum);
    8490                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);
    8694                RequestedOutputsx(femmodel->results,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,requested_outputs,numoutputs);
    8795        }
  • issm/branches/trunk-jpl-damage/src/c/solvers/solver_adjoint_linear.cpp

    r9271 r11684  
    1313
    1414        /*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;
    2022        int  configuration_type;
    2123
     
    2628        SystemMatricesx(&Kff, &Kfs, &pf, &df, NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
    2729        CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
    28         Reduceloadx(pf, Kfs, ys,true); MatFree(&Kfs); //true means spc = 0
    29         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 spc0
     30        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
    3133        InputUpdateFromSolutionx(femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,ug);
    32         VecFree(&ug); VecFree(&uf);
     34        xdelete(&ug); xdelete(&uf);
    3335}
  • issm/branches/trunk-jpl-damage/src/c/solvers/solver_linear.cpp

    r9225 r11684  
    1111
    1212        /*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;
    1920        int  configuration_type;
    2021
     
    2526        SystemMatricesx(&Kff, &Kfs, &pf, &df, NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
    2627        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);
    3032        InputUpdateFromSolutionx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,ug);
    31         VecFree(&ug); VecFree(&uf);
     33        xdelete(&ug);  xdelete(&uf);
    3234}
  • issm/branches/trunk-jpl-damage/src/c/solvers/solver_newton.cpp

    r11338 r11684  
    1818        int    count;
    1919        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;
    2632
    2733        /*parameters:*/
     
    4753        for(;;){
    4854
    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;
    5157
    5258                /*Solver forward model*/
    5359                SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
    5460                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);
    5965
    6066                /*Check convergence*/
    6167                convergence(&converged,Kff,pf,uf,old_uf,femmodel->parameters);
    62                 MatFree(&Kff);VecFree(&pf);
     68                xdelete(&Kff); xdelete(&pf);
    6369                if(converged==true) break;
    6470                if(count>=max_nonlinear_iterations){
     
    7076                SystemMatricesx(&Kff,&Kfs,&pf,NULL,&kmax,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
    7177                CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
    72                 Reduceloadx(pf,Kfs,ys);   MatFree(&Kfs);
     78                Reduceloadx(pf,Kfs,ys);   xdelete(&Kfs);
    7379
    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);
    7882
    7983                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);
    8387                InputUpdateFromSolutionx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,ug);
    8488
     
    8993
    9094        /*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);
    9599}
  • issm/branches/trunk-jpl-damage/src/c/solvers/solver_nonlinear.cpp

    r11347 r11684  
    1414
    1515        /*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;
    2225       
    2326        Loads* loads=NULL;
     
    5659
    5760                //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;
    6063
    6164                SystemMatricesx(&Kff, &Kfs, &pf, &df, NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,loads,femmodel->materials,femmodel->parameters);
    6265                CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
    63                 Reduceloadx(pf, Kfs, ys); MatFree(&Kfs);
     66                Reduceloadx(pf, Kfs, ys); xdelete(&Kfs);
    6467                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);
    6669
    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);
    6871                InputUpdateFromConstantx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,converged,ConvergedEnum);
    6972                InputUpdateFromSolutionx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,ug);
     
    9699        /*clean-up*/
    97100        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);
    102105}
  • issm/branches/trunk-jpl-damage/src/c/solvers/solver_stokescoupling_nonlinear.cpp

    r11284 r11684  
    1414
    1515        /*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;
    2530        bool converged;
    2631        int  constraints_converged;
     
    5459                //Update once again the solution to make sure that vx and vxold are similar (for next step in transient or steadystate)
    5560                InputUpdateFromSolutionx(femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,ug_horiz);
    56                 VecFree(&ug_horiz);
     61                xdelete(&ug_horiz);
    5762
    5863                //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;
    6065
    6166                /*solve: */
    6267                SystemMatricesx(&Kff_horiz, &Kfs_horiz, &pf_horiz, &df_horiz, NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
    6368                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);
    6570                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);
    6772                InputUpdateFromSolutionx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,ug_horiz);
    6873
    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);
    7075
    7176                /*Second compute vertical velocity: */
     
    7681                SystemMatricesx(&Kff_vert, &Kfs_vert, &pf_vert,  &df_vert,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
    7782                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);
    8186                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);
    8388
    8489                /*Increase count: */
     
    9297
    9398        /*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);
    98103}
  • issm/branches/trunk-jpl-damage/src/c/solvers/solver_thermal_nonlinear.cpp

    r11197 r11684  
    1212
    1313        /*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;
    1818        double melting_offset;
    1919
    2020        /*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;
    2525
    2626        bool converged;
     
    5656                SystemMatricesx(&Kff, &Kfs, &pf,&df, &melting_offset,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
    5757                CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
    58                 Reduceloadx(pf, Kfs, ys); MatFree(&Kfs); VecFree(&tf);
     58                Reduceloadx(pf, Kfs, ys); xdelete(&Kfs); xdelete(&tf);
    5959                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);
    6363                InputUpdateFromSolutionx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,tg);
    6464
     
    8484
    8585        /*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);
    9090}
  • issm/branches/trunk-jpl-damage/src/c/toolkits/matlab/matlabincludes.h

    r8901 r11684  
    88#ifdef _SERIAL_
    99#include <mex.h>
     10class Matrix;
     11class Vector;
     12
    1013int MatlabNArrayToNArray(double** pmatrix,int* pmatrix_numel,int* pmatrix_ndims,int** pmatrix_size,const mxArray* mxmatrix);
    1114int MatlabNArrayToNArray(bool** pmatrix,int* pmatrix_numel,int* pmatrix_ndims,int** pmatrix_size,const mxArray* mxmatrix);
    1215int MatlabNArrayToNArray(char** pmatrix,int* pmatrix_numel,int* pmatrix_ndims,int** pmatrix_size,const mxArray* mxmatrix);
     16Matrix* MatlabMatrixToMatrix(const mxArray* mxmatrix);
     17Vector* MatlabVectorToVector(const mxArray* mxvector);
    1318#endif
    1419
  • issm/branches/trunk-jpl-damage/src/c/toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp

    r9320 r11684  
    2525int MatlabMatrixToDoubleMatrix(double** pmatrix,int* pmatrix_rows,int* pmatrix_cols,const mxArray* mxmatrix){
    2626
    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;
    3130
    3231        /*output: */
     
    3635        mwIndex*    ir=NULL;
    3736        mwIndex*    jc=NULL;
    38         double* pr=NULL;
    39         int     count;
    40         int     nnz;
    41         int     nz;
    4237
    4338        /*Ok, first check if we are dealing with a sparse or full matrix: */
     
    4540
    4641                /*Dealing with sparse matrix: recover size first: */
    47                 mxmatrix_ptr=(double*)mxGetPr(mxmatrix);
     42                pmxdoublematrix=(double*)mxGetPr(mxmatrix);
    4843                rows=mxGetM(mxmatrix);
    4944                cols=mxGetN(mxmatrix);
    50                 nnz=mxGetNzmax(mxmatrix);
    51                 nz=(int)((double)nnz/(double)rows);
    52 
    5345                matrix=(double*)xcalloc(rows*cols,sizeof(double));
    5446
    5547                /*Now, get ir,jc and pr: */
    56                 pr=mxGetPr(mxmatrix);
    5748                ir=mxGetIr(mxmatrix);
    5849                jc=mxGetJc(mxmatrix);
     
    6253                for(i=0;i<cols;i++){
    6354                        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];
    6556                                count++;
    6657                        }
     
    6859
    6960        }
    70         else{
    71 
    72 
     61        else if(mxIsClass(mxmatrix,"double")){
    7362                /*Dealing with dense matrix: recover pointer and size: */
    74                 mxmatrix_ptr=(double*)mxGetPr(mxmatrix);
     63                pmxdoublematrix=(double*)mxGetPr(mxmatrix);
    7564                rows=mxGetM(mxmatrix);
    7665                cols=mxGetN(mxmatrix);
    77 
    7866               
    7967                /*Create serial matrix: */
     
    8270                for(i=0;i<rows;i++){
    8371                        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];
    8573                        }
    8674                }
    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");
    8893        }
    8994
  • issm/branches/trunk-jpl-damage/src/m/classes/friction.m

    r11135 r11684  
    3939                end % }}}
    4040                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'));
    4242                        fielddisplay(obj,'coefficient','friction coefficient [SI]');
    4343                        fielddisplay(obj,'p','p exponent');
  • issm/branches/trunk-jpl-damage/src/m/classes/inversion.m

    r11577 r11684  
    9292                        checkfield(md,'inversion.iscontrol','values',[0 1]);
    9393                        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'});
    9497                        checkfield(md,'inversion.nsteps','numel',1,'>=',1);
    9598                        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  
    158158                         if isfield(structmd,'drag_p'), md.friction.p=structmd.drag_p; end
    159159                         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();
    162162                                 md.rifts.riftproperties=structmd.riftproperties;
     163                                 md.rifts.riftstruct=structmd.rifts;
     164                                 md.rifts.riftproperties=structmd.riftinfo;
    163165                         end
    164166                         if isfield(structmd,'bamg'), md.private.bamg=structmd.bamg; end
     
    273275                         if isfield(structmd,'z'), md.mesh.z=structmd.z; end
    274276                         if isfield(structmd,'mask'), md.flaim.criterion=structmd.mask; end
    275           if isfield(structmd,'pressureload'), md.diagnostic.icefront=structmd.pressureload; end
     277                        if isfield(structmd,'pressureload'), md.diagnostic.icefront=structmd.pressureload; end
    276278                         if isfield(structmd,'diagnostic_ref'), md.diagnostic.referential=structmd.diagnostic_ref; end
     279
    277280
    278281                         %Field changes
     
    359362                                 pos=find(structmd.cm_responses==382); md.inversion.cost_functions(pos)=503;
    360363                         end
     364
    361365                         if isfield(structmd,'artificial_diffusivity') & structmd.artificial_diffusivity==2,
    362366                                         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 enum
    3 %
    4 %   WARNING: DO NOT MODIFY THIS FILE
    5 %            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
    6 %            Please read src/c/EnumDefinitions/README for more information
    7 %
    8 %   Usage:
    9 %      string=EnumToModelField(enum)
    10 
    11 switch enum,
    12 
    13                 case ThicknessEnum(), string='thickness'; return
    14                 case FrictionCoefficientEnum(), string='drag_coefficient'; return
    15                 case MaterialsRheologyBEnum(), string='rheology_B'; return
    16                 case MaterialsRheologyBbarEnum(), string='rheology_B'; return
    17                 case MaterialsRheologyZEnum(), string='rheology_Z'; return
    18                 case MaterialsRheologyZbarEnum(), string='rheology_Z'; return
    19                 case BalancethicknessThickeningRateEnum: string='dhdt'; return
    20                 case VxEnum(), string='vx'; return
    21                 case InversionVxObsEnum(), string='vx_obs'; return
    22                 case VyEnum(), string='vy'; return
    23                 case InversionVyObsEnum(), string='vy_obs'; return
    24                 case BasalforcingsMeltingRateEnum(), string='basal_melting_rate'; return
    25                 case SurfaceforcingsMassBalanceEnum(), string='surface_mass_balance'; return
    26                 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  
    8282
    8383        %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);
    8586        %data_interp=griddata(md.mesh.x,md.mesh.y,data,X,Y);
    8687
  • issm/branches/trunk-jpl-damage/src/m/model/collapse.m

    r11462 r11684  
    9393md.geometry.bed=project2d(md,md.geometry.bed,1);
    9494md.mesh.vertexonboundary=project2d(md,md.mesh.vertexonboundary,1);
     95md.mesh.elementconnectivity=project2d(md,md.mesh.elementconnectivity,1);
    9596md.mask.elementonfloatingice=project2d(md,md.mask.elementonfloatingice,1);
    9697md.mask.vertexonfloatingice=project2d(md,md.mask.vertexonfloatingice,1);
     
    111112md.mesh.lowervertex=NaN;
    112113md.mesh.uppervertex=NaN;
     114md.mesh.lowerelements=NaN;
     115md.mesh.upperelements=NaN;
    113116
    114117%Remove old mesh
  • issm/branches/trunk-jpl-damage/src/m/model/mesh/bamg.m

    r11016 r11684  
    44%   Available options (for more details see ISSM website http://issm.jpl.nasa.gov/):
    55%
    6 %   - domain: followed by an ARGUS file that prescribes the domain outline
    7 %   - 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 ration 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        : geometrical 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 ration 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: maximal 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
     6%   - 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
    4545%
    4646%   Examples:
  • issm/branches/trunk-jpl-damage/src/m/qmu/dakota_in_data.m

    r5215 r11684  
    8080if strcmpi(params.analysis_driver,'matlab') && ...
    8181   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']);
    8484end
    8585
  • issm/branches/trunk-jpl-damage/src/m/qmu/dakota_in_write.m

    r5486 r11684  
    6363    filei=input('Dakota input file to write?  ','s');
    6464end
    65 [pathstr,name,ext,versn] = fileparts(filei);
     65[pathstr,name,ext] = fileparts(filei);
    6666if isempty(ext)
    6767% fileparts only considers '.in' to be the extension, not '.qmu.in'
    6868    ext='.qmu.in';
    6969end
    70 filei2=fullfile(pathstr,[name ext versn]);
     70filei2=fullfile(pathstr,[name ext]);
    7171
    7272display(sprintf('Opening Dakota input file ''%s''.',filei2));
     
    234234    param_write(fidi,'\t  ','evaluation_static_scheduling','','\n',params);
    235235    if ~isempty(params.analysis_components)
    236         [pathstr,name,ext,versn] = fileparts(params.analysis_components);
     236        [pathstr,name,ext] = fileparts(params.analysis_components);
    237237        if isempty(ext)
    238238            ext='.m';
    239239        end
    240         params.analysis_components=fullfile(pathstr,[name ext versn]);
     240        params.analysis_components=fullfile(pathstr,[name ext]);
    241241        param_write(fidi,'\t  ','analysis_components',' = ''','''\n',params);
    242242    end
  • issm/branches/trunk-jpl-damage/src/m/solutions/AnalysisConfiguration.m

    r11354 r11684  
    1414
    1515        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];
    1818
    1919        case ThermalSolutionEnum,
  • issm/branches/trunk-jpl-damage/src/m/solutions/steadystate_core.m

    r9725 r11684  
    1010        control_analysis=femmodel.parameters.InversionIscontrol;
    1111        solution_type=femmodel.parameters.SolutionType;
     12        isenthalpy=femmodel.parameters.ThermalIsenthalpy;
    1213
    1314        %Initialize counter
     
    1718
    1819                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
    2025
    2126                issmprintf(VerboseSolution,'\n%s',['   computing new velocity']);
     
    4651                femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,PressureEnum);
    4752                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
    5059
    5160end %end of function
  • issm/branches/trunk-jpl-damage/src/m/utils/Analysis/setcluster.m

    r5961 r11684  
    55%      md=setcluster(md,cluster);
    66
     7disp('Warning: setcluster is deprecated, use md.cluster=cluster instead');
    78md.cluster=cluster;
  • issm/branches/trunk-jpl-damage/src/m/utils/Exp/manipulation

    • Property svn:ignore set to
      Makefile
  • issm/branches/trunk-jpl-damage/src/m/utils/Exp/readwrite

    • Property svn:ignore set to
      Makefile
  • issm/branches/trunk-jpl-damage/src/mex/CreateJacobianMatrix/CreateJacobianMatrix.cpp

    r11335 r11684  
    1717       
    1818        /* output datasets: */
    19         Mat    Jff  = NULL;
     19        Matrix*    Jff  = NULL;
    2020
    2121        /*Boot module: */
     
    5353        delete materials;
    5454        delete parameters;
    55         MatFree(&Jff);
     55        delete Jff;
    5656
    5757        /*end module: */
  • issm/branches/trunk-jpl-damage/src/mex/CreateNodalConstraints/CreateNodalConstraints.cpp

    r8910 r11684  
    1212
    1313        /* output datasets: */
    14         Vec ys=NULL;
     14        Vector* ys=NULL;
    1515
    1616        /*Boot module: */
     
    3232        /*Free ressources: */
    3333        delete nodes;
    34         VecFree(&ys);
     34        delete ys;
    3535
    3636        /*end module: */
  • issm/branches/trunk-jpl-damage/src/mex/GetSolutionFromInputs/GetSolutionFromInputs.cpp

    r8910 r11684  
    1414        Materials* materials=NULL;
    1515        Parameters* parameters=NULL;
    16         Vec      ug=NULL;
     16        Vector*      ug=NULL;
    1717
    1818        /* output datasets: elements and loads*/
  • issm/branches/trunk-jpl-damage/src/mex/InputUpdateFromSolution/InputUpdateFromSolution.cpp

    r8910 r11684  
    1414        Materials* materials=NULL;
    1515        Parameters* parameters=NULL;
    16         Vec      solution=NULL;
     16        Vector*      solution=NULL;
    1717
    1818        /*Boot module: */
     
    5050        delete materials;
    5151        delete parameters;
    52         VecFree(&solution);
     52        delete solution;
    5353
    5454        /*end module: */
  • issm/branches/trunk-jpl-damage/src/mex/Mergesolutionfromftog/Mergesolutionfromftog.cpp

    r8910 r11684  
    99        /*input datasets: */
    1010        bool        flag_ys0;
    11         Vec         uf         = NULL;
    12         Vec         ys         = NULL;
     11        Vector*         uf         = NULL;
     12        Vector*         ys         = NULL;
    1313        Nodes*      nodes   = NULL;
    1414        Parameters* parameters   = NULL;
    1515
    1616        /* output datasets: */
    17         Vec ug=NULL;
     17        Vector* ug=NULL;
    1818
    1919        /*Boot module: */
     
    4545
    4646        /*Free ressources: */
    47         VecFree(&uf);
    48         VecFree(&ug);
    49         VecFree(&ys);
     47        delete uf;
     48        delete ug;
     49        delete ys;
    5050        delete nodes;
    5151        delete parameters;
  • issm/branches/trunk-jpl-damage/src/mex/Reduceload/Reduceload.cpp

    r8910 r11684  
    88
    99        /*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;
    1313        bool        flag_ys0=false;
    1414
     
    4040
    4141        /*Free ressources: */
    42         VecFree(&pf);
    43         MatFree(&Kfs);
    44         VecFree(&ys);
     42        delete pf;
     43        delete Kfs;
     44        delete ys;
    4545
    4646        MODULEEND();
  • issm/branches/trunk-jpl-damage/src/mex/Reducevectorgtof/Reducevectorgtof.cpp

    r8910 r11684  
    88
    99        /*input datasets: */
    10         Vec ug=NULL;
     10        Vector* ug=NULL;
    1111        Nodes* nodes=NULL;
    1212        Parameters* parameters=NULL;
    1313
    1414        /* output datasets: */
    15         Vec uf=NULL;
     15        Vector* uf=NULL;
    1616
    1717        /*Boot module: */
     
    3535        delete nodes;
    3636        delete parameters;
    37         VecFree(&ug);
    38         VecFree(&uf);
     37        delete ug;
     38        delete uf;
    3939
    4040        /*end module: */
  • issm/branches/trunk-jpl-damage/src/mex/Reducevectorgtos/Reducevectorgtos.cpp

    r8910 r11684  
    88
    99        /*input datasets: */
    10         Vec yg=NULL;
     10        Vector* yg=NULL;
    1111        Nodes* nodes=NULL;
    1212        Parameters* parameters=NULL;
    1313
    1414        /* output datasets: */
    15         Vec ys=NULL;
     15        Vector* ys=NULL;
    1616
    1717        /*Boot module: */
     
    3535        delete nodes;
    3636        delete parameters;
    37         VecFree(&yg);
    38         VecFree(&ys);
     37        delete yg;
     38        delete ys;
    3939
    4040        /*end module: */
  • issm/branches/trunk-jpl-damage/src/mex/Solver/Solver.cpp

    r11252 r11684  
    88
    99        /*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;
    1515        Parameters *parameters    = NULL;
    1616        int         analysis_type;
     
    6666
    6767        /*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;
    7373        delete parameters;
    7474
  • issm/branches/trunk-jpl-damage/src/mex/SystemMatrices/SystemMatrices.cpp

    r8910 r11684  
    1717       
    1818        /* 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;
    2323
    2424        double kmax;
     
    7272        delete materials;
    7373        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;
    7878
    7979        /*end module: */
  • issm/branches/trunk-jpl-damage/src/mex/UpdateDynamicConstraints/UpdateDynamicConstraints.cpp

    r9302 r11684  
    1111        Nodes       *nodes       = NULL;
    1212        Parameters  *parameters  = NULL;
    13         Vec          yg          = NULL;
     13        Vector*          yg          = NULL;
    1414
    1515        /*Boot module: */
     
    3232
    3333        /*Free ressources: */
    34         VecFree(&yg);
     34        delete yg;
    3535        delete constraints;
    3636        delete nodes;
  • issm/branches/trunk-jpl-damage/test/NightlyRun/IdToName.m

    r11348 r11684  
    224224        case 453, name='SquareSheetShelfGroundingLine3dSoftSerial';
    225225        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';
    226236        case 501, name='PigDiagM2dSerial';
    227237        case 502, name='PigDiagM2dParallel';
  • issm/branches/trunk-jpl-damage/test/NightlyRun/runme.m

    r11254 r11684  
    180180                                                disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,fieldname));
    181181                                        else
     182                                                disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,fieldname));
    182183                                                rethrow(me2);
    183184                                        end
     
    204205                        disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,'N/A'));
    205206                else
     207                        disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,'N/A'));
    206208                        rethrow(me);
    207209                end
Note: See TracChangeset for help on using the changeset viewer.