Changeset 12168


Ignore:
Timestamp:
05/01/12 17:28:47 (13 years ago)
Author:
cborstad
Message:

merged trunk-jpl into branch through revision 12167

Location:
issm/branches/trunk-jpl-damage
Files:
172 deleted
393 edited
75 copied

Legend:

Unmodified
Added
Removed
  • issm/branches/trunk-jpl-damage

  • issm/branches/trunk-jpl-damage/bin

    • Property svn:ignore
      • TabularUnified  

        old new  
        1111*.bat
        1212*.rtf
         13*.py
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-altix64-castor.sh

    r11174 r12168  
    11#!/bin/csh
    22
    3 ./configure --prefix=$ISSM_TIER --with-serial=no --with-metis-dir=$ISSM_TIER/externalpackages/metis/install --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install --with-mpi-include=/usr/include  --with-mpi-lib="-L/usr/lib -lmpi" --with-petsc-arch=$ISSM_ARCH --with-dakota-dir=$ISSM_TIER/externalpackages/dakota/install --with-mkl-dir=/opt/intel/mkl/9.1.023/lib/64 --with-triangle-dir=$ISSM_TIER/externalpackages/triangle/install --with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install/$ISSM_ARCH -lPLAPACK" --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/$ISSM_ARCH/INCLUDE" --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/$ISSM_ARCH/ --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/$ISSM_ARCH/ --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/$ISSM_ARCH --with-graphics-lib=/usr/X11R6/lib/libX11.so
     3./configure --prefix=$ISSM_DIR --with-serial=no --with-metis-dir=$ISSM_DIR/externalpackages/metis/install --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install --with-mpi-include=/usr/include  --with-mpi-lib="-L/usr/lib -lmpi" --with-petsc-arch=$ISSM_ARCH --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install --with-mkl-dir=/opt/intel/mkl/9.1.023/lib/64 --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/$ISSM_ARCH -lPLAPACK" --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/$ISSM_ARCH/INCLUDE" --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/$ISSM_ARCH/ --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/$ISSM_ARCH/ --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/$ISSM_ARCH --with-graphics-lib=/usr/X11R6/lib/libX11.so
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-cosmos.sh

    r11174 r12168  
    11#!/bin/csh
    22
    3 ./configure --prefix=$ISSM_TIER --with-serial=no --with-metis-dir=$ISSM_TIER/externalpackages/metis/install --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install --with-mpi-include=/opt/mpich/gm/intel10.1/include  --with-mpi-lib="-L/opt/mpich/gm/intel10.1/lib -lmpich -L/usr/local/gm/lib/ -lgm  -lpthread  -lrt" --with-petsc-arch=$ISSM_ARCH --with-mkl-dir=/opt/intel/mkl/10.0.5.025/lib/32/  --with-plapack-dir="-L$ISSM_TIER/externalpackages/petsc/install/$ISSM_ARCH -lPLAPACK" --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/$ISSM_ARCH/INCLUDE" --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/$ISSM_ARCH/ --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/$ISSM_ARCH/ --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/$ISSM_ARCH  --with-vendor=intel-linux --with-graphics-lib=/usr/X11R6/lib/libX11.so
     3./configure --prefix=$ISSM_DIR --with-serial=no --with-metis-dir=$ISSM_DIR/externalpackages/metis/install --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install --with-mpi-include=/opt/mpich/gm/intel10.1/include  --with-mpi-lib="-L/opt/mpich/gm/intel10.1/lib -lmpich -L/usr/local/gm/lib/ -lgm  -lpthread  -lrt" --with-petsc-arch=$ISSM_ARCH --with-mkl-dir=/opt/intel/mkl/10.0.5.025/lib/32/  --with-plapack-dir="-L$ISSM_DIR/externalpackages/petsc/install/$ISSM_ARCH -lPLAPACK" --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/$ISSM_ARCH/INCLUDE" --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/$ISSM_ARCH/ --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/$ISSM_ARCH/ --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/$ISSM_ARCH  --with-vendor=intel-linux --with-graphics-lib=/usr/X11R6/lib/libX11.so
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-greenplanet.sh

    r11381 r12168  
    55
    66./configure \
    7  --prefix=$ISSM_TIER \
    8  --with-serial=no \
    9  --with-triangle-dir=$ISSM_TIER/externalpackages/triangle/install \
    10  --with-metis-dir=$ISSM_TIER/externalpackages/metis/install \
    11  --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install \
     7 --prefix=$ISSM_DIR \
     8 --with-modules=no \
     9 --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
     10 --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
     11 --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
    1212 --with-mpi-include="/sopt/mpi/openmpi-1.5.4_psm/intel/include/" \
    1313 --with-mpi-lib="-L/sopt/mpi/openmpi-1.5.4_psm/intel/lib/ -lmpi -lmpi_f77" \
    1414 --with-petsc-arch=$ISSM_ARCH \
    15  --with-dakota-dir=$ISSM_TIER/externalpackages/dakota/install \
     15 --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
    1616 --with-mkl-dir=/opt/intel/mkl/10.2.4.032/ \
    17  --with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install/ -lPLAPACK" \
    18  --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
    19  --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    20  --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    21  --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/ \
     17 --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
     18 --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
     19 --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     20 --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     21 --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
    2222 --with-graphics-lib=/usr/lib64/libX11.so \
    2323 --with-cxxoptflags="-O3 -xS" \
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-linux64-astrid-ad.sh

    r11174 r12168  
    22
    33./configure \
    4  --prefix=$ISSM_TIER \
     4 --prefix=$ISSM_DIR \
    55 --with-serial=no\
    6  --with-metis-dir=$ISSM_TIER/externalpackages/metis/install \
    7  --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install \
    8  --with-mpi-include=$ISSM_TIER/externalpackages/mpich2/install/include  \
    9  --with-mpi-lib="-L$ISSM_TIER/externalpackages/mpich2/install/lib/ -lmpich" \
     6 --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
     7 --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
     8 --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
     9 --with-mpi-lib="-L$ISSM_DIR/externalpackages/mpich2/install/lib/ -lmpich" \
    1010 --with-petsc-arch=$ISSM_ARCH \
    11  --with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install \
    12  --with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install/ -lPLAPACK" \
    13  --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
    14  --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    15  --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    16  --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/ \
     11 --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
     12 --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
     13 --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
     14 --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     15 --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     16 --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
    1717 --with-graphics-lib=/usr/lib64/libX11.so \
    1818 --with-cxxoptflags="-march=opteron -O2" \
    1919 --with-fortran-lib="-L/usr/lib/gcc/x86_64-redhat-linux/4.1.1/ -lgfortran" \
    20  --with-rose-dir=$ISSM_TIER/externalpackages/rose/install/ \
    21  --with-adic2-dir=$ISSM_TIER/externalpackages/adic/install/ \
     20 --with-rose-dir=$ISSM_DIR/externalpackages/rose/install/ \
     21 --with-adic2-dir=$ISSM_DIR/externalpackages/adic/install/ \
    2222 --with-numthreads=24 \
    2323 --without-thermal \
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-linux64-astrid-petsc2.sh

    r11174 r12168  
    55#mpich 1.0.2
    66
    7 ./configure --prefix=$ISSM_TIER --with-matlab-dir=$MATLAB_DIR --with-triangle-dir=$ISSM_TIER/externalpackages/triangle/install --with-metis-dir=$ISSM_TIER/externalpackages/metis/install --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install --with-mpi-include=$ISSM_TIER/externalpackages/mpich2/install/include  --with-mpi-lib="-L$ISSM_TIER/externalpackages/mpich2/install/lib/ -lmpich" --with-petsc-arch=$ISSM_ARCH --with-dakota-dir=$ISSM_TIER/externalpackages/dakota/install --with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install/externalpackages/fblaslapack/$ISSM_ARCH --with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/$ISSM_ARCH -lPLAPACK" --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/$ISSM_ARCH/INCLUDE" --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/externalpackages/blacs-dev/$ISSM_ARCH --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/externalpackages/SCALAPACK/$ISSM_ARCH --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/externalpackages/MUMPS_4.6.3/$ISSM_ARCH --with-fortran-lib="-L/usr/lib/gcc/x86_64-redhat-linux/4.1.1/ -lgfortran" --with-graphics-lib=/usr/lib64/libX11.so --with-cxxoptflags="-march=opteron -O2" --with-numthreads=32 --with-scotch-dir=$ISSM_TIER/externalpackages/scotch/install --with-chaco-dir=$ISSM_TIER/externalpackages/chaco/install --enable-debugging --with-shapelib-dir=$ISSM_TIER/externalpackages/shapelib/install\
     7./configure --prefix=$ISSM_DIR --with-matlab-dir=$MATLAB_DIR --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install --with-metis-dir=$ISSM_DIR/externalpackages/metis/install --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  --with-mpi-lib="-L$ISSM_DIR/externalpackages/mpich2/install/lib/ -lmpich" --with-petsc-arch=$ISSM_ARCH --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/fblaslapack/$ISSM_ARCH --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/$ISSM_ARCH -lPLAPACK" --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/$ISSM_ARCH/INCLUDE" --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/blacs-dev/$ISSM_ARCH --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/SCALAPACK/$ISSM_ARCH --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/MUMPS_4.6.3/$ISSM_ARCH --with-fortran-lib="-L/usr/lib/gcc/x86_64-redhat-linux/4.1.1/ -lgfortran" --with-graphics-lib=/usr/lib64/libX11.so --with-cxxoptflags="-march=opteron -O2" --with-numthreads=32 --with-scotch-dir=$ISSM_DIR/externalpackages/scotch/install --with-chaco-dir=$ISSM_DIR/externalpackages/chaco/install --enable-debugging --with-shapelib-dir=$ISSM_DIR/externalpackages/shapelib/install\
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-linux64-astrid.sh

    r11174 r12168  
    33#External packages versions:
    44#petsc 3.1 or 3.2
    5 #mpich 1.0.2
     5#mpich 1.4
    66
    77./configure \
    8  --prefix=$ISSM_TIER \
     8 --prefix=$ISSM_DIR \
    99 --with-matlab-dir=$MATLAB_DIR \
    10  --with-triangle-dir=$ISSM_TIER/externalpackages/triangle/install \
    11  --with-metis-dir=$ISSM_TIER/externalpackages/metis/install \
    12  --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install \
    13  --with-tao-dir=$ISSM_TIER/externalpackages/tao/install \
    14  --with-mpi-include=$ISSM_TIER/externalpackages/mpich2/install/include  \
    15  --with-mpi-lib="-L$ISSM_TIER/externalpackages/mpich2/install/lib/ -lmpich " \
     10 --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
     11 --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
     12 --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
     13 --with-tao-dir=$ISSM_DIR/externalpackages/tao/install \
     14 --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
     15 --with-mpi-lib="-L$ISSM_DIR/externalpackages/mpich2/install/lib/ -lmpich -lmpl " \
    1616 --with-petsc-arch=$ISSM_ARCH \
    17  --with-dakota-dir=$ISSM_TIER/externalpackages/dakota/install \
    18  --with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install \
    19  --with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install/ -lPLAPACK" \
    20  --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
    21  --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    22  --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    23  --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    24  --with-scotch-dir="$ISSM_TIER/externalpackages/scotch/install" \
    25  --with-chaco-dir="$ISSM_TIER/externalpackages/chaco/install" \
    26  --with-shapelib-dir="$ISSM_TIER/externalpackages/shapelib/install" \
     17 --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
     18 --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
     19 --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
     20 --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
     21 --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     22 --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     23 --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     24 --with-scotch-dir="$ISSM_DIR/externalpackages/scotch/install" \
     25 --with-chaco-dir="$ISSM_DIR/externalpackages/chaco/install" \
     26 --with-shapelib-dir="$ISSM_DIR/externalpackages/shapelib/install" \
    2727 --with-fortran-lib="-L/usr/lib/gcc/x86_64-redhat-linux/4.1.1/ -lgfortran" \
    2828 --with-graphics-lib=/usr/lib64/libX11.so \
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-linux64-murdo-ad.sh

    r11174 r12168  
    22
    33./configure \
    4  --prefix=$ISSM_TIER \
     4 --prefix=$ISSM_DIR \
    55 --with-serial=no\
    6  --with-metis-dir=$ISSM_TIER/externalpackages/metis/install \
    7  --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install \
    8  --with-mpi-include=$ISSM_TIER/externalpackages/mpich2/install/include  \
    9  --with-mpi-lib="-L$ISSM_TIER/externalpackages/mpich2/install/lib/ -lmpich" \
     6 --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
     7 --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
     8 --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
     9 --with-mpi-lib="-L$ISSM_DIR/externalpackages/mpich2/install/lib/ -lmpich" \
    1010 --with-petsc-arch=$ISSM_ARCH \
    11  --with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install \
    12  --with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install/ -lPLAPACK" \
    13  --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
    14  --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    15  --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    16  --with-hypre-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    17  --with-ml-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    18  --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/ \
     11 --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
     12 --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
     13 --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
     14 --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     15 --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     16 --with-hypre-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     17 --with-ml-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     18 --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
    1919 --with-graphics-lib=/usr/lib64/libX11.so \
    2020 --with-cxxoptflags="-mtune=barcelona -ffast-math -O3 -msse4.2 -Wno-write-strings "\
    2121 --with-fortran-lib="-L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/ -lg2c  /usr/lib/gcc/x86_64-redhat-linux/4.1.1/libgfortran.a" \
    22  --with-adic2-dir=$ISSM_TIER/externalpackages/adic/install/ \
     22 --with-adic2-dir=$ISSM_DIR/externalpackages/adic/install/ \
    2323--with-numthreads=24 \
    2424 --without-thermal \
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-linux64-murdo-nopetsc.sh

    r12004 r12168  
    22
    33./configure \
    4  --prefix=$ISSM_TIER \
    5  --with-mpi-include=$ISSM_TIER/externalpackages/mpich2/install/include  \
    6  --with-mpi-lib="-L$ISSM_TIER/externalpackages/mpich2/install/lib/ -lmpich" \
     4 --prefix=$ISSM_DIR \
     5 --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
     6 --with-mpi-lib="-L$ISSM_DIR/externalpackages/mpich2/install/lib/ -lmpich" \
    77 --with-matlab-dir=$MATLAB_DIR \
    8  --with-triangle-dir=$ISSM_TIER/externalpackages/triangle/install \
    9  --with-metis-dir=$ISSM_TIER/externalpackages/metis/install \
    10  --with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install/lib \
     8 --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
     9 --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
     10 --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install/lib \
    1111 --with-graphics-lib=/usr/lib64/libX11.so \
    12  --with-scotch-dir="$ISSM_TIER/externalpackages/scotch/install" \
    13  --with-chaco-dir="$ISSM_TIER/externalpackages/chaco/install" \
     12 --with-scotch-dir="$ISSM_DIR/externalpackages/scotch/install" \
     13 --with-chaco-dir="$ISSM_DIR/externalpackages/chaco/install" \
    1414 --with-cxxoptflags="-mtune=barcelona -ffast-math -O3 -msse4.2 -Wno-write-strings "\
    1515 --with-numthreads=18 \
    1616 --enable-debugging \
    17  --with-gsl-dir=$ISSM_TIER/externalpackages/gsl/install
     17 --with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install
    1818 
    1919 
    20 # --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install \
     20# --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
    2121# --with-petsc-arch=$ISSM_ARCH \
    22 # --with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install/ -lPLAPACK" \
    23 # --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
    24 # --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    25 # --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    26 # --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    27 # --with-dakota-dir=$ISSM_TIER/externalpackages/dakota/install \
     22# --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
     23# --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
     24# --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     25# --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     26# --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     27# --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-linux64-murdo.sh

    r11577 r12168  
    22
    33./configure \
    4  --prefix=$ISSM_TIER \
     4 --prefix=$ISSM_DIR \
    55 --with-matlab-dir=$MATLAB_DIR \
    6  --with-triangle-dir=$ISSM_TIER/externalpackages/triangle/install \
    7  --with-metis-dir=$ISSM_TIER/externalpackages/metis/install \
    8  --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install \
    9  --with-mpi-include=$ISSM_TIER/externalpackages/mpich2/install/include  \
    10  --with-mpi-lib="-L$ISSM_TIER/externalpackages/mpich2/install/lib/ -lmpich" \
     6 --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
     7 --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
     8 --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
     9 --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
     10 --with-mpi-lib="-L$ISSM_DIR/externalpackages/mpich2/install/lib/ -lmpich" \
    1111 --with-petsc-arch=$ISSM_ARCH \
    12  --with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install \
    13  --with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install/ -lPLAPACK" \
    14  --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
    15  --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    16  --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    17  --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    18  --with-scotch-dir="$ISSM_TIER/externalpackages/scotch/install" \
    19  --with-chaco-dir="$ISSM_TIER/externalpackages/chaco/install" \
     12 --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
     13 --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
     14 --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
     15 --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     16 --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     17 --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     18 --with-scotch-dir="$ISSM_DIR/externalpackages/scotch/install" \
     19 --with-chaco-dir="$ISSM_DIR/externalpackages/chaco/install" \
    2020 --with-graphics-lib=/usr/lib64/libX11.so \
    2121 --with-cxxoptflags="-mtune=barcelona -ffast-math -O3 -msse4.2 -Wno-write-strings "\
    2222 --with-numthreads=18 \
    23  --with-dakota-dir=$ISSM_TIER/externalpackages/dakota/install \
     23 --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
    2424 --enable-debugging
    2525 
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-macosx32-mathieu.sh

    r11174 r12168  
    1010
    1111./configure \
    12         --prefix=$ISSM_TIER \
     12        --prefix=$ISSM_DIR \
    1313        --with-matlab-dir=$MATLAB_DIR \
    14         --with-triangle-dir=$ISSM_TIER/externalpackages/triangle/install \
    15         --with-metis-dir=$ISSM_TIER/externalpackages/metis/install \
    16         --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install  \
    17         --with-mpi-include=$ISSM_TIER/externalpackages/mpich2/install/include  \
    18         --with-mpi-lib=" $ISSM_TIER/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_TIER/externalpackages/mpich2/install/lib/libmpich.a $ISSM_TIER/externalpackages/mpich2/install/lib/libmpl.a " \
     14        --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
     15        --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
     16        --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install  \
     17        --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
     18        --with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpl.a " \
    1919        --with-petsc-arch=$ISSM_ARCH \
    20         --with-dakota-dir=$ISSM_TIER/externalpackages/dakota/install \
    21         --with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install \
    22         --with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install/ -lPLAPACK" \
    23         --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/include/ " \
    24         --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    25         --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    26         --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/ \
     20        --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
     21        --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
     22        --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
     23        --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/include/ " \
     24        --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     25        --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     26        --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
    2727        --with-fortran-lib="/usr/local/lib/libgfortran.a" \
    2828        --with-math-lib="/usr/lib/libm.dylib" \
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-macosx32-ogive.sh

    r11174 r12168  
    55
    66./configure \
    7         --prefix=$ISSM_TIER \
     7        --prefix=$ISSM_DIR \
    88        --with-matlab-dir=$MATLAB_DIR \
    9         --with-triangle-dir=$ISSM_TIER/externalpackages/triangle/install \
    10         --with-metis-dir=$ISSM_TIER/externalpackages/metis/install \
    11         --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install  \
    12         --with-mpi-include=$ISSM_TIER/externalpackages/mpich2/install/include  \
    13         --with-mpi-lib=" $ISSM_TIER/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_TIER/externalpackages/mpich2/install/lib/libmpich.a $ISSM_TIER/externalpackages/mpich2/install/lib/libmpl.a " \
     9        --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
     10        --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
     11        --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install  \
     12        --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
     13        --with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpl.a " \
    1414        --with-petsc-arch=$ISSM_ARCH \
    15         --with-dakota-dir=$ISSM_TIER/externalpackages/dakota/install \
    16         --with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install \
    17         --with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install/ -lPLAPACK" \
    18         --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/include/ " \
    19         --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    20         --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    21         --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/ \
     15        --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
     16        --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
     17        --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
     18        --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/include/ " \
     19        --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     20        --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     21        --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
    2222        --with-fortran-lib="/usr/local/gfortran/lib/libgfortran.a" \
    2323        --with-math-lib="/usr/lib/libm.dylib" \
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-macosx64-larour-ad.sh

    r12004 r12168  
    66./configure \
    77        --with-serial=no\
    8         --prefix=$ISSM_TIER \
    9         --with-metis-dir=$ISSM_TIER/externalpackages/metis/install \
    10         --with-mpi-include=$ISSM_TIER/externalpackages/mpich2/install/include  \
    11         --with-mpi-lib=" $ISSM_TIER/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_TIER/externalpackages/mpich2/install/lib/libmpich.a $ISSM_TIER/externalpackages/mpich2/install/lib/libmpl.a " \
     8        --prefix=$ISSM_DIR \
     9        --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
     10        --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
     11        --with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpl.a " \
    1212        --without-blas-lapack-dir \
    13         --with-chaco-dir=$ISSM_TIER/externalpackages/chaco/install \
     13        --with-chaco-dir=$ISSM_DIR/externalpackages/chaco/install \
    1414        --with-fortran-lib="/usr/local/gfortran/lib/libgfortran.a" \
    15         --with-dakota-dir=$ISSM_TIER/externalpackages/dakota/install \
     15        --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
    1616        --with-math-lib="/usr/lib/libm.dylib" \
    1717        --with-graphics-lib="/usr/X11/lib/libX11.dylib" \
    1818        --with-cxxoptflags=" -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -mmacosx-version-min=10.5  -O3 -DNDEBUG -w "\
    19         --with-adic2-dir=$ISSM_TIER/externalpackages/adic/install/ \
    20         --with-adolc-dir=$ISSM_TIER/externalpackages/adolc/install/ \
     19        --with-adic2-dir=$ISSM_DIR/externalpackages/adic/install/ \
     20        --with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install/ \
    2121        --with-numthreads=8 \
    2222        --without-thermal \
     
    3434 
    3535#--without-prognostic \
    36 #--with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install  \
     36#--with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install  \
    3737#--with-petsc-arch=$ISSM_ARCH \
    38 #--with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install \
    39 #--with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install/ -lPLAPACK" \
    40 #--with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/include/ " \
    41 #--with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    42 #--with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    43 #--with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/ \
     38#--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
     39#--with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
     40#--with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/include/ " \
     41#--with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     42#--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     43#--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-macosx64-larour-nopetsc.sh

    r12004 r12168  
    11#!/bin/sh
    22
    3 #petsc 3.2
    4 #mpich 1.4
     3pythonversion=3.2
    54
    65./configure \
    7         --prefix=$ISSM_TIER \
    8         --with-mpi-include=$ISSM_TIER/externalpackages/mpich2/install/include  \
    9         --with-mpi-lib=" $ISSM_TIER/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_TIER/externalpackages/mpich2/install/lib/libmpich.a $ISSM_TIER/externalpackages/mpich2/install/lib/libmpl.a " \
     6        --prefix=$ISSM_DIR \
    107        --with-matlab-dir=$MATLAB_DIR \
    11         --with-triangle-dir=$ISSM_TIER/externalpackages/triangle/install \
    12         --with-metis-dir=$ISSM_TIER/externalpackages/metis/install \
    13         --with-chaco-dir=$ISSM_TIER/externalpackages/chaco/install \
    14         --with-fortran-lib="/usr/local/gfortran/lib/libgfortran.a" \
     8        --with-python-dir=$ISSM_DIR/externalpackages/python/install\
     9        --with-python-version=$pythonversion \
     10        --with-python-numpy-dir=$ISSM_DIR/externalpackages/python/install/Python.framework/Versions/$pythonversion/lib/python$pythonversion/site-packages/numpy/core/include/numpy\
     11        --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
    1512        --with-math-lib="/usr/lib/libm.dylib" \
    16         --with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install/lib \
    1713        --with-graphics-lib="/usr/X11/lib/libX11.dylib" \
    1814        --with-cxxoptflags=" -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -mmacosx-version-min=10.5  -O3 -DNDEBUG -w "\
    19         --with-numthreads=8 \
    20         --with-gsl-dir=$ISSM_TIER/externalpackages/gsl/install
    21 #       --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install  \
    22 #       --with-petsc-arch=$ISSM_ARCH \
    23 #       --with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install/ -lPLAPACK" \
    24 #       --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/include/ " \
    25 #       --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    26 #       --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    27 #       --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/
    28 #   --with-dakota-dir=$ISSM_TIER/externalpackages/dakota/install \
     15        --with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-macosx64-larour-python.sh

    r12004 r12168  
    55
    66./configure \
    7         --prefix=$ISSM_TIER \
    8         --with-triangle-dir=$ISSM_TIER/externalpackages/triangle/install \
    9         --with-python-dir=$ISSM_TIER/externalpackages/python/install\
    10         --with-python-numpy-dir=$ISSM_TIER/externalpackages/python/install/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/numpy\
    11         --with-metis-dir=$ISSM_TIER/externalpackages/metis/install \
    12         --with-mpi-include=$ISSM_TIER/externalpackages/mpich2/install/include  \
    13         --with-mpi-lib=" $ISSM_TIER/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_TIER/externalpackages/mpich2/install/lib/libmpich.a $ISSM_TIER/externalpackages/mpich2/install/lib/libmpl.a " \
    14         --with-chaco-dir=$ISSM_TIER/externalpackages/chaco/install \
     7        --prefix=$ISSM_DIR \
     8        --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
     9        --with-python-dir=$ISSM_DIR/externalpackages/python/install\
     10        --with-python-numpy-dir=$ISSM_DIR/externalpackages/python/install/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/numpy\
     11        --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
     12        --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
     13        --with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpl.a " \
     14        --with-chaco-dir=$ISSM_DIR/externalpackages/chaco/install \
    1515        --with-fortran-lib="/usr/local/gfortran/lib/libgfortran.a" \
    1616        --with-math-lib="/usr/lib/libm.dylib" \
     
    1818        --with-cxxoptflags=" -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -mmacosx-version-min=10.5  -O3 -DNDEBUG -w "\
    1919        --with-numthreads=8 \
    20         --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install  \
     20        --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install  \
    2121        --with-petsc-arch=$ISSM_ARCH \
    22         --with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install \
    23         --with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install/ -lPLAPACK" \
    24         --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/include/ " \
    25         --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    26         --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    27         --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/
    28         #--with-dakota-dir=$ISSM_TIER/externalpackages/dakota/install \
    29         #--with-boost-dir=$ISSM_TIER/externalpackages/boost/install/ \
     22        --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
     23        --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
     24        --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/include/ " \
     25        --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     26        --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     27        --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/
     28        #--with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
     29        #--with-boost-dir=$ISSM_DIR/externalpackages/boost/install/ \
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-macosx64-larour.sh

    r12004 r12168  
    55
    66./configure \
    7         --prefix=$ISSM_TIER \
     7        --prefix=$ISSM_DIR \
    88        --with-matlab-dir=$MATLAB_DIR \
    9         --with-triangle-dir=$ISSM_TIER/externalpackages/triangle/install \
    10         --with-metis-dir=$ISSM_TIER/externalpackages/metis/install \
    11         --with-mpi-include=$ISSM_TIER/externalpackages/mpich2/install/include  \
    12         --with-mpi-lib=" $ISSM_TIER/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_TIER/externalpackages/mpich2/install/lib/libmpich.a $ISSM_TIER/externalpackages/mpich2/install/lib/libmpl.a " \
    13         --with-chaco-dir=$ISSM_TIER/externalpackages/chaco/install \
     9        --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
     10        --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
     11        --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
     12        --with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpl.a " \
     13        --with-chaco-dir=$ISSM_DIR/externalpackages/chaco/install \
    1414        --with-fortran-lib="/usr/local/gfortran/lib/libgfortran.a" \
    1515        --with-math-lib="/usr/lib/libm.dylib" \
     
    1717        --with-cxxoptflags=" -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -mmacosx-version-min=10.5  -O3 -DNDEBUG -w "\
    1818        --with-numthreads=8 \
    19         --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install  \
     19        --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install  \
    2020        --with-petsc-arch=$ISSM_ARCH \
    21         --with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install \
    22         --with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install/ -lPLAPACK" \
    23         --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/include/ " \
    24         --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    25         --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    26         --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/
    27         #--with-dakota-dir=$ISSM_TIER/externalpackages/dakota/install \
     21        --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
     22        --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
     23        --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/include/ " \
     24        --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     25        --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     26        --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/
     27        #--with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-macosx64-mathieu.sh

    r11174 r12168  
    55
    66./configure \
    7         --prefix=$ISSM_TIER \
     7        --prefix=$ISSM_DIR \
    88        --with-matlab-dir=$MATLAB_DIR \
    9         --with-triangle-dir=$ISSM_TIER/externalpackages/triangle/install \
    10         --with-metis-dir=$ISSM_TIER/externalpackages/metis/install \
    11         --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install  \
    12         --with-mpi-include=$ISSM_TIER/externalpackages/mpich2/install/include  \
    13         --with-mpi-lib=" $ISSM_TIER/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_TIER/externalpackages/mpich2/install/lib/libmpich.a $ISSM_TIER/externalpackages/mpich2/install/lib/libmpl.a " \
     9        --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
     10        --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
     11        --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install  \
     12        --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
     13        --with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpl.a " \
    1414        --with-petsc-arch=$ISSM_ARCH \
    15         --with-dakota-dir=$ISSM_TIER/externalpackages/dakota/install \
    16         --with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install \
    17         --with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install/ -lPLAPACK" \
    18         --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/include/ " \
    19         --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    20         --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    21         --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/ \
     15        --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
     16        --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
     17        --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
     18        --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/include/ " \
     19        --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     20        --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     21        --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
    2222        --with-fortran-lib="/usr/local/lib/libgfortran.a" \
    2323        --with-math-lib="/usr/lib/libm.dylib" \
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-macosx64-nicole.sh

    r11684 r12168  
    55
    66./configure \
    7         --prefix=$ISSM_TIER \
     7        --prefix=$ISSM_DIR \
    88        --with-matlab-dir=$MATLAB_DIR \
    9         --with-triangle-dir=$ISSM_TIER/externalpackages/triangle/install \
    10         --with-metis-dir=$ISSM_TIER/externalpackages/metis/install \
    11         --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install  \
    12         --with-mpi-include=$ISSM_TIER/externalpackages/mpich2/install/include  \
    13         --with-mpi-lib=" $ISSM_TIER/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_TIER/externalpackages/mpich2/install/lib/libmpich.a $ISSM_TIER/externalpackages/mpich2/install/lib/libmpl.a " \
     9        --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
     10        --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
     11        --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install  \
     12        --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
     13        --with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpl.a " \
    1414        --with-petsc-arch=$ISSM_ARCH \
    15         --with-dakota-dir=$ISSM_TIER/externalpackages/dakota/install \
    16         --with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install \
    17         --with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install -lPLAPACK" \
    18         --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/include/ " \
    19         --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install \
    20         --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install \
    21         --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install \
    22         --with-scotch-dir="$ISSM_TIER/externalpackages/scotch/install" \
    23         --with-chaco-dir="$ISSM_TIER/externalpackages/chaco/install" \
     15        --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
     16        --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
     17        --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install -lPLAPACK" \
     18        --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/include/ " \
     19        --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install \
     20        --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install \
     21        --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
     22        --with-scotch-dir="$ISSM_DIR/externalpackages/scotch/install" \
     23        --with-chaco-dir="$ISSM_DIR/externalpackages/chaco/install" \
    2424        --with-fortran-lib="/usr/local/gfortran/lib/gcc/x86_64-apple-darwin10/4.6.2/libgfortran.a" \
    2525        --with-math-lib="/usr/lib/libm.dylib" \
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-macosx64-ogive.sh

    r11174 r12168  
    99
    1010./configure \
    11         --prefix=$ISSM_TIER \
     11        --prefix=$ISSM_DIR \
    1212        --with-matlab-dir=$MATLAB_DIR \
    13         --with-triangle-dir=$ISSM_TIER/externalpackages/triangle/install \
    14         --with-metis-dir=$ISSM_TIER/externalpackages/metis/install \
    15         --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install  \
    16         --with-mpi-include=$ISSM_TIER/externalpackages/mpich2/install/include  \
    17         --with-mpi-lib=" $ISSM_TIER/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_TIER/externalpackages/mpich2/install/lib/libmpich.a $ISSM_TIER/externalpackages/mpich2/install/lib/libmpl.a " \
     13        --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
     14        --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
     15        --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install  \
     16        --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
     17        --with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpl.a " \
    1818        --with-petsc-arch=$ISSM_ARCH \
    19         --with-dakota-dir=$ISSM_TIER/externalpackages/dakota/install \
    20         --with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install \
    21         --with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install/ -lPLAPACK" \
    22         --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/include/ " \
    23         --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    24         --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    25         --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/ \
     19        --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
     20        --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
     21        --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
     22        --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/include/ " \
     23        --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     24        --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     25        --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
    2626        --with-fortran-lib="/usr/local/gfortran/lib/x86_64/libgfortran.a" \
    2727        --with-math-lib="/usr/lib/libm.dylib" \
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-macosx64-sophie.sh

    r11174 r12168  
    99
    1010./configure \
    11         --prefix=$ISSM_TIER \
     11        --prefix=$ISSM_DIR \
    1212        --with-matlab-dir=$MATLAB_DIR \
    13         --with-triangle-dir=$ISSM_TIER/externalpackages/triangle/install \
    14         --with-metis-dir=$ISSM_TIER/externalpackages/metis/install \
    15         --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install  \
    16         --with-mpi-include=$ISSM_TIER/externalpackages/mpich2/install/include  \
    17         --with-mpi-lib=" $ISSM_TIER/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_TIER/externalpackages/mpich2/install/lib/libmpich.a $ISSM_TIER/externalpackages/mpich2/install/lib/libmpl.a " \
     13        --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
     14        --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
     15        --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install  \
     16        --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
     17        --with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpl.a " \
    1818        --with-petsc-arch=$ISSM_ARCH \
    19         --with-dakota-dir=$ISSM_TIER/externalpackages/dakota/install \
    20         --with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install \
    21         --with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install/ -lPLAPACK" \
    22         --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/include/ " \
    23         --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    24         --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    25         --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/ \
     19        --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
     20        --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
     21        --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
     22        --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/include/ " \
     23        --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     24        --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     25        --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
    2626        --with-fortran-lib="/sw/usr/local/lib/x86_64/libgfortran.a" \
    2727        --with-math-lib="/usr/lib/libm.dylib" \
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-pleiades-petsc2.sh

    r11174 r12168  
    22
    33./configure \
    4  --prefix=$ISSM_TIER \
    5  --with-serial=no \
    6  --with-triangle-dir=$ISSM_TIER/externalpackages/triangle/install \
    7  --with-metis-dir=$ISSM_TIER/externalpackages/metis/install \
    8  --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install \
     4 --prefix=$ISSM_DIR \
     5 --with-modules=no \
     6 --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
     7 --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
     8 --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
    99 --with-mpi-include=/nasa/sgi/mpt/1.25/include \
    1010 --with-mpi-lib="-L/nasa/sgi/mpt/1.25/lib/ -lmpi -lpthread -lgfortran" \
    1111 --with-petsc-arch=$ISSM_ARCH \
    12  --with-dakota-dir=$ISSM_TIER/externalpackages/dakota/install \
     12 --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
    1313 --with-mkl-dir=/nasa/intel/mkl/10.0.011/lib/64/ \
    14  --with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install/ -lPLAPACK" \
    15  --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
    16  --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    17  --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    18  --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/ \
     14 --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
     15 --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
     16 --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     17 --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     18 --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
    1919 --with-graphics-lib=/usr/lib64/libX11.so \
    2020 --with-cxxoptflags="-O3 -xS" \
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-pleiades.sh

    r11174 r12168  
    22
    33./configure \
    4  --prefix=$ISSM_TIER \
    5  --with-serial=no \
    6  --with-triangle-dir=$ISSM_TIER/externalpackages/triangle/install \
    7  --with-metis-dir=$ISSM_TIER/externalpackages/metis/install \
    8  --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install \
     4 --prefix=$ISSM_DIR \
     5 --with-modules=no \
     6 --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
     7 --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
     8 --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
     9 --with-tao-dir=$ISSM_DIR/externalpackages/tao/install \
    910 --with-mpi-include=/nasa/sgi/mpt/1.25/include \
    1011 --with-mpi-lib="-L/nasa/sgi/mpt/1.25/lib/ -lmpi -lpthread -lgfortran" \
    1112 --with-petsc-arch=$ISSM_ARCH \
    12  --with-dakota-dir=$ISSM_TIER/externalpackages/dakota/install \
     13 --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
    1314 --with-mkl-dir=/nasa/intel/mkl/10.0.011/lib/64/ \
    14  --with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install/ -lPLAPACK" \
    15  --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
    16  --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    17  --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/ \
    18  --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/ \
     15 --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
     16 --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
     17 --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     18 --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     19 --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
    1920 --with-graphics-lib=/usr/lib64/libX11.so \
    2021 --with-cxxoptflags="-O3 -xS" \
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-win32-eric.sh

    r11174 r12168  
    44#get configure.sh to pick up the intel compiler
    55
    6 ./configure --prefix=$ISSM_TIER --with-parallel=no --with-vendor=intel-win  --with-matlab-dir=$MATLAB_DIR --with-triangle-dir=$ISSM_TIER/externalpackages/triangle/install --with-metis-dir=$ISSM_TIER/externalpackages/metis/install --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install  --with-petsc-arch=$ISSM_ARCH  --with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install/externalpackages/f2cblaslapack/$ISSM_ARCH
     6./configure --prefix=$ISSM_DIR --with-parallel=no --with-vendor=intel-win  --with-matlab-dir=$MATLAB_DIR --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install --with-metis-dir=$ISSM_DIR/externalpackages/metis/install --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install  --with-petsc-arch=$ISSM_ARCH  --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/f2cblaslapack/$ISSM_ARCH
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-win7-32.sh

    r11577 r12168  
    22
    33#Dos style path needed for the windows sdk 7.1 cl compiler:
    4 ISSM_TIER_WIN=`cygpath -m "$ISSM_TIER"`
     4ISSM_DIR_WIN=`cygpath -m "$ISSM_DIR"`
    55
    66#get configure.sh to pick up the win7 Visual Studio compiler
    7 ./configure --prefix=$ISSM_TIER \
     7./configure --prefix=$ISSM_DIR \
    88        --with-vendor=intel-win7-32  \
    99        --with-matlab-dir=$MATLAB_DIR \
    10         --with-triangle-dir="$ISSM_TIER_WIN/externalpackages/triangle/install" \
    11         --with-metis-dir="$ISSM_TIER_WIN/externalpackages/metis/install" \
    12         --with-petsc-dir="$ISSM_TIER_WIN/externalpackages/petsc/install" \
     10        --with-triangle-dir="$ISSM_DIR_WIN/externalpackages/triangle/install" \
     11        --with-metis-dir="$ISSM_DIR_WIN/externalpackages/metis/install" \
     12        --with-petsc-dir="$ISSM_DIR_WIN/externalpackages/petsc/install" \
    1313        --with-petsc-arch=$ISSM_ARCH  \
    14         --with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install/lib/  \
    15         --with-mpi-lib="$ISSM_TIER_WIN/externalpackages/petsc/install/lib/libpetsc.lib" \
    16         --with-mpi-include="$ISSM_TIER_WIN/externalpackages/petsc/install/include/mpiuni"
     14        --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install/lib/  \
     15        --with-mpi-lib="$ISSM_DIR_WIN/externalpackages/petsc/install/lib/libpetsc.lib" \
     16        --with-mpi-include="$ISSM_DIR_WIN/externalpackages/petsc/install/include/mpiuni"
  • TabularUnified issm/branches/trunk-jpl-damage/configs/config-win7-64.sh

    r11577 r12168  
    22
    33#Dos style path needed for the windows sdk 7.1 cl compiler:
    4 ISSM_TIER_WIN=`cygpath -m "$ISSM_TIER"`
     4ISSM_DIR_WIN=`cygpath -m "$ISSM_DIR"`
    55
    66#get configure.sh to pick up the win7 Visual Studio compiler
    7 ./configure --prefix=$ISSM_TIER \
     7./configure --prefix=$ISSM_DIR \
    88        --with-vendor=intel-win7-64  \
    99        --with-matlab-dir=$MATLAB_DIR \
    10         --with-triangle-dir="$ISSM_TIER_WIN/externalpackages/triangle/install" \
    11         --with-metis-dir="$ISSM_TIER_WIN/externalpackages/metis/install" \
    12         --with-petsc-dir="$ISSM_TIER_WIN/externalpackages/petsc/install" \
     10        --with-triangle-dir="$ISSM_DIR_WIN/externalpackages/triangle/install" \
     11        --with-metis-dir="$ISSM_DIR_WIN/externalpackages/metis/install" \
     12        --with-petsc-dir="$ISSM_DIR_WIN/externalpackages/petsc/install" \
    1313        --with-petsc-arch=$ISSM_ARCH  \
    14         --with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install/lib/  \
    15         --with-mpi-lib="$ISSM_TIER_WIN/externalpackages/petsc/install/lib/libpetsc.lib" \
    16         --with-mpi-include="$ISSM_TIER_WIN/externalpackages/petsc/install/include/mpiuni"
     14        --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install/lib/  \
     15        --with-mpi-lib="$ISSM_DIR_WIN/externalpackages/petsc/install/lib/libpetsc.lib" \
     16        --with-mpi-include="$ISSM_DIR_WIN/externalpackages/petsc/install/include/mpiuni"
  • TabularUnified issm/branches/trunk-jpl-damage/configure.ac

    r12004 r12168  
    22
    33#AUTOCONF
    4 AC_INIT([ISSM],[4.0],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
     4AC_INIT([ISSM],[4.1],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
    55AC_CONFIG_AUX_DIR([./aux-config])         #Put config files in aux-config
    66AC_CONFIG_MACRO_DIR([m4])                 #m4 macros are located in m4
     
    3636AC_CONFIG_FILES([Makefile
    3737                        src/Makefile
    38                         src/c/Makefile
    39                         src/mex/Makefile
     38                        src/c/Makefile
     39                        src/py/Makefile
     40                        src/py/model/Makefile
     41                        src/modules/Makefile
     42                        src/modules/python/Makefile
     43                        src/modules/matlab/Makefile
    4044                        src/m/Makefile
    4145                        bin/Makefile])
  • TabularUnified issm/branches/trunk-jpl-damage/cron/configs/linux64_daily

    r12004 r12168  
    66
    77#ISSM main directory (full paths)
    8 ISSM_DIR="/path/to/issm"
    9 ISSM_TIER="/path/to/issm/cron/trunk-jpl"
     8ISSM_DIR="/path/to/issm/cron/trunk-jpl"
    109
    1110#ISSM Architecture
     
    7271
    7372#Mail delivery. If SKIPMAIL="no", the html nightly run report will be
    74 #sent to the adresses present in $ISSM_TIER/cron/mailinglist.
     73#sent to the adresses present in $ISSM_DIR/cron/mailinglist.
    7574SKIPMAIL="no"
    7675
  • TabularUnified issm/branches/trunk-jpl-damage/cron/configs/linux64_nightly

    r12004 r12168  
    66
    77#ISSM main directory (full paths)
    8 ISSM_DIR="/path/to/issm"
    9 ISSM_TIER="/path/to/issm/cron/trunk-jpl"
     8ISSM_DIR="/path/to/issm/cron/trunk-jpl"
    109
    1110#ISSM Architecture
     
    7271
    7372#Mail delivery. If SKIPMAIL="no", the html nightly run report will be
    74 #sent to the adresses present in $ISSM_TIER/cron/mailinglist.
     73#sent to the adresses present in $ISSM_DIR/cron/mailinglist.
    7574SKIPMAIL="no"
    7675
  • TabularUnified issm/branches/trunk-jpl-damage/cron/configs/macosx64_daily

    r12004 r12168  
    66
    77#ISSM main directory (full path)
    8 ISSM_DIR="/path/to/issm/"
    9 ISSM_TIER="/path/to/issm/trunk-jpl/cron/trunk-jpl"
     8ISSM_DIR="/path/to/issm/trunk-jpl/cron/trunk-jpl"
    109
    1110#ISSM Architecture
     
    7271
    7372#Mail delivery. If SKIPMAIL="no", the html nightly run report will be
    74 #sent to the adresses present in $ISSM_TIER/cron/mailinglist.
     73#sent to the adresses present in $ISSM_DIR/cron/mailinglist.
    7574SKIPMAIL="no"
    7675
  • TabularUnified issm/branches/trunk-jpl-damage/cron/configs/macosx64_nightly

    r12004 r12168  
    66
    77#ISSM main directory (full path)
    8 ISSM_DIR="/path/to/issm/"
    9 ISSM_TIER="/path/to/issm/trunk-jpl/cron/trunk-jpl"
     8ISSM_DIR="/path/to/issm/trunk-jpl/cron/trunk-jpl"
    109
    1110#ISSM Architecture
     
    7271
    7372#Mail delivery. If SKIPMAIL="no", the html nightly run report will be
    74 #sent to the adresses present in $ISSM_TIER/cron/mailinglist.
     73#sent to the adresses present in $ISSM_DIR/cron/mailinglist.
    7574SKIPMAIL="no"
    7675
  • TabularUnified issm/branches/trunk-jpl-damage/cron/configs/win732

    r12004 r12168  
    66
    77#ISSM main directory (full path)
    8 ISSM_DIR="/cygdrive/c/issm"
    9 ISSM_TIER="/cygdrive/c/issm/trunk-jpl/cron/trunk-jpl"
     8ISSM_DIR="/cygdrive/c/issm-uci/trunk-jpl/cron/trunk-jpl"
    109
    1110#ISSM Architecture
     
    1615
    1716#MATLAB path
    18 MATLAB_PATH="C:/MATLAB/R2011b32/"
     17MATLAB_PATH="C:/MATLAB/R2012a/"
    1918
    2019#COMPILATION CONFIGURATION FILE
     
    3231# - "none"     leave ISSM as is in its directory
    3332#              ->skip to section 3
    34 ISSM_INSTALLATION="none"
     33ISSM_INSTALLATION="checkout"
    3534
    3635#SVN repository
     
    3837
    3938#execution path used for parallel runs
    40 EXECUTION_PATH="/cygdrive/c/issm/ExecutionNightlyRun"
     39EXECUTION_PATH="/cygdrive/c/issm-uci/ExecutionNightlyRun"
    4140
    4241#-----------------------------------#
     
    4948# - "none"    leave external packages as is
    5049#             ->skip to section 4
    51 ISSM_EXTERNALPACKAGES="none"
    52 EXTERNALPACKAGESDIR="/cygdrive/c/issm/trunk-jpl/externalpackages"
     50ISSM_EXTERNALPACKAGES="link"
     51EXTERNALPACKAGESDIR="/cygdrive/c/issm-uci/trunk-jpl/externalpackages"
    5352
    5453#List of external pakages to be installed
     
    6665# - "yes" compile ISSM
    6766# - "no"  do not compile ISSM
    68 ISSM_COMPILATION="no"
     67ISSM_COMPILATION="yes"
    6968
    7069#----------------------#
     
    7372
    7473#Mail delivery. If SKIPMAIL="no", the html nightly run report will be
    75 #sent to the adresses present in $ISSM_TIER/cron/mailinglist.
    76 SKIPMAIL="no"
     74#sent to the adresses present in $ISSM_DIR/cron/mailinglist.
     75SKIPMAIL="yes"
    7776
    7877#Sender email address
    79 EMAIL_ADRESS="eric.larour@jpl.nasa.gov"
     78EMAIL_ADRESS="eric.larour@gmail.com"
    8079
    8180#------------------------#
     
    8584#number of cpus used in ISSM installation and compilation (one is usually
    8685#safer as some packages are very sensitive to parallel compilation)
    87 NUMCPUS_INSTALL=8
     86NUMCPUS_INSTALL=1
    8887
    8988#number of cpus used in the nightly runs.
     
    9594#ex: "'id',[101 102 103]"
    9695
    97 NROPTIONS="'benchmark','all'"
     96NROPTIONS="'benchmark',102:2:120"
    9897
    9998#------------------------#
    10099# 7: Matlab#
    101100#------------------------#
    102 MATLABBIN=/cygdrive/c/MATLAB/R2011b32/bin/matlab
     101MATLABBIN=/cygdrive/c/MATLAB/R2012a/bin/matlab
  • TabularUnified issm/branches/trunk-jpl-damage/cron/configs/win764

    r12004 r12168  
    66
    77#ISSM main directory (full path)
    8 ISSM_DIR="/cygdrive/c/issm"
    9 ISSM_TIER="/cygdrive/c/issm/trunk-jpl/cron/trunk-jpl"
     8ISSM_DIR="/cygdrive/c/issm/trunk-jpl/cron/trunk-jpl"
    109
    1110#ISSM Architecture
     
    7372
    7473#Mail delivery. If SKIPMAIL="no", the html nightly run report will be
    75 #sent to the adresses present in $ISSM_TIER/cron/mailinglist.
     74#sent to the adresses present in $ISSM_DIR/cron/mailinglist.
    7675SKIPMAIL="no"
    7776
  • TabularUnified issm/branches/trunk-jpl-damage/cron/configs/winxp32

    r12004 r12168  
    66
    77#ISSM main directory (full path)
    8 ISSM_DIR="C:/home/issm/trunk-jpl"
    9 ISSM_TIER="C:/home/issm/trunk-jpl/cron/trunk-jpl"
     8ISSM_DIR="C:/home/issm/trunk-jpl/cron/trunk-jpl"
    109
    1110#ISSM Architecture
     
    6665
    6766#Mail delivery. If SKIPMAIL="no", the html nightly run report will be
    68 #sent to the adresses present in $ISSM_TIER/cron/mailinglist.
     67#sent to the adresses present in $ISSM_DIR/cron/mailinglist.
    6968SKIPMAIL="no"
    7069
  • TabularUnified issm/branches/trunk-jpl-damage/etc/environment.csh

    r8555 r12168  
    1 #ISSM_TIER and ISSM_ARCH should have been defined already in your shell settings file (.bashrc, .cshrc, etc ...)
    2 source $ISSM_TIER/etc/environment_variables.csh
     1#ISSM_DIR and ISSM_ARCH should have been defined already in your shell settings file (.bashrc, .cshrc, etc ...)
     2source $ISSM_DIR/etc/environment_variables.csh
    33
    44#Do we have any command line arguments? (such as MATLAB_DIR=otherdirthandefault), source them before exporting the variables
     
    1010
    1111#CRON utilities
    12 setenv PATH {$PATH}:{$ISSM_TIER}/cron
     12setenv PATH {$PATH}:{$ISSM_DIR}/cron
    1313
    1414#SCRIPTS utilities
    15 setenv PATH {$PATH}:{$ISSM_TIER}/scripts
     15setenv PATH {$PATH}:{$ISSM_DIR}/scripts
    1616
    1717#MATLAB
     
    110110#AUTOCONF
    111111setenv AUTOCONF_DIR {$AUTOCONF_DIR}
    112 setenv PATH {$PATH}:{$AUTOCONF_DIR}/bin
     112setenv PATH {$AUTOCONF_DIR}/bin:{$PATH}
    113113
    114114#AUTOMAKE
    115115setenv AUTOMAKE_DIR {$AUTOMAKE_DIR}
    116 setenv PATH {$PATH}:{$AUTOMAKE_DIR}/bin
     116setenv PATH {$AUTOMAKE_DIR}/bin:{$PATH}
    117117
    118118#BORLAND
  • TabularUnified issm/branches/trunk-jpl-damage/etc/environment.sh

    r12004 r12168  
    1 #ISSM_TIER and ISSM_ARCH should have been defined already in your shell settings file (.bashrc, .cshrc, etc ...)
     1#ISSM_DIR and ISSM_ARCH should have been defined already in your shell settings file (.bashrc, .cshrc, etc ...)
    22
    33#Windows compilers:
    44if [[ "$ISSM_ARCH" == "cygwin-intel" ]]; then
    5         source $ISSM_TIER/externalpackages/windows/windows_environment.sh
     5        source $ISSM_DIR/externalpackages/windows/windows_environment.sh
    66fi
    77
    8 source $ISSM_TIER/etc/environment_variables.sh
     8source $ISSM_DIR/etc/environment_variables.sh
    99
    1010#Do we have any command line arguments? (such as MATLAB_DIR=otherdirthandefault), source them after exporting the variables
     
    1616
    1717#CRON utilities
    18 PATH="$PATH:$ISSM_TIER/cron"
     18PATH="$PATH:$ISSM_DIR/cron"
    1919
    2020#scripts
    21 PATH="$PATH:$ISSM_TIER/scripts"
     21PATH="$PATH:$ISSM_DIR/scripts"
    2222
    2323##MATLAB
     
    137137#export INTEL_DIR
    138138#PATH="$PATH:$INTEL_DIR"
    139 #source $ISSM_TIER/externalpackages/intel/intel.sh
     139#source $ISSM_DIR/externalpackages/intel/intel.sh
    140140
    141141#SDK
     
    242242export PATH="$PATH:$ANDROID_NDK_DIR/"
    243243
    244 #ANDROID_DEV_DIR
    245 export ANDROID_DEV_DIR
     244#ANDROID_DIR
     245export ANDROID_DIR
    246246
    247247#ANDROID_SDK
     
    259259#PYTHON
    260260export PATH="$PYTHON_DIR/bin:$PATH"
    261 export PYTHONPATH="$PYTHONPATH:$ISSM_TIER/src/mex"
    262 export LD_LIBRARY_PATH=$ISSM_TIER/src/mex:$LD_LIBRARY_PATH
     261export PYTHONPATH="$PYTHONPATH:$ISSM_DIR/src/modules/python"
     262export LD_LIBRARY_PATH=$ISSM_DIR/src/modules/python:$LD_LIBRARY_PATH
    263263
    264264#MODELE
  • TabularUnified issm/branches/trunk-jpl-damage/etc/environment_variables.csh

    r10874 r12168  
    11#
    22#
    3 #This routine can only be run if the ISSM_TIER variable has been correctly set!
     3#This routine can only be run if the ISSM_DIR variable has been correctly set!
    44#
    55#
    66
    77#MATLAB
    8 set MATLAB_DIR={$ISSM_TIER}/externalpackages/matlab/install
     8set MATLAB_DIR={$ISSM_DIR}/externalpackages/matlab/install
    99
    1010#MPI
    11 set MPI_DIR={$ISSM_TIER}/externalpackages/mpich2/install
     11set MPI_DIR={$ISSM_DIR}/externalpackages/mpich2/install
    1212
    1313#PETSC
    14 set PETSC_DIR={$ISSM_TIER}/externalpackages/petsc/install
     14set PETSC_DIR={$ISSM_DIR}/externalpackages/petsc/install
    1515
    1616#SLEPC
    17 set SLEPC_DIR={$ISSM_TIER}/externalpackages/slepc/install
     17set SLEPC_DIR={$ISSM_DIR}/externalpackages/slepc/install
    1818
    1919#Dakota
    20 set DAKOTA_DIR={$ISSM_TIER}/externalpackages/dakota/install
     20set DAKOTA_DIR={$ISSM_DIR}/externalpackages/dakota/install
    2121
    2222#Qhull
    23 set QHULL_DIR={$ISSM_TIER}/externalpackages/qhull/install
     23set QHULL_DIR={$ISSM_DIR}/externalpackages/qhull/install
    2424
    2525#Doxygen
    26 set DOXYGEN_DIR={$ISSM_TIER}/externalpackages/doxygen/install
     26set DOXYGEN_DIR={$ISSM_DIR}/externalpackages/doxygen/install
    2727
    2828#MTOC
    29 set MTOC_DIR={$ISSM_TIER}/externalpackages/mtoc/install
     29set MTOC_DIR={$ISSM_DIR}/externalpackages/mtoc/install
    3030
    3131#Triangle
    32 set TRIANGLE_DIR={$ISSM_TIER}/externalpackages/triangle/install
     32set TRIANGLE_DIR={$ISSM_DIR}/externalpackages/triangle/install
    3333
    3434#METIS
    35 set METIS_DIR={$ISSM_TIER}/externalpackages/metis/install
     35set METIS_DIR={$ISSM_DIR}/externalpackages/metis/install
    3636
    3737#BLAS
    38 set BLAS_DIR={$ISSM_TIER}/externalpackages/petsc/install/externalexternalpackages/fblaslapack
     38set BLAS_DIR={$ISSM_DIR}/externalpackages/petsc/install/externalexternalpackages/fblaslapack
    3939
    4040#LAPACK
    41 set LAPACK_DIR={$ISSM_TIER}/externalpackages/petsc/install/externalexternalpackages/fblaslapack/$ISSM_ARCH
     41set LAPACK_DIR={$ISSM_DIR}/externalpackages/petsc/install/externalexternalpackages/fblaslapack/$ISSM_ARCH
    4242
    4343#SCALAPACK
    44 set SCALAPACK_DIR={$ISSM_TIER}/externalpackages/petsc/install/externalexternalpackages/SCALAPACK/$ISSM_ARCH
     44set SCALAPACK_DIR={$ISSM_DIR}/externalpackages/petsc/install/externalexternalpackages/SCALAPACK/$ISSM_ARCH
    4545
    4646#PLAPACK
    47 set PLAPACK_DIR={$ISSM_TIER}/externalpackages/petsc/install/externalexternalpackages/PLAPACKR32
     47set PLAPACK_DIR={$ISSM_DIR}/externalpackages/petsc/install/externalexternalpackages/PLAPACKR32
    4848
    4949#BLACS
    50 set BLACS_DIR={$ISSM_TIER}/externalpackages/petsc/install/externalexternalpackages/blacs-dev/$ISSM_ARCH
     50set BLACS_DIR={$ISSM_DIR}/externalpackages/petsc/install/externalexternalpackages/blacs-dev/$ISSM_ARCH
    5151
    5252#sowing
    53 set SOWING_DIR={$ISSM_TIER}/externalpackages/sowing/install
     53set SOWING_DIR={$ISSM_DIR}/externalpackages/sowing/install
    5454
    5555#YAMS
    56 set YAMS_DIR={$ISSM_TIER}/externalpackages/yams/install
     56set YAMS_DIR={$ISSM_DIR}/externalpackages/yams/install
    5757
    5858#TEX2IM
    59 set TEX2IM_DIR={$ISSM_TIER}/externalpackages/tex2im/install
     59set TEX2IM_DIR={$ISSM_DIR}/externalpackages/tex2im/install
    6060
    6161#Chaco
    62 set CHACO_DIR={$ISSM_TIER}/externalpackages/chaco/install
     62set CHACO_DIR={$ISSM_DIR}/externalpackages/chaco/install
    6363
    6464#MeshPart
    65 set MESHPART_DIR={$ISSM_TIER}/externalpackages/meshpart/install
     65set MESHPART_DIR={$ISSM_DIR}/externalpackages/meshpart/install
    6666
    6767#SCOTCH
    68 set SCOTCH_DIR={$ISSM_TIER}/externalpackages/scotch/install
     68set SCOTCH_DIR={$ISSM_DIR}/externalpackages/scotch/install
    6969
    7070#Development packages
    7171#automake
    72 set AUTOMAKE_DIR={$ISSM_TIER}/externalpackages/automake/install
     72set AUTOMAKE_DIR={$ISSM_DIR}/externalpackages/automake/install
    7373
    7474#autoconf
    75 set AUTOCONF_DIR={$ISSM_TIER}/externalpackages/autoconf/install
     75set AUTOCONF_DIR={$ISSM_DIR}/externalpackages/autoconf/install
    7676
    7777#borland
     
    7979
    8080#ssh
    81 set SSH_DIR={$ISSM_TIER}/externalpackages/ssh
     81set SSH_DIR={$ISSM_DIR}/externalpackages/ssh
    8282
    8383#valgrind
    84 set VALGRIND_DIR={$ISSM_TIER}/externalpackages/valgrind/install/bin
     84set VALGRIND_DIR={$ISSM_DIR}/externalpackages/valgrind/install/bin
  • TabularUnified issm/branches/trunk-jpl-damage/etc/environment_variables.sh

    r12004 r12168  
    11#
    22#
    3 #This routine can only be run if the ISSM_TIER variable has been correctly set!
     3#This routine can only be run if the ISSM_DIR variable has been correctly set!
    44#
    55#
    66
    77#MATLAB
    8 MATLAB_DIR="$ISSM_TIER/externalpackages/matlab/install"
     8MATLAB_DIR="$ISSM_DIR/externalpackages/matlab/install"
    99
    1010#MPI
    11 MPI_DIR="$ISSM_TIER/externalpackages/mpich2/install"
     11MPI_DIR="$ISSM_DIR/externalpackages/mpich2/install"
    1212
    1313#PETSC
    14 PETSC_DIR="$ISSM_TIER/externalpackages/petsc/install"
     14PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install"
    1515
    1616#SLEPC
    17 SLEPC_DIR="$ISSM_TIER/externalpackages/slepc/install"
     17SLEPC_DIR="$ISSM_DIR/externalpackages/slepc/install"
    1818
    1919#Dakota
    20 DAKOTA_DIR="$ISSM_TIER/externalpackages/dakota/install"
     20DAKOTA_DIR="$ISSM_DIR/externalpackages/dakota/install"
    2121
    2222#Qhull
    23 QHULL_DIR="$ISSM_TIER/externalpackages/qhull/install"
     23QHULL_DIR="$ISSM_DIR/externalpackages/qhull/install"
    2424
    2525#Doxygen
    26 DOXYGEN_DIR="$ISSM_TIER/externalpackages/doxygen/install"
     26DOXYGEN_DIR="$ISSM_DIR/externalpackages/doxygen/install"
    2727
    2828#MTOC
    29 MTOC_DIR="$ISSM_TIER/externalpackages/mtoc/install"
     29MTOC_DIR="$ISSM_DIR/externalpackages/mtoc/install"
    3030
    3131#Triangle
    32 TRIANGLE_DIR="$ISSM_TIER/externalpackages/triangle/install"
     32TRIANGLE_DIR="$ISSM_DIR/externalpackages/triangle/install"
    3333
    3434#METIS
    35 METIS_DIR="$ISSM_TIER/externalpackages/metis/install"
     35METIS_DIR="$ISSM_DIR/externalpackages/metis/install"
    3636
    3737#BLAS
    38 BLAS_DIR="$ISSM_TIER/externalpackages/petsc/install/externalpackages/fblaslapack"
     38BLAS_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/fblaslapack"
    3939
    4040#LAPACK
    41 LAPACK_DIR="$ISSM_TIER/externalpackages/petsc/install/externalpackages/fblaslapack/$ISSM_ARCH"
     41LAPACK_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/fblaslapack/$ISSM_ARCH"
    4242
    4343#SCALAPACK
    44 SCALAPACK_DIR="$ISSM_TIER/externalpackages/petsc/install/externalpackages/SCALAPACK/$ISSM_ARCH"
     44SCALAPACK_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/SCALAPACK/$ISSM_ARCH"
    4545
    4646#PLAPACK
    47 PLAPACK_DIR="$ISSM_TIER/externalpackages/petsc/install/externalpackages/PLAPACKR32"
     47PLAPACK_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32"
    4848
    4949#BLACS
    50 BLACS_DIR="$ISSM_TIER/externalpackages/petsc/install/externalpackages/blacs-dev/$ISSM_ARCH"
     50BLACS_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/blacs-dev/$ISSM_ARCH"
    5151
    5252#sowing
    53 SOWING_DIR="$ISSM_TIER/externalpackages/sowing/install"
     53SOWING_DIR="$ISSM_DIR/externalpackages/sowing/install"
    5454
    5555#BLACS
    56 BLACS_DIR="$ISSM_TIER/externalpackages/petsc/install/externalpackages/blacs-dev/$ISSM_ARCH"
     56BLACS_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/blacs-dev/$ISSM_ARCH"
    5757
    5858#YAMS
    59 YAMS_DIR="$ISSM_TIER/externalpackages/yams/install"
     59YAMS_DIR="$ISSM_DIR/externalpackages/yams/install"
    6060
    6161#BAMG
    62 BAMG_DIR="$ISSM_TIER/externalpackages/bamg/install"
     62BAMG_DIR="$ISSM_DIR/externalpackages/bamg/install"
    6363
    6464#Chaco
    65 CHACO_DIR="$ISSM_TIER/externalpackages/chaco/install"
     65CHACO_DIR="$ISSM_DIR/externalpackages/chaco/install"
    6666
    6767#MeshPart
    68 MESHPART_DIR="$ISSM_TIER/externalpackages/meshpart/install"
     68MESHPART_DIR="$ISSM_DIR/externalpackages/meshpart/install"
    6969
    7070#SCOTCH
    71 SCOTCH_DIR="$ISSM_TIER/externalpackages/scotch/install"
     71SCOTCH_DIR="$ISSM_DIR/externalpackages/scotch/install"
    7272
    7373#Development packages
    7474#automake
    75 AUTOMAKE_DIR="$ISSM_TIER/externalpackages/automake/install"
     75AUTOMAKE_DIR="$ISSM_DIR/externalpackages/automake/install"
    7676
    7777#libtool
    78 LIBTOOL_DIR="$ISSM_TIER/externalpackages/libtool/install"
     78LIBTOOL_DIR="$ISSM_DIR/externalpackages/libtool/install"
    7979
    8080#autoconf
    81 AUTOCONF_DIR="$ISSM_TIER/externalpackages/autoconf/install"
     81AUTOCONF_DIR="$ISSM_DIR/externalpackages/autoconf/install"
    8282
    8383#borland
     
    8888
    8989#TEX2IM                 
    90 TEX2IM_DIR="$ISSM_TIER/externalpackages/tex2im/install"
     90TEX2IM_DIR="$ISSM_DIR/externalpackages/tex2im/install"
    9191
    9292#sdk
     
    9494
    9595#ssh
    96 SSH_DIR="$ISSM_TIER/externalpackages/ssh"
     96SSH_DIR="$ISSM_DIR/externalpackages/ssh"
    9797
    9898#valgrind
    99 VALGRIND_DIR="$ISSM_TIER/externalpackages/valgrind/install/bin"
     99VALGRIND_DIR="$ISSM_DIR/externalpackages/valgrind/install/bin"
    100100
    101101#graphviz
    102 GRAPHVIZ_DIR="$ISSM_TIER/externalpackages/graphviz/install/bin"
     102GRAPHVIZ_DIR="$ISSM_DIR/externalpackages/graphviz/install/bin"
    103103
    104104#cppcheck
    105 CPPCHECK_DIR="$ISSM_TIER/externalpackages/cppcheck/install"
     105CPPCHECK_DIR="$ISSM_DIR/externalpackages/cppcheck/install"
    106106
    107107#gdal
    108 GDAL_DIR="$ISSM_TIER/externalpackages/gdal/install"
     108GDAL_DIR="$ISSM_DIR/externalpackages/gdal/install"
    109109
    110110#mercurial
    111 MERCURIAL_DIR="$ISSM_TIER/externalpackages/mercurial/install"
     111MERCURIAL_DIR="$ISSM_DIR/externalpackages/mercurial/install"
    112112
    113113#boost
    114 BOOST_DIR="$ISSM_TIER/externalpackages/boost/install"
    115 BOOSTROOT="$ISSM_TIER/externalpackages/boost/install"
     114BOOST_DIR="$ISSM_DIR/externalpackages/boost/install"
     115BOOSTROOT="$ISSM_DIR/externalpackages/boost/install"
    116116
    117117#OpenAnalysis
    118 OPENANALYSISROOT="$ISSM_TIER/externalpackages/openanalysis/install"
     118OPENANALYSISROOT="$ISSM_DIR/externalpackages/openanalysis/install"
    119119
    120120#xerces
    121 XERCESROOT="$ISSM_TIER/externalpackages/xerces/install"
    122 XERCESCROOT="$ISSM_TIER/externalpackages/xerces/src"
     121XERCESROOT="$ISSM_DIR/externalpackages/xerces/install"
     122XERCESCROOT="$ISSM_DIR/externalpackages/xerces/src"
    123123
    124124#xaifBooster
    125 XAIFBOOSTERROOT="$ISSM_TIER/externalpackages/xaifbooster/"
    126 XAIF_DIR="$ISSM_TIER/externalpackages/xaifbooster/xaifBooster"
    127 XAIFBOOSTER_HOME="$ISSM_TIER/externalpackages/xaifbooster/xaifBooster"
     125XAIFBOOSTERROOT="$ISSM_DIR/externalpackages/xaifbooster/"
     126XAIF_DIR="$ISSM_DIR/externalpackages/xaifbooster/xaifBooster"
     127XAIFBOOSTER_HOME="$ISSM_DIR/externalpackages/xaifbooster/xaifBooster"
    128128PLATFORM=x86-Linux
    129129
    130130#angel
    131 ANGELROOT="$ISSM_TIER/externalpackages/angel/angel"
     131ANGELROOT="$ISSM_DIR/externalpackages/angel/angel"
    132132
    133133#java
     
    135135
    136136#bbftp
    137 BBFTP_DIR="$ISSM_TIER/externalpackages/bbftp/install"
     137BBFTP_DIR="$ISSM_DIR/externalpackages/bbftp/install"
    138138
    139139#adic2
    140 ADIC_DIR="$ISSM_TIER/externalpackages/adic/install"
     140ADIC_DIR="$ISSM_DIR/externalpackages/adic/install"
    141141
    142142#colpack
    143 COLPACK_DIR="$ISSM_TIER/externalpackages/colpack/install"
     143COLPACK_DIR="$ISSM_DIR/externalpackages/colpack/install"
    144144
    145145#eclipse
    146 ECLIPSE_DIR="$ISSM_TIER/externalpackages/eclipse/install"
     146ECLIPSE_DIR="$ISSM_DIR/externalpackages/eclipse/install"
    147147
    148148#flaim
    149 FLAIM_DIR="$ISSM_TIER/externalpackages/flaim/install"
     149FLAIM_DIR="$ISSM_DIR/externalpackages/flaim/install"
    150150
    151151#appscan
    152 APPSCAN_DIR="$ISSM_TIER/externalpackages/appscan"
     152APPSCAN_DIR="$ISSM_DIR/externalpackages/appscan"
    153153
    154154#cppcheck
    155 CPPCHECK_DIR="$ISSM_TIER/externalpackages/cppcheck/install"
     155CPPCHECK_DIR="$ISSM_DIR/externalpackages/cppcheck/install"
    156156
    157157#rats
    158 RATS_DIR="$ISSM_TIER/externalpackages/rats/install"
     158RATS_DIR="$ISSM_DIR/externalpackages/rats/install"
    159159
    160160#dyson
    161 DYSON_DIR="$ISSM_TIER/externalpackages/dyson/"
     161DYSON_DIR="$ISSM_DIR/externalpackages/dyson/"
    162162
    163163#cmake
    164 CMAKE_DIR="$ISSM_TIER/externalpackages/cmake/install"
     164CMAKE_DIR="$ISSM_DIR/externalpackages/cmake/install"
    165165
    166166#shapelib
    167 SHAPELIB_DIR="$ISSM_TIER/externalpackages/shapelib/install"
     167SHAPELIB_DIR="$ISSM_DIR/externalpackages/shapelib/install"
    168168
    169169#cccl
    170 CCCL_DIR="$ISSM_TIER/externalpackages/cccl/install"
     170CCCL_DIR="$ISSM_DIR/externalpackages/cccl/install"
    171171
    172172#packagemaker
    173 PACKAGEMAKER_DIR="$ISSM_TIER/externalpackages/packagemaker/install"
     173PACKAGEMAKER_DIR="$ISSM_DIR/externalpackages/packagemaker/install"
     174
     175#android-dev-dir
     176ANDROID_DIR="$ISSM_DIR/externalpackages/android"
    174177
    175178#android-ndk
    176 ANDROID_NDK_DIR="$ISSM_TIER/externalpackages/android-ndk/install"
    177 
    178 #android-dev-dir
    179 ANDROID_DEV_DIR="$ISSM_TIER/externalpackages/android-dev-dir"
     179ANDROID_NDK_DIR="$ANDROID_DIR/android-ndk/install"
    180180
    181181#android-sdk
    182 ANDROID_SDK_DIR="$ISSM_TIER/externalpackages/android-sdk/install-sdk"
     182ANDROID_SDK_DIR="$ANDROID_DIR/android-sdk/install-sdk"
    183183
    184184#android-ant
    185 ANDROID_ANT_DIR="$ISSM_TIER/externalpackages/android-sdk/install-ant"
     185ANDROID_ANT_DIR="$ANDROID_DIR/android-sdk/install-ant"
    186186
    187187#gsl
    188 GSL_DIR="$ISSM_TIER/externalpackages/gsl/install"
     188GSL_DIR="$ISSM_DIR/externalpackages/gsl/install"
    189189
    190190#gnu make
    191 GMAKE_DIR="$ISSM_TIER/externalpackages/gmake/install"
     191GMAKE_DIR="$ISSM_DIR/externalpackages/gmake/install"
    192192
    193193#PYTHON
    194 PYTHON_DIR="$ISSM_TIER/externalpackages/python/install"
     194PYTHON_DIR="$ISSM_DIR/externalpackages/python/install"
    195195
    196196#MODELE
    197 MODELE_DIR="$ISSM_TIER/externalpackages/modelE"
     197MODELE_DIR="$ISSM_DIR/externalpackages/modelE"
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/adic/install.sh

    r11128 r12168  
    1919cd build
    2020../source/configure \
    21         --with-rose=$ISSM_TIER/externalpackages/rose/install \
    22         --with-openanalysis=$ISSM_TIER/externalpackages/openanalysis/openanalysis/x86_64-Linux \
    23         --with-boost=$ISSM_TIER/externalpackages/boost/install \
    24         --with-xerces=$ISSM_TIER/externalpackages/xerces/src \
    25         --with-xaifbooster=$ISSM_TIER/externalpackages/xaifbooster/xaifBooster \
    26         --with-colpack=$ISSM_TIER/externalpackages/colpack/install\
    27         --prefix=$ISSM_TIER/externalpackages/adic/install
     21        --with-rose=$ISSM_DIR/externalpackages/rose/install \
     22        --with-openanalysis=$ISSM_DIR/externalpackages/openanalysis/openanalysis/x86_64-Linux \
     23        --with-boost=$ISSM_DIR/externalpackages/boost/install \
     24        --with-xerces=$ISSM_DIR/externalpackages/xerces/src \
     25        --with-xaifbooster=$ISSM_DIR/externalpackages/xaifbooster/xaifBooster \
     26        --with-colpack=$ISSM_DIR/externalpackages/colpack/install\
     27        --prefix=$ISSM_DIR/externalpackages/adic/install
    2828if [ -z $1 ]; then
    2929        make
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/adolc/install.sh

    r12004 r12168  
    2020
    2121./configure \
    22         --prefix=$ISSM_TIER/externalpackages/adolc/install \
     22        --prefix=$ISSM_DIR/externalpackages/adolc/install \
    2323        --enable-sparse \
    2424        --enable-docexa \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/autoconf/install.sh

    r11577 r12168  
    1515#Compile autoconf
    1616cd src
    17 ./configure --prefix="$ISSM_TIER/externalpackages/autoconf/install"
     17./configure --prefix="$ISSM_DIR/externalpackages/autoconf/install"
    1818make 
    1919make install
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/automake/install.sh

    r11577 r12168  
    1313#Compile automake
    1414cd src
    15 ./configure --prefix="$ISSM_TIER/externalpackages/automake/install"
     15./configure --prefix="$ISSM_DIR/externalpackages/automake/install"
    1616make 
    1717make install
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/bbftp/install.sh

    r11101 r12168  
    1919#Configure and compile
    2020cd bbftpc
    21 ./configure --prefix=$ISSM_TIER/externalpackages/bbftp/install
     21./configure --prefix=$ISSM_DIR/externalpackages/bbftp/install
    2222make
    2323make install
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/boost/install.sh

    r12004 r12168  
    2222cd src
    2323./bootstrap.sh \
    24         --prefix="$ISSM_TIER/externalpackages/boost/install" \
     24        --prefix="$ISSM_DIR/externalpackages/boost/install" \
    2525        --with-python=python3.2 \
    26         --with-python-root="$ISSM_TIER/externalpackages/python/install"
     26        --with-python-root="$ISSM_DIR/externalpackages/python/install"
    2727
    2828#Compile boost
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/bsdtar/install-win7.sh

    r11577 r12168  
    1313
    1414cd src
    15 ./configure --prefix="$ISSM_TIER/externalpackages/bsdtar/install"
     15./configure --prefix="$ISSM_DIR/externalpackages/bsdtar/install"
    1616make
    1717make install
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/cccl/install-win7.orig.sh

    r11577 r12168  
    1515
    1616#Compile
    17 ./configure --prefix="$ISSM_TIER/externalpackages/cccl/install"
     17./configure --prefix="$ISSM_DIR/externalpackages/cccl/install"
    1818
    1919make
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/cmake/install.sh

    r11128 r12168  
    1414#Compile cmake
    1515cd install
    16 ./bootstrap --prefix=$ISSM_TIER/externalpackages/cmake/install
     16./bootstrap --prefix=$ISSM_DIR/externalpackages/cmake/install
    1717if [ -z $1 ]; then
    1818        make
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/cppcheck/install.sh

    r11128 r12168  
    1717        make -j $1
    1818fi 
    19 make install PREFIX=$ISSM_TIER/externalpackages/cppcheck/install
     19make install PREFIX=$ISSM_DIR/externalpackages/cppcheck/install
    2020cd ..
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/dakota/install-altix64-cosmos.sh

    r11101 r12168  
    2929cd src
    3030./configure \
    31         --prefix="$ISSM_TIER/externalpackages/dakota/install" \
     31        --prefix="$ISSM_DIR/externalpackages/dakota/install" \
    3232        --without-graphics  \
    3333        --with-pic \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/dakota/install-linux64-astrid.sh

    r11109 r12168  
    2929cd src
    3030./configure \
    31         --prefix="$ISSM_TIER/externalpackages/dakota/install" \
     31        --prefix="$ISSM_DIR/externalpackages/dakota/install" \
    3232        --without-graphics  \
    3333        --with-pic \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/dakota/install-linux64-murdo.sh

    r11577 r12168  
    2929cd src
    3030./configure \
    31         --prefix="$ISSM_TIER/externalpackages/dakota/install" \
     31        --prefix="$ISSM_DIR/externalpackages/dakota/install" \
    3232        --without-graphics  \
    3333        --with-pic \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/dakota/install-macosx64.sh

    r11684 r12168  
    2929cd src
    3030./configure \
    31    --prefix="$ISSM_TIER/externalpackages/dakota/install" \
     31   --prefix="$ISSM_DIR/externalpackages/dakota/install" \
    3232   --without-graphics  \
    3333   --with-pic \
    3434   --disable-mpi \
    35    --with-blas="-L$ISSM_TIER/externalpackages/petsc/install/lib -lfblas " \
    36    --with-lapack="-L$ISSM_TIER/externalpackages/petsc/install/lib -lflapack -lPLAPACK "
     35   --with-blas="-L$ISSM_DIR/externalpackages/petsc/install/lib -lfblas " \
     36   --with-lapack="-L$ISSM_DIR/externalpackages/petsc/install/lib -lflapack -lPLAPACK "
    3737cd ..
    3838
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/dakota/install-pleiades.sh

    r11101 r12168  
    2929cd src
    3030./configure \
    31         --prefix="$ISSM_TIER/externalpackages/dakota/install" \
     31        --prefix="$ISSM_DIR/externalpackages/dakota/install" \
    3232        --without-graphics  \
    3333        --with-pic \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/doxygen/install.sh

    r11241 r12168  
    88
    99#Configure doxygen
    10 cd install && ./configure --prefix "$ISSM_TIER/externalpackages/doxygen/install"
     10cd install && ./configure --prefix "$ISSM_DIR/externalpackages/doxygen/install"
    1111if [ -z $1 ]; then
    1212        make
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/gdal/install.sh

    r11128 r12168  
    1717cd src
    1818./configure \
    19         --prefix="$ISSM_TIER/externalpackages/gdal/install" \
     19        --prefix="$ISSM_DIR/externalpackages/gdal/install" \
    2020        --without-python \
    2121        --with-netcdf=no \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/gmake/install.sh

    r11748 r12168  
    1616
    1717#Configure and compile:
    18 ./configure --prefix=$ISSM_TIER/externalpackages/gmake/install
     18./configure --prefix=$ISSM_DIR/externalpackages/gmake/install
    1919
    2020if [ -z $1 ]; then
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/graphviz/install.sh

    r11128 r12168  
    1414#Configure dakota
    1515cd src
    16 ./configure --prefix="$ISSM_TIER/externalpackages/graphviz/install"
     16./configure --prefix="$ISSM_DIR/externalpackages/graphviz/install"
    1717cd ..
    1818
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/gsl/install-linux64-murdo.sh

    r11773 r12168  
    1616
    1717./configure \
    18         --prefix="$ISSM_TIER/externalpackages/gsl/install"
     18        --prefix="$ISSM_DIR/externalpackages/gsl/install"
    1919
    2020#Compile gsl
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/gsl/install-macosx64.sh

    r11747 r12168  
    1818
    1919./configure \
    20         --prefix="$ISSM_TIER/externalpackages/gsl/install"
     20        --prefix="$ISSM_DIR/externalpackages/gsl/install"
    2121
    2222#Compile gsl
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/latex2rtf/install.sh

    r11101 r12168  
    1010#Compile
    1111cd install
    12 export PREFIX="$ISSM_TIER/externalpackages/latex2rtf/install/"
     12export PREFIX="$ISSM_DIR/externalpackages/latex2rtf/install/"
    1313make
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/libtool/install.sh

    r11115 r12168  
    1313#Compile libtool
    1414cd src
    15 ./configure --prefix="$ISSM_TIER/externalpackages/libtool/install"
     15./configure --prefix="$ISSM_DIR/externalpackages/libtool/install"
    1616make 
    1717make install
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/matlab/install.sh

    r12004 r12168  
    55
    66#Select or create a new simlink
    7 #ln -s /usr/local/pkgs/matlab-7.6/ install
     7ln -s /usr/local/pkgs/matlab-7.6/ install
    88#ln -s /usr/local/matlab704/ install
    99#ln -s /usr/local/matlab711/ install
    1010ln -s /usr/local/matlab712/ install
    11 #ln -s /usr/local/pkgs/matlab-7.6/ install
    1211
    1312# Macintosh (OSX) simlink
     
    1615#ln -s /Applications/MATLAB_R2010a.app/ install
    1716#ln -s /Applications/MATLAB_R2012a.app/ install
    18 ln -s /Applications/MATLAB*.app/ install
     17#ln -s /Applications/MATLAB*.app/ install
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/metis/install-5.0.1-linux64.sh

    r11128 r12168  
    1717
    1818#Compile metis
    19 make config prefix="$ISSM_TIER/externalpackages/metis/install"
     19make config prefix="$ISSM_DIR/externalpackages/metis/install"
    2020make install
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/mpich2/install-1.0.2-altix64.sh

    r11128 r12168  
    1818export FFLAGS="$FFLAGS -fPIC"
    1919./configure \
    20         --prefix="$ISSM_TIER/externalpackages/mpich2/install" \
     20        --prefix="$ISSM_DIR/externalpackages/mpich2/install" \
    2121        --enable-sharedlibs=gcc \
    2222        --enable-f91=gfortran
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/mpich2/install-1.0.2-linux64.sh

    r11128 r12168  
    1818export FFLAGS="$FFLAGS -fPIC"
    1919./configure \
    20         --prefix="$ISSM_TIER/externalpackages/mpich2/install" \
     20        --prefix="$ISSM_DIR/externalpackages/mpich2/install" \
    2121        --enable-sharedlibs=gcc \
    2222        --enable-f91=gfortran
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/mpich2/install-1.0.2-macosx32.sh

    r11128 r12168  
    1717export CFLAGS=" -m32"
    1818./configure \
    19         --prefix="$ISSM_TIER/externalpackages/mpich2/install" \
     19        --prefix="$ISSM_DIR/externalpackages/mpich2/install" \
    2020        --enable-f91=gfortran \
    2121        --enable-sharedlibs=osx-gcc
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/mpich2/install-1.0.2-win32.sh

    r11128 r12168  
    1717export CFLAGS="$CFLAGS -fPIC"
    1818export FFLAGS="$FFLAGS -fPIC"
    19 ./configure --prefix="$ISSM_TIER/externalpackages/mpich2/install"
     19./configure --prefix="$ISSM_DIR/externalpackages/mpich2/install"
    2020
    2121#Apply Patch to examples
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/mpich2/install-1.4-linux64.sh

    r11128 r12168  
    1717export FFLAGS="$FFLAGS -fPIC"
    1818./configure \
    19         --prefix="$ISSM_TIER/externalpackages/mpich2/install" \
     19        --prefix="$ISSM_DIR/externalpackages/mpich2/install" \
    2020        --enable-shared \
    2121        --enable-sharedlibs=gcc \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/mpich2/install-1.4-macosx32.sh

    r11577 r12168  
    1919export CPPFLAGS=" -arch i386"
    2020./configure \
    21         --prefix="$ISSM_TIER/externalpackages/mpich2/install" \
     21        --prefix="$ISSM_DIR/externalpackages/mpich2/install" \
    2222        --enable-f91=gfortran \
    2323        --enable-sharedlibs=osx-gcc \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/mpich2/install-1.4-macosx64.sh

    r11128 r12168  
    1919export CXXFLAGS=" -arch x86_64"
    2020./configure \
    21         --prefix="$ISSM_TIER/externalpackages/mpich2/install" \
     21        --prefix="$ISSM_DIR/externalpackages/mpich2/install" \
    2222        --enable-f91 \
    2323        --enable-sharedlibs=osx-gcc \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/ncview/install.sh

    r11101 r12168  
    1515cd install
    1616./configure \
    17         --prefix "$ISSM_TIER/externalpackages/ncview/install" \
     17        --prefix "$ISSM_DIR/externalpackages/ncview/install" \
    1818        --x-libraries=/usr/X11/lib/ \
    1919        --x-includes=/usr/X11/include/ \
    20         --with-netcdf_incdir="$ISSM_TIER/externalpackages/netcdf/install/include/" \
    21         --with-netcdf_libdir="$ISSM_TIER/externalpackages/netcdf/install/lib/"
     20        --with-netcdf_incdir="$ISSM_DIR/externalpackages/netcdf/install/include/" \
     21        --with-netcdf_libdir="$ISSM_DIR/externalpackages/netcdf/install/lib/"
    2222
    2323make
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/netcdf/install.sh

    r11128 r12168  
    1515#Configure and compile
    1616cd install
    17 ./configure  --prefix="$ISSM_TIER/externalpackages/netcdf/install"
     17./configure  --prefix="$ISSM_DIR/externalpackages/netcdf/install"
    1818if [ -z $1 ]; then
    1919        make
  • issm/branches/trunk-jpl-damage/externalpackages/nose

    • Property svn:ignore
      • TabularUnified  

        old new  
        11py3k
         2src-*
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/nose/install-macosx64sh

    r11841 r12168  
    11#/bin/bash
    2 #Install Python3 nose module
     2#Install Python nose module
    33
    4 rm -rf py3k
     4pythonversion=2
     5       
     6rm -rf src
    57
    6 svn checkout http://python-nose.googlecode.com/svn/branches/py3k
    7 cd py3k
     8if [[ $pythonversion == "3" ]];then
    89
    9 python3.2 ./setup.py build
    10 python3.2 ./setup.py install
     10        svn checkout http://python-nose.googlecode.com/svn/branches/py3k
     11        mv py3k src
     12
     13        cd src
     14        python ./setup.py build
     15        python ./setup.py install
     16fi
     17
     18if [[ $pythonversion == "2" ]];then
     19
     20        tar -zxvf  nose-1.1.2.tar.gz
     21        mv nose-1.1.2 src
     22        rm -rf nose-1.1.2
     23
     24        cd src
     25        python ./setup.py build
     26        python ./setup.py install
     27fi
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/pcre/install.sh

    r11128 r12168  
    1313#Configure doxygen
    1414cd install
    15 ./configure --prefix "$ISSM_TIER/externalpackages/python/install"
     15./configure --prefix "$ISSM_DIR/externalpackages/python/install"
    1616make
    1717make install
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-2.3.2-altix64-castor.sh

    r11106 r12168  
    1717        cd install
    1818        ./config/configure.py \
    19                 --prefix="$ISSM_TIER/externalpackages/petsc/install" \
     19                --prefix="$ISSM_DIR/externalpackages/petsc/install" \
    2020                --with-batch=1  \
    2121                --ISSM_ARCH=$ISSM_ARCH \
     
    4141        cd install
    4242        ./config/configure.py  \
    43                 --prefix="$ISSM_TIER/externalpackages/petsc/install" \
     43                --prefix="$ISSM_DIR/externalpackages/petsc/install" \
    4444                --with-batch=1  \
    4545                --ISSM_ARCH=$ISSM_ARCH \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-2.3.2-cosmos.sh

    r11128 r12168  
    1212#configure
    1313cd install
    14 PETSC_DIR=$ISSM_TIER/externalpackages/petsc/install
     14PETSC_DIR=$ISSM_DIR/externalpackages/petsc/install
    1515./config/configure.py  \
    1616        --prefix=$PETSC_DIR \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-2.3.2-linux64-astrid.sh

    r11128 r12168  
    1313cd install
    1414./config/configure.py  \
    15         --prefix="$ISSM_TIER/externalpackages/petsc/install" \
    16         --with-mpi-dir=$ISSM_TIER/externalpackages/mpich2/install \
     15        --prefix="$ISSM_DIR/externalpackages/petsc/install" \
     16        --with-mpi-dir=$ISSM_DIR/externalpackages/mpich2/install \
    1717        --PETSC_ARCH=linux-gnu-amd64 \
    18         --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/install" \
     18        --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install" \
    1919        --with-fc=gfortran \
    2020        --with-debugging=1 \
     
    2525        --download-blas=yes \
    2626        --download-f-blas-lapack=yes \
    27         --FFLAGS=-I$ISSM_TIER/externalpackages/mpich2/install/include \
     27        --FFLAGS=-I$ISSM_DIR/externalpackages/mpich2/install/include \
    2828        --download-plapack=yes \
    2929        --COPTFLAGS="-march=opteron -O2" \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-2.3.2-macosx32-eric.sh

    r11128 r12168  
    1717        cd install
    1818        ./config/configure.py  \
    19                 --prefix="$ISSM_TIER/externalpackages/petsc/install" \
    20                 --with-mpi-dir=$ISSM_TIER/externalpackages/mpich2/install \
     19                --prefix="$ISSM_DIR/externalpackages/petsc/install" \
     20                --with-mpi-dir=$ISSM_DIR/externalpackages/mpich2/install \
    2121                --PETSC_ARCH=macosx-gnu \
    22                 --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/install" \
     22                --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install" \
    2323                --with-fc=/usr/local/bin/gfortran \
    2424                --with-debugging=0 \
     
    2929                --download-blas=yes \
    3030                --download-f-blas-lapack=yes \
    31                 --FFLAGS="-I$ISSM_TIER/externalpackages/mpich2/install/include -L$ISSM_TIER/externalpackages/mpich2/install/lib -L/usr/local/bin -lmpich -lpmpich -lgfortran  -fPIC -arch i386" \
     31                --FFLAGS="-I$ISSM_DIR/externalpackages/mpich2/install/include -L$ISSM_DIR/externalpackages/mpich2/install/lib -L/usr/local/bin -lmpich -lpmpich -lgfortran  -fPIC -arch i386" \
    3232                --download-plapack=yes \
    3333                --CXXFLAGS=" -fPIC -arch i386" \
     
    4343        cd install
    4444        ./config/configure.py  \
    45                 --prefix="$ISSM_TIER/externalpackages/petsc/install" \
    46                 --with-mpi-dir=$ISSM_TIER/externalpackages/mpich2/install \
     45                --prefix="$ISSM_DIR/externalpackages/petsc/install" \
     46                --with-mpi-dir=$ISSM_DIR/externalpackages/mpich2/install \
    4747                --PETSC_ARCH=macosx-gnu \
    48                 --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/install" \
     48                --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install" \
    4949                --with-fc=/usr/local/bin/gfortran \
    5050                --with-debugging=0 \
    5151                --with-shared=0 \
    52                 --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/externalpackages/MUMPS_4.6.3  \
     52                --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/MUMPS_4.6.3  \
    5353                --download-scalapack=yes \
    5454                --download-blacs=yes \
    5555                --download-blas=yes \
    5656                --download-f-blas-lapack=yes \
    57                 --FFLAGS="-I$ISSM_TIER/externalpackages/mpich2/install/include -L$ISSM_TIER/externalpackages/mpich2/install/lib -L/usr/local/bin -lmpich -lpmpich -lgfortran  -fPIC -arch i386" \
     57                --FFLAGS="-I$ISSM_DIR/externalpackages/mpich2/install/include -L$ISSM_DIR/externalpackages/mpich2/install/lib -L/usr/local/bin -lmpich -lpmpich -lgfortran  -fPIC -arch i386" \
    5858                --download-plapack=yes \
    5959                --CXXFLAGS=" -fPIC -arch i386" \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-2.3.2-macosx32-ogive.sh

    r11128 r12168  
    1212#configure
    1313cd install
    14 ./config/configure.py  --prefix="$ISSM_TIER/externalpackages/petsc/install" \
    15         --with-mpi-dir=$ISSM_TIER/externalpackages/mpich2/install \
     14./config/configure.py  --prefix="$ISSM_DIR/externalpackages/petsc/install" \
     15        --with-mpi-dir=$ISSM_DIR/externalpackages/mpich2/install \
    1616        --PETSC_ARCH=macosx-gnu \
    17         --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/install" \
     17        --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install" \
    1818        --with-fc=/usr/local/bin/gfortran \
    1919        --with-debugging=0 \
     
    2424        --download-blas=yes \
    2525        --download-f-blas-lapack=yes \
    26         --FFLAGS="-I$ISSM_TIER/externalpackages/mpich2/install/include -L$ISSM_TIER/externalpackages/mpich2/install/lib -L/usr/local/bin -lmpich -lpmpich -lgfortran" \
     26        --FFLAGS="-I$ISSM_DIR/externalpackages/mpich2/install/include -L$ISSM_DIR/externalpackages/mpich2/install/lib -L/usr/local/bin -lmpich -lpmpich -lgfortran" \
    2727        --download-plapack=yes
    2828
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-2.3.2-macosx64.sh

    r12004 r12168  
    1313cd src
    1414./config/configure.py \
    15   --prefix="$ISSM_TIER/externalpackages/petsc/install" \
    16   --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
     15  --prefix="$ISSM_DIR/externalpackages/petsc/install" \
     16  --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
    1717  --PETSC_ARCH=macosx-gnu \
    18   --with-mpi-dir="$ISSM_TIER/externalpackages/mpich2/install" \
     18  --with-mpi-dir="$ISSM_DIR/externalpackages/mpich2/install" \
    1919  --with-debugging=0 \
    2020  --with-shared-libraries=0 \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-2.3.2-pleiades.sh

    r11106 r12168  
    1717        cd install
    1818        ./config/configure.py  \
    19                 --prefix="$ISSM_TIER/externalpackages/petsc/install" \
     19                --prefix="$ISSM_DIR/externalpackages/petsc/install" \
    2020                --with-batch=1  \
    2121                --PETSC_ARCH=$ISSM_ARCH \
     
    4444        cd install
    4545        ./config/configure.py  \
    46                 --prefix="$ISSM_TIER/externalpackages/petsc/install" \
     46                --prefix="$ISSM_DIR/externalpackages/petsc/install" \
    4747                --with-batch=1  \
    4848                --PETSC_ARCH=$ISSM_ARCH \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-2.3.2-win32-eric.sh

    r11128 r12168  
    1414./config/configure.py  \
    1515        --with-parallel-no \
    16         --prefix="$ISSM_TIER/externalpackages/petsc/install" \
     16        --prefix="$ISSM_DIR/externalpackages/petsc/install" \
    1717        --PETSC_ARCH=cygwin-intel \
    18         --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/install" \
     18        --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install" \
    1919        --with-debugging=0 \
    2020        --with-mpi=0 \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-2.3.2-win7.sh

    r11386 r12168  
    1414./config/configure.py  \
    1515        --with-parallel-no \
    16         --prefix="$ISSM_TIER/externalpackages/petsc/install" \
     16        --prefix="$ISSM_DIR/externalpackages/petsc/install" \
    1717        --PETSC_ARCH=cygwin-intel \
    18         --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/install" \
     18        --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install" \
    1919        --with-debugging=0 \
    2020        --with-mpi=0 \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-3.1-altix64-castor.sh

    r11106 r12168  
    1717        cd src
    1818        ./config/configure.py \
    19           --prefix="$ISSM_TIER/externalpackages/petsc/install" \
    20           --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
     19          --prefix="$ISSM_DIR/externalpackages/petsc/install" \
     20          --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
    2121          --ISSM_ARCH=$ISSM_ARCH \
    2222          --with-debugging=no \
     
    4141        cd src
    4242        ./config/configure.py \
    43                 --prefix="$ISSM_TIER/externalpackages/petsc/install" \
    44                 --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
     43                --prefix="$ISSM_DIR/externalpackages/petsc/install" \
     44                --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
    4545                --with-batch=1  \
    4646                --ISSM_ARCH=$ISSM_ARCH \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-3.1-cosmos.sh

    r11128 r12168  
    1313cd src
    1414./config/configure.py \
    15         --prefix="$ISSM_TIER/externalpackages/petsc/install" \
    16         --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
     15        --prefix="$ISSM_DIR/externalpackages/petsc/install" \
     16        --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
    1717        --with-batch=1  \
    1818        --ISSM_ARCH=$ISSM_ARCH \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-3.1-linux64-astrid.sh

    r11128 r12168  
    1313cd src
    1414./config/configure.py \
    15  --prefix="$ISSM_TIER/externalpackages/petsc/install" \
    16  --with-mpi-dir=$ISSM_TIER/externalpackages/mpich2/install \
     15 --prefix="$ISSM_DIR/externalpackages/petsc/install" \
     16 --with-mpi-dir=$ISSM_DIR/externalpackages/mpich2/install \
    1717 --PETSC_ARCH=linux-gnu-amd64 \
    18  --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
     18 --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
    1919 --with-debugging=0 \
    2020 --with-shared=0 \
     
    2525 --download-f-blas-lapack=yes \
    2626 --download-parmetis=yes \
    27  --FFLAGS=-I$ISSM_TIER/externalpackages/mpich2/install/include \
     27 --FFLAGS=-I$ISSM_DIR/externalpackages/mpich2/install/include \
    2828 --download-plapack=yes \
    2929 --COPTFLAGS="-march=opteron -O2" \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-3.1-macosx32-mathieu.sh

    r11128 r12168  
    1313cd src
    1414./config/configure.py  \
    15  --prefix="$ISSM_TIER/externalpackages/petsc/install" \
    16  --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
     15 --prefix="$ISSM_DIR/externalpackages/petsc/install" \
     16 --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
    1717 --PETSC_ARCH=macosx-gnu \
    18  --with-mpi-dir=$ISSM_TIER/externalpackages/mpich2/install \
     18 --with-mpi-dir=$ISSM_DIR/externalpackages/mpich2/install \
    1919 --with-debugging=0 \
    2020 --with-shared=0 \
     
    2525 --download-f-blas-lapack=yes \
    2626 --download-plapack=yes \
    27  --FFLAGS="-I$ISSM_TIER/externalpackages/mpich2/install/include -arch i386" \
     27 --FFLAGS="-I$ISSM_DIR/externalpackages/mpich2/install/include -arch i386" \
    2828 --COPTFLAGS="-march=opteron -O2 -arch i386" \
    2929 --FOPTFLAGS="-march=opteron -O2 -arch i386" \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-3.1-macosx32-ogive.sh

    r11128 r12168  
    1313cd src
    1414./config/configure.py \
    15         --prefix="$ISSM_TIER/externalpackages/petsc/install" \
    16         --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
    17         --with-mpi-dir=$ISSM_TIER/externalpackages/mpich2/install \
     15        --prefix="$ISSM_DIR/externalpackages/petsc/install" \
     16        --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
     17        --with-mpi-dir=$ISSM_DIR/externalpackages/mpich2/install \
    1818        --PETSC_ARCH=macosx-gnu \
    1919        --with-fc=/usr/local/bin/gfortran \
     
    3030        --FOPTFLAGS="-march=opteron -O2 " \
    3131        --CXXOPTFLAGS="-march=opteron -O2 " \
    32         --FFLAGS="-I$ISSM_TIER/externalpackages/mpich2/install/include -L$ISSM_TIER/externalpackages/mpich2/install/lib -L/usr/local/bin -lmpich -lpmpich -lgfortran "
     32        --FFLAGS="-I$ISSM_DIR/externalpackages/mpich2/install/include -L$ISSM_DIR/externalpackages/mpich2/install/lib -L/usr/local/bin -lmpich -lpmpich -lgfortran "
    3333
    3434#Compile petsc and install it
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-3.1-pleiades.sh

    r11106 r12168  
    1717        cd src
    1818        ./config/configure.py \
    19                 --prefix="$ISSM_TIER/externalpackages/petsc/install" \
     19                --prefix="$ISSM_DIR/externalpackages/petsc/install" \
    2020                --with-batch=1  \
    2121                --PETSC_ARCH="$ISSM_ARCH" \
    22                 --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
     22                --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
    2323                --with-debugging=no \
    2424                --with-shared=0 \
     
    4444        cd src
    4545        ./config/configure.py \
    46          --prefix="$ISSM_TIER/externalpackages/petsc/install" \
     46         --prefix="$ISSM_DIR/externalpackages/petsc/install" \
    4747         --with-batch=1  \
    4848         --PETSC_ARCH="$ISSM_ARCH" \
    49          --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
     49         --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
    5050         --with-debugging=no \
    5151         --with-shared=0 \
     
    5757         --download-scalapack=yes \
    5858         --download-blacs=yes  \
    59          --with-plapack-dir=$ISSM_TIER/externalpackages/petsc/src/$ISSM_ARCH \
     59         --with-plapack-dir=$ISSM_DIR/externalpackages/petsc/src/$ISSM_ARCH \
    6060         --download-parmetis=yes \
    6161         --FFLAGS=-I/usr/include \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-3.1-win7.sh

    r12004 r12168  
    1414./config/configure.py  \
    1515        --with-parallel-no \
    16         --prefix="$ISSM_TIER/externalpackages/petsc/install" \
     16        --prefix="$ISSM_DIR/externalpackages/petsc/install" \
    1717        --PETSC_ARCH=cygwin-intel \
    18         --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
     18        --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
    1919        --with-debugging=0 \
    2020        --with-mpi=0 \
     
    2626
    2727#./config/configure.py  \
    28 # --prefix="$ISSM_TIER/externalpackages/petsc/install" \
    29 # --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
     28# --prefix="$ISSM_DIR/externalpackages/petsc/install" \
     29# --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
    3030# --PETSC_ARCH=macosx-gnu \
    31 # --with-mpi-dir=$ISSM_TIER/externalpackages/mpich2/install \
     31# --with-mpi-dir=$ISSM_DIR/externalpackages/mpich2/install \
    3232# --with-debugging=0 \
    3333# --with-shared=0 \
     
    3838# --download-f-blas-lapack=yes \
    3939# --download-plapack=yes \
    40 # --FFLAGS="-I$ISSM_TIER/externalpackages/mpich2/install/include -arch i386" \
     40# --FFLAGS="-I$ISSM_DIR/externalpackages/mpich2/install/include -arch i386" \
    4141# --COPTFLAGS="-march=opteron -O2 -arch i386" \
    4242# --FOPTFLAGS="-march=opteron -O2 -arch i386" \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-3.2-greenplanet.sh

    r11382 r12168  
    1313cd src
    1414./config/configure.py \
    15         --prefix="$ISSM_TIER/externalpackages/petsc/install" \
    16         --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
     15        --prefix="$ISSM_DIR/externalpackages/petsc/install" \
     16        --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
    1717        --PETSC_ARCH="$ISSM_ARCH" \
    1818        --with-batch=1 \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-3.2-linux64.sh

    r11167 r12168  
    1313cd src
    1414./config/configure.py \
    15         --prefix="$ISSM_TIER/externalpackages/petsc/install" \
    16         --with-mpi-dir=$ISSM_TIER/externalpackages/mpich2/install \
     15        --prefix="$ISSM_DIR/externalpackages/petsc/install" \
     16        --with-mpi-dir=$ISSM_DIR/externalpackages/mpich2/install \
    1717        --with-clanguage=C++ \
    1818        --PETSC_ARCH=linux-gnu-amd64 \
    19         --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
     19        --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
    2020        --with-debugging=0 \
    2121        --with-shared-libraries=0 \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-3.2-macosx64.sh

    r11128 r12168  
    1313cd src
    1414./config/configure.py \
    15   --prefix="$ISSM_TIER/externalpackages/petsc/install" \
    16   --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
     15  --prefix="$ISSM_DIR/externalpackages/petsc/install" \
     16  --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
    1717  --PETSC_ARCH=macosx-gnu \
    18   --with-mpi-dir="$ISSM_TIER/externalpackages/mpich2/install" \
     18  --with-mpi-dir="$ISSM_DIR/externalpackages/mpich2/install" \
    1919  --with-debugging=0 \
    2020  --with-shared-libraries=0 \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-3.2-pleiades.sh

    r11110 r12168  
    1717        cd src
    1818        ./config/configure.py \
    19                 --prefix="$ISSM_TIER/externalpackages/petsc/install" \
     19                --prefix="$ISSM_DIR/externalpackages/petsc/install" \
    2020                --with-batch=1  \
    2121                --PETSC_ARCH="$ISSM_ARCH" \
    22                 --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
     22                --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
    2323                --with-debugging=0 \
    2424                --with-shared-libraries=0 \
     
    4444        cd src
    4545        ./config/configure.py \
    46          --prefix="$ISSM_TIER/externalpackages/petsc/install" \
     46         --prefix="$ISSM_DIR/externalpackages/petsc/install" \
    4747         --with-batch=1  \
    4848         --PETSC_ARCH="$ISSM_ARCH" \
    49          --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
     49         --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
    5050         --with-debugging=0 \
    5151         --with-shared-libraries=0 \
     
    5757         --download-scalapack=yes \
    5858         --download-blacs=yes  \
    59          --with-plapack-dir=$ISSM_TIER/externalpackages/petsc/src/$ISSM_ARCH \
     59         --with-plapack-dir=$ISSM_DIR/externalpackages/petsc/src/$ISSM_ARCH \
    6060         --download-parmetis=yes \
    6161         --FFLAGS=-I/usr/include \
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/petsc/install-dev-linux64.sh

    r12004 r12168  
    66        # Adapted from petsc 3.2.
    77        # Used Mercurial to get code
     8        rm -rf src
    89        hg clone http://petsc.cs.iit.edu/petsc/petsc-dev src
    910        cd src
     
    2526
    2627if [ $STEP -eq 2 ]; then
     28        rm -rf install
    2729        cd src
    2830        ./config/configure.py \
    29         --prefix="$ISSM_TIER/externalpackages/petsc/install" \
    30         --with-mpi-dir="$ISSM_TIER/externalpackages/mpich2/install" \
     31        --prefix="$ISSM_DIR/externalpackages/petsc/install" \
     32        --with-mpi-dir="$ISSM_DIR/externalpackages/mpich2/install" \
    3133        --with-clanguage=C++ \
    3234        --PETSC_ARCH=linux-gnu-amd64 \
    33         --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
     35        --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
    3436        --with-debugging=0 \
    3537        --with-shared-libraries=0 \
     
    4244        --download-plapack=yes \
    4345        --download-parmetis=yes \
     46        --download-spai=yes \
    4447        --with-pic=1
    4548
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/python/install.sh

    r12004 r12168  
    2020#Configure doxygen
    2121cd src
    22 ./configure --prefix="$ISSM_TIER/externalpackages/python/install" --enable-framework="$ISSM_TIER/externalpackages/python/install"
     22./configure --prefix="$ISSM_DIR/externalpackages/python/install" --enable-framework="$ISSM_DIR/externalpackages/python/install"
    2323if [ -z $1 ]; then
    2424        make
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/qhull/install.sh

    r11128 r12168  
    1515#Configure qhull
    1616cd src
    17 ./configure --prefix="$ISSM_TIER/externalpackages/qhull/install"
     17./configure --prefix="$ISSM_DIR/externalpackages/qhull/install"
    1818make
    1919make install
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/rats/install.sh

    r11128 r12168  
    1212#compile
    1313cd src
    14 ./configure --prefix=$ISSM_TIER/externalpackages/rats/install
     14./configure --prefix=$ISSM_DIR/externalpackages/rats/install
    1515make
    1616make install
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/rose/install.sh

    r11128 r12168  
    1515cd build
    1616../source/configure \
    17         --prefix=$ISSM_TIER/externalpackages/rose/install \
    18         --with-boost=$ISSM_TIER/externalpackages/boost/install\
    19         --srcdir=$ISSM_TIER/externalpackages/rose/source
     17        --prefix=$ISSM_DIR/externalpackages/rose/install \
     18        --with-boost=$ISSM_DIR/externalpackages/boost/install\
     19        --srcdir=$ISSM_DIR/externalpackages/rose/source
    2020
    2121if [ -z $1 ]; then
  • issm/branches/trunk-jpl-damage/externalpackages/scipy

    • Property svn:ignore
      • TabularUnified  

        old new  
        11scipy
         2scipy-*
        23numpy
         4numpy-*
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/scipy/install-macosx64.sh

    r11944 r12168  
    1919        #install numpy
    2020        cd numpy
    21         python3.2 setup.py build
    22         python3.2 setup.py install
     21        python setup.py build
     22        python setup.py install
    2323
    2424       
     
    3030        #install scipy
    3131        cd scipy
    32         python3.2 setup.py build
    33         python3.2 setup.py install
     32        python setup.py build
     33        python setup.py install
    3434
    3535elif [[ $install == "3" ]];then
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/swig/install.sh

    r11113 r12168  
    1313#Copy pcre prototype in include directory
    1414cd install
    15 #cp $ISSM_TIER/externalpackages/pcre/install/pcre.h  ./Source/Include/
    16 #cp $ISSM_TIER/externalpackages/pcre/install/.libs/*  ./Source/Include/
    17 export CFLAGS="$CFLAGS -I$ISSM_TIER/externalpackages/pcre/install"
    18 export LDFLAGS="-L$ISSM_TIER/externalpackages/pcre/install/.libs/"
     15#cp $ISSM_DIR/externalpackages/pcre/install/pcre.h  ./Source/Include/
     16#cp $ISSM_DIR/externalpackages/pcre/install/.libs/*  ./Source/Include/
     17export CFLAGS="$CFLAGS -I$ISSM_DIR/externalpackages/pcre/install"
     18export LDFLAGS="-L$ISSM_DIR/externalpackages/pcre/install/.libs/"
    1919export LIBS="-lpcre"
    2020#Configure doxygen
    2121./configure \
    22  --prefix="$ISSM_TIER/externalpackages/python/install" \
    23  --with-pcre-prefix="$ISSM_TIER/externalpackages/pcre/install" \
    24  --with-pcre-exec-prefix="$ISSM_TIER/externalpackages/pcre/install"
     22 --prefix="$ISSM_DIR/externalpackages/python/install" \
     23 --with-pcre-prefix="$ISSM_DIR/externalpackages/pcre/install" \
     24 --with-pcre-exec-prefix="$ISSM_DIR/externalpackages/pcre/install"
    2525make
    2626make install
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/tao/install.sh

    r11577 r12168  
    1414rm -rf tao-2.0-p3
    1515cd install
    16 export TAO_DIR="$ISSM_TIER/externalpackages/tao/install/"
     16export TAO_DIR="$ISSM_DIR/externalpackages/tao/install/"
    1717
    1818#petsc needs to be compiled with --with-clanguage=C++
  • issm/branches/trunk-jpl-damage/externalpackages/triangle

    • Property svn:ignore
      • TabularUnified  

        old new  
        11install
         2install-matlab
         3install-python
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/triangle/configs/android/android-4.0/configure.make

    r11989 r12168  
    1111
    1212ANDROID_BIN=$(ISSM_TIER)/src/android/tmp/android-14-toolchain/bin
    13 CC=$(ANDROID_DEV_DIR)/tmp/android-linux-4.0/bin/arm-linux-androideabi-gcc
    14 AR=$(ANDROID_DEV_DIR)/tmp/android-linux-4.0/bin/arm-linux-androideabi-ar
    15 RANLIB=$(ANDROID_DEV_DIR)/tmp/android-linux-4.0/bin/arm-linux-androideabi-ranlib
    16 CSWITCHES = $(CFLAGS)  -I/usr/X11R6/include -L/usr/X11R6/lib -I$(MATLAB_DIR)/extern/include -fPIC -I$(MATLAB_DIR)/include
     13CC=$(ANDROID_DIR)/arm-linux-android-4.0/bin/arm-linux-androideabi-gcc
     14AR=$(ANDROID_DIR)/arm-linux-android-4.0/bin/arm-linux-androideabi-ar
     15RANLIB=$(ANDROID_DIR)/arm-linux-android-4.0/bin/arm-linux-androideabi-ranlib
     16CSWITCHES = $(CFLAGS)
    1717TRILIBDEFS = -DTRILIBRARY
    1818OBJ_EXT=o
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/triangle/triangle.c.patch.python

    r12004 r12168  
    55>  * double precision activation in exactinit(); The rest is not changed.
    66>  * We also created the ice_makefile to compile Triangle into a library. */
    7 > #include <mat.h>
    8 > #include <matrix.h>
     7> /* #include <mat.h>
     8> #include <matrix.h> */
    99> #define ANSI_DECLARATORS
    1010> #define NO_TIMER
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/valgrind/install-altix64.sh

    r11187 r12168  
    1414#configure
    1515cd install
    16 ./configure --prefix="$ISSM_TIER/externalpackages/valgrind/install"
     16./configure --prefix="$ISSM_DIR/externalpackages/valgrind/install"
    1717
    1818#Compile valgrind
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/valgrind/install-linux64.sh

    r11187 r12168  
    1414#configure
    1515cd install
    16 ./configure  --prefix="$ISSM_TIER/externalpackages/valgrind/install"
     16./configure  --prefix="$ISSM_DIR/externalpackages/valgrind/install"
    1717
    1818#Compile valgrind
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/valgrind/install-macosx32.sh

    r11187 r12168  
    1414#configure
    1515cd install
    16 ./configure  --prefix="$ISSM_TIER/externalpackages/valgrind/install" --enable-only32bit
     16./configure  --prefix="$ISSM_DIR/externalpackages/valgrind/install" --enable-only32bit
    1717
    1818#Compile valgrind
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/valgrind/install-macosx64.sh

    r11187 r12168  
    1414#configure
    1515cd install
    16 ./configure  --prefix="$ISSM_TIER/externalpackages/valgrind/install" --enable-only64bit
     16./configure  --prefix="$ISSM_DIR/externalpackages/valgrind/install" --enable-only64bit
    1717
    1818#Compile valgrind
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/valgrind/install-win32.sh

    r11187 r12168  
    1414#configure
    1515cd install
    16 ./configure  --prefix="$ISSM_TIER/externalpackages/valgrind/install"
     16./configure  --prefix="$ISSM_DIR/externalpackages/valgrind/install"
    1717
    1818#Compile valgrind
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/vim/install.sh

    r11128 r12168  
    1919cd src/src
    2020./configure \
    21         --prefix "$ISSM_TIER/externalpackages/vim/install" \
     21        --prefix "$ISSM_DIR/externalpackages/vim/install" \
    2222        --with-gcc "/usr/bin/gcc"
    2323
  • TabularUnified issm/branches/trunk-jpl-damage/externalpackages/windows/configs/sdk7.1.win7-64.sh

    r12004 r12168  
    1515declare -x LOCALAPPDATA="C:\\Users\\schlegel\\AppData\\Local"
    1616declare -x MANPATH="/usr/local/man:/usr/share/man:/usr/man:"
    17 declare -x PATH="/usr/local/bin:/usr/bin:/usr/include:/cygdrive/c/cygwin/usr/bin:/cygdrive/c/cygwin/usr/include:/cygdrive/c/Windows/Microsoft.NET/Framework64/v4.0.30319:/cygdrive/c/Windows/Microsoft.NET/Framework/v4.0.30319:/cygdrive/c/Windows/Microsoft.NET/Framework64/v3.5:/cygdrive/c/Windows/Microsoft.NET/Framework/v3.5:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/Tools:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/Bin/amd64:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/Bin/VCPackages:/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.1/Bin/NETFX 4.0 Tools/x64:/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.1/Bin/x64:/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.1/Bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files/Microsoft Windows Performance Toolkit:/cygdrive/c/MATLAB/R2011b/runtime/win64:/cygdrive/b/MATLAB/R2011b/bin:/cygdrive/c/MATLAB/R2011b/extern/include:/cygdrive/c/MATLAB/R2011a/runtime/win64:/cygdrive/c/MATLAB/R2011a/bin:/cygdrive/c/MATLAB/R2011a/extern/include"
     17declare -x PATH="/usr/local/bin:/usr/bin:/usr/include:/cygdrive/c/cygwin/usr/bin:/cygdrive/c/cygwin/usr/include:/cygdrive/c/Windows/Microsoft.NET/Framework64/v4.0.30319:/cygdrive/c/Windows/Microsoft.NET/Framework/v4.0.30319:/cygdrive/c/Windows/Microsoft.NET/Framework64/v3.5:/cygdrive/c/Windows/Microsoft.NET/Framework/v3.5:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/Tools:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/Bin/amd64:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/Bin/VCPackages:/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.1/Bin/NETFX 4.0 Tools/x64:/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.1/Bin/x64:/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.1/Bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files/Microsoft Windows Performance Toolkit:/cygdrive/c/MATLAB/R2012a/runtime/win64:/cygdrive/c/MATLAB/R2012a/bin:/cygdrive/c/MATLAB/R2012a/extern/include:/cygdrive/c/MATLAB/R2011a/runtime/win64:/cygdrive/c/MATLAB/R2011a/bin:/cygdrive/c/MATLAB/R2011a/extern/include"
    1818declare -x PATHEXT=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"
    1919declare -x PROCESSOR_ARCHITECTURE="x86"
  • TabularUnified issm/branches/trunk-jpl-damage/m4/issm_options.m4

    r12004 r12168  
    1313        fi
    1414        dnl }}}
    15         dnl Serial build {{{
    16         AC_ARG_WITH([serial],
    17                 AS_HELP_STRING([--with-serial = value],[serial compilation. ]),
    18                 [SERIAL_VALUE=$withval],[SERIAL_VALUE="yes"])
    19         AC_MSG_CHECKING(for serial compilation)
    20         AM_CONDITIONAL([NOSERIAL], [test $SERIAL_VALUE = no])
    21         AM_CONDITIONAL([SERIAL], [test $SERIAL_VALUE = yes])
    22         AC_MSG_RESULT($SERIAL_VALUE)
    23         dnl }}}
    24         dnl Parallel build {{{
    25         AC_ARG_WITH([parallel],
    26                 AS_HELP_STRING([--with-parallel = value], [parallel compilation. ]),
    27                 [PARALLEL_VALUE=$withval],[PARALLEL_VALUE="yes"])
    28         AC_MSG_CHECKING(for parallel compilation)
    29         AM_CONDITIONAL([NOPARALLEL], [test $PARALLEL_VALUE = no])
    30         AM_CONDITIONAL([PARALLEL], [test $PARALLEL_VALUE = yes])
    31         AC_MSG_RESULT($PARALLEL_VALUE)
     15        dnl Modules build {{{
     16        AC_ARG_WITH([modules],
     17                AS_HELP_STRING([--with-modules = value],[modules compilation. ]),
     18                [MODULES_VALUE=$withval],[MODULES_VALUE="yes"])
     19        AC_MSG_CHECKING(for modules compilation)
     20        AM_CONDITIONAL([MODULES], [test $MODULES_VALUE = yes])
     21        AC_MSG_RESULT($MODULES_VALUE)
     22        dnl }}}
     23        dnl Extensions{{{
    3224        ISSMEXT=".exe"
    3325        AC_SUBST([ISSMEXT])
    34         dnl }}}
    35         dnl Serial or Parallel check {{{
    36         dnl Check that at least serial or parallel builds have been requested!
    37         if test "$SERIAL_VALUE" != "yes" ; then
    38                 if test "$PARALLEL_VALUE" != "yes"; then
    39                         AC_MSG_ERROR([cannot request --with-serial=no and --with-parallel=no at the same time!])
    40                 fi
    41         fi
    4226        dnl }}}
    4327
     
    8165                        export CXXFLAGS=" -O3 -xS -D_INTEL_LINUX_ "
    8266                        export CFLAGS=" -O3 -xS -D_INTEL_LINUX_ "
     67                elif test $VENDOR = arm-linux; then
     68                        export CC=$ANDROID_DIR/arm-linux-android-4.0/bin/arm-linux-androideabi-cc
     69                        export CXX=$ANDROID_DIR/arm-linux-android-4.0/bin/arm-linux-androideabi-cc
     70
    8371                else
    8472                AC_MSG_ERROR([unknow compiler vendor!])
     
    9280        dnl 1. See if matlab has been provided
    9381        AC_ARG_WITH([matlab-dir],
    94                 AS_HELP_STRING([--with-matlab-dir = DIR], [matlab root directory. necessary for serial build.]),
     82                AS_HELP_STRING([--with-matlab-dir=DIR], [matlab root directory. necessary for serial build.]),
    9583                [MATLAB_ROOT=$withval],[MATLAB_ROOT=""])
    9684
    97         AC_MSG_CHECKING([wether Matlab is enabled])
     85        AC_MSG_CHECKING([whether matlab is enabled])
    9886        if test -d "$MATLAB_ROOT"; then
    9987                HAVE_MATLAB=yes
     
    10997        dnl 2. if matlab is provided, get version number
    11098        if test x$HAVE_MATLAB = xyes; then
    111                 AC_MSG_CHECKING([for Matlab version])
     99                AC_MSG_CHECKING([for matlab version])
    112100                MATLAB_VERSION=""
    113101
     
    172160
    173161                dnl 3. Get Matlab libraries
    174                 AC_MSG_CHECKING(for Matlab headers and libraries in $MATLAB_ROOT)
     162                AC_MSG_CHECKING(for matlab headers and libraries in $MATLAB_ROOT)
    175163                MATLABINCL=-I"$MATLAB_ROOT/extern/include";
    176164               
     
    191179                        *darwin*)
    192180                                dnl mex -v gives all the flags for compilation of mex files
    193                                 dnl if matlab version is 7.10 or more, we must use mexmaci64 (64 bits)
     181                                dnl if matlab version is 7.9 or more, we must use mexmaci64 (64 bits)
    194182                                MEXLINK="-O -Wl,-flat_namespace -undefined suppress -arch i386 -bundle -Wl,-exported_symbols_list,$MATLAB_ROOT/extern/lib/maci/mexFunction.map"
    195183                                MEXLIB=" -L$MATLAB_ROOT/bin/maci/ -lmx -lmex -lmat -lstdc++ -largeArrayDims"
    196184                                if test $MATLAB_MAJOR -ge 7; then
    197                                          if test $MATLAB_MINOR -ge 10; then
     185                                         if test $MATLAB_MINOR -ge 9; then
    198186                                                  MEXLINK="-O -Wl,-flat_namespace -undefined suppress -bundle -Wl,-exported_symbols_list,$MATLAB_ROOT/extern/lib/maci64/mexFunction.map"
    199187                                                         MEXLIB=" -L$MATLAB_ROOT/bin/maci64/ -lmx -lmex -lmat -lstdc++"
     
    217205                AC_SUBST([MATLABINCL])
    218206                AC_SUBST([MEX])
    219                 WRAPPEREXT=$MEXEXT
    220                 AC_SUBST([WRAPPEREXT])
     207                MATLABWRAPPEREXT=$MEXEXT
     208                AC_SUBST([MATLABWRAPPEREXT])
    221209                AC_SUBST([MEXLIB])
    222210                AC_SUBST([MEXLINK])
     
    225213        dnl triangle {{{
    226214        AC_ARG_WITH([triangle-dir],
    227                           AS_HELP_STRING([--with-triangle-dir = DIR], [triangle root directory. necessary for serial build]),
     215                          AS_HELP_STRING([--with-triangle-dir=DIR], [triangle root directory. necessary for serial build]),
    228216                         [TRIANGLE_ROOT=$withval],[TRIANGLE_ROOT=""])
    229         AC_MSG_CHECKING(for Triangle headers and libraries)
     217        AC_MSG_CHECKING(for triangle headers and libraries)
    230218
    231219        if test -d "$TRIANGLE_ROOT"; then
     
    266254        dnl dakota{{{
    267255        AC_ARG_WITH([dakota-dir],
    268           AS_HELP_STRING([--with-dakota-dir = DIR], [dakota root directory. necessary for serial build]),
     256          AS_HELP_STRING([--with-dakota-dir=DIR], [dakota root directory. necessary for serial build]),
    269257          [DAKOTA_ROOT=$withval],[DAKOTA_ROOT=""])
    270         AC_MSG_CHECKING(for Dakota)
     258        AC_MSG_CHECKING(for dakota)
    271259       
    272260        if test -d "$DAKOTA_ROOT"; then
     
    299287        dnl boost{{{
    300288        AC_ARG_WITH([boost-dir],
    301           AS_HELP_STRING([--with-boost-dir = DIR], [boost root directory.]),
     289          AS_HELP_STRING([--with-boost-dir=DIR], [boost root directory.]),
    302290          [BOOST_ROOT=$withval],[BOOST_ROOT=""])
    303         AC_MSG_CHECKING(for Boost)
     291        AC_MSG_CHECKING(for boost)
    304292       
    305293        if test -d "$BOOST_ROOT"; then
     
    318306        AC_MSG_RESULT($HAVE_BOOST)
    319307        dnl }}}
     308        dnl python-version{{{
     309        AC_ARG_WITH([python-version],
     310          AS_HELP_STRING([--with-python-version = PYTHONVERSION],[python version.]),
     311          [PYTHONVERSION=$withval],[PYTHONVERSION=""])
     312        AC_MSG_CHECKING(for python version)
     313
     314        HAVE_PYTHON3="no"
     315
     316        dnl recover major:
     317        PYTHON_MAJOR=${PYTHONVERSION%.*}
     318
     319        if test x$PYTHON_MAJOR = x3; then
     320                dnl are we running python 3?
     321                HAVE_PYTHON3="yes"
     322        fi
     323        AC_DEFINE_UNQUOTED([_PYTHON_MAJOR_],$PYTHON_MAJOR,[python version major])
     324
     325        AM_CONDITIONAL([PYTHON3], [test x$HAVE_PYTHON3 = xyes])
     326        AC_MSG_RESULT($PYTHON_MAJOR)
     327        dnl }}}
    320328        dnl python{{{
    321329        AC_ARG_WITH([python-dir],
    322           AS_HELP_STRING([--with-python-dir = DIR], [python root directory.]),
     330          AS_HELP_STRING([--with-python-dir=DIR], [python root directory.]),
    323331          [PYTHON_ROOT=$withval],[PYTHON_ROOT=""])
    324         AC_MSG_CHECKING(for Python)
     332        AC_MSG_CHECKING(for python)
    325333       
    326334        if test -d "$PYTHON_ROOT"; then
     
    328336                HAVE_PYTHON=yes
    329337                PYTHONINCL=-I$PYTHON_ROOT/include
    330                 PYTHONLIB="-L$PYTHON_ROOT/lib -lpython3.2"
     338                PYTHONLIB="-L$PYTHON_ROOT/lib -lpython$PYTHONVERSION"
    331339                PYTHONEXT=.so
    332340                PYTHONLINK="-dynamiclib"
     
    335343                AC_SUBST([PYTHONINCL])
    336344                AC_SUBST([PYTHONLIB])
    337                 WRAPPEREXT=$PYTHONEXT
    338                 AC_SUBST([WRAPPEREXT])
     345                PYTHONWRAPPEREXT=$PYTHONEXT
     346                AC_SUBST([PYTHONWRAPPEREXT])
    339347                AC_SUBST([PYTHONLINK])
    340348        else
     
    346354        dnl python-numpy{{{
    347355        AC_ARG_WITH([python-numpy-dir],
    348           AS_HELP_STRING([--with-python-numpy-dir = DIR], [python-numpy root directory.]),
     356          AS_HELP_STRING([--with-python-numpy-dir=DIR], [python-numpy root directory.]),
    349357          [PYTHON_NUMPY_ROOT=$withval],[PYTHON_NUMPY_ROOT=""])
    350         AC_MSG_CHECKING(for Python-Numpy)
     358        AC_MSG_CHECKING(for python-numpy)
    351359       
    352360        if test -d "$PYTHON_NUMPY_ROOT"; then
     
    364372        dnl chaco{{{
    365373        AC_ARG_WITH([chaco-dir],
    366           AS_HELP_STRING([--with-chaco-dir = DIR], [chaco root directory.]),
     374          AS_HELP_STRING([--with-chaco-dir=DIR], [chaco root directory.]),
    367375          [CHACO_ROOT=$withval],[CHACO_ROOT=""])
    368         AC_MSG_CHECKING(for Chaco)
     376        AC_MSG_CHECKING(for chaco)
    369377       
    370378        if test -d "$CHACO_ROOT"; then
     
    386394        dnl scotch{{{
    387395        AC_ARG_WITH([scotch-dir],
    388           AS_HELP_STRING([--with-scotch-dir = DIR], [scotch root directory.]),
     396          AS_HELP_STRING([--with-scotch-dir=DIR], [scotch root directory.]),
    389397          [SCOTCH_ROOT=$withval],[SCOTCH_ROOT=""])
    390         AC_MSG_CHECKING(for Scotch)
     398        AC_MSG_CHECKING(for scotch)
    391399       
    392400        if test -d "$SCOTCH_ROOT"; then
     
    408416        dnl adolc{{{
    409417        AC_ARG_WITH([adolc-dir],
    410                 AS_HELP_STRING([--with-adolc-dir = DIR], [adolc root directory.]),
     418                AS_HELP_STRING([--with-adolc-dir=DIR], [adolc root directory.]),
    411419                [ADOLC_ROOT=$withval],[ADOLC_ROOT="no"])
    412         AC_MSG_CHECKING(for ADOLC)
     420        AC_MSG_CHECKING(for adolc)
    413421
    414422        if test "x$ADOLC_ROOT" = "xno"; then
     
    436444        dnl adic2{{{
    437445        AC_ARG_WITH([adic2-dir],
    438           AS_HELP_STRING([--with-adic2-dir = DIR], [adic2 root directory.]),
     446          AS_HELP_STRING([--with-adic2-dir=DIR], [adic2 root directory.]),
    439447          [ADIC2_ROOT=$withval],[ADIC2_ROOT="no"])
    440         AC_MSG_CHECKING(for ADIC2)
     448        AC_MSG_CHECKING(for adic2)
    441449
    442450        if test "x$ADIC2_ROOT" = "xno"; then
     
    464472        dnl gsl{{{
    465473        AC_ARG_WITH([gsl-dir],
    466           AS_HELP_STRING([--with-gsl-dir = DIR], [gsl root directory.]),
     474          AS_HELP_STRING([--with-gsl-dir=DIR], [gsl root directory.]),
    467475          [GSL_ROOT=$withval],[GSL_ROOT=""])
    468         AC_MSG_CHECKING(for Gsl)
     476        AC_MSG_CHECKING(for gsl)
    469477       
    470478        if test -d "$GSL_ROOT"; then
     
    487495        dnl rose{{{
    488496        AC_ARG_WITH([rose-dir],
    489           AS_HELP_STRING([--with-rose-dir = DIR], [rose root directory.]),
     497          AS_HELP_STRING([--with-rose-dir=DIR], [rose root directory.]),
    490498          [ROSE_ROOT=$withval],[ROSE_ROOT=""])
    491         AC_MSG_CHECKING(for Rose)
     499        AC_MSG_CHECKING(for rose)
    492500       
    493501        if test -d "$ROSE_ROOT"; then
     
    510518        dnl metis{{{
    511519        AC_ARG_WITH([metis-dir],
    512           AS_HELP_STRING([--with-metis-dir = DIR],[metis root directory. necessary for serial build]),
     520          AS_HELP_STRING([--with-metis-dir=DIR],[metis root directory. necessary for serial build]),
    513521          [METIS_ROOT=$withval],[METIS_ROOT=""])
    514522
    515523        if test -d "$METIS_ROOT"; then
    516524
    517                 AC_MSG_CHECKING(for Metis headers and libraries in $METIS_ROOT)
     525                AC_MSG_CHECKING(for metis headers and libraries in $METIS_ROOT)
    518526
    519527                dnl first figure out version of metis: does the VERSION file exist?
     
    568576                HAVE_METIS=no
    569577        fi
    570 
    571         if test $HAVE_METIS = no; then
    572                 AC_MSG_ERROR([--with-metis-dir  missing. Metis is needed to run ISSM]);
    573         else
    574                 AC_MSG_RESULT($HAVE_METIS)
    575         fi
     578        AM_CONDITIONAL([METIS], [test x$HAVE_METIS = xyes])
    576579        dnl }}}
    577580        dnl mpi{{{
     
    582585       
    583586        AC_ARG_WITH([mpi-include],
    584           AS_HELP_STRING([--with-mpi-include = DIR],[mpi include directory, necessary for parallel build]),
     587          AS_HELP_STRING([--with-mpi-include=DIR],[mpi include directory, necessary for parallel build]),
    585588          [MPI_INCLUDE=$withval],[MPI_INCLUDE=""])
    586589       
     
    591594                        HAVE_MPI=no
    592595                else
     596                        HAVE_MPI=yes
    593597                        MPIINCL=-I"$MPI_INCLUDE/"
    594598                        AC_DEFINE([_HAVE_MPI_],[1],[with Mpi in ISSM src])
     
    598602                fi
    599603        fi
    600         AC_MSG_RESULT(done)
     604        AM_CONDITIONAL([MPI], [test x$HAVE_MPI = xyes])
     605        AC_MSG_RESULT($HAVE_MPI)
    601606        dnl }}}
    602607        dnl petsc{{{
    603608        AC_ARG_WITH([petsc-dir],
    604           AS_HELP_STRING([--with-petsc-dir = DIR],[PETSc root directory, necessary for parallel build]),
     609          AS_HELP_STRING([--with-petsc-dir=DIR],[PETSc root directory, necessary for parallel build]),
    605610          [PETSC_ROOT=$withval],[PETSC_ROOT=""])
    606611               
    607612        if test -d "$PETSC_ROOT"; then
    608                 AC_MSG_CHECKING(for PETSc version)
     613                AC_MSG_CHECKING(for petsc version)
    609614                PETSC_MAJOR=`cat $PETSC_ROOT/include/petscversion.h | grep "#define PETSC_VERSION_MAJOR" | sed 's/#define PETSC_VERSION_MAJOR//' | sed 's/ //g'`
    610615                PETSC_MINOR=`cat $PETSC_ROOT/include/petscversion.h | grep "#define PETSC_VERSION_MINOR" | sed 's/#define PETSC_VERSION_MINOR//' | sed 's/ //g'`
     
    614619
    615620                PETSC_VERSION_DATE_HG=`cat $PETSC_ROOT/include/petscversion.h | grep "#define PETSC_VERSION_DATE_HG" | sed 's/#define PETSC_VERSION_DATE_HG//' | sed 's/ //g' | sed -e 's/\"//g' `
    616                 AC_MSG_CHECKING(wether PETSc is the development version)
     621                AC_MSG_CHECKING(whether petsc is the development version)
    617622                if test x$PETSC_VERSION_DATE_HG = xunknown; then
    618623                        AC_DEFINE([_HAVE_PETSCDEV_],[1],[with PETSc-dev])
     
    624629       
    625630        AC_ARG_WITH([petsc-arch],
    626           AS_HELP_STRING([--with-petsc-arch = DIR],[PETSc arch , necessary for parallel build]),
     631          AS_HELP_STRING([--with-petsc-arch=DIR],[PETSc arch , necessary for parallel build]),
    627632          [PETSC_ARCH=$withval],[PETSC_ARCH=""])
    628633
    629         AC_MSG_CHECKING(for PETSc headers and libraries in $PETSC_ROOT for architecture $PETSC_ARCH)
     634        AC_MSG_CHECKING(for petsc headers and libraries in $PETSC_ROOT for architecture $PETSC_ARCH)
    630635       
    631636        if test -d "$PETSC_ROOT"; then
     
    671676        dnl tao{{{
    672677        AC_ARG_WITH([tao-dir],
    673                 AS_HELP_STRING([--with-tao-dir = DIR], [tao root directory.]),
     678                AS_HELP_STRING([--with-tao-dir=DIR], [tao root directory.]),
    674679                [TAO_ROOT=$withval],[TAO_ROOT=""])
    675         AC_MSG_CHECKING(for Tao)
     680        AC_MSG_CHECKING(for tao)
    676681
    677682        if test -d "$TAO_ROOT"; then
     
    689694        AC_MSG_RESULT($HAVE_TAO)
    690695        dnl }}}
    691         dnl mpiuni{{{
    692         dnl when running in serial mode, MPI must be ignored, and set to internal petsc mpiuni:
    693         if test "$PARALLEL_VALUE" = "no" ; then
    694                 HAVE_MPI=yes
    695                 MPIINCL=-I"$PETSC_ROOT/include/mpiuni"
    696 
    697                 case "${host_os}" in
    698                         *cygwin*)
    699                         dnl MPILIB="-link -LIBPATH:\"$PETSC_ROOT/$PETSC_ARCH/lib\" -LIBPATH:\"$PETSC_ROOT/lib\" -LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" libmpiuni.lib"
    700                         ;;
    701                         *linux*)
    702                         MPILIB="-L$PETSC_ROOT/$PETSC_ARCH/lib -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lmpiuni"
    703                         ;;
    704                         *darwin*)
    705                         MPILIB="-L$PETSC_ROOT/$PETSC_ARCH/lib -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lmpiuni"
    706                         ;;
    707                 esac
    708                                                                  
    709                 AC_DEFINE([_HAVE_MPI_],[1],[with Mpi in ISSM src])
    710                 AC_SUBST([MPIINCL])
    711                 AC_SUBST([MPILIB])
    712         fi
    713         dnl }}}
    714696        dnl slepc{{{
    715697        AC_ARG_WITH([slepc-dir],
    716           AS_HELP_STRING([--with-slepc-dir = DIR],[slepc root directory]),
     698          AS_HELP_STRING([--with-slepc-dir=DIR],[slepc root directory]),
    717699          [SLEPC_ROOT=$withval],[SLEPC_ROOT=""])
    718700                         
    719         AC_MSG_CHECKING(for Slepc headers and libraries in $SLEPC_ROOT)
     701        AC_MSG_CHECKING(for slepc headers and libraries in $SLEPC_ROOT)
    720702        if test -d "$SLEPC_ROOT"; then
    721703                HAVE_SLEPC=yes
     
    733715        dnl shapelib{{{
    734716        AC_ARG_WITH([shapelib-dir],
    735           AS_HELP_STRING([--with-shapelib-dir = DIR], [shapelib root directory]),
     717          AS_HELP_STRING([--with-shapelib-dir=DIR], [shapelib root directory]),
    736718          [SHAPELIB_ROOT=$withval],[SHAPELIB_ROOT=""])
    737719                         
    738         AC_MSG_CHECKING(for Shapelib headers and libraries in $SHAPELIB_ROOT)
     720        AC_MSG_CHECKING(for shapelib headers and libraries in $SHAPELIB_ROOT)
    739721        if test -d "$SHAPELIB_ROOT"; then
    740722
     
    754736        dnl scalapack{{{
    755737        AC_ARG_WITH([scalapack-dir],
    756           AS_HELP_STRING([--with-scalapack-dir = DIR],[scalapack root directory]),
     738          AS_HELP_STRING([--with-scalapack-dir=DIR],[scalapack root directory]),
    757739          [SCALAPACK_ROOT=$withval],[SCALAPACK_ROOT=""])
    758740                         
    759         AC_MSG_CHECKING(for Scalapack headers and libraries in $SCALAPACK_ROOT)
     741        AC_MSG_CHECKING(for scalapack headers and libraries in $SCALAPACK_ROOT)
    760742        if test -d "$SCALAPACK_ROOT"; then
    761743
     
    773755        dnl blas{{{
    774756        AC_ARG_WITH([blas-lapack-dir],
    775           AS_HELP_STRING([--with-blas-lapack-dir = DIR],[blas-lapack root directory]),
     757          AS_HELP_STRING([--with-blas-lapack-dir=DIR],[blas-lapack root directory]),
    776758          [BLASLAPACK_ROOT=$withval],[BLASLAPACK_ROOT=""])
    777759                         
    778         AC_MSG_CHECKING(for Blas and Lapack headers and libraries in $BLASLAPACK_ROOT)
     760        AC_MSG_CHECKING(for blas and lapack headers and libraries in $BLASLAPACK_ROOT)
    779761        if test -d "$BLASLAPACK_ROOT"; then
    780762
     
    806788        dnl mkl{{{
    807789        AC_ARG_WITH([mkl-dir],
    808           AS_HELP_STRING([--with-mkl-dir = DIR],[mkl root directory]),
     790          AS_HELP_STRING([--with-mkl-dir=DIR],[mkl root directory]),
    809791          [MKL_ROOT=$withval],[MKL_ROOT=""])
    810792                         
     
    825807        dnl }}}
    826808        dnl plapack{{{
     809        AC_MSG_CHECKING(for plapack)
     810       
    827811        AC_ARG_WITH([plapack-lib],
    828812          AS_HELP_STRING([--with-plapack-lib = lib],[plapack library]),
    829813          [PLAPACK_LIB=$withval],[PLAPACK_LIB=""])
    830         AC_MSG_CHECKING(for Plapack libraries)
    831814       
    832815        AC_ARG_WITH([plapack-include],
     
    834817                                                         [plapack include ]),
    835818                          [PLAPACK_INCLUDE=$withval],[PLAPACK_INCLUDE=""])
    836         AC_MSG_CHECKING(for Plapack headers)
    837819         
    838820        if test -n "$PLAPACK_LIB"; then
     
    857839        dnl mumps{{{
    858840        AC_ARG_WITH([mumps-dir],
    859           AS_HELP_STRING([--with-mumps-dir = DIR],[mumps root directory]),
     841          AS_HELP_STRING([--with-mumps-dir=DIR],[mumps root directory]),
    860842          [MUMPS_ROOT=$withval],[MUMPS_ROOT=""])
    861843                         
    862         AC_MSG_CHECKING(for Mumps headers and libraries in $MUMPS_ROOT)
     844        AC_MSG_CHECKING(for mumps headers and libraries in $MUMPS_ROOT)
    863845        if test -d "$MUMPS_ROOT"; then
    864846
     
    882864        dnl blacs{{{
    883865        AC_ARG_WITH([blacs-dir],
    884                 AS_HELP_STRING([--with-blacs-dir = DIR],[blacs root directory]),
     866                AS_HELP_STRING([--with-blacs-dir=DIR],[blacs root directory]),
    885867                          [BLACS_ROOT=$withval],[BLACS_ROOT=""])
    886868                         
    887         AC_MSG_CHECKING(for Blacs headers and libraries in $BLACS_ROOT)
     869        AC_MSG_CHECKING(for blacs headers and libraries in $BLACS_ROOT)
    888870        if test -d "$BLACS_ROOT"; then
    889871
     
    903885        dnl hypre{{{
    904886        AC_ARG_WITH([hypre-dir],
    905           AS_HELP_STRING([--with-hypre-dir = DIR],[hypre root directory]),
     887          AS_HELP_STRING([--with-hypre-dir=DIR],[hypre root directory]),
    906888                          [HYPRE_ROOT=$withval],[HYPRE_ROOT=""])
    907889                         
    908         AC_MSG_CHECKING(for Hypre headers and libraries in $HYPRE_ROOT)
     890        AC_MSG_CHECKING(for hypre headers and libraries in $HYPRE_ROOT)
    909891        if test -d "$HYPRE_ROOT"; then
    910892
     
    924906        dnl ml{{{
    925907        AC_ARG_WITH([ml-dir],
    926           AS_HELP_STRING([--with-ml-dir = DIR],[ml root directory]),
     908          AS_HELP_STRING([--with-ml-dir=DIR],[ml root directory]),
    927909                          [ML_ROOT=$withval],[ML_ROOT=""])
    928910                         
    929         AC_MSG_CHECKING(for Ml headers and libraries in $ML_ROOT)
     911        AC_MSG_CHECKING(for ml headers and libraries in $ML_ROOT)
    930912        if test -d "$ML_ROOT"; then
    931913
     
    12291211        AC_MSG_CHECKING(consistency between all libraries)
    12301212       
    1231         dnl check that if petsc is requested in parallel, mpi should be specified
     1213        dnl check that if petsc is requested , mpi should be specified
    12321214        if test "$HAVE_PETSC" = "yes" ; then
    12331215                if test "$HAVE_MPI" = "NO";  then
     
    12361218        fi
    12371219
    1238         dnl check that we have either python or matlab support if we only compile serially
    1239         if test "$PARALLEL_VALUE" = "no"  && test "$HAVE_MATLAB" = "no" && test "$HAVE_PYTHON" = "no"; then
    1240                 AC_MSG_ERROR([need at least python or matlab support to compile only in serial mode!]);
    1241         fi
    1242 
    1243         dnl check that we don't have with-matlab and with-python at the same time
    1244         if test "$HAVE_PYTHON" = "yes" ; then
    1245                 if test "$HAVE_MATLAB" = "yes";  then
    1246                         AC_MSG_ERROR([cannot create matlab and python wrappers simultaneously! Please choose one or the other.]);
    1247                 fi
    1248         fi
     1220        dnl check that we have either python or matlab support if we compile the modules
     1221        if test "$MODULES_VALUE" = "yes"  && test "$HAVE_MATLAB" = "no" && test "$HAVE_PYTHON" = "no"; then
     1222                AC_MSG_ERROR([need at least python or matlab support to compile modules (or use --with-modules=no)]);
     1223        fi
     1224
     1225        dnl check that we have python version if python compile is specified
     1226        if test "$HAVE_PYTHON" = "yes"  && test "$PYTHONVERSION" = "" ; then
     1227        AC_MSG_ERROR([need python-version if python compile is required!]);
     1228        fi
     1229
     1230        dnl check that if we have MPI, we have metis
     1231        if test "$HAVE_METIS" = "yes"  && test "$HAVE_MPI" = "no" ; then
     1232        AC_MSG_ERROR([need mpi if using the metis partitioner!]);
     1233        fi
     1234
     1235
     1236
     1237
    12491238
    12501239        AC_MSG_RESULT(done)
     
    12571246          AS_HELP_STRING([--with-cxxoptflags = CXXOPTFLAGS], [optimization using CXX flags, ex: --with-cxxoptflags=-march=opteron -O3]),
    12581247          [CXXOPTFLAGS=$withval],[CXXOPTFLAGS="-g -O2"])
    1259         AC_MSG_CHECKING(for C++ optimization flags)
     1248        AC_MSG_CHECKING(for c++ optimization flags)
    12601249        AC_SUBST([CXXOPTFLAGS])
    12611250        AC_MSG_RESULT(done)
  • TabularUnified issm/branches/trunk-jpl-damage/scripts/GenerateReferences.sh

    r8066 r12168  
    1616\begin{document}
    1717\nocite{$CITE}
    18 \bibliography{$ISSM_DIR/publications/bibtex/references}
     18\bibliography{$JPL_SVN/publications/bibtex/references}
    1919\end{document}
    2020END
     
    2929mv references.bak2 references.bbl
    3030echo "Converting to rtf"
    31 $ISSM_TIER/externalpackages/latex2rtf/install/latex2rtf -P $ISSM_TIER/externalpackages/latex2rtf/install/cfg/ references
     31$ISSM_DIR/externalpackages/latex2rtf/install/latex2rtf -P $ISSM_DIR/externalpackages/latex2rtf/install/cfg/ references
    3232
    3333#Remove all but rtf file
  • TabularUnified issm/branches/trunk-jpl-damage/scripts/archive.sh

    r6088 r12168  
    1010
    1111#Cleanup code
    12 cd $ISSM_TIER
     12cd $ISSM_DIR
    1313make clean
    1414make distclean
     
    1818
    1919#Create tar file, with today's date in the title;
    20 cd $ISSM_TIER/..
     20cd $ISSM_DIR/..
    2121today=`today_date`
    22 tar zcvf issm-3.0-$today.tar.gz  `basename $ISSM_TIER`
     22tar zcvf issm-3.0-$today.tar.gz  `basename $ISSM_DIR`
  • TabularUnified issm/branches/trunk-jpl-damage/scripts/automakererun.sh

    r10863 r12168  
    44
    55
    6  ACLOCAL="$ISSM_TIER/externalpackages/automake/install/bin/aclocal"
    7 AUTOCONF="$ISSM_TIER/externalpackages/autoconf/install/bin/autoconf"
    8 AUTOHEAD="$ISSM_TIER/externalpackages/autoconf/install/bin/autoheader"
    9 AUTOMAKE="$ISSM_TIER/externalpackages/automake/install/bin/automake"
     6 ACLOCAL="$ISSM_DIR/externalpackages/automake/install/bin/aclocal"
     7AUTOCONF="$ISSM_DIR/externalpackages/autoconf/install/bin/autoconf"
     8AUTOHEAD="$ISSM_DIR/externalpackages/autoconf/install/bin/autoheader"
     9AUTOMAKE="$ISSM_DIR/externalpackages/automake/install/bin/automake"
    1010
    1111echo "removing config.cach"
  • TabularUnified issm/branches/trunk-jpl-damage/scripts/cloc2html.py

    r11241 r12168  
    44import sys, re, os
    55
    6 ISSM_TIER=os.getenv('ISSM_TIER');
    7 if(not ISSM_TIER): raise NameError('ISSM_TIER undefined')
     6ISSM_DIR=os.getenv('ISSM_DIR');
     7if(not ISSM_DIR): raise NameError('ISSM_DIR undefined')
    88
    99infile  = open('temp','r')
  • TabularUnified issm/branches/trunk-jpl-damage/scripts/convertmatlabclasses.py

    r11226 r12168  
    44
    55#get names of all directories to process
    6 ISSM_TIER=os.getenv('ISSM_TIER');
    7 if(not ISSM_TIER): raise NameError('ISSM_TIER undefined')
    8 newclassesdir = ISSM_TIER + '/src/m/classes/'
    9 oldclassesdir = ISSM_TIER + '/src/m/oldclasses/'
     6ISSM_DIR=os.getenv('ISSM_DIR');
     7if(not ISSM_DIR): raise NameError('ISSM_DIR undefined')
     8newclassesdir = ISSM_DIR + '/src/m/classes/'
     9oldclassesdir = ISSM_DIR + '/src/m/oldclasses/'
    1010
    1111#make new directory
  • TabularUnified issm/branches/trunk-jpl-damage/scripts/dailyrun.sh

    r6088 r12168  
    5454#Prepare run
    5555#Windows hack for startup.m {{{1
    56 #windows environments: ISSM_TIER_WIN variable not correctly picked up when using
    57 #the cron job. just get startup to take the ISSM_TIER variable as the pwd:
     56#windows environments: ISSM_DIR_WIN variable not correctly picked up when using
     57#the cron job. just get startup to take the ISSM_DIR variable as the pwd:
    5858if [ "$OS" = "winxp32" ]
    5959then
    60         cat startup.m | sed 's/clear status/clear status; ISSM_TIER=pwd;/g' > startup.m.bak
     60        cat startup.m | sed 's/clear status/clear status; ISSM_DIR=pwd;/g' > startup.m.bak
    6161        mv startup.m.bak startup.m
    6262fi
    6363#}}}
    6464#create softlink to startup {{{1
    65 cd $ISSM_TIER/test/NightlyRun/
    66 ln -s $ISSM_TIER/startup.m .
     65cd $ISSM_DIR/test/NightlyRun/
     66ln -s $ISSM_DIR/startup.m .
    6767#}}}
    6868#Create dailylog directory and info.log {{{1
     
    7070INSTALL_TIME=$(timer)
    7171ELAPSED_INSTALL=$(timer $START_TIME)
    72 rm -rf $ISSM_TIER/dailylog
    73 mkdir  $ISSM_TIER/dailylog
    74 cat << END > $ISSM_TIER/dailylog/info.log
     72rm -rf $ISSM_DIR/dailylog
     73mkdir  $ISSM_DIR/dailylog
     74cat << END > $ISSM_DIR/dailylog/info.log
    7575today:     $(echo $TODAY)
    7676user:      $(echo $USER)
     
    9595do
    9696        #Launch matlab and the daily run script
    97         cat > $ISSM_TIER/dailylog/matlab_run$i.m << EOF
     97        cat > $ISSM_DIR/dailylog/matlab_run$i.m << EOF
    9898        warning off %necessary to avoid a info.log of several Go for parallel runs
    9999        try,
    100         cd $ISSM_TIER/test/NightlyRun
     100        cd $ISSM_DIR/test/NightlyRun
    101101        startup;
    102102        $(if [ "$NROPTIONS" = ""  ]
     
    111111                directory=strsplit(pwd,'/');
    112112                message=getReport(me)
    113                 fid=fopen([ISSM_TIER '/dailylog/matlaberror.log'], 'at');
     113                fid=fopen([ISSM_DIR '/dailylog/matlaberror.log'], 'at');
    114114                fprintf(fid,'\nMatlab error occured in: %s\n\n',directory{end});
    115115                fprintf(fid,'%s',message);
     
    121121
    122122        #Start run from dailylog directory
    123         cd $ISSM_TIER/dailylog/
     123        cd $ISSM_DIR/dailylog/
    124124
    125125        #Start test
     
    132132#}}}
    133133#concatenate all reports {{{1
    134 cd $ISSM_TIER/dailylog/
     134cd $ISSM_DIR/dailylog/
    135135mv matlab_log1.log  matlab_log.log
    136136for (( i=2;i<=$NUMCPUS_RUN;i++ ))
     
    149149ELAPSED_RUN=$(timer $INSTALL_TIME)
    150150ELAPSED_TOTAL=$(timer $START_TIME)
    151 cat << END >>  $ISSM_TIER/dailylog/info.log
     151cat << END >>  $ISSM_DIR/dailylog/info.log
    152152elapsed_run:   $(echo $ELAPSED_RUN)
    153153elapsed_total: $(echo $ELAPSED_TOTAL)
     
    158158#Send Report
    159159#Build html report {{{1
    160 cd $ISSM_TIER/dailylog/
     160cd $ISSM_DIR/dailylog/
    161161sh ../scripts/report.sh
    162 ln -s $ISSM_TIER/dailylog/report.html $INIT_PATH
    163 echo "html report located in $ISSM_TIER/dailylog/report.html and $INIT_PATH/report.html"
     162ln -s $ISSM_DIR/dailylog/report.html $INIT_PATH
     163echo "html report located in $ISSM_DIR/dailylog/report.html and $INIT_PATH/report.html"
    164164#}}}
  • TabularUnified issm/branches/trunk-jpl-damage/scripts/getloc.sh

    r11241 r12168  
    11#!/bin/bash
    22#get number of lines of code
    3 cloc-1.55.pl $ISSM_TIER/src $ISSM_TIER/m4 --exclude-dir=.svn --exclude-ext=exp --exclude-lang=make --out=temp
     3cloc-1.55.pl $ISSM_DIR/src $ISSM_DIR/m4 --exclude-dir=.svn --exclude-ext=exp --exclude-lang=make --out=temp
    44cat temp
    55./cloc2html.py
    66rm temp
    77
    8 cat $ISSM_TIER/src/dox/issm.dox | sed '/<table/,//d' > input1
    9 cat $ISSM_TIER/src/dox/issm.dox | sed '1,/<\/table>/d' > input2
    10 cat input1 temp.html input2 > $ISSM_TIER/src/dox/issm.dox
     8cat $ISSM_DIR/src/dox/issm.dox | sed '/<table/,//d' > input1
     9cat $ISSM_DIR/src/dox/issm.dox | sed '1,/<\/table>/d' > input2
     10cat input1 temp.html input2 > $ISSM_DIR/src/dox/issm.dox
    1111rm input1 input2 temp.html
    1212
     
    1919#OLDER MANUAL VESION
    2020#get Matlab number of lines
    21 cd $ISSM_TIER/src/m
     21cd $ISSM_DIR/src/m
    2222M_LOC=$(find . -name "*.m" -exec wc -l '{}' \; | awk '{ sum += $1 } END { print sum}');
    2323echo "Matlab code: $M_LOC"
    2424
    2525#get C/CPP number of lines
    26 cd $ISSM_TIER/src
     26cd $ISSM_DIR/src
    2727CPP_LOC=$(find . -name "*.cpp" -exec wc -l '{}' \; | awk '{ sum += $1 } END { print sum}');
    2828echo "C++    code: $CPP_LOC"
  • TabularUnified issm/branches/trunk-jpl-damage/scripts/issmconfiguration.sh

    r12004 r12168  
    77presendir=`pwd`
    88
    9 if test -d "$ISSM_TIER/configs" ; then
    10         cd $ISSM_TIER/configs
     9if test -d "$ISSM_DIR/configs" ; then
     10        cd $ISSM_DIR/configs
    1111        LIST=`ls`
    1212       
     
    4040        echo ""
    4141
    42         cd $ISSM_TIER
     42        cd $ISSM_DIR
    4343        source ./scripts/automakererun.sh
    4444        source configs/$configurename
     
    5656
    5757
    58 #alias aut='a=`pwd` && cd $ISSM_TIER && ./scripts/automakererun.sh && ./configs/config-macosx64-larour-nopetsc.sh'
     58#alias aut='a=`pwd` && cd $ISSM_DIR && ./scripts/automakererun.sh && ./configs/config-macosx64-larour-nopetsc.sh'
  • TabularUnified issm/branches/trunk-jpl-damage/scripts/report.sh

    r12004 r12168  
    4949
    5050#create some variables
    51 if [ $(ls -1 $ISSM_TIER/bin | wc -l) -le 20 ];
     51if [ $(ls -1 $ISSM_DIR/bin | wc -l) -le 20 ];
    5252then
    5353        IS_INSTALL=0
  • TabularUnified issm/branches/trunk-jpl-damage/scripts/run.sh

    r6088 r12168  
    66MATLAB_VERSION="7.6" #7.2,7.4,7.6 and 7.8
    77#create softlink to startup {{{1
    8 cd $ISSM_TIER/test/NightlyRun/
    9 ln -s $ISSM_TIER/startup.m .
     8cd $ISSM_DIR/test/NightlyRun/
     9ln -s $ISSM_DIR/startup.m .
    1010#}}}
    1111
     
    1414do
    1515        #Launch matlab and the daily run script
    16         cat > $ISSM_TIER/dailylog/matlab_run$i.m << EOF
     16        cat > $ISSM_DIR/dailylog/matlab_run$i.m << EOF
    1717        warning off %necessary to avoid a daily.log of several Go for parallel runs
    1818        try,
    19                 cd $ISSM_TIER/test/NightlyRun
     19                cd $ISSM_DIR/test/NightlyRun
    2020                startup;
    2121                $(if [ "$NROPTIONS" = ""  ]
     
    3030                directory=strsplit(pwd,'/');
    3131                message=getReport(me)
    32                 fid=fopen([ISSM_TIER '/dailylog/matlaberror.log'], 'at');
     32                fid=fopen([ISSM_DIR '/dailylog/matlaberror.log'], 'at');
    3333                fprintf(fid,'\nMatlab error occured in: %s\n\n',directory{end});
    3434                fprintf(fid,'%s',message);
     
    3939
    4040        #Start run from dailylog directory
    41         cd $ISSM_TIER/dailylog/
     41        cd $ISSM_DIR/dailylog/
    4242
    4343        #Start test
  • TabularUnified issm/branches/trunk-jpl-damage/scripts/windowsbuild.sh

    r6555 r12168  
    1111today=`today_date`
    1212
    13 cd $ISSM_TIER/bin
     13cd $ISSM_DIR/bin
    1414
    1515#Filter out .svn files
  • TabularUnified issm/branches/trunk-jpl-damage/src/Makefile.am

    r11684 r12168  
    1 EXTRA_DIST =  perl  pro
    2 SUBDIRS = c mex m
     1EXTRA_DIST =  perl  pro 
     2SUBDIRS = c modules m  py
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/Container/Constraints.cpp

    r10522 r12168  
    4848
    4949        /*figure out total number of constraints combining all the cpus (no clones here)*/
    50         #ifdef _PARALLEL_
    51         MPI_Reduce(&localconstraints,&numberofconstraints,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
    52         MPI_Bcast(&numberofconstraints,1,MPI_INT,0,MPI_COMM_WORLD);
     50        #ifdef _HAVE_MPI_
     51                MPI_Reduce(&localconstraints,&numberofconstraints,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
     52                MPI_Bcast(&numberofconstraints,1,MPI_INT,0,MPI_COMM_WORLD);
    5353        #else
    54         numberofconstraints=localconstraints;
     54                numberofconstraints=localconstraints;
    5555        #endif
     56       
    5657
    5758        return numberofconstraints;
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/Container/DataSet.cpp

    r12004 r12168  
    8484/*}}}*/
    8585
    86 /*I/O*/
    87 #ifdef _SERIAL_
    88 /*FUNCTION DataSet::Marshall{{{1*/
    89 char* DataSet::Marshall(){
    90 
    91         vector<Object*>::iterator object;
    92         int                       object_size;
    93         int                       marshalled_dataset_size=0;
    94         char*                     marshalled_dataset=NULL;
    95         char*                     old_marshalled_dataset=NULL;
    96 
    97         /*First get size of marshalled dataset: */
    98         object_size=(int)objects.size();
    99 
    100         marshalled_dataset_size=MarshallSize();
    101        
    102         /*Allocate marshalled dataset: */
    103         marshalled_dataset=(char*)xmalloc(marshalled_dataset_size*sizeof(char));
    104 
    105         /*Keep track of old_marshalled_dataset: */
    106         old_marshalled_dataset=marshalled_dataset;
    107 
    108         /*Store internals of dataset first: */
    109         memcpy(marshalled_dataset,&object_size,sizeof(int)); marshalled_dataset+=sizeof(int);
    110         memcpy(marshalled_dataset,&sorted,sizeof(int)); marshalled_dataset+=sizeof(int);
    111         if(sorted){
    112                 if(object_size)memcpy(marshalled_dataset,sorted_ids,object_size*sizeof(int)); marshalled_dataset+=object_size*sizeof(int);
    113                 if(object_size)memcpy(marshalled_dataset,id_offsets,object_size*sizeof(int)); marshalled_dataset+=object_size*sizeof(int);
    114         }
    115 
    116         for ( object=objects.begin() ; object < objects.end(); object++ ){
    117                 (*object)->Marshall(&marshalled_dataset);
    118         }
    119 
    120         /* Ok, marshalled_dataset now points to the end of the original marshalled_dataset pointer
    121          * before  we started the loop on objects. Get object to point right again: */
    122         marshalled_dataset-=marshalled_dataset_size;
    123 
    124         /*We should be back to old_marshalled_dataset: check and abort if that's not the case,
    125          * because this is a nasty error: */
    126         if (marshalled_dataset!=old_marshalled_dataset){
    127                 _error_("final marshalled dataset \"%s\" is different from initial one!",EnumToStringx(enum_type));
    128                 abort();
    129         }
    130 
    131         /*Return: */
    132         return marshalled_dataset;
    133 }
    134 /*}}}*/
    135 /*FUNCTION DataSet::MarshallSize{{{1*/
    136 int DataSet::MarshallSize(){
    137 
    138         vector<Object*>::iterator object;
    139         int                      marshalled_dataset_size=0;
    140 
    141 
    142         for ( object=objects.begin() ; object < objects.end(); object++ ){
    143                 marshalled_dataset_size+= (*object)->MarshallSize();
    144         }
    145 
    146         marshalled_dataset_size+=sizeof(int); //objects size
    147         marshalled_dataset_size+=sizeof(int); //sorted size
    148         if(sorted){
    149                 marshalled_dataset_size+=(int)objects.size()*sizeof(int); //sorted ids
    150                 marshalled_dataset_size+=(int)objects.size()*sizeof(int); //id offsets
    151         }
    152 
    153         return marshalled_dataset_size;
    154 }
    155 /*}}}*/
    156 /*FUNCTION DataSet::Demarshall{{{1*/
    157 DataSet* DataSetDemarshall(char* marshalled_dataset){
    158 
    159         return DataSetDemarshallRaw(&marshalled_dataset);
    160 
    161 }
    162 /*}}}*/
    163 /*FUNCTION DataSet::DemarshallRaw{{{1*/
    164 DataSet* DataSetDemarshallRaw(char** pmarshalled_dataset){
    165 
    166         int i;
    167 
    168         DataSet* dataset=NULL;
    169         int      numobjects=0;
    170         int      enum_type;
    171         Object*  object=NULL;
    172         int      sorted;
    173         int*     sorted_ids=NULL;
    174         int*     id_offsets=NULL;
    175         char*    marshalled_dataset=NULL;
    176 
    177         /*recover marshalled_dataset pointer: */
    178         marshalled_dataset=*pmarshalled_dataset;
    179 
    180         /*initialize dataset: */
    181         dataset=new DataSet();
    182 
    183         /*Get internals first: */
    184         memcpy(&numobjects,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
    185         memcpy(&sorted,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
    186         if(sorted){
    187                 if(numobjects){
    188                         sorted_ids=(int*)xmalloc(numobjects*sizeof(int));
    189                         id_offsets=(int*)xmalloc(numobjects*sizeof(int));
    190                         memcpy(sorted_ids,marshalled_dataset,numobjects*sizeof(int)); marshalled_dataset+=numobjects*sizeof(int);
    191                         memcpy(id_offsets,marshalled_dataset,numobjects*sizeof(int)); marshalled_dataset+=numobjects*sizeof(int);
    192                 }
    193                 dataset->SetSorting(sorted_ids,id_offsets);
    194         }
    195 
    196         for(i=0;i<numobjects;i++){
    197 
    198                 /*get enum type of object: */
    199                 memcpy(&enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
    200 
    201                 switch(enum_type){
    202                         case NodeEnum:{
    203                                 Node* node=NULL;
    204                                 node=new Node();
    205                                 node->Demarshall(&marshalled_dataset);
    206                                 dataset->AddObject(node);}
    207                                 break;
    208                         case VertexEnum:{
    209                                 Vertex* vertex=NULL;
    210                                 vertex=new Vertex();
    211                                 vertex->Demarshall(&marshalled_dataset);
    212                                 dataset->AddObject(vertex);}
    213                                 break;
    214                         case DoubleParamEnum:{
    215                                 DoubleParam* doubleparam=NULL;
    216                                 doubleparam=new DoubleParam();
    217                                 doubleparam->Demarshall(&marshalled_dataset);
    218                                 dataset->AddObject(doubleparam);}
    219                                 break;
    220                         case TriaEnum:{
    221                                 Tria* tria=NULL;
    222                                 tria=new Tria();
    223                                 tria->Demarshall(&marshalled_dataset);
    224                                 dataset->AddObject(tria);}
    225                                 break;
    226                         case TriaP1InputEnum:{
    227                                 TriaP1Input* triavertexinput=NULL;
    228                                 triavertexinput=new TriaP1Input();
    229                                 triavertexinput->Demarshall(&marshalled_dataset);
    230                                 dataset->AddObject(triavertexinput);}
    231                                 break;
    232                         #ifdef _HAVE_3D_
    233                         case PentaP1InputEnum:{
    234                                 PentaP1Input* pentavertexinput=NULL;
    235                                 pentavertexinput=new PentaP1Input();
    236                                 pentavertexinput->Demarshall(&marshalled_dataset);
    237                                 dataset->AddObject(pentavertexinput);}
    238                                 break;
    239                         #endif
    240                         case TransientInputEnum:{
    241                                 TransientInput* transientinput=NULL;
    242                                 transientinput=new TransientInput();
    243                                 transientinput->Demarshall(&marshalled_dataset);
    244                                 dataset->AddObject(transientinput);}
    245                                 break;
    246                         #ifdef _HAVE_CONTROL_
    247                         case ControlInputEnum:{
    248                            ControlInput* controlinputinput=NULL;
    249                                 controlinputinput=new ControlInput();
    250                                 controlinputinput->Demarshall(&marshalled_dataset);
    251                                 dataset->AddObject(controlinputinput);}
    252                                 break;
    253                         #endif
    254                         case DatasetInputEnum:{
    255                                 DatasetInput* datasetinputinput=NULL;
    256                                 datasetinputinput=new DatasetInput();
    257                                 datasetinputinput->Demarshall(&marshalled_dataset);
    258                                 dataset->AddObject(datasetinputinput);}
    259                                 break;
    260                         case TriaP1ElementResultEnum:{
    261                                 TriaP1ElementResult* triavertexelementresult=NULL;
    262                                 triavertexelementresult=new TriaP1ElementResult();
    263                                 triavertexelementresult->Demarshall(&marshalled_dataset);
    264                                 dataset->AddObject(triavertexelementresult);}
    265                                 break;
    266                          #ifdef _HAVE_3D_
    267                         case PentaP1ElementResultEnum:{
    268                                 PentaP1ElementResult* pentavertexelementresult=NULL;
    269                                 pentavertexelementresult=new PentaP1ElementResult();
    270                                 pentavertexelementresult->Demarshall(&marshalled_dataset);
    271                                 dataset->AddObject(pentavertexelementresult);}
    272                                 break;
    273                         case PentaEnum:{
    274                                 Penta* penta=NULL;
    275                                 penta=new Penta();
    276                                 penta->Demarshall(&marshalled_dataset);
    277                                 dataset->AddObject(penta);}
    278                                 break;
    279                         #endif
    280                         case MaticeEnum:{
    281                                 Matice* matice=NULL;
    282                                 matice=new Matice();
    283                                 matice->Demarshall(&marshalled_dataset);
    284                                 dataset->AddObject(matice);}
    285                                 break;
    286                         case MatparEnum:{
    287                                 Matpar* matpar=NULL;
    288                                 matpar=new Matpar();
    289                                 matpar->Demarshall(&marshalled_dataset);
    290                                 dataset->AddObject(matpar);}
    291                                 break;
    292                         case SpcStaticEnum:{
    293                                 SpcStatic* spcstatic=NULL;
    294                                 spcstatic=new SpcStatic();
    295                                 spcstatic->Demarshall(&marshalled_dataset);
    296                                 dataset->AddObject(spcstatic);}
    297                                 break;
    298                         case SpcDynamicEnum:{
    299                                 SpcDynamic* spcdynamic=NULL;
    300                                 spcdynamic=new SpcDynamic();
    301                                 spcdynamic->Demarshall(&marshalled_dataset);
    302                                 dataset->AddObject(spcdynamic);}
    303                                 break;
    304                         case SpcTransientEnum:{
    305                                 SpcTransient* spctransient=NULL;
    306                                 spctransient=new SpcTransient();
    307                                 spctransient->Demarshall(&marshalled_dataset);
    308                                 dataset->AddObject(spctransient);}
    309                                 break;
    310                         case PengridEnum:{
    311                                 Pengrid* pengrid=NULL;
    312                                 pengrid=new Pengrid();
    313                                 pengrid->Demarshall(&marshalled_dataset);
    314                                 dataset->AddObject(pengrid);}
    315                                 break;
    316                         case PenpairEnum:{
    317                                 Penpair* penpair=NULL;
    318                                 penpair=new Penpair();
    319                                 penpair->Demarshall(&marshalled_dataset);
    320                                 dataset->AddObject(penpair);}
    321                                 break;
    322                         case IcefrontEnum:{
    323                                 Icefront* icefront=NULL;
    324                                 icefront=new Icefront();
    325                                 icefront->Demarshall(&marshalled_dataset);
    326                                 dataset->AddObject(icefront);}
    327                                 break;
    328                         case NumericalfluxEnum:{
    329                                 Numericalflux* numericalflux=NULL;
    330                                 numericalflux=new Numericalflux();
    331                                 numericalflux->Demarshall(&marshalled_dataset);
    332                                 dataset->AddObject(numericalflux);}
    333                                 break;
    334                         #ifdef _HAVE_RIFTS_
    335                         case RiftfrontEnum:{
    336                                 Riftfront* riftfront=NULL;
    337                                 riftfront=new Riftfront();
    338                                 riftfront->Demarshall(&marshalled_dataset);
    339                                 dataset->AddObject(riftfront);}
    340                                 break;
    341                         #endif
    342                         case DoubleInputEnum:{
    343                                 DoubleInput* doubleinput=NULL;
    344                                 doubleinput=new DoubleInput();
    345                                 doubleinput->Demarshall(&marshalled_dataset);
    346                                 dataset->AddObject(doubleinput);}
    347                                 break;
    348                         case IntInputEnum:{
    349                                 IntInput* intinput=NULL;
    350                                 intinput=new IntInput();
    351                                 intinput->Demarshall(&marshalled_dataset);
    352                                 dataset->AddObject(intinput);}
    353                                 break;
    354                         case BoolInputEnum:{
    355                                 BoolInput* boolinput=NULL;
    356                                 boolinput=new BoolInput();
    357                                 boolinput->Demarshall(&marshalled_dataset);
    358                                 dataset->AddObject(boolinput);}
    359                                 break;
    360                         case IntParamEnum:{
    361                                 IntParam* intparam=NULL;
    362                                 intparam=new IntParam();
    363                                 intparam->Demarshall(&marshalled_dataset);
    364                                 dataset->AddObject(intparam);}
    365                                 break;
    366                         case BoolParamEnum:{
    367                                 BoolParam* boolparam=NULL;
    368                                 boolparam=new BoolParam();
    369                                 boolparam->Demarshall(&marshalled_dataset);
    370                                 dataset->AddObject(boolparam);}
    371                                 break;
    372                         case StringParamEnum:{
    373                                 StringParam* stringparam=NULL;
    374                                 stringparam=new StringParam();
    375                                 stringparam->Demarshall(&marshalled_dataset);
    376                                 dataset->AddObject(stringparam);}
    377                                 break;
    378                         case DoubleVecExternalResultEnum:{
    379                                 DoubleVecExternalResult* doublevecexternalresult=NULL;
    380                                 doublevecexternalresult=new DoubleVecExternalResult();
    381                                 doublevecexternalresult->Demarshall(&marshalled_dataset);
    382                                 dataset->AddObject(doublevecexternalresult);}
    383                                 break;
    384                         case DoubleExternalResultEnum:{
    385                                 DoubleExternalResult* doubleexternalresult=NULL;
    386                                 doubleexternalresult=new DoubleExternalResult();
    387                                 doubleexternalresult->Demarshall(&marshalled_dataset);
    388                                 dataset->AddObject(doubleexternalresult);}
    389                                 break;
    390                         #ifdef _HAVE_GROUNDINGLINE_
    391                         case BoolElementResultEnum:{
    392                                 BoolElementResult* boolelementresult=NULL;
    393                                 boolelementresult=new BoolElementResult();
    394                                 boolelementresult->Demarshall(&marshalled_dataset);
    395                                 dataset->AddObject(boolelementresult);}
    396                                 break;
    397                         #endif
    398                         default:
    399                                 _error_("could not recognize enum type: %s",EnumToStringx(enum_type));
    400                 }
    401         }
    402 
    403         /*Assign output pointers:*/
    404         *pmarshalled_dataset=marshalled_dataset;
    405        
    406         return dataset;
    407 }
    408 /*}}}*/
    409 #endif
    410 
    41186/*Specific methods*/
    41287/*FUNCTION DataSet::AddObject{{{1*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/Container/DataSet.h

    r9777 r12168  
    4949                void  Echo();
    5050                void  DeepEcho();
    51                 #ifdef _SERIAL_
    52                 char* Marshall();
    53                 int   MarshallSize();
    54                 #endif
    5551                int   AddObject(Object* object);
    5652                int   DeleteObject(int id);
     
    6965};
    7066
    71 /*This routine cannot be object oriented, but need for demarshalling: */
    72 #ifdef _SERIAL_
    73 DataSet* DataSetDemarshall(char* marshalled_dataset);
    74 DataSet* DataSetDemarshallRaw(char** pmarshalled_dataset);
    7567#endif
    76        
    77 
    78 
    79 #endif
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/Container/Elements.cpp

    r11708 r12168  
    124124        }
    125125
    126         #ifdef _PARALLEL_
    127126        /*Synchronize across cluster, so as to not end up with different sizes for each patch on each cpu: */
     127        #ifdef _HAVE_MPI_
    128128        MPI_Reduce (&numvertices,&max_numvertices,1,MPI_INT,MPI_MAX,0,MPI_COMM_WORLD );
    129129        MPI_Bcast(&max_numvertices,1,MPI_INT,0,MPI_COMM_WORLD);
     
    193193
    194194                /*Get rank of first cpu that has results*/
     195                #ifdef _HAVE_MPI_
    195196                if(this->Size()) rank=my_rank;
    196197                else rank=num_procs;
    197198                MPI_Allreduce (&rank,&minrank,1,MPI_INT,MPI_MIN,MPI_COMM_WORLD);
     199                #else
     200                minrank=my_rank;
     201                #endif
    198202
    199203                /*see what the first element of this partition has in stock (this is common to all partitions)*/
     
    203207                        element->ListResultsInfo(&resultsenums,&resultssizes,&resultstimes,&resultssteps,&numberofresults);
    204208                }
     209                #ifdef _HAVE_MPI_
    205210                MPI_Bcast(&numberofresults,1,MPI_DOUBLE,minrank,MPI_COMM_WORLD);
     211                #endif
    206212
    207213                /*Get out if there is no results. Otherwise broadcast info*/
    208214                if(!numberofresults) return;
     215                #ifdef _HAVE_MPI_
    209216                if(my_rank!=minrank){
    210217                        resultsenums=(int*)xmalloc(numberofresults*sizeof(int));
     
    217224                MPI_Bcast(resultstimes,numberofresults,MPI_DOUBLE,minrank,MPI_COMM_WORLD);
    218225                MPI_Bcast(resultssteps,numberofresults,MPI_INT,minrank,MPI_COMM_WORLD);
     226                #endif
    219227
    220228                /*Loop over all results and get nodal vector*/
     
    250258
    251259                /*Gather onto master cpu 0, if needed: */
    252 #ifdef _PARALLEL_
    253260                if(io_gather)patch->Gather();
    254 #endif
    255261
    256262                /*create result object and add to results dataset:*/
     
    276282        int numberofelements;
    277283
    278         #ifdef _PARALLEL_
    279284        local_nelem=this->Size();
     285        #ifdef _HAVE_MPI_
    280286        MPI_Allreduce ( (void*)&local_nelem,(void*)&numberofelements,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
    281287        #else
    282         numberofelements=this->Size();
     288        numberofelements=local_nelem;
    283289        #endif
    284290
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/Container/Loads.cpp

    r10522 r12168  
    6363
    6464        /*figure out total number of loads combining all the cpus (no clones here)*/
    65         #ifdef _PARALLEL_
     65        #ifdef _HAVE_MPI_
    6666        MPI_Reduce(&localloads,&numberofloads,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
    6767        MPI_Bcast(&numberofloads,1,MPI_INT,0,MPI_COMM_WORLD);
     
    6969        numberofloads=localloads;
    7070        #endif
     71
    7172
    7273        return numberofloads;
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/Container/Nodes.cpp

    r11298 r12168  
    8383         * 0. This means the dofs between all the cpus are not unique. We now offset the dofs of eache
    8484         * cpus by the total last dofs of the previus cpu, starting from 0.
    85          * First: bet number of dofs for each cpu*/
     85         * First: get number of dofs for each cpu*/
    8686        alldofcount=(int*)xmalloc(num_procs*sizeof(int));
     87        #ifdef _HAVE_MPI_
    8788        MPI_Gather(&dofcount,1,MPI_INT,alldofcount,1,MPI_INT,0,MPI_COMM_WORLD);
    8889        MPI_Bcast(alldofcount,num_procs,MPI_INT,0,MPI_COMM_WORLD);
     90        #else
     91        alldofcount[0]=dofcount;
     92        #endif
    8993
    9094        /* Every cpu should start its own dof count at the end of the dofcount from cpu-1*/
     
    119123                }
    120124        }
    121         MPI_Allreduce ( (void*)truedofs,(void*)alltruedofs,numnodes*maxdofspernode,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
     125
     126        #ifdef _HAVE_MPI_
     127        MPI_Allreduce((void*)truedofs,(void*)alltruedofs,numnodes*maxdofspernode,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
     128        #else
     129        for(i=0;i<numnodes*maxdofspernode;i++)alltruedofs[i]=truedofs[i];
     130        #endif
    122131
    123132        /* Now every cpu knows the true dofs of everyone else that is not a clone*/
     
    145154        int  numnodes;
    146155
    147 
    148156        /*Figure out number of nodes for this analysis: */
    149157        numnodes=this->NumberOfNodes(analysis_type);
     
    162170         * dealt with by another cpu. We take the minimum because we are going to manage dof assignment in increasing
    163171         * order of cpu rank. This is also why we initialized this array to num_procs.*/
     172        #ifdef _HAVE_MPI_
    164173        MPI_Allreduce ( (void*)ranks,(void*)minranks,numnodes,MPI_INT,MPI_MIN,MPI_COMM_WORLD);
     174        #else
     175        for(i=0;i<numnodes;i++)minranks[i]=ranks[i];
     176        #endif
    165177
    166178        /*Now go through all objects, and use minranks to flag which objects are cloned: */
     
    204216        }
    205217
    206 #ifdef _PARALLEL_
    207218        /*Grab max of all cpus: */
     219        #ifdef _HAVE_MPI_
    208220        MPI_Allreduce ( (void*)&max,(void*)&allmax,1,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
    209221        max=allmax;
    210 #endif
     222        #endif
    211223
    212224        return max;
     
    239251
    240252        /*Gather from all cpus: */
     253        #ifdef _HAVE_MPI_
    241254        MPI_Allreduce ( (void*)&numdofs,(void*)&allnumdofs,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
     255        #else
     256        allnumdofs=numdofs;
     257        #endif
    242258        return allnumdofs;
    243259}
     
    262278
    263279        /*Gather from all cpus: */
     280        #ifdef _HAVE_MPI_
    264281        MPI_Allreduce ( (void*)&numnodes,(void*)&allnumnodes,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
     282        #else
     283        allnumnodes=numnodes;
     284        #endif
    265285
    266286        return allnumnodes;
     
    288308        }
    289309
    290         #ifdef _PARALLEL_
    291                 MPI_Reduce (&max_sid,&node_max_sid,1,MPI_INT,MPI_MAX,0,MPI_COMM_WORLD );
    292                 MPI_Bcast(&node_max_sid,1,MPI_INT,0,MPI_COMM_WORLD);
    293                 max_sid=node_max_sid;
    294         #endif 
     310        #ifdef _HAVE_MPI_
     311        MPI_Reduce (&max_sid,&node_max_sid,1,MPI_INT,MPI_MAX,0,MPI_COMM_WORLD );
     312        MPI_Bcast(&node_max_sid,1,MPI_INT,0,MPI_COMM_WORLD);
     313        max_sid=node_max_sid;
     314        #endif
    295315
    296316        if(max_sid==1){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/Container/Options.cpp

    r12004 r12168  
    2020#include "../shared/shared.h"
    2121#include "../EnumDefinitions/EnumDefinitions.h"
    22 #if _SERIAL_
    2322#include "../io/io.h"
    24 #endif
    2523/*}}}*/
    2624
     
    3129}
    3230/*}}}*/
    33 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    34 /*FUNCTION Options::Options(int istart, int nrhs, const mxArray* prhs[]){{{1*/
    35 Options::Options(int istart, int nrhs, const mxArray* prhs[]){
    36 
    37         int            i;
    38         char          *name    = NULL;
    39         Option *option = NULL;
    40 
    41         /*loop over each name and value*/
    42         for (i=istart; i<nrhs; i=i+2){
    43                 if (!mxIsClass(prhs[i],"char")) _error_("Argument %d must be name of option.",i+1);
    44 
    45                 FetchData(&name,prhs[i]);
    46                 if (i+1 == nrhs) _error_("Argument %d must exist and be value of option \"%s\".",i+2,name);
    47 
    48                 //_printf_(true,"  Processing option \"%s\" of class \"%s\".\n",name,mxGetClassName(prhs[i+1]));
    49                 option=(Option*)OptionParse(name,&prhs[i+1]);
    50                 this->AddOption(option);
    51                 option=NULL;
    52         }
    53 
    54         /*echo the dataset  */
    55         //if (this->Size()) for(i=0;i<this->Size();i++) ((Option*)this->GetObjectByOffset(i))->Echo();
    56 }
    57 /*}}}*/
    58 #endif
    5931/*FUNCTION Options::~Options(){{{1*/
    6032Options::~Options(){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/Container/Options.h

    r12004 r12168  
    1515                /*constructors, destructors*/
    1616                Options();
    17                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18                 Options(int istart, int nrhs, const mxArray* prhs[]);
    19                 #endif
    2017                ~Options();
    2118
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/Container/Results.cpp

    r12004 r12168  
    6565/*}}}*/
    6666/*FUNCTION Results::Write{{{1*/
    67 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    68 void Results::Write(mxArray** pdataref){
    69 
    70         int i,j;
    71         int count;
    72 
    73         /*output: */
    74         mxArray* dataref=NULL;
    75         mxArray* processeddataref=NULL;
    76         mwSize nfields;
    77         mwSize maxfields;
    78         mwSize nsteps;
    79         mwSize step;
    80         const char **fnames      = NULL;
    81         int         *enums       = NULL;
    82         int          baseenum;
    83         mwSize       onebyone[2] = {1,1};
    84         mwSize       ndim        = 2;
    85 
    86         /*How many time steps do we have? : */
    87         nsteps=0;
    88         for(i=0;i<this->Size();i++){
    89                 ExternalResult* result=(ExternalResult*)this->GetObjectByOffset(i);
    90                 step=result->GetStep();
    91                 if(step>nsteps)nsteps=step;
    92         }
    93         onebyone[0]=nsteps;
    94 
    95         /*How many field names do we have. First, figure out how many result types we have: */
    96         maxfields=(mwSize)this->Size();
    97         enums=(int*)xmalloc(maxfields*sizeof(int));
    98         for(i=0;i<maxfields;i++){
    99                 ExternalResult* result=(ExternalResult*)this->GetObjectByOffset(i);
    100                 enums[i]=result->InstanceEnum();
    101         }
    102         /*Now, make result types unique: */
    103         for(i=0;i<maxfields;i++){
    104                 if(enums[i]>=0){//if <0, it means this enum was found to replicate another one previously
    105                         baseenum=enums[i];             
    106                         /*is the baseenum repeated later on?:*/
    107                         for(j=i+1;j<maxfields;j++){
    108                                 if (enums[j]==baseenum)enums[j]=-1;
    109                         }
    110                 }
    111                 else continue;
    112         }
    113 
    114         /*Now, go through enums, and whatever is not null is a non repeated field name: */
    115         nfields=0;
    116         for(i=0;i<maxfields;i++)if(enums[i]>0)nfields++;
    117 
    118         /*Add 2 fields for time and step: */
    119         nfields=nfields+2;
    120        
    121         /*Fill the names of the structure field: */
    122         fnames=(const char**)xmalloc(nfields*sizeof(char*));
    123         count=0;
    124         for(i=0;i<maxfields;i++){
    125                 if (enums[i]>0){
    126                         fnames[count]=EnumToStringx(enums[i]);
    127                         count++;
    128                 }
    129         }
    130         /*don't forget the extra fields "time" and "step":*/
    131         fnames[nfields-2]="time";
    132         fnames[nfields-1]="step";
    133 
    134         /*Initialize structure: */
    135         dataref=mxCreateStructArray( ndim,onebyone,nfields,fnames);
    136 
    137         /*Fill each field: */
    138         for(i=0;i<this->Size();i++){ //do not include the last one used for time
    139                 ExternalResult* result=(ExternalResult*)this->GetObjectByOffset(i);
    140                 result->SetMatlabField(dataref);
    141         }
    142 
    143         /*Now, process the patch in the dataref structure, by calling MatlabProcessPatch.m
    144          *on the current dataref structure: */
    145         mexCallMATLAB(1,&processeddataref,1,&dataref, "MatlabProcessPatch");
    146 
    147         /*Assign output pointers:*/
    148         *pdataref=processeddataref;
    149 }
    150 #else
    15167void Results::Write(Parameters* parameters){
    15268       
     
    16783
    16884}
    169 #endif
    17085/*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/Container/Results.h

    r12004 r12168  
    2626                /*numerics: {{{1*/
    2727                Results* SpawnTriaResults(int* indices);
    28                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    29                 void Write(mxArray** pdataref);
    30                 #else
    3128                void Write(Parameters* parameters);
    32                 #endif
    3329                /*}}}*/
    3430};
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/Container/Vertices.cpp

    r11298 r12168  
    6161         * First: bet number of dofs for each cpu*/
    6262        alldofcount=(int*)xmalloc(num_procs*sizeof(int));
     63        #ifdef _HAVE_MPI_
    6364        MPI_Gather(&dofcount,1,MPI_INT,alldofcount,1,MPI_INT,0,MPI_COMM_WORLD);
    6465        MPI_Bcast(alldofcount,num_procs,MPI_INT,0,MPI_COMM_WORLD);
     66        #else
     67        alldofcount[0]=dofcount;
     68        #endif
    6569
    6670        /* Every cpu should start its own dof count at the end of the dofcount from cpu-1*/
     
    8589                vertex->ShowTrueDofs(truedofs);
    8690        }
     91        #ifdef _HAVE_MPI_
    8792        MPI_Allreduce((void*)truedofs,(void*)alltruedofs,numberofobjects*numberofdofsperobject,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
     93        #else
     94        for(i=0;i<numberofobjects*numberofdofsperobject;i++)alltruedofs[i]=truedofs[i];
     95        #endif
    8896
    8997        /* Now every cpu knows the true dofs of everyone else that is not a clone*/
     
    121129         * dealt with by another cpu. We take the minimum because we are going to manage dof assignment in increasing
    122130         * order of cpu rank. This is also why we initialized this array to num_procs.*/
     131        #ifdef _HAVE_MPI_
    123132        MPI_Allreduce ( (void*)ranks,(void*)minranks,numberofobjects,MPI_INT,MPI_MIN,MPI_COMM_WORLD);
     133        #else
     134        for(i=0;i<numberofobjects;i++)minranks[i]=ranks[i];
     135        #endif
    124136
    125137        /*Now go through all objects, and use minranks to flag which objects are cloned: */
     
    149161        }
    150162
    151         #ifdef _PARALLEL_
     163        #ifdef _HAVE_MPI_
    152164        MPI_Reduce (&max_sid,&vertex_max_sid,1,MPI_INT,MPI_MAX,0,MPI_COMM_WORLD );
    153165        MPI_Bcast(&vertex_max_sid,1,MPI_INT,0,MPI_COMM_WORLD);
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/EnumDefinitions/Synchronize.sh

    r11684 r12168  
    66
    77#Removed existing files
    8 rm $ISSM_TIER/src/m/enum/*.m
    9 rm $ISSM_TIER/src/c/modules/EnumToStringx/EnumToStringx.cpp
    10 rm $ISSM_TIER/src/c/modules/StringToEnumx/StringToEnumx.cpp
     8rm $ISSM_DIR/src/m/enum/*.m
     9rm $ISSM_DIR/src/c/modules/EnumToStringx/EnumToStringx.cpp
     10rm $ISSM_DIR/src/c/modules/StringToEnumx/StringToEnumx.cpp
    1111
    1212#Get number of enums
     
    1515#Build EnumToStringx.cpp {{{1
    1616#Header
    17 cat <<END >  $ISSM_TIER/src/c/modules/EnumToStringx/EnumToStringx.cpp
     17cat <<END >  $ISSM_DIR/src/c/modules/EnumToStringx/EnumToStringx.cpp
    1818/*
    1919* \file EnumToStringx.cpp:
     
    3535END
    3636#core
    37 cat temp |  awk '{print "\t\t" "case " $2" : return \"" substr($2,1,length($2)-4) "\";"}' >> $ISSM_TIER/src/c/modules/EnumToStringx/EnumToStringx.cpp
     37cat temp |  awk '{print "\t\t" "case " $2" : return \"" substr($2,1,length($2)-4) "\";"}' >> $ISSM_DIR/src/c/modules/EnumToStringx/EnumToStringx.cpp
    3838#Footer
    39 cat <<END >> $ISSM_TIER/src/c/modules/EnumToStringx/EnumToStringx.cpp
     39cat <<END >> $ISSM_DIR/src/c/modules/EnumToStringx/EnumToStringx.cpp
    4040                default : return "unknown";
    4141
     
    5757#Build StringToEnumx.cpp {{{1
    5858#Header
    59 cat <<END > $ISSM_TIER/src/c/modules/StringToEnumx/StringToEnumx.cpp
     59cat <<END > $ISSM_DIR/src/c/modules/StringToEnumx/StringToEnumx.cpp
    6060/*
    6161* \file StringToEnumx.cpp:
     
    8181i2=120;
    8282for (( i=1 ; i<=100 ; i++ )); do
    83         echo "   if(stage==$i){" >> $ISSM_TIER//src/c/modules/StringToEnumx/StringToEnumx.cpp
     83        echo "   if(stage==$i){" >> $ISSM_DIR//src/c/modules/StringToEnumx/StringToEnumx.cpp
    8484        awk -v i1=$i1 -v i2=$i2 '{if(NR>=i1 && NR<=i2) print $0 }' temp |
    85         awk '{print "\t" ((NR==1)?"      if":"      else if") " (strcmp(name,\"" substr($2,1,length($2)-4) "\")==0) return " $2 ";"}' >> $ISSM_TIER//src/c/modules/StringToEnumx/StringToEnumx.cpp
    86         echo "         else stage=$(($i+1));" >> $ISSM_TIER//src/c/modules/StringToEnumx/StringToEnumx.cpp
    87         echo "   }" >> $ISSM_TIER//src/c/modules/StringToEnumx/StringToEnumx.cpp
     85        awk '{print "\t" ((NR==1)?"      if":"      else if") " (strcmp(name,\"" substr($2,1,length($2)-4) "\")==0) return " $2 ";"}' >> $ISSM_DIR//src/c/modules/StringToEnumx/StringToEnumx.cpp
     86        echo "         else stage=$(($i+1));" >> $ISSM_DIR//src/c/modules/StringToEnumx/StringToEnumx.cpp
     87        echo "   }" >> $ISSM_DIR//src/c/modules/StringToEnumx/StringToEnumx.cpp
    8888       
    8989        if [ $i2 -ge $NUMENUMS ]; then break; fi
     
    9393
    9494#footer
    95 cat <<END >> $ISSM_TIER/src/c/modules/StringToEnumx/StringToEnumx.cpp
     95cat <<END >> $ISSM_DIR/src/c/modules/StringToEnumx/StringToEnumx.cpp
    9696        /*If we reach this point, the string provided has not been found*/
    9797   _error_("Enum %s not found",name);
     
    127127        #}}}
    128128        #Add case to matlabenum file{{{
    129         cat <<END > $ISSM_TIER"/src/m/enum/"$(echo $NAMEENUM".m")
     129        cat <<END > $ISSM_DIR"/src/m/enum/"$(echo $NAMEENUM".m")
    130130function macro=$(echo $NAMEENUM)()
    131131%$(echo $NAMEENUM | awk {'print toupper($1)'}) - Enum of $(echo $NAME)
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/Makefile.am

    r12004 r12168  
    44
    55#Library declaration {{{1
    6 #Compile serial library, and then try and compile parallel library
    7 if NOSERIAL
    8 if NOPARALLEL
    9 lib_LIBRARIES =
    10 else
    11 lib_LIBRARIES = libpISSM.a libOverload.a
    12 endif
    13 else
    14 if NOPARALLEL
    15 lib_LIBRARIES = libISSM.a libOverload.a
    16 else
    17 lib_LIBRARIES = libISSM.a libpISSM.a libOverload.a
    18 endif
     6lib_LIBRARIES = libISSMCore.a libISSMModules.a libISSMOverload.a
     7if PYTHON
     8lib_LIBRARIES += libISSMPython.a
     9endif
     10if MATLAB
     11lib_LIBRARIES += libISSMMatlab.a
    1912endif
    2013#}}}
     
    2215#sources
    2316#Core sources{{{1
    24 core_sources = ./include/macros.h\
     17core_sources = ./issm.h\
     18                                        ./issm-binding.h\
     19                                        ./include/macros.h\
    2520                                        ./include/typedefs.h\
    2621                                        ./include/types.h\
     
    211206                                        ./shared/Wrapper/ModuleBoot.cpp\
    212207                                        ./shared/Wrapper/ModuleEnd.cpp\
    213                                         ./toolkits/mpi/mpiincludes.h\
    214                                         ./toolkits/mpi/patches/mpipatches.h\
    215                                         ./toolkits/mpi/patches/DetermineLocalSize.cpp\
    216                                         ./toolkits/mpi/patches/MPI_Upperrow.cpp\
    217                                         ./toolkits/mpi/patches/MPI_Lowerrow.cpp\
    218                                         ./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp\
    219208                                        ./toolkits/metis/metisincludes.h\
    220209                                        ./toolkits/issm/issmtoolkit.h\
     
    223212                                        ./toolkits/issm/SeqMat.h\
    224213                                        ./toolkits/issm/SeqMat.cpp\
    225                                         ./toolkits/metis/patches/metispatches.h\
    226                                         ./toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp\
    227214                                        ./toolkits/triangle/triangleincludes.h\
    228215                                        ./toolkitsenums.h\
     
    362349                                          ./modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp\
    363350                                          ./modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp\
    364                                           ./modules/AverageOntoPartitionx/AverageOntoPartitionx.h
    365 dakota_psources= ./modules/Dakotax/SpawnCoreParallel.cpp
     351                                          ./modules/AverageOntoPartitionx/AverageOntoPartitionx.h\
     352                                          ./modules/Dakotax/SpawnCoreParallel.cpp
    366353#}}}
    367354#Transient sources  {{{1
    368 transient_sources  = ./modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp
    369 transient_psources = ./solutions/transient_core.cpp
     355transient_sources  = ./modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp \
     356                                        ./solutions/transient_core.cpp
    370357#}}}
    371358#Steadystate sources  {{{1
    372 steadystate_psources = ./solutions/steadystate_core.cpp\
    373                                                 ./solutions/steadystateconvergence.cpp
     359steadystate_sources = ./solutions/steadystate_core.cpp\
     360                                          ./solutions/steadystateconvergence.cpp
    374361#}}}
    375362#Prognostic sources  {{{1
     
    377364                                              ./modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp\
    378365                                              ./modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp\
    379                                               ./modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp
    380 prognostic_psources = ./solutions/prognostic_core.cpp
     366                                              ./modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp\
     367                                                  ./solutions/prognostic_core.cpp
    381368#}}}
    382369#Thermal sources  {{{1
     
    395382                                           ./modules/ConstraintsStatex/ThermalConstraintsState.cpp\
    396383                                           ./modules/ConstraintsStatex/ThermalIsPresent.cpp\
    397                                            ./modules/ResetConstraintsx/ThermalConstraintsReset.cpp
    398 
    399 thermal_psources = ./solutions/thermal_core.cpp\
    400                                             ./solutions/enthalpy_core.cpp\
    401                                             ./solvers/solver_thermal_nonlinear.cpp
     384                                           ./modules/ResetConstraintsx/ThermalConstraintsReset.cpp \
     385                                           ./solutions/thermal_core.cpp\
     386                                           ./solutions/enthalpy_core.cpp\
     387                                           ./solvers/solver_thermal_nonlinear.cpp
    402388#}}}
    403389#Control sources  {{{1
     
    443429                                          ./objects/Inputs/ControlInput.cpp\
    444430                                          ./shared/Numerics/BrentSearch.cpp\
    445                                           ./shared/Numerics/OptimalSearch.cpp\
    446                                           ./shared/Numerics/OptFunc.cpp
    447 
    448 control_psources=./solutions/control_core.cpp\
     431                                          ./shared/Numerics/OptimalSearch.cpp \
     432                                          ./solutions/control_core.cpp\
    449433                                          ./solutions/controltao_core.cpp\
    450434                                          ./solutions/controlrestart.cpp\
     
    462446                                              ./modules/ModelProcessorx/Hydrology/CreateNodesHydrology.cpp\
    463447                                              ./modules/ModelProcessorx/Hydrology/CreateConstraintsHydrology.cpp\
    464                                               ./modules/ModelProcessorx/Hydrology/CreateLoadsHydrology.cpp
    465                                          
    466 hydrology_psources  = ./solutions/hydrology_core.cpp\
    467                                                ./solutions/hydrology_core_step.cpp
     448                                              ./modules/ModelProcessorx/Hydrology/CreateLoadsHydrology.cpp \
     449                                                  ./solutions/hydrology_core.cpp\
     450                                                  ./solutions/hydrology_core_step.cpp
    468451#}}}
    469452#Diagnostic sources  {{{1
     
    480463                                              ./modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp \
    481464                                              ./modules/ModelProcessorx/DiagnosticHutter/CreateLoadsDiagnosticHutter.cpp \
    482                                                         ./shared/Elements/CoordinateSystemTransform.cpp\
    483                                                         ./shared/Elements/TransformLoadVectorCoord.cpp \
    484                                                         ./shared/Elements/TransformStiffnessMatrixCoord.cpp \
    485                                                         ./shared/Elements/TransformInvStiffnessMatrixCoord.cpp \
    486                                                         ./shared/Elements/TransformSolutionCoord.cpp
    487 diagnostic_psources =./solutions/diagnostic_core.cpp\
    488                                               ./solvers/solver_stokescoupling_nonlinear.cpp
     465                                                  ./shared/Elements/CoordinateSystemTransform.cpp\
     466                                                  ./shared/Elements/TransformLoadVectorCoord.cpp \
     467                                                  ./shared/Elements/TransformStiffnessMatrixCoord.cpp \
     468                                                  ./shared/Elements/TransformInvStiffnessMatrixCoord.cpp \
     469                                                  ./shared/Elements/TransformSolutionCoord.cpp\
     470                                                  ./solutions/diagnostic_core.cpp\
     471                                                  ./solvers/solver_stokescoupling_nonlinear.cpp
    489472#}}}
    490473#Balanced sources  {{{1
     
    492475                                            ./modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp\
    493476                                            ./modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp\
    494                                             ./modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp
    495 balanced_psources = ./solutions/balancethickness_core.cpp
     477                                                ./modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp\
     478                                                ./solutions/balancethickness_core.cpp
    496479#}}}
    497480#Responses sources  {{{1
     
    533516                                          ./modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp \
    534517                                          ./modules/ModelProcessorx/SurfaceSlope/CreateConstraintsSurfaceSlope.cpp\
    535                                           ./modules/ModelProcessorx/SurfaceSlope/CreateLoadsSurfaceSlope.cpp
    536 slope_psources = ./solutions/surfaceslope_core.cpp\
     518                                          ./modules/ModelProcessorx/SurfaceSlope/CreateLoadsSurfaceSlope.cpp\
     519                                          ./solutions/surfaceslope_core.cpp\
    537520                                          ./solutions/bedslope_core.cpp
    538521#}}}
     
    694677                             ./objects/KML/KMLFileReadUtils.h
    695678#}}}
    696 #Matlab sources  {{{1
    697 matlab_sources= ./toolkits/matlab/matlabincludes.h\
    698                                     ./toolkits/matlab/MatlabNArrayToNArray.cpp\
    699                                     ./toolkits/double/MatlabVectorToDoubleVector.cpp\
    700                                     ./toolkits/double/double.h\
    701                                     ./toolkits/double/MatlabMatrixToDoubleMatrix.cpp\
    702                                     ./io/Matlab/matlabio.h\
    703                                     ./io/Matlab/CheckNumMatlabArguments.cpp\
    704                                     ./io/Matlab/mxGetAssignedField.cpp\
    705                                     ./io/Matlab/WriteMatlabData.cpp\
    706                                     ./io/Matlab/FetchMatlabData.cpp\
    707                                     ./io/Matlab/OptionParse.cpp
    708 #}}}
    709 #Python sources  {{{1
    710 python_sources=     ./io/Python/pythonio.h\
    711                                     ./io/Python/WritePythonData.cpp\
    712                                     ./io/Python/CheckNumPythonArguments.cpp\
    713                                     ./io/Python/FetchPythonData.cpp
    714 #}}}
    715679#Petsc sources  {{{1
    716680petsc_sources= ./toolkits/petsc\
     
    718682                                        ./toolkits/petsc/patches/SolverEnum.h\
    719683                                        ./toolkits/petsc/patches/petscpatches.h\
    720                                         ./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp\
    721                                         ./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp\
    722                                         ./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp\
    723                                         ./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp\
    724684                                        ./toolkits/petsc/patches/VecTranspose.cpp\
    725685                                        ./toolkits/petsc/patches/VecToMPISerial.cpp\
     
    732692                                        ./toolkits/petsc/patches/SerialToVec.cpp\
    733693                                        ./toolkits/petsc/patches/VecFree.cpp\
     694                                        ./toolkits/petsc/patches/PetscMatrixToDoubleMatrix.cpp\
     695                                        ./toolkits/petsc/patches/PetscVectorToDoubleVector.cpp\
    734696                                        ./toolkits/petsc/patches/VecDuplicatePatch.cpp\
    735697                                        ./toolkits/petsc/patches/KSPFree.cpp\
     
    754716
    755717#}}}
    756 #Serialsources  {{{1
    757 serial_sources= ./objects/Options/Option.cpp\
     718#Mpi sources  {{{1
     719mpi_sources= ./toolkits/mpi/mpiincludes.h\
     720                                ./toolkits/mpi/patches/mpipatches.h\
     721                                ./toolkits/mpi/patches/DetermineLocalSize.cpp\
     722                                ./toolkits/mpi/patches/MPI_Upperrow.cpp\
     723                                ./toolkits/mpi/patches/MPI_Lowerrow.cpp\
     724                                ./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp
     725#}}}
     726#Metis sources  {{{1
     727metis_sources= ./toolkits/metis/patches/metispatches.h\
     728                                        ./toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp
     729#}}}
     730#Python sources  {{{1
     731python_sources=     ./python/io/pythonio.h\
     732                                        ./python/python-binding.h\
     733                                    ./python/io/WritePythonData.cpp\
     734                                    ./python/io/CheckNumPythonArguments.cpp\
     735                                    ./python/io/FetchPythonData.cpp
     736
     737#}}}
     738#Matlab sources  {{{1
     739matlab_sources= ./toolkits/matlab/matlabincludes.h\
     740                                    ./matlab/matlab-binding.h\
     741                                    ./matlab/io/matlabio.h\
     742                                    ./matlab/io/MatlabNArrayToNArray.cpp\
     743                                    ./matlab/io/CheckNumMatlabArguments.cpp\
     744                                    ./matlab/io/mxGetAssignedField.cpp\
     745                                    ./matlab/io/WriteMatlabData.cpp\
     746                                    ./matlab/io/FetchMatlabData.cpp\
     747                                    ./matlab/io/OptionParse.cpp\
     748                                    ./matlab/io/MatlabMatrixToMatrix.cpp\
     749                                    ./matlab/io/MatlabVectorToVector.cpp\
     750                                         ./matlab/io/MatlabVectorToDoubleVector.cpp\
     751                                         ./matlab/io/MatlabMatrixToDoubleMatrix.cpp\
     752                                         ./matlab/io/MatlabMatrixToSeqMat.cpp\
     753                                         ./matlab/io/MatlabVectorToSeqVec.cpp
     754#}}}
     755#Matlab and Petsc sources  {{{1
     756matlabpetsc_sources= ./matlab/io/MatlabMatrixToPetscMatrix.cpp\
     757                                         ./matlab/io/MatlabVectorToPetscVector.cpp
     758       
     759#}}}
     760#Modules sources{{{1
     761module_sources= ./objects/Options/Option.cpp\
    758762                        ./objects/Options/Option.h\
    759763                        ./objects/Options/OptionDouble.cpp\
     
    769773                        ./objects/Options/OptionUtilities.cpp\
    770774                        ./objects/Options/OptionUtilities.h\
     775                        ./shared/Alloc/alloc_module.h\
     776                        ./shared/Alloc/alloc_module.cpp\
    771777                        ./shared/Threads/issm_threads.h\
    772778                        ./shared/Threads/LaunchThread.cpp\
     
    790796                        ./modules/Chacox/chaco_seconds.cpp\
    791797                        ./modules/Chacox/user_params.cpp\
    792                         ./modules/Dakotax/SpawnCoreSerial.cpp\
    793798                        ./modules/TriaSearchx/TriaSearchx.h\
    794799                        ./modules/TriaSearchx/TriaSearchx.cpp\
     
    815820                        ./modules/HoleFillerx/HoleFillerx.cpp\
    816821                        ./modules/HoleFillerx/HoleFillerx.h\
     822                        ./modules/Krigingx/Krigingx.cpp\
     823                        ./modules/Krigingx/Krigingx.h\
    817824                        ./modules/AverageFilterx/AverageFilterx.cpp\
    818825                        ./modules/AverageFilterx/AverageFilterx.h\
     
    841848#}}}
    842849
     850#{{{1 Conditional build-up of sources
    843851#ISSM sources are a combination of core sources and sources related to specific capabilities (which can
    844852#be activated by autotools conditionals
    845 #{{{1
     853
    846854
    847855#First the core
    848856issm_sources  =  $(core_sources)
    849 issm_psources = 
    850857
    851858#Now the optional source
    852859if DAKOTA
    853860issm_sources  +=  $(dakota_sources)
    854 issm_psources +=  $(dakota_psources)
    855861endif
    856862
    857863if PETSC
    858864issm_sources  +=  $(petsc_sources)
    859 issm_psources +=  $(petsc_psources)
    860865endif
    861866
    862867if GSL
    863868issm_sources  +=  $(gsl_sources)
    864 issm_psources +=  $(gsl_psources)
    865 endif
    866 
     869endif
    867870
    868871if TRANSIENT
    869872issm_sources  +=  $(transient_sources)
    870 issm_psources +=  $(transient_psources)
    871873endif
    872874
    873875if STEADYSTATE
    874876issm_sources  +=  $(steadystate_sources)
    875 issm_psources +=  $(steadystate_psources)
    876877endif
    877878
    878879if PROGNOSTIC
    879880issm_sources  +=  $(prognostic_sources)
    880 issm_psources +=  $(prognostic_psources)
    881881endif
    882882
    883883if THERMAL
    884884issm_sources  +=  $(thermal_sources)
    885 issm_psources +=  $(thermal_psources)
    886885endif
    887886
    888887if CONTROL
    889888issm_sources  +=  $(control_sources)
    890 issm_psources +=  $(control_psources)
    891889endif
    892890
    893891if HYDROLOGY
    894892issm_sources  +=  $(hydrology_sources)
    895 issm_psources +=  $(hydrology_psources)
    896893endif
    897894
    898895if DIAGNOSTIC
    899896issm_sources  +=  $(diagnostic_sources)
    900 issm_psources +=  $(diagnostic_psources)
    901897endif
    902898
    903899if BALANCED
    904900issm_sources  +=  $(balanced_sources)
    905 issm_psources +=  $(balanced_psources)
    906901endif
    907902
     
    912907if SLOPE
    913908issm_sources  +=  $(slope_sources)
    914 issm_psources +=  $(slope_psources)
    915909endif
    916910
     
    926920issm_sources +=  $(threed_sources)
    927921endif
    928 #}}}
    929 
    930 #ISSM serial library {{{1
    931 if SERIAL
    932 libISSM_a_SOURCES  = $(issm_sources)
    933 libISSM_a_SOURCES += $(serial_sources)
    934 libISSM_a_SOURCES += $(bamg_sources)
    935 libISSM_a_SOURCES += $(kml_sources)
    936 libISSM_a_CXXFLAGS = -fPIC -D_SERIAL_ -D_GNU_SOURCE -fno-omit-frame-pointer -pthread -D_CPP_  $(CXXFLAGS) $(CXXOPTFLAGS)
    937 #libISSM_a_CXXFLAGS = -D_SERIAL_ -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER   $(CXXFLAGS) $(CXXOPTFLAGS)
     922
     923if MPI
     924issm_sources +=  $(mpi_sources)
     925endif
     926
     927if METIS
     928issm_sources +=  $(metis_sources)
     929endif
     930
     931if PETSC
     932if MATLAB
     933issm_sources +=  $(matlabpetsc_sources)
     934endif
     935endif
     936
     937
     938#}}}
     939#Library flags and sources {{{1
     940ALLCXXFLAGS= -fPIC -D_GNU_SOURCE -fno-omit-frame-pointer -pthread -D_CPP_  $(CXXFLAGS) $(CXXOPTFLAGS)
     941
     942libISSMCore_a_SOURCES  = $(issm_sources)
     943libISSMCore_a_CXXFLAGS = $(ALLCXXFLAGS)
     944
     945if MODULES
     946libISSMModules_a_SOURCES = $(module_sources)
     947libISSMModules_a_SOURCES += $(bamg_sources)
     948libISSMModules_a_SOURCES += $(kml_sources)
     949libISSMModules_a_CXXFLAGS = $(ALLCXXFLAGS)
    938950
    939951if PYTHON
    940 libISSM_a_CXXFLAGS+=  -DNPY_NO_DEPRECATED_API
    941 libISSM_a_SOURCES += $(python_sources)
     952libISSMPython_a_SOURCES = $(python_sources)
     953libISSMPython_a_CXXFLAGS= $(ALLCXXFLAGS)
    942954endif
    943955
    944956if MATLAB
    945 libISSM_a_SOURCES += $(matlab_sources)
    946 endif
    947 
    948 endif
    949 #}}}
    950 #ISSM parallel library {{{1
    951 if PARALLEL
    952 libpISSM_a_SOURCES  = $(issm_sources)
    953 libpISSM_a_SOURCES += $(issm_psources)
    954 libpISSM_a_CXXFLAGS = -fPIC -D_PARALLEL_   -D_C_ $(CXXFLAGS) $(CXXOPTFLAGS)
     957libISSMMatlab_a_SOURCES = $(matlab_sources)
     958libISSMMatlab_a_CXXFLAGS= $(ALLCXXFLAGS)
     959endif
    955960endif
    956961#}}}
    957962#Overload library, to overload any non-standard symbols. {{{1
    958 libOverload_a_SOURCES = ./shared/String/stricmp.c
    959 libOverload_a_CFLAGS  = -fPIC -D_PARALLEL_  -D_C_ $(COPTFLAGS) $(CFLAGS)
     963libISSMOverload_a_SOURCES = ./shared/String/stricmp.c
     964libISSMOverload_a_CFLAGS  = -fPIC -D_C_ $(COPTFLAGS) $(CFLAGS)
    960965#}}}
    961966
    962967#Executable {{{1
    963 if NOPARALLEL
    964 bin_PROGRAMS =
    965 else
    966968bin_PROGRAMS = issm
    967 endif
    968969
    969970#Standard libraries
    970 LDADD = ./libpISSM.a ./libOverload.a
     971LDADD = ./libISSMCore.a ./libISSMOverload.a
    971972
    972973#External packages
     
    974975
    975976issm_SOURCES = solutions/issm.cpp
    976 issm_CXXFLAGS= -fPIC -D_PARALLEL_ $(CXXFLAGS) $(CXXOPTFLAGS) $(COPTFLAGS)
     977issm_CXXFLAGS= -fPIC $(CXXFLAGS) $(CXXOPTFLAGS) $(COPTFLAGS)
    977978#}}}
    978979#Automatic differentiation: append this fold to the end of the src/c/Makefile.am to get this Makefile.am {{{
    979980if ADIC2
    980 lib_LIBRARIES += libAD.a libpISSMRose.a
     981lib_LIBRARIES += libAD.a libISSMRose.a
    981982
    982983#ADIC2 library, for automatic differentiation
    983984#libAD_a_SOURCES = ./mini1.ad.c
    984985libAD_a_SOURCES =
    985 libAD_a_CFLAGS = -fPIC -D_PARALLEL_   -D_C_ $(COPTFLAGS)
    986 
     986libAD_a_CFLAGS = -fPIC -D_C_ $(COPTFLAGS)
    987987
    988988
    989989#test rose preprocessing
    990990%.r2cpp.cpp : %.cpp
    991         testTranslator -rose:o $@ -rose:skipfinalCompileStep -DHAVE_CONFIG_H -D_PARALLEL_ -D_C_ -I. -I../.. $(INCLUDES) $<
    992 libpISSMRose_a_SOURCES = $(libpISSM_a_SOURCES:.cpp=.r2cpp.cpp)
    993 libpISSMRose_a_CXXFLAGS= -fPIC -D_PARALLEL_ -D_C_ $(CXXOPTFLAGS)
     991        testTranslator -rose:o $@ -rose:skipfinalCompileStep -DHAVE_CONFIG_H -D_C_ -I. -I../.. $(INCLUDES) $<
     992libISSMRose_a_SOURCES = $(libISSMCore_a_SOURCES:.cpp=.r2cpp.cpp)
     993libISSMRose_a_CXXFLAGS= -fPIC -D_C_ $(CXXOPTFLAGS)
    994994
    995995
     
    10031003#Executable
    10041004bin_PROGRAMS +=  issmRose.exe
    1005 issmRose_exe_LDADD = ./libpISSMRose.a $(LDADD)
     1005issmRose_exe_LDADD = ./libISSMRose.a $(LDADD)
    10061006issmRose_exe_SOURCES = solutions/issm.cpp
    1007 issmRose_exe_CXXFLAGS= -fPIC -D_PARALLEL_  $(CXXOPTFLAGS) $(COPTFLAGS)
     1007issmRose_exe_CXXFLAGS= -fPIC $(CXXOPTFLAGS) $(COPTFLAGS)
    10081008LDADD +=  $(ADIC2LIB)
    10091009
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/include/macros.h

    r12004 r12168  
    4040#endif
    4141/*}}}*/
    42 
    43 /* MODULEBOOT/MODULEEND {{{1*/
     42/* ISSMBOOT/ISSMEND {{{1*/
    4443
    4544/*The following macros hide the error exception handling in a matlab module. Just put
    46  * MODULEBOOT(); and MODULEEND(); at the beginning and end of a module, and c++ exceptions
     45 * ISSMBOOT(); and ISSMEND(); at the beginning and end of a module, and c++ exceptions
    4746 * will be trapped. Really nifty!*/
    4847
    49 #ifdef _SERIAL_
    50 #ifdef _HAVE_MATLAB_ //{{{2
    51 #define MODULEBOOT(); ModuleBoot(); \
     48#define ISSMBOOT(); \
    5249        try{
    5350
    54 #define MODULEEND(); ModuleEnd(); }\
    55         catch(ErrorException &exception){\
    56                 exception.Report(); \
    57                 mexErrMsgTxt(""); \
    58         }\
    59         catch (exception& e) {\
    60                 _printf_(true,"Standard exception: %s\n",e.what());\
    61                 mexErrMsgTxt(" ");\
    62         }
    63 #endif //}}}
    64 #ifdef _HAVE_PYTHON_ //{{{2
    65 #define MODULEBOOT(); ModuleBoot();  \
    66         PyObject* output = PyTuple_New(NLHS); if (!output) return NULL;
    67 
    68 #define MODULEEND();  ModuleEnd(); \
    69                                                  return output;
    70 #endif //}}}
    71 #else
    72 //{{{2
    73 #define MODULEBOOT(); \
    74         try{
    75 
    76 #define MODULEEND(); }\
     51#define ISSMEND(); }\
    7752        catch(ErrorException &exception){\
    7853                exception.Report(); \
     
    8257                _printf_(true,"Standard exception: %s\n",e.what());\
    8358                return 1;\
     59        }\
     60        catch(...){\
     61                _printf_(true,"An unexpected error occurred");\
    8462        }
    85 //}}}
    86 #endif
    8763/*}}}*/
    88 /* WRAPPER {{{1*/
    89 #ifdef _HAVE_MATLAB_
    90 #define WRAPPER(modulename,...) void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[])
    91 #endif
    92 #ifdef _HAVE_PYTHON_
    93 #define WRAPPER(modulename,...)  \
    94 \
    95 static PyObject* modulename(PyObject* self,PyObject* args);\
    96 static PyMethodDef modulename##_funcs[] = {\
    97         {#modulename, (PyCFunction)modulename, METH_VARARGS, ""},\
    98         {NULL,NULL,0,NULL}\
    99 };\
    100 \
    101 static struct PyModuleDef modulename##module= {\
    102         PyModuleDef_HEAD_INIT,\
    103         #modulename,   /* name of module */\
    104         NULL, /* module documentation, may be NULL */\
    105         -1,       /* size of per-interpreter state of the module,\
    106                                  or -1 if the module keeps state in global variables. */\
    107         modulename##_funcs\
    108 };\
    109 \
    110 PyMODINIT_FUNC PyInit_##modulename(void){\
    111 \
    112         import_array();\
    113         return PyModule_Create(&modulename##module);\
    114 }\
    115 \
    116 static PyObject* modulename(PyObject* self,PyObject* args)
    11764
    11865#endif
    119 
    120 /*}}}*/
    121 /* CHECKARGUMENTS {{{1*/
    122 #ifdef _HAVE_MATLAB_
    123 #define CHECKARGUMENTS(NLHS,NRHS,functionpointer) CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,functionpointer)
    124 #endif
    125 #ifdef _HAVE_PYTHON_
    126 #define CHECKARGUMENTS(NLHS,NRHS,functionpointer) CheckNumPythonArguments(args, NRHS,functionpointer)
    127 #endif
    128 /*}}}*/
    129 
    130 
    131 #endif
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/include/types.h

    r12004 r12168  
    1616
    1717/*Define abstract type for I/O: */
    18 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    19 #include <mex.h>
    20 typedef const mxArray* ConstDataHandle;  //serially, we are reading data from a matlab array.
    21 typedef mxArray* DataHandle; 
    22 #else
    23 typedef FILE* ConstDataHandle; //in parallel, we are reading data from a file.
    24 typedef FILE* DataHandle;
    25 #endif
    2618enum param_type { STRING, INTEGER, STRINGARRAY, DOUBLE, DOUBLEVEC, DOUBLEMAT, PETSCVEC, PETSCMAT };
    2719
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/io/PrintfFunction.cpp

    r12004 r12168  
    88#include "../shared/shared.h"
    99#include "../include/include.h"
    10 
    11 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    12 #include "mex.h"
    13 #endif
    1410
    1511int PrintfFunction(const char* format,...){
     
    5349
    5450        /*Ok, if we are running in parallel, get node 0 to print*/
    55 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    56         mexPrintf(buffer);
    57 #else
    5851        if(my_rank==0)printf(buffer);
    59 #endif
    6052
    6153        /*Clean up and return*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/io/io.h

    r12004 r12168  
    1515#include "./Disk/diskio.h"
    1616
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include "./Matlab/matlabio.h"
    19 #endif
    20 
    21 #if defined(_HAVE_PYTHON_) && defined(_SERIAL_)
    22 #include "./Python/pythonio.h"
    23 #endif
    24 
    2517/*printf: */
    2618int PrintfFunction(const char* format,...);
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/ConstraintsStatex/RiftConstraintsState.cpp

    r9761 r12168  
    3232        }
    3333
    34         #ifdef _PARALLEL_
     34        #ifdef _HAVE_MPI_
    3535        MPI_Reduce (&found,&mpi_found,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
    3636        MPI_Bcast(&mpi_found,1,MPI_INT,0,MPI_COMM_WORLD);               
     
    9595        }
    9696
    97         #ifdef _PARALLEL_
     97        #ifdef _HAVE_MPI_
    9898        MPI_Reduce (&num_unstable_constraints,&sum_num_unstable_constraints,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
    9999        MPI_Bcast(&sum_num_unstable_constraints,1,MPI_INT,0,MPI_COMM_WORLD);               
     
    135135       
    136136        /*Is there just one found? that would mean we have frozen! : */
    137         #ifdef _PARALLEL_
     137        #ifdef _HAVE_MPI_
    138138        MPI_Reduce (&found,&mpi_found,1,MPI_INT,MPI_MAX,0,MPI_COMM_WORLD );
    139139        MPI_Bcast(&mpi_found,1,MPI_INT,0,MPI_COMM_WORLD);               
     
    195195        }
    196196
    197         #ifdef _PARALLEL_
     197        #ifdef _HAVE_MPI_
    198198        MPI_Reduce (&found,&mpi_found,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
    199199        MPI_Bcast(&mpi_found,1,MPI_INT,0,MPI_COMM_WORLD);               
     
    228228        }
    229229
    230         #ifdef _PARALLEL_
     230        #ifdef _HAVE_MPI_
    231231        MPI_Reduce (&found,&mpi_found,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
    232232        MPI_Bcast(&mpi_found,1,MPI_INT,0,MPI_COMM_WORLD);               
     
    289289        }
    290290
    291         #ifdef _PARALLEL_
     291        #ifdef _HAVE_MPI_
    292292        MPI_Reduce (&num_unstable_constraints,&sum_num_unstable_constraints,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
    293293        MPI_Bcast(&sum_num_unstable_constraints,1,MPI_INT,0,MPI_COMM_WORLD);               
     
    329329        }
    330330
    331         #ifdef _PARALLEL_
     331        #ifdef _HAVE_MPI_
    332332        MPI_Reduce (&max_penetration,&mpi_max_penetration,1,MPI_DOUBLE,MPI_MAX,0,MPI_COMM_WORLD );
    333333        MPI_Bcast(&mpi_max_penetration,1,MPI_DOUBLE,0,MPI_COMM_WORLD);               
     
    368368        }
    369369
    370         #ifdef _PARALLEL_
     370        #ifdef _HAVE_MPI_
    371371        MPI_Reduce (&num_unstable_constraints,&sum_num_unstable_constraints,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
    372372        MPI_Bcast(&sum_num_unstable_constraints,1,MPI_INT,0,MPI_COMM_WORLD);               
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/ConstraintsStatex/ThermalConstraintsState.cpp

    r9883 r12168  
    3636        }
    3737
    38         #ifdef _PARALLEL_
     38        #ifdef _HAVE_MPI_
    3939        MPI_Reduce (&num_unstable_constraints,&sum_num_unstable_constraints,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
    4040        MPI_Bcast(&sum_num_unstable_constraints,1,MPI_INT,0,MPI_COMM_WORLD);               
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/ConstraintsStatex/ThermalIsPresent.cpp

    r9883 r12168  
    2828        }
    2929       
    30         #ifdef _PARALLEL_
     30        #ifdef _HAVE_MPI_
    3131        MPI_Reduce (&found,&mpi_found,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
    3232        MPI_Bcast(&mpi_found,1,MPI_INT,0,MPI_COMM_WORLD);               
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/ContourToMeshx/ContourToMeshx.cpp

    r11708 r12168  
    1111#include "./ContourToMeshx.h"
    1212
    13 int ContourToMeshx( Vector** pin_nod,Vector** pin_elem, double* index, double* x, double* y,Contour** contours,int numcontours,char* interptype,int nel,int nods, int edgevalue) {
     13int ContourToMeshx( Vector** pin_nod,Vector** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue) {
    1414
    1515        int noerr=1;
     
    3737
    3838        /*initialize thread parameters: */
    39         gate.numcontours=numcontours;
    4039        gate.contours=contours;
    4140        gate.nods=nods;
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/ContourToMeshx/ContourToMeshx.h

    r11708 r12168  
    1313typedef struct{
    1414
    15         int numcontours;
    16         Contour** contours;
     15        DataSet* contours;
    1716        int nods;
    1817        int edgevalue;
     
    2524
    2625/* local prototypes: */
    27 int ContourToMeshx( Vector** pin_nods,Vector** pin_elem, double* index, double* x, double* y,Contour** contours,int numcontours,char* interptype,int nel,int nods, int edgevalue);
     26int ContourToMeshx( Vector** pin_nods,Vector** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue);
    2827
    2928void* ContourToMeshxt(void* vContourToMeshxThreadStruct);
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp

    r11708 r12168  
    2626
    2727        /*Contour:*/
    28         Contour* contouri=NULL;
    29         int      numnodes;
    30         double*  xc=NULL;
    31         double*  yc=NULL;
    32 
     28        DataSet* contours=NULL;
    3329
    3430        /*parameters: */
    35         int numcontours;
    36         Contour** contours=NULL;
    3731        int nods;
    3832        int edgevalue;
     
    4943
    5044        /*recover parameters :*/
    51         numcontours=gate->numcontours;
    5245        contours=gate->contours;
    5346        nods=gate->nods;
     
    6154
    6255        /*Loop through all contours: */
    63         for (i=0;i<numcontours;i++){
    64                 contouri=*(contours+i);
    65                 numnodes=contouri->nods;
    66                 xc=contouri->x;
    67                 yc=contouri->y;
    68                 IsInPoly(in_nod,xc,yc,numnodes,x,y,i0,i1,edgevalue);
     56        for (i=0;i<contours->Size();i++){
     57                Contour* contour=(Contour*)contours->GetObjectByOffset(i);
     58                IsInPoly(in_nod,contour->x,contour->y,contour->nods,x,y,i0,i1,edgevalue);
    6959        }
    7060
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/ContourToNodesx/ContourToNodesx.cpp

    r11708 r12168  
    3838        return 1;
    3939}
     40
     41int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){
     42
     43        int i;
     44        int m,n;
     45
     46        /*Contour:*/
     47        Contour* contouri=NULL;
     48        int      numnodes;
     49        double*  xc=NULL;
     50        double*  yc=NULL;
     51        double   value;
     52
     53        /*output: */
     54        Vector* flags=NULL;
     55
     56        flags=new Vector(nods);
     57
     58        /*Loop through all contours: */
     59        if(contours){
     60                for (i=0;i<contours->Size();i++){
     61                        Contour* contour=(Contour*)contours->GetObjectByOffset(i);
     62                        IsInPoly(flags,contour->x,contour->y,contour->nods,x,y,0,nods,edgevalue);
     63                }
     64        }
     65
     66        /*Assemble vector: */
     67        flags->Assemble();
     68
     69        /*Assign output pointers: */
     70        *pflags=flags;
     71       
     72        return 1;
     73}
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/ContourToNodesx/ContourToNodesx.h

    r11708 r12168  
    1212/* local prototypes: */
    1313int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue);
     14int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue);
    1415
    1516#endif /* _CONTOURTONODESX_H */
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/Dakotax/Dakotax.cpp

    r12004 r12168  
    5151#endif
    5252
    53 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    54 void Dakotax(mxArray* femmodel){
    55 #else
    5653void Dakotax(FemModel* femmodel){
    57 #endif
    5854
    5955
     
    6965
    7066        /*Retrieve parameters: */
    71         #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    72         FetchData((Parameters**)&parameters,mxGetField((mxArray*)femmodel,0,"parameters"));
    73         #else
    7467        parameters=femmodel->parameters;
    75         #endif
    7668
    7769        /*Recover dakota_input_file, dakota_output_file and dakota_error_file, in the parameters dataset in parallel */
     
    8072        parameters->FindParam(&dakota_error_file,QmuErrNameEnum);
    8173
    82         #ifdef _PARALLEL_
    8374        if(my_rank==0){
    84         #endif
    8575       
    8676                // Instantiate/initialize the parallel library and problem description
    8777                // database objects.
    88                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    89                         Dakota::ParallelLibrary parallel_lib; //use Dakota's standard library mode constructor
    90                 #else
    91                         Dakota::ParallelLibrary parallel_lib("serial"); //use our own ISSM Dakota library mode constructor, which only fires up Dakota on CPU 0.
    92                 #endif
     78                Dakota::ParallelLibrary parallel_lib("serial"); //use our own ISSM Dakota library mode constructor, which only fires up Dakota on CPU 0.
    9379                Dakota::ProblemDescDB problem_db(parallel_lib);
    9480
     
    123109                selected_strategy.run_strategy();
    124110               
    125                 #ifdef _PARALLEL_
    126111                //Warn other cpus that we are done running the dakota iterator, by setting the counter to -1:
    127112                SpawnCore(NULL,0, NULL,NULL,0,femmodel,-1);
    128                 #endif
    129113
    130         #ifdef _PARALLEL_
    131114        }
    132115        else{
     
    136119                }
    137120        }
    138         #endif //#ifdef _PARALLEL_
    139121
    140122        /*Free ressources:*/
     
    143125        xfree((void**)&dakota_output_file);
    144126
    145         #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    146         delete parameters;
    147         #endif
    148 
    149127        #endif //#ifdef _HAVE_DAKOTA_
    150128}
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/Dakotax/Dakotax.h

    r12004 r12168  
    1010
    1111/* local prototypes: */
    12 int SpawnCore(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, void* femmodel,int counter);
     12int  SpawnCore(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, void* femmodel,int counter);
    1313int  DescriptorIndex(char* root, int* pindex,char* descriptor);
    1414
    15 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    16 void Dakotax(mxArray* femmodel);
    17 void SpawnCoreSerial(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, mxArray* femmodel,int counter);
    18 #else
    1915void Dakotax(FemModel* femmodel);
    2016void SpawnCoreParallel(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, FemModel* femmodel,int counter);
    21 #endif
    2217void DakotaResponses(double* responses,char** responses_descriptors,int numresponses,FemModel* femmodel);
    2318void DakotaMPI_Bcast(double** pvariables, char*** pvariables_descriptors,int* pnumvariables, int* pnumresponses);
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/Dakotax/SpawnCore.cpp

    r12004 r12168  
    2121        /*Branch into a serial SpawnCore and a parallel SpawnCore: */
    2222
    23         #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    24                 SpawnCoreSerial(responses, numresponses, variables, variables_descriptors,numvariables, (mxArray*)femmodel, counter);
    25         #else
    26                 /*Call SpawnCoreParallel unless counter=-1 on cpu0, in which case, bail out and return 0: */
    27                 MPI_Bcast(&counter,1,MPI_INT,0,MPI_COMM_WORLD);
    28                 if(counter==-1)return 0;
    29                 SpawnCoreParallel(responses, numresponses, variables, variables_descriptors,numvariables, (FemModel*)femmodel,counter);
    30         #endif
     23        /*Call SpawnCoreParallel unless counter=-1 on cpu0, in which case, bail out and return 0: */
     24        MPI_Bcast(&counter,1,MPI_INT,0,MPI_COMM_WORLD);
     25        if(counter==-1)return 0;
     26
     27        SpawnCoreParallel(responses, numresponses, variables, variables_descriptors,numvariables, (FemModel*)femmodel,counter);
    3128        return 1;
    3229}
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp

    r8608 r12168  
    2727
    2828        /*Sum all J from all cpus of the cluster:*/
     29        #ifdef _HAVE_MPI_
    2930        MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
    3031        MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
    3132        J=J_sum;
     33        #endif
    3234
    3335        /*Assign output pointers: */
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/ElementResponsex/ElementResponsex.cpp

    r10703 r12168  
    3737
    3838        /*Broadcast whether we found the element: */
     39        #ifdef _HAVE_MPI_
    3940        MPI_Allreduce ( &found,&sumfound,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
    4041        if(!sumfound)_error_("%s%i%s","could not find material with id",index," to compute ElementResponse");
     42        #endif
    4143
    4244        /*Ok, we found the element, compute responseocity: */
     
    4648
    4749        /*Broadcast and plug into response: */
     50        #ifdef _HAVE_MPI_
    4851        MPI_Allreduce ( &cpu_found,&cpu_found,1,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
    4952        MPI_Bcast(&response,1,MPI_DOUBLE,cpu_found,MPI_COMM_WORLD);
     53        #endif
    5054
    5155        *presponse=response;
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp

    r11577 r12168  
    6161/*  read exp file  */
    6262
    63         if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy,&closed,filexp,true))
     63        if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy,&closed,filexp))
    6464                _error_("Error reading exp file.");
    6565        _printf_(true,"Exp2Kmlx -- Reading %d exp profiles from file \"%s\".\n",nprof,filexp);
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp

    r11708 r12168  
    156156                vec_nodes_on_floatingice->Assemble();
    157157               
     158                #ifdef _HAVE_MPI_
    158159                MPI_Allreduce(&local_nflipped,&nflipped,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
    159160                _printf_(VerboseConvergence(),"   Additional number of vertices allowed to unground: %i\n",nflipped);
     161                #else
     162                nflipped=local_nflipped;
     163                #endif
    160164
    161165                /*Avoid leaks: */
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/IceVolumex/IceVolumex.cpp

    r9880 r12168  
    1919                local_ice_volume+=element->IceVolume();
    2020        }
     21        #ifdef _HAVE_MPI_
    2122        MPI_Reduce(&local_ice_volume,&total_ice_volume,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
    2223        MPI_Bcast(&total_ice_volume,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
     24        #else
     25        total_ice_volume=local_ice_volume;
     26        #endif
    2327
    2428        /*Assign output pointers: */
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/InputConvergencex/InputConvergencex.cpp

    r9761 r12168  
    3030
    3131        /*In parallel, we need to gather the converged status: */
    32         #ifdef _PARALLEL_
     32        #ifdef _HAVE_MPI_
    3333        MPI_Allreduce ( (void*)&num_notconverged,(void*)&total_notconverged,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
    3434        num_notconverged=total_notconverged;
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp

    r11708 r12168  
    1414
    1515int InterpFromMeshToMesh2dx(double** pdata_interp,double* index_data,double* x_data,double* y_data,int nods_data,int nels_data,
    16                         double* data,int data_rows,int data_cols,double* x_interp,double* y_interp,int nods_interp,double* default_values,int num_default_values, Contour** contours, int numcontours){
     16                        double* data,int data_rows,int data_cols,double* x_interp,double* y_interp,int nods_interp,double* default_values,int num_default_values, DataSet* contours){
    1717       
    1818        /*Output*/
     
    3636        bool   skip_bamg=false;
    3737
    38 
    3938        /*Checks*/
    4039        if (data_cols<=0){
     
    5049        /*If default values supplied, figure out which nodes are inside the contour, including the border of the contour: */
    5150        if(num_default_values){
    52                 ContourToNodesx( &vec_incontour,x_interp,y_interp,nods_interp,contours,numcontours,1);
     51                ContourToNodesx( &vec_incontour,x_interp,y_interp,nods_interp,contours,1);
    5352                incontour=vec_incontour->ToMPISerial();
    5453        }
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h

    r5032 r12168  
    1010/* local prototypes: */
    1111int InterpFromMeshToMesh2dx(double** pdata_interp,double* index_data,double* x_data,double* y_data,int nods_data,int nels_data,
    12                         double* data,int data_rows,int data_cols,double* x_interp,double* y_interp,int nods_interp,double* default_values,int num_default_values,Contour** contours, int numcontours );
     12                        double* data,int data_rows,int data_cols,double* x_interp,double* y_interp,int nods_interp,double* default_values,int num_default_values,DataSet* contours);
    1313
    1414#endif
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/MassFluxx/MassFluxx.cpp

    r8263 r12168  
    5959        }
    6060
    61         #ifdef _PARALLEL_
     61        #ifdef _HAVE_MPI_
    6262        MPI_Allreduce ( (void*)&mass_flux,(void*)&all_mass_flux,1,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD);
    6363        mass_flux=all_mass_flux;
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/MaxAbsVxx/MaxAbsVxx.cpp

    r5870 r12168  
    3131        }
    3232
    33         #ifdef _PARALLEL_
    3433        /*Figure out maximum across the cluster: */
     34        #ifdef _HAVE_MPI_
    3535        MPI_Reduce (&maxabsvx,&node_maxabsvx,1,MPI_DOUBLE,MPI_MAX,0,MPI_COMM_WORLD );
    3636        MPI_Bcast(&node_maxabsvx,1,MPI_DOUBLE,0,MPI_COMM_WORLD);   
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/MaxAbsVyx/MaxAbsVyx.cpp

    r5871 r12168  
    3232        }
    3333
    34         #ifdef _PARALLEL_
    3534        /*Figure out maximum across the cluster: */
     35        #ifdef _HAVE_MPI_
    3636        MPI_Reduce (&maxabsvy,&node_maxabsvy,1,MPI_DOUBLE,MPI_MAX,0,MPI_COMM_WORLD );
    3737        MPI_Bcast(&node_maxabsvy,1,MPI_DOUBLE,0,MPI_COMM_WORLD);   
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/MaxAbsVzx/MaxAbsVzx.cpp

    r5414 r12168  
    3131        }
    3232
    33         #ifdef _PARALLEL_
    3433        /*Figure out minimum across the cluster: */
     34        #ifdef _HAVE_MPI_
    3535        MPI_Reduce (&maxabsvz,&node_maxabsvz,1,MPI_DOUBLE,MPI_MAX,0,MPI_COMM_WORLD );
    3636        MPI_Bcast(&node_maxabsvz,1,MPI_DOUBLE,0,MPI_COMM_WORLD);   
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/MaxVelx/MaxVelx.cpp

    r5414 r12168  
    3232        }
    3333
    34         #ifdef _PARALLEL_
    3534        /*Figure out maximum across the cluster: */
     35        #ifdef _HAVE_MPI_
    3636        MPI_Reduce (&maxvel,&node_maxvel,1,MPI_DOUBLE,MPI_MAX,0,MPI_COMM_WORLD );
    3737        MPI_Bcast(&node_maxvel,1,MPI_DOUBLE,0,MPI_COMM_WORLD);   
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/MaxVxx/MaxVxx.cpp

    r5414 r12168  
    3131        }
    3232
    33         #ifdef _PARALLEL_
    3433        /*Figure out minimum across the cluster: */
     34        #ifdef _HAVE_MPI_
    3535        MPI_Reduce (&maxvx,&node_maxvx,1,MPI_DOUBLE,MPI_MAX,0,MPI_COMM_WORLD );
    3636        MPI_Bcast(&node_maxvx,1,MPI_DOUBLE,0,MPI_COMM_WORLD);   
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/MaxVyx/MaxVyx.cpp

    r5414 r12168  
    3131        }
    3232
    33         #ifdef _PARALLEL_
    3433        /*Figure out minimum across the cluster: */
     34        #ifdef _HAVE_MPI_
    3535        MPI_Reduce (&maxvy,&node_maxvy,1,MPI_DOUBLE,MPI_MAX,0,MPI_COMM_WORLD );
    3636        MPI_Bcast(&node_maxvy,1,MPI_DOUBLE,0,MPI_COMM_WORLD);   
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/MaxVzx/MaxVzx.cpp

    r5414 r12168  
    3232        }
    3333
    34         #ifdef _PARALLEL_
    3534        /*Figure out minimum across the cluster: */
     35        #ifdef _HAVE_MPI_
    3636        MPI_Reduce (&maxvz,&node_maxvz,1,MPI_DOUBLE,MPI_MAX,0,MPI_COMM_WORLD );
    3737        MPI_Bcast(&node_maxvz,1,MPI_DOUBLE,0,MPI_COMM_WORLD);   
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/MeshPartitionx/MeshPartitionx.cpp

    r10000 r12168  
    4242                /*Partition using Metis:*/
    4343                if (num_procs>1){
     44                        #ifdef _HAVE_METIS_
    4445                        METIS_PartMeshNodalPatch(&numberofelements,&numberofnodes, index, &etype, &numflag, &num_procs, &edgecut, epart, npart);
     46                        #endif
    4547                }
    4648                else if (num_procs==1){
     
    6769                /*Partition using Metis:*/
    6870                if (num_procs>1){
     71                        #ifdef _HAVE_METIS_
    6972                        METIS_PartMeshNodalPatch(&numberofelements2d,&numberofnodes2d, index2d, &etype2d, &numflag, &num_procs, &edgecut, epart2d, npart2d);
     73                        #endif
    7074                }
    7175                else if (num_procs==1){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/MeshProfileIntersectionx/SegmentIntersect.cpp

    r11112 r12168  
    66int SegmentIntersect(double* palpha, double* pbeta, double* x1, double* y1, double* x2, double* y2){
    77
    8         /*See ISSM_TIER/src/m/utils/Geometry/SegIntersect.m for matlab routine from which we take this routine: */
     8        /*See ISSM_DIR/src/m/utils/Geometry/SegIntersect.m for matlab routine from which we take this routine: */
    99
    1010        /*output: */
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/MinVelx/MinVelx.cpp

    r5414 r12168  
    3232        }
    3333
    34         #ifdef _PARALLEL_
    3534        /*Figure out minimum across the cluster: */
     35        #ifdef _HAVE_MPI_
    3636        MPI_Reduce (&minvel,&node_minvel,1,MPI_DOUBLE,MPI_MIN,0,MPI_COMM_WORLD );
    3737        MPI_Bcast(&node_minvel,1,MPI_DOUBLE,0,MPI_COMM_WORLD);   
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/MinVxx/MinVxx.cpp

    r5414 r12168  
    3131        }
    3232
    33         #ifdef _PARALLEL_
    3433        /*Figure out minimum across the cluster: */
     34        #ifdef _HAVE_MPI_
    3535        MPI_Reduce (&minvx,&node_minvx,1,MPI_DOUBLE,MPI_MIN,0,MPI_COMM_WORLD );
    3636        MPI_Bcast(&node_minvx,1,MPI_DOUBLE,0,MPI_COMM_WORLD);   
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/MinVyx/MinVyx.cpp

    r5414 r12168  
    3131        }
    3232
    33         #ifdef _PARALLEL_
    3433        /*Figure out minimum across the cluster: */
     34        #ifdef _HAVE_MPI_
    3535        MPI_Reduce (&minvy,&node_minvy,1,MPI_DOUBLE,MPI_MIN,0,MPI_COMM_WORLD );
    3636        MPI_Bcast(&node_minvy,1,MPI_DOUBLE,0,MPI_COMM_WORLD);   
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/MinVzx/MinVzx.cpp

    r5414 r12168  
    3131        }
    3232
    33         #ifdef _PARALLEL_
    3433        /*Figure out minimum across the cluster: */
     34        #ifdef _HAVE_MPI_
    3535        MPI_Reduce (&minvz,&node_minvz,1,MPI_DOUBLE,MPI_MIN,0,MPI_COMM_WORLD );
    3636        MPI_Bcast(&node_minvz,1,MPI_DOUBLE,0,MPI_COMM_WORLD);   
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp

    r9733 r12168  
    6363        else elements_width=6; //penta elements
    6464
    65         #ifdef _PARALLEL_
    6665        /*Determine parallel partitioning of elements: we use Metis for now. First load the data, then partition*/
    6766        if(dim==2){
     
    7978        xfree((void**)&elements);
    8079        xfree((void**)&elements2d);
    81 
    82         #else
    83         /*In serial mode, epart is full of 0: all elements belong to cpu 0: */
    84         epart=(int*)xcalloc(numberofelements,sizeof(int));
    85         #endif
    8680
    8781        /*Deal with rifts, they have to be included into one partition only, not several: */
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/NodalValuex/NodalValuex.cpp

    r9206 r12168  
    3636
    3737        /*Broadcast whether we found the element: */
     38        #ifdef _HAVE_MPI_
    3839        MPI_Allreduce ( &found,&sumfound,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
    3940        if(!sumfound)_error_("%s%i%s%s","could not find element with vertex with id",index," to compute nodal value ",EnumToStringx(natureofdataenum));
     41        #endif
    4042
    4143        /*Broadcast and plug into response: */
     44        #ifdef _HAVE_MPI_
    4245        MPI_Allreduce ( &cpu_found,&cpu_found,1,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
    4346        MPI_Bcast(&value,1,MPI_DOUBLE,cpu_found,MPI_COMM_WORLD);
     47        #else
     48        value=cpu_found;
     49        #endif
    4450
    4551        *pnodalvalue=value;
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/OutputResultsx/OutputResultsx.cpp

    r12004 r12168  
    1616#include "../../objects/objects.h"
    1717               
    18 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    19 void OutputResultsx(mxArray** pdataref, Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Results* results){
    20 #else
    2118void OutputResultsx(                    Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Results* results){
    22 #endif
    2319
    2420        extern int  my_rank;
     
    3127        bool        dakota_analysis         = false;
    3228       
    33         #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    34         const char **fnames      = NULL;
    35         mwSize       onebyone[2] = {0,0};
    36         mwSize       ndim        = 2;
    37         int          nfields=0;
    38         #endif
    39 
    4029        /*retrieve parameters: */
    4130        parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);
     
    4332        if(dakota_analysis){
    4433                //no need to output anything, Dakota analysis has different outputs
    45                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    46                 *pdataref=mxCreateStructArray( ndim,onebyone,nfields,fnames);
    47                 #endif
    4834                return;
    4935        }
     
    5642        /*Results do not include the type of solution being run . In parallel, we output results to a filename,
    5743         *therefore, we need to include the solutiontype into the filename: */
    58         #ifdef _PARALLEL_
    5944        if(my_rank==0){
    6045                parameters->FindParam(&solutiontype,SolutionTypeEnum);
     
    8873                parameters->SetParam(fid,OutputFilePointerEnum);
    8974        }
    90         #endif
    9175
    92         /*Write results to disk (in parallel), or to memory (in serial mode): */
    93         #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    94                 results->Write(pdataref);
    95         #else
    96                 results->Write(parameters);
    97         #endif
     76        /*Write results to disk: */
     77        results->Write(parameters);
    9878
    9979        /*Delete and reinitialize results, in parallel: */
    100         #ifdef _PARALLEL_
    101                 results->clear();
     80        results->clear();
    10281
    103                 /*Close output file? :*/
    104                 /*WARNING: issm.cpp is taking care of it for now (quick fix)
    105                 if((step==1) && (time==0)){
    106                         if(io_gather){
    107                                 if(my_rank==0) pfclose(fid,outputfilename);
    108                         }
    109                         else pfclose(fid,cpu_outputfilename);
    110                 }
    111                 */
    112         #endif
     82        /*Close output file? :*/
     83        /*WARNING: issm.cpp is taking care of it for now (quick fix)
     84          if((step==1) && (time==0)){
     85          if(io_gather){
     86          if(my_rank==0) pfclose(fid,outputfilename);
     87          }
     88          else pfclose(fid,cpu_outputfilename);
     89          }
     90        */
    11391}
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/OutputResultsx/OutputResultsx.h

    r12004 r12168  
    1414#include "../../Container/Container.h"
    1515
    16 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    17 #include <mex.h>
    18 void OutputResultsx(mxArray** pdataref, Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads,  Materials* materials, Parameters* parameters, Results* results);
    19 #else
    2016void OutputResultsx(Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads,  Materials* materials, Parameters* parameters, Results* results);
    21 #endif
    2217
    2318#endif  /* _OUTPUTRESULTS_H */
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp

    r12004 r12168  
    9292        }
    9393
    94         #ifdef _PARALLEL_
    9594        /*Ok, broadcast to other cpus: */
     95        #ifdef _HAVE_MPI_
    9696        MPI_Bcast(&numanalyses,1,MPI_INT,0,MPI_COMM_WORLD);
    9797        if(my_rank!=0){
     
    100100        }
    101101        MPI_Bcast(analyses,numanalyses,MPI_DOUBLE,0,MPI_COMM_WORLD);
     102        #endif
    102103        for(i=0;i<numanalyses;i++){
    103104                char* string=strings[i];
     
    106107                }
    107108                if(my_rank==0)stringlength=(strlen(string)+1)*sizeof(char);
     109                #ifdef _HAVE_MPI_
    108110                MPI_Bcast(&stringlength,1,MPI_INT,0,MPI_COMM_WORLD);
    109111                if(my_rank!=0)string=(char*)xmalloc(stringlength);
    110112                MPI_Bcast(string,stringlength,MPI_CHAR,0,MPI_COMM_WORLD);
    111113                if(my_rank!=0)strings[i]=string;
     114                #endif
    112115        }
    113         #endif
    114116
    115117        /*Ok, out of strings and analyses and numanalyses, create parameters, and plug them into parameters container: */
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp

    r11577 r12168  
    1111
    1212void PositiveDegreeDayx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters){
    13        
    14         Element* element = NULL;
    1513
    16         for(int i=0;i<elements->Size();i++){
    17                 element=(Element*)elements->GetObjectByOffset(i);
    18                 element->PositiveDegreeDay();
    19         }
     14// void PositiveDegreeDayx(hd,vTempsea,vPrec,agd,Tsurf,ni){
     15//    note "v" prefix means 12 monthly means, ie time dimension
     16//    INPUT parameters: ni: working size of arrays
     17//    INPUT: surface elevation (m): hd(NA)
     18//    monthly mean surface sealevel temperature (degrees C): vTempsea(NA
     19//    ,NTIME)
     20//    monthly mean precip rate (m/yr water equivalent): vPrec(NA,NTIME)
     21//    OUTPUT: mass-balance (m/yr ice): agd(NA)
     22//    mean annual surface temperature (degrees C): Tsurf(NA)
    2023
     24  int    i, it, jj, itm;
     25  double DT = 0.02, sigfac, snormfac;
     26  double signorm = 5.5;      // signorm : sigma of the temperature distribution for a normal day
     27  double siglim;       // sigma limit for the integration which is equal to 2.5 sigmanorm
     28  double signormc;     // sigma of the temperature distribution for cloudy day
     29  double siglimc=0, siglim0, siglim0c;
     30  double tstep, tsint, tint, tstepc;
     31  int    NPDMAX = 1504, NPDCMAX = 1454;
     32  //double pdds[NPDMAX]={0};
     33  //double pds[NPDCMAX]={0};
     34  double pddt, pd ; // pd : snow/precip fraction, precipitation falling as snow
     35  double PDup, PDCUT = 2.0;    // PDcut: rain/snow cutoff temperature (C)
     36  double tstar; // monthly mean surface temp
     37 
     38  double* pdds=NULL;
     39  double* pds=NULL;
     40  Element* element = NULL;
     41 
     42  pdds=(double*)xmalloc(NPDMAX*sizeof(double)+1);
     43  pds=(double*)xmalloc(NPDCMAX*sizeof(double)+1);
     44 
     45 
     46  // PDD constant
     47  siglim = 2.5*signorm;
     48 
     49  // initialize PDD (creation of a lookup table)
     50  tstep = 0.1;
     51  tsint = tstep*0.5;
     52  sigfac = -1.0/(2.0*pow(signorm,2));
     53  snormfac = 1.0/(signorm*sqrt(2.0*acos(-1.0)));
     54  siglim = 2.5*signorm;
     55  itm = (int)(2*siglim/DT + 1.5);
     56 
     57  if (itm >= NPDMAX){
     58    printf("increase NPDMAX in massBalance.cpp\n");
     59    exit (1);
     60      }
     61  for (it = 0; it < itm; it++){ 
     62    //    tstar = REAL(it)*DT-siglim;
     63    tstar = it*DT-siglim;
     64    tint = tsint;
     65    pddt = 0;
     66    for ( jj = 0; jj < 600; jj++){
     67      if (tint > (tstar+siglim)){break;}
     68      pddt = pddt + tint*exp(sigfac*(pow((tint-tstar),2)))*tstep;
     69      tint = tint+tstep;
     70    }
     71    pdds[it] = pddt*snormfac;
     72  }
     73  pdds[itm+1] = siglim + DT;
     74 
     75  //*********compute PD(T) : snow/precip fraction. precipitation falling as snow
     76  tstepc = 0.1;
     77  tsint = PDCUT-tstepc*0.5;
     78  signormc = signorm - 0.5;
     79  sigfac = -1.0/(2.0*pow(signormc,2));
     80  snormfac = 1.0/(signormc*sqrt(2.0*acos(-1.0)));
     81  siglimc = 2.5*signormc ;
     82  itm = (int)((PDCUT+2.*siglimc)/DT + 1.5);
     83  if (itm >= NPDCMAX){
     84    printf("'increase NPDCMAX in p35com'\n");
     85    exit (1);
     86      }
     87  for (it = 0; it < itm; it++ ){
     88    tstar = it*DT-siglimc;
     89    //    tstar = REAL(it)*DT-siglimc;
     90    tint = tsint;          // start against upper bound
     91    pd = 0;
     92    for (jj = 0; jj < 600; jj++){
     93      if (tint<(tstar-siglimc)) {break;}
     94      pd = pd + exp(sigfac*(pow((tint-tstar),2)))*tstepc;
     95      tint = tint-tstepc;
     96    }
     97    pds[it] = pd*snormfac;  // gaussian integral lookup table for snow fraction
     98  }
     99  pds[itm+1] = 0;
     100  //     *******END initialize PDD
     101 
     102  for(i=0;i<elements->Size();i++){
     103    element=(Element*)elements->GetObjectByOffset(i);
     104    element->PositiveDegreeDay(pdds,pds,signorm);
     105  }
     106  /*free ressouces: */
     107  xfree((void**)&pdds);
     108  xfree((void**)&pds);
     109 
    21110}
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp

    r8608 r12168  
    2727
    2828        /*Sum all J from all cpus of the cluster:*/
     29        #ifdef _HAVE_MPI_
    2930        MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
    3031        MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
    3132        J=J_sum;
     33        #endif
    3234
    3335        /*Assign output pointers: */
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/Solverx/Solverx.cpp

    r12004 r12168  
    3434
    3535                /*In serial mode, the Petsc Options database has not been initialized properly: */
    36                 #ifdef _SERIAL_
    37                 parameters->FindParam(&analysis_type,AnalysisTypeEnum);
    38                 PetscOptionsFromAnalysis(parameters,analysis_type);
    39                 #endif
    4036
    4137                SolverxPetsc(&uf_vector,Kff->matrix,pf->vector,uf0_vector,df_vector,parameters);
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/Solverx/SolverxPetsc.cpp

    r11684 r12168  
    4343        #endif
    4444
    45 
    4645        /*Display message*/
    4746        _printf_(VerboseModule(),"   Solving\n");
     
    5251        #endif
    5352
    54         /*First, check that f-set is not NULL, i.e. model is fully constrained: {{{*/
     53        /*First, check that f-set is not NULL, i.e. model is fully constrained:*/
    5554        _assert_(Kff);
    5655        MatGetSize(Kff,&global_m,&global_n); _assert_(global_m==global_m);
     
    5857                *puf=NULL; return;
    5958        }
    60         /*}}}*/
    61         /*Initial guess logic here: {{{1*/
     59
     60        /*Initial guess */
    6261        /*Now, check that we are not giving an initial guess to the solver, if we are running a direct solver: */
    6362        #if _PETSC_MAJOR_ >= 3
     
    7473                MatGetLocalSize(Kff,&local_m,&local_n);uf=NewVec(local_n,fromlocalsize);
    7574        }
    76         /*}}}*/
    77         /*Process petsc options to see if we are using special types of external solvers: {{{1*/
     75
     76        /*Process petsc options to see if we are using special types of external solvers*/
    7877        PetscOptionsDetermineSolverType(&solver_type);
    7978
    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);
     79        /*Check the solver is available*/
     80        if(solver_type==MUMPSPACKAGE_LU || solver_type==MUMPSPACKAGE_CHOL){
     81                #if _PETSC_MAJOR_ >=3
     82                        #ifndef _HAVE_MUMPS_
     83                        _error_("requested MUMPS solver, which was not compiled into ISSM!\n");
     84                        #endif
     85                #endif
    8786        }
    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
    11687
    117         #endif
    118         }
    119         /*}}}*/
    120         /*Prepare solver:{{{1*/
     88        /*Prepare solver*/
    12189        KSPCreate(MPI_COMM_WORLD,&ksp);
    12290        KSPSetOperators(ksp,Kff,Kff,DIFFERENT_NONZERO_PATTERN);
    12391        KSPSetFromOptions(ksp);
    12492
    125         #if defined(_SERIAL_) && _PETSC_MAJOR_==3
     93        #if _PETSC_MAJOR_==3
    12694        /*Specific solver?: */
    12795        KSPGetPC(ksp,&pc);
     
    133101                #endif
    134102        }
    135         #endif
    136103
    137         #if defined(_PARALLEL_) && _PETSC_MAJOR_==3
    138104        /*Stokes: */
    139105        if (solver_type==StokesSolverEnum){
     
    155121        #endif
    156122
    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*/
     123        /*If there is an initial guess for the solution, use it
     124         * except if we are using the MUMPS direct solver
     125         * where any initial guess will crash Petsc*/
    159126        if (uf0){
    160                 if( (solver_type!=MUMPSPACKAGE_LU) && (solver_type!=MUMPSPACKAGE_CHOL) && (solver_type!=SPOOLESPACKAGE_LU) && (solver_type!=SPOOLESPACKAGE_CHOL) && (solver_type!=SUPERLUDISTPACKAGE)){
     127                if((solver_type!=MUMPSPACKAGE_LU) && (solver_type!=MUMPSPACKAGE_CHOL) && (solver_type!=SPOOLESPACKAGE_LU) && (solver_type!=SPOOLESPACKAGE_CHOL) && (solver_type!=SUPERLUDISTPACKAGE)){
    161128                        KSPSetInitialGuessNonzero(ksp,PETSC_TRUE);
    162129                }
    163130        }
    164         /*}}}*/
    165        
    166         if(VerboseSolver())KSPView(ksp,PETSC_VIEWER_STDOUT_WORLD);
    167131
    168132        /*Solve: */
     133        if(VerboseSolver())KSPView(ksp,PETSC_VIEWER_STDOUT_WORLD);
    169134        KSPSolve(ksp,pf,uf);
    170135       
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp

    r8607 r12168  
    2727
    2828        /*Sum all J from all cpus of the cluster:*/
     29        #ifdef _HAVE_MPI_
    2930        MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
    3031        MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
    3132        J=J_sum;
     33        #endif
    3234
    3335        /*Assign output pointers: */
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/SurfaceAreax/SurfaceAreax.cpp

    r5414 r12168  
    2828
    2929        /*Sum all J from all cpus of the cluster:*/
    30         MPI_Reduce (&S,&S_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
     30        #ifdef _HAVE_MPI_
     31        MPI_Reduce (&S,&S_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
    3132        MPI_Bcast(&S_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
    3233        S=S_sum;
     34        #endif
    3335
    3436        /*add surface area to element inputs:*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp

    r8607 r12168  
    3131
    3232        /*Sum all J from all cpus of the cluster:*/
     33        #ifdef _HAVE_MPI_
    3334        MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
    3435        MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
    3536        J=J_sum;
     37        #endif
    3638
    3739        /*Assign output pointers: */
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp

    r8607 r12168  
    2727
    2828        /*Sum all J from all cpus of the cluster:*/
     29        #ifdef _HAVE_MPI_
    2930        MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
    3031        MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
    3132        J=J_sum;
     33        #endif
    3234
    3335        /*Assign output pointers: */
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp

    r8607 r12168  
    2727
    2828        /*Sum all J from all cpus of the cluster:*/
     29        #ifdef _HAVE_MPI_
    2930        MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
    3031        MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
    3132        J=J_sum;
     33        #endif
    3234
    3335        /*Assign output pointers: */
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp

    r8607 r12168  
    2727
    2828        /*Sum all J from all cpus of the cluster:*/
     29        #ifdef _HAVE_MPI_
    2930        MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
    3031        MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
    3132        J=J_sum;
     33        #endif
    3234
    3335        /*Assign output pointers: */
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.cpp

    r8608 r12168  
    2727
    2828        /*Sum all J from all cpus of the cluster:*/
     29        #ifdef _HAVE_MPI_
    2930        MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
    3031        MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
    3132        J=J_sum;
     33        #endif
    3234
    3335        /*Assign output pointers: */
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.cpp

    r8607 r12168  
    2727
    2828        /*Sum all J from all cpus of the cluster:*/
     29        #ifdef _HAVE_MPI_
    2930        MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
    3031        MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
    3132        J=J_sum;
     33        #endif
    3234
    3335        /*Assign output pointers: */
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/TimeAdaptx/TimeAdaptx.cpp

    r6130 r12168  
    3131        }
    3232
    33         #ifdef _PARALLEL_
    3433        /*Figure out minimum across the cluster: */
     34        #ifdef _HAVE_MPI_
    3535        MPI_Reduce (&min_dt,&node_min_dt,1,MPI_DOUBLE,MPI_MIN,0,MPI_COMM_WORLD );
    3636        MPI_Bcast(&node_min_dt,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/TriMeshx/TriMeshx.cpp

    r11944 r12168  
    1010#include "../../toolkits/toolkits.h"
    1111#include "../../EnumDefinitions/EnumDefinitions.h"
     12/*ANSI_DECLARATORS needed to call triangle library: */
     13#ifndef ANSI_DECLARATORS
     14#define ANSI_DECLARATORS
     15#include "triangle.h"
     16#undef ANSI_DECLARATORS
     17#else
     18#include "triangle.h"
     19#endif
    1220/*}}}*/
    1321
    14 
    15 void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,double area,bool order){
     22void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){
    1623
    1724        /*indexing: */
     
    2835
    2936        /*intermediary: */
    30         int      counter,backcounter;
     37        int      counter,counter2,backcounter;
    3138        Contour* contour=NULL;
    3239
     
    3946        for (i=0;i<domain->Size();i++){
    4047                contour=(Contour*)domain->GetObjectByOffset(i);
     48                in.numberofpoints+=contour->nods-1;
     49        }
     50        for (i=0;i<rifts->Size();i++){
     51                contour=(Contour*)rifts->GetObjectByOffset(i);
    4152                in.numberofpoints+=contour->nods;
    4253        }
     54
    4355        /*number of point attributes: */
    4456        in.numberofpointattributes=1;
     
    5062        for (i=0;i<domain->Size();i++){
    5163                contour=(Contour*)domain->GetObjectByOffset(i);
     64                for (j=0;j<contour->nods-1;j++){
     65                        in.pointlist[2*counter+0]=contour->x[j];
     66                        in.pointlist[2*counter+1]=contour->y[j];
     67                        counter++;
     68                }
     69        }
     70        for (i=0;i<rifts->Size();i++){
     71                contour=(Contour*)rifts->GetObjectByOffset(i);
    5272                for (j=0;j<contour->nods;j++){
    5373                        in.pointlist[2*counter+0]=contour->x[j];
     
    5878       
    5979        /*fill in the point attribute list: */
    60         in.pointattributelist = (REAL *) xmalloc(in.numberofpoints * in.numberofpointattributes * sizeof(REAL));
     80        in.pointattributelist = (REAL*)xmalloc(in.numberofpoints*in.numberofpointattributes*sizeof(REAL));
    6181        for (i=0;i<in.numberofpoints;i++) in.pointattributelist[i] = 0.0;
    6282       
     
    6585        for(i=0;i<in.numberofpoints;i++) in.pointmarkerlist[i] = 0;
    6686
    67 
    6887        /*Build segments. First figure out number of segments: holes and closed outlines have as many segments as vertices: */
    6988        in.numberofsegments=0;
    7089        for (i=0;i<domain->Size();i++){
    7190                contour=(Contour*)domain->GetObjectByOffset(i);
    72                 in.numberofsegments+=contour->nods;
     91                in.numberofsegments+=contour->nods-1;
     92        }
     93        for(i=0;i<rifts->Size();i++){
     94                contour=(Contour*)rifts->GetObjectByOffset(i);
     95                /*for rifts, we have one less segment as we have vertices*/
     96                in.numberofsegments+=contour->nods-1;
    7397        }
    7498       
     
    79103        for (i=0;i<domain->Size();i++){
    80104                contour=(Contour*)domain->GetObjectByOffset(i);
    81                 for (j=0;j<contour->nods-1;j++){
     105                for (j=0;j<contour->nods-2;j++){
    82106                        in.segmentlist[2*counter+0]=counter;
    83107                        in.segmentlist[2*counter+1]=counter+1;
     
    92116                 backcounter=counter;
    93117        }
    94 
     118        counter2=counter;
     119        for (i=0;i<rifts->Size();i++){
     120                contour=(Contour*)rifts->GetObjectByOffset(i);
     121                for (j=0;j<(contour->nods-1);j++){
     122                        in.segmentlist[2*counter2+0]=counter;
     123                        in.segmentlist[2*counter2+1]=counter+1;
     124                        in.segmentmarkerlist[counter2]=2+i;
     125                        counter2++;
     126                        counter++;
     127                }
     128                counter++;
     129        }
    95130       
    96131        /*Build regions: */
     
    103138                for (i=0;i<domain->Size()-1;i++){
    104139                        contour=(Contour*)domain->GetObjectByOffset(i+1);
    105                         GridInsideHole(&in.holelist[2*i+0],&in.holelist[2*i+1],contour->nods,contour->x,contour->y);
     140                        GridInsideHole(&in.holelist[2*i+0],&in.holelist[2*i+1],contour->nods-1,contour->x,contour->y);
    106141                }
    107142        }
    108143
    109144        /* Make necessary initializations so that Triangle can return a triangulation in `out': */
    110 
    111         out.pointlist = (REAL *) NULL;           
    112         out.pointattributelist = (REAL *) NULL;
    113         out.pointmarkerlist = (int *) NULL;
    114         out.trianglelist = (int *) NULL;         
    115         out.triangleattributelist = (REAL *) NULL;
    116         out.neighborlist = (int *) NULL;         
    117         out.segmentlist = (int *) NULL;
    118         out.segmentmarkerlist = (int *) NULL;
    119         out.edgelist = (int *) NULL;             
    120         out.edgemarkerlist = (int *) NULL;   
     145        out.pointlist             = (REAL*)NULL;
     146        out.pointattributelist    = (REAL*)NULL;
     147        out.pointmarkerlist       = (int *)NULL;
     148        out.trianglelist          = (int *)NULL;
     149        out.triangleattributelist = (REAL*)NULL;
     150        out.neighborlist          = (int *)NULL;
     151        out.segmentlist           = (int *)NULL;
     152        out.segmentmarkerlist     = (int *)NULL;
     153        out.edgelist              = (int *)NULL;
     154        out.edgemarkerlist        = (int *)NULL;
    121155
    122156        /* Triangulate the points:.  Switches are chosen to read and write a  */
     
    125159        /*   produce an edge list (e), a Voronoi diagram (v), and a triangle */
    126160        /*   neighbor list (n).                                              */
    127 
    128161        sprintf(options,"%s%lf","pQzDq30ia",area); /*replace V by Q to quiet down the logging*/
    129 
    130  
    131162        triangulate(options, &in, &out, NULL);
    132 
    133163        /*report(&out, 0, 1, 1, 1, 1, 0);*/
    134 
    135164
    136165        /*Allocate index, x and y: */
     
    141170        segmentmarkerlist=(double*)xmalloc(out.numberofsegments*sizeof(double));
    142171
    143         for (i = 0; i < out.numberoftriangles; i++) {
     172        for (i = 0; i< out.numberoftriangles; i++) {
    144173                for (j = 0; j < out.numberofcorners; j++) {
    145                         *(index+3*i+j)=(double)out.trianglelist[i * out.numberofcorners + j]+1;
    146                 }
    147         }
    148         for (i = 0; i < out.numberofpoints; i++) {
    149                 x[i]=out.pointlist[i * 2 + 0];
    150                 y[i]=out.pointlist[i * 2 + 1];
    151         }
    152        
    153         for (i = 0; i < out.numberofsegments; i++) {
     174                        index[3*i+j]=(double)out.trianglelist[i*out.numberofcorners+j]+1;
     175                }
     176        }
     177        for (i = 0; i< out.numberofpoints; i++){
     178                x[i]=out.pointlist[i*2+0];
     179                y[i]=out.pointlist[i*2+1];
     180        }
     181        for (i = 0; i<out.numberofsegments;i++){
    154182                segments[3*i+0]=(double)out.segmentlist[i*2+0]+1;
    155183                segments[3*i+1]=(double)out.segmentlist[i*2+1]+1;
     
    157185        }
    158186
    159 
    160 
    161187        /*Associate elements with segments: */
    162188        AssociateSegmentToElement(&segments,out.numberofsegments,index,out.numberoftriangles);
    163189
    164190        /*Order segments so that their normals point outside the domain: */
    165         if(order){
    166                 OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles);
    167         }
    168 
     191        OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles);
    169192
    170193        /*Output : */
     
    179202        *py=new Vector(y,out.numberofpoints);
    180203        *psegmentmarkerlist=new Vector(segmentmarkerlist,out.numberofsegments);
    181 
    182204}
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/TriMeshx/TriMeshx.h

    r11880 r12168  
    66#define _TRIMESHX_H_
    77
    8 
    9 
    10 /*ANSI_DECLARATORS needed to call triangle library: */
    11 #ifndef ANSI_DECLARATORS
    12 #define ANSI_DECLARATORS
    13 #include "triangle.h"
    14 #undef ANSI_DECLARATORS
    15 #else
    16 #include "triangle.h"
    17 #endif
    18 
    198#include "string.h"
    20 
    219#include "../../Container/Container.h"
    2210#include "../../objects/objects.h"
    2311
    2412/* local prototypes: */
    25 void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,double area,bool order);
     13void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area);
    2614
    2715#endif  /* _TRIMESHX_H */
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/modules.h

    r12004 r12168  
    6262#include "./Exp2Kmlx/Exp2Kmlx.h"
    6363#include "./Kml2Expx/Kml2Expx.h"
     64#include "./Krigingx/Krigingx.h"
    6465#include "./Shp2Kmlx/Shp2Kmlx.h"
    6566#include "./MassFluxx/MassFluxx.h"
     
    111112#include "./TimeAdaptx/TimeAdaptx.h"
    112113#include "./TriaSearchx/TriaSearchx.h"
    113 #ifdef _SERIAL_
    114114#include "./TriMeshx/TriMeshx.h"
    115 #endif
    116115#include "./ThicknessAbsMisfitx/ThicknessAbsMisfitx.h"
    117116#include "./ThicknessAbsGradientx/ThicknessAbsGradientx.h"
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Bamg/BamgGeom.cpp

    r12004 r12168  
    1919}
    2020/*}}}*/
    21 /*FUNCTION BamgGeom::BamgGeom(mxArray* matlab_struct){{{1*/
    22 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    23 BamgGeom::BamgGeom(mxArray* matlab_struct){
    24 
    25         FetchData(&this->Vertices,        &this->VerticesSize[0],        &this->VerticesSize[1],        mxGetAssignedField(matlab_struct,0,"Vertices"));
    26         FetchData(&this->Edges,           &this->EdgesSize[0],           &this->EdgesSize[1],           mxGetAssignedField(matlab_struct,0,"Edges"));
    27         this->TangentAtEdgesSize[0]=0,    this->TangentAtEdgesSize[1]=0;    this->TangentAtEdges=NULL;
    28         FetchData(&this->Corners,         &this->CornersSize[0],         &this->CornersSize[1],         mxGetAssignedField(matlab_struct,0,"Corners"));
    29         FetchData(&this->RequiredVertices,&this->RequiredVerticesSize[0],&this->RequiredVerticesSize[1],mxGetAssignedField(matlab_struct,0,"RequiredVertices"));
    30         FetchData(&this->RequiredEdges,   &this->RequiredEdgesSize[0],   &this->RequiredEdgesSize[1],   mxGetAssignedField(matlab_struct,0,"RequiredEdges"));
    31         FetchData(&this->CrackedEdges,    &this->CrackedEdgesSize[0],    &this->CrackedEdgesSize[1],    mxGetAssignedField(matlab_struct,0,"CrackedEdges"));
    32         FetchData(&this->SubDomains,      &this->SubDomainsSize[0],      &this->SubDomainsSize[1],      mxGetAssignedField(matlab_struct,0,"SubDomains"));
    33 
    34 }
    35 #endif
    36 /*}}}*/
    3721/*FUNCTION BamgGeom::~BamgGeom(){{{1*/
    3822BamgGeom::~BamgGeom(){
     
    4933}
    5034/*}}}*/
    51 
    52 /*Methods*/
    53 /*FUNCTION BamgGeom::SetMatlabStructureFields{{{1*/
    54 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    55 void BamgGeom::SetMatlabStructureFields(mxArray** matlab_struct){
    56 
    57         /*Intermediary*/
    58         int         i;
    59         mxArray*    output=NULL;
    60         const int         numfields=7;
    61         const char* fnames[numfields];
    62         mwSize      ndim=2;
    63         mwSize      dimensions[2]={1,1};
    64 
    65         /*Initialize field names*/
    66         i=0;
    67         fnames[i++] = "Vertices";
    68         fnames[i++] = "Edges";
    69         fnames[i++] = "TangentAtEdges";
    70         fnames[i++] = "RequiredVertices";
    71         fnames[i++] = "RequiredEdges";
    72         fnames[i++] = "CrackedEdges";
    73         fnames[i++] = "SubDomains";
    74         _assert_(i==numfields);
    75 
    76         /*Initialize Matlab structure*/
    77         output=mxCreateStructArray(ndim,dimensions,numfields,fnames);
    78 
    79         /*set each matlab each field*/
    80         i=0;
    81         i++; SetMatlabStructureField(output,"Vertices",        this->VerticesSize[0],        this->VerticesSize[1],        this->Vertices);
    82         i++; SetMatlabStructureField(output,"Edges",           this->EdgesSize[0],           this->EdgesSize[1],           this->Edges);
    83         i++; SetMatlabStructureField(output,"TangentAtEdges",  this->TangentAtEdgesSize[0],  this->TangentAtEdgesSize[1],  this->TangentAtEdges);
    84         i++; SetMatlabStructureField(output,"RequiredVertices",this->RequiredVerticesSize[0],this->RequiredVerticesSize[1],this->RequiredVertices);
    85         i++; SetMatlabStructureField(output,"RequiredEdges",   this->RequiredEdgesSize[0],   this->RequiredEdgesSize[1],   this->RequiredEdges);
    86         i++; SetMatlabStructureField(output,"CrackedEdges",    this->CrackedEdgesSize[0],    this->CrackedEdgesSize[1],    this->CrackedEdges);
    87         i++; SetMatlabStructureField(output,"SubDomains",      this->SubDomainsSize[0],      this->SubDomainsSize[1],      this->SubDomains);
    88         _assert_(i==numfields);
    89 
    90         /*Assign output*/
    91         *matlab_struct=output;
    92 
    93 }
    94 #endif
    95 /*}}}*/
    96 /*FUNCTION BamgGeom::SetMatlabStructureField{{{1*/
    97 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    98 void BamgGeom::SetMatlabStructureField(mxArray* matlab_struct,const char* fieldname,int fieldrows,int fieldcols,double* fieldpointer){
    99 
    100         /*Intermediary*/
    101         int         i1,i2;
    102         mxArray*    pfield=NULL;
    103         mxArray*    pfield2=NULL;
    104 
    105         /*Copy field*/
    106         double*  fieldcopy=NULL;
    107         if (fieldrows*fieldcols){
    108                 fieldcopy=(double*)xmalloc(fieldrows*fieldcols*sizeof(double));
    109                 for(i1=0;i1<fieldrows;i1++){
    110                         for(i2=0;i2<fieldcols;i2++){
    111                                 fieldcopy[fieldcols*i1+i2]=fieldpointer[fieldcols*i1+i2];
    112                         }
    113                 }
    114         }
    115 
    116         /*Set matlab field*/
    117         pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    118         mxSetM(pfield,fieldcols);
    119         mxSetN(pfield,fieldrows);
    120         mxSetPr(pfield,fieldcopy);
    121         mexCallMATLAB(1,&pfield2,1,&pfield,"transpose");//transpose
    122         mxSetField(matlab_struct,0,fieldname,pfield2);
    123 }
    124 #endif
    125 /*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Bamg/BamgGeom.h

    r12004 r12168  
    44#ifndef _BAMGGEOM_H_
    55#define _BAMGGEOM_H_
    6 
    7 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    8 #include <mex.h>
    9 #endif
    106
    117class BamgGeom{
     
    3026
    3127                BamgGeom();
    32                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    33                 BamgGeom(mxArray* matlab_struct);
    34                 #endif
    3528                ~BamgGeom();
    36 
    37                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    38                 void SetMatlabStructureFields(mxArray** matlab_struct);
    39                 void SetMatlabStructureField(mxArray* matlab_struct,const char* fieldname,int fieldrows,int fieldcols,double* fieldpointer);
    40                 #endif
    4129};
    4230
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Bamg/BamgMesh.cpp

    r12004 r12168  
    1818        this->CrackedEdgesSize[0]=0,              this->CrackedEdgesSize[1]=0;             this->CrackedEdges=NULL;
    1919
    20         this->VerticesOnGeomVertexSize[0]=0, this->VerticesOnGeomVertexSize[1]=0;this->VerticesOnGeomVertex=NULL;
    21         this->VerticesOnGeomEdgeSize[0]=0,   this->VerticesOnGeomEdgeSize[1]=0;  this->VerticesOnGeomEdge=NULL;
    22         this->EdgesOnGeomEdgeSize[0]=0,      this->EdgesOnGeomEdgeSize[1]=0;     this->EdgesOnGeomEdge=NULL;
     20        this->VerticesOnGeomVertexSize[0]=0,      this->VerticesOnGeomVertexSize[1]=0;     this->VerticesOnGeomVertex=NULL;
     21        this->VerticesOnGeomEdgeSize[0]=0,        this->VerticesOnGeomEdgeSize[1]=0;       this->VerticesOnGeomEdge=NULL;
     22        this->EdgesOnGeomEdgeSize[0]=0,           this->EdgesOnGeomEdgeSize[1]=0;          this->EdgesOnGeomEdge=NULL;
    2323
    2424        this->IssmEdgesSize[0]=0,                 this->IssmEdgesSize[1]=0;                this->IssmEdges=NULL;
     
    2828        this->NodalConnectivitySize[0]=0,         this->NodalConnectivitySize[1]=0;        this->NodalConnectivity=NULL;
    2929        this->NodalElementConnectivitySize[0]=0,  this->NodalElementConnectivitySize[1]=0; this->NodalElementConnectivity=NULL;
    30 
    31 
    3230}
    33 /*}}}*/
    34 /*FUNCTION BamgMesh::BamgMesh(mxArray* matlab_struct){{{1*/
    35 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    36 BamgMesh::BamgMesh(mxArray* matlab_struct){
    37 
    38         int lines,cols;
    39 
    40         FetchData(&this->Vertices,            &this->VerticesSize[0],            &this->VerticesSize[1],            mxGetAssignedField(matlab_struct,0,"Vertices"));
    41         FetchData(&this->Edges,               &this->EdgesSize[0],               &this->EdgesSize[1],               mxGetAssignedField(matlab_struct,0,"Edges"));
    42         FetchData(&this->Triangles,           &this->TrianglesSize[0],           &this->TrianglesSize[1],           mxGetAssignedField(matlab_struct,0,"Triangles"));
    43         this->QuadrilateralsSize[0]=0,        this->QuadrilateralsSize[1]=0;     this->Quadrilaterals=NULL;
    44 
    45         this->SubDomainsSize[0]=0,            this->SubDomainsSize[1]=0;         this->SubDomains=NULL;
    46         this->SubDomainsFromGeomSize[0]=0,    this->SubDomainsFromGeomSize[1]=0; this->SubDomainsFromGeom=NULL;
    47         this->CrackedVerticesSize[0]=0,       this->CrackedVerticesSize[1]=0;    this->CrackedVertices=NULL;
    48         FetchData(&this->CrackedEdges,        &this->CrackedEdgesSize[0],        &this->CrackedEdgesSize[1],        mxGetAssignedField(matlab_struct,0,"CrackedEdges"));
    49 
    50         FetchData(&this->VerticesOnGeomEdge,  &this->VerticesOnGeomEdgeSize[0],  &this->VerticesOnGeomEdgeSize[1],  mxGetAssignedField(matlab_struct,0,"VerticesOnGeomEdge"));
    51         FetchData(&this->VerticesOnGeomVertex,&this->VerticesOnGeomVertexSize[0],&this->VerticesOnGeomVertexSize[1],mxGetAssignedField(matlab_struct,0,"VerticesOnGeomVertex"));
    52         FetchData(&this->EdgesOnGeomEdge,     &this->EdgesOnGeomEdgeSize[0],     &this->EdgesOnGeomEdgeSize[1],     mxGetAssignedField(matlab_struct,0,"EdgesOnGeomEdge"));
    53 
    54         this->IssmEdgesSize[0]=0,             this->IssmEdgesSize[1]=0;          this->IssmEdges=NULL;
    55         FetchData(&this->IssmSegments,        &this->IssmSegmentsSize[0],        &this->IssmSegmentsSize[1],        mxGetAssignedField(matlab_struct,0,"IssmSegments"));
    56 
    57         this->ElementConnectivitySize[0]=0,      this->ElementConnectivitySize[1]=0;      this->ElementConnectivity=NULL;
    58         this->NodalConnectivitySize[0]=0,        this->NodalConnectivitySize[1]=0;        this->NodalConnectivity=NULL;
    59         this->NodalElementConnectivitySize[0]=0, this->NodalElementConnectivitySize[1]=0; this->NodalElementConnectivity=NULL;
    60 
    61 }
    62 #endif
    6331/*}}}*/
    6432/*FUNCTION BamgMesh::~BamgMesh(){{{1*/
     
    8957}
    9058/*}}}*/
    91 
    92 /*Methods*/
    93 /*FUNCTION BamgMesh::SetMatlabStructureFields{{{1*/
    94 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    95 void BamgMesh::SetMatlabStructureFields(mxArray** matlab_struct){
    96 
    97         /*Intermediary*/
    98         int         i;
    99         mxArray*    output=NULL;
    100         const int         numfields=16;
    101         const char* fnames[numfields];
    102         mwSize      ndim=2;
    103         mwSize      dimensions[2]={1,1};
    104 
    105         /*Initialize field names*/
    106         i=0;
    107         fnames[i++] = "Triangles";
    108         fnames[i++] = "Vertices";
    109         fnames[i++] = "Edges";
    110         fnames[i++] = "IssmSegments";
    111         fnames[i++] = "IssmEdges";
    112         fnames[i++] = "Quadrilaterals";
    113         fnames[i++] = "VerticesOnGeomVertex";
    114         fnames[i++] = "VerticesOnGeomEdge";
    115         fnames[i++] = "EdgesOnGeomEdge";
    116         fnames[i++] = "SubDomains";
    117         fnames[i++] = "SubDomainsFromGeom";
    118         fnames[i++] = "ElementConnectivity";
    119         fnames[i++] = "NodalConnectivity";
    120         fnames[i++] = "NodalElementConnectivity";
    121         fnames[i++] = "CrackedVertices";
    122         fnames[i++] = "CrackedEdges";
    123         _assert_(i==numfields);
    124 
    125         /*Initialize Matlab structure*/
    126         output=mxCreateStructArray(ndim,dimensions,numfields,fnames);
    127 
    128         /*set each matlab each field*/
    129         i=0;
    130         i++; SetMatlabStructureField(output,"Triangles",                this->TrianglesSize[0],                this->TrianglesSize[1],                 this->Triangles);
    131         i++; SetMatlabStructureField(output,"Vertices",                 this->VerticesSize[0],                 this->VerticesSize[1],                  this->Vertices);
    132         i++; SetMatlabStructureField(output,"Edges",                    this->EdgesSize[0],                    this->EdgesSize[1],                     this->Edges);
    133         i++; SetMatlabStructureField(output,"IssmSegments",             this->IssmSegmentsSize[0],             this->IssmSegmentsSize[1],              this->IssmSegments);
    134         i++; SetMatlabStructureField(output,"IssmEdges",                this->IssmEdgesSize[0],                this->IssmEdgesSize[1],                 this->IssmEdges);
    135         i++; SetMatlabStructureField(output,"Quadrilaterals",           this->QuadrilateralsSize[0],           this->QuadrilateralsSize[1],            this->Quadrilaterals);
    136         i++; SetMatlabStructureField(output,"VerticesOnGeomVertex",this->VerticesOnGeomVertexSize[0],this->VerticesOnGeomVertexSize[1], this->VerticesOnGeomVertex);
    137         i++; SetMatlabStructureField(output,"VerticesOnGeomEdge",  this->VerticesOnGeomEdgeSize[0],  this->VerticesOnGeomEdgeSize[1],   this->VerticesOnGeomEdge);
    138         i++; SetMatlabStructureField(output,"EdgesOnGeomEdge",     this->EdgesOnGeomEdgeSize[0],     this->EdgesOnGeomEdgeSize[1],      this->EdgesOnGeomEdge);
    139         i++; SetMatlabStructureField(output,"SubDomains",               this->SubDomainsSize[0],               this->SubDomainsSize[1],                this->SubDomains);
    140         i++; SetMatlabStructureField(output,"SubDomainsFromGeom",       this->SubDomainsFromGeomSize[0],       this->SubDomainsFromGeomSize[1],        this->SubDomainsFromGeom);
    141         i++; SetMatlabStructureField(output,"ElementConnectivity",      this->ElementConnectivitySize[0],      this->ElementConnectivitySize[1],       this->ElementConnectivity);
    142         i++; SetMatlabStructureField(output,"NodalConnectivity",        this->NodalConnectivitySize[0],        this->NodalConnectivitySize[1],         this->NodalConnectivity);
    143         i++; SetMatlabStructureField(output,"NodalElementConnectivity", this->NodalElementConnectivitySize[0], this->NodalElementConnectivitySize[1],  this->NodalElementConnectivity);
    144         i++; SetMatlabStructureField(output,"CrackedVertices",          this->CrackedVerticesSize[0],          this->CrackedVerticesSize[1],           this->CrackedVertices);
    145         i++; SetMatlabStructureField(output,"CrackedEdges",             this->CrackedEdgesSize[0],             this->CrackedEdgesSize[1],              this->CrackedEdges);
    146         _assert_(i==numfields);
    147 
    148         /*Assign output*/
    149         *matlab_struct=output;
    150 
    151 }
    152 #endif
    153 /*}}}*/
    154 /*FUNCTION BamgMesh::SetMatlabStructureField{{{1*/
    155 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    156 void BamgMesh::SetMatlabStructureField(mxArray* matlab_struct,const char* fieldname,int fieldrows,int fieldcols,double* fieldpointer){
    157 
    158         /*Intermediary*/
    159         int         i1,i2;
    160         mxArray*    pfield=NULL;
    161         mxArray*    pfield2=NULL;
    162 
    163         /*Copy field*/
    164         double*  fieldcopy=NULL;
    165         if (fieldrows*fieldcols){
    166                 fieldcopy=(double*)xmalloc(fieldrows*fieldcols*sizeof(double));
    167                 for(i1=0;i1<fieldrows;i1++){
    168                         for(i2=0;i2<fieldcols;i2++){
    169                                 fieldcopy[fieldcols*i1+i2]=fieldpointer[fieldcols*i1+i2];
    170                         }
    171                 }
    172         }
    173 
    174         /*Set matlab field*/
    175         pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    176         mxSetM(pfield,fieldcols);
    177         mxSetN(pfield,fieldrows);
    178         mxSetPr(pfield,fieldcopy);
    179         mexCallMATLAB(1,&pfield2,1,&pfield,"transpose");//transpose
    180         mxSetField(matlab_struct,0,fieldname,pfield2);
    181 }
    182 #endif
    183 /*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Bamg/BamgMesh.h

    r12004 r12168  
    44#ifndef _BAMGMESH_H_
    55#define _BAMGMESH_H_
    6 
    7 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    8 #include <mex.h>
    9 #endif
    106
    117class BamgMesh{
     
    5147
    5248                BamgMesh();
    53                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    54                 BamgMesh(mxArray* matlab_struct);
    55                 #endif
    5649                ~BamgMesh();
    57 
    58                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    59                 void SetMatlabStructureFields(mxArray** matlab_struct);
    60                 void SetMatlabStructureField(mxArray* matlab_struct,const char* fieldname,int fieldrows,int fieldcols,double* fieldpointer);
    61                 #endif
    62 
    6350};
    6451
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Bamg/BamgOpts.cpp

    r12004 r12168  
    4040
    4141}
    42 /*}}}*/
    43 /*FUNCTION BamgOpts::BamgOpts(mxArray* matlab_struct){{{1*/
    44 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    45 BamgOpts::BamgOpts(mxArray* matlab_struct){
    46 
    47         FetchData(&this->anisomax,mxGetField(matlab_struct,0,"anisomax"));
    48         FetchData(&this->cutoff,mxGetField(matlab_struct,0,"cutoff"));
    49         FetchData(&this->coeff,mxGetField(matlab_struct,0,"coeff"));
    50         FetchData(&this->errg,mxGetField(matlab_struct,0,"errg"));
    51         FetchData(&this->gradation,mxGetField(matlab_struct,0,"gradation"));
    52         FetchData(&this->Hessiantype,mxGetField(matlab_struct,0,"Hessiantype"));
    53         FetchData(&this->MaxCornerAngle,mxGetField(matlab_struct,0,"MaxCornerAngle"));
    54         FetchData(&this->maxnbv,mxGetField(matlab_struct,0,"maxnbv"));
    55         FetchData(&this->maxsubdiv,mxGetField(matlab_struct,0,"maxsubdiv"));
    56         FetchData(&this->Metrictype,mxGetField(matlab_struct,0,"Metrictype"));
    57         FetchData(&this->nbjacobi,mxGetField(matlab_struct,0,"nbjacobi"));
    58         FetchData(&this->nbsmooth,mxGetField(matlab_struct,0,"nbsmooth"));
    59         FetchData(&this->omega,mxGetField(matlab_struct,0,"omega"));
    60         FetchData(&this->power,mxGetField(matlab_struct,0,"power"));
    61         FetchData(&this->verbose,mxGetField(matlab_struct,0,"verbose"));
    62 
    63         FetchData(&this->Crack,mxGetField(matlab_struct,0,"Crack"));
    64         FetchData(&this->geometricalmetric,mxGetField(matlab_struct,0,"geometricalmetric"));
    65         FetchData(&this->KeepVertices,mxGetField(matlab_struct,0,"KeepVertices"));
    66         FetchData(&this->splitcorners,mxGetField(matlab_struct,0,"splitcorners"));
    67 
    68         FetchData(&this->hmin,mxGetField(matlab_struct,0,"hmin"));
    69         FetchData(&this->hmax,mxGetField(matlab_struct,0,"hmax"));
    70         FetchData(&this->hminVertices,&this->hminVerticesSize[0],&this->hminVerticesSize[1],mxGetField(matlab_struct,0,"hminVertices"));
    71         FetchData(&this->hmaxVertices,&this->hmaxVerticesSize[0],&this->hmaxVerticesSize[1],mxGetField(matlab_struct,0,"hmaxVertices"));
    72         FetchData(&this->hVertices,&this->hVerticesSize[0],&this->hVerticesSize[1],mxGetField(matlab_struct,0,"hVertices"));
    73         FetchData(&this->metric,&this->metricSize[0],&this->metricSize[1],mxGetField(matlab_struct,0,"metric"));
    74         FetchData(&this->field,&this->fieldSize[0],&this->fieldSize[1],mxGetField(matlab_struct,0,"field"));
    75         FetchData(&this->err,&this->errSize[0],&this->errSize[1],mxGetField(matlab_struct,0,"err"));
    76 
    77         /*Additional checks*/
    78         this->Check();
    79 
    80 }
    81 #endif
    8242/*}}}*/
    8343/*FUNCTION BamgOpts::~BamgOpts() {{{1*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Bamg/BamgOpts.h

    r12004 r12168  
    55#ifndef _BAMGOPTS_H_
    66#define _BAMGOPTS_H_
    7 
    8 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    9 #include <mex.h>
    10 #endif
    117
    128class BamgOpts{
     
    5450
    5551                BamgOpts();
    56                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    57                 BamgOpts(mxArray* matlab_struct);
    58                 #endif
    5952                ~BamgOpts();
    6053
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Bamg/Metric.h

    r9690 r12168  
    55#include "../../shared/Bamg/shared.h"
    66#include "R2.h"
     7#include <math.h>
    78
    89namespace bamg {
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Bamg/QuadTree.h

    r9883 r12168  
    3333                                        int   Id(){_error_("not implemented yet");};
    3434                                        int   MyRank(){_error_("not implemented yet");};
    35                                         #ifdef _SERIAL_
    36                                         void  Marshall(char** pmarshalled_dataset){_error_("not implemented yet");};
    37                                         int   MarshallSize(){_error_("not implemented yet");};
    38                                         void  Demarshall(char** pmarshalled_dataset){_error_("not implemented yet");};
    39                                         #endif
    4035                                        int   ObjectEnum(){_error_("not implemented yet");};
    4136                                        Object* copy(){_error_("not implemented yet");};
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Constraints/SpcDynamic.cpp

    r9883 r12168  
    7272}
    7373/*}}}1*/
    74 #ifdef _SERIAL_
    75 /*FUNCTION SpcDynamic::Marshall {{{1*/
    76 void  SpcDynamic::Marshall(char** pmarshalled_dataset){
    77 
    78         char* marshalled_dataset=NULL;
    79         int   enum_type=0;
    80 
    81         /*recover marshalled_dataset: */
    82         marshalled_dataset=*pmarshalled_dataset;
    83 
    84         /*get enum type of SpcDynamic: */
    85         enum_type=SpcDynamicEnum;
    86        
    87         /*marshall enum: */
    88         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    89        
    90         /*marshall SpcDynamic data: */
    91         memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
    92         memcpy(marshalled_dataset,&nodeid,sizeof(nodeid));marshalled_dataset+=sizeof(nodeid);
    93         memcpy(marshalled_dataset,&dof,sizeof(dof));marshalled_dataset+=sizeof(dof);
    94         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    95         memcpy(marshalled_dataset,&isset,sizeof(isset));marshalled_dataset+=sizeof(isset);
    96         memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    97 
    98         *pmarshalled_dataset=marshalled_dataset;
    99         return;
    100 }
    101 /*}}}1*/
    102 /*FUNCTION SpcDynamic::MarshallSize {{{1*/
    103 int   SpcDynamic::MarshallSize(){
    104 
    105         return sizeof(sid)
    106                 +sizeof(nodeid)
    107                 +sizeof(dof)
    108                 +sizeof(value)
    109                 +sizeof(isset)
    110                 +sizeof(analysis_type)
    111                 +sizeof(int); //sizeof(int) for enum type
    112 }
    113 /*}}}1*/
    114 /*FUNCTION SpcDynamic::Demarshall {{{1*/
    115 void  SpcDynamic::Demarshall(char** pmarshalled_dataset){
    116 
    117         char* marshalled_dataset=NULL;
    118 
    119         /*recover marshalled_dataset: */
    120         marshalled_dataset=*pmarshalled_dataset;
    121 
    122         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    123          *object data (thanks to DataSet::Demarshall):*/
    124 
    125         memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
    126         memcpy(&nodeid,marshalled_dataset,sizeof(nodeid));marshalled_dataset+=sizeof(nodeid);
    127         memcpy(&dof,marshalled_dataset,sizeof(dof));marshalled_dataset+=sizeof(dof);
    128         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    129         memcpy(&isset,marshalled_dataset,sizeof(isset));marshalled_dataset+=sizeof(isset);
    130         memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    131 
    132         /*return: */
    133         *pmarshalled_dataset=marshalled_dataset;
    134         return;
    135 }
    136 /*}}}1*/
    137 #endif
    13874/*FUNCTION SpcDynamic::ObjectEnum{{{1*/
    13975int SpcDynamic::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Constraints/SpcDynamic.h

    r9883 r12168  
    3434                int   Id();
    3535                int   MyRank();
    36                 #ifdef _SERIAL_
    37                 void  Marshall(char** pmarshalled_dataset);
    38                 int   MarshallSize();
    39                 void  Demarshall(char** pmarshalled_dataset);
    40                 #endif
    4136                int   ObjectEnum();
    4237                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Constraints/SpcStatic.cpp

    r9883 r12168  
    7575}
    7676/*}}}1*/
    77 #ifdef _SERIAL_
    78 /*FUNCTION SpcStatic::Marshall {{{1*/
    79 void  SpcStatic::Marshall(char** pmarshalled_dataset){
    80 
    81         char* marshalled_dataset=NULL;
    82         int   enum_type=0;
    83 
    84         /*recover marshalled_dataset: */
    85         marshalled_dataset=*pmarshalled_dataset;
    86 
    87         /*get enum type of SpcStatic: */
    88         enum_type=SpcStaticEnum;
    89        
    90         /*marshall enum: */
    91         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    92        
    93         /*marshall SpcStatic data: */
    94         memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
    95         memcpy(marshalled_dataset,&nodeid,sizeof(nodeid));marshalled_dataset+=sizeof(nodeid);
    96         memcpy(marshalled_dataset,&dof,sizeof(dof));marshalled_dataset+=sizeof(dof);
    97         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    98         memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    99 
    100         *pmarshalled_dataset=marshalled_dataset;
    101         return;
    102 }
    103 /*}}}1*/
    104 /*FUNCTION SpcStatic::MarshallSize {{{1*/
    105 int   SpcStatic::MarshallSize(){
    106 
    107         return sizeof(sid)
    108                 +sizeof(nodeid)
    109                 +sizeof(dof)
    110                 +sizeof(value)
    111                 +sizeof(analysis_type)
    112                 +sizeof(int); //sizeof(int) for enum type
    113 }
    114 /*}}}1*/
    115 /*FUNCTION SpcStatic::Demarshall {{{1*/
    116 void  SpcStatic::Demarshall(char** pmarshalled_dataset){
    117 
    118         char* marshalled_dataset=NULL;
    119 
    120         /*recover marshalled_dataset: */
    121         marshalled_dataset=*pmarshalled_dataset;
    122 
    123         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    124          *object data (thanks to DataSet::Demarshall):*/
    125 
    126         memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
    127         memcpy(&nodeid,marshalled_dataset,sizeof(nodeid));marshalled_dataset+=sizeof(nodeid);
    128         memcpy(&dof,marshalled_dataset,sizeof(dof));marshalled_dataset+=sizeof(dof);
    129         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    130         memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    131 
    132         /*return: */
    133         *pmarshalled_dataset=marshalled_dataset;
    134         return;
    135 }
    136 /*}}}1*/
    137 #endif
    13877/*FUNCTION SpcStatic::ObjectEnum{{{1*/
    13978int SpcStatic::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Constraints/SpcStatic.h

    r9883 r12168  
    3333                int   Id();
    3434                int   MyRank();
    35                 #ifdef _SERIAL_
    36                 void  Marshall(char** pmarshalled_dataset);
    37                 int   MarshallSize();
    38                 void  Demarshall(char** pmarshalled_dataset);
    39                 #endif
    4035                int   ObjectEnum();
    4136                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Constraints/SpcTransient.cpp

    r9883 r12168  
    8787}
    8888/*}}}1*/
    89 #ifdef _SERIAL_
    90 /*FUNCTION SpcTransient::Marshall {{{1*/
    91 void  SpcTransient::Marshall(char** pmarshalled_dataset){
    92 
    93         char* marshalled_dataset=NULL;
    94         int   enum_type=0;
    95 
    96         /*recover marshalled_dataset: */
    97         marshalled_dataset=*pmarshalled_dataset;
    98 
    99         /*get enum type of SpcTransient: */
    100         enum_type=SpcTransientEnum;
    101        
    102         /*marshall enum: */
    103         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    104        
    105         /*marshall SpcTransient data: */
    106         memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
    107         memcpy(marshalled_dataset,&nodeid,sizeof(nodeid));marshalled_dataset+=sizeof(nodeid);
    108         memcpy(marshalled_dataset,&dof,sizeof(dof));marshalled_dataset+=sizeof(dof);
    109         memcpy(marshalled_dataset,&nsteps,sizeof(nsteps));marshalled_dataset+=sizeof(nsteps);
    110         memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    111         if(nsteps){
    112                 memcpy(marshalled_dataset,values,nsteps*sizeof(double));marshalled_dataset+=nsteps*sizeof(double);
    113                 memcpy(marshalled_dataset,times,nsteps*sizeof(double));marshalled_dataset+=nsteps*sizeof(double);
    114         }
    115 
    116         *pmarshalled_dataset=marshalled_dataset;
    117         return;
    118 }
    119 /*}}}1*/
    120 /*FUNCTION SpcTransient::MarshallSize {{{1*/
    121 int   SpcTransient::MarshallSize(){
    122 
    123         return sizeof(sid)
    124                 +sizeof(nodeid)
    125                 +sizeof(dof)
    126                 +sizeof(nsteps)
    127                 +nsteps*2*sizeof(double)
    128                 +sizeof(analysis_type)
    129                 +sizeof(int); //sizeof(int) for enum type
    130 }
    131 /*}}}1*/
    132 /*FUNCTION SpcTransient::Demarshall {{{1*/
    133 void  SpcTransient::Demarshall(char** pmarshalled_dataset){
    134 
    135         char* marshalled_dataset=NULL;
    136 
    137         /*recover marshalled_dataset: */
    138         marshalled_dataset=*pmarshalled_dataset;
    139 
    140         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    141          *object data (thanks to DataSet::Demarshall):*/
    142 
    143         memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
    144         memcpy(&nodeid,marshalled_dataset,sizeof(nodeid));marshalled_dataset+=sizeof(nodeid);
    145         memcpy(&dof,marshalled_dataset,sizeof(dof));marshalled_dataset+=sizeof(dof);
    146         memcpy(&nsteps,marshalled_dataset,sizeof(nsteps));marshalled_dataset+=sizeof(nsteps);
    147         memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    148         if(nsteps){
    149                 values=(double*)xmalloc(nsteps*sizeof(double));
    150                 times=(double*)xmalloc(nsteps*sizeof(double));
    151                 memcpy(values,marshalled_dataset,nsteps*sizeof(double));marshalled_dataset+=nsteps*sizeof(double);
    152                 memcpy(times,marshalled_dataset,nsteps*sizeof(double));marshalled_dataset+=nsteps*sizeof(double);
    153         }
    154 
    155         /*return: */
    156         *pmarshalled_dataset=marshalled_dataset;
    157         return;
    158 }
    159 /*}}}1*/
    160 #endif
    16189/*FUNCTION SpcTransient::ObjectEnum{{{1*/
    16290int SpcTransient::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Constraints/SpcTransient.h

    r9883 r12168  
    3535                int   Id();
    3636                int   MyRank();
    37                 #ifdef _SERIAL_
    38                 void  Marshall(char** pmarshalled_dataset);
    39                 int   MarshallSize();
    40                 void  Demarshall(char** pmarshalled_dataset);
    41                 #endif
    4237                int   ObjectEnum();
    4338                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Contour.cpp

    r12004 r12168  
    7979}
    8080/*}}}*/
    81 #ifdef _SERIAL_
    82 /*FUNCTION Contour::Marshall{{{1*/
    83 void  Contour::Marshall(char** pmarshalled_dataset){
    84 
    85         char* marshalled_dataset=NULL;
    86         int   enum_type=0;
    87         char* marshalled_inputs=NULL;
    88         int   marshalled_inputssize;
    89 
    90         /*recover marshalled_dataset: */
    91         marshalled_dataset=*pmarshalled_dataset;
    92 
    93         /*get enum type of Contour: */
    94         enum_type=ContourEnum;
    95        
    96         /*marshall enum: */
    97         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    98        
    99         /*marshall Contour data: */
    100         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    101         memcpy(marshalled_dataset,&nods,sizeof(nods));marshalled_dataset+=sizeof(nods);
    102         memcpy(marshalled_dataset,&closed,sizeof(closed));marshalled_dataset+=sizeof(closed);
    103         memcpy(marshalled_dataset,x,nods*sizeof(double));marshalled_dataset+=nods*sizeof(double);
    104         memcpy(marshalled_dataset,y,nods*sizeof(double));marshalled_dataset+=nods*sizeof(double);
    105 
    106         *pmarshalled_dataset=marshalled_dataset;
    107         return;
    108 }
    109 /*}}}*/
    110 /*FUNCTION Contour::MarshallSize{{{1*/
    111 int   Contour::MarshallSize(){
    112 
    113         return sizeof(id)+
    114                 sizeof(nods)+
    115                 sizeof(closed)+
    116                 2*nods*sizeof(double)+
    117                 sizeof(int); //sizeof(int) for enum type
    118 }
    119 /*}}}*/
    120 /*FUNCTION Contour::Demarshall{{{1*/
    121 void  Contour::Demarshall(char** pmarshalled_dataset){
    122 
    123         char* marshalled_dataset=NULL;
    124 
    125         /*recover marshalled_dataset: */
    126         marshalled_dataset=*pmarshalled_dataset;
    127 
    128         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    129          *object data (thanks to DataSet::Demarshall):*/
    130 
    131         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    132         memcpy(&nods,marshalled_dataset,sizeof(nods));marshalled_dataset+=sizeof(nods);
    133         memcpy(&closed,marshalled_dataset,sizeof(closed));marshalled_dataset+=sizeof(closed);
    134 
    135         if(nods){
    136                 this->x=(double*)xmalloc(nods*sizeof(double));
    137                 this->y=(double*)xmalloc(nods*sizeof(double));
    138                 memcpy(x,marshalled_dataset,nods*sizeof(double));marshalled_dataset+=nods*sizeof(double);
    139                 memcpy(y,marshalled_dataset,nods*sizeof(double));marshalled_dataset+=nods*sizeof(double);
    140         }
    141 
    142         /*return: */
    143         *pmarshalled_dataset=marshalled_dataset;
    144         return;
    145 }
    146 /*}}}*/
    147 #endif
    14881/*FUNCTION Contour::ObjectEnum{{{1*/
    14982int Contour::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Contour.h

    r12004 r12168  
    3434                int   Id(void);
    3535                int   MyRank(void);
    36                 #ifdef _SERIAL_
    37                 void  Marshall(char** pmarshalled_dataset);
    38                 int   MarshallSize(void);
    39                 void  Demarshall(char** pmarshalled_dataset);
    40                 #endif
    4136                int   ObjectEnum(void);
    4237                Object* copy(void);
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/DofIndexing.cpp

    r9777 r12168  
    208208}               
    209209/*}}}*/
    210 #ifdef _SERIAL_
    211 /*FUNCTION DofIndexing::Marshall{{{1*/
    212 void  DofIndexing::Marshall(char** pmarshalled_dataset){
    213 
    214         char* marshalled_dataset=NULL;
    215         int   enum_type=0;
    216         bool  flagdoftype; //to indicate if there are some doftype or if NULL
    217 
    218         /*recover marshalled_dataset: */
    219         marshalled_dataset=*pmarshalled_dataset;
    220 
    221         /*preliminary: */
    222         if(this->doftype)flagdoftype=true;
    223         else             flagdoftype=false;
    224 
    225         /*get enum type of DofIndexing: */
    226         enum_type=DofIndexingEnum;
    227        
    228         /*marshall enum: */
    229         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    230        
    231         /*marshall DofIndexing data: */
    232         memcpy(marshalled_dataset,&gsize,sizeof(gsize));marshalled_dataset+=sizeof(gsize);
    233         memcpy(marshalled_dataset,&fsize,sizeof(fsize));marshalled_dataset+=sizeof(fsize);
    234         memcpy(marshalled_dataset,&ssize,sizeof(ssize));marshalled_dataset+=sizeof(ssize);
    235         memcpy(marshalled_dataset,&flagdoftype,sizeof(flagdoftype));marshalled_dataset+=sizeof(flagdoftype);
    236         memcpy(marshalled_dataset,&clone,sizeof(clone));marshalled_dataset+=sizeof(clone);
    237        
    238         if(this->gsize>0){
    239                 memcpy(marshalled_dataset,f_set,gsize*sizeof(bool));marshalled_dataset+=gsize*sizeof(bool);
    240                 memcpy(marshalled_dataset,s_set,gsize*sizeof(bool));marshalled_dataset+=gsize*sizeof(bool);
    241                 memcpy(marshalled_dataset,svalues,gsize*sizeof(double)); marshalled_dataset+=gsize*sizeof(double);
    242                 if(flagdoftype){ memcpy(marshalled_dataset,doftype,gsize*sizeof(int)); marshalled_dataset+=gsize*sizeof(int); }
    243                 memcpy(marshalled_dataset,gdoflist,gsize*sizeof(int)); marshalled_dataset+=gsize*sizeof(int);
    244         }
    245         if(this->fsize>0 && this->fsize!=UNDEF){ memcpy(marshalled_dataset,fdoflist,fsize*sizeof(int)); marshalled_dataset+=fsize*sizeof(int);}
    246         if(this->ssize>0 && this->ssize!=UNDEF){ memcpy(marshalled_dataset,sdoflist,ssize*sizeof(int)); marshalled_dataset+=ssize*sizeof(int);}
    247 
    248         *pmarshalled_dataset=marshalled_dataset;
    249         return;
    250 }
    251 /*}}}*/
    252 /*FUNCTION DofIndexing::MarshallSize{{{1*/
    253 int   DofIndexing::MarshallSize(){
    254 
    255         int size=0;
    256 
    257         size+=4*sizeof(int)+sizeof(bool);
    258         if(this->gsize>0){
    259                 size+= 2*this->gsize*sizeof(bool)+
    260                            this->gsize*sizeof(double)+
    261                            this->gsize*sizeof(int);
    262                 if(this->doftype)size+=this->gsize*sizeof(int);
    263         }
    264         if(this->fsize>0 && this->fsize!=UNDEF)size+=this->fsize*sizeof(int);
    265         if(this->ssize>0 && this->ssize!=UNDEF)size+=this->ssize*sizeof(int);
    266 
    267         size+=sizeof(int); //sizeof(int) for enum type
    268 
    269         return size;
    270 }
    271 /*}}}*/
    272 /*FUNCTION DofIndexing::Demarshall{{{1*/
    273 void  DofIndexing::Demarshall(char** pmarshalled_dataset){
    274 
    275         char* marshalled_dataset=NULL;
    276         int   enum_type;
    277         bool  flagdoftype;
    278 
    279         /*recover marshalled_dataset: */
    280         marshalled_dataset=*pmarshalled_dataset;
    281 
    282         /*get enum type of object since DofIndexing is not directly called by DataSet: */
    283         memcpy(&enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
    284 
    285         /*easy part: */
    286         memcpy(&gsize,marshalled_dataset,sizeof(gsize));marshalled_dataset+=sizeof(gsize);
    287         memcpy(&fsize,marshalled_dataset,sizeof(fsize));marshalled_dataset+=sizeof(fsize);
    288         memcpy(&ssize,marshalled_dataset,sizeof(ssize));marshalled_dataset+=sizeof(ssize);
    289         memcpy(&flagdoftype,marshalled_dataset,sizeof(flagdoftype));marshalled_dataset+=sizeof(flagdoftype);
    290         memcpy(&clone,marshalled_dataset,sizeof(clone));marshalled_dataset+=sizeof(clone);
    291        
    292         /*Allocate: */
    293         if(this->gsize>0){
    294                 this->f_set=(bool*)xmalloc(this->gsize*sizeof(bool));
    295                 this->s_set=(bool*)xmalloc(this->gsize*sizeof(bool));
    296                 this->svalues=(double*)xmalloc(this->gsize*sizeof(double));
    297                 if(flagdoftype)this->doftype=(int*)xmalloc(this->gsize*sizeof(int));
    298                 else           this->doftype=NULL;
    299                 this->gdoflist=(int*)xmalloc(this->gsize*sizeof(int));
    300         }
    301         else{
    302                 this->f_set=NULL;
    303                 this->s_set=NULL;
    304                 this->svalues=NULL;
    305                 this->doftype=NULL;
    306                 this->gdoflist=NULL;
    307         }
    308         if(this->fsize>0)
    309          this->fdoflist=(int*)xmalloc(this->fsize*sizeof(int));
    310         else
    311          this->fdoflist=NULL;
    312         if(this->ssize>0)
    313          this->sdoflist=(int*)xmalloc(this->ssize*sizeof(int));
    314         else
    315          this->sdoflist=NULL;
    316 
    317         /*Copy arrays: */
    318         if(this->gsize>0){
    319                 memcpy(f_set,marshalled_dataset,gsize*sizeof(bool));marshalled_dataset+=gsize*sizeof(bool);
    320                 memcpy(s_set,marshalled_dataset,gsize*sizeof(bool));marshalled_dataset+=gsize*sizeof(bool);
    321                 memcpy(svalues,marshalled_dataset,gsize*sizeof(double));marshalled_dataset+=gsize*sizeof(double);
    322                 if(flagdoftype){memcpy(doftype,marshalled_dataset,gsize*sizeof(int));marshalled_dataset+=gsize*sizeof(int); }
    323                 memcpy(gdoflist,marshalled_dataset,gsize*sizeof(int));marshalled_dataset+=gsize*sizeof(int);
    324         }
    325        
    326         if(this->fsize>0 && this->fsize!=UNDEF){ memcpy(this->fdoflist,marshalled_dataset,this->fsize*sizeof(int));marshalled_dataset+=this->fsize*sizeof(int); }
    327         if(this->ssize>0 && this->ssize!=UNDEF){ memcpy(this->sdoflist,marshalled_dataset,this->ssize*sizeof(int));marshalled_dataset+=this->ssize*sizeof(int); }
    328 
    329         /*return: */
    330         *pmarshalled_dataset=marshalled_dataset;
    331         return;
    332 }
    333 /*}}}*/
    334 #endif
    335 
     210
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/DofIndexing.h

    r9777 r12168  
    4343                void  Echo(void);
    4444                void  DeepEcho(void);
    45                 #ifdef _SERIAL_
    46                 void  Marshall(char** pmarshalled_dataset);
    47                 int   MarshallSize();
    48                 void  Demarshall(char** pmarshalled_dataset);
    49                 #endif
    5045                void  copy(DofIndexing* properties);
    5146                /*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ElementResults/BoolElementResult.cpp

    r11708 r12168  
    6464}
    6565/*}}}*/
    66 #ifdef _SERIAL_
    67 /*FUNCTION BoolElementResult::Marshall{{{1*/
    68 void  BoolElementResult::Marshall(char** pmarshalled_dataset){
    69 
    70         char* marshalled_dataset=NULL;
    71         int   enum_value=0;
    72 
    73         /*recover marshalled_dataset: */
    74         marshalled_dataset=*pmarshalled_dataset;
    75 
    76         /*get enum value of BoolElementResult: */
    77         enum_value=BoolElementResultEnum;
    78        
    79         /*marshall enum: */
    80         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    81        
    82         /*marshall BoolElementResult data: */
    83         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    84         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    85         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    86         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    87 
    88         *pmarshalled_dataset=marshalled_dataset;
    89 }
    90 /*}}}*/
    91 /*FUNCTION BoolElementResult::Demarshall{{{1*/
    92 void  BoolElementResult::Demarshall(char** pmarshalled_dataset){
    93 
    94         char* marshalled_dataset=NULL;
    95         int   i;
    96 
    97         /*recover marshalled_dataset: */
    98         marshalled_dataset=*pmarshalled_dataset;
    99 
    100         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    101          *object data (thanks to DataSet::Demarshall):*/
    102         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    103         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    104         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    105         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    106 
    107         /*return: */
    108         *pmarshalled_dataset=marshalled_dataset;
    109         return;
    110 }
    111 /*}}}*/
    112 /*FUNCTION BoolElementResult::MarshallSize{{{1*/
    113 int   BoolElementResult::MarshallSize(){
    114        
    115         return sizeof(value)+
    116                 +sizeof(enum_type)
    117                 +sizeof(time)
    118                 +sizeof(step)
    119                 +sizeof(int); //sizeof(int) for enum value
    120 }
    121 /*}}}*/
    122 #endif
    12366/*FUNCTION BoolElementResult::ObjectEnum{{{1*/
    12467int BoolElementResult::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ElementResults/BoolElementResult.h

    r11708 r12168  
    3535                int   Id();
    3636                int   MyRank();
    37                 #ifdef _SERIAL_
    38                 void  Marshall(char** pmarshalled_dataset);
    39                 int   MarshallSize();
    40                 void  Demarshall(char** pmarshalled_dataset);
    41                 #endif
    4237                int   ObjectEnum();
    4338                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ElementResults/DoubleElementResult.cpp

    r9883 r12168  
    6464}
    6565/*}}}*/
    66 #ifdef _SERIAL_
    67 /*FUNCTION DoubleElementResult::Marshall{{{1*/
    68 void  DoubleElementResult::Marshall(char** pmarshalled_dataset){
    69 
    70         char* marshalled_dataset=NULL;
    71         int   enum_value=0;
    72 
    73         /*recover marshalled_dataset: */
    74         marshalled_dataset=*pmarshalled_dataset;
    75 
    76         /*get enum value of DoubleElementResult: */
    77         enum_value=DoubleElementResultEnum;
    78        
    79         /*marshall enum: */
    80         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    81        
    82         /*marshall DoubleElementResult data: */
    83         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    84         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    85         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    86         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    87 
    88         *pmarshalled_dataset=marshalled_dataset;
    89 }
    90 /*}}}*/
    91 /*FUNCTION DoubleElementResult::Demarshall{{{1*/
    92 void  DoubleElementResult::Demarshall(char** pmarshalled_dataset){
    93 
    94         char* marshalled_dataset=NULL;
    95         int   i;
    96 
    97         /*recover marshalled_dataset: */
    98         marshalled_dataset=*pmarshalled_dataset;
    99 
    100         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    101          *object data (thanks to DataSet::Demarshall):*/
    102         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    103         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    104         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    105         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    106 
    107         /*return: */
    108         *pmarshalled_dataset=marshalled_dataset;
    109         return;
    110 }
    111 /*}}}*/
    112 /*FUNCTION DoubleElementResult::MarshallSize{{{1*/
    113 int   DoubleElementResult::MarshallSize(){
    114        
    115         return sizeof(value)+
    116                 +sizeof(enum_type)
    117                 +sizeof(time)
    118                 +sizeof(step)
    119                 +sizeof(int); //sizeof(int) for enum value
    120 }
    121 /*}}}*/
    122 #endif
    12366/*FUNCTION DoubleElementResult::ObjectEnum{{{1*/
    12467int DoubleElementResult::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ElementResults/DoubleElementResult.h

    r11708 r12168  
    3535                int   Id();
    3636                int   MyRank();
    37                 #ifdef _SERIAL_
    38                 void  Marshall(char** pmarshalled_dataset);
    39                 int   MarshallSize();
    40                 void  Demarshall(char** pmarshalled_dataset);
    41                 #endif
    4237                int   ObjectEnum();
    4338                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ElementResults/PentaP1ElementResult.cpp

    r11708 r12168  
    6767}
    6868/*}}}*/
    69 #ifdef _SERIAL_
    70 /*FUNCTION PentaP1ElementResult::Marshall{{{1*/
    71 void  PentaP1ElementResult::Marshall(char** pmarshalled_dataset){
    72 
    73         char* marshalled_dataset=NULL;
    74         int   enum_value=0;
    75 
    76         /*recover marshalled_dataset: */
    77         marshalled_dataset=*pmarshalled_dataset;
    78 
    79         /*get enum value of PentaP1ElementResult: */
    80         enum_value=PentaP1ElementResultEnum;
    81        
    82         /*marshall enum: */
    83         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    84        
    85         /*marshall PentaP1ElementResult data: */
    86         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    87         memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
    88         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    89         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    90 
    91         *pmarshalled_dataset=marshalled_dataset;
    92 }
    93 /*}}}*/
    94 /*FUNCTION PentaP1ElementResult::MarshallSize{{{1*/
    95 int   PentaP1ElementResult::MarshallSize(){
    96        
    97         return sizeof(values)+
    98                 +sizeof(enum_type)
    99                 +sizeof(time)
    100                 +sizeof(step)
    101                 +sizeof(int); //sizeof(int) for enum value
    102 }
    103 /*}}}*/
    104 /*FUNCTION PentaP1ElementResult::Demarshall{{{1*/
    105 void  PentaP1ElementResult::Demarshall(char** pmarshalled_dataset){
    106 
    107         char* marshalled_dataset=NULL;
    108         int   i;
    109 
    110         /*recover marshalled_dataset: */
    111         marshalled_dataset=*pmarshalled_dataset;
    112 
    113         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    114          *object data (thanks to DataSet::Demarshall):*/
    115         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    116         memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
    117         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    118         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    119 
    120         /*return: */
    121         *pmarshalled_dataset=marshalled_dataset;
    122         return;
    123 }
    124 /*}}}*/
    125 #endif
    12669/*FUNCTION PentaP1ElementResult::ObjectEnum{{{1*/
    12770int PentaP1ElementResult::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ElementResults/PentaP1ElementResult.h

    r11708 r12168  
    3434                int   Id();
    3535                int   MyRank();
    36                 #ifdef _SERIAL_
    37                 void  Marshall(char** pmarshalled_dataset);
    38                 int   MarshallSize();
    39                 void  Demarshall(char** pmarshalled_dataset);
    40                 #endif
    4136                int   ObjectEnum();
    4237                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ElementResults/TriaP1ElementResult.cpp

    r11708 r12168  
    6666}
    6767/*}}}*/
    68 #ifdef _SERIAL_
    69 /*FUNCTION TriaP1ElementResult::Marshall{{{1*/
    70 void  TriaP1ElementResult::Marshall(char** pmarshalled_dataset){
    71 
    72         char* marshalled_dataset=NULL;
    73         int   enum_value=0;
    74 
    75 
    76         /*recover marshalled_dataset: */
    77         marshalled_dataset=*pmarshalled_dataset;
    78 
    79         /*get enum value of TriaP1ElementResult: */
    80         enum_value=TriaP1ElementResultEnum;
    81        
    82         /*marshall enum: */
    83         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    84        
    85         /*marshall TriaP1ElementResult data: */
    86         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    87         memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
    88         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    89         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    90 
    91         *pmarshalled_dataset=marshalled_dataset;
    92 }
    93 /*}}}*/
    94 /*FUNCTION TriaP1ElementResult::MarshallSize{{{1*/
    95 int   TriaP1ElementResult::MarshallSize(){
    96        
    97         return sizeof(values)
    98                 +sizeof(enum_type)
    99                 +sizeof(time)
    100                 +sizeof(step)
    101                 +sizeof(int); //sizeof(int) for enum value
    102 }
    103 /*}}}*/
    104 /*FUNCTION TriaP1ElementResult::Demarshall{{{1*/
    105 void  TriaP1ElementResult::Demarshall(char** pmarshalled_dataset){
    106 
    107         char* marshalled_dataset=NULL;
    108         int   i;
    109 
    110         /*recover marshalled_dataset: */
    111         marshalled_dataset=*pmarshalled_dataset;
    112 
    113         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    114          *object data (thanks to DataSet::Demarshall):*/
    115         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    116         memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
    117         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    118         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    119 
    120         /*return: */
    121         *pmarshalled_dataset=marshalled_dataset;
    122         return;
    123 }
    124 /*}}}*/
    125 #endif
    12668/*FUNCTION TriaP1ElementResult::ObjectEnum{{{1*/
    12769int TriaP1ElementResult::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ElementResults/TriaP1ElementResult.h

    r11708 r12168  
    3333                int   Id();
    3434                int   MyRank();
    35                 #ifdef _SERIAL_
    36                 void  Marshall(char** pmarshalled_dataset);
    37                 int   MarshallSize();
    38                 void  Demarshall(char** pmarshalled_dataset);
    39                 #endif
    4035                int   ObjectEnum();
    4136                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Elements/Element.h

    r11708 r12168  
    7171                virtual void   MigrateGroundingLine(double* old_floating_ice,double* sheet_ungrounding)=0;
    7272                virtual void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding)=0;
    73                 virtual void   PositiveDegreeDay(void)=0;
     73                virtual void   PositiveDegreeDay(double* pdds,double* pds,double signorm)=0;
    7474                virtual int    UpdatePotentialSheetUngrounding(double* potential_sheet_ungrounding,Vector* vec_nodes_on_iceshelf,double* nodes_on_iceshelf)=0;
    7575                virtual void   ResetCoordinateSystem()=0;
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Elements/Penta.cpp

    r11984 r12168  
    142142}
    143143/*}}}*/
    144 
    145 /*Marshall*/
    146 #ifdef _SERIAL_
    147 /*FUNCTION Penta::Marshall {{{1*/
    148 void  Penta::Marshall(char** pmarshalled_dataset){
    149 
    150         int   i;
    151         char* marshalled_dataset=NULL;
    152         int   enum_type=0;
    153         char* marshalled_inputs=NULL;
    154         int   marshalled_inputs_size;
    155         char* marshalled_results=NULL;
    156         int   marshalled_results_size;
    157         int   flaghook; //to indicate if hook is NULL or exists
    158 
    159         /*recover marshalled_dataset: */
    160         marshalled_dataset=*pmarshalled_dataset;
    161 
    162         /*get enum type of Penta: */
    163         enum_type=PentaEnum;
    164 
    165         /*marshall enum: */
    166         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    167 
    168         /*marshall Penta data: */
    169         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    170         memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
    171         memcpy(marshalled_dataset,&numanalyses,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses);
    172 
    173         /*Mershall Ref: */
    174         for(i=0;i<numanalyses;i++){
    175                 memcpy(marshalled_dataset,&element_type_list[i],sizeof(element_type_list[i]));marshalled_dataset+=sizeof(element_type_list[i]);
    176         }
    177 
    178         /*Marshall hooks: */
    179         for(i=0;i<numanalyses;i++){
    180                 if(hnodes[i]){
    181                         /*Set flag to 1 as there is a hook */
    182                         flaghook=1;
    183                         memcpy(marshalled_dataset,&flaghook,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook);
    184                         hnodes[i]->Marshall(&marshalled_dataset);
    185                 }
    186                 else{
    187                         /*Set flag to 0 and do not marshall flag as there is no Hook */
    188                         flaghook=0;
    189                         memcpy(marshalled_dataset,&flaghook,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook);
    190                 }
    191         }
    192         hmatice->Marshall(&marshalled_dataset);
    193         hmatpar->Marshall(&marshalled_dataset);
    194         hneighbors->Marshall(&marshalled_dataset);
    195 
    196         /*Marshall inputs and results: */
    197         marshalled_inputs_size=inputs->MarshallSize();
    198         marshalled_inputs=inputs->Marshall();
    199         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    200         marshalled_dataset+=marshalled_inputs_size;
    201 
    202         marshalled_results_size=results->MarshallSize();
    203         marshalled_results=results->Marshall();
    204         memcpy(marshalled_dataset,marshalled_results,marshalled_results_size*sizeof(char));
    205         marshalled_dataset+=marshalled_results_size;
    206 
    207         /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
    208 
    209         xfree((void**)&marshalled_inputs);
    210         xfree((void**)&marshalled_results);
    211 
    212         /*marshall horizontal neighbors: */
    213         memcpy(marshalled_dataset,horizontalneighborsids,3*sizeof(int));marshalled_dataset+=3*sizeof(int);
    214 
    215         *pmarshalled_dataset=marshalled_dataset;
    216         return;
    217 }
    218 /*}}}*/
    219 /*FUNCTION Penta::MarshallSize {{{1*/
    220 int   Penta::MarshallSize(){
    221 
    222         int i;
    223         int hnodes_size=0;;
    224 
    225         for(i=0;i<numanalyses;i++){
    226                 hnodes_size+=sizeof(int); //Flag 0 or 1
    227                 if (hnodes[i]) hnodes_size+=hnodes[i]->MarshallSize();
    228         }
    229 
    230         return sizeof(id)
    231                 +sizeof(sid)
    232                 +hnodes_size
    233                 +sizeof(numanalyses)
    234                 +numanalyses*sizeof(int) //element_type_lists
    235                 +hmatice->MarshallSize()
    236                 +hmatpar->MarshallSize()
    237                 +hneighbors->MarshallSize()
    238                 +inputs->MarshallSize()
    239                 +results->MarshallSize()
    240                 +3*sizeof(int)
    241                 +sizeof(int); //sizeof(int) for enum type
    242 }
    243 /*}}}*/
    244 /*FUNCTION Penta::Demarshall {{{1*/
    245 void  Penta::Demarshall(char** pmarshalled_dataset){
    246 
    247         char* marshalled_dataset=NULL;
    248         int   i;
    249         int flaghook;
    250 
    251         /*recover marshalled_dataset: */
    252         marshalled_dataset=*pmarshalled_dataset;
    253 
    254         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    255          *object data (thanks to DataSet::Demarshall):*/
    256         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    257         memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
    258         memcpy(&numanalyses,marshalled_dataset,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses);
    259 
    260         /*demarshall Ref: */
    261         this->element_type_list=(int*)xmalloc(this->numanalyses*sizeof(int));
    262         for(i=0;i<numanalyses;i++){ memcpy(&element_type_list[i],marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);}
    263 
    264         /*allocate dynamic memory: */
    265         this->hnodes=new Hook*[this->numanalyses];
    266         /*demarshall hooks: */
    267         for(i=0;i<numanalyses;i++){
    268                 memcpy(&flaghook,marshalled_dataset,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook);
    269                 if(flaghook){ // there is a hook so demarshall it
    270                         hnodes[i]=new Hook();
    271                         hnodes[i]->Demarshall(&marshalled_dataset);
    272                 }
    273                 else hnodes[i]=NULL; //There is no hook so it is NULL
    274         }
    275         hmatice=new Hook(); hmatice->Demarshall(&marshalled_dataset);
    276         hmatpar=new Hook(); hmatpar->Demarshall(&marshalled_dataset);
    277         hneighbors=new Hook(); hneighbors->Demarshall(&marshalled_dataset);
    278 
    279         /*pointers are garbage, until configuration is carried out: */
    280         nodes=NULL;
    281         matice=NULL;
    282         matpar=NULL;
    283         verticalneighbors=NULL;
    284 
    285         /*demarshall inputs and results: */
    286         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    287         results=(Results*)DataSetDemarshallRaw(&marshalled_dataset);
    288 
    289         /*parameters: may not exist even yet, so let Configure handle it: */
    290         this->parameters=NULL;
    291 
    292         /*neighbors: */
    293         memcpy(&this->horizontalneighborsids,marshalled_dataset,3*sizeof(int));marshalled_dataset+=3*sizeof(int);
    294 
    295         /*return: */
    296         *pmarshalled_dataset=marshalled_dataset;
    297         return;
    298 }
    299 /*}}}*/
    300 #endif
    301144
    302145/*Other*/
     
    24212264/*}}}*/
    24222265/*FUNCTION Penta::PositiveDegreeDay{{{1*/
    2423 void  Penta::PositiveDegreeDay(){
    2424 
    2425         _error_("Not implemented yet");
     2266void  Penta::PositiveDegreeDay(double* pdds,double* pds,double signorm){
     2267
     2268
     2269   int    i,iqj,imonth;
     2270   double agd[NUMVERTICES];  // surface and basal
     2271   double saccu[NUMVERTICES] = {0};     // yearly surface accumulation
     2272   double smelt[NUMVERTICES] = {0};     // yearly melt
     2273   double precrunoff[NUMVERTICES];      // yearly runoff
     2274   double prect; // total precipitation during 1 year taking into account des. ef.
     2275   double water; //water=rain + snowmelt
     2276   double runoff; //meltwater only, does not include rain
     2277   double sconv; //rhow_rain/rhoi / 12 months
     2278
     2279   double  rho_water,rho_ice,density;
     2280   double lapser=6.5/1000, sealev=0;    // lapse rate. degrees per meter.
     2281   double desfac = 0.5;                 //desert elevation factor
     2282   double s0p[NUMVERTICES]={0};         //should be set to elevation from precip source
     2283   double s0t[NUMVERTICES]={0};         //should be set to elevation from temperature source
     2284   double st;             // elevation between altitude of the temp record and current altitude
     2285   double sp;             // elevation between altitude of the prec record and current altitude
     2286
     2287
     2288   // PDD and PD constants and variables
     2289   double siglim;          // sigma limit for the integration which is equal to 2.5 sigmanorm
     2290   double siglimc=0, siglim0, siglim0c;
     2291   double PDup, pddsig, PDCUT = 2.0; // PDcut: rain/snow cutoff temperature (C)
     2292   double DT = 0.02;
     2293   double pddt, pd; // pd: snow/precip fraction, precipitation falling as snow
     2294   
     2295   double q, qmpt; // q is desert/elev. fact, hnpfac is huybrect fact, and pd is normal dist.
     2296   double qm[NUMVERTICES] = {0};        // snow part of the precipitation
     2297   double qmt[NUMVERTICES] = {0};       // precipitation without desertification effect adjustment
     2298   double qmp[NUMVERTICES] = {0};       // desertification taken into account
     2299   double pdd[NUMVERTICES] = {0};     
     2300   double frzndd[NUMVERTICES] = {0}; 
     2301
     2302   double tstar;                        // monthly mean surface temp
     2303   double Tsum[NUMVERTICES]= {0};       // average summer (JJA) temperature
     2304   double Tsurf[NUMVERTICES] = {0};     // average annual temperature   
     2305   
     2306   double h[NUMVERTICES],s[NUMVERTICES],ttmp[NUMVERTICES],prectmp[NUMVERTICES]; // ,b[NUMVERTICES]
     2307   double t[NUMVERTICES][12],prec[NUMVERTICES][12];
     2308   double deltm=1/12;
     2309   int    ismon[12]={12,1,2,3,4,5,6,7,8,9,10,11};
     2310
     2311   double snwm;  // snow that could have been melted in a year.
     2312   double snwmf; //  ablation factor for snow per positive degree day.
     2313   double smf;   //  ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002).
     2314
     2315   double dfrz=1.5, CovrLm=2009./3.35e+5, dCovrLm=dfrz*CovrLm; //m*J kg^-1 C^-1 /(J kg^-1)=m/C yr
     2316   double supice,supcap,diffndd;
     2317   double fsupT=0.5,  fsupndd=0.5;  // Tsurf mode factors for supice
     2318   double pddtj[NUMVERTICES], hmx2;
     2319
     2320   /*Recover info at the vertices: */
     2321   GetInputListOnVertices(&h[0],ThicknessEnum);
     2322   GetInputListOnVertices(&s[0],SurfaceEnum);
     2323   GetInputListOnVertices(&ttmp[0],ThermalSpctemperatureEnum);
     2324   GetInputListOnVertices(&prectmp[0],SurfaceforcingsPrecipitationEnum);
     2325
     2326   for(i=0;i<NUMVERTICES;i++) ttmp[i]=ttmp[i]-273.15; // convertion from Kelvin to celcius
     2327
     2328   for(i=0;i<NUMVERTICES;i++)
     2329     for(imonth=0;imonth<12;imonth++){
     2330       t[i][imonth]=ttmp[i];
     2331       prec[i][imonth]=prectmp[i];
     2332   }
     2333
     2334   /*Get material parameters :*/
     2335   rho_ice=matpar->GetRhoIce();
     2336   rho_water=matpar->GetRhoWater();
     2337   density=rho_ice/rho_water;
     2338   
     2339   sconv=(rho_water/rho_ice)/12.; //rhow_rain/rhoi / 12 months
     2340     
     2341     /*PDD constant*/
     2342   siglim = 2.5*signorm;
     2343   siglim0 =  siglim/DT + 0.5;
     2344   siglim0c =  siglimc/DT + 0.5;
     2345   PDup = siglimc+PDCUT;
     2346   
     2347   // seasonal loop
     2348   for (iqj = 0; iqj < 12; iqj++){
     2349     imonth =  ismon[iqj];
     2350     for (i = 0; i < NUMVERTICES; i++){
     2351       st=(s[i]-s0t[i])/1000;
     2352       tstar = t[i][imonth] - lapser *max(st,sealev);
     2353       Tsurf[i] = tstar*deltm+Tsurf[i];       
     2354       
     2355       /*********compute PD ****************/
     2356       if (tstar < PDup){
     2357         pd = 1;
     2358         if (tstar >= -siglimc){ pd = pds[int(tstar/DT + siglim0c)];}}
     2359       else {
     2360         pd = 0;}
     2361       
     2362       /******exp des/elev precip reduction*******/
     2363       sp=(s[i]-s0p[i])/1000; // deselev effect is wrt chng in topo
     2364       if (sp>0.0){q = exp(-desfac*sp);}
     2365       else {q = 1.0;}
     2366       
     2367       qmt[i]= qmt[i] + prec[i][imonth]*sconv;  //*sconv to convert in m of ice equivalent
     2368       qmpt= q*prec[i][imonth]*sconv;           
     2369       qmp[i]= qmp[i] + qmpt;
     2370       qm[i]= qm[i] + qmpt*pd;
     2371       
     2372       /*********compute PDD************/
     2373       // ndd(month)=-(tstar-pdd(month)) since ndd+pdd gives expectation of
     2374       // gaussian=T_m, so ndd=-(Tsurf-pdd)
     2375       if (iqj>6 &&  iqj<10){ Tsum[i]=Tsum[i]+tstar;}
     2376       if (tstar >= siglim) {pdd[i] = pdd[i] + tstar*deltm;}
     2377       else if (tstar> -siglim){
     2378         pddsig=pdds[int(tstar/DT + siglim0)];
     2379         pdd[i] = pdd[i] + pddsig*deltm;
     2380         frzndd[i] = frzndd[i] - (tstar-pddsig)*deltm;}
     2381       else{frzndd[i] = frzndd[i] - tstar*deltm; }
     2382     }
     2383   } // end of seasonal loop
     2384   
     2385   //******************************************************************
     2386   for(i=0;i<NUMVERTICES;i++){
     2387     saccu[i] = qm[i];
     2388     prect = qmp[i];     // total precipitation during 1 year taking into account des. ef.
     2389     Tsum[i]=Tsum[i]/3;
     2390     
     2391     /***** determine PDD factors *****/
     2392     if(Tsum[i]< -1.) {
     2393       snwmf=2.65*0.001;   //  ablation factor for snow per positive degree day.*0.001 to go from mm to m/ppd
     2394       smf=17.22*0.001;    //  ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002)
     2395     }
     2396     else if(Tsum[i]< 10){
     2397       snwmf = (0.15*Tsum[i] + 2.8)*0.001;
     2398       smf = (0.0067*pow((10.-Tsum[i]),3) + 8.3)*0.001;
     2399     }
     2400     else{
     2401       snwmf=4.3*0.001;
     2402       smf=8.3*0.001;
     2403     }
     2404     snwmf=0.95*snwmf;
     2405     smf=0.95*smf;
     2406     
     2407     /*****  compute PDD ablation and refreezing *****/
     2408     pddt = pdd[i] *365;
     2409     snwm = snwmf*pddt;       // snow that could have been melted in a year
     2410     hmx2 = min(h[i],dfrz);   // refreeze active layer max depth: dfrz
     2411     
     2412     if(snwm < saccu[i]) {
     2413       water=prect-saccu[i] + snwm; //water=rain + snowmelt
     2414       //     l 2.2= capillary factor
     2415       //     Should refreezing be controlled by frzndd or by mean annual Tsurf?
     2416       //     dCovrLm concept is of warming of active layer (thickness =d@=1-
     2417       //     >2m)
     2418       //     problem with water seepage into ice: should be sealed after
     2419       //     refreezing
     2420       //     so everything needs to be predicated on 1 year scale, except for
     2421       //     thermal
     2422       //     conductivity through ice
     2423       //     also, need to account that melt season has low accum, so what's
     2424       //     going to
     2425       //     hold the meltwater around for refreezing? And melt-time will have
     2426       //     low seasonal frzndd
     2427       
     2428       //      Superimposed ice :  Pfeffer et al. 1991, Tarasov 2002
     2429       
     2430       supice= min(hmx2*CovrLm*frzndd[i]+2.2*(saccu[i]-snwm), water); // superimposed ice
     2431       supcap=min(2.2*(saccu[i]-snwm),water);
     2432       runoff=snwm - supice;  //meltwater only, does not include rain
     2433     }
     2434     else {  //all snow melted
     2435       supice= min(hmx2*CovrLm*frzndd[i], prect );
     2436       runoff= saccu[i] + smf*(pddt-saccu[i]/snwmf) - supice;
     2437       supcap=0;
     2438     }
     2439     //     pdd melting doesn't cool Tsurf, so ndd refreeze shouldn't warm it
     2440     //     except pdd melt heat source is atmosphere, while refreeze is
     2441     //     ground/ice stored interim
     2442     //     assume pdd=ndd, then melt should equal refreeze and Tsurf should=0
     2443     //     assume ndd=2*pdd, then all supice is refrozen, but Tsurf should be
     2444     //     <0
     2445     //     assume ndd>pdd, little melt => little supice
     2446     //     bottom line: compare for Tsurf<0 : supice and no supice case,
     2447     //     expect Tsurf difference
     2448     //     except some of cooling flux comes from atmosphere//
     2449     //     1 dm supice should not raise Tsurf by 1/dCovrLm = 16.675C
     2450     //     does supice make sense when H< 0.1m? then d=thermoactive ice layer ////
     2451     //     < 0.1
     2452     
     2453     //     make more sense to just use residual pdd-ndd except that pdd
     2454     //     residual not clear yet
     2455     //     frzndd should not be used up by refreezing in snow, so stick in
     2456     //     supcap.
     2457     diffndd=0;
     2458     if (frzndd[i]>0) {
     2459       diffndd=fsupndd*min((supice-supcap)/dCovrLm ,frzndd[i]);
     2460       frzndd[i]=frzndd[i]-diffndd;
     2461     }
     2462     if(runoff<0){
     2463       saccu[i]= saccu[i] -runoff;
     2464       smelt[i] = 0;
     2465       precrunoff[i]=prect-saccu[i];
     2466       //here assume pdd residual is 0, =>
     2467       Tsurf[i]= max(Tsurf[i],-frzndd[i]);
     2468     }
     2469     else {
     2470       smelt[i] = runoff;
     2471       precrunoff[i]=prect-max(0.,supice)-saccu[i];}
     2472     //here really need pdd balance, try 0.5 fudge factor?
     2473     //at least runoff>0 => it's fairly warm, so Tsurf is !<<0,
     2474     //yet from site plots, can be ice free with Tsurf=-5.5C
     2475     if(Tsurf[i]<0) {
     2476       Tsurf[i]= min(Tsurf[i]+fsupT*diffndd , 0.);}
     2477     
     2478     agd[i] = -smelt[i]+saccu[i];
     2479     pddtj[i]=pddt;
     2480     
     2481     /*Update inputs*/   
     2482     this->inputs->AddInput(new PentaP1Input(SurfaceforcingsMassBalanceEnum,&agd[0])); ////////verifier le nom
     2483     // this->inputs->AddInput(new TriaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0]));
     2484     this->inputs->AddInput(new PentaP1Input(ThermalSpctemperatureEnum,&Tsurf[0]));
     2485     
     2486   }       //end of the for loop over the vertices
    24262487}
    24272488/*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Elements/Penta.h

    r11708 r12168  
    5555                int               ObjectEnum();
    5656                int               Id();
    57                 #ifdef _SERIAL_
    58                 void      Marshall(char** pmarshalled_dataset);
    59                 int               MarshallSize();
    60                 void      Demarshall(char** pmarshalled_dataset);
    61                 #endif
    6257                int               MyRank();
    6358                /*}}}*/
     
    112107                void   PatchFill(int* pcount, Patch* patch);
    113108                void   PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes);
    114                 void   PositiveDegreeDay(void);
     109                void   PositiveDegreeDay(double* pdds,double* pds,double signorm);
    115110                void   ProcessResultsUnits(void);
    116111                void   ResetCoordinateSystem(void);
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Elements/Tria.cpp

    r12004 r12168  
    122122}
    123123/*}}}*/
    124 
    125 /*Marshall*/
    126 #ifdef _SERIAL_
    127 /*FUNCTION Tria::Marshall {{{1*/
    128 void  Tria::Marshall(char** pmarshalled_dataset){
    129 
    130         int   i;
    131         char* marshalled_dataset=NULL;
    132         int   enum_type=0;
    133         char* marshalled_inputs=NULL;
    134         int   marshalled_inputs_size;
    135         char* marshalled_results=NULL;
    136         int   marshalled_results_size;
    137         int   flaghook; //to indicate if hook is NULL or exists
    138 
    139         /*recover marshalled_dataset: */
    140         marshalled_dataset=*pmarshalled_dataset;
    141 
    142         /*get enum type of Tria: */
    143         enum_type=TriaEnum;
    144 
    145         /*marshall enum: */
    146         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    147 
    148         /*marshall Tria data: */
    149         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    150         memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
    151         memcpy(marshalled_dataset,&numanalyses,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses);
    152 
    153         /*Mershall Ref: */
    154         for(i=0;i<numanalyses;i++){
    155                 memcpy(marshalled_dataset,&element_type_list[i],sizeof(element_type_list[i]));marshalled_dataset+=sizeof(element_type_list[i]);
    156         }
    157 
    158         /*Marshall hooks: */
    159         for(i=0;i<numanalyses;i++){
    160                 if(hnodes[i]){
    161                         /*Set flag to 1 as there is a hook */
    162                         flaghook=1;
    163                         memcpy(marshalled_dataset,&flaghook,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook);
    164                         hnodes[i]->Marshall(&marshalled_dataset);
    165                 }
    166                 else{
    167                         /*Set flag to 0 and do not marshall flag as there is no Hook */
    168                         flaghook=0;
    169                         memcpy(marshalled_dataset,&flaghook,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook);
    170                 }
    171         }
    172         hmatice->Marshall(&marshalled_dataset);
    173         hmatpar->Marshall(&marshalled_dataset);
    174 
    175         /*Marshall inputs: */
    176         marshalled_inputs_size=inputs->MarshallSize();
    177         marshalled_inputs=inputs->Marshall();
    178         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    179         marshalled_dataset+=marshalled_inputs_size;
    180 
    181         /*Marshall results: */
    182         marshalled_results_size=results->MarshallSize();
    183         marshalled_results=results->Marshall();
    184         memcpy(marshalled_dataset,marshalled_results,marshalled_results_size*sizeof(char));
    185         marshalled_dataset+=marshalled_results_size;
    186 
    187         /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
    188 
    189         xfree((void**)&marshalled_inputs);
    190         xfree((void**)&marshalled_results);
    191 
    192         /*marshall horizontal neighbors: */
    193         memcpy(marshalled_dataset,horizontalneighborsids,3*sizeof(int));marshalled_dataset+=3*sizeof(int);
    194 
    195         *pmarshalled_dataset=marshalled_dataset;
    196         return;
    197 }
    198 /*}}}*/
    199 /*FUNCTION Tria::MarshallSize {{{1*/
    200 int   Tria::MarshallSize(){
    201 
    202         int i;
    203         int hnodes_size=0;;
    204 
    205         for(i=0;i<numanalyses;i++){
    206                 hnodes_size+=sizeof(int); //Flag 0 or 1
    207                 if (hnodes[i]) hnodes_size+=hnodes[i]->MarshallSize();
    208         }
    209 
    210         return sizeof(id)
    211           +sizeof(sid)
    212           +hnodes_size
    213           +sizeof(numanalyses)
    214           +numanalyses*sizeof(int) //element_type_lists
    215           +hmatice->MarshallSize()
    216           +hmatpar->MarshallSize()
    217           +inputs->MarshallSize()
    218           +results->MarshallSize()
    219           +3*sizeof(int)
    220           +sizeof(int); //sizeof(int) for enum type
    221 }
    222 /*}}}*/
    223 /*FUNCTION Tria::Demarshall {{{1*/
    224 void  Tria::Demarshall(char** pmarshalled_dataset){
    225 
    226         char* marshalled_dataset=NULL;
    227         int i;
    228         int flaghook;
    229 
    230         /*recover marshalled_dataset: */
    231         marshalled_dataset=*pmarshalled_dataset;
    232 
    233         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    234          *object data (thanks to DataSet::Demarshall):*/
    235         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    236         memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
    237         memcpy(&numanalyses,marshalled_dataset,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses);
    238 
    239         /*demarshall Ref: */
    240         this->element_type_list=(int*)xmalloc(this->numanalyses*sizeof(int));
    241         for(i=0;i<numanalyses;i++){ memcpy(&element_type_list[i],marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);}
    242 
    243         /*allocate dynamic memory: */
    244         this->hnodes=new Hook*[this->numanalyses];
    245         /*demarshall hooks: */
    246         for(i=0;i<numanalyses;i++){
    247                 memcpy(&flaghook,marshalled_dataset,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook);
    248                 if(flaghook){ // there is a hook so demarshall it
    249                         hnodes[i]=new Hook();
    250                         hnodes[i]->Demarshall(&marshalled_dataset);
    251                 }
    252                 else hnodes[i]=NULL; //There is no hook so it is NULL
    253         }
    254         hmatice=new Hook(); hmatice->Demarshall(&marshalled_dataset);
    255         hmatpar=new Hook(); hmatpar->Demarshall(&marshalled_dataset);
    256 
    257         /*pointers are garbabe, until configuration is carried out: */
    258         nodes=NULL;
    259         matice=NULL;
    260         matpar=NULL;
    261        
    262         /*demarshall inputs: */
    263         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    264         results=(Results*)DataSetDemarshallRaw(&marshalled_dataset);
    265 
    266         /*parameters: may not exist even yet, so let Configure handle it: */
    267         this->parameters=NULL;
    268 
    269         /*neighbors: */
    270         memcpy(&this->horizontalneighborsids,marshalled_dataset,3*sizeof(int));marshalled_dataset+=3*sizeof(int);
    271 
    272         /*return: */
    273         *pmarshalled_dataset=marshalled_dataset;
    274         return;
    275 }
    276 /*}}}*/
    277 #endif
    278124
    279125/*Other*/
     
    22412087/*}}}*/
    22422088/*FUNCTION Tria::PositiveDegreeDay{{{1*/
    2243 void  Tria::PositiveDegreeDay(){
    2244 
    2245         _error_("Not implemented yet");
     2089void  Tria::PositiveDegreeDay(double* pdds,double* pds,double signorm){
     2090
     2091   int    i,iqj,imonth;
     2092   double agd[NUMVERTICES];  // surface and basal
     2093   double saccu[NUMVERTICES] = {0};     // yearly surface accumulation
     2094   double smelt[NUMVERTICES] = {0};     // yearly melt
     2095   double precrunoff[NUMVERTICES];      // yearly runoff
     2096   double prect; // total precipitation during 1 year taking into account des. ef.
     2097   double water; //water=rain + snowmelt
     2098   double runoff; //meltwater only, does not include rain
     2099   double sconv; //rhow_rain/rhoi / 12 months
     2100
     2101   double  rho_water,rho_ice,density;
     2102   double lapser=6.5/1000, sealev=0;    // lapse rate. degrees per meter.
     2103   double desfac = 0.5;                 //desert elevation factor
     2104   double s0p[NUMVERTICES]={0};         //should be set to elevation from precip source
     2105   double s0t[NUMVERTICES]={0};         //should be set to elevation from temperature source
     2106   double st;             // elevation between altitude of the temp record and current altitude
     2107   double sp;             // elevation between altitude of the prec record and current altitude
     2108
     2109
     2110   // PDD and PD constants and variables
     2111   double siglim;          // sigma limit for the integration which is equal to 2.5 sigmanorm
     2112   double siglimc=0, siglim0, siglim0c;
     2113   double PDup, pddsig, PDCUT = 2.0; // PDcut: rain/snow cutoff temperature (C)
     2114   double DT = 0.02;
     2115   double pddt, pd; // pd: snow/precip fraction, precipitation falling as snow
     2116   
     2117   double q, qmpt; // q is desert/elev. fact, hnpfac is huybrect fact, and pd is normal dist.
     2118   double qm[NUMVERTICES] = {0};        // snow part of the precipitation
     2119   double qmt[NUMVERTICES] = {0};       // precipitation without desertification effect adjustment
     2120   double qmp[NUMVERTICES] = {0};       // desertification taken into account
     2121   double pdd[NUMVERTICES] = {0};     
     2122   double frzndd[NUMVERTICES] = {0}; 
     2123
     2124   double tstar;                        // monthly mean surface temp
     2125   double Tsum[NUMVERTICES]= {0};       // average summer (JJA) temperature
     2126   double Tsurf[NUMVERTICES] = {0};     // average annual temperature   
     2127   
     2128   double h[NUMVERTICES],s[NUMVERTICES],ttmp[NUMVERTICES],prectmp[NUMVERTICES]; // ,b[NUMVERTICES]
     2129   double t[NUMVERTICES][12],prec[NUMVERTICES][12];
     2130   double deltm=1/12;
     2131   int    ismon[12]={12,1,2,3,4,5,6,7,8,9,10,11};
     2132
     2133   double snwm;  // snow that could have been melted in a year.
     2134   double snwmf; //  ablation factor for snow per positive degree day.
     2135   double smf;   //  ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002).
     2136
     2137   double dfrz=1.5, CovrLm=2009./3.35e+5, dCovrLm=dfrz*CovrLm; //m*J kg^-1 C^-1 /(J kg^-1)=m/C yr
     2138   double supice,supcap,diffndd;
     2139   double fsupT=0.5,  fsupndd=0.5;  // Tsurf mode factors for supice
     2140   double pddtj[NUMVERTICES], hmx2;
     2141
     2142   /*Recover info at the vertices: */
     2143   GetInputListOnVertices(&h[0],ThicknessEnum);
     2144   GetInputListOnVertices(&s[0],SurfaceEnum);
     2145   GetInputListOnVertices(&ttmp[0],ThermalSpctemperatureEnum);
     2146   GetInputListOnVertices(&prectmp[0],SurfaceforcingsPrecipitationEnum);
     2147
     2148   for(i=0;i<NUMVERTICES;i++) ttmp[i]=ttmp[i]-273.15; // convertion from Kelvin to celcius
     2149
     2150   for(i=0;i<NUMVERTICES;i++)
     2151     for(imonth=0;imonth<12;imonth++){
     2152       t[i][imonth]=ttmp[i];
     2153       prec[i][imonth]=prectmp[i];
     2154   }
     2155
     2156   /*Get material parameters :*/
     2157   rho_ice=matpar->GetRhoIce();
     2158   rho_water=matpar->GetRhoWater();
     2159   density=rho_ice/rho_water;
     2160   
     2161   sconv=(rho_water/rho_ice)/12.; //rhow_rain/rhoi / 12 months
     2162     
     2163     /*PDD constant*/
     2164   siglim = 2.5*signorm;
     2165   siglim0 =  siglim/DT + 0.5;
     2166   siglim0c =  siglimc/DT + 0.5;
     2167   PDup = siglimc+PDCUT;
     2168   
     2169   // seasonal loop
     2170   for (iqj = 0; iqj < 12; iqj++){
     2171     imonth =  ismon[iqj];
     2172     for (i = 0; i < NUMVERTICES; i++){
     2173       st=(s[i]-s0t[i])/1000;
     2174       tstar = t[i][imonth] - lapser *max(st,sealev);
     2175       Tsurf[i] = tstar*deltm+Tsurf[i];       
     2176       
     2177       /*********compute PD ****************/
     2178       if (tstar < PDup){
     2179         pd = 1;
     2180         if (tstar >= -siglimc){ pd = pds[int(tstar/DT + siglim0c)];}}
     2181       else {
     2182         pd = 0;}
     2183       
     2184       /******exp des/elev precip reduction*******/
     2185       sp=(s[i]-s0p[i])/1000; // deselev effect is wrt chng in topo
     2186       if (sp>0.0){q = exp(-desfac*sp);}
     2187       else {q = 1.0;}
     2188       
     2189       qmt[i]= qmt[i] + prec[i][imonth]*sconv;  //*sconv to convert in m of ice equivalent
     2190       qmpt= q*prec[i][imonth]*sconv;           
     2191       qmp[i]= qmp[i] + qmpt;
     2192       qm[i]= qm[i] + qmpt*pd;
     2193       
     2194       /*********compute PDD************/
     2195       // ndd(month)=-(tstar-pdd(month)) since ndd+pdd gives expectation of
     2196       // gaussian=T_m, so ndd=-(Tsurf-pdd)
     2197       if (iqj>6 &&  iqj<10){ Tsum[i]=Tsum[i]+tstar;}
     2198       if (tstar >= siglim) {pdd[i] = pdd[i] + tstar*deltm;}
     2199       else if (tstar> -siglim){
     2200         pddsig=pdds[int(tstar/DT + siglim0)];
     2201         pdd[i] = pdd[i] + pddsig*deltm;
     2202         frzndd[i] = frzndd[i] - (tstar-pddsig)*deltm;}
     2203       else{frzndd[i] = frzndd[i] - tstar*deltm; }
     2204     }
     2205   } // end of seasonal loop
     2206   
     2207   //******************************************************************
     2208   for(i=0;i<NUMVERTICES;i++){
     2209     saccu[i] = qm[i];
     2210     prect = qmp[i];     // total precipitation during 1 year taking into account des. ef.
     2211     Tsum[i]=Tsum[i]/3;
     2212     
     2213     /***** determine PDD factors *****/
     2214     if(Tsum[i]< -1.) {
     2215       snwmf=2.65*0.001;   //  ablation factor for snow per positive degree day.*0.001 to go from mm to m/ppd
     2216       smf=17.22*0.001;    //  ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002)
     2217     }
     2218     else if(Tsum[i]< 10){
     2219       snwmf = (0.15*Tsum[i] + 2.8)*0.001;
     2220       smf = (0.0067*pow((10.-Tsum[i]),3) + 8.3)*0.001;
     2221     }
     2222     else{
     2223       snwmf=4.3*0.001;
     2224       smf=8.3*0.001;
     2225     }
     2226     snwmf=0.95*snwmf;
     2227     smf=0.95*smf;
     2228     
     2229     /*****  compute PDD ablation and refreezing *****/
     2230     pddt = pdd[i] *365;
     2231     snwm = snwmf*pddt;       // snow that could have been melted in a year
     2232     hmx2 = min(h[i],dfrz);   // refreeze active layer max depth: dfrz
     2233     
     2234     if(snwm < saccu[i]) {
     2235       water=prect-saccu[i] + snwm; //water=rain + snowmelt
     2236       //     l 2.2= capillary factor
     2237       //     Should refreezing be controlled by frzndd or by mean annual Tsurf?
     2238       //     dCovrLm concept is of warming of active layer (thickness =d@=1-
     2239       //     >2m)
     2240       //     problem with water seepage into ice: should be sealed after
     2241       //     refreezing
     2242       //     so everything needs to be predicated on 1 year scale, except for
     2243       //     thermal
     2244       //     conductivity through ice
     2245       //     also, need to account that melt season has low accum, so what's
     2246       //     going to
     2247       //     hold the meltwater around for refreezing? And melt-time will have
     2248       //     low seasonal frzndd
     2249       
     2250       //      Superimposed ice :  Pfeffer et al. 1991, Tarasov 2002
     2251       
     2252       supice= min(hmx2*CovrLm*frzndd[i]+2.2*(saccu[i]-snwm), water); // superimposed ice
     2253       supcap=min(2.2*(saccu[i]-snwm),water);
     2254       runoff=snwm - supice;  //meltwater only, does not include rain
     2255     }
     2256     else {  //all snow melted
     2257       supice= min(hmx2*CovrLm*frzndd[i], prect );
     2258       runoff= saccu[i] + smf*(pddt-saccu[i]/snwmf) - supice;
     2259       supcap=0;
     2260     }
     2261     //     pdd melting doesn't cool Tsurf, so ndd refreeze shouldn't warm it
     2262     //     except pdd melt heat source is atmosphere, while refreeze is
     2263     //     ground/ice stored interim
     2264     //     assume pdd=ndd, then melt should equal refreeze and Tsurf should=0
     2265     //     assume ndd=2*pdd, then all supice is refrozen, but Tsurf should be
     2266     //     <0
     2267     //     assume ndd>pdd, little melt => little supice
     2268     //     bottom line: compare for Tsurf<0 : supice and no supice case,
     2269     //     expect Tsurf difference
     2270     //     except some of cooling flux comes from atmosphere//
     2271     //     1 dm supice should not raise Tsurf by 1/dCovrLm = 16.675C
     2272     //     does supice make sense when H< 0.1m? then d=thermoactive ice layer ////
     2273     //     < 0.1
     2274     
     2275     //     make more sense to just use residual pdd-ndd except that pdd
     2276     //     residual not clear yet
     2277     //     frzndd should not be used up by refreezing in snow, so stick in
     2278     //     supcap.
     2279     diffndd=0;
     2280     if (frzndd[i]>0) {
     2281       diffndd=fsupndd*min((supice-supcap)/dCovrLm ,frzndd[i]);
     2282       frzndd[i]=frzndd[i]-diffndd;
     2283     }
     2284     if(runoff<0){
     2285       saccu[i]= saccu[i] -runoff;
     2286       smelt[i] = 0;
     2287       precrunoff[i]=prect-saccu[i];
     2288       //here assume pdd residual is 0, =>
     2289       Tsurf[i]= max(Tsurf[i],-frzndd[i]);
     2290     }
     2291     else {
     2292       smelt[i] = runoff;
     2293       precrunoff[i]=prect-max(0.,supice)-saccu[i];}
     2294     //here really need pdd balance, try 0.5 fudge factor?
     2295     //at least runoff>0 => it's fairly warm, so Tsurf is !<<0,
     2296     //yet from site plots, can be ice free with Tsurf=-5.5C
     2297     if(Tsurf[i]<0) {
     2298       Tsurf[i]= min(Tsurf[i]+fsupT*diffndd , 0.);}
     2299     
     2300     agd[i] = -smelt[i]+saccu[i];
     2301     pddtj[i]=pddt;
     2302     
     2303     /*Update inputs*/   
     2304     this->inputs->AddInput(new TriaP1Input(SurfaceforcingsMassBalanceEnum,&agd[0])); ////////verifier le nom
     2305     // this->inputs->AddInput(new TriaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0]));
     2306     this->inputs->AddInput(new TriaP1Input(ThermalSpctemperatureEnum,&Tsurf[0]));
     2307     
     2308   }       //end of the for loop over the vertices
    22462309}
    22472310/*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Elements/Tria.h

    r11708 r12168  
    5151                int   Id();
    5252                int   MyRank();
    53                 #ifdef _SERIAL_
    54                 void  Marshall(char** pmarshalled_dataset);
    55                 int   MarshallSize();
    56                 void  Demarshall(char** pmarshalled_dataset);
    57                 #endif
    5853                int   ObjectEnum();
    5954                Object* copy();
     
    108103                int    NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units);
    109104                void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding);
    110                 void   PositiveDegreeDay(void);
     105                void   PositiveDegreeDay(double* pdds,double* pds,double signorm);
    111106                void   RequestedOutput(int output_enum,int step,double time);
    112107                void   ListResultsInfo(int** results_enums,int** results_size,double** results_times,int** results_steps,int* num_results);
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ExternalResults/BoolExternalResult.cpp

    r12004 r12168  
    6868}
    6969/*}}}*/
    70 #ifdef _SERIAL_
    71 /*FUNCTION BoolExternalResult::Marshall{{{1*/
    72 void  BoolExternalResult::Marshall(char** pmarshalled_dataset){
    73 
    74         char* marshalled_dataset=NULL;
    75         int   enum_value=0;
    76 
    77         /*recover marshalled_dataset: */
    78         marshalled_dataset=*pmarshalled_dataset;
    79 
    80         /*get enum value of BoolExternalResult: */
    81         enum_value=BoolExternalResultEnum;
    82        
    83         /*marshall enum: */
    84         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    85        
    86         /*marshall BoolExternalResult data: */
    87         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    88         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    89         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    90         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    91         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    92 
    93         *pmarshalled_dataset=marshalled_dataset;
    94 }
    95 /*}}}*/
    96 /*FUNCTION BoolExternalResult::MarshallSize{{{1*/
    97 int   BoolExternalResult::MarshallSize(){
    98        
    99         return sizeof(value)+
    100                 +sizeof(id)
    101                 +sizeof(enum_type)
    102                 +sizeof(step)
    103                 +sizeof(time)
    104                 +sizeof(int); //sizeof(int) for enum value
    105 }
    106 /*}}}*/
    107 /*FUNCTION BoolExternalResult::Demarshall{{{1*/
    108 void  BoolExternalResult::Demarshall(char** pmarshalled_dataset){
    109 
    110         char* marshalled_dataset=NULL;
    111         int   i;
    112 
    113         /*recover marshalled_dataset: */
    114         marshalled_dataset=*pmarshalled_dataset;
    115 
    116         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    117          *object data (thanks to DataSet::Demarshall):*/
    118         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    119         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    120         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    121         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    122         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    123 
    124         /*return: */
    125         *pmarshalled_dataset=marshalled_dataset;
    126         return;
    127 }
    128 /*}}}*/
    129 #endif
    13070/*FUNCTION BoolExternalResult::ObjectEnum{{{1*/
    13171int BoolExternalResult::ObjectEnum(void){
     
    185125}
    186126/*}}}*/
    187 /*FUNCTION BoolExternalResult::SetMatlabField{{{1*/
    188 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    189 void BoolExternalResult::SetMatlabField(mxArray* dataref){
    190 
    191         char* name=NULL;
    192         this->GetResultName(&name);
    193        
    194         mxSetField( dataref, this->step-1, name,mxCreateDoubleScalar((double)value));
    195         mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
    196         mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
    197 }
    198 #endif
    199 /*}}}*/
    200127/*FUNCTION BoolExternalResult::GetStep{{{1*/
    201128int BoolExternalResult::GetStep(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ExternalResults/BoolExternalResult.h

    r12004 r12168  
    1515#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    1616#endif
    17 
    18 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    19 #include <mex.h>
    20 #endif
    21 
    2217
    2318#include "./ExternalResult.h"
     
    4742                int   Id();
    4843                int   MyRank();
    49                 #ifdef _SERIAL_
    50                 void  Marshall(char** pmarshalled_dataset);
    51                 int   MarshallSize();
    52                 void  Demarshall(char** pmarshalled_dataset);
    53                 #endif
    5444                int   ObjectEnum();
    5545                Object* copy();
     
    5949                void  WriteData(FILE* fid,bool io_gather);
    6050                void  GetResultName(char**);
    61             #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    62                 void  SetMatlabField(mxArray* dataref);
    63                 #endif
    6451                int   GetStep(void);
    6552                /*}}}*/
    6653};
    67 #endif  /* _BOOLEXTERNALRESULT_H */
     54#endif
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ExternalResults/DoubleExternalResult.cpp

    r12004 r12168  
    6868}
    6969/*}}}*/
    70 #ifdef _SERIAL_
    71 /*FUNCTION DoubleExternalResult::Marshall{{{1*/
    72 void  DoubleExternalResult::Marshall(char** pmarshalled_dataset){
    73 
    74         char* marshalled_dataset=NULL;
    75         int   enum_value=0;
    76 
    77         /*recover marshalled_dataset: */
    78         marshalled_dataset=*pmarshalled_dataset;
    79 
    80         /*get enum value of DoubleExternalResult: */
    81         enum_value=DoubleExternalResultEnum;
    82        
    83         /*marshall enum: */
    84         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    85        
    86         /*marshall DoubleExternalResult data: */
    87         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    88         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    89         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    90         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    91         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    92 
    93         *pmarshalled_dataset=marshalled_dataset;
    94 }
    95 /*}}}*/
    96 /*FUNCTION DoubleExternalResult::MarshallSize{{{1*/
    97 int   DoubleExternalResult::MarshallSize(){
    98        
    99         return sizeof(value)+
    100                 +sizeof(id)
    101                 +sizeof(enum_type)
    102                 +sizeof(step)
    103                 +sizeof(time)
    104                 +sizeof(int); //sizeof(int) for enum value
    105 }
    106 /*}}}*/
    107 /*FUNCTION DoubleExternalResult::Demarshall{{{1*/
    108 void  DoubleExternalResult::Demarshall(char** pmarshalled_dataset){
    109 
    110         char* marshalled_dataset=NULL;
    111         int   i;
    112 
    113         /*recover marshalled_dataset: */
    114         marshalled_dataset=*pmarshalled_dataset;
    115 
    116         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    117          *object data (thanks to DataSet::Demarshall):*/
    118         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    119         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    120         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    121         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    122         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    123 
    124         /*return: */
    125         *pmarshalled_dataset=marshalled_dataset;
    126         return;
    127 }
    128 /*}}}*/
    129 #endif
    13070/*FUNCTION DoubleExternalResult::ObjectEnum{{{1*/
    13171int DoubleExternalResult::ObjectEnum(void){
     
    181121}
    182122/*}}}*/
    183 /*FUNCTION DoubleExternalResult::SetMatlabField{{{1*/
    184 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    185 void DoubleExternalResult::SetMatlabField(mxArray* dataref){
    186 
    187         char* name=NULL;
    188         this->GetResultName(&name);
    189         mxSetField( dataref,this->step-1, name,mxCreateDoubleScalar(value));
    190         mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
    191         mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
    192 
    193 }
    194 #endif
    195 /*}}}*/
    196123/*FUNCTION DoubleExternalResult::GetStep{{{1*/
    197124int DoubleExternalResult::GetStep(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ExternalResults/DoubleExternalResult.h

    r12004 r12168  
    1414#else
    1515#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    16 #endif
    17 
    18 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    19 #include <mex.h>
    2016#endif
    2117
     
    4844                int   Id();
    4945                int   MyRank();
    50                 #ifdef _SERIAL_
    51                 void  Marshall(char** pmarshalled_dataset);
    52                 int   MarshallSize();
    53                 void  Demarshall(char** pmarshalled_dataset);
    54                 #endif
    5546                int   ObjectEnum();
    5647                Object* copy();
     
    6051                void  WriteData(FILE* fid,bool io_gather);
    6152                void  GetResultName(char**);
    62                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    63                 void  SetMatlabField(mxArray* dataref);
    64                 #endif
    6553                int   GetStep(void);
    6654                /*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp

    r12004 r12168  
    9696}
    9797/*}}}*/
    98 #ifdef _SERIAL_
    99 /*FUNCTION DoubleMatExternalResult::Marshall{{{1*/
    100 void  DoubleMatExternalResult::Marshall(char** pmarshalled_dataset){
    101 
    102         char* marshalled_dataset=NULL;
    103         int   enum_value=0;
    104 
    105         /*recover marshalled_dataset: */
    106         marshalled_dataset=*pmarshalled_dataset;
    107 
    108         /*get enum value of DoubleMatExternalResult: */
    109         enum_value=DoubleMatExternalResultEnum;
    110        
    111         /*marshall enum: */
    112         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    113        
    114         /*marshall DoubleMatExternalResult data: */
    115         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    116         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    117         memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    118         memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
    119         memcpy(marshalled_dataset,values,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
    120         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    121         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    122 
    123         *pmarshalled_dataset=marshalled_dataset;
    124 }
    125 /*}}}*/
    126 /*FUNCTION DoubleMatExternalResult::MarshallSize{{{1*/
    127 int   DoubleMatExternalResult::MarshallSize(){
    128        
    129         return sizeof(M)
    130                 +sizeof(N)
    131                 +M*N*sizeof(double)
    132                 +sizeof(id)
    133                 +sizeof(enum_type)
    134                 +sizeof(step)
    135                 +sizeof(time)
    136                 +sizeof(int); //sizeof(int) for enum value
    137 }
    138 /*}}}*/
    139 /*FUNCTION DoubleMatExternalResult::Demarshall{{{1*/
    140 void  DoubleMatExternalResult::Demarshall(char** pmarshalled_dataset){
    141 
    142         char* marshalled_dataset=NULL;
    143         int   i;
    144 
    145         /*recover marshalled_dataset: */
    146         marshalled_dataset=*pmarshalled_dataset;
    147 
    148         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    149          *object data (thanks to DataSet::Demarshall):*/
    150         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    151         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    152        
    153         /*data: */
    154         memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    155         memcpy(&N,marshalled_dataset,sizeof(N));marshalled_dataset+=sizeof(N);
    156         values=(double*)xmalloc(M*N*sizeof(double));
    157         memcpy(values,marshalled_dataset,M*N*sizeof(double));marshalled_dataset+=M*N*sizeof(double);
    158         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    159         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    160 
    161         /*return: */
    162         *pmarshalled_dataset=marshalled_dataset;
    163         return;
    164 }
    165 /*}}}*/
    166 #endif
    16798/*FUNCTION DoubleMatExternalResult::ObjectEnum{{{1*/
    16899int DoubleMatExternalResult::ObjectEnum(void){
     
    222153}
    223154/*}}}*/
    224 /*FUNCTION DoubleMatExternalResult::SetMatlabField{{{1*/
    225 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    226 void DoubleMatExternalResult::SetMatlabField(mxArray* dataref){
    227 
    228         mxArray* pfield=NULL;
    229         mxArray* pfield2=NULL;
    230         char* name=NULL;
    231         double* doublemat=NULL;
    232 
    233         /*Make a copy of the value, to be used by matlab: */
    234         doublemat=(double*)xmalloc(M*N*sizeof(double));
    235         memcpy(doublemat,values,M*N*sizeof(double));
    236 
    237         /*recover name: */
    238         this->GetResultName(&name);
    239                                
    240         /*create matlab matrix: */
    241         pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    242         mxSetM(pfield,N);
    243         mxSetN(pfield,M);
    244         mxSetPr(pfield,doublemat);
    245        
    246         /*transpose the matrix, from c to matlab format */
    247         mexCallMATLAB(1,&pfield2, 1, &pfield, "transpose");
    248 
    249         /*set tranpose matrix inside the dataref structure: */
    250         mxSetField( dataref, this->step-1, name,pfield2);
    251         mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
    252         mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
    253 
    254 }
    255 #endif
    256 /*}}}*/
    257155/*FUNCTION DoubleMatExternalResult::GetStep{{{1*/
    258156int DoubleMatExternalResult::GetStep(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ExternalResults/DoubleMatExternalResult.h

    r12004 r12168  
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    1515#endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    19 #endif
    20 
    2116
    2217#include "./ExternalResult.h"
     
    4944                int   Id();
    5045                int   MyRank();
    51                 #ifdef _SERIAL_
    52                 void  Marshall(char** pmarshalled_dataset);
    53                 int   MarshallSize();
    54                 void  Demarshall(char** pmarshalled_dataset);
    55                 #endif
    5646                int   ObjectEnum();
    5747                Object* copy();
     
    6151                void  WriteData(FILE* fid,bool io_gather);
    6252                void  GetResultName(char**);
    63                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    64                 void  SetMatlabField(mxArray* dataref);
    65                 #endif
    6653                int   GetStep(void);
    6754                /*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp

    r12004 r12168  
    8787}
    8888/*}}}*/
    89 #ifdef _SERIAL_
    90 /*FUNCTION DoubleVecExternalResult::Marshall{{{1*/
    91 void  DoubleVecExternalResult::Marshall(char** pmarshalled_dataset){
    92 
    93         char* marshalled_dataset=NULL;
    94         int   enum_value=0;
    95 
    96         /*recover marshalled_dataset: */
    97         marshalled_dataset=*pmarshalled_dataset;
    98 
    99         /*get enum value of DoubleVecExternalResult: */
    100         enum_value=DoubleVecExternalResultEnum;
    101        
    102         /*marshall enum: */
    103         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    104        
    105         /*marshall DoubleVecExternalResult data: */
    106         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    107         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    108         memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    109         memcpy(marshalled_dataset,values,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
    110         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    111         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    112 
    113         *pmarshalled_dataset=marshalled_dataset;
    114 }
    115 /*}}}*/
    116 /*FUNCTION DoubleVecExternalResult::MarshallSize{{{1*/
    117 int   DoubleVecExternalResult::MarshallSize(){
    118        
    119         return sizeof(M)
    120                 +M*sizeof(double)
    121                 +sizeof(id)
    122                 +sizeof(enum_type)
    123                 +sizeof(step)
    124                 +sizeof(time)
    125                 +sizeof(int); //sizeof(int) for enum value
    126 }
    127 /*}}}*/
    128 /*FUNCTION DoubleVecExternalResult::Demarshall{{{1*/
    129 void  DoubleVecExternalResult::Demarshall(char** pmarshalled_dataset){
    130 
    131         char* marshalled_dataset=NULL;
    132         int   i;
    133 
    134         /*recover marshalled_dataset: */
    135         marshalled_dataset=*pmarshalled_dataset;
    136 
    137         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    138          *object data (thanks to DataSet::Demarshall):*/
    139         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    140         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    141        
    142         /*data: */
    143         memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    144         values=(double*)xmalloc(M*sizeof(double));
    145         memcpy(values,marshalled_dataset,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
    146         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    147         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    148 
    149         /*return: */
    150         *pmarshalled_dataset=marshalled_dataset;
    151         return;
    152 }
    153 /*}}}*/
    154 #endif
    15589/*FUNCTION DoubleVecExternalResult::ObjectEnum{{{1*/
    15690int DoubleVecExternalResult::ObjectEnum(void){
     
    206140}
    207141/*}}}*/
    208 /*FUNCTION DoubleVecExternalResult::SetMatlabField{{{1*/
    209 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    210 void DoubleVecExternalResult::SetMatlabField(mxArray* dataref){
    211 
    212         mxArray *pfield    = NULL;
    213         double  *doublemat = NULL;
    214         char    *name      = NULL;
    215         double  *doublevec = NULL;
    216 
    217         /*Make a copy of the value, to be used by matlab: */
    218         doublevec=(double*)xmalloc(M*sizeof(double));
    219         memcpy(doublevec,values,M*sizeof(double));
    220 
    221         /*recover name: */
    222         this->GetResultName(&name);
    223                                
    224         /*create matlab matrix: */
    225         pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    226         mxSetM(pfield,M);
    227         mxSetN(pfield,1);
    228         mxSetPr(pfield,doublevec);
    229 
    230         mxSetField( dataref, this->step-1, name,pfield);
    231         mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
    232         mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
    233 }
    234 #endif
    235 /*}}}*/
    236142/*FUNCTION DoubleVecExternalResult::GetStep{{{1*/
    237143int DoubleVecExternalResult::GetStep(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ExternalResults/DoubleVecExternalResult.h

    r12004 r12168  
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    1515#endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    19 #endif
    20 
    2116
    2217#include "./ExternalResult.h"
     
    4843                int   Id();
    4944                int   MyRank();
    50                 #ifdef _SERIAL_
    51                 void  Marshall(char** pmarshalled_dataset);
    52                 int   MarshallSize();
    53                 void  Demarshall(char** pmarshalled_dataset);
    54                 #endif
    5545                int   ObjectEnum();
    5646                Object* copy();
     
    6050                void  WriteData(FILE* fid,bool io_gather);
    6151                void  GetResultName(char**);
    62                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    63                 void  SetMatlabField(mxArray* dataref);
    64                 #endif
    6552                int   GetStep(void);
    6653                /*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ExternalResults/ExternalResult.h

    r12004 r12168  
    1616#endif
    1717
    18 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    19 #include <mex.h>
    20 #endif
    21 
    2218#include "../Object.h"
    2319#include "../Node.h"
     
    3329                virtual void  WriteData(FILE* fid,bool io_gather)=0;
    3430                virtual void  GetResultName(char**)=0;
    35                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    36                 virtual void  SetMatlabField(mxArray* dataref)=0;
    37                 #endif
    3831                virtual int   GetStep(void)=0;
    3932                /*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ExternalResults/IntExternalResult.cpp

    r12004 r12168  
    6868}
    6969/*}}}*/
    70 #ifdef _SERIAL_
    71 /*FUNCTION IntExternalResult::Marshall{{{1*/
    72 void  IntExternalResult::Marshall(char** pmarshalled_dataset){
    73 
    74         char* marshalled_dataset=NULL;
    75         int   enum_value=0;
    76 
    77         /*recover marshalled_dataset: */
    78         marshalled_dataset=*pmarshalled_dataset;
    79 
    80         /*get enum value of IntExternalResult: */
    81         enum_value=IntExternalResultEnum;
    82        
    83         /*marshall enum: */
    84         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    85        
    86         /*marshall IntExternalResult data: */
    87         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    88         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    89         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    90         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    91         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    92 
    93         *pmarshalled_dataset=marshalled_dataset;
    94 }
    95 /*}}}*/
    96 /*FUNCTION IntExternalResult::MarshallSize{{{1*/
    97 int   IntExternalResult::MarshallSize(){
    98        
    99         return sizeof(value)+
    100                 +sizeof(id)
    101                 +sizeof(enum_type)
    102                 +sizeof(step)
    103                 +sizeof(time)
    104                 +sizeof(int); //sizeof(int) for enum value
    105 }
    106 /*}}}*/
    107 /*FUNCTION IntExternalResult::Demarshall{{{1*/
    108 void  IntExternalResult::Demarshall(char** pmarshalled_dataset){
    109 
    110         char* marshalled_dataset=NULL;
    111         int   i;
    112 
    113         /*recover marshalled_dataset: */
    114         marshalled_dataset=*pmarshalled_dataset;
    115 
    116         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    117          *object data (thanks to DataSet::Demarshall):*/
    118         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    119         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    120         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    121         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    122         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    123 
    124         /*return: */
    125         *pmarshalled_dataset=marshalled_dataset;
    126         return;
    127 }
    128 /*}}}*/
    129 #endif
    13070/*FUNCTION IntExternalResult::ObjectEnum{{{1*/
    13171int IntExternalResult::ObjectEnum(void){
     
    185125}
    186126/*}}}*/
    187 /*FUNCTION IntExternalResult::SetMatlabField{{{1*/
    188 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    189 void IntExternalResult::SetMatlabField(mxArray* dataref){
    190 
    191         char* name=NULL;
    192         this->GetResultName(&name);
    193 
    194         mxSetField( dataref, this->step-1, name,mxCreateDoubleScalar(value));
    195         mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
    196         mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
    197 
    198 }
    199 #endif
    200 /*}}}*/
    201127/*FUNCTION IntExternalResult::GetStep{{{1*/
    202128int IntExternalResult::GetStep(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ExternalResults/IntExternalResult.h

    r12004 r12168  
    1414#else
    1515#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    16 #endif
    17 
    18 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    19 #include <mex.h>
    2016#endif
    2117
     
    4642                int   Id();
    4743                int   MyRank();
    48                 #ifdef _SERIAL_
    49                 void  Marshall(char** pmarshalled_dataset);
    50                 int   MarshallSize();
    51                 void  Demarshall(char** pmarshalled_dataset);
    52                 #endif
    5344                int   ObjectEnum();
    5445                Object* copy();
     
    5849                void  WriteData(FILE* fid,bool io_gather);
    5950                void  GetResultName(char**);
    60                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    61                 void  SetMatlabField(mxArray* dataref);
    62                 #endif
    6351                int   GetStep(void);
    6452                /*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ExternalResults/PetscVecExternalResult.cpp

    r12004 r12168  
    8080}
    8181/*}}}*/
    82 #ifdef _SERIAL_
    83 /*FUNCTION PetscVecExternalResult::Marshall{{{1*/
    84 void  PetscVecExternalResult::Marshall(char** pmarshalled_dataset){
    85 
    86         char* marshalled_dataset=NULL;
    87         int   enum_value=0;
    88         int   M;
    89         double* serial_value=NULL;
    90 
    91         /*recover marshalled_dataset: */
    92         marshalled_dataset=*pmarshalled_dataset;
    93 
    94         /*get enum value of PetscVecExternalResult: */
    95         enum_value=PetscVecExternalResultEnum;
    96        
    97         /*marshall enum: */
    98         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    99        
    100         /*marshall PetscVecExternalResult data: */
    101         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    102         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    103         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    104         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    105        
    106         if(value){
    107                 VecGetSize(value,&M);
    108                 VecToMPISerial(&serial_value,value);
    109                 memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    110                 memcpy(marshalled_dataset,serial_value,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
    111         }
    112         else{
    113                 M=0;
    114                 memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    115         }
    116         /*Free ressources:*/
    117         xfree((void**)&serial_value);
    118 
    119         /*return:*/
    120         *pmarshalled_dataset=marshalled_dataset;
    121 }
    122 /*}}}*/
    123 /*FUNCTION PetscVecExternalResult::MarshallSize{{{1*/
    124 int   PetscVecExternalResult::MarshallSize(){
    125 
    126         int M=0;
    127         if(value)VecGetSize(value,&M);
    128 
    129         return sizeof(M)+M*sizeof(double)
    130                 +sizeof(id)
    131                 +sizeof(enum_type)
    132                 +sizeof(step)
    133                 +sizeof(time)
    134                 +sizeof(int); //sizeof(int) for enum value
    135 }
    136 /*}}}*/
    137 /*FUNCTION PetscVecExternalResult::Demarshall{{{1*/
    138 void  PetscVecExternalResult::Demarshall(char** pmarshalled_dataset){
    139 
    140         char* marshalled_dataset=NULL;
    141         int   i;
    142         int   M;
    143         double* serial_vec=NULL;
    144         int*    idxm=NULL;
    145 
    146         /*recover marshalled_dataset: */
    147         marshalled_dataset=*pmarshalled_dataset;
    148 
    149         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    150          *object data (thanks to DataSet::Demarshall):*/
    151         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    152         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    153        
    154         /*data: */
    155         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    156         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    157        
    158         memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    159         if(M){
    160                 serial_vec=(double*)xmalloc(M*sizeof(double));
    161                 memcpy(serial_vec,marshalled_dataset,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
    162 
    163                 value=NewVec(M);
    164                 idxm=(int*)xmalloc(M*sizeof(int));
    165                 for(i=0;i<M;i++)idxm[i]=i;
    166                 VecSetValues(value,M,idxm,serial_vec,INSERT_VALUES);
    167 
    168                 VecAssemblyBegin(value);
    169                 VecAssemblyEnd(value);
    170 
    171                
    172         }
    173         else{
    174                 value=NULL;
    175         }
    176 
    177         /*Free ressources:*/
    178         xfree((void**)&serial_vec);
    179         xfree((void**)&idxm);
    180 
    181         /*return: */
    182         *pmarshalled_dataset=marshalled_dataset;
    183 }
    184 /*}}}*/
    185 #endif
    18682/*FUNCTION PetscVecExternalResult::ObjectEnum{{{1*/
    18783int PetscVecExternalResult::ObjectEnum(void){
     
    244140}
    245141/*}}}*/
    246 /*FUNCTION PetscVecExternalResult::SetMatlabField{{{1*/
    247 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    248 void  PetscVecExternalResult::SetMatlabField(mxArray* dataref){
    249 
    250         mxArray* pfield=NULL;
    251         char* name=NULL;
    252         double* doublevec=NULL;
    253         int M;
    254        
    255         VecToMPISerial(&doublevec,value);
    256         VecGetSize(value,&M);
    257         this->GetResultName(&name);
    258        
    259         pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    260         mxSetM(pfield,M);
    261         mxSetN(pfield,1);
    262         mxSetPr(pfield,doublevec);
    263        
    264         mxSetField( dataref, this->step-1, name, pfield);
    265         mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
    266         mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
    267 
    268 }
    269 #endif
    270 /*}}}*/
    271142/*FUNCTION PetscVecExternalResult::GetStep{{{1*/
    272143int PetscVecExternalResult::GetStep(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ExternalResults/PetscVecExternalResult.h

    r12004 r12168  
    1515#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    1616#endif
    17 
    18 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    19 #include <mex.h>
    20 #endif
    21 
    2217
    2318#include "./ExternalResult.h"
     
    4843                int   Id();
    4944                int   MyRank();
    50                 #ifdef _SERIAL_
    51                 void  Marshall(char** pmarshalled_dataset);
    52                 int   MarshallSize();
    53                 void  Demarshall(char** pmarshalled_dataset);
    54                 #endif
    5545                int   ObjectEnum();
    5646                Object* copy();
     
    6050                void  WriteData(FILE* fid,bool io_gather);
    6151                void  GetResultName(char**);
    62                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    63                 void  SetMatlabField(mxArray* dataref);
    64                 #endif
    6552                int   GetStep(void);
    6653                /*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ExternalResults/StringExternalResult.cpp

    r12004 r12168  
    7171}
    7272/*}}}*/
    73 #ifdef _SERIAL_
    74 /*FUNCTION StringExternalResult::Marshall{{{1*/
    75 void  StringExternalResult::Marshall(char** pmarshalled_dataset){
    76 
    77         char* marshalled_dataset=NULL;
    78         int   enum_value=0;
    79         int   stringsize;
    80 
    81         /*recover marshalled_dataset: */
    82         marshalled_dataset=*pmarshalled_dataset;
    83 
    84         /*get enum value of StringExternalResult: */
    85         enum_value=StringExternalResultEnum;
    86        
    87         /*marshall enum: */
    88         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    89 
    90         /*marshall data: */
    91         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    92         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    93         stringsize=strlen(this->value)+1;
    94        
    95         memcpy(marshalled_dataset,&stringsize,sizeof(stringsize));marshalled_dataset+=sizeof(stringsize);
    96         memcpy(marshalled_dataset,this->value,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
    97         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    98         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    99 
    100         *pmarshalled_dataset=marshalled_dataset;
    101 }
    102 /*}}}*/
    103 /*FUNCTION StringExternalResult::MarshallSize{{{1*/
    104 int   StringExternalResult::MarshallSize(){
    105 
    106         int stringsize;
    107         stringsize=strlen(this->value)+1;
    108        
    109         return sizeof(int)+
    110                 +stringsize*sizeof(char)
    111                 +sizeof(id)
    112                 +sizeof(enum_type)
    113                 +sizeof(step)
    114                 +sizeof(time)
    115                 +sizeof(int); //sizeof(int) for enum value
    116 }
    117 /*}}}*/
    118 /*FUNCTION StringExternalResult::Demarshall{{{1*/
    119 void  StringExternalResult::Demarshall(char** pmarshalled_dataset){
    120 
    121         char* marshalled_dataset=NULL;
    122         int   i;
    123         int   stringsize;
    124 
    125         /*recover marshalled_dataset: */
    126         marshalled_dataset=*pmarshalled_dataset;
    127 
    128         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    129          *object data (thanks to DataSet::Demarshall):*/
    130         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    131         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    132 
    133         memcpy(&stringsize,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
    134        
    135         this->value=(char*)xmalloc(stringsize*sizeof(char));
    136         memcpy(value,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
    137         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    138         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    139 
    140         /*return: */
    141         *pmarshalled_dataset=marshalled_dataset;
    142         return;
    143 }
    144 /*}}}*/
    145 #endif
    14673/*FUNCTION StringExternalResult::ObjectEnum{{{1*/
    14774int StringExternalResult::ObjectEnum(void){
     
    197124}
    198125/*}}}*/
    199 /*FUNCTION StringExternalResult::SetMatlabField{{{1*/
    200 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    201 void  StringExternalResult::SetMatlabField(mxArray* dataref){
    202        
    203         char* name=NULL;
    204 
    205         this->GetResultName(&name);
    206 
    207         mxSetField( dataref, this->step-1, name, mxCreateString(value));
    208         mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
    209         mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
    210 
    211 }
    212 #endif
    213 /*}}}*/
    214126/*FUNCTION StringExternalResult::GetStep{{{1*/
    215127int StringExternalResult::GetStep(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/ExternalResults/StringExternalResult.h

    r12004 r12168  
    1515#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    1616#endif
    17 
    18 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    19 #include <mex.h>
    20 #endif
    21 
    2217
    2318#include "./ExternalResult.h"
     
    4843                int   Id();
    4944                int   MyRank();
    50                 #ifdef _SERIAL_
    51                 void  Marshall(char** pmarshalled_dataset);
    52                 int   MarshallSize();
    53                 void  Demarshall(char** pmarshalled_dataset);
    54                 #endif
    5545                int   ObjectEnum();
    5646                Object* copy();
     
    6050                void  WriteData(FILE* fid,bool io_gather);
    6151                void  GetResultName(char**);
    62                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    63                 void  SetMatlabField(mxArray* dataref);
    64                 #endif
    6552                int   GetStep(void);
    6653                /*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/FemModel.cpp

    r11708 r12168  
    2222/*FUNCTION FemModel::constructor {{{1*/
    2323FemModel::FemModel(char* inputfilename, char* outputfilename, const int in_solution_type,const int* analyses,const int nummodels){
    24 #ifdef _PARALLEL_
    2524
    2625        /*intermediary*/
     
    7574        /*Add output file name to parameters: */
    7675        this->parameters->AddObject(new StringParam(OutputfilenameEnum,outputfilename));
    77 
    78 #endif
    7976
    8077}
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Hook.cpp

    r9777 r12168  
    118118}
    119119/*}}}*/
    120 #ifdef _SERIAL_
    121 /*FUNCTION Hook::Marshall{{{1*/
    122 void Hook::Marshall(char** pmarshalled_dataset){
    123 
    124         char* marshalled_dataset=NULL;
    125         int   enum_type=0;
    126         int   i;
    127 
    128         /*recover marshalled_dataset: */
    129         marshalled_dataset=*pmarshalled_dataset;
    130 
    131         /*get enum type of Hook: */
    132         enum_type=HookEnum;
    133        
    134         /*marshall enum: */
    135         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    136        
    137         /*marshall Hook data: */
    138         memcpy(marshalled_dataset,&num,sizeof(num));marshalled_dataset+=sizeof(num);
    139         for(i=0;i<num;i++){
    140                 memcpy(marshalled_dataset,&this->ids[i],sizeof(int));marshalled_dataset+=sizeof(int);
    141                 memcpy(marshalled_dataset,&this->offsets[i],sizeof(int));marshalled_dataset+=sizeof(int);
    142         }
    143 
    144         *pmarshalled_dataset=marshalled_dataset;
    145         return;
    146 }
    147 /*}}}*/
    148 /*FUNCTION Hook::MarshallSize{{{1*/
    149 int Hook::MarshallSize(){
    150 
    151         return
    152                 sizeof(num)+
    153                 num*sizeof(int)+
    154                 num*sizeof(int)+
    155                 sizeof(int); //sizeof(int) for enum type
    156 }
    157 /*}}}*/
    158 /*FUNCTION Hook::Demarshall{{{1*/
    159 void Hook::Demarshall(char** pmarshalled_dataset){
    160 
    161         char* marshalled_dataset=NULL;
    162         int   i;
    163         int   enum_type;
    164 
    165         /*recover marshalled_dataset: */
    166         marshalled_dataset=*pmarshalled_dataset;
    167 
    168         /*get enum type of object since Hook is not directly called by DataSet: */
    169         memcpy(&enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
    170 
    171         memcpy(&num,marshalled_dataset,sizeof(num));marshalled_dataset+=sizeof(num);
    172        
    173         /*allocate: */
    174         if (num<0){
    175                 _error_("cannot demarshall Hook as num<=0");
    176         }
    177         else if (num==0){
    178                 this->ids=NULL;
    179                 this->offsets=NULL;
    180                 this->objects=NULL;
    181         }
    182         else{
    183 
    184                 this->ids=(int*)xmalloc(num*sizeof(int));
    185                 this->offsets=(int*)xmalloc(num*sizeof(int));
    186 
    187                 /*demarshall allocated ids and offsets: */
    188                 _assert_(num<1000);
    189                 for (i=0;i<num;i++){
    190                         memcpy(&this->ids[i],marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
    191                         memcpy(&this->offsets[i],marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
    192                 }
    193 
    194                 /*nullify object pointers */
    195                 this->objects=(Object**)xmalloc(num*sizeof(Object*));
    196                 for (i=0;i<num;i++){
    197                         this->objects[i]=NULL;
    198                 }
    199         }
    200 
    201         /*return: */
    202         *pmarshalled_dataset=marshalled_dataset;
    203         return;
    204 }
    205 /*}}}*/
    206 #endif
    207120/*FUNCTION Hook::copy {{{1*/
    208121Object* Hook::copy(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Hook.h

    r9777 r12168  
    3434                void       Echo(void);
    3535                void       DeepEcho(void);
    36                 #ifdef _SERIAL_
    37                 void       Marshall(char** pmarshalled_dataset);
    38                 int        MarshallSize();
    39                 void       Demarshall(char** pmarshalled_dataset);
    40                 #endif
    4136                Object*    copy(void);
    4237                /*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Inputs/BoolInput.cpp

    r11984 r12168  
    5959}
    6060/*}}}*/
    61 #ifdef _SERIAL_
    62 /*FUNCTION BoolInput::Marshall{{{1*/
    63 void  BoolInput::Marshall(char** pmarshalled_dataset){
    64 
    65         char* marshalled_dataset=NULL;
    66         int   enum_value=0;
    67 
    68         /*recover marshalled_dataset: */
    69         marshalled_dataset=*pmarshalled_dataset;
    70 
    71         /*get enum value of BoolInput: */
    72         enum_value=BoolInputEnum;
    73        
    74         /*marshall enum: */
    75         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    76        
    77         /*marshall BoolInput data: */
    78         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    79         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    80 
    81         *pmarshalled_dataset=marshalled_dataset;
    82 }
    83 /*}}}*/
    84 /*FUNCTION BoolInput::MarshallSize{{{1*/
    85 int   BoolInput::MarshallSize(){
    86        
    87         return sizeof(value)+
    88                 +sizeof(enum_type)+
    89                 +sizeof(int); //sizeof(int) for enum value
    90 }
    91 /*}}}*/
    92 /*FUNCTION BoolInput::Demarshall{{{1*/
    93 void  BoolInput::Demarshall(char** pmarshalled_dataset){
    94 
    95         char* marshalled_dataset=NULL;
    96         int   i;
    97 
    98         /*recover marshalled_dataset: */
    99         marshalled_dataset=*pmarshalled_dataset;
    100 
    101         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    102          *object data (thanks to DataSet::Demarshall):*/
    103         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    104         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    105 
    106         /*return: */
    107         *pmarshalled_dataset=marshalled_dataset;
    108         return;
    109 }
    110 /*}}}*/
    111 #endif
    11261/*FUNCTION BoolInput::ObjectEnum{{{1*/
    11362int BoolInput::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Inputs/BoolInput.h

    r11984 r12168  
    3131                int   Id();
    3232                int   MyRank();
    33                 #ifdef _SERIAL_
    34                 void  Marshall(char** pmarshalled_dataset);
    35                 int   MarshallSize();
    36                 void  Demarshall(char** pmarshalled_dataset);
    37                 #endif
    3833                int   ObjectEnum();
    3934                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Inputs/ControlInput.h

    r11984 r12168  
    3636                int   Id();
    3737                int   MyRank();
    38                 #ifdef _SERIAL_
    39                 void  Marshall(char** pmarshalled_dataset);
    40                 int   MarshallSize();
    41                 void  Demarshall(char** pmarshalled_dataset);
    42                 #endif
    4338                int   ObjectEnum();
    4439                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Inputs/DatasetInput.cpp

    r10135 r12168  
    6161}
    6262/*}}}*/
    63 #ifdef _SERIAL_
    64 /*FUNCTION DatasetInput::Marshall{{{1*/
    65 void  DatasetInput::Marshall(char** pmarshalled_dataset){
    66 
    67         char* marshalled_dataset=NULL;
    68         char* marshalled_inputs=NULL;
    69         int   marshalled_inputs_size;
    70         int   enum_value=0;
    71 
    72         /*recover marshalled_dataset: */
    73         marshalled_dataset=*pmarshalled_dataset;
    74 
    75         /*get enum value of DatasetInput: */
    76         enum_value=DatasetInputEnum;
    77        
    78         /*marshall enum: */
    79         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    80        
    81         /*marshall enum_type: */
    82         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    83 
    84         /*marshal inputs*/
    85         marshalled_inputs_size=inputs->MarshallSize();
    86         marshalled_inputs=inputs->Marshall();
    87         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    88         marshalled_dataset+=marshalled_inputs_size;
    89 
    90         /*clean up and assign output pointer*/
    91         xfree((void**)&marshalled_inputs);
    92         *pmarshalled_dataset=marshalled_dataset;
    93 }
    94 /*}}}*/
    95 /*FUNCTION DatasetInput::MarshallSize{{{1*/
    96 int   DatasetInput::MarshallSize(){
    97        
    98         int size=0;
    99 
    100         size=sizeof(enum_type)+
    101           +inputs->MarshallSize()
    102           +sizeof(int); //sizeof(int) for enum value
    103 
    104         return size;
    105 }
    106 /*}}}*/
    107 /*FUNCTION DatasetInput::Demarshall{{{1*/
    108 void  DatasetInput::Demarshall(char** pmarshalled_dataset){
    109         char* marshalled_dataset=NULL;
    110 
    111         /*recover marshalled_dataset: */
    112         marshalled_dataset=*pmarshalled_dataset;
    113 
    114         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    115          *object data (thanks to DataSet::Demarshall):*/
    116         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    117 
    118         /*Demarshal values*/
    119         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    120 
    121         /*return: */
    122         *pmarshalled_dataset=marshalled_dataset;
    123         return;
    124 }
    125 /*}}}*/
    126 #endif
    12763/*FUNCTION DatasetInput::ObjectEnum{{{1*/
    12864int DatasetInput::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Inputs/DatasetInput.h

    r11984 r12168  
    3131                int   Id();
    3232                int   MyRank();
    33                 #ifdef _SERIAL_
    34                 void  Marshall(char** pmarshalled_dataset);
    35                 int   MarshallSize();
    36                 void  Demarshall(char** pmarshalled_dataset);
    37                 #endif
    3833                int   ObjectEnum();
    3934                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Inputs/DoubleInput.cpp

    r11984 r12168  
    5959}
    6060/*}}}*/
    61 #ifdef _SERIAL_
    62 /*FUNCTION DoubleInput::Marshall{{{1*/
    63 void  DoubleInput::Marshall(char** pmarshalled_dataset){
    64 
    65         char* marshalled_dataset=NULL;
    66         int   enum_value=0;
    67 
    68         /*recover marshalled_dataset: */
    69         marshalled_dataset=*pmarshalled_dataset;
    70 
    71         /*get enum value of DoubleInput: */
    72         enum_value=DoubleInputEnum;
    73        
    74         /*marshall enum: */
    75         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    76        
    77         /*marshall DoubleInput data: */
    78         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    79         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    80 
    81         *pmarshalled_dataset=marshalled_dataset;
    82 }
    83 /*}}}*/
    84 /*FUNCTION DoubleInput::MarshallSize{{{1*/
    85 int   DoubleInput::MarshallSize(){
    86        
    87         return sizeof(value)+
    88                 +sizeof(enum_type)+
    89                 +sizeof(int); //sizeof(int) for enum value
    90 }
    91 /*}}}*/
    92 /*FUNCTION DoubleInput::Demarshall{{{1*/
    93 void  DoubleInput::Demarshall(char** pmarshalled_dataset){
    94 
    95         char* marshalled_dataset=NULL;
    96         int   i;
    97 
    98         /*recover marshalled_dataset: */
    99         marshalled_dataset=*pmarshalled_dataset;
    100 
    101         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    102          *object data (thanks to DataSet::Demarshall):*/
    103         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    104         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    105 
    106         /*return: */
    107         *pmarshalled_dataset=marshalled_dataset;
    108         return;
    109 }
    110 /*}}}*/
    111 #endif
    11261/*FUNCTION DoubleInput::ObjectEnum{{{1*/
    11362int DoubleInput::ObjectEnum(void){
     
    159108/*FUNCTION DoubleInput::GetInputValue(bool* pvalue) {{{1*/
    160109void DoubleInput::GetInputValue(bool* pvalue){
    161 #ifdef _SERIAL_
    162         *pvalue=(bool)value;
    163 #else
    164110        _error_("Double input of enum %s cannot return a boolean",EnumToStringx(enum_type));
    165 #endif
    166111
    167112}
     
    169114/*FUNCTION DoubleInput::GetInputValue(int* pvalue){{{1*/
    170115void DoubleInput::GetInputValue(int* pvalue){
    171 #ifdef _SERIAL_
    172         *pvalue=(int)value;
    173 #else
    174116        _error_("Double input of enum %i (%s) cannot return an integer",enum_type,EnumToStringx(enum_type));
    175 #endif
    176117
    177118}
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Inputs/DoubleInput.h

    r11984 r12168  
    3030                int   Id();
    3131                int   MyRank();
    32                 #ifdef _SERIAL_
    33                 void  Marshall(char** pmarshalled_dataset);
    34                 int   MarshallSize();
    35                 void  Demarshall(char** pmarshalled_dataset);
    36                 #endif
    3732                int   ObjectEnum();
    3833                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Inputs/IntInput.cpp

    r11984 r12168  
    5454}
    5555/*}}}*/
    56 #ifdef _SERIAL_
    57 /*FUNCTION IntInput::Marshall{{{1*/
    58 void  IntInput::Marshall(char** pmarshalled_dataset){
    59 
    60         char* marshalled_dataset=NULL;
    61         int   enum_value=0;
    62 
    63         /*recover marshalled_dataset: */
    64         marshalled_dataset=*pmarshalled_dataset;
    65 
    66         /*get enum value of IntInput: */
    67         enum_value=IntInputEnum;
    68        
    69         /*marshall enum: */
    70         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    71        
    72         /*marshall IntInput data: */
    73         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    74         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    75 
    76         *pmarshalled_dataset=marshalled_dataset;
    77 }
    78 /*}}}*/
    79 /*FUNCTION IntInput::MarshallSize{{{1*/
    80 int   IntInput::MarshallSize(){
    81        
    82         return sizeof(value)+
    83                 +sizeof(enum_type)+
    84                 +sizeof(int); //sizeof(int) for enum value
    85 }
    86 /*}}}*/
    87 /*FUNCTION IntInput::Demarshall{{{1*/
    88 void  IntInput::Demarshall(char** pmarshalled_dataset){
    89 
    90         char* marshalled_dataset=NULL;
    91         int   i;
    92 
    93         /*recover marshalled_dataset: */
    94         marshalled_dataset=*pmarshalled_dataset;
    95 
    96         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    97          *object data (thanks to DataSet::Demarshall):*/
    98         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    99         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    100 
    101         /*return: */
    102         *pmarshalled_dataset=marshalled_dataset;
    103         return;
    104 }
    105 /*}}}*/
    106 #endif
    10756/*FUNCTION IntInput::ObjectEnum{{{1*/
    10857int IntInput::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Inputs/IntInput.h

    r11984 r12168  
    3131                int   Id();
    3232                int   MyRank();
    33                 #ifdef _SERIAL_
    34                 void  Marshall(char** pmarshalled_dataset);
    35                 int   MarshallSize();
    36                 void  Demarshall(char** pmarshalled_dataset);
    37                 #endif
    3833                int   ObjectEnum();
    3934                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Inputs/PentaP1Input.cpp

    r11984 r12168  
    7070}
    7171/*}}}*/
    72 #ifdef _SERIAL_
    73 /*FUNCTION PentaP1Input::Marshall{{{1*/
    74 void  PentaP1Input::Marshall(char** pmarshalled_dataset){
    75 
    76         char* marshalled_dataset=NULL;
    77         int   enum_value=0;
    78 
    79         /*recover marshalled_dataset: */
    80         marshalled_dataset=*pmarshalled_dataset;
    81 
    82         /*get enum value of PentaP1Input: */
    83         enum_value=PentaP1InputEnum;
    84        
    85         /*marshall enum: */
    86         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    87        
    88         /*marshall PentaP1Input data: */
    89         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    90         memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
    91 
    92         *pmarshalled_dataset=marshalled_dataset;
    93 }
    94 /*}}}*/
    95 /*FUNCTION PentaP1Input::MarshallSize{{{1*/
    96 int   PentaP1Input::MarshallSize(){
    97        
    98         return sizeof(values)+
    99                 +sizeof(enum_type)+
    100                 +sizeof(int); //sizeof(int) for enum value
    101 }
    102 /*}}}*/
    103 /*FUNCTION PentaP1Input::Demarshall{{{1*/
    104 void  PentaP1Input::Demarshall(char** pmarshalled_dataset){
    105 
    106         char* marshalled_dataset=NULL;
    107         int   i;
    108 
    109         /*recover marshalled_dataset: */
    110         marshalled_dataset=*pmarshalled_dataset;
    111 
    112         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    113          *object data (thanks to DataSet::Demarshall):*/
    114         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    115         memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
    116 
    117         /*return: */
    118         *pmarshalled_dataset=marshalled_dataset;
    119         return;
    120 }
    121 /*}}}*/
    122 #endif
    12372/*FUNCTION PentaP1Input::ObjectEnum{{{1*/
    12473int PentaP1Input::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Inputs/PentaP1Input.h

    r11984 r12168  
    3131                int   Id();
    3232                int   MyRank();
    33                 #ifdef _SERIAL_
    34                 void  Marshall(char** pmarshalled_dataset);
    35                 int   MarshallSize();
    36                 void  Demarshall(char** pmarshalled_dataset);
    37                 #endif
    3833                int   ObjectEnum();
    3934                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Inputs/TransientInput.cpp

    r11708 r12168  
    114114}
    115115/*}}}*/
    116 #ifdef _SERIAL_
    117 /*FUNCTION TransientInput::Marshall{{{1*/
    118 void  TransientInput::Marshall(char** pmarshalled_dataset){
    119 
    120         char* marshalled_dataset=NULL;
    121         char* marshalled_inputs=NULL;
    122         int   marshalled_inputs_size;
    123         int   enum_value=0;
    124 
    125         /*recover marshalled_dataset: */
    126         marshalled_dataset=*pmarshalled_dataset;
    127 
    128         /*get enum value of TransientInput: */
    129         enum_value=TransientInputEnum;
    130        
    131         /*marshall enum: */
    132         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    133 
    134         /*marshall TransientInput data: */
    135         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    136         memcpy(marshalled_dataset,&numtimesteps,sizeof(numtimesteps));marshalled_dataset+=sizeof(numtimesteps);
    137         memcpy(marshalled_dataset,timesteps,numtimesteps*sizeof(double));marshalled_dataset+=numtimesteps*sizeof(double);
    138 
    139         /*marshal inputs*/
    140         marshalled_inputs_size=inputs->MarshallSize();
    141         marshalled_inputs=inputs->Marshall();
    142         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    143         marshalled_dataset+=marshalled_inputs_size;
    144 
    145         /*clean up and assign output pointer*/
    146         xfree((void**)&marshalled_inputs);
    147         *pmarshalled_dataset=marshalled_dataset;
    148 
    149 }
    150 /*}}}*
    151 /*FUNCTION TransientInput::MarshallSize{{{1*/
    152 int   TransientInput::MarshallSize(){
    153 
    154         return
    155                 +sizeof(enum_type)+
    156                 +sizeof(numtimesteps)+
    157                 +inputs->MarshallSize()
    158                 +numtimesteps*sizeof(double)+
    159                 +sizeof(int); //sizeof(int) for enum value
    160 }
    161 /*}}}*/
    162 /*FUNCTION TransientInput::Demarshall{{{1*/
    163 void  TransientInput::Demarshall(char** pmarshalled_dataset){
    164 
    165         char* marshalled_dataset=NULL;
    166 
    167         /*recover marshalled_dataset: */
    168         marshalled_dataset=*pmarshalled_dataset;
    169 
    170         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    171          *object data (thanks to DataSet::Demarshall):*/
    172         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    173         memcpy(&numtimesteps,marshalled_dataset,sizeof(numtimesteps));marshalled_dataset+=sizeof(numtimesteps);
    174 
    175         /*allocate: */
    176         timesteps=(double*)xmalloc(numtimesteps*sizeof(double));
    177         memcpy(timesteps,marshalled_dataset,numtimesteps*sizeof(double));marshalled_dataset+=numtimesteps*sizeof(double);
    178 
    179         /*Demarshal values*/
    180         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    181 
    182         /*return: */
    183         *pmarshalled_dataset=marshalled_dataset;
    184         return;
    185 
    186 }
    187 /*}}}*/
    188 #endif
    189116/*FUNCTION TransientInput::ObjectEnum{{{1*/
    190117int TransientInput::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Inputs/TransientInput.h

    r11984 r12168  
    3434                int   Id();
    3535                int   MyRank();
    36                 #ifdef _SERIAL_
    37                 void  Marshall(char** pmarshalled_dataset);
    38                 int   MarshallSize();
    39                 void  Demarshall(char** pmarshalled_dataset);
    40                 #endif
    4136                int   ObjectEnum();
    4237                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Inputs/TriaP1Input.cpp

    r11984 r12168  
    7070}
    7171/*}}}*/
    72 #ifdef _SERIAL_
    73 /*FUNCTION TriaP1Input::Marshall{{{1*/
    74 void  TriaP1Input::Marshall(char** pmarshalled_dataset){
    75 
    76         char* marshalled_dataset=NULL;
    77         int   enum_value=0;
    78 
    79         /*recover marshalled_dataset: */
    80         marshalled_dataset=*pmarshalled_dataset;
    81 
    82         /*get enum value of TriaP1Input: */
    83         enum_value=TriaP1InputEnum;
    84        
    85         /*marshall enum: */
    86         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    87        
    88         /*marshall TriaP1Input data: */
    89         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    90         memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
    91 
    92         *pmarshalled_dataset=marshalled_dataset;
    93 }
    94 /*}}}*/
    95 /*FUNCTION TriaP1Input::MarshallSize{{{1*/
    96 int   TriaP1Input::MarshallSize(){
    97        
    98         return sizeof(values)+
    99                 +sizeof(enum_type)+
    100                 +sizeof(int); //sizeof(int) for enum value
    101 }
    102 /*}}}*/
    103 /*FUNCTION TriaP1Input::Demarshall{{{1*/
    104 void  TriaP1Input::Demarshall(char** pmarshalled_dataset){
    105 
    106         char* marshalled_dataset=NULL;
    107         int   i;
    108 
    109         /*recover marshalled_dataset: */
    110         marshalled_dataset=*pmarshalled_dataset;
    111 
    112         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    113          *object data (thanks to DataSet::Demarshall):*/
    114         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    115         memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
    116 
    117         /*return: */
    118         *pmarshalled_dataset=marshalled_dataset;
    119         return;
    120 }
    121 /*}}}*/
    122 #endif
    12372/*FUNCTION TriaP1Input::ObjectEnum{{{1*/
    12473int TriaP1Input::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Inputs/TriaP1Input.h

    r11984 r12168  
    3131                int   Id();
    3232                int   MyRank();
    33                 #ifdef _SERIAL_
    34                 void  Marshall(char** pmarshalled_dataset);
    35                 int   MarshallSize();
    36                 void  Demarshall(char** pmarshalled_dataset);
    37                 #endif
    3833                int   ObjectEnum();
    3934                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/IoModel.cpp

    r10390 r12168  
    198198                                /*Ok, we have reached the end of the file. break: */
    199199                                record_code=0; //0 means bailout
     200                                #ifdef _HAVE_MPI_
    200201                                MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD);  /*tell others cpus we are bailing: */
     202                                #endif
    201203                                break;
    202204                        }
     
    207209                                fread(&record_code,sizeof(int),1,this->fid);
    208210                                       
     211                                #ifdef _HAVE_MPI_
    209212                                /*Tell other cpus what we are doing: */
    210213                                MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD);  /*tell other cpus what we are going to do: */
     
    213216                                MPI_Bcast(&record_enum,1,MPI_INT,0,MPI_COMM_WORLD); 
    214217                                MPI_Bcast(&record_length,1,MPI_INT,0,MPI_COMM_WORLD); 
     218                                #endif
    215219                               
    216 
    217220                                switch(record_code){
    218221                                        case 1:
    219222                                                /*Read the boolean and broadcast it to other cpus:*/
    220223                                                if(fread(&booleanint,sizeof(int),1,this->fid)!=1) _error_(" could not read boolean ");
     224                                                #ifdef _HAVE_MPI_
    221225                                                MPI_Bcast(&booleanint,1,MPI_INT,0,MPI_COMM_WORLD);
     226                                                #endif
    222227
    223228                                                /*create BoolParam: */
     
    228233                                                /*Read the integer and broadcast it to other cpus:*/
    229234                                                if(fread(&integer,sizeof(int),1,this->fid)!=1) _error_(" could not read integer ");
     235                                                #ifdef _HAVE_MPI_
    230236                                                MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD);
     237                                                #endif
    231238
    232239                                                /*create IntParam: */
     
    237244                                                /*Read the scalar and broadcast it to other cpus:*/
    238245                                                if(fread(&scalar,sizeof(double),1,this->fid)!=1) _error_(" could not read scalar ");
     246                                                #ifdef _HAVE_MPI_
    239247                                                MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
     248                                                #endif
    240249
    241250                                                /*create DoubleParam: */
     
    246255                                                /*We have to read a string from disk. First read the dimensions of the string, then the string: */
    247256                                                if(fread(&string_size,sizeof(int),1,this->fid)!=1) _error_(" could not read length of string ");
     257                                                #ifdef _HAVE_MPI_
    248258                                                MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD);
     259                                                #endif
    249260
    250261                                                if(string_size){
     
    254265                                                        /*Read string, then broadcast: */
    255266                                                        if(fread(string,string_size*sizeof(char),1,this->fid)!=1)_error_("  could not read string ");
     267                                                        #ifdef _HAVE_MPI_
    256268                                                        MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD);
     269                                                        #endif
    257270                                                }
    258271                                                else{
     
    308321                }
    309322        } //}}}
     323        #ifdef _HAVE_MPI_
    310324        else{ //cpu ~0 {{{2
    311325                for(;;){ //wait on cpu 0
     
    377391                }
    378392        } //}}}
     393        #endif
    379394}
    380395/*}}}*/
     
    399414                if(fread(&booleanint,sizeof(int),1,fid)!=1) _error_(" could not read boolean ");
    400415        }
     416        #ifdef _HAVE_MPI_
    401417        MPI_Bcast(&booleanint,1,MPI_INT,0,MPI_COMM_WORLD);
     418        #endif
    402419
    403420        /*cast to bool: */
     
    428445        }
    429446
     447        #ifdef _HAVE_MPI_
    430448        MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD);
     449        #endif
    431450
    432451        /*Assign output pointers: */
     
    456475                if(fread(&scalar,sizeof(double),1,fid)!=1)_error_(" could not read scalar ");
    457476        }
     477        #ifdef _HAVE_MPI_
    458478        MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
     479        #endif
    459480
    460481        /*Assign output pointers: */
     
    487508        }
    488509
     510        #ifdef _HAVE_MPI_
    489511        MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD);
     512        #endif
    490513
    491514        /*Now allocate string: */
     
    498521                        if(fread(string,string_size*sizeof(char),1,fid)!=1)_error_("  could not read string ");
    499522                }
     523                #ifdef _HAVE_MPI_
    500524                MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD);
     525                #endif
    501526        }
    502527        else{
     
    538563        }
    539564
     565        #ifdef _HAVE_MPI_
    540566        MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD);
     567        #endif
    541568
    542569        if(my_rank==0){ 
    543570                if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix ");
    544571        }
    545         MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD);
     572        #ifdef _HAVE_MPI_
     573        MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD);
     574        #endif
    546575
    547576        /*Now allocate matrix: */
     
    554583                }
    555584               
     585                #ifdef _HAVE_MPI_
    556586                MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD);
     587                #endif
    557588        }
    558589
     
    602633                if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows for matrix ");
    603634        }
     635        #ifdef _HAVE_MPI_
    604636        MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD);
     637        #endif
    605638
    606639        if(my_rank==0){ 
    607640                if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix ");
    608641        }
     642        #ifdef _HAVE_MPI_
    609643        MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD);
     644        #endif
    610645
    611646        /*Now allocate matrix: */
     
    617652                        if(fread(matrix,M*N*sizeof(double),1,fid)!=1) _error_("could not read matrix ");
    618653                }
     654                #ifdef _HAVE_MPI_
    619655                MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD);
     656                #endif
    620657        }
    621658
     
    652689                if(fread(&numstrings,sizeof(int),1,fid)!=1) _error_(" could not read length of string array");
    653690        }
     691        #ifdef _HAVE_MPI_
    654692        MPI_Bcast(&numstrings,1,MPI_INT,0,MPI_COMM_WORLD);
     693        #endif
    655694
    656695        /*Now allocate string array: */
     
    665704                                if(fread(&string_size,sizeof(int),1,fid)!=1) _error_(" could not read length of string ");
    666705                        }
     706                        #ifdef _HAVE_MPI_
    667707                        MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD);
     708                        #endif
    668709                        if(string_size){
    669710                                string=(char*)xmalloc((string_size+1)*sizeof(char));
     
    674715                                        if(fread(string,string_size*sizeof(char),1,fid)!=1)_error_("  could not read string ");
    675716                                }
     717                                #ifdef _HAVE_MPI_
    676718                                MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD);
     719                                #endif
    677720                        }
    678721                        else{
     
    717760                if(fread(&numrecords,sizeof(int),1,fid)!=1) _error_("could not read number of records in matrix array ");
    718761        }
     762        #ifdef _HAVE_MPI_
    719763        MPI_Bcast(&numrecords,1,MPI_INT,0,MPI_COMM_WORLD);
     764        #endif
    720765
    721766        if(numrecords){
     
    738783                                if(fread(&M,sizeof(int),1,fid)!=1) _error_("%s%i%s","could not read number of rows in ",i,"th matrix of matrix array");
    739784                        }
     785                        #ifdef _HAVE_MPI_
    740786                        MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD);
     787                        #endif
    741788
    742789                        if(my_rank==0){ 
    743790                                if(fread(&N,sizeof(int),1,fid)!=1) _error_("%s%i%s","could not read number of columns in ",i,"th matrix of matrix array");
    744791                        }
     792                        #ifdef _HAVE_MPI_
    745793                        MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD);
     794                        #endif
    746795
    747796                        /*Now allocate matrix: */
     
    754803                                }
    755804
     805                                #ifdef _HAVE_MPI_
    756806                                MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD);
     807                                #endif
    757808                        }
    758809
     
    10471098                }
    10481099        }
     1100        #ifdef _HAVE_MPI_
    10491101        MPI_Bcast(&found,1,MPI_INT,0,MPI_COMM_WORLD);
    10501102        if(!found)_error_("%s %s ","could not find data with name",EnumToStringx(data_enum));
     1103        #endif
    10511104
    10521105        /*Broadcast code and vector type: */
     1106        #ifdef _HAVE_MPI_
    10531107        MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD);
    10541108        MPI_Bcast(&vector_type,1,MPI_INT,0,MPI_COMM_WORLD);
    10551109        if(record_code==5) MPI_Bcast(&vector_type,1,MPI_INT,0,MPI_COMM_WORLD);
     1110        #endif
    10561111
    10571112        /*Assign output pointers:*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Loads/Icefront.cpp

    r12004 r12168  
    163163}
    164164/*}}}*/
    165 #ifdef _SERIAL_
    166 /*FUNCTION Icefront::Marshall {{{1*/
    167 void  Icefront::Marshall(char** pmarshalled_dataset){
    168 
    169         char* marshalled_dataset=NULL;
    170         int   enum_type=0;
    171         char* marshalled_inputs=NULL;
    172         int   marshalled_inputs_size;
    173 
    174         /*recover marshalled_dataset: */
    175         marshalled_dataset=*pmarshalled_dataset;
    176 
    177         /*get enum type of Icefront: */
    178         enum_type=IcefrontEnum;
    179 
    180         /*marshall enum: */
    181         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    182 
    183         /*marshall Icefront data: */
    184         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    185         memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    186 
    187         /*Marshall hooks: */
    188         hnodes->Marshall(&marshalled_dataset);
    189         helement->Marshall(&marshalled_dataset);
    190         hmatpar->Marshall(&marshalled_dataset);
    191 
    192         /*Marshall inputs: */
    193         marshalled_inputs_size=inputs->MarshallSize();
    194         marshalled_inputs=inputs->Marshall();
    195         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    196         marshalled_dataset+=marshalled_inputs_size;
    197 
    198         /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
    199 
    200         xfree((void**)&marshalled_inputs);
    201 
    202         *pmarshalled_dataset=marshalled_dataset;
    203 }
    204 /*}}}*/
    205 /*FUNCTION Icefront::MarshallSize {{{1*/
    206 int   Icefront::MarshallSize(){
    207        
    208         return sizeof(id)
    209                 +sizeof(analysis_type)
    210                 +hnodes->MarshallSize()
    211                 +helement->MarshallSize()
    212                 +hmatpar->MarshallSize()
    213                 +inputs->MarshallSize()
    214                 +sizeof(int); //sizeof(int) for enum type
    215 }
    216 /*}}}*/
    217 /*FUNCTION Icefront::Demarshall {{{1*/
    218 void  Icefront::Demarshall(char** pmarshalled_dataset){
    219 
    220         char* marshalled_dataset=NULL;
    221         int   i;
    222 
    223         /*recover marshalled_dataset: */
    224         marshalled_dataset=*pmarshalled_dataset;
    225 
    226         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    227          *object data (thanks to DataSet::Demarshall):*/
    228         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    229         memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    230 
    231         /*demarshall hooks: */
    232         hnodes=new Hook(); hnodes->Demarshall(&marshalled_dataset);
    233         helement=new Hook(); helement->Demarshall(&marshalled_dataset);
    234         hmatpar=new Hook(); hmatpar->Demarshall(&marshalled_dataset);
    235        
    236         /*pointers are garbabe, until configuration is carried out: */
    237         nodes=NULL;
    238         element=NULL;
    239         matpar=NULL;
    240 
    241         /*demarshall inputs: */
    242         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    243 
    244         /*parameters: may not exist even yet, so let Configure handle it: */
    245         this->parameters=NULL;
    246 
    247         /*return: */
    248         *pmarshalled_dataset=marshalled_dataset;
    249         return;
    250 }
    251 /*}}}*/
    252 #endif
    253165/*FUNCTION Icefront::ObjectEnum{{{1*/
    254166int Icefront::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Loads/Icefront.h

    r12004 r12168  
    4949                int   Id();
    5050                int   MyRank();
    51                 #ifdef _SERIAL_
    52                 void  Marshall(char** pmarshalled_dataset);
    53                 int   MarshallSize();
    54                 void  Demarshall(char** pmarshalled_dataset);
    55                 #endif
    5651                int   ObjectEnum();
    5752                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Loads/Numericalflux.cpp

    r11684 r12168  
    189189}
    190190/*}}}*/
    191 #ifdef _SERIAL_
    192 /*FUNCTION Numericalflux::Marshall {{{1*/
    193 void  Numericalflux::Marshall(char** pmarshalled_dataset){
    194 
    195         char* marshalled_dataset=NULL;
    196         int   enum_type=0;
    197         char* marshalled_inputs=NULL;
    198         int   marshalled_inputs_size;
    199 
    200         /*recover marshalled_dataset: */
    201         marshalled_dataset=*pmarshalled_dataset;
    202 
    203         /*get enum type of Numericalflux: */
    204         enum_type=NumericalfluxEnum;
    205 
    206         /*marshall enum: */
    207         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    208 
    209         /*marshall Numericalflux data: */
    210         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    211         memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    212 
    213         /*Marshall hooks: */
    214         hnodes->Marshall(&marshalled_dataset);
    215         helement->Marshall(&marshalled_dataset);
    216 
    217         /*Marshall inputs: */
    218         marshalled_inputs_size=inputs->MarshallSize();
    219         marshalled_inputs=inputs->Marshall();
    220         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    221         marshalled_dataset+=marshalled_inputs_size;
    222 
    223         /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
    224 
    225         xfree((void**)&marshalled_inputs);
    226 
    227         *pmarshalled_dataset=marshalled_dataset;
    228         return;
    229 }
    230 /*}}}*/
    231 /*FUNCTION Numericalflux::MarshallSize{{{1*/
    232 int   Numericalflux::MarshallSize(){
    233 
    234         return sizeof(id)
    235                 +sizeof(analysis_type)
    236                 +hnodes->MarshallSize()
    237                 +helement->MarshallSize()
    238                 +inputs->MarshallSize()
    239                 +sizeof(int); //sizeof(int) for enum type
    240 }
    241 /*}}}*/
    242 /*FUNCTION Numericalflux::Demarshall {{{1*/
    243 void  Numericalflux::Demarshall(char** pmarshalled_dataset){
    244 
    245         char* marshalled_dataset=NULL;
    246         int   i;
    247 
    248         /*recover marshalled_dataset: */
    249         marshalled_dataset=*pmarshalled_dataset;
    250 
    251         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    252          *object data (thanks to DataSet::Demarshall):*/
    253         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    254         memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    255 
    256         /*demarshall hooks: */
    257         hnodes=new Hook(); hnodes->Demarshall(&marshalled_dataset);
    258         helement=new Hook(); helement->Demarshall(&marshalled_dataset);
    259        
    260         /*demarshall inputs: */
    261         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    262 
    263         /*parameters: may not exist even yet, so let Configure handle it: */
    264         this->parameters=NULL;
    265         this->element=NULL;
    266         this->nodes=NULL;
    267 
    268         /*return: */
    269         *pmarshalled_dataset=marshalled_dataset;
    270         return;
    271 }
    272 /*}}}*/
    273 #endif
    274191/*FUNCTION Numericalflux::ObjectEnum{{{1*/
    275192int Numericalflux::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Loads/Numericalflux.h

    r11684 r12168  
    4545                int   Id();
    4646                int   MyRank();
    47                 #ifdef _SERIAL_
    48                 void  Marshall(char** pmarshalled_dataset);
    49                 int   MarshallSize();
    50                 void  Demarshall(char** pmarshalled_dataset);
    51                 #endif
    5247                int   ObjectEnum();
    5348                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Loads/Pengrid.cpp

    r11684 r12168  
    132132}
    133133/*}}}1*/
    134 #ifdef _SERIAL_
    135 /*FUNCTION Pengrid::Marshall {{{1*/
    136 void  Pengrid::Marshall(char** pmarshalled_dataset){
    137 
    138         char* marshalled_dataset=NULL;
    139         int   enum_type=0;
    140         char* marshalled_inputs=NULL;
    141         int   marshalled_inputs_size;
    142 
    143         /*recover marshalled_dataset: */
    144         marshalled_dataset=*pmarshalled_dataset;
    145 
    146         /*get enum type of Tria: */
    147         enum_type=PengridEnum;
    148 
    149         /*marshall enum: */
    150         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    151 
    152         /*marshall Tria data: */
    153         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    154         memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    155         memcpy(marshalled_dataset,&active,sizeof(active));marshalled_dataset+=sizeof(active);
    156         memcpy(marshalled_dataset,&zigzag_counter,sizeof(zigzag_counter));marshalled_dataset+=sizeof(zigzag_counter);
    157 
    158         /*Marshall hooks: */
    159         hnode->Marshall(&marshalled_dataset);
    160         helement->Marshall(&marshalled_dataset);
    161         hmatpar->Marshall(&marshalled_dataset);
    162 
    163         /*Marshall inputs: */
    164         marshalled_inputs_size=inputs->MarshallSize();
    165         marshalled_inputs=inputs->Marshall();
    166         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    167         marshalled_dataset+=marshalled_inputs_size;
    168 
    169         /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
    170 
    171         xfree((void**)&marshalled_inputs);
    172 
    173         *pmarshalled_dataset=marshalled_dataset;
    174         return;
    175 }
    176 /*}}}*/
    177 /*FUNCTION Pengrid::MarshallSize {{{1*/
    178 int   Pengrid::MarshallSize(){
    179        
    180         return sizeof(id)
    181                 +sizeof(analysis_type)
    182                 +sizeof(active)
    183                 +sizeof(zigzag_counter)
    184                 +hnode->MarshallSize()
    185                 +helement->MarshallSize()
    186                 +hmatpar->MarshallSize()
    187                 +inputs->MarshallSize()
    188                 +sizeof(int); //sizeof(int) for enum type
    189 }
    190 /*}}}*/
    191 /*FUNCTION Pengrid::Demarshall {{{1*/
    192 void  Pengrid::Demarshall(char** pmarshalled_dataset){
    193 
    194         char* marshalled_dataset=NULL;
    195         int   i;
    196 
    197         /*recover marshalled_dataset: */
    198         marshalled_dataset=*pmarshalled_dataset;
    199 
    200         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    201          *object data (thanks to DataSet::Demarshall):*/
    202 
    203         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    204         memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    205         memcpy(&active,marshalled_dataset,sizeof(active));marshalled_dataset+=sizeof(active);
    206         memcpy(&zigzag_counter,marshalled_dataset,sizeof(zigzag_counter));marshalled_dataset+=sizeof(zigzag_counter);
    207 
    208         /*demarshall hooks: */
    209         hnode=new Hook(); hnode->Demarshall(&marshalled_dataset);
    210         helement=new Hook(); helement->Demarshall(&marshalled_dataset);
    211         hmatpar=new Hook(); hmatpar->Demarshall(&marshalled_dataset);
    212        
    213         /*demarshall inputs: */
    214         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    215 
    216         /*parameters: may not exist even yet, so let Configure handle it: */
    217         this->parameters=NULL;
    218         this->node=NULL;
    219         this->element=NULL;
    220         this->matpar=NULL;
    221 
    222         /*return: */
    223         *pmarshalled_dataset=marshalled_dataset;
    224         return;
    225 }
    226 /*}}}*/
    227 #endif
    228134/*FUNCTION Pengrid::ObjectEnum{{{1*/
    229135int Pengrid::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Loads/Pengrid.h

    r11684 r12168  
    5050                int   Id();
    5151                int   MyRank();
    52                 #ifdef _SERIAL_
    53                 void  Marshall(char** pmarshalled_dataset);
    54                 int   MarshallSize();
    55                 void  Demarshall(char** pmarshalled_dataset);
    56                 #endif
    5752                int   ObjectEnum();
    5853                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Loads/Penpair.cpp

    r11684 r12168  
    8585}
    8686/*}}}1*/
    87 #ifdef _SERIAL_
    88 /*FUNCTION Penpair::Marshall {{{1*/
    89 void  Penpair::Marshall(char** pmarshalled_dataset){
    90 
    91         char* marshalled_dataset=NULL;
    92         int   enum_type=0;
    93 
    94         /*recover marshalled_dataset: */
    95         marshalled_dataset=*pmarshalled_dataset;
    96 
    97         /*get enum type of Penpair: */
    98         enum_type=PenpairEnum;
    99        
    100         /*marshall enum: */
    101         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    102        
    103         /*marshall Penpair data: */
    104         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    105         memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    106 
    107         /*Marshall hooks*/
    108         hnodes->Marshall(&marshalled_dataset);
    109 
    110         *pmarshalled_dataset=marshalled_dataset;
    111         return;
    112 }
    113 /*}}}1*/
    114 /*FUNCTION Penpair::MarshallSize {{{1*/
    115 int   Penpair::MarshallSize(){
    116 
    117         return sizeof(id)+
    118                 +sizeof(analysis_type)
    119                 +hnodes->MarshallSize()
    120                 +sizeof(int); //sizeof(int) for enum type
    121 }
    122 /*}}}1*/
    123 /*FUNCTION Penpair::Demarshall {{{1*/
    124 void  Penpair::Demarshall(char** pmarshalled_dataset){
    125 
    126         int i;
    127         char* marshalled_dataset=NULL;
    128 
    129         /*recover marshalled_dataset: */
    130         marshalled_dataset=*pmarshalled_dataset;
    131 
    132         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    133          *object data (thanks to DataSet::Demarshall):*/
    134         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    135         memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    136 
    137         /*demarshall hooks: */
    138         hnodes=new Hook(); hnodes->Demarshall(&marshalled_dataset);
    139 
    140         /*pointers are garbabe, until configuration is carried out: */
    141         nodes=NULL;
    142         parameters=NULL;
    143 
    144         /*return: */
    145         *pmarshalled_dataset=marshalled_dataset;
    146         return;
    147 }
    148 /*}}}1*/
    149 #endif
    15087/*FUNCTION Penpair::ObjectEnum{{{1*/
    15188int Penpair::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Loads/Penpair.h

    r11684 r12168  
    3737                int   Id();
    3838                int   MyRank();
    39                 #ifdef _SERIAL_
    40                 void  Marshall(char** pmarshalled_dataset);
    41                 int   MarshallSize();
    42                 void  Demarshall(char** pmarshalled_dataset);
    43                 #endif
    4439                int   ObjectEnum();
    4540                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Loads/Riftfront.cpp

    r11684 r12168  
    192192}
    193193/*}}}1*/
    194 #ifdef _SERIAL_
    195 /*FUNCTION Riftfront::Marshall {{{1*/
    196 void  Riftfront::Marshall(char** pmarshalled_dataset){
    197 
    198         char* marshalled_dataset=NULL;
    199         int   enum_type=0;
    200         char* marshalled_inputs=NULL;
    201         int   marshalled_inputs_size;
    202 
    203         /*recover marshalled_dataset: */
    204         marshalled_dataset=*pmarshalled_dataset;
    205 
    206         /*get enum type of Riftfront: */
    207         enum_type=RiftfrontEnum;
    208 
    209         /*marshall enum: */
    210         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    211 
    212         /*marshall Riftfront data: */
    213         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    214         memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    215         memcpy(marshalled_dataset,&active,sizeof(active));marshalled_dataset+=sizeof(active);
    216         memcpy(marshalled_dataset,&normal,sizeof(normal));marshalled_dataset+=sizeof(normal);
    217         memcpy(marshalled_dataset,&length,sizeof(length));marshalled_dataset+=sizeof(length);
    218         memcpy(marshalled_dataset,&fraction,sizeof(fraction));marshalled_dataset+=sizeof(fraction);
    219         memcpy(marshalled_dataset,&frozen,sizeof(frozen));marshalled_dataset+=sizeof(frozen);
    220         memcpy(marshalled_dataset,&state,sizeof(state));marshalled_dataset+=sizeof(state);
    221         memcpy(marshalled_dataset,&counter,sizeof(counter));marshalled_dataset+=sizeof(counter);
    222         memcpy(marshalled_dataset,&prestable,sizeof(prestable));marshalled_dataset+=sizeof(prestable);
    223         memcpy(marshalled_dataset,&penalty_lock,sizeof(penalty_lock));marshalled_dataset+=sizeof(penalty_lock);
    224         memcpy(marshalled_dataset,&material_converged,sizeof(material_converged));marshalled_dataset+=sizeof(material_converged);
    225 
    226         /*Marshall hooks: */
    227         hnodes->Marshall(&marshalled_dataset);
    228         helements->Marshall(&marshalled_dataset);
    229         hmatpar->Marshall(&marshalled_dataset);
    230 
    231         /*Marshall inputs: */
    232         marshalled_inputs_size=inputs->MarshallSize();
    233         marshalled_inputs=inputs->Marshall();
    234         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    235         marshalled_dataset+=marshalled_inputs_size;
    236 
    237         /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
    238 
    239         xfree((void**)&marshalled_inputs);
    240 
    241         *pmarshalled_dataset=marshalled_dataset;
    242         return;
    243 }
    244 /*}}}*/
    245 /*FUNCTION Riftfront::MarshallSize {{{1*/
    246 int   Riftfront::MarshallSize(){
    247        
    248         return sizeof(id)
    249                 +sizeof(analysis_type)
    250                 +sizeof(active)
    251                 +sizeof(normal)
    252                 +sizeof(length)
    253                 +sizeof(fraction)
    254                 +sizeof(frozen)
    255                 +sizeof(state)
    256                 +sizeof(counter)
    257                 +sizeof(prestable)
    258                 +sizeof(penalty_lock)
    259                 +sizeof(material_converged)
    260                 +hnodes->MarshallSize()
    261                 +helements->MarshallSize()
    262                 +hmatpar->MarshallSize()
    263                 +inputs->MarshallSize()
    264                 +sizeof(int); //sizeof(int) for enum type
    265 }
    266 /*}}}*/
    267 /*FUNCTION Riftfront::Demarshall {{{1*/
    268 void  Riftfront::Demarshall(char** pmarshalled_dataset){
    269 
    270         char* marshalled_dataset=NULL;
    271         int   i;
    272 
    273         /*recover marshalled_dataset: */
    274         marshalled_dataset=*pmarshalled_dataset;
    275 
    276         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    277          *object data (thanks to DataSet::Demarshall):*/
    278 
    279         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    280         memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    281         memcpy(&active,marshalled_dataset,sizeof(active));marshalled_dataset+=sizeof(active);
    282         memcpy(&normal,marshalled_dataset,sizeof(normal));marshalled_dataset+=sizeof(normal);
    283         memcpy(&length,marshalled_dataset,sizeof(length));marshalled_dataset+=sizeof(length);
    284         memcpy(&fraction,marshalled_dataset,sizeof(fraction));marshalled_dataset+=sizeof(fraction);
    285         memcpy(&frozen,marshalled_dataset,sizeof(frozen));marshalled_dataset+=sizeof(frozen);
    286         memcpy(&state,marshalled_dataset,sizeof(state));marshalled_dataset+=sizeof(state);
    287         memcpy(&counter,marshalled_dataset,sizeof(counter));marshalled_dataset+=sizeof(counter);
    288         memcpy(&prestable,marshalled_dataset,sizeof(prestable));marshalled_dataset+=sizeof(prestable);
    289         memcpy(&penalty_lock,marshalled_dataset,sizeof(penalty_lock));marshalled_dataset+=sizeof(penalty_lock);
    290         memcpy(&material_converged,marshalled_dataset,sizeof(material_converged));marshalled_dataset+=sizeof(material_converged);
    291 
    292         /*demarshall hooks: */
    293         hnodes=new Hook();    hnodes->Demarshall(&marshalled_dataset);
    294         helements=new Hook(); helements->Demarshall(&marshalled_dataset);
    295         hmatpar=new Hook();   hmatpar->Demarshall(&marshalled_dataset);
    296 
    297         /*pointers are garbabe, until configuration is carried out: */
    298         nodes=NULL;
    299         elements=NULL;
    300         matpar=NULL;
    301        
    302         /*demarshall inputs: */
    303         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    304 
    305         /*parameters: may not exist even yet, so let Configure handle it: */
    306         this->parameters=NULL;
    307 
    308         /*return: */
    309         *pmarshalled_dataset=marshalled_dataset;
    310 }
    311 /*}}}*/
    312 #endif
    313194/*FUNCTION Riftfront::ObjectEnum{{{1*/
    314195int Riftfront::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Loads/Riftfront.h

    r11684 r12168  
    5757                int   Id();
    5858                int   MyRank();
    59                 #ifdef _SERIAL_
    60                 void  Marshall(char** pmarshalled_dataset);
    61                 int   MarshallSize();
    62                 void  Demarshall(char** pmarshalled_dataset);
    63                 #endif
    6459                int   ObjectEnum();
    6560                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Materials/Matice.cpp

    r12004 r12168  
    8888}
    8989/*}}}*/
    90 #ifdef _SERIAL_
    91 /*FUNCTION Matice::Marshall {{{1*/
    92 void  Matice::Marshall(char** pmarshalled_dataset){
    93 
    94         /*Intermediaries*/
    95         char* marshalled_dataset=NULL;
    96         int   enum_type=0;
    97         char* marshalled_inputs=NULL;
    98         int   marshalled_inputs_size;
    99 
    100         /*recover marshalled_dataset: */
    101         marshalled_dataset=*pmarshalled_dataset;
    102 
    103         /*get enum type of Matice: */
    104         enum_type=MaticeEnum;
    105        
    106         /*marshall enum: */
    107         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    108        
    109         /*marshall Matice data: */
    110         memcpy(marshalled_dataset,&mid,sizeof(mid));marshalled_dataset+=sizeof(mid);
    111 
    112         /*Marshall hooks: */
    113         helement->Marshall(&marshalled_dataset);
    114 
    115         /*Marshall inputs: */
    116         marshalled_inputs_size=inputs->MarshallSize();
    117         marshalled_inputs=inputs->Marshall();
    118         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    119         marshalled_dataset+=marshalled_inputs_size;
    120 
    121         *pmarshalled_dataset=marshalled_dataset;
    122 
    123         /*clean up and return*/
    124         xfree((void**)&marshalled_inputs);
    125 }
    126 /*}}}*/
    127 /*FUNCTION Matice::MarshallSize{{{1*/
    128 int   Matice::MarshallSize(){
    129 
    130         return sizeof(mid)
    131           +helement->MarshallSize()
    132           +inputs->MarshallSize()
    133           +sizeof(int); //sizeof(int) for enum type
    134 }
    135 /*}}}*/
    136 /*FUNCTION Matice::Demarshall {{{1*/
    137 void  Matice::Demarshall(char** pmarshalled_dataset){
    138 
    139         char* marshalled_dataset=NULL;
    140 
    141         /*recover marshalled_dataset: */
    142         marshalled_dataset=*pmarshalled_dataset;
    143 
    144         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    145          *object data (thanks to DataSet::Demarshall):*/
    146         memcpy(&mid,marshalled_dataset,sizeof(mid));marshalled_dataset+=sizeof(mid);
    147 
    148         /*demarshall hooks: */
    149         helement=new Hook(); helement->Demarshall(&marshalled_dataset);
    150 
    151         /*demarshall inputs: */
    152         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    153 
    154         /*return: */
    155         *pmarshalled_dataset=marshalled_dataset;
    156         return;
    157 }
    158 /*}}}*/
    159 #endif
    16090/*FUNCTION Matice::ObjectEnum{{{1*/
    16191int Matice::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Materials/Matice.h

    r11708 r12168  
    3535                int   Id();
    3636                int   MyRank();
    37                 #ifdef _SERIAL_
    38                 void  Marshall(char** pmarshalled_dataset);
    39                 int   MarshallSize();
    40                 void  Demarshall(char** pmarshalled_dataset);
    41                 #endif
    4237                int   ObjectEnum();
    4338                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Materials/Matpar.cpp

    r11351 r12168  
    102102}
    103103/*}}}1*/
    104 #ifdef _SERIAL_
    105 /*FUNCTION Matpar::Marshall {{{1*/
    106 void  Matpar::Marshall(char** pmarshalled_dataset){
    107 
    108         char* marshalled_dataset=NULL;
    109         int   enum_type=0;
    110 
    111         /*recover marshalled_dataset: */
    112         marshalled_dataset=*pmarshalled_dataset;
    113 
    114         /*get enum type of Matpar: */
    115         enum_type=MatparEnum;
    116        
    117         /*marshall enum: */
    118         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    119        
    120         /*marshall Matpar data: */
    121         memcpy(marshalled_dataset,&mid,sizeof(mid));marshalled_dataset+=sizeof(mid);
    122         memcpy(marshalled_dataset,&rho_ice,sizeof(rho_ice));marshalled_dataset+=sizeof(rho_ice);
    123         memcpy(marshalled_dataset,&rho_water,sizeof(rho_water));marshalled_dataset+=sizeof(rho_water);
    124         memcpy(marshalled_dataset,&mu_water,sizeof(mu_water));marshalled_dataset+=sizeof(mu_water);
    125         memcpy(marshalled_dataset,&heatcapacity,sizeof(heatcapacity));marshalled_dataset+=sizeof(heatcapacity);
    126         memcpy(marshalled_dataset,&thermalconductivity,sizeof(thermalconductivity));marshalled_dataset+=sizeof(thermalconductivity);
    127         memcpy(marshalled_dataset,&latentheat,sizeof(latentheat));marshalled_dataset+=sizeof(latentheat);
    128         memcpy(marshalled_dataset,&beta,sizeof(beta));marshalled_dataset+=sizeof(beta);
    129         memcpy(marshalled_dataset,&meltingpoint,sizeof(meltingpoint));marshalled_dataset+=sizeof(meltingpoint);
    130         memcpy(marshalled_dataset,&referencetemperature,sizeof(referencetemperature));marshalled_dataset+=sizeof(referencetemperature);
    131         memcpy(marshalled_dataset,&mixed_layer_capacity,sizeof(mixed_layer_capacity));marshalled_dataset+=sizeof(mixed_layer_capacity);
    132         memcpy(marshalled_dataset,&thermal_exchange_velocity,sizeof(thermal_exchange_velocity));marshalled_dataset+=sizeof(thermal_exchange_velocity);
    133         memcpy(marshalled_dataset,&g,sizeof(g));marshalled_dataset+=sizeof(g);
    134 
    135         *pmarshalled_dataset=marshalled_dataset;
    136         return;
    137 }
    138 /*}}}1*/
    139 /*FUNCTION Matpar::MarshallSize {{{1*/
    140 int   Matpar::MarshallSize(){
    141 
    142         return sizeof(mid)+
    143                 sizeof(rho_ice)+
    144                 sizeof(rho_water)+
    145                 sizeof(mu_water)+
    146                 sizeof(heatcapacity)+
    147                 sizeof(thermalconductivity)+
    148                 sizeof(latentheat)+
    149                 sizeof(beta)+
    150                 sizeof(meltingpoint)+
    151                 sizeof(referencetemperature)+
    152                 sizeof(mixed_layer_capacity)+
    153                 sizeof(thermal_exchange_velocity)+
    154                 sizeof(g)+
    155                 sizeof(int); //sizeof(int) for enum type
    156 }
    157 /*}}}1*/
    158 /*FUNCTION Matpar::Demarshall {{{1*/
    159 void  Matpar::Demarshall(char** pmarshalled_dataset){
    160 
    161         char* marshalled_dataset=NULL;
    162 
    163         /*recover marshalled_dataset: */
    164         marshalled_dataset=*pmarshalled_dataset;
    165 
    166         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    167          *object data (thanks to DataSet::Demarshall):*/
    168 
    169         memcpy(&mid,marshalled_dataset,sizeof(mid));marshalled_dataset+=sizeof(mid);
    170         memcpy(&rho_ice,marshalled_dataset,sizeof(rho_ice));marshalled_dataset+=sizeof(rho_ice);
    171         memcpy(&rho_water,marshalled_dataset,sizeof(rho_water));marshalled_dataset+=sizeof(rho_water);
    172         memcpy(&mu_water,marshalled_dataset,sizeof(mu_water));marshalled_dataset+=sizeof(mu_water);
    173         memcpy(&heatcapacity,marshalled_dataset,sizeof(heatcapacity));marshalled_dataset+=sizeof(heatcapacity);
    174         memcpy(&thermalconductivity,marshalled_dataset,sizeof(thermalconductivity));marshalled_dataset+=sizeof(thermalconductivity);
    175         memcpy(&latentheat,marshalled_dataset,sizeof(latentheat));marshalled_dataset+=sizeof(latentheat);
    176         memcpy(&beta,marshalled_dataset,sizeof(beta));marshalled_dataset+=sizeof(beta);
    177         memcpy(&meltingpoint,marshalled_dataset,sizeof(meltingpoint));marshalled_dataset+=sizeof(meltingpoint);
    178         memcpy(&referencetemperature,marshalled_dataset,sizeof(referencetemperature));marshalled_dataset+=sizeof(referencetemperature);
    179         memcpy(&mixed_layer_capacity,marshalled_dataset,sizeof(mixed_layer_capacity));marshalled_dataset+=sizeof(mixed_layer_capacity);
    180         memcpy(&thermal_exchange_velocity,marshalled_dataset,sizeof(thermal_exchange_velocity));marshalled_dataset+=sizeof(thermal_exchange_velocity);
    181         memcpy(&g,marshalled_dataset,sizeof(g));marshalled_dataset+=sizeof(g);
    182 
    183         /*return: */
    184         *pmarshalled_dataset=marshalled_dataset;
    185         return;
    186 }
    187 /*}}}1*/
    188 #endif
    189104/*FUNCTION Matpar::ObjectEnum{{{1*/
    190105int Matpar::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Materials/Matpar.h

    r11708 r12168  
    4646                int   Id();
    4747                int   MyRank();
    48                 #ifdef _SERIAL_
    49                 void  Marshall(char** pmarshalled_dataset);
    50                 int   MarshallSize();
    51                 void  Demarshall(char** pmarshalled_dataset);
    52                 #endif
    5348                int   ObjectEnum();
    5449                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Node.cpp

    r11708 r12168  
    193193}
    194194/*}}}*/
    195 #ifdef _SERIAL_
    196 /*FUNCTION Node::Marshall{{{1*/
    197 void  Node::Marshall(char** pmarshalled_dataset){
    198 
    199         char* marshalled_dataset=NULL;
    200         int   enum_type=0;
    201         char* marshalled_inputs=NULL;
    202         int   marshalled_inputssize;
    203 
    204         /*recover marshalled_dataset: */
    205         marshalled_dataset=*pmarshalled_dataset;
    206 
    207         /*get enum type of Node: */
    208         enum_type=NodeEnum;
    209        
    210         /*marshall enum: */
    211         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    212        
    213         /*marshall Node data: */
    214         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    215         memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
    216         memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    217         memcpy(marshalled_dataset,&coord_system,9*sizeof(double));marshalled_dataset+=9*sizeof(double); 
    218 
    219         /*marshall objects: */
    220         indexing.Marshall(&marshalled_dataset);
    221         hvertex->Marshall(&marshalled_dataset);
    222 
    223         /*Marshall inputs: */
    224         marshalled_inputssize=inputs->MarshallSize();
    225         marshalled_inputs=inputs->Marshall();
    226         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputssize*sizeof(char));
    227         marshalled_dataset+=marshalled_inputssize;
    228 
    229         /*Free ressources:*/
    230         xfree((void**)&marshalled_inputs);
    231 
    232         *pmarshalled_dataset=marshalled_dataset;
    233         return;
    234 }
    235 /*}}}*/
    236 /*FUNCTION Node::MarshallSize{{{1*/
    237 int   Node::MarshallSize(){
    238 
    239         return sizeof(id)+
    240                 sizeof(sid)+
    241                 indexing.MarshallSize()+
    242                 hvertex->MarshallSize()+
    243                 inputs->MarshallSize()+
    244                 sizeof(analysis_type)+
    245                 9*sizeof(double)+
    246                 sizeof(int); //sizeof(int) for enum type
    247 }
    248 /*}}}*/
    249 /*FUNCTION Node::Demarshall{{{1*/
    250 void  Node::Demarshall(char** pmarshalled_dataset){
    251 
    252         char* marshalled_dataset=NULL;
    253 
    254         /*recover marshalled_dataset: */
    255         marshalled_dataset=*pmarshalled_dataset;
    256 
    257         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    258          *object data (thanks to DataSet::Demarshall):*/
    259 
    260         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    261         memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
    262         memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    263         memcpy(&coord_system,marshalled_dataset,9*sizeof(double));marshalled_dataset+=9*sizeof(double);
    264        
    265         /*demarshall objects: */
    266         indexing.Demarshall(&marshalled_dataset);
    267         hvertex=new Hook(); hvertex->Demarshall(&marshalled_dataset);
    268 
    269         /*demarshall inputs: */
    270         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    271 
    272         /*return: */
    273         *pmarshalled_dataset=marshalled_dataset;
    274         return;
    275 }
    276 /*}}}*/
    277 #endif
    278195/*FUNCTION Node::ObjectEnum{{{1*/
    279196int Node::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Node.h

    r11708 r12168  
    4444                int   Id();
    4545                int   MyRank();
    46                 #ifdef _SERIAL_
    47                 void  Marshall(char** pmarshalled_dataset);
    48                 int   MarshallSize();
    49                 void  Demarshall(char** pmarshalled_dataset);
    50                 #endif
    5146                int   ObjectEnum();
    5247                Object* copy(){_error_("Not implemented yet (similar to Elements)");};
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Numerics/Matrix.cpp

    r12004 r12168  
    140140}
    141141/*}}}*/
    142 
    143 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    144 /*FUNCTION Matrix::ToMatlabMatrix{{{1*/
    145 mxArray* Matrix::ToMatlabMatrix(void){
    146 
    147         mxArray* dataref=NULL;
    148         #ifdef _HAVE_PETSC_
    149         PetscMatrixToMatlabMatrix(&dataref,this->matrix);
    150         #else
    151         dataref=this->matrix->ToMatlabMatrix();
    152         #endif
    153         return dataref;
    154 
    155 }
    156 /*}}}*/
    157 /*FUNCTION MatlabMatrixToMatrix{{{1*/
    158 Matrix* MatlabMatrixToMatrix(const mxArray* mxmatrix){
    159 
    160         int dummy;
    161         Matrix* matrix=NULL;
    162 
    163         /*allocate matrix object: */
    164         matrix=new Matrix();
    165 
    166         #ifdef _HAVE_PETSC_
    167         MatlabMatrixToPetscMatrix(&matrix->matrix,NULL,NULL,mxmatrix);
    168         #else
    169         matrix->matrix=MatlabMatrixToSeqMat(mxmatrix);
    170         #endif
    171        
    172         return matrix;
    173 }
    174 /*}}}*/
    175 #endif
    176142/*FUNCTION Matrix::Assemble{{{1*/
    177143void Matrix::Assemble(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Numerics/Matrix.h

    r12004 r12168  
    2121#endif
    2222
    23 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    24 #include "mex.h"
    25 #endif
    2623class Vector;
    2724
     
    5148                /*Matrix specific routines {{{1*/
    5249                void Echo(void);
    53                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    54                 mxArray* ToMatlabMatrix(void);
    55                 #endif
    5650                void Assemble(void);
    5751                double Norm(NormMode norm_type);
     
    6660
    6761};
    68 /*API: */
    69 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    70 Matrix* MatlabMatrixToMatrix(const mxArray* mxmatrix);
    71 #endif
    7262
    7363#endif //#ifndef _MATRIX_H_
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Numerics/Vector.cpp

    r12004 r12168  
    132132}
    133133/*}}}*/
    134 
    135 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    136 /*FUNCTION Vector::ToMatlabVector{{{1*/
    137 mxArray* Vector::ToMatlabVector(void){
    138 
    139         mxArray* dataref=NULL;
    140         #ifdef _HAVE_PETSC_
    141         PetscVectorToMatlabVector(&dataref,this->vector);
    142         #else
    143         dataref=this->vector->ToMatlabVector();
    144         #endif
    145         return dataref;
    146 
    147 }
    148 /*}}}*/
    149 /*FUNCTION MatlabVectorToVector{{{1*/
    150 Vector* MatlabVectorToVector(const mxArray* mxvector){
    151 
    152         int dummy;
    153         Vector* vector=NULL;
    154 
    155         /*allocate vector object: */
    156         vector=new Vector();
    157 
    158         #ifdef _HAVE_PETSC_
    159         MatlabVectorToPetscVector(&vector->vector,&dummy,mxvector);
    160         #else
    161         vector->vector=MatlabVectorToSeqVec(mxvector);
    162         #endif
    163        
    164         return vector;
    165 }
    166 /*}}}*/
    167 #endif
    168134/*FUNCTION Vector::Assemble{{{1*/
    169135void Vector::Assemble(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Numerics/Vector.h

    r12004 r12168  
    2121#endif
    2222               
    23 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    24 #include "mex.h"
    25 #endif
    26 
    2723/*}}}*/
    2824
     
    5450                /*Vector specific routines {{{1*/
    5551                void Echo(void);
    56                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    57                 mxArray* ToMatlabVector(void);
    58                 #endif
    5952                void    AXPY(Vector *X, double a);
    6053                void    AYPX(Vector *X, double a);
     
    7770};
    7871
    79 /*API: */
    80 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    81 Vector* MatlabVectorToVector(const mxArray* mxvector);
    82 #endif
    8372
    8473#endif //#ifndef _VECTOR_H_
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Object.h

    r9883 r12168  
    2121                virtual int   Id()=0;
    2222                virtual int   MyRank()=0;
    23                 #ifdef _SERIAL_
    24                 virtual void  Marshall(char** pmarshalled_dataset)=0;
    25                 virtual int   MarshallSize()=0;
    26                 virtual void  Demarshall(char** pmarshalled_dataset)=0;
    27                 #endif
    2823                virtual int   ObjectEnum()=0;
    2924                virtual Object* copy()=0;
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/OptArgs.h

    r12004 r12168  
    66#define _OPTARGS_H_
    77
    8 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    9 
    10 #include "mex.h"
    11 struct OptArgs{
    12         char* function_name;
    13         mxArray* femmodel;
    14 };
    15 
    16 #else
    17 
    188class Model;
    199struct OptArgs{
    2010        FemModel* femmodel;
    2111};
    22 #endif
    2312
    2413#endif
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Options/Option.h

    r9883 r12168  
    3333                int   Id(){_error_("Not implemented yet");};
    3434                int   MyRank(){_error_("Not implemented yet");};
    35                 #ifdef _SERIAL_
    36                 void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    37                 int   MarshallSize(){_error_("Not implemented yet");};
    38                 void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    39                 #endif
    4035                int   ObjectEnum(){return OptionEnum;};
    4136                Object* copy(){_error_("Not implemented yet");};
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Options/OptionCell.h

    r9883 r12168  
    3030                int   Id(){_error_("Not implemented yet");};
    3131                int   MyRank(){_error_("Not implemented yet");};
    32                 #ifdef _SERIAL_
    33                 void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    34                 int   MarshallSize(){_error_("Not implemented yet");};
    35                 void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    36                 #endif
    3732                int   ObjectEnum(){return OptionCellEnum;};
    3833                Object* copy(){_error_("Not implemented yet");};
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Options/OptionChar.h

    r9883 r12168  
    3030                int   Id(){_error_("Not implemented yet");};
    3131                int   MyRank(){_error_("Not implemented yet");};
    32                 #ifdef _SERIAL_
    33                 void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    34                 int   MarshallSize(){_error_("Not implemented yet");};
    35                 void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    36                 #endif
    3732                int   ObjectEnum(){return OptionCharEnum;};
    3833                Object* copy(){_error_("Not implemented yet");};
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Options/OptionDouble.h

    r9883 r12168  
    3030                int   Id(){_error_("Not implemented yet");};
    3131                int   MyRank(){_error_("Not implemented yet");};
    32                 #ifdef _SERIAL_
    33                 void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    34                 int   MarshallSize(){_error_("Not implemented yet");};
    35                 void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    36                 #endif
    3732                int   ObjectEnum(){return OptionDoubleEnum;};
    3833                Object* copy(){_error_("Not implemented yet");};
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Options/OptionLogical.h

    r9883 r12168  
    3030                int   Id(){_error_("Not implemented yet");};
    3131                int   MyRank(){_error_("Not implemented yet");};
    32                 #ifdef _SERIAL_
    33                 void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    34                 int   MarshallSize(){_error_("Not implemented yet");};
    35                 void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    36                 #endif
    3732                int   ObjectEnum(){return OptionLogicalEnum;};
    3833                Object* copy(){_error_("Not implemented yet");};
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Options/OptionStruct.h

    r9883 r12168  
    3030                int   Id(){_error_("Not implemented yet");};
    3131                int   MyRank(){_error_("Not implemented yet");};
    32                 #ifdef _SERIAL_
    33                 void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    34                 int   MarshallSize(){_error_("Not implemented yet");};
    35                 void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    36                 #endif
    3732                int   ObjectEnum(){return OptionStructEnum;};
    3833                Object* copy(){_error_("Not implemented yet");};
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/BoolParam.cpp

    r12004 r12168  
    6262}
    6363/*}}}*/
    64 #ifdef _SERIAL_
    65 /*FUNCTION BoolParam::Marshall{{{1*/
    66 void  BoolParam::Marshall(char** pmarshalled_dataset){
    67 
    68         char* marshalled_dataset=NULL;
    69         int   enum_value=0;
    70 
    71         /*recover marshalled_dataset: */
    72         marshalled_dataset=*pmarshalled_dataset;
    73 
    74         /*get enum value of BoolParam: */
    75         enum_value=BoolParamEnum;
    76        
    77         /*marshall enum: */
    78         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    79        
    80         /*marshall BoolParam data: */
    81         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    82         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    83 
    84         *pmarshalled_dataset=marshalled_dataset;
    85 }
    86 /*}}}*/
    87 /*FUNCTION BoolParam::MarshallSize{{{1*/
    88 int   BoolParam::MarshallSize(){
    89        
    90         return sizeof(value)+
    91                 +sizeof(enum_type)+
    92                 +sizeof(int); //sizeof(int) for enum value
    93 }
    94 /*}}}*/
    95 /*FUNCTION BoolParam::Demarshall{{{1*/
    96 void  BoolParam::Demarshall(char** pmarshalled_dataset){
    97 
    98         char* marshalled_dataset=NULL;
    99         int   i;
    100 
    101         /*recover marshalled_dataset: */
    102         marshalled_dataset=*pmarshalled_dataset;
    103 
    104         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    105          *object data (thanks to DataSet::Demarshall):*/
    106         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    107         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    108 
    109         /*return: */
    110         *pmarshalled_dataset=marshalled_dataset;
    111         return;
    112 }
    113 /*}}}*/
    114 #endif
    11564/*FUNCTION BoolParam::ObjectEnum{{{1*/
    11665int BoolParam::ObjectEnum(void){
     
    13483}
    13584/*}}}*/
    136 /*FUNCTION BoolParam::SetMatlabField{{{1*/
    137 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    138 void  BoolParam::SetMatlabField(mxArray* dataref){
    139         char* name=NULL;
    140         this->GetParameterName(&name);
    141         mxSetField( dataref, 0, name,mxCreateDoubleScalar((double)value));
    142 }
    143 #endif
    144 /*}}}*/
    14585/*FUNCTION BoolParam::UnitConversion{{{1*/
    14686void  BoolParam::UnitConversion(int direction_enum){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/BoolParam.h

    r12004 r12168  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4137                int   Id();
    4238                int   MyRank();
    43                 #ifdef _SERIAL_
    44                 void  Marshall(char** pmarshalled_dataset);
    45                 int   MarshallSize();
    46                 void  Demarshall(char** pmarshalled_dataset);
    47                 #endif
    4839                int   ObjectEnum();
    4940                Object* copy();
     
    8172               
    8273                void GetParameterName(char**pname);
    83                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    84                 void  SetMatlabField(mxArray* dataref);
    85                 #endif
    8674                /*}}}*/
    8775};
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/DoubleMatArrayParam.cpp

    r12004 r12168  
    127127}
    128128/*}}}*/
    129 #ifdef _SERIAL_
    130 /*FUNCTION DoubleMatArrayParam::Marshall{{{1*/
    131 void  DoubleMatArrayParam::Marshall(char** pmarshalled_dataset){
    132 
    133         char* marshalled_dataset=NULL;
    134         int   enum_value=0;
    135         int   i;
    136 
    137         /*recover marshalled_dataset: */
    138         marshalled_dataset=*pmarshalled_dataset;
    139 
    140         /*get enum value of DoubleMatArrayParam: */
    141         enum_value=DoubleMatArrayParamEnum;
    142        
    143         /*marshall enum: */
    144         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    145        
    146         /*marshall DoubleMatArrayParam data: */
    147         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    148         memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    149         if(M){
    150                 memcpy(marshalled_dataset,mdim_array,M*sizeof(int));marshalled_dataset+=M*sizeof(int);
    151                 memcpy(marshalled_dataset,ndim_array,M*sizeof(int));marshalled_dataset+=M*sizeof(int);
    152                 for(i=0;i<M;i++){
    153                         double* matrix=this->array[i];
    154                         int     m=this->mdim_array[i];
    155                         int     n=this->ndim_array[i];
    156                         memcpy(marshalled_dataset,&m,sizeof(m));marshalled_dataset+=sizeof(m);
    157                         memcpy(marshalled_dataset,&n,sizeof(n));marshalled_dataset+=sizeof(n);
    158                         if(m*n)memcpy(marshalled_dataset,matrix,m*n*sizeof(double));marshalled_dataset+=m*n*sizeof(double);
    159                 }
    160         }
    161        
    162         *pmarshalled_dataset=marshalled_dataset;
    163 }
    164 /*}}}*/
    165 /*FUNCTION DoubleMatArrayParam::MarshallSize{{{1*/
    166 int   DoubleMatArrayParam::MarshallSize(){
    167 
    168         int size=0;
    169         int i;
    170 
    171         size+=sizeof(enum_type)+
    172                 sizeof(M)+
    173                 M*sizeof(int)+
    174                 M*sizeof(int);
    175 
    176         for(i=0;i<M;i++){
    177                 int     m=this->mdim_array[i];
    178                 int     n=this->ndim_array[i];
    179                 size+=sizeof(m)+sizeof(n)+m*n*sizeof(double);
    180         }
    181         size+=sizeof(int); //sizeof(int) for enum value
    182 
    183         return  size;
    184 }
    185 /*}}}*/
    186 /*FUNCTION DoubleMatArrayParam::Demarshall{{{1*/
    187 void  DoubleMatArrayParam::Demarshall(char** pmarshalled_dataset){
    188 
    189         char* marshalled_dataset=NULL;
    190         int   i;
    191         double* matrix=NULL;
    192         int     m,n;
    193 
    194         /*recover marshalled_dataset: */
    195         marshalled_dataset=*pmarshalled_dataset;
    196 
    197         /*this time, no need to get enum value, the pointer directly points to the beginning of the
    198          *object data (thanks to DataSet::Demarshall):*/
    199        
    200         /*data: */
    201         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    202        
    203         memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    204         if(M){
    205                 this->mdim_array=(int*)xmalloc(M*sizeof(int));
    206                 this->ndim_array=(int*)xmalloc(M*sizeof(int));
    207                 memcpy(this->mdim_array,marshalled_dataset,M*sizeof(int));marshalled_dataset+=M*sizeof(int);
    208                 memcpy(this->ndim_array,marshalled_dataset,M*sizeof(int));marshalled_dataset+=M*sizeof(int);
    209 
    210                 this->array=(double**)xmalloc(M*sizeof(double*));
    211                 for(i=0;i<M;i++){
    212                         memcpy(&m,marshalled_dataset,sizeof(m));marshalled_dataset+=sizeof(m);
    213                         memcpy(&n,marshalled_dataset,sizeof(n));marshalled_dataset+=sizeof(n);
    214                         if(m*n){
    215                                 matrix=(double*)xmalloc(m*n*sizeof(double));
    216                                 memcpy(matrix,marshalled_dataset,m*n*sizeof(double));marshalled_dataset+=m*n*sizeof(double);
    217                         }
    218                         else{
    219                                 matrix=NULL;
    220                         }
    221                         this->array[i]=matrix;
    222                 }
    223         }
    224         else{
    225                 this->array=NULL;
    226                 this->mdim_array=NULL;
    227                 this->ndim_array=NULL;
    228         }
    229 
    230         /*return: */
    231         *pmarshalled_dataset=marshalled_dataset;
    232         return;
    233 }
    234 /*}}}*/
    235 #endif
    236129/*FUNCTION DoubleMatArrayParam::ObjectEnum{{{1*/
    237130int DoubleMatArrayParam::ObjectEnum(void){
     
    307200        EnumToStringx(pname,this->enum_type);
    308201}
    309 /*}}}*/
    310 /*FUNCTION StringArrayParam::SetMatlabField{{{1*/
    311 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    312 void  DoubleMatArrayParam::SetMatlabField(mxArray* dataref){
    313        
    314         int      i,m,n;
    315         double*  matrix=NULL;
    316         double*  outmatrix=NULL;
    317         char*    name=NULL;
    318         mwSize   dims[2]={0};
    319         mxArray* pfield=NULL;
    320         mxArray* pfield2=NULL;
    321         mxArray* pfield3=NULL;
    322        
    323         this->GetParameterName(&name);
    324         dims[0]=this->M;
    325         dims[1]=1;
    326         pfield=mxCreateCellArray(2,dims);
    327 
    328         for(i=0;i<this->M;i++){
    329                 matrix=this->array[i];
    330                 m=this->mdim_array[i];
    331                 n=this->ndim_array[i];
    332                 outmatrix=(double*)xmalloc(m*n*sizeof(double));
    333                 memcpy(outmatrix,matrix,m*n*sizeof(double));
    334        
    335                 pfield2=mxCreateDoubleMatrix(0,0,mxREAL);
    336                 mxSetM(pfield2,n);
    337                 mxSetN(pfield2,m);
    338                 mxSetPr(pfield2,outmatrix);
    339 
    340                 //transpose the outmatrix, written directly to matlab! from C to matlab.
    341                 mexCallMATLAB(1,&pfield3, 1, &pfield2, "transpose");
    342        
    343                 mxSetCell(pfield,i,pfield3);
    344         }
    345        
    346         mxSetField( dataref, 0, name,pfield);
    347 }
    348 #endif
    349202/*}}}*/
    350203/*FUNCTION DoubleMatArrayParam::SetValue(double** array, int M, int* mdim_array, int* ndim_array){{{1*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/DoubleMatArrayParam.h

    r12004 r12168  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4440                int   Id();
    4541                int   MyRank();
    46                 #ifdef _SERIAL_
    47                 void  Marshall(char** pmarshalled_dataset);
    48                 int   MarshallSize();
    49                 void  Demarshall(char** pmarshalled_dataset);
    50                 #endif
    5142                int   ObjectEnum();
    5243                Object* copy();
     
    8475
    8576                void GetParameterName(char**pname);
    86                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    87                 void  SetMatlabField(mxArray* dataref);
    88                 #endif
    8977
    9078                /*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/DoubleMatParam.cpp

    r12004 r12168  
    7878}
    7979/*}}}*/
    80 #ifdef _SERIAL_
    81 /*FUNCTION DoubleMatParam::Marshall{{{1*/
    82 void  DoubleMatParam::Marshall(char** pmarshalled_dataset){
    83 
    84         char* marshalled_dataset=NULL;
    85         int   enum_value=0;
    86 
    87         /*recover marshalled_dataset: */
    88         marshalled_dataset=*pmarshalled_dataset;
    89 
    90         /*get enum value of DoubleMatParam: */
    91         enum_value=DoubleMatParamEnum;
    92        
    93         /*marshall enum: */
    94         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    95        
    96         /*marshall DoubleMatParam data: */
    97         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    98         memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    99         memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
    100         memcpy(marshalled_dataset,value,M*N*sizeof(double));marshalled_dataset+=M*N*sizeof(double);
    101 
    102         *pmarshalled_dataset=marshalled_dataset;
    103 }
    104 /*}}}*/
    105 /*FUNCTION DoubleMatParam::MarshallSize{{{1*/
    106 int   DoubleMatParam::MarshallSize(){
    107        
    108         return sizeof(M)
    109                 +sizeof(N)
    110                 +M*N*sizeof(double)
    111                 +sizeof(enum_type)+
    112                 +sizeof(int); //sizeof(int) for enum value
    113 }
    114 /*}}}*/
    115 /*FUNCTION DoubleMatParam::Demarshall{{{1*/
    116 void  DoubleMatParam::Demarshall(char** pmarshalled_dataset){
    117 
    118         char* marshalled_dataset=NULL;
    119         int   i;
    120 
    121         /*recover marshalled_dataset: */
    122         marshalled_dataset=*pmarshalled_dataset;
    123 
    124         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    125          *object data (thanks to DataSet::Demarshall):*/
    126         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    127        
    128         /*data: */
    129         memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    130         memcpy(&N,marshalled_dataset,sizeof(N));marshalled_dataset+=sizeof(N);
    131         value=(double*)xmalloc(M*N*sizeof(double));
    132         memcpy(value,marshalled_dataset,M*N*sizeof(double));marshalled_dataset+=M*N*sizeof(double);
    133 
    134         /*return: */
    135         *pmarshalled_dataset=marshalled_dataset;
    136         return;
    137 }
    138 /*}}}*/
    139 #endif
    14080/*FUNCTION DoubleMatParam::ObjectEnum{{{1*/
    14181int DoubleMatParam::ObjectEnum(void){
     
    169109/*FUNCTION DoubleMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){{{1*/
    170110void  DoubleMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){
    171 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    172         int* output=NULL;
    173         int  i;
    174 
    175         output=(int*)xmalloc((int)(M*N*sizeof(int)));
    176         for(i=0;i<M*N;i++) output[i]=(int)value[i];
    177 
    178         /*Assign output pointers:*/
    179         if(pM) *pM=M;
    180         if(pN) *pN=N;
    181         *pintarray=output;
    182 #else
    183111        _error_("DoubleMat of enum %i (%s) cannot return an array of int",enum_type,EnumToStringx(enum_type));
    184 #endif
    185112}
    186113/*}}}*/
     
    189116        EnumToStringx(pname,this->enum_type);
    190117}
    191 /*}}}*/
    192 /*FUNCTION DoubleMatParam::SetMatlabField{{{1*/
    193 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    194 void  DoubleMatParam::SetMatlabField(mxArray* dataref){
    195 
    196         mxArray* pfield=NULL;
    197         mxArray* pfield2=NULL;
    198         double* doublemat=NULL;
    199         char* name=NULL;
    200        
    201         this->GetParameterName(&name);
    202         this->GetParameterValue(&doublemat,NULL,NULL);
    203                                
    204         pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    205         mxSetM(pfield,N);
    206         mxSetN(pfield,M);
    207         mxSetPr(pfield,doublemat);
    208        
    209         //transpose the matrix, written directly to matlab! from C to matlab.
    210         mexCallMATLAB(1,&pfield2, 1, &pfield, "transpose");
    211         mxSetField( dataref, 0, name,pfield2);
    212 }
    213 #endif
    214118/*}}}*/
    215119/*FUNCTION DoubleMatParam::SetValue{{{1*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/DoubleMatParam.h

    r12004 r12168  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4339                int   Id();
    4440                int   MyRank();
    45                 #ifdef _SERIAL_
    46                 void  Marshall(char** pmarshalled_dataset);
    47                 int   MarshallSize();
    48                 void  Demarshall(char** pmarshalled_dataset);
    49                 #endif
    5041                int   ObjectEnum();
    5142                Object* copy();
     
    8475
    8576                void GetParameterName(char**pname);
    86                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    87                 void  SetMatlabField(mxArray* dataref);
    88                 #endif
    8977
    9078                /*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/DoubleParam.cpp

    r12004 r12168  
    5959}
    6060/*}}}*/
    61 #ifdef _SERIAL_
    62 /*FUNCTION DoubleParam::Marshall{{{1*/
    63 void  DoubleParam::Marshall(char** pmarshalled_dataset){
    64 
    65         char* marshalled_dataset=NULL;
    66         int   enum_value=0;
    67 
    68         /*recover marshalled_dataset: */
    69         marshalled_dataset=*pmarshalled_dataset;
    70 
    71         /*get enum value of DoubleParam: */
    72         enum_value=DoubleParamEnum;
    73        
    74         /*marshall enum: */
    75         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    76        
    77         /*marshall DoubleParam data: */
    78         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    79         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    80 
    81         *pmarshalled_dataset=marshalled_dataset;
    82 }
    83 /*}}}*/
    84 /*FUNCTION DoubleParam::MarshallSize{{{1*/
    85 int   DoubleParam::MarshallSize(){
    86        
    87         return sizeof(value)+
    88                 +sizeof(enum_type)+
    89                 +sizeof(int); //sizeof(int) for enum value
    90 }
    91 /*}}}*/
    92 /*FUNCTION DoubleParam::Demarshall{{{1*/
    93 void  DoubleParam::Demarshall(char** pmarshalled_dataset){
    94 
    95         char* marshalled_dataset=NULL;
    96         int   i;
    97 
    98         /*recover marshalled_dataset: */
    99         marshalled_dataset=*pmarshalled_dataset;
    100 
    101         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    102          *object data (thanks to DataSet::Demarshall):*/
    103         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    104         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    105 
    106         /*return: */
    107         *pmarshalled_dataset=marshalled_dataset;
    108         return;
    109 }
    110 /*}}}*/
    111 #endif
    11261/*FUNCTION DoubleParam::ObjectEnum{{{1*/
    11362int DoubleParam::ObjectEnum(void){
     
    13382/*FUNCTION DoubleParam::GetParameterValue(int* pinteger){{{1*/
    13483void DoubleParam::GetParameterValue(int* pinteger){
    135 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    136         *pinteger=(int)value;
    137 #else
    13884        _error_("Double param of enum %i (%s) cannot return an integer",enum_type,EnumToStringx(enum_type));
    139 #endif
    14085}
    14186/*}}}*/
    14287/*FUNCTION DoubleParam::GetParameterValue(bool* pbool){{{1*/
    14388void DoubleParam::GetParameterValue(bool* pbool){
    144 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    145 
    146         /*If debugging mode, cheeck that the double is 0 or 1*/
    147         _assert_(value==0 || value==1);
    148         *pbool=(bool)value;
    149 
    150 #else
    15189        _error_("Double param of enum %i (%s) cannot return an bool",enum_type,EnumToStringx(enum_type));
    152 #endif
    15390}
    15491/*}}}*/
    15592/*FUNCTION DoubleParam::GetParameterValue(int** pintarray,int* pM){{{1*/
    15693void DoubleParam::GetParameterValue(int** pintarray,int* pM){
    157 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    158         int* output=NULL;
    159 
    160         output=(int*)xmalloc(1*sizeof(int));
    161         *output=(int)value;
    162 
    163         /*Assign output pointers:*/
    164         if(pM) *pM=1;
    165         *pintarray=output;
    166 #else
    16794        _error_("Double param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));
    168 #endif
    16995}
    17096/*}}}*/
    17197/*FUNCTION DoubleParam::GetParameterValue(int** pintarray,int* pM,int* pN){{{1*/
    17298void DoubleParam::GetParameterValue(int** pintarray,int* pM,int* pN){
    173 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    174         int* output=NULL;
    175 
    176         output=(int*)xmalloc(1*sizeof(int));
    177         *output=(int)value;
    178 
    179         /*Assign output pointers:*/
    180         if(pM) *pM=1;
    181         if(pN) *pN=1;
    182         *pintarray=output;
    183 #else
    18499        _error_("Double param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));
    185 #endif
    186100}
    187101/*}}}*/
    188102/*FUNCTION DoubleParam::GetParameterValue(double** pdoublearray,int* pM){{{1*/
    189103void DoubleParam::GetParameterValue(double** pdoublearray,int* pM){
    190 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    191         double* output=NULL;
    192 
    193         output=(double*)xmalloc(1*sizeof(double));
    194         *output=(double)value;
    195 
    196         /*Assign output podoubleers:*/
    197         if(pM) *pM=1;
    198         *pdoublearray=output;
    199 #else
    200104        _error_("Double param of enum %i (%s) cannot return an array of double",enum_type,EnumToStringx(enum_type));
    201 #endif
    202105}
    203106/*}}}*/
    204107/*FUNCTION DoubleParam::GetParameterValue(double** pdoublearray,int* pM,int* pN){{{1*/
    205108void DoubleParam::GetParameterValue(double** pdoublearray,int* pM,int* pN){
    206 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    207         double* output=NULL;
    208 
    209         output=(double*)xmalloc(1*sizeof(double));
    210         *output=(double)value;
    211 
    212         /*Assign output podoubleers:*/
    213         if(pM) *pM=1;
    214         if(pN) *pN=1;
    215         *pdoublearray=output;
    216 #else
    217109        _error_("Double param of enum %i (%s) cannot return an array of double",enum_type,EnumToStringx(enum_type));
    218 #endif
    219110}
    220 /*}}}*/
    221 /*FUNCTION DoubleParam::SetMatlabField{{{1*/
    222 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    223 void  DoubleParam::SetMatlabField(mxArray* dataref){
    224 
    225         char* name=NULL;
    226         this->GetParameterName(&name);
    227         mxSetField( dataref, 0, name,mxCreateDoubleScalar(value));
    228 }
    229 #endif
    230111/*}}}*/
    231112/*FUNCTION DoubleParam::UnitConversion{{{1*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/DoubleParam.h

    r12004 r12168  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4238                int   Id();
    4339                int   MyRank();
    44                 #ifdef _SERIAL_
    45                 void  Marshall(char** pmarshalled_dataset);
    46                 int   MarshallSize();
    47                 void  Demarshall(char** pmarshalled_dataset);
    48                 #endif
    4940                int   ObjectEnum();
    5041                Object* copy();
     
    8273
    8374                void GetParameterName(char**pname);
    84                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    85                 void  SetMatlabField(mxArray* dataref);
    86                 #endif
    8775
    8876                /*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/DoubleTransientMatParam.h

    r12004 r12168  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/DoubleVecParam.cpp

    r12004 r12168  
    7575}
    7676/*}}}*/
    77 #ifdef _SERIAL_
    78 /*FUNCTION DoubleVecParam::Marshall{{{1*/
    79 void  DoubleVecParam::Marshall(char** pmarshalled_dataset){
    80 
    81         char* marshalled_dataset=NULL;
    82         int   enum_value=0;
    83 
    84         /*recover marshalled_dataset: */
    85         marshalled_dataset=*pmarshalled_dataset;
    86 
    87         /*get enum value of DoubleVecParam: */
    88         enum_value=DoubleVecParamEnum;
    89        
    90         /*marshall enum: */
    91         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    92        
    93         /*marshall DoubleVecParam data: */
    94         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    95         memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    96         memcpy(marshalled_dataset,values,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
    97 
    98         *pmarshalled_dataset=marshalled_dataset;
    99 }
    100 /*}}}*/
    101 /*FUNCTION DoubleVecParam::MarshallSize{{{1*/
    102 int   DoubleVecParam::MarshallSize(){
    103        
    104         return sizeof(M)
    105                 +M*sizeof(double)
    106                 +sizeof(enum_type)+
    107                 +sizeof(int); //sizeof(int) for enum value
    108 }
    109 /*}}}*/
    110 /*FUNCTION DoubleVecParam::Demarshall{{{1*/
    111 void  DoubleVecParam::Demarshall(char** pmarshalled_dataset){
    112 
    113         char* marshalled_dataset=NULL;
    114         int   i;
    115 
    116         /*recover marshalled_dataset: */
    117         marshalled_dataset=*pmarshalled_dataset;
    118 
    119         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    120          *object data (thanks to DataSet::Demarshall):*/
    121         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    122        
    123         /*data: */
    124         memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    125         values=(double*)xmalloc(M*sizeof(double));
    126         memcpy(values,marshalled_dataset,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
    127 
    128         /*return: */
    129         *pmarshalled_dataset=marshalled_dataset;
    130         return;
    131 }
    132 /*}}}*/
    133 #endif
    13477/*FUNCTION DoubleVecParam::ObjectEnum{{{1*/
    13578int DoubleVecParam::ObjectEnum(void){
     
    181124/*FUNCTION DoubleVecParam::GetParameterValue(int** pintarray,int* pM){{{1*/
    182125void  DoubleVecParam::GetParameterValue(int** pintarray,int* pM){
    183 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    184         int* output=NULL;
    185         int i;
    186 
    187         /*Cast values into integers*/
    188         output=(int*)xmalloc(M*sizeof(int));
    189         for(i=0;i<M;i++) output[i]=(int)values[i];
    190 
    191         /*Assign output pointers:*/
    192         if(pM) *pM=M;
    193         *pintarray=output;
    194 #else
    195126        _error_("DoubleVec param of enum %i (%s) cannot return an array of int",enum_type,EnumToStringx(enum_type));
    196 #endif
    197127}
    198128/*}}}*/
     
    201131        EnumToStringx(pname,this->enum_type);
    202132}
    203 /*}}}*/
    204 /*FUNCTION DoubleVecParam::SetMatlabField{{{1*/
    205 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    206 void  DoubleVecParam::SetMatlabField(mxArray* dataref){
    207 
    208         char* name=NULL;
    209         double* doublevec=NULL;
    210         mxArray* pfield=NULL;
    211 
    212         this->GetParameterValue(&doublevec,NULL);
    213         this->GetParameterName(&name);
    214                                
    215         pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    216         mxSetM(pfield,M);
    217         mxSetN(pfield,1);
    218         mxSetPr(pfield,doublevec);
    219        
    220         mxSetField( dataref, 0, name, pfield);
    221 }
    222 #endif
    223133/*}}}*/
    224134/*FUNCTION DoubleVecParam::SetValue{{{1*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/DoubleVecParam.h

    r12004 r12168  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4238                int   Id();
    4339                int   MyRank();
    44                 #ifdef _SERIAL_
    45                 void  Marshall(char** pmarshalled_dataset);
    46                 int   MarshallSize();
    47                 void  Demarshall(char** pmarshalled_dataset);
    48                 #endif
    4940                int   ObjectEnum();
    5041                Object* copy();
     
    8273               
    8374                void GetParameterName(char**pname);
    84                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    85                 void  SetMatlabField(mxArray* dataref);
    86                 #endif
    8775                /*}}}*/
    8876};
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/FileParam.cpp

    r12004 r12168  
    6262}
    6363/*}}}*/
    64 #ifdef _SERIAL_
    65 /*FUNCTION FileParam::Marshall{{{1*/
    66 void  FileParam::Marshall(char** pmarshalled_dataset){
    67 
    68         _error_("FileParam is a pointer and cannot be marshalled");
    69 }
    70 /*}}}*/
    71 /*FUNCTION FileParam::MarshallSize{{{1*/
    72 int   FileParam::MarshallSize(){
    73         _error_("FileParam is a pointer and cannot be marshalled");
    74 }
    75 /*}}}*/
    76 /*FUNCTION FileParam::Demarshall{{{1*/
    77 void  FileParam::Demarshall(char** pmarshalled_dataset){
    78         _error_("FileParam is a pointer and cannot be marshalled");
    79 }
    80 /*}}}*/
    81 #endif
    8264/*FUNCTION FileParam::ObjectEnum{{{1*/
    8365int FileParam::ObjectEnum(void){
     
    10183}
    10284/*}}}*/
    103 /*FUNCTION FileParam::SetMatlabField{{{1*/
    104 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    105 void  FileParam::SetMatlabField(mxArray* dataref){
    106        
    107         _error_("FileParam is a pointer and cannot be converted into a matlab object");
    108 }
    109 #endif
    110 /*}}}*/
    11185/*FUNCTION FileParam::UnitConversion{{{1*/
    11286void  FileParam::UnitConversion(int direction_enum){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/FileParam.h

    r12004 r12168  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4137                int   Id();
    4238                int   MyRank();
    43                 #ifdef _SERIAL_
    44                 void  Marshall(char** pmarshalled_dataset);
    45                 int   MarshallSize();
    46                 void  Demarshall(char** pmarshalled_dataset);
    47                 #endif
    4839                int   ObjectEnum();
    4940                Object* copy();
     
    8172
    8273                void GetParameterName(char**pname);
    83                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    84                 void  SetMatlabField(mxArray* dataref);
    85                 #endif
    8674
    8775                /*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/IntMatParam.cpp

    r12004 r12168  
    7878}
    7979/*}}}*/
    80 #ifdef _SERIAL_
    81 /*FUNCTION IntMatParam::Marshall{{{1*/
    82 void  IntMatParam::Marshall(char** pmarshalled_dataset){
    83 
    84         char* marshalled_dataset=NULL;
    85         int   enum_value=0;
    86 
    87         /*recover marshalled_dataset: */
    88         marshalled_dataset=*pmarshalled_dataset;
    89 
    90         /*get enum value of IntMatParam: */
    91         enum_value=IntMatParamEnum;
    92        
    93         /*marshall enum: */
    94         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    95        
    96         /*marshall IntMatParam data: */
    97         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    98         memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    99         memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
    100         memcpy(marshalled_dataset,value,M*N*sizeof(int));marshalled_dataset+=M*N*sizeof(int);
    101 
    102         *pmarshalled_dataset=marshalled_dataset;
    103 }
    104 /*}}}*/
    105 /*FUNCTION IntMatParam::MarshallSize{{{1*/
    106 int   IntMatParam::MarshallSize(){
    107        
    108         return sizeof(M)
    109                 +sizeof(N)
    110                 +M*N*sizeof(int)
    111                 +sizeof(enum_type)+
    112                 +sizeof(int); //sizeof(int) for enum value
    113 }
    114 /*}}}*/
    115 /*FUNCTION IntMatParam::Demarshall{{{1*/
    116 void  IntMatParam::Demarshall(char** pmarshalled_dataset){
    117 
    118         char* marshalled_dataset=NULL;
    119         int   i;
    120 
    121         /*recover marshalled_dataset: */
    122         marshalled_dataset=*pmarshalled_dataset;
    123 
    124         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    125          *object data (thanks to DataSet::Demarshall):*/
    126         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    127        
    128         /*data: */
    129         memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    130         memcpy(&N,marshalled_dataset,sizeof(N));marshalled_dataset+=sizeof(N);
    131         value=(int*)xmalloc(M*N*sizeof(int));
    132         memcpy(value,marshalled_dataset,M*N*sizeof(int));marshalled_dataset+=M*N*sizeof(int);
    133 
    134         /*return: */
    135         *pmarshalled_dataset=marshalled_dataset;
    136         return;
    137 }
    138 /*}}}*/
    139 #endif
    14080/*FUNCTION IntMatParam::ObjectEnum{{{1*/
    14181int IntMatParam::ObjectEnum(void){
     
    172112}
    173113/*}}}*/
    174 /*FUNCTION IntMatParam::SetMatlabField{{{1*/
    175 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    176 void  IntMatParam::SetMatlabField(mxArray* dataref){
    177 
    178         char    *name        = NULL;
    179         double  *doublearray = NULL;
    180         int     *intarray    = NULL;
    181         mxArray *pfield      = NULL;
    182         mxArray *pfield2     = NULL;
    183 
    184         this->GetParameterValue(&intarray,NULL,NULL);
    185         this->GetParameterName(&name);
    186 
    187         /*cast intarray into doublearray for Matlab*/
    188         doublearray=(double*)xmalloc(M*N*sizeof(double));
    189         for(int i=0;i<M*N;i++)doublearray[i]=(double)intarray[i];
    190         xfree((void**)&intarray);
    191 
    192         pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    193         mxSetM(pfield,M);
    194         mxSetN(pfield,N);
    195         mxSetPr(pfield,doublearray);
    196 
    197         //transpose the matrix, written directly to matlab! from C to matlab.
    198         mexCallMATLAB(1,&pfield2, 1, &pfield, "transpose");
    199         mxSetField( dataref, 0, name,pfield2);
    200 }
    201 #endif
    202 /*}}}*/
    203114/*FUNCTION IntMatParam::SetValue{{{1*/
    204115void  IntMatParam::SetValue(int* intarray,int in_M,int in_N){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/IntMatParam.h

    r12004 r12168  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4339                int   Id();
    4440                int   MyRank();
    45                 #ifdef _SERIAL_
    46                 void  Marshall(char** pmarshalled_dataset);
    47                 int   MarshallSize();
    48                 void  Demarshall(char** pmarshalled_dataset);
    49                 #endif
    5041                int   ObjectEnum();
    5142                Object* copy();
     
    8374
    8475                void GetParameterName(char**pname);
    85                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    86                 void  SetMatlabField(mxArray* dataref);
    87                 #endif
    8876
    8977                /*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/IntParam.cpp

    r12004 r12168  
    6262}
    6363/*}}}*/
    64 #ifdef _SERIAL_
    65 /*FUNCTION IntParam::Marshall{{{1*/
    66 void  IntParam::Marshall(char** pmarshalled_dataset){
    67 
    68         char* marshalled_dataset=NULL;
    69         int   enum_value=0;
    70 
    71         /*recover marshalled_dataset: */
    72         marshalled_dataset=*pmarshalled_dataset;
    73 
    74         /*get enum value of IntParam: */
    75         enum_value=IntParamEnum;
    76        
    77         /*marshall enum: */
    78         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    79        
    80         /*marshall IntParam data: */
    81         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    82         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    83 
    84         *pmarshalled_dataset=marshalled_dataset;
    85 }
    86 /*}}}*/
    87 /*FUNCTION IntParam::MarshallSize{{{1*/
    88 int   IntParam::MarshallSize(){
    89        
    90         return sizeof(value)+
    91                 +sizeof(enum_type)+
    92                 +sizeof(int); //sizeof(int) for enum value
    93 }
    94 /*}}}*/
    95 /*FUNCTION IntParam::Demarshall{{{1*/
    96 void  IntParam::Demarshall(char** pmarshalled_dataset){
    97 
    98         char* marshalled_dataset=NULL;
    99         int   i;
    100 
    101         /*recover marshalled_dataset: */
    102         marshalled_dataset=*pmarshalled_dataset;
    103 
    104         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    105          *object data (thanks to DataSet::Demarshall):*/
    106         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    107         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    108 
    109         /*return: */
    110         *pmarshalled_dataset=marshalled_dataset;
    111         return;
    112 }
    113 /*}}}*/
    114 #endif
    11564/*FUNCTION IntParam::ObjectEnum{{{1*/
    11665int IntParam::ObjectEnum(void){
     
    13483}
    13584/*}}}*/
    136 /*FUNCTION IntParam::SetMatlabField{{{1*/
    137 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    138 void  IntParam::SetMatlabField(mxArray* dataref){
    139        
    140         char* name=NULL;
    141         this->GetParameterName(&name);
    142         mxSetField( dataref, 0, name,mxCreateDoubleScalar((double)value));
    143 }
    144 #endif
    145 /*}}}*/
    14685/*FUNCTION IntParam::UnitConversion{{{1*/
    14786void  IntParam::UnitConversion(int direction_enum){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/IntParam.h

    r12004 r12168  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4238                int   Id();
    4339                int   MyRank();
    44                 #ifdef _SERIAL_
    45                 void  Marshall(char** pmarshalled_dataset);
    46                 int   MarshallSize();
    47                 void  Demarshall(char** pmarshalled_dataset);
    48                 #endif
    4940                int   ObjectEnum();
    5041                Object* copy();
     
    8273
    8374                void GetParameterName(char**pname);
    84                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    85                 void  SetMatlabField(mxArray* dataref);
    86                 #endif
    8775
    8876                /*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/IntVecParam.cpp

    r12004 r12168  
    9191}
    9292/*}}}*/
    93 #ifdef _SERIAL_
    94 /*FUNCTION IntVecParam::Marshall{{{1*/
    95 void  IntVecParam::Marshall(char** pmarshalled_dataset){
    96 
    97         char* marshalled_dataset=NULL;
    98         int   enum_value=0;
    99 
    100         /*recover marshalled_dataset: */
    101         marshalled_dataset=*pmarshalled_dataset;
    102 
    103         /*get enum value of IntVecParam: */
    104         enum_value=IntVecParamEnum;
    105        
    106         /*marshall enum: */
    107         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    108        
    109         /*marshall IntVecParam data: */
    110         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    111         memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    112         if(M)memcpy(marshalled_dataset,values,M*sizeof(int));marshalled_dataset+=M*sizeof(int);
    113 
    114         *pmarshalled_dataset=marshalled_dataset;
    115 }
    116 /*}}}*/
    117 /*FUNCTION IntVecParam::MarshallSize{{{1*/
    118 int   IntVecParam::MarshallSize(){
    119        
    120         return sizeof(M)+
    121                 +M*sizeof(int)
    122                 +sizeof(enum_type)+
    123                 +sizeof(int); //sizeof(int) for enum value
    124 }
    125 /*}}}*/
    126 /*FUNCTION IntVecParam::Demarshall{{{1*/
    127 void  IntVecParam::Demarshall(char** pmarshalled_dataset){
    128 
    129         char* marshalled_dataset=NULL;
    130         int   i;
    131 
    132         /*recover marshalled_dataset: */
    133         marshalled_dataset=*pmarshalled_dataset;
    134 
    135         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    136          *object data (thanks to DataSet::Demarshall):*/
    137         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    138        
    139         /*data: */
    140         memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    141         if(M) {
    142                 values=(int*)xmalloc(M*sizeof(int));
    143                 memcpy(values,marshalled_dataset,M*sizeof(int));marshalled_dataset+=M*sizeof(int);
    144         }
    145 
    146         /*return: */
    147         *pmarshalled_dataset=marshalled_dataset;
    148         return;
    149 }
    150 /*}}}*/
    151 #endif
    15293/*FUNCTION IntVecParam::ObjectEnum{{{1*/
    15394int IntVecParam::ObjectEnum(void){
     
    185126}
    186127/*}}}*/
    187 /*FUNCTION IntVecParam::SetMatlabField{{{1*/
    188 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    189 void  IntVecParam::SetMatlabField(mxArray* dataref){
    190 
    191         char    *name      = NULL;
    192         double  *doublevec = NULL;
    193         int     *intvec    = NULL;
    194         mxArray *pfield    = NULL;
    195 
    196         this->GetParameterValue(&intvec,NULL);
    197         this->GetParameterName(&name);
    198 
    199         /*cast intvec into doublevec for Matlab*/
    200         if(M){
    201                 doublevec=(double*)xmalloc(M*sizeof(double));
    202                 for(int i=0;i<M;i++)doublevec[i]=(double)intvec[i];
    203         }
    204         else doublevec=NULL;
    205         xfree((void**)&intvec);
    206                                
    207         pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    208         mxSetM(pfield,M);
    209         mxSetN(pfield,1);
    210         mxSetPr(pfield,doublevec);
    211        
    212         mxSetField(dataref, 0, name, pfield);
    213 }
    214 #endif
    215 /*}}}*/
    216128/*FUNCTION IntVecParam::SetValue{{{1*/
    217129void  IntVecParam::SetValue(int* intarray,int in_M){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/IntVecParam.h

    r12004 r12168  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4339                int   Id();
    4440                int   MyRank();
    45                 #ifdef _SERIAL_
    46                 void  Marshall(char** pmarshalled_dataset);
    47                 int   MarshallSize();
    48                 void  Demarshall(char** pmarshalled_dataset);
    49                 #endif
    5041                int   ObjectEnum();
    5142                Object* copy();
     
    8374               
    8475                void GetParameterName(char**pname);
    85                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    86                 void  SetMatlabField(mxArray* dataref);
    87                 #endif
    8876                /*}}}*/
    8977};
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/MatrixParam.cpp

    r12004 r12168  
    7070}
    7171/*}}}*/
    72 #ifdef _SERIAL_
    73 /*FUNCTION MatrixParam::Marshall{{{1*/
    74 void  MatrixParam::Marshall(char** pmarshalled_dataset){
    75 
    76         char* marshalled_dataset=NULL;
    77         int   enum_value=0;
    78         int   M,N;
    79         double* serial_mat=NULL;
    80 
    81         /*recover marshalled_dataset: */
    82         marshalled_dataset=*pmarshalled_dataset;
    83 
    84         /*get enum value of MatrixParam: */
    85         enum_value=MatrixParamEnum;
    86        
    87         /*marshall enum: */
    88         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    89        
    90         /*marshall MatrixParam data: */
    91         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    92         if(value){
    93                 value->GetSize(&M,&N);
    94                 serial_mat=value->ToSerial();
    95                 memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    96                 memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
    97                 memcpy(marshalled_dataset,serial_mat,M*N*sizeof(double));marshalled_dataset+=(M*N*sizeof(double));
    98         }
    99         else{
    100                 M=0;
    101                 N=0;
    102                 memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    103                 memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
    104         }
    105        
    106         /*Free ressources:*/
    107         xfree((void**)&serial_mat);
    108 
    109         /*return:*/
    110         *pmarshalled_dataset=marshalled_dataset;
    111 }
    112 /*}}}*/
    113 /*FUNCTION MatrixParam::MarshallSize{{{1*/
    114 int   MatrixParam::MarshallSize(){
    115 
    116         int M=0;
    117         int N=0;
    118         if(value)value->GetSize(&M,&N);
    119                        
    120         return sizeof(M)+
    121                 sizeof(N)+
    122                 M*N*sizeof(double)+
    123                 +sizeof(enum_type)+
    124                 +sizeof(int); //sizeof(int) for enum value
    125 }
    126 /*}}}*/
    127 /*FUNCTION MatrixParam::Demarshall{{{1*/
    128 void  MatrixParam::Demarshall(char** pmarshalled_dataset){
    129 
    130         char* marshalled_dataset=NULL;
    131         int   M,N;
    132         double* serial_mat=NULL;
    133 
    134         /*recover marshalled_dataset: */
    135         marshalled_dataset=*pmarshalled_dataset;
    136 
    137         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    138          *object data (thanks to DataSet::Demarshall):*/
    139         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    140        
    141         /*data: */
    142         memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    143         memcpy(&N,marshalled_dataset,sizeof(N));marshalled_dataset+=sizeof(N);
    144         if(M!=0 && N!=0){
    145                 serial_mat=(double*)xmalloc(M*N*sizeof(double));
    146                 memcpy(serial_mat,marshalled_dataset,M*N*sizeof(double));marshalled_dataset+=(M*N*sizeof(double));
    147                 value=new Matrix(serial_mat,M,N,.001);
    148         }
    149         else{
    150                 value=NULL;
    151         }
    152 
    153         /*Free ressources:*/
    154         xfree((void**)&serial_mat);
    155 
    156         /*return: */
    157         *pmarshalled_dataset=marshalled_dataset;
    158 }
    159 /*}}}*/
    160 #endif
    16172/*FUNCTION MatrixParam::ObjectEnum{{{1*/
    16273int MatrixParam::ObjectEnum(void){
     
    190101}
    191102/*}}}*/
    192 /*FUNCTION MatrixParam::SetMatlabField{{{1*/
    193 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    194 void  MatrixParam::SetMatlabField(mxArray* dataref){
    195        
    196         char* name=NULL;
    197         int   M,N;
    198         double* doublemat=NULL;
    199         mxArray* pfield=NULL;
    200 
    201         doublemat=value->ToSerial();
    202         value->GetSize(&M,&N);
    203         this->GetParameterName(&name);
    204                                
    205         pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    206         mxSetM(pfield,M);
    207         mxSetN(pfield,N);
    208         mxSetPr(pfield,doublemat);
    209         mxSetField( dataref, 0, name, pfield);
    210 }
    211 #endif
    212 /*}}}*/
    213103/*FUNCTION MatrixParam::SetValue{{{1*/
    214104void  MatrixParam::SetValue(Matrix* matrix){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/MatrixParam.h

    r12004 r12168  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4238                int   Id();
    4339                int   MyRank();
    44                 #ifdef _SERIAL_
    45                 void  Marshall(char** pmarshalled_dataset);
    46                 int   MarshallSize();
    47                 void  Demarshall(char** pmarshalled_dataset);
    48                 #endif
    4940                int   ObjectEnum();
    5041                Object* copy();
     
    8273
    8374                void GetParameterName(char**pname);
    84                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    85                 void  SetMatlabField(mxArray* dataref);
    86                 #endif
    8775
    8876                /*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/Param.h

    r12004 r12168  
    1414#else
    1515#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    16 #endif
    17 
    18 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    19 #include <mex.h>
    2016#endif
    2117
     
    6056                virtual void  UnitConversion(int direction_enum)=0;
    6157                virtual void  GetParameterName(char**pname)=0;
    62                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    63                 virtual void  SetMatlabField(mxArray* dataref)=0;
    64                 #endif
    6558};
    6659#endif
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/StringArrayParam.cpp

    r12004 r12168  
    9292}
    9393/*}}}*/
    94 #ifdef _SERIAL_
    95 /*FUNCTION StringArrayParam::Marshall{{{1*/
    96 void  StringArrayParam::Marshall(char** pmarshalled_dataset){
    97 
    98         int   i;
    99         char* marshalled_dataset=NULL;
    100         int   enum_value=0;
    101         int   stringsize;
    102         char* string=NULL;
    103 
    104         /*recover marshalled_dataset: */
    105         marshalled_dataset=*pmarshalled_dataset;
    106 
    107         /*get enum value of StringArrayParam: */
    108         enum_value=StringArrayParamEnum;
    109        
    110         /*marshall enum: */
    111         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    112        
    113         /*marshall data: */
    114         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    115         memcpy(marshalled_dataset,&numstrings,sizeof(numstrings));marshalled_dataset+=sizeof(numstrings);
    116         for(i=0;i<numstrings;i++){
    117                 string=this->value[i];
    118                 stringsize=strlen(string)+1;
    119                
    120                 memcpy(marshalled_dataset,&stringsize,sizeof(stringsize));marshalled_dataset+=sizeof(stringsize);
    121                 memcpy(marshalled_dataset,string,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
    122         }
    123 
    124         *pmarshalled_dataset=marshalled_dataset;
    125 }
    126 /*}}}*/
    127 /*FUNCTION StringArrayParam::MarshallSize{{{1*/
    128 int   StringArrayParam::MarshallSize(){
    129 
    130         int i;
    131         int marshallsize=0;
    132         int stringsize;
    133         char* string=NULL;
    134 
    135         marshallsize+=sizeof(numstrings);
    136 
    137         for(i=0;i<numstrings;i++){
    138                 string=this->value[i];
    139                 stringsize=strlen(string)+1;
    140                 marshallsize+=sizeof(stringsize);
    141                 marshallsize+=stringsize*sizeof(char);
    142         }
    143        
    144         marshallsize+=sizeof(enum_type);
    145         marshallsize+=sizeof(int); //sizeof(int) for enum value
    146 
    147         return marshallsize;
    148 }
    149 /*}}}*/
    150 /*FUNCTION StringArrayParam::Demarshall{{{1*/
    151 void  StringArrayParam::Demarshall(char** pmarshalled_dataset){
    152 
    153         char* marshalled_dataset=NULL;
    154         int   i;
    155         int   stringsize;
    156         char* string=NULL;
    157 
    158         /*recover marshalled_dataset: */
    159         marshalled_dataset=*pmarshalled_dataset;
    160 
    161         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    162          *object data (thanks to DataSet::Demarshall):*/
    163         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    164 
    165         memcpy(&numstrings,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
    166         if(numstrings){
    167                 this->value=(char**)xmalloc(numstrings*sizeof(char*));
    168 
    169                 for(i=0;i<numstrings;i++){
    170                         memcpy(&stringsize,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
    171 
    172                         string=(char*)xmalloc(stringsize*sizeof(char));
    173                         memcpy(string,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
    174 
    175                         this->value[i]=string;
    176                 }
    177         }
    178         else this->value=NULL;
    179 
    180         /*return: */
    181         *pmarshalled_dataset=marshalled_dataset;
    182         return;
    183 }
    184 /*}}}*/
    185 #endif
    18694/*FUNCTION StringArrayParam::ObjectEnum{{{1*/
    18795int StringArrayParam::ObjectEnum(void){
     
    236144}
    237145/*}}}*/
    238 /*FUNCTION StringArrayParam::SetMatlabField{{{1*/
    239 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    240 void  StringArrayParam::SetMatlabField(mxArray* dataref){
    241        
    242         int      i;
    243         char*    name=NULL;
    244         mwSize   dims[2]={0};
    245         mxArray* pfield=NULL;
    246        
    247         this->GetParameterName(&name);
    248 
    249         dims[0]=this->numstrings;
    250         dims[1]=1;
    251         pfield=mxCreateCellArray(2,dims);
    252         for(i=0;i<this->numstrings;i++){
    253                 char* string=value[i];
    254                 mxSetCell(pfield,i,mxCreateString(string));
    255         }
    256         mxSetField( dataref, 0, name,pfield);
    257 }
    258 #endif
    259 /*}}}*/
    260146/*FUNCTION StringArrayParam::SetValue{{{1*/
    261147void  StringArrayParam::SetValue(char** stringarray,int M){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/StringArrayParam.h

    r12004 r12168  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4440                int   Id();
    4541                int   MyRank();
    46                 #ifdef _SERIAL_
    47                 void  Marshall(char** pmarshalled_dataset);
    48                 int   MarshallSize();
    49                 void  Demarshall(char** pmarshalled_dataset);
    50                 #endif
    5142                int   ObjectEnum();
    5243                Object* copy();
     
    8475
    8576                void GetParameterName(char**pname);
    86                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    87                 void  SetMatlabField(mxArray* dataref);
    88                 #endif
    8977                /*}}}*/
    9078};
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/StringParam.cpp

    r12004 r12168  
    6464}
    6565/*}}}*/
    66 #ifdef _SERIAL_
    67 /*FUNCTION StringParam::Marshall{{{1*/
    68 void  StringParam::Marshall(char** pmarshalled_dataset){
    69 
    70         char* marshalled_dataset=NULL;
    71         int   enum_value=0;
    72         int   stringsize;
    73 
    74         /*recover marshalled_dataset: */
    75         marshalled_dataset=*pmarshalled_dataset;
    76 
    77         /*get enum value of StringParam: */
    78         enum_value=StringParamEnum;
    79        
    80         /*marshall enum: */
    81         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    82 
    83         /*marshall data: */
    84         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    85         stringsize=strlen(this->value)+1;
    86        
    87         memcpy(marshalled_dataset,&stringsize,sizeof(stringsize));marshalled_dataset+=sizeof(stringsize);
    88         memcpy(marshalled_dataset,this->value,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
    89 
    90         *pmarshalled_dataset=marshalled_dataset;
    91 }
    92 /*}}}*/
    93 /*FUNCTION StringParam::MarshallSize{{{1*/
    94 int   StringParam::MarshallSize(){
    95 
    96         int stringsize;
    97         stringsize=strlen(this->value)+1;
    98        
    99         return sizeof(int)+
    100                 stringsize*sizeof(char)+
    101                 sizeof(enum_type)+
    102                 sizeof(int); //sizeof(int) for enum value
    103 }
    104 /*}}}*/
    105 /*FUNCTION StringParam::Demarshall{{{1*/
    106 void  StringParam::Demarshall(char** pmarshalled_dataset){
    107 
    108         char* marshalled_dataset=NULL;
    109         int   i;
    110         int   stringsize;
    111 
    112         /*recover marshalled_dataset: */
    113         marshalled_dataset=*pmarshalled_dataset;
    114 
    115         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    116          *object data (thanks to DataSet::Demarshall):*/
    117         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    118 
    119         memcpy(&stringsize,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
    120        
    121         this->value=(char*)xmalloc(stringsize*sizeof(char));
    122         memcpy(this->value,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
    123 
    124         /*return: */
    125         *pmarshalled_dataset=marshalled_dataset;
    126         return;
    127 }
    128 /*}}}*/
    129 #endif
    13066/*FUNCTION StringParam::ObjectEnum{{{1*/
    13167int StringParam::ObjectEnum(void){
     
    164100}
    165101/*}}}*/
    166 /*FUNCTION StringParam::SetMatlabField{{{1*/
    167 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    168 void  StringParam::SetMatlabField(mxArray* dataref){
    169        
    170         char* name=NULL;
    171 
    172         this->GetParameterName(&name);
    173         mxSetField( dataref, 0, name, mxCreateString(value));
    174 }
    175 #endif
    176 /*}}}*/
    177102/*FUNCTION StringParam::SetValue{{{1*/
    178103void  StringParam::SetValue(char* string){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/StringParam.h

    r12004 r12168  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4238                int   Id();
    4339                int   MyRank();
    44                 #ifdef _SERIAL_
    45                 void  Marshall(char** pmarshalled_dataset);
    46                 int   MarshallSize();
    47                 void  Demarshall(char** pmarshalled_dataset);
    48                 #endif
    4940                int   ObjectEnum();
    5041                Object* copy();
     
    8273
    8374                void GetParameterName(char**pname);
    84                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    85                 void  SetMatlabField(mxArray* dataref);
    86                 #endif
    8775
    8876                /*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/VectorParam.cpp

    r12004 r12168  
    7272}
    7373/*}}}*/
    74 #ifdef _SERIAL_
    75 /*FUNCTION VectorParam::Marshall{{{1*/
    76 void  VectorParam::Marshall(char** pmarshalled_dataset){
    77 
    78         char* marshalled_dataset=NULL;
    79         int   enum_value=0;
    80         int   M;
    81         double* serial_value=NULL;
    82 
    83         /*recover marshalled_dataset: */
    84         marshalled_dataset=*pmarshalled_dataset;
    85 
    86         /*get enum value of VectorParam: */
    87         enum_value=VectorParamEnum;
    88        
    89         /*marshall enum: */
    90         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    91        
    92         /*marshall VectorParam data: */
    93         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    94         if(value){
    95                 value->GetSize(&M);
    96                 serial_value=value->ToMPISerial();
    97                 memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    98                 memcpy(marshalled_dataset,serial_value,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
    99         }
    100         else{
    101                 M=0;
    102                 memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    103         }
    104         /*Free ressources:*/
    105         xfree((void**)&serial_value);
    106 
    107         /*return:*/
    108         *pmarshalled_dataset=marshalled_dataset;
    109 }
    110 /*}}}*/
    111 /*FUNCTION VectorParam::MarshallSize{{{1*/
    112 int   VectorParam::MarshallSize(){
    113 
    114         int M=0;
    115         if(value)value->GetSize(&M);
    116 
    117         return sizeof(M)+M*sizeof(double)
    118                 +sizeof(enum_type)+
    119                 +sizeof(int); //sizeof(int) for enum value
    120 }
    121 /*}}}*/
    122 /*FUNCTION VectorParam::Demarshall{{{1*/
    123 void  VectorParam::Demarshall(char** pmarshalled_dataset){
    124 
    125         char* marshalled_dataset=NULL;
    126         int   i;
    127         double* serial_vec=NULL;
    128         int   M;
    129 
    130         /*recover marshalled_dataset: */
    131         marshalled_dataset=*pmarshalled_dataset;
    132 
    133         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    134          *object data (thanks to DataSet::Demarshall):*/
    135         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    136        
    137         /*data: */
    138        
    139         memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    140         if(M){
    141                 serial_vec=(double*)xmalloc(M*sizeof(double));
    142                 memcpy(serial_vec,marshalled_dataset,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
    143 
    144                 value=new Vector(serial_vec,M);
    145         }
    146         else{
    147                 value=NULL;
    148         }
    149 
    150         /*Free ressources:*/
    151         xfree((void**)&serial_vec);
    152 
    153         /*return: */
    154         *pmarshalled_dataset=marshalled_dataset;
    155 }
    156 /*}}}*/
    157 #endif
    15874/*FUNCTION VectorParam::ObjectEnum{{{1*/
    15975int VectorParam::ObjectEnum(void){
     
    188104}
    189105/*}}}*/
    190 /*FUNCTION VectorParam::SetMatlabField{{{1*/
    191 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    192 void  VectorParam::SetMatlabField(mxArray* dataref){
    193 
    194         mxArray* pfield=NULL;
    195         char* name=NULL;
    196         double* doublevec=NULL;
    197         int M;
    198        
    199         doublevec=value->ToMPISerial();
    200         value->GetSize(&M);
    201         this->GetParameterName(&name);
    202        
    203         pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    204         mxSetM(pfield,M);
    205         mxSetN(pfield,1);
    206         mxSetPr(pfield,doublevec);
    207        
    208         mxSetField( dataref, 0, name, pfield);
    209 }
    210 #endif
    211 /*}}}*/
    212106/*FUNCTION VectorParam::SetValue{{{1*/
    213107void  VectorParam::SetValue(Vector* vector){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Params/VectorParam.h

    r12004 r12168  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4238                int   Id();
    4339                int   MyRank();
    44                 #ifdef _SERIAL_
    45                 void  Marshall(char** pmarshalled_dataset);
    46                 int   MarshallSize();
    47                 void  Demarshall(char** pmarshalled_dataset);
    48                 #endif
    4940                int   ObjectEnum();
    5041                Object* copy();
     
    8273
    8374                void GetParameterName(char**pname);
    84                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    85                 void  SetMatlabField(mxArray* dataref);
    86                 #endif
    8775
    8876                /*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Patch.cpp

    r11399 r12168  
    120120        int         node_numrows;
    121121        double     *total_values  = NULL;
     122        #ifdef _HAVE_MPI_
    122123        MPI_Status  status;
     124        #endif
    123125
    124         #ifdef _SERIAL_
    125         return; //nothing to be done
    126         #endif
    127        
    128126        /*First, figure out total number of rows combining all the cpus: */
     127        #ifdef _HAVE_MPI_
    129128        MPI_Reduce(&this->numrows,&total_numrows,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
    130129        MPI_Bcast(&total_numrows,1,MPI_INT,0,MPI_COMM_WORLD);
     130        #else
     131        total_numrows=this->numrows;
     132        #endif
    131133
    132134        /*return if patch empty*/
     
    144146
    145147        /*Now, ask other nodes to send their values: */
     148        #ifdef _HAVE_MPI_
    146149        for (i=1;i<num_procs;i++){
    147150                if (my_rank==i){
     
    155158                }
    156159        }       
     160        #endif
    157161
    158162        /*Now, node 0 has total_values, of size total_numrows*this->numcols. Update the fields in the patch, to reflect this new
     
    163167                this->values=total_values;
    164168        }
     169        #ifdef _HAVE_MPI_
    165170        else{
    166171                this->numrows=0;
    167172                xfree((void**)&this->values);
    168173        }
     174        #endif
    169175}/*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Segment.cpp

    r9883 r12168  
    7171}
    7272/*}}}*/
    73 #ifdef _SERIAL_
    74 /*FUNCTION Segment::Marshall{{{1*/
    75 void  Segment::Marshall(char** pmarshalled_dataset){
    76 
    77         _error_(" not supported yet!");
    78 }
    79 /*}}}*/
    80 /*FUNCTION Segment::MarshallSize{{{1*/
    81 int   Segment::MarshallSize(){
    82         _error_(" not supported yet!");
    83 }
    84 /*}}}*/
    85 /*FUNCTION Segment::Demarshall{{{1*/
    86 void  Segment::Demarshall(char** pmarshalled_dataset){
    87         _error_(" not supported yet!");
    88 }
    89 /*}}}*/
    90 #endif
    9173/*FUNCTION Segment::ObjectEnum{{{1*/
    9274int Segment::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Segment.h

    r9883 r12168  
    3030                int   Id();
    3131                int   MyRank();
    32                 #ifdef _SERIAL_
    33                 void  Marshall(char** pmarshalled_dataset);
    34                 int   MarshallSize();
    35                 void  Demarshall(char** pmarshalled_dataset);
    36                 #endif
    3732                int   ObjectEnum();
    3833                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Vertex.cpp

    r11708 r12168  
    9292}
    9393/*}}}*/
    94 #ifdef _SERIAL_
    95 /*FUNCTION Vertex::Marshall {{{1*/
    96 void  Vertex::Marshall(char** pmarshalled_dataset){
    97 
    98         char* marshalled_dataset=NULL;
    99         int   enum_type=0;
    100 
    101         /*recover marshalled_dataset: */
    102         marshalled_dataset=*pmarshalled_dataset;
    103 
    104         /*get enum type of Vertex: */
    105         enum_type=VertexEnum;
    106 
    107         /*marshall enum: */
    108         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    109 
    110         /*marshall Vertex data: */
    111         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    112         memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
    113         memcpy(marshalled_dataset,&x,sizeof(x));marshalled_dataset+=sizeof(x);
    114         memcpy(marshalled_dataset,&y,sizeof(y));marshalled_dataset+=sizeof(y);
    115         memcpy(marshalled_dataset,&z,sizeof(z));marshalled_dataset+=sizeof(z);
    116         memcpy(marshalled_dataset,&sigma,sizeof(sigma));marshalled_dataset+=sizeof(sigma);
    117         memcpy(marshalled_dataset,&connectivity,sizeof(connectivity));marshalled_dataset+=sizeof(connectivity);
    118         memcpy(marshalled_dataset,&dof,sizeof(dof));marshalled_dataset+=sizeof(dof);
    119         memcpy(marshalled_dataset,&clone,sizeof(clone));marshalled_dataset+=sizeof(clone);
    120 
    121         *pmarshalled_dataset=marshalled_dataset;
    122         return;
    123 }
    124 /*}}}*/
    125 /*FUNCTION Vertex::MarshallSize {{{1*/
    126 int   Vertex::MarshallSize(){
    127        
    128         return sizeof(id)+
    129                 sizeof(sid)+
    130                 sizeof(x)+
    131                 sizeof(y)+
    132                 sizeof(z)+
    133                 sizeof(sigma)+
    134                 sizeof(connectivity)+
    135                 sizeof(dof)+
    136                 sizeof(clone)+
    137                 +sizeof(int); //sizeof(int) for enum type
    138 }
    139 /*}}}*/
    140 /*FUNCTION Vertex::Demarshall {{{1*/
    141 void  Vertex::Demarshall(char** pmarshalled_dataset){
    142 
    143         char* marshalled_dataset=NULL;
    144         int   i;
    145 
    146         /*recover marshalled_dataset: */
    147         marshalled_dataset=*pmarshalled_dataset;
    148 
    149         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    150          *object data (thanks to DataSet::Demarshall):*/
    151 
    152         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    153         memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
    154         memcpy(&x,marshalled_dataset,sizeof(x));marshalled_dataset+=sizeof(x);
    155         memcpy(&y,marshalled_dataset,sizeof(y));marshalled_dataset+=sizeof(y);
    156         memcpy(&z,marshalled_dataset,sizeof(z));marshalled_dataset+=sizeof(z);
    157         memcpy(&sigma,marshalled_dataset,sizeof(sigma));marshalled_dataset+=sizeof(sigma);
    158         memcpy(&connectivity,marshalled_dataset,sizeof(connectivity));marshalled_dataset+=sizeof(connectivity);
    159         memcpy(&dof,marshalled_dataset,sizeof(dof));marshalled_dataset+=sizeof(dof);
    160         memcpy(&clone,marshalled_dataset,sizeof(clone));marshalled_dataset+=sizeof(clone);
    161 
    162         /*return: */
    163         *pmarshalled_dataset=marshalled_dataset;
    164         return;
    165 }
    166 /*}}}*/
    167 #endif
    16894/*FUNCTION Vertex::ObjectEnum{{{1*/
    16995int Vertex::ObjectEnum(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/objects/Vertex.h

    r11708 r12168  
    4747                int   Id();
    4848                int   MyRank();
    49                 #ifdef _SERIAL_
    50                 void  Marshall(char** pmarshalled_dataset);
    51                 int   MarshallSize();
    52                 void  Demarshall(char** pmarshalled_dataset);
    53                 #endif
    5449                int   ObjectEnum();
    5550                Object* copy();
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/shared/Alloc/alloc.cpp

    r12004 r12168  
    1919#endif
    2020
    21 #if defined(_SERIAL_) && defined(_HAVE_MATLAB_)
    22 #include "mex.h"
    23 #endif
    24 
    2521#include <stdio.h>
    2622#include <stdlib.h>
     
    3733        if(!size)_error_(" attempting to 0 size allocation!");
    3834
    39         #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    40         /* Use the matlab api to do the allocation: */
    41         memptr=mxMalloc(size);
    42         #else
    4335        /* Use the c library to do the allocation: */
    4436        memptr=malloc(size);
    45         #endif
    4637        if(!memptr) _error_("memory allocation failed!");
    4738
     
    5546        if(!size)_error_("attempting to 0 size allocation!");
    5647
    57         #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    58         /* Use the matlab api to do the allocation: */
    59         memptr=mxCalloc(n,size);
    60         #else
    6148        /* Use the c library to do the allocation: */
    6249        memptr=calloc(n,size);
    63         #endif
    6450        if(!memptr) _error_("memory allocation failed!");
    6551
     
    7056
    7157        if (pv && *pv){
    72                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    73                         mxFree(*pv);
    74                 #else
    75                         free(*pv);
    76                 #endif
     58                free(*pv);
    7759
    7860                *pv=NULL;
     
    8365       
    8466        if (pv && *pv){
    85                 #ifdef _PARALLEL_
    8667                /*There is no mxDelete in the Matlab API -> using delete trips up Matlab. So we
    8768                 * don't actually free memory in Matlab, we let the memory manager do that. We only
    8869                 * free in parallel: */
    8970                delete *pv;
    90                 #else
    91                 /*Actually, still get rid of internal Petsc matrix. Quick fix until Matlab handles C++
    92                  * correctly: */
    93                 #ifdef _HAVE_PETSC_
    94                         MatFree(&(*pv)->matrix);
    95                 #endif
    96                 #endif
    9771                *pv=NULL;
    9872        }
     
    10276
    10377        if (pv && *pv){
    104                 #ifdef _PARALLEL_
    10578                /*There is no mxDelete in the Matlab API -> using delete trips up Matlab. So we
    10679                 * don't actually free memory in Matlab, we let the memory manager do that. We only
    10780                 * free in parallel: */
    10881                delete *pv;
    109                 #else
    110                 /*Actually, still get rid of internal Petsc vector. Quick fix until Matlab handles C++
    111                  * correctly: */
    112                 #ifdef _HAVE_PETSC_
    113                         VecFree(&(*pv)->vector);
    114                 #endif
    115                 #endif
    11682                *pv=NULL;
    11783        }
     
    12490       
    12591        if(!size)_error_("attempting to realloc to zero");
    126 
    127         #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    128         value = (void*)mxRealloc(pv,size);
    129         #else
    13092        value = (void*)realloc(pv,size);
    131         #endif
    13293
    13394        if (value == NULL) {
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/shared/Exceptions/Exceptions.cpp

    r12004 r12168  
    1111#include "../shared.h"
    1212#include "../../include/include.h"
    13 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    14 #include "mex.h"
    15 #endif
    1613
    1714ErrorException::ErrorException(const string &what_arg){
     
    3229
    3330ErrorException::~ErrorException() throw(){
     31        extern int num_procs;
     32        /*We want the report only for matlab modules, otherwise we get twice the report
     33         * We assume that if num_procs==1, it is a module (FIXME)*/
     34        if(num_procs==1) this->Report();
    3435}
    3536
     
    4041void ErrorException::Report(){
    4142        extern int my_rank;
     43        extern int num_procs;
    4244
    4345        if (function_name=="" || file_line==0){ //WINDOWS
     
    4547        }
    4648        else{
    47                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    48                         mexErrMsgTxt(exprintf("\n??? Error using ==> %s at %i\n%s error message: %s\n",
    49                                                         file_name.c_str(),file_line,function_name.c_str(),what()));
    50                 #else
     49                if(num_procs==1){
     50                        printf("\n??? Error using ==> %s:%i\n",file_name.c_str(),file_line);
     51                        printf("%s error message: %s\n\n",function_name.c_str(),what());
     52                }
     53                else{
    5154                        printf("\n[%i] ??? Error using ==> %s:%i\n",my_rank,file_name.c_str(),file_line);
    5255                        printf("[%i] %s error message: %s\n\n",my_rank,function_name.c_str(),what());
    53                 #endif
     56                }
    5457        }
    5558        return;
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/shared/Exceptions/exceptions.h

    r11199 r12168  
    2323
    2424        public:
    25 
    2625        ErrorException(const string &what_arg); //for windows
    2726        ErrorException(string what_file,string what_function,int what_line,string what_arg);//UNIX
    2827        ~ErrorException() throw();
    29 
    3028        virtual const char *what() const throw();
    31 
    3229        void Report();
    3330
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/shared/Exp/DomainOutlineRead.cpp

    r12004 r12168  
    1313#include "../../Container/DataSet.h"
    1414
    15 int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname,bool whole=true){
    16 
     15int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname){
    1716       
    1817        /*indexing: */
     
    102101                if((x[0]==x[n-1]) && (y[0]==y[n-1])){
    103102                        cl=true;
    104                         if (!whole) {
    105                                 n=n-1;
    106                         }
    107103                }
    108104
     
    126122}
    127123
    128 DataSet* DomainOutlineRead(char* domainname,bool whole=true){
    129 
    130         /*indexing: */
    131         int i;
     124DataSet* DomainOutlineRead(char* domainname){
    132125
    133126        /*intermediary: */
    134         int nprof;
    135         int* profnvertices=NULL;
    136         double** pprofx=NULL;
    137         double** pprofy=NULL;
    138 
    139         Contour* contour=NULL;
     127        int       nprof;
     128        int      *profnvertices = NULL;
     129        double  **pprofx        = NULL;
     130        double  **pprofy        = NULL;
     131        Contour  *contour       = NULL;
    140132
    141133        /*output: */
    142134        DataSet* domain=NULL;
    143135
    144         /*get domain outline from intermediary function:*/
    145         DomainOutlineRead(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname,whole);
     136        /*If domainname is an empty string, return empty dataset*/
     137        if (strcmp(domainname,"")==0){
     138                nprof=0;
     139        }
     140        else{
     141                DomainOutlineRead(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname);
     142        }
    146143
    147144        /*now create dataset of contours: */
    148145        domain=new DataSet(0);
    149146
    150         for(i=0;i<nprof;i++){
     147        for(int i=0;i<nprof;i++){
    151148                domain->AddObject(new Contour(i,profnvertices[i],pprofx[i],pprofy[i],1));
    152149        }
    153 
    154150        return domain;
    155151}
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/shared/Exp/DomainOutlineWrite.cpp

    r9320 r12168  
    1111#include "../Exceptions/exceptions.h"
    1212
    13 int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname,bool whole=true){
     13int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname){
    1414
    1515       
     
    2020        /*I/O: */
    2121        FILE* fid=NULL;
    22 
    23         /*input: */
    24 //      int nprof; //number of profiles in the domainname file
    25 //      int* profnvertices=NULL; //array holding the number of vertices for the nprof profiles
    26 //      double** pprofx=NULL; //array of profiles x coordinates
    27 //      double** pprofy=NULL; //array of profiles y coordinates
    28 //      bool* closed=NULL; //array holding closed flags for the nprof profiles
    2922
    3023        /*open domain outline file for writing: */
     
    4336               
    4437                /*Write number of profile vertices: */
    45                 if(closed[counter] && !whole)
    46                         fprintf(fid,"%u %s\n",profnvertices[counter]+1,"1.");
    47                 else
    48                         fprintf(fid,"%u %s\n",profnvertices[counter]  ,"1.");
     38                fprintf(fid,"%u %s\n",profnvertices[counter]  ,"1.");
    4939       
    5040                /*Write next line: */
     
    5545                        fprintf(fid,"%lf\t%lf\n",pprofx[counter][i],pprofy[counter][i]);
    5646                }
    57 
    58                 /*Now check that we are dealing with open contours: */
    59                 if(closed[counter] && !whole)
    60                         fprintf(fid,"%lf\t%lf\n",pprofx[counter][0],pprofy[counter][0]);
    6147
    6248                /*Write blank line: */
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/shared/Exp/exp.h

    r12004 r12168  
    1313int IsOutsidePoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
    1414int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue);
    15 int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname,bool whole);
     15int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname);
    1616int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue);
    1717
    18 int      DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname,bool whole);
    19 DataSet* DomainOutlineRead(char* domainname,bool whole);
     18int      DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname);
     19DataSet* DomainOutlineRead(char* domainname);
    2020
    2121
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/shared/Numerics/OptionsFromAnalysis.cpp

    r12004 r12168  
    3030        parameters->FindParam(&strings,&numanalyses,PetscOptionsStringsEnum);
    3131
    32         #if defined(_HAVE_MATLAB_) && defined(_SERIAL_) //do not take this away, because ISSM loads analyses as a Double Param instead of a DoubleVec Param  when running with only 1 analysis
    33         if(numanalyses==1){ analyses=(double*)xmalloc(1*sizeof(double)); parameters->FindParam(analyses,PetscOptionsAnalysesEnum);
    34         }
    35         else parameters->FindParam(&analyses,&dummy,PetscOptionsAnalysesEnum);
    36         #else
    3732        parameters->FindParam(&analyses,&dummy,PetscOptionsAnalysesEnum);
    38         #endif
    3933
    4034        if(numanalyses==0)return NULL; //we did not find petsc options, don't bother.
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/shared/Numerics/Synchronize.sh

    r11402 r12168  
    22#Synchronize Verbosity
    33#first remove existing files
    4 rm $ISSM_TIER/src/m/shared/Verb*.m
     4rm $ISSM_DIR/src/m/shared/Verb*.m
    55
    66echo "Synchronizing Verbosity levels..."
     
    2929#include "../../include/macros.h"
    3030#include "../Exceptions/exceptions.h"
    31 #ifdef _SERIAL_
    32 #include <mex.h>
    33 #endif
    3431/*}}}*/
    3532
     
    5451
    5552        #Add Verbosity Matlab file{{{
    56         cat <<END > $ISSM_TIER"/src/m/shared/"$(echo $FILENAME".m")
     53        cat <<END > $ISSM_DIR"/src/m/shared/"$(echo $FILENAME".m")
    5754function bool=$(echo $FILENAME)()
    5855%$(echo $FILENAME | awk {'print toupper($1)'}) - Return true if $(echo $LEVELNAME | awk {'print tolower($1)'}) level is activated
     
    140137        if(level<0) _error_("vebosity level should be a positive integer (user provided %i)",level);
    141138
    142 #ifdef _SERIAL_
    143 
    144         mxArray* output=NULL;
    145         mxArray* input=NULL;
    146         input=mxCreateDoubleScalar((double)level);
    147 
    148         mexCallMATLAB(0,&output,1,&input,"SetVerbosityLevel");
    149 #else
    150 
    151139        verbositylevel = level;
    152140
    153 #endif
    154141}/*}}}*/
    155142/*FUNCTION GetVerbosityLevel {{{*/
    156143int  GetVerbosityLevel(void){
    157 #ifdef _SERIAL_
    158 
    159         mxArray* output=NULL;
    160         mxArray* input=NULL;
    161         double   level;
    162 
    163         mexCallMATLAB(1,&output,0,&input,"GetVerbosityLevel");
    164         level=mxGetScalar(output);
    165 
    166         verbositylevel = (int)level;
    167         return verbositylevel;
    168 
    169 #else
    170 
    171144        _assert_(verbositylevel>=0);
    172145        return verbositylevel;
    173 
    174 #endif
    175146}/*}}}*/
    176147END
    177148#}}}
    178149#Complete verbose.m {{{1
    179 VERBOSEPATH="$ISSM_TIER/src/m/classes/verbose.m"
     150VERBOSEPATH="$ISSM_DIR/src/m/classes/verbose.m"
    180151cat $VERBOSEPATH  | sed "/%BEGINFIELDS/,$ d"  > temp_begin
    181152cat $VERBOSEPATH  | sed "1,/%ENDFIELDS/d" > temp_end
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/shared/Numerics/Verbosity.cpp

    r12004 r12168  
    1818#include "../../include/macros.h"
    1919#include "../Exceptions/exceptions.h"
    20 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    21 #include <mex.h>
    22 #endif
    2320/*}}}*/
    2421
     
    3936        if(level<0) _error_("vebosity level should be a positive integer (user provided %i)",level);
    4037
    41 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    42 
    43         mxArray* output=NULL;
    44         mxArray* input=NULL;
    45         input=mxCreateDoubleScalar((double)level);
    46 
    47         mexCallMATLAB(0,&output,1,&input,"SetVerbosityLevel");
    48 #else
    49 
    5038        verbositylevel = level;
    5139
    52 #endif
    5340}/*}}}*/
    5441/*FUNCTION GetVerbosityLevel {{{*/
    5542int  GetVerbosityLevel(void){
    56 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    57 
    58         mxArray* output=NULL;
    59         mxArray* input=NULL;
    60         double   level;
    61 
    62         mexCallMATLAB(1,&output,0,&input,"GetVerbosityLevel");
    63         level=mxGetScalar(output);
    64 
    65         verbositylevel = (int)level;
    66         return verbositylevel;
    67 
    68 #else
    6943
    7044        _assert_(verbositylevel>=0);
    7145        return verbositylevel;
    7246
    73 #endif
    7447}/*}}}*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/shared/Numerics/XZvectorsToCoordinateSystem.cpp

    r12004 r12168  
    1 #include "../../io/Matlab/matlabio.h"
    21#include "../Alloc/alloc.h"
    32#include "../../include/include.h"
    43#include "../Exceptions/exceptions.h"
     4#include "./isnan.h"
    55#include <math.h>
    66
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/shared/TriMesh/SplitMeshForRifts.cpp

    r8301 r12168  
    4747        segmentmarkerlist=*psegmentmarkerlist;
    4848
    49 
    5049        /*Establish list of segments that belong to a rift: */
    51         RiftSegmentsFromSegments(&nriftsegs,&riftsegments,nel,index,nsegs,segments); /*riftsegments of size nriftsegsx4 (4 for first element on segment,second element,
    52                                                                                                                                                                    first node and second snode)*/
     50        /*riftsegments of size nriftsegsx4 (4 for first element on segment,second element,first node and second snode)*/
     51        RiftSegmentsFromSegments(&nriftsegs,&riftsegments,nel,index,nsegs,segments);
    5352
    5453        /*Go through all nodes of the rift segments, and start splitting the mesh: */
     
    5756                for (j=0;j<2;j++){
    5857       
    59                         node=*(riftsegments+4*i+j+2);
     58                        node=riftsegments[4*i+j+2];
    6059                        if(flags[node-1]){
    6160                                /*This node was already split, skip:*/
     
    7069                                DetermineGridElementListOnOneSideOfRift(&NumGridElementListOnOneSideOfRift,&GridElementListOnOneSideOfRift,i,nriftsegs,riftsegments,node,index,nel);
    7170                       
    72                                 /*Summary: we have for node, a list of elements (GridElementListOnOneSideOfRift, of size NumGridElementListOnOneSideOfRift) that all contain node
    73                                  *and that are on the same side of the rift. For all these elements, we clone node into another node, and we swap all instances of node in the triangulation
    74                                  *for those elements, to the new node.*/
     71                                /*Summary: we have for node, a list of elements
     72                                 * (GridElementListOnOneSideOfRift, of size
     73                                 * NumGridElementListOnOneSideOfRift) that all contain node
     74                                 *and that are on the same side of the rift. For all these
     75                                 elements, we clone node into another node, and we swap all
     76                                 instances of node in the triangulation *for those elements, to the
     77                                 new node.*/
    7578                               
    7679                                //augment number of nodes
     
    9497
    9598        /*update segments: they got modified completely by adding new nodes.*/
    96         UpdateSegments(&segments,&segmentmarkerlist, &nsegs,index,x,y,riftsegments,nriftsegs);
     99        UpdateSegments(&segments,&segmentmarkerlist, &nsegs,index,x,y,riftsegments,nriftsegs,nods,nel);
    97100
    98101        /*Assign output pointers: */
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/shared/TriMesh/TriMeshUtils.cpp

    r11401 r12168  
    1111
    1212#define RIFTPENALTYPAIRSWIDTH 8
     13/*FUNCTION IsGridOnRift{{{*/
    1314int IsGridOnRift(int* riftsegments, int nriftsegs, int node){
    1415
     
    3233                return 0;
    3334        }
    34 }
    35                                
    36 
     35}/*}}}*/
     36/*FUNCTION GridElementsList{{{*/
    3737int GridElementsList(int** pGridElements, int* pNumGridElements,int node,double * index,int nel){
    3838
     
    8787        *pNumGridElements=NumGridElements;
    8888        return noerr;
    89 }
    90 
    91 
     89}/*}}}*/
     90/*FUNCTION IsNeighbor{{{*/
    9291int IsNeighbor(int el1,int el2,double* index){
    9392        /*From a triangulation held in index, figure out if elements 1 and 2 have two nodes in common: */
     
    105104                return 0;
    106105        }
    107 }
    108                                                        
    109 
     106}/*}}}*/
     107/*FUNCTION IsOnRift{{{*/
    110108int IsOnRift(int el,int nriftsegs,int* riftsegments){
    111109        /*From a list of elements segments, figure out if el belongs to it: */
     
    117115        }
    118116        return 0;
    119 }
    120 
    121 
    122 /******************************************************************************************************************************
    123                                    RiftSegmentsFromSegments
    124 ******************************************************************************************************************************/
    125 
     117}/*}}}*/
     118/*FUNCTION RiftSegmentsFromSegments{{{*/
    126119void RiftSegmentsFromSegments(int* pnriftsegs, int** priftsegments, int nel, double* index, int nsegs,double* segments){
    127120       
     
    189182        *priftsegments=riftsegments;
    190183        *pnriftsegs=nriftsegs;
    191 }
    192 
    193 /******************************************************************************************************************************
    194                                    DetermineGridElementListOnOneSideOfRift
    195 ******************************************************************************************************************************/
    196 
     184}/*}}}*/
     185/*FUNCTION DetermineGridElementListOnOneSideOfRift{{{*/
    197186int DetermineGridElementListOnOneSideOfRift(int* pNumGridElementListOnOneSideOfRift, int** pGridElementListOnOneSideOfRift, int segmentnumber, int nriftsegs, int* riftsegments, int node,double* index,int nel){
    198187
     
    257246        *pGridElementListOnOneSideOfRift=GridElementListOnOneSideOfRift;
    258247        return noerr;
    259 }
    260 
    261 /******************************************************************************************************************************
    262                                    UpdateSegments
    263 ******************************************************************************************************************************/
    264 
    265 int UpdateSegments(double** psegments,double** psegmentmarkerlist, int* pnsegs, double* index, double* x,double* y,int* riftsegments,int nriftsegs){
     248}/*}}}*/
     249/*FUNCTION UpdateSegments{{{*/
     250int UpdateSegments(double** psegments,double** psegmentmarkerlist, int* pnsegs, double* index, double* x,double* y,int* riftsegments,int nriftsegs,int nods,int nel){
    266251
    267252        int noerr=1;
     
    284269        /*First, update the existing segments to the new nodes :*/
    285270        for (i=0;i<nriftsegs;i++){
    286                 el1=*(riftsegments+4*i+0);
    287                 el2=*(riftsegments+4*i+1);
     271                el1=riftsegments[4*i+0];
     272                el2=riftsegments[4*i+1];
    288273                for (j=0;j<nsegs;j++){
    289                         if (*(segments+3*j+2)==(el1+1)){
     274                        if (segments[3*j+2]==(el1+1)){
    290275                                /*segment j is the same as rift segment i.Let's update segments[j][:] using  element el1 and the corresponding rift segment.
    291276                                 *Because riftsegments does not represent a list of rift segments anymore (it got heavily modified in SplitElementsForRifts,
     
    293278                                for (k=0;k<3;k++){
    294279                                        if ((x[(int)*(index+el1*3+k)-1]==x[(int)*(segments+3*j+0)-1]) && (y[(int)*(index+el1*3+k)-1]==y[(int)*(segments+3*j+0)-1])){
    295                                                 *(segments+3*j+0)=*(index+el1*3+k);
     280                                                *(segments+3*j+0)=*(index+el1*3+k); _assert_(segments[3*j+0]<nods+1);
    296281                                                break;
    297282                                        }
     
    299284                                for (k=0;k<3;k++){
    300285                                        if ((x[(int)*(index+el1*3+k)-1]==x[(int)*(segments+3*j+1)-1])  && (y[(int)*(index+el1*3+k)-1]==y[(int)*(segments+3*j+1)-1])){
    301                                                 *(segments+3*j+1)=*(index+el1*3+k);
     286                                                *(segments+3*j+1)=*(index+el1*3+k); _assert_(segments[3*j+1]<nods+1);
    302287                                                break;
    303288                                        }
     
    308293                                for (k=0;k<3;k++){
    309294                                        if ((x[(int)*(index+el2*3+k)-1]==x[(int)*(segments+3*j+0)-1]) && (y[(int)*(index+el2*3+k)-1]==y[(int)*(segments+3*j+0)-1])){
    310                                                 *(segments+3*(nsegs+i)+0)=*(index+el2*3+k);
     295                                                *(segments+3*(nsegs+i)+0)=*(index+el2*3+k); _assert_(segments[3*(nsegs+i)+0]<nods+1);
    311296                                                break;
    312297                                        }
     
    314299                                for (k=0;k<3;k++){
    315300                                        if ((x[(int)*(index+el2*3+k)-1]==x[(int)*(segments+3*j+1)-1]) && (y[(int)*(index+el2*3+k)-1]==y[(int)*(segments+3*j+1)-1])){
    316                                                 *(segments+3*(nsegs+i)+1)=*(index+el2*3+k);
     301                                                *(segments+3*(nsegs+i)+1)=*(index+el2*3+k); _assert_(segments[3*(nsegs+i)+1]<nods+1);
    317302                                                break;
    318303                                        }
     
    324309                                for (k=0;k<3;k++){
    325310                                        if ((x[(int)*(index+el2*3+k)-1]==x[(int)*(segments+3*j+0)-1]) && (y[(int)*(index+el2*3+k)-1]==y[(int)*(segments+3*j+0)-1])){
    326                                                 *(segments+3*j+0)=*(index+el2*3+k);
     311                                                *(segments+3*j+0)=*(index+el2*3+k); _assert_(segments[3*j+0]<nods+1);
    327312                                                break;
    328313                                        }
     
    330315                                for (k=0;k<3;k++){
    331316                                        if ((x[(int)*(index+el2*3+k)-1]==x[(int)*(segments+3*j+1)-1]) && (y[(int)*(index+el2*3+k)-1]==y[(int)*(segments+3*j+1)-1])){
    332                                                 *(segments+3*j+1)=*(index+el2*3+k);
     317                                                *(segments+3*j+1)=*(index+el2*3+k);_assert_(segments[3*j+1]<nods+1);
    333318                                                break;
    334319                                        }
     
    339324                                for (k=0;k<3;k++){
    340325                                        if ((x[(int)*(index+el1*3+k)-1]==x[(int)*(segments+3*j+0)-1]) && (y[(int)*(index+el1*3+k)-1]==y[(int)*(segments+3*j+0)-1])){
    341                                                 *(segments+3*(nsegs+i)+0)=*(index+el1*3+k);
     326                                                *(segments+3*(nsegs+i)+0)=*(index+el1*3+k);_assert_(segments[3*(nsegs+i)+0]<nods+1);
    342327                                                break;
    343328                                        }
     
    345330                                for (k=0;k<3;k++){
    346331                                        if ((x[(int)*(index+el1*3+k)-1]==x[(int)*(segments+3*j+1)-1]) && (y[(int)*(index+el1*3+k)-1]==y[(int)*(segments+3*j+1)-1])){
    347                                                 *(segments+3*(nsegs+i)+1)=*(index+el1*3+k);
     332                                                *(segments+3*(nsegs+i)+1)=*(index+el1*3+k);_assert_(segments[3*(nsegs+i)+1]<nods+1);
    348333                                                break;
    349334                                        }
     
    360345       
    361346        return noerr;
    362 }
    363 
    364 /******************************************************************************************************************************
    365                                    pnpoly
    366 ******************************************************************************************************************************/
     347}/*}}}*/
     348/*FUNCTION pnpoly{{{*/
    367349int pnpoly(int npol, double *xp, double *yp, double x, double y) {
    368350        int i, j, c = 0;
     
    374356        }
    375357        return c;
    376 }
    377 
    378 /******************************************************************************************************************************
    379                                    IsInPoly
    380 ******************************************************************************************************************************/
    381 //void IsInPoly(double* in,double* xc,double* yc,int numnodes,double* x,double* y,int nods){
    382 //
    383 //      int i;
    384 //      double x0,y0;
    385 //
    386 //      /*Go through all nodes of the mesh:*/
    387 //      for (i=0;i<nods;i++){
    388 //              if (in[i]){
    389 //                      /*this node already is inside one of the contours, continue*/
    390 //                      continue;
    391 //              }
    392 //              /*pick up node: */
    393 //              x0=x[i];
    394 //              y0=y[i];
    395 //              if (pnpoly(numnodes,xc,yc,x0,y0)){
    396 //                      in[i]=1;
    397 //              }
    398 //      }
    399 //}
    400 
    401 /******************************************************************************************************************************
    402                                    FindElement
    403 ******************************************************************************************************************************/
    404 
     358}/*}}}*/
     359/*FUNCTION FindElement{{{*/
    405360int FindElement(double A,double B,double* index,int nel){
    406361
     
    414369        }
    415370        return el;
    416 }
    417 /******************************************************************************************************************************
    418                                    SplitRiftSegments
    419 ******************************************************************************************************************************/
    420 
    421 int SplitRiftSegments(double** psegments,double** psegmentmarkerlist, int* pnumsegs, int* pnumrifts,int** priftsnumsegs,double*** priftssegments,int numrifts){
     371}/*}}}*/
     372/*FUNCTION SplitRiftSegments{{{*/
     373int SplitRiftSegments(double** psegments,double** psegmentmarkerlist, int* pnumsegs, int* pnumrifts,int** priftsnumsegs,double*** priftssegments,int numrifts,int nods,int nel){
    422374
    423375        /*Using segment markers, wring out the rift segments from the segments. Rift markers are
     
    461413        for (i=0;i<numsegs;i++){
    462414                if (segmentmarkerlist[i]==1){
    463                         *(new_segments+3*counter+0)=*(segments+3*i+0);
    464                         *(new_segments+3*counter+1)=*(segments+3*i+1);
    465                         *(new_segments+3*counter+2)=*(segments+3*i+2);
     415                        new_segments[3*counter+0]=segments[3*i+0];
     416                        new_segments[3*counter+1]=segments[3*i+1];
     417                        new_segments[3*counter+2]=segments[3*i+2];
    466418                        new_segmentmarkers[counter]=segmentmarkerlist[i];
    467419                        counter++;
     
    484436                for (j=0;j<numsegs;j++){
    485437                        if (segmentmarkerlist[j]==(2+i)){
    486                                 *(riftsegment+3*counter+0)=*(segments+3*j+0);
    487                                 *(riftsegment+3*counter+1)=*(segments+3*j+1);
    488                                 *(riftsegment+3*counter+2)=*(segments+3*j+2);
     438                                riftsegment[3*counter+0]=segments[3*j+0];_assert_(riftsegment[3*counter+0]<nods+1);
     439                                riftsegment[3*counter+1]=segments[3*j+1];_assert_(riftsegment[3*counter+1]<nods+1);
     440                                riftsegment[3*counter+2]=segments[3*j+2];_assert_(riftsegment[3*counter+2]<nel+1);
    489441                                counter++;
    490442                        }
     
    504456        *priftsnumsegs=riftsnumsegs;
    505457        return noerr;
    506 }
    507 
    508 /******************************************************************************************************************************
    509                                    PairRiftElements
    510 ******************************************************************************************************************************/
    511 
     458}/*}}}*/
     459/*FUNCTION PairRiftElements{{{*/
    512460int PairRiftElements(int** priftsnumpairs, double*** priftspairs,int numrifts,int* riftsnumsegments, double** riftssegments,double* x,double* y){
    513461
     
    558506
    559507        return noerr;
    560 }
    561 
    562 
    563 /******************************************************************************************************************************
    564                                    RemoveRifts
    565 ******************************************************************************************************************************/
    566 
    567 double dabs(double x){
    568         if (x<0)x=-x;
    569         return x;
    570 }
     508}/*}}}*/
     509/*FUNCTION RemoveRifts{{{*/
    571510int RemoveRifts(double** pindex,double** px,double** py,int* pnods,double** psegments,int* pnumsegs,int numrifts1,int* rifts1numsegs,double** rifts1segments,double** rifts1pairs,int nel){
    572511
     
    615554                if (y[i]<ymin)ymin=y[i];
    616555        }
    617         xmin=xmin-dabs(xmin);
    618         ymin=ymin-dabs(ymin);
     556        xmin=xmin-fabs(xmin);
     557        ymin=ymin-fabs(ymin);
    619558
    620559        /*Initialize two arrays, one for nodes that are going to be merged, the other with corresponding nodes being merge into: */
     
    751690
    752691        return noerr;
    753 }
    754 
    755 /******************************************************************************************************************************
    756                                    IsRiftPresent
    757 ******************************************************************************************************************************/
    758 
     692}/*}}}*/
     693/*FUNCTION IsRiftPresent{{{*/
    759694int IsRiftPresent(int* priftflag,int* pnumrifts, double* segmentmarkerlist,int nsegs){
    760695
     
    783718
    784719        return noerr;
    785 }
    786 
    787 /******************************************************************************************************************************
    788                                    OrderRifts
    789 ******************************************************************************************************************************/
    790 
    791 int OrderRifts(double** priftstips, double** riftssegments,double** riftspairs,int numrifts,int* riftsnumsegments,double* x,double* y){
     720}/*}}}*/
     721/*FUNCTION OrderRifts{{{*/
     722int OrderRifts(double** priftstips, double** riftssegments,double** riftspairs,int numrifts,int* riftsnumsegments,double* x,double* y,int nods,int nels){
    792723       
    793724        int noerr=1;
     
    811742        /*output: */
    812743        double* riftstips=NULL;
    813 
    814744
    815745        /*Allocate byproduct of this routine, riftstips: */
     
    822752                numsegs=riftsnumsegments[i];
    823753       
    824                        
    825754                /*Allocate copy of riftsegments and riftpairs,
    826755                 *as well as ordering vector: */
     
    847776                        }
    848777                        /* Make sure node3 faces node1 and node4 faces node2: */
    849                         if ((x[node1]==x[node4]) && (y[node1]==y[node4])){
     778                        _assert_(node1<nods+1 && node4<nods+1);
     779                        _assert_(node1>0 && node4>0);
     780                        if ((x[node1-1]==x[node4-1]) && (y[node1-1]==y[node4-1])){
    850781                                /*Swap node3 and node4:*/
    851782                                temp_node=node3;
     
    943874        *priftstips=riftstips;
    944875        return noerr;
    945 }
    946 
    947 /******************************************************************************************************************************
    948                                    PenaltyPairs
    949 ******************************************************************************************************************************/
    950 
     876}/*}}}*/
     877/*FUNCTION PenaltyPairs{{{*/
    951878int PenaltyPairs(double*** priftspenaltypairs,int** priftsnumpenaltypairs,int numrifts,double** riftssegments,
    952879                int* riftsnumsegs,double** riftspairs,double* riftstips,double* x,double* y){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/shared/TriMesh/trimesh.h

    r11401 r12168  
    66#define _SHARED_TRIMESH_H
    77
    8 
    98#include <stdio.h>
    109#include <math.h>
    1110
    12 
    13 
    1411//#define REAL double //took  it out because it may conflict with stdlib.h defines. put back if necessary
    15 
    1612int AssociateSegmentToElement(double** psegments,int nseg, double* index,int nel);
    1713int OrderSegments(double** psegments,int nseg, double* index,int nel);
    18                
    1914int GridInsideHole(double* px0,double* py0,int n,double* x,double* y);
    2015int FindElement(double A,double B,double* index,int nel);
    21 
    2216int SplitMeshForRifts(int* pnel,double** pindex,int* pnods,double** px,double** py,int* pnsegs,double** psegments,double** psegmentmarkerlist);
    23 
    2417int IsGridOnRift(int* riftsegments, int nriftsegs, int node);
    2518int GridElementsList(int** pGridElements, int* pNumGridElements,int node,double * index,int nel);
     
    2821void RiftSegmentsFromSegments(int* pnriftsegs, int** priftsegments, int nel, double* index, int nsegs,double* segments);
    2922int DetermineGridElementListOnOneSideOfRift(int* pNumGridElementListOnOneSideOfRift, int** pGridElementListOnOneSideOfRift, int segmentnumber, int nriftsegs, int* riftsegments, int node,double* index,int nel);
    30 int UpdateSegments(double** psegments,double** psegmentmarkerlist, int* pnsegs, double* index, double* x,double* y,int* riftsegments,int nriftsegs);
     23int UpdateSegments(double** psegments,double** psegmentmarkerlist, int* pnsegs, double* index, double* x,double* y,int* riftsegments,int nriftsegs,int nods,int nel);
    3124int pnpoly(int npol, double *xp, double *yp, double x, double y);
    3225int FindElement(double A,double B,double* index,int nel);
    3326int RemoveRifts(double** pindex,double** px,double** py,int* pnods,double** psegments,int* pnumsegs,int numrifts1,int* rifts1numsegs,double** rifts1segments,double** rifts1pairs,int nel);
    3427int IsRiftPresent(int* priftflag,int* pnumrifts, double* segmentmarkerlist,int nsegs);
    35 int SplitRiftSegments(double** psegments,double** psegmentmarkerlist, int* pnumsegs, int* pnumrifts,int** priftsnumsegs,double*** priftssegments,int numrifts);
    36 int OrderRifts(double** priftstips, double** riftssegments,double** riftspairs,int numrifts,int* riftsnumsegments,double* x,double* y);
     28int SplitRiftSegments(double** psegments,double** psegmentmarkerlist, int* pnumsegs, int* pnumrifts,int** priftsnumsegs,double*** priftssegments,int numrifts,int nods,int nels);
     29int OrderRifts(double** priftstips, double** riftssegments,double** riftspairs,int numrifts,int* riftsnumsegments,double* x,double* y,int nods,int nels);
    3730int PenaltyPairs(double*** priftspenaltypairs,int** priftsnumpenaltypairs,int numrifts,double**  riftssegments,
    3831                int* riftsnumsegments,double** riftspairs,double* riftstips,double* x,double* y);
    39 
    4032int RemoveCornersFromRifts(double** pindex,int* pnel,double** px,double** py,int* pnods, double* segments,double* segmentmarkers,int num_seg);
    4133int PairRiftElements(int** priftsnumpairs, double*** priftspairs,int numrifts,int* riftsnumsegments, double** riftssegments,double* x,double* y);
    4234
    43 
    4435#endif  /* _SHARED_TRIMESH_H */
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/shared/Wrapper/wrappershared.h

    r11935 r12168  
    88#include "../../objects/objects.h"
    99
    10 #ifdef _SERIAL_
    1110int ModuleBoot(void);
    1211int ModuleEnd(void);
    13 #endif
    1412
    1513#endif
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/shared/shared.h

    r12004 r12168  
    88
    99#include "Alloc/alloc.h"
     10#include "Alloc/alloc_module.h"
    1011#include "Exceptions/exceptions.h"
    1112#include "Exp/exp.h"
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/solutions/issm.cpp

    r12004 r12168  
    3535        int      ierr;
    3636
    37         MODULEBOOT();
    38 
    39         #ifndef _PARALLEL_
    40         _error_(" parallel executable was compiled without support of parallel libraries!");
    41         #endif
     37        ISSMBOOT();
    4238
    4339        /*Initialize environments: Petsc, MPI, etc...: */
     
    4642        if(ierr) _error_("Could not initialize Petsc");
    4743        #else
     44        #ifdef _HAVE_MPI_
    4845        MPI_Init(&argc,&argv);
    4946        #endif
     47        #endif
    5048
     49        #ifdef _HAVE_MPI_
    5150        MPI_Barrier(MPI_COMM_WORLD); start=MPI_Wtime();
     51        #else
     52        start=(double)clock();
     53        #endif
    5254
    5355        /*Size and rank: */
     56        #ifdef _HAVE_MPI_
    5457        MPI_Comm_rank(MPI_COMM_WORLD,&my_rank); 
    5558        MPI_Comm_size(MPI_COMM_WORLD,&num_procs);
     59        #endif
    5660
    5761        /*First process inputs*/
     
    6670       
    6771        /*Create femmodel, using input file: */
     72        #ifdef _HAVE_MPI_
    6873        MPI_Barrier(MPI_COMM_WORLD); start_init=MPI_Wtime();
     74        #else
     75        start_init=(double)clock();
     76        #endif
    6977        femmodel=new FemModel(binfilename,outbinfilename,solution_type,analyses,numanalyses);
    7078       
     
    8694        femmodel->parameters->FindParam(&control_analysis,InversionIscontrolEnum);
    8795        femmodel->parameters->FindParam(&tao_analysis,InversionTaoEnum);
     96        #ifdef _HAVE_MPI_
    8897        MPI_Barrier(MPI_COMM_WORLD); finish_init=MPI_Wtime();
     98        #else
     99        finish_init=(double)clock();
     100        #endif
    89101
    90102        _printf_(true,"call computational core:\n");
     103        #ifdef _HAVE_MPI_
    91104        MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
     105        #else
     106        start_core=(double)clock();
     107        #endif
     108       
    92109        if(dakota_analysis){
    93110                #ifdef _HAVE_DAKOTA_
     
    110127                solutioncore(femmodel);
    111128        }
     129        #ifdef _HAVE_MPI_
    112130        MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
    113 
     131        #else
     132        finish_core=(double)clock();
     133        #endif
     134       
    114135        _printf_(true,"write results to disk:\n");
    115136        OutputResultsx(femmodel->elements, femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,femmodel->results);
     
    131152
    132153        /*Get finish time and close*/
     154        #ifdef _HAVE_MPI_
    133155        MPI_Barrier(MPI_COMM_WORLD); finish = MPI_Wtime( );
    134156        _printf_(true,"\n   %-34s %f seconds  \n","FemModel initialization elapsed time:",finish_init-start_init);
    135157        _printf_(true,"   %-34s %f seconds  \n","Core solution elapsed time:",finish_core-start_core);
    136158        _printf_(true,"\n   %s %i hrs %i min %i sec\n\n","Total elapsed time:",int((finish-start)/3600),int(int(finish-start)%3600/60),int(finish-start)%60);
     159        #else
     160        finish=(double)clock();
     161        _printf_(true,"\n   %-34s %f seconds  \n","FemModel initialization elapsed time:",(finish_init-start_init)/CLOCKS_PER_SEC);
     162        _printf_(true,"   %-34s %f seconds  \n","Core solution elapsed time:",(finish_core-start_core)/CLOCKS_PER_SEC);
     163        _printf_(true,"\n   %s %i hrs %i min %i sec\n\n","Total elapsed time:",int((finish-start)/3600/CLOCKS_PER_SEC),int(int((finish-start)/CLOCKS_PER_SEC)%3600/60),(int(finish-start)/CLOCKS_PER_SEC)%60);
     164        #endif
    137165       
     166               
    138167       
     168        #ifdef _HAVE_PETSC_
    139169        _printf_(true,"closing MPI and Petsc\n");
    140         #ifdef _HAVE_PETSC_
    141170        PetscFinalize();
    142171        #else
     172        #ifdef _HAVE_MPI_
     173        _printf_(true,"closing MPI and Petsc\n");
    143174        MPI_Finalize();
     175        #endif
    144176        #endif
    145177       
    146178        /*end module: */
    147         MODULEEND();
     179        ISSMEND();
    148180
    149181        return 0; //unix success return;
    150182}
    151 
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/toolkits/issm/SeqMat.cpp

    r11941 r12168  
    9292}
    9393/*}}}*/
    94 
    95 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    96 /*FUNCTION SeqMat::ToMatlabMatrix{{{1*/
    97 mxArray* SeqMat::ToMatlabMatrix(void){
    98 
    99         /*Intermediary: */
    100         double* buffer=NULL;
    101         mxArray* pfield=NULL;
    102        
    103         /*output: */
    104         mxArray* dataref=NULL;
    105 
    106         /*copy vector into a new buffer: */
    107         if(this->M*this->N){
    108                 buffer=(double*)xmalloc(this->M*this->N*sizeof(double));
    109                 memcpy(buffer,this->matrix,M*N*sizeof(double));
    110 
    111                 pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    112                 mxSetM(pfield,this->N);
    113                 mxSetN(pfield,this->M);
    114                 mxSetPr(pfield,buffer);
    115                
    116                 //transpose the matrix, written directly to matlab! from C to matlab.
    117                 mexCallMATLAB(1,&dataref, 1, &pfield, "transpose");
    118         }
    119         else dataref=mxCreateDoubleMatrix(0,0,mxREAL);
    120 
    121         /*do not erase buffer!: */
    122         return dataref;
    123 
    124 }
    125 
    126 
    127        
    128        
    129 /*}}}*/
    130 /*FUNCTION MatlabMatrixToSeqMat{{{1*/
    131 SeqMat* MatlabMatrixToSeqMat(const mxArray* dataref){
    132 
    133         SeqMat* output=NULL;
    134 
    135         output=new SeqMat();
    136         MatlabMatrixToDoubleMatrix(&output->matrix,&output->M,&output->N,dataref);
    137         return output;
    138 
    139 }
    140 /*}}}*/
    141 #endif
    14294/*FUNCTION SeqMat::Assemble{{{1*/
    14395void SeqMat::Assemble(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/toolkits/issm/SeqMat.h

    r11941 r12168  
    1515
    1616#include "../toolkitsenums.h"
    17 
    18 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    19 #include "mex.h"
    20 #endif
    2117
    2218/*}}}*/
     
    4036                /*SeqMat specific routines {{{1*/
    4137                void Echo(void);
    42                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    43                 mxArray* ToMatlabMatrix(void);
    44                 #endif
    4538                void Assemble(void);
    4639                double Norm(NormMode norm_type);
     
    5649};
    5750               
    58 /*API :*/
    59 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    60 SeqMat*  MatlabMatrixToSeqMat(const mxArray* dataref);
    61 #endif
    62 
    6351#endif //#ifndef _SEQMAT_H_
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/toolkits/issm/SeqVec.cpp

    r11861 r12168  
    6666/*}}}*/
    6767
    68 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    69 /*FUNCTION SeqVec::ToMatlabVector{{{1*/
    70 mxArray* SeqVec::ToMatlabVector(void){
    71 
    72         double* buffer=NULL;
    73        
    74         mxArray* dataref=NULL;
    75 
    76         /*copy vector into a new buffer: */
    77         if(this->M){
    78                 buffer=(double*)xmalloc(this->M*sizeof(double));
    79                 memcpy(buffer,vector,M*sizeof(double));
    80 
    81                 dataref = mxCreateDoubleMatrix(0,0,mxREAL);
    82                 mxSetM(dataref,this->M);
    83                 mxSetN(dataref,1);
    84                 mxSetPr(dataref,buffer);       
    85         }
    86         else dataref = mxCreateDoubleMatrix(0,0,mxREAL);
    87 
    88 
    89         /*do not erase buffer!: */
    90         return dataref;
    91 
    92 }
    93 /*}}}*/
    94 /*FUNCTION MatlabVectorToSeqVec{{{1*/
    95 SeqVec* MatlabVectorToSeqVec(const mxArray* dataref){
    96 
    97         SeqVec* output=NULL;
    98 
    99         output=new SeqVec();
    100         MatlabVectorToDoubleVector(&output->vector,&output->M,dataref);
    101         return output;
    102 
    103 }
    104 /*}}}*/
    105 #endif
    10668/*FUNCTION SeqVec::Assemble{{{1*/
    10769void SeqVec::Assemble(void){
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/toolkits/issm/SeqVec.h

    r11861 r12168  
    1515
    1616#include "../toolkitsenums.h"
    17 
    18 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    19 #include "mex.h"
    20 #endif
    2117
    2218/*}}}*/
     
    3733                /*SeqVec specific routines {{{1*/
    3834                void Echo(void);
    39                 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    40                 mxArray* ToMatlabVector(void);
    41                 #endif
    4235                void Assemble(void);
    4336                void SetValues(int ssize, int* list, double* values, InsMode mode);
     
    5952};
    6053
    61 
    62 /*API :*/
    63 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    64 SeqVec*  MatlabVectorToSeqVec(const mxArray* dataref);
    65 #endif
    66 
    6754#endif //#ifndef _SEQVEC_H_
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/toolkits/petsc/patches/MatInvert.cpp

    r12004 r12168  
    5555        MatAssemblyBegin(inv,MAT_FINAL_ASSEMBLY);
    5656        MatAssemblyEnd(inv,MAT_FINAL_ASSEMBLY);
    57 
    58         #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    59                 MatConvert(inv, MATSEQAIJ,MAT_REUSE_MATRIX,&inv);
    60         #else
    61                 MatConvert(inv, MATMPIAIJ,MAT_REUSE_MATRIX,&inv);
    62         #endif
     57               
     58        MatConvert(inv, MATMPIAIJ,MAT_REUSE_MATRIX,&inv);
    6359       
    6460        /*Free ressources:*/
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/toolkits/petsc/patches/NewMat.cpp

    r12004 r12168  
    6868
    6969        #ifdef _HAVE_PETSCDEV_
    70         MatCreateAIJ(MPI_COMM_WORLD,m,n,M,N,d_nz,NULL,o_nz,NULL,&outmatrix);
     70        if(sparsity==1){
     71                MatCreateDense(MPI_COMM_WORLD,m,n,M,N,NULL,&outmatrix);
     72        }
     73        else{
     74                MatCreateAIJ(MPI_COMM_WORLD,m,n,M,N,d_nz,NULL,o_nz,NULL,&outmatrix);
     75        }
    7176        #else
    7277        MatCreateMPIAIJ(MPI_COMM_WORLD,m,n,M,N,d_nz,NULL,o_nz,NULL,&outmatrix);
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/toolkits/petsc/patches/petscpatches.h

    r12004 r12168  
    1515
    1616class Parameters;
    17 
    18 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    19 #include "mex.h"
    20 int MatlabMatrixToPetscMatrix(Mat* matrix,int* prows,int* pcols, const mxArray* mxmatrix);
    21 int MatlabVectorToPetscVector(Vec* pvector,int* pvector_rows,const mxArray* mxvector);
    22 int PetscMatrixToMatlabMatrix(mxArray** pdataref,Mat matrix);
    23 int PetscVectorToMatlabVector(mxArray** pdataref,Vec vector);
    24 #endif
    2517
    2618Vec NewVec(int size,bool fromlocalsize=false);
     
    5143MatType ISSMToPetscMatrixType(MatrixType type);
    5244
     45void PetscMatrixToDoubleMatrix(double** pmatrix, int* prows, int* pcols,Mat matrix);
     46void PetscVectorToDoubleVector(double** pvector, int* prows, Vec vector);
     47
    5348#endif
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/toolkits/python/pythonincludes.h

    r11974 r12168  
    77
    88
     9#ifdef HAVE_CONFIG_H
     10        #include <config.h>
     11#else
     12#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
     13#endif
     14
     15#if _PYTHON_MAJOR_ == 2
     16#undef NPY_NO_DEPRECATED_API
     17#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
     18#else
     19#define NPY_NO_DEPRECATED_API
     20#endif
     21
    922#include "Python.h"
    1023#include "arrayobject.h"
    11 
    12 
    1324
    1425#ifdef _HAVE_BOOST_
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/toolkits/toolkits.h

    r12004 r12168  
    1212#endif
    1313
    14 #if defined(_HAVE_PYTHON_) && defined(_SERIAL_)
     14#ifdef _HAVE_PYTHON_
    1515#include "./python/pythonincludes.h"
    1616#endif
     
    2020#endif
    2121
    22 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    23 #include "./matlab/matlabincludes.h"
     22#ifdef _HAVE_MPI_
     23#include "./mpi/mpiincludes.h"
    2424#endif
    2525
     26#ifdef _HAVE_METIS_
     27#include "./metis/metisincludes.h"
     28#endif
    2629
    27 #include "./mpi/mpiincludes.h"
    28 #include "./metis/metisincludes.h"
    2930#include "./triangle/triangleincludes.h"
    30 #include "./double/double.h"
    3131#include "./toolkitsenums.h"
    3232#include "./issm/issmtoolkit.h"
  • TabularUnified issm/branches/trunk-jpl-damage/src/c/toolkits/triangle/triangleincludes.h

    r2214 r12168  
    66#define _TRIANGLE_INCLUDES_H_
    77
    8 #ifdef _SERIAL_
    9 
    108#ifdef _C_ //only valid for iso C, not C++
    119/*Triangle includes: */
     
    1311#endif //#ifdef _C_
    1412
    15 #endif //ifdef _SERIAL_
    16 
    1713
    1814#endif
  • TabularUnified issm/branches/trunk-jpl-damage/src/dox/issm.dox

    r11241 r12168  
    4646</th>
    4747<tr>
    48 <th  bgcolor=#FFFFFF style="text-align:left;"> C++ </th><td  bgcolor=#FFFFFF style="text-align:right;">533</td><td  bgcolor=#FFFFFF style="text-align:right;">15491</td><td  bgcolor=#FFFFFF style="text-align:right;">17275</td><td  bgcolor=#FFFFFF style="text-align:right;">58005</td><td  bgcolor=#FFFFFF style="text-align:right;">90771</td>
     48<th  bgcolor=#FFFFFF style="text-align:left;"> C++ </th><td  bgcolor=#FFFFFF style="text-align:right;">499</td><td  bgcolor=#FFFFFF style="text-align:right;">14338</td><td  bgcolor=#FFFFFF style="text-align:right;">16340</td><td  bgcolor=#FFFFFF style="text-align:right;">54651</td><td  bgcolor=#FFFFFF style="text-align:right;">85329</td>
    4949</tr>
    5050<tr>
    51 <th  bgcolor=#C6E2FF style="text-align:left;"> MATLAB </th><td  bgcolor=#C6E2FF style="text-align:right;">977</td><td  bgcolor=#C6E2FF style="text-align:right;">7199</td><td  bgcolor=#C6E2FF style="text-align:right;">13702</td><td  bgcolor=#C6E2FF style="text-align:right;">31690</td><td  bgcolor=#C6E2FF style="text-align:right;">52591</td>
     51<th  bgcolor=#C6E2FF style="text-align:left;"> MATLAB </th><td  bgcolor=#C6E2FF style="text-align:right;">919</td><td  bgcolor=#C6E2FF style="text-align:right;">6875</td><td  bgcolor=#C6E2FF style="text-align:right;">13184</td><td  bgcolor=#C6E2FF style="text-align:right;">30350</td><td  bgcolor=#C6E2FF style="text-align:right;">50409</td>
    5252</tr>
    5353<tr>
    54 <th  bgcolor=#FFFFFF style="text-align:left;"> C/C++  Header </th><td  bgcolor=#FFFFFF style="text-align:right;">399</td><td  bgcolor=#FFFFFF style="text-align:right;">3069</td><td  bgcolor=#FFFFFF style="text-align:right;">2727</td><td  bgcolor=#FFFFFF style="text-align:right;">10358</td><td  bgcolor=#FFFFFF style="text-align:right;">16154</td>
     54<th  bgcolor=#FFFFFF style="text-align:left;"> C/C++  Header </th><td  bgcolor=#FFFFFF style="text-align:right;">366</td><td  bgcolor=#FFFFFF style="text-align:right;">2665</td><td  bgcolor=#FFFFFF style="text-align:right;">2529</td><td  bgcolor=#FFFFFF style="text-align:right;">9400</td><td  bgcolor=#FFFFFF style="text-align:right;">14594</td>
    5555</tr>
    5656<tr>
    57 <th  bgcolor=#C6E2FF style="text-align:left;"> m4 </th><td  bgcolor=#C6E2FF style="text-align:right;">7</td><td  bgcolor=#C6E2FF style="text-align:right;">1061</td><td  bgcolor=#C6E2FF style="text-align:right;">242</td><td  bgcolor=#C6E2FF style="text-align:right;">8941</td><td  bgcolor=#C6E2FF style="text-align:right;">10244</td>
     57<th  bgcolor=#C6E2FF style="text-align:left;"> m4 </th><td  bgcolor=#C6E2FF style="text-align:right;">7</td><td  bgcolor=#C6E2FF style="text-align:right;">993</td><td  bgcolor=#C6E2FF style="text-align:right;">80</td><td  bgcolor=#C6E2FF style="text-align:right;">8237</td><td  bgcolor=#C6E2FF style="text-align:right;">9310</td>
    5858</tr>
    5959<tr>
    60 <th  bgcolor=#FFFFFF style="text-align:left;"> Objective  C </th><td  bgcolor=#FFFFFF style="text-align:right;">9</td><td  bgcolor=#FFFFFF style="text-align:right;">98</td><td  bgcolor=#FFFFFF style="text-align:right;">0</td><td  bgcolor=#FFFFFF style="text-align:right;">370</td><td  bgcolor=#FFFFFF style="text-align:right;">468</td>
     60<th  bgcolor=#FFFFFF style="text-align:left;"> Python </th><td  bgcolor=#FFFFFF style="text-align:right;">47</td><td  bgcolor=#FFFFFF style="text-align:right;">183</td><td  bgcolor=#FFFFFF style="text-align:right;">518</td><td  bgcolor=#FFFFFF style="text-align:right;">1099</td><td  bgcolor=#FFFFFF style="text-align:right;">1800</td>
    6161</tr>
    6262<tr>
    63 <th  bgcolor=#C6E2FF style="text-align:left;"> Bourne  Shell </th><td  bgcolor=#C6E2FF style="text-align:right;">8</td><td  bgcolor=#C6E2FF style="text-align:right;">61</td><td  bgcolor=#C6E2FF style="text-align:right;">98</td><td  bgcolor=#C6E2FF style="text-align:right;">271</td><td  bgcolor=#C6E2FF style="text-align:right;">430</td>
     63<th  bgcolor=#C6E2FF style="text-align:left;"> Objective  C </th><td  bgcolor=#C6E2FF style="text-align:right;">9</td><td  bgcolor=#C6E2FF style="text-align:right;">98</td><td  bgcolor=#C6E2FF style="text-align:right;">0</td><td  bgcolor=#C6E2FF style="text-align:right;">370</td><td  bgcolor=#C6E2FF style="text-align:right;">468</td>
    6464</tr>
    6565<tr>
     
    6767</tr>
    6868<tr>
    69 <th  bgcolor=#C6E2FF style="text-align:left;"> IDL </th><td  bgcolor=#C6E2FF style="text-align:right;">1</td><td  bgcolor=#C6E2FF style="text-align:right;">18</td><td  bgcolor=#C6E2FF style="text-align:right;">4</td><td  bgcolor=#C6E2FF style="text-align:right;">124</td><td  bgcolor=#C6E2FF style="text-align:right;">146</td>
     69<th  bgcolor=#C6E2FF style="text-align:left;"> Bourne  Shell </th><td  bgcolor=#C6E2FF style="text-align:right;">5</td><td  bgcolor=#C6E2FF style="text-align:right;">46</td><td  bgcolor=#C6E2FF style="text-align:right;">71</td><td  bgcolor=#C6E2FF style="text-align:right;">226</td><td  bgcolor=#C6E2FF style="text-align:right;">343</td>
    7070</tr>
    7171<tr>
    72 <th  bgcolor=#FFFFFF style="text-align:left;"> C </th><td  bgcolor=#FFFFFF style="text-align:right;">2</td><td  bgcolor=#FFFFFF style="text-align:right;">3</td><td  bgcolor=#FFFFFF style="text-align:right;">3</td><td  bgcolor=#FFFFFF style="text-align:right;">24</td><td  bgcolor=#FFFFFF style="text-align:right;">30</td>
     72<th  bgcolor=#FFFFFF style="text-align:left;"> IDL </th><td  bgcolor=#FFFFFF style="text-align:right;">1</td><td  bgcolor=#FFFFFF style="text-align:right;">18</td><td  bgcolor=#FFFFFF style="text-align:right;">4</td><td  bgcolor=#FFFFFF style="text-align:right;">124</td><td  bgcolor=#FFFFFF style="text-align:right;">146</td>
    7373</tr>
    7474<tr>
    75 <th  bgcolor=#C6E2FF style="text-align:left;"> Python </th><td  bgcolor=#C6E2FF style="text-align:right;">2</td><td  bgcolor=#C6E2FF style="text-align:right;">1</td><td  bgcolor=#C6E2FF style="text-align:right;">4</td><td  bgcolor=#C6E2FF style="text-align:right;">13</td><td  bgcolor=#C6E2FF style="text-align:right;">18</td>
     75<th  bgcolor=#C6E2FF style="text-align:left;"> C </th><td  bgcolor=#C6E2FF style="text-align:right;">2</td><td  bgcolor=#C6E2FF style="text-align:right;">3</td><td  bgcolor=#C6E2FF style="text-align:right;">3</td><td  bgcolor=#C6E2FF style="text-align:right;">24</td><td  bgcolor=#C6E2FF style="text-align:right;">30</td>
    7676</tr>
    7777<tr>
    78 <th  bgcolor=#FFFFFF style="text-align:left;"> SUM: </th><td  bgcolor=#FFFFFF style="text-align:right;">1941</td><td  bgcolor=#FFFFFF style="text-align:right;">27022</td><td  bgcolor=#FFFFFF style="text-align:right;">34078</td><td  bgcolor=#FFFFFF style="text-align:right;">110036</td><td  bgcolor=#FFFFFF style="text-align:right;">171136</td>
     78<th  bgcolor=#FFFFFF style="text-align:left;"> SUM: </th><td  bgcolor=#FFFFFF style="text-align:right;">1858</td><td  bgcolor=#FFFFFF style="text-align:right;">25240</td><td  bgcolor=#FFFFFF style="text-align:right;">32752</td><td  bgcolor=#FFFFFF style="text-align:right;">104721</td><td  bgcolor=#FFFFFF style="text-align:right;">162713</td>
    7979</tr>
    8080</table>
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/Makefile.am

    r12004 r12168  
    1313                                ./planet/*.m \
    1414                                ./qmu/*.m \
    15                                 ./shared/*.m \
    16                                 ./solutions/*.m \
    17                                 ./solvers/*.m \
    1815                                ./utils/*.m \
    19                                 ./utils/Analysis/*.m \
    2016                                ./utils/Array/*.m \
    2117                                ./utils/BC/*.m \
  • issm/branches/trunk-jpl-damage/src/m/classes

    • Property svn:ignore
      • TabularUnified  

        old new  
         1__pycache__
        12Makefile.in
        23Makefile
  • issm/branches/trunk-jpl-damage/src/m/classes/clusters

    • Property svn:ignore
      • TabularUnified  

        old new  
         1__pycache__
        12Makefile.in
        23Makefile
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/classes/clusters/generic.m

    r12004 r12168  
    22%
    33%   Usage:
    4 %      cluster=generic('name','astrid',);
    54%      cluster=generic('name','astrid','np',3);
    65%      cluster=generic('name',oshostname(),'np',3,'login','username');
     
    1413                 port=0;
    1514                 interactive=1;
    16                  codepath=[issmtier() '/bin'];
    17                  executionpath=[issmtier() '/execution'];
    18                  valgrind=[issmtier() '/externalpackages/valgrind/install/bin/valgrind'];
    19                  valgrindlib=[issmtier() '/externalpackages/valgrind/install/lib/libmpidebug.so'];
    20                  valgrindsup=[issmtier() '/externalpackages/valgrind/issm.supp'];
     15                 codepath=[issmdir() '/bin'];
     16                 executionpath=[issmdir() '/execution'];
     17                 valgrind=[issmdir() '/externalpackages/valgrind/install/bin/valgrind'];
     18                 valgrindlib=[issmdir() '/externalpackages/valgrind/install/lib/libmpidebug.so'];
     19                 valgrindsup=[issmdir() '/externalpackages/valgrind/issm.supp'];
    2120                 %}}}
    2221         end
     
    2827
    2928                         %get name
    30                          if ~exist(options,'name'), error('option ''name'' has not been provided'); end
    31                          cluster.name=getfieldvalue(options,'name');
     29                         cluster.name=getfieldvalue(options,'name',oshostname());
    3230
    3331                         %initialize cluster using user settings if provided
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/classes/clusters/none.m

    r12004 r12168  
    1212    methods
    1313                 function cluster=none(varargin) % {{{1
    14                          cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
    15                  end
    16                  %}}}
    17                  function disp(cluster) % {{{1
    18                          %  display the object
    19                          disp(sprintf('cluster class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
    20                          disp(sprintf('    name: %s',cluster.name));
    21                  end
    22                  %}}}
    23                  function checkconsistency(cluster,md,solution,analyses) % {{{1
    24                  end
    25                  %}}}
    26                  function BuildQueueScript(cluster,md) % {{{1
    27                          error('none.BuildQueueScript error message: serial cluster cannot build queue script');
     14                         error('Cannot assign md.cluster to ''none'': ISSM is not available in serial model anymore');
    2815                 end
    2916                 %}}}
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/classes/diagnostic.m

    r12004 r12168  
    130130                        fielddisplay(obj,'spcvy','y-axis velocity constraint (NaN means no constraint)');
    131131                        fielddisplay(obj,'spcvz','z-axis velocity constraint (NaN means no constraint)');
    132                         fielddisplay(obj,'icefront','segments on ice front list (last column 0-> Air, 1-> Water, 2->Ice');
     132                        fielddisplay(obj,'icefront','segments on ice front list (last column 0-> Air, 1-> Water, 2->Ice)');
    133133
    134134                        disp(sprintf('\n      %s','Rift options:'));
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/classes/groundingline.m

    r12004 r12168  
    3737                                end
    3838                                pos=find(md.mask.vertexongroundedice);
    39                                 if any(md.geometry.bed(pos)-md.geometry.bathymetry(pos)),
     39                                if any(abs(md.geometry.bed(pos)-md.geometry.bathymetry(pos))>10^-10),
    4040                                        checkmessage(['bathymetry not equal to bed on grounded ice !']);
    4141                                end
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/classes/model/model.m

    r12004 r12168  
    382382                                 md.solver           = addoptions(md.solver,DiagnosticVertAnalysisEnum,iluasmoptions);
    383383                         end
    384                          md.cluster          = none();
     384                         md.cluster          = generic();
    385385                         md.balancethickness = balancethickness();
    386386                         md.diagnostic       = diagnostic();
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/classes/modellist.m

    r12004 r12168  
    77        properties (SetAccess=public)
    88                models  = cell(0,1);
    9                 cluster = none();
     9                cluster = generic();
    1010        end
    1111        methods
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/classes/solver.m

    r12004 r12168  
    1818                                 end
    1919                         end % }}}
    20                  function obj = addoptions(obj,analysis,solveroptions) % {{{1
     20                 function obj = addoptions(obj,analysis,varargin) % {{{1
     21                 % Usage example:
     22                 %    md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum,stokesoptions());
     23                 %    md.solver=addoptions(md.solver,DiagnosticHorizAnalysisEnum);
    2124
    2225                         %Convert analysis from enum to string
     
    2932
    3033                         %Add solver options to analysis
    31                          obj.(analysis) = solveroptions;
     34                         if nargin==3, obj.(analysis) = varargin{1}; end
    3235                 end
    3336                 %}}}
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/kml/README.txt

    r8298 r12168  
    6161There are some other utilities that are used in the construction of topological tables for the kml writing.
    6262
    63 nodeconnectivity.m   - create a node connectivity table (nnodes x mxepg+1)
     63kmlnodeconnectivity.m   - create a node connectivity table (nnodes x mxepg+1)
    6464edgeadjacency.m      - create an edge adjacency array (elems x edges)
    6565edgeperimeter.m      - create an edge perimeter (edgeper x 2) and element perimeter (edgeper x 1) list
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/kml/kml_part_edges.m

    r9733 r12168  
    150150        elemp=md.mesh.elements(irow,:);
    151151        epartp=epart(irow,:);
    152         nodeconp=nodeconnectivity(elemp,md.mesh.numberofvertices);
     152        nodeconp=kmlnodeconnectivity(elemp,md.mesh.numberofvertices);
    153153        [edgeadjp]=edgeadjacency(elemp,nodeconp);
    154154        [edgeper,elemper,iloop]=edgeperimeter(elemp,nodeconp,edgeadjp);
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/kml/kml_partitions.m

    r9733 r12168  
    151151        elemp=md.mesh.elements(irow,:);
    152152        epartp=epart(irow,:);
    153         nodeconp=nodeconnectivity(elemp,md.mesh.numberofvertices);
     153        nodeconp=kmlnodeconnectivity(elemp,md.mesh.numberofvertices);
    154154        [edgeadjp]=edgeadjacency(elemp,nodeconp);
    155155        [edgeper,elemper,iloop]=edgeperimeter(elemp,nodeconp,edgeadjp);
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/kml/kml_unsh_edges.m

    r9733 r12168  
    7474if (~exist('prtplt','var') || strncmpi(prtplt,'on' ,2) || strncmpi(prtplt,'y',1)) && ...
    7575    md.qmu.numberofpartitions
    76     [edgeadj]=edgeadjacency(md.mesh.elements,md.nodeconnectivity);
     76    [edgeadj]=edgeadjacency(md.mesh.elements,md.kmlnodeconnectivity);
    7777    [icol,irow]=find(edgeadj'==0);
    7878    edgeuns=zeros(length(irow),2);
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/model/collapse.m

    r12004 r12168  
    3030if ~isnan(md.inversion.vel_obs), md.inversion.vel_obs=project2d(md,md.inversion.vel_obs,md.mesh.numberoflayers); end;
    3131if ~isnan(md.inversion.cost_functions_coefficients), md.inversion.cost_functions_coefficients=project2d(md,md.inversion.cost_functions_coefficients,md.mesh.numberoflayers); end;
    32 if ~isnan(md.inversion.min_parameters), md.inversion.min_parameters=project2d(md,md.inversion.min_parameters,md.mesh.numberoflayers); end;
    33 if ~isnan(md.inversion.max_parameters), md.inversion.max_parameters=project2d(md,md.inversion.max_parameters,md.mesh.numberoflayers); end;
     32if numel(md.inversion.min_parameters)>1, md.inversion.min_parameters=project2d(md,md.inversion.min_parameters,md.mesh.numberoflayers); end;
     33if numel(md.inversion.max_parameters)>1, md.inversion.max_parameters=project2d(md,md.inversion.max_parameters,md.mesh.numberoflayers); end;
    3434if ~isnan(md.surfaceforcings.mass_balance),
    3535        md.surfaceforcings.mass_balance=project2d(md,md.surfaceforcings.mass_balance,md.mesh.numberoflayers);
     
    102102
    103103%lat long
    104 md.mesh.lat=project2d(md,md.mesh.lat,1);
    105 md.mesh.long=project2d(md,md.mesh.long,1);
     104if numel(md.mesh.lat)>1,  md.mesh.lat=project2d(md,md.mesh.lat,1); end
     105if numel(md.mesh.long)>1, md.mesh.long=project2d(md,md.mesh.long,1); end
    106106
    107107%Initialize with the 2d mesh
  • issm/branches/trunk-jpl-damage/src/m/model/mesh

    • Property svn:ignore
      • TabularUnified  

        old new  
         1__pycache__
        12Makefile.in
        23Makefile
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/model/mesh/triangle.m

    r12004 r12168  
    3838
    3939%Mesh using TriMesh
    40 if strcmp(riftname,''),
    41         [md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.segments,md.mesh.segmentmarkers]=TriMesh(domainname,area,true);
    42 else
    43         [elements,x,y,segments,segmentmarkers]=TriMeshRifts(domainname,riftname,area,'yes');
     40[elements,x,y,segments,segmentmarkers]=TriMesh(domainname,riftname,area);
    4441
    45         %check that all the created nodes belong to at least one element
    46         orphan=find(~ismember([1:length(x)],sort(unique(elements(:)))));
    47         for i=1:length(orphan),
    48                 %get rid of the orphan node i
    49                 %update x and y
    50                 x=[x(1:orphan(i)-(i-1)-1); x(orphan(i)-(i-1)+1:end)];
    51                 y=[y(1:orphan(i)-(i-1)-1); y(orphan(i)-(i-1)+1:end)];
    52                 %update elements
    53                 pos=find(elements>orphan(i)-(i-1));
    54                 elements(pos)=elements(pos)-1;
    55                 %update segments
    56                 pos1=find(segments(:,1)>orphan(i)-(i-1));
    57                 pos2=find(segments(:,2)>orphan(i)-(i-1));
    58                 segments(pos1,1)=segments(pos1,1)-1;
    59                 segments(pos2,2)=segments(pos2,2)-1;
    60         end
     42%check that all the created nodes belong to at least one element
     43orphan=find(~ismember([1:length(x)],sort(unique(elements(:)))));
     44for i=1:length(orphan),
     45        disp('WARNING: removing orphans');
     46        %get rid of the orphan node i
     47        %update x and y
     48        x=[x(1:orphan(i)-(i-1)-1); x(orphan(i)-(i-1)+1:end)];
     49        y=[y(1:orphan(i)-(i-1)-1); y(orphan(i)-(i-1)+1:end)];
     50        %update elements
     51        pos=find(elements>orphan(i)-(i-1));
     52        elements(pos)=elements(pos)-1;
     53        %update segments
     54        pos1=find(segments(:,1)>orphan(i)-(i-1));
     55        pos2=find(segments(:,2)>orphan(i)-(i-1));
     56        segments(pos1,1)=segments(pos1,1)-1;
     57        segments(pos2,2)=segments(pos2,2)-1;
     58end
    6159
    62         %plug into md
    63         md.mesh.x=x;
    64         md.mesh.y=y;
    65         md.mesh.elements=elements;
    66         md.mesh.segments=segments;
    67         md.mesh.segmentmarkers=segmentmarkers;
    68 end
     60%plug into md
     61md.mesh.x=x;
     62md.mesh.y=y;
     63md.mesh.elements=elements;
     64md.mesh.segments=segments;
     65md.mesh.segmentmarkers=segmentmarkers;
    6966
    7067%Fill in rest of fields:
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/model/modis.m

    r9620 r12168  
    1414
    1515%Get path  to gdal binaries
    16 path_gdal=[issmtier() '/externalpackages/gdal/install/bin/'];
     16path_gdal=[issmdir() '/externalpackages/gdal/install/bin/'];
    1717
    1818%Was gdal compiled?
    1919if ~exist([path_gdal 'gdal_translate']),
    20         error(['modis error message: GDAL library needs to be compiled to use this routine. Compile GDAL in ' issmtier() '/externalpackages/gdal to use this routine.']);
     20        error(['modis error message: GDAL library needs to be compiled to use this routine. Compile GDAL in ' issmdir() '/externalpackages/gdal to use this routine.']);
    2121end
    2222
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/model/petscversion.m

    r12004 r12168  
    88PETSC_VERSION=3;
    99
    10 configfile=[issmtier() '/config.h'];
     10configfile=[issmdir() '/config.h'];
    1111if ~exist(configfile,'file'),
    1212        error(['File ' configfile ' not found. ISSM has not been configured yet!']);
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/model/plot/applyoptions.m

    r11683 r12168  
    229229                warning on MATLAB:log:logOfZero;
    230230                set(c,'YTickLabel',labels);
     231        end
     232        if exist(options,'cbYLim');
     233                set(c,'YLim',getfieldvalue(options,'cbYLim'));
    231234        end
    232235        if exist(options,'colorbartitle'),
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/model/plot/northarrow.m

    r9288 r12168  
    7272
    7373%Text North
    74 xN=max([A(1) D(1) E(1) F(1) G(1)])+ratio/3*lengtharrow;
     74xN=max([A(1) D(1) E(1) F(1) G(1)])+ratio/3*abs(lengtharrow);
    7575yN=mean([A(2) F(2) H(2)]);
    7676text(xN,yN,'North','FontSize',fontsize,'FontWeight','b');
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/model/plot/plot_gridded.m

    r11009 r12168  
    4040        data_max=max(data_grid(:));
    4141end
     42options=changefieldvalue(options,'cbYLim',[data_min data_max]);
    4243if whitepos==1,
    4344        white  =data_max + (data_max-data_min)/55;
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/model/plot/plot_overlay.m

    r12004 r12168  
    9696        %h_data(find(data_grid>data_mean))=1;
    9797        h_data=1*ones(size(data_grid));
    98         h_data(find(data_grid>data_mean))=0.7;
     98        h_data(find(data_grid<data_mean))=0.7;
    9999        %saturation (S)
    100100        s_data=max(min(abs(data_grid-data_mean)/(data_max-data_mean) ,1),0);
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/model/plot/plot_section.m

    r12004 r12168  
    3636
    3737%read contours:
    38 profiles=expread(getfieldvalue(options,'sectionvalue'),1);
     38profiles=expread(getfieldvalue(options,'sectionvalue'));
    3939numprofiles=length(profiles);
    4040
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/utils/DataProcessing/TracksToMatrix.m

    r8298 r12168  
    2626
    2727%Add path to dace
    28 addpath([issmtier() '/externalpackages/dace/install'])
     28addpath([issmdir() '/externalpackages/dace/install'])
    2929
    3030%First create the x_m and y_m fot the matrix
     
    8282
    8383%remove DACE path
    84 rmpath([issmtier() '/externalpackages/dace/install']);
     84rmpath([issmdir() '/externalpackages/dace/install']);
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/utils/Exp/expdisp.m

    r2721 r12168  
    4141end
    4242
    43 domain=expread(domainoutline,1);
     43domain=expread(domainoutline);
    4444
    4545figure(figurenumber),hold on
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/utils/Exp/exptool.m

    r10138 r12168  
    7171                else
    7272                        %read file
    73                         B=expread(filename,1);
     73                        B=expread(filename);
    7474                        %go through all profiles of B
    7575                        for i=1:size(B,2)
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/utils/Miscellaneous/issmdoc.m

    r11577 r12168  
    22
    33%First get ISSM tier:
    4 ISSM_TIER=issmtier;
     4ISSM_DIR=issmdir;
    55
    66disp(sprintf('\n%s','  A comprehensive documentation is available on http://issm.jpl.nasa.gov'));
    77disp(sprintf('\n%s','  Example: how to create a square ice shelf'));
    8 disp(sprintf('%s','        go to ',ISSM_TIER,'/examples/SquareIceshelf'));
     8disp(sprintf('%s','        go to ',ISSM_DIR,'/examples/SquareIceshelf'));
    99disp(sprintf('%s','        md=model;                                %creates a new empty model structure'));
    1010disp(sprintf('%s','        md=triangle(md,''DomainOutline.exp'',50000);   %creates a mesh of the domain outline with a resolution of 50000m'));
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/utils/OS/ispetsc.m

    r12004 r12168  
    66
    77
    8 configfile=[issmtier() '/bin/config.h']; %should find it in the install target
     8configfile=[issmdir() '/bin/config.h']; %should find it in the install target
    99if ~exist(configfile,'file'),
    1010        error(['File ' configfile ' not found. ISSM has not been configured yet!']);
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/utils/OS/issmscpin.m

    r11577 r12168  
    3232                %use the putty project pscp.exe: it should be in the path.
    3333               
    34                 %get ISSM_TIER variable
    35                 [status,ISSM_TIER]=system('echo [%ISSM_TIER_WIN%]');
     34                %get ISSM_DIR variable
     35                [status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
    3636                if status,
    37                         error('scpin error message: could not find ISSM_TIER_WIN envirnoment variable');
     37                        error('scpin error message: could not find ISSM_DIR_WIN envirnoment variable');
    3838                end
    39                 ISSM_TIER=ISSM_TIER(2:end-2);
     39                ISSM_DIR=ISSM_DIR(2:end-2);
    4040
    4141                username=input('Username: (quoted string) ');
     
    4343
    4444                for i=1:numel(packages),
    45                         [status,result]=system([ISSM_TIER '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' key '" ' host ':' path '/' packages{i} ' ./']);
     45                        [status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' key '" ' host ':' path '/' packages{i} ' ./']);
    4646                        if status,
    4747                                error('scpin error message: could not call putty pscp');
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/utils/OS/issmscpout.m

    r9369 r12168  
    2323                %use the putty project pscp.exe: it should be in the path.
    2424               
    25                 %get ISSM_TIER variable
    26                 [status,ISSM_TIER]=system('echo [%ISSM_TIER_WIN%]');
     25                %get ISSM_DIR variable
     26                [status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
    2727                if status,
    28                         error('scpout error message: could not find ISSM_TIER_WIN envirnoment variable');
     28                        error('scpout error message: could not find ISSM_DIR_WIN envirnoment variable');
    2929                end
    30                 ISSM_TIER=ISSM_TIER(2:end-2);
     30                ISSM_DIR=ISSM_DIR(2:end-2);
    3131
    3232                username=input('Username: (quoted string) ');
     
    3434
    3535                for i=1:numel(packages),
    36                         [status,result]=system([ISSM_TIER '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' key '" ' packages{i} ' ' host ':' path]);
     36                        [status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' key '" ' packages{i} ' ' host ':' path]);
    3737                        if status,
    3838                                error('scpout error message: could not call putty pscp');
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/utils/OS/issmssh.m

    r9369 r12168  
    1515                %use the putty project plink.exe: it should be in the path.
    1616               
    17                 %get ISSM_TIER variable
    18                 [status,ISSM_TIER]=system('echo [%ISSM_TIER_WIN%]');
     17                %get ISSM_DIR variable
     18                [status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
    1919                if status,
    20                         error('issmssh error message: could not find ISSM_TIER_WIN envirnoment variable');
     20                        error('issmssh error message: could not find ISSM_DIR_WIN envirnoment variable');
    2121                end
    22                 ISSM_TIER=ISSM_TIER(2:end-2);
     22                ISSM_DIR=ISSM_DIR(2:end-2);
    2323
    2424                username=input('Username: (quoted string) ');
    2525                key=input('Key: (quoted string) ');
    2626
    27                 system([ISSM_TIER '/externalpackages/ssh/plink.exe -ssh -l "' username '" -pw "' key '" ' host ' "' command '"']);
     27                system([ISSM_DIR '/externalpackages/ssh/plink.exe -ssh -l "' username '" -pw "' key '" ' host ' "' command '"']);
    2828
    2929        else
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/utils/Shell/flaimdir.m

    r11180 r12168  
    55%      FLAIM_DIR=flaimdir()
    66
    7 FLAIM_DIR=[issmtier '/externalpackages/flaim/install'];
     7FLAIM_DIR=[issmdir '/externalpackages/flaim/install'];
  • TabularUnified issm/branches/trunk-jpl-damage/src/m/utils/Shell/issmdir.m

    r11577 r12168  
    11function ISSM_DIR=issmdir()
    2 %ISSMDIR - Get ISSM_DIR environment variable contents.
     2%ISSMDIR - Get ISSM_DIR environment variable
    33%
    44%   Usage:
     
    99else
    1010        ISSM_DIR =getenv('ISSM_DIR_WIN');
     11        if strcmpi(ISSM_DIR(end),'/') | strcmpi(ISSM_DIR(end),'\'),
     12                ISSM_DIR = ISSM_DIR(1:end-1); %shave off the last '/'
     13        end
    1114end
    1215
  • issm/branches/trunk-jpl-damage/src/py

    • Property svn:ignore set to
      Makefile
  • issm/branches/trunk-jpl-damage/src/py/model

    • Property svn:ignore
      • TabularUnified  

        old new  
         1Makefile
        12__pycache__
  • TabularUnified issm/branches/trunk-jpl-damage/startup.m

    r12004 r12168  
    1111lastwarn('');
    1212
    13 %Recover ISSM_TIER , or if on a Windows machine, ISSM_TIER_WIN
     13%Recover ISSM_DIR , or if on a Windows machine, ISSM_DIR_WIN
    1414if ~ispc,
    15         ISSM_TIER=getenv('ISSM_TIER');
     15        ISSM_DIR=getenv('ISSM_DIR');
    1616else
    17         ISSM_TIER=getenv('ISSM_TIER_WIN');
    18         %ISSM_TIER='';
     17        ISSM_DIR=getenv('ISSM_DIR_WIN');
     18        %ISSM_DIR='';
    1919end
    20 if (isempty(ISSM_TIER)),
    21         error('''ISSM_TIER'' environment variable is empty! You should define ISSM_TIER in your .cshrc or .bashrc!');
     20if (isempty(ISSM_DIR)),
     21        error('''ISSM_DIR'' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!');
    2222end
    2323
    2424%Now add all issm code paths necessary to run issm smoothly.
    2525%We capture the error output, so that we can warn the user to update
    26 %the variable ISSM_TIER in this file, in case it is not correctly setup.
     26%the variable ISSM_DIR in this file, in case it is not correctly setup.
    2727
    2828%ISSM path
    29 addpath([ISSM_TIER '/src/m/utils/']); %loads recursivepath
    30 addpath([ISSM_TIER '/bin']);
    31 addpath(recursivepath([ISSM_TIER '/src/m']));
    32 addpath(recursivepath([ISSM_TIER '/externalpackages/scotch']));
    33 addpath(recursivepath([ISSM_TIER '/externalpackages/canos']));
    34 addpath(recursivepath([ISSM_TIER '/externalpackages/kml']));
    35 addpath(recursivepath([ISSM_TIER '/externalpackages/export_fig']));
    36 addpath(recursivepath([ISSM_TIER '/externalpackages/googleearthtoolbox']));
    37 addpath(recursivepath([ISSM_TIER '/externalpackages/cm_and_cb_utilities']));
     29addpath([ISSM_DIR '/src/m/utils/']); %loads recursivepath
     30addpath([ISSM_DIR '/bin']);
     31addpath(recursivepath([ISSM_DIR '/src/m']));
     32addpath(recursivepath([ISSM_DIR '/externalpackages/scotch']));
     33addpath(recursivepath([ISSM_DIR '/externalpackages/canos']));
     34addpath(recursivepath([ISSM_DIR '/externalpackages/kml']));
     35addpath(recursivepath([ISSM_DIR '/externalpackages/export_fig']));
     36addpath(recursivepath([ISSM_DIR '/externalpackages/googleearthtoolbox']));
     37addpath(recursivepath([ISSM_DIR '/externalpackages/cm_and_cb_utilities']));
    3838
    39 clear ISSM_TIER;
     39clear ISSM_DIR;
    4040
    4141%Check on any warning messages that might indicate that the paths were not correct.
    4242if ~isempty(lastwarn),
    43         fprintf('\n  Error trying to setup ''ISSM'' code paths. Try and update the ISSM_TIER variable in your .cshrc or .bashrc!\n');
     43        fprintf('\n  Error trying to setup ''ISSM'' code paths. Try and update the ISSM_DIR variable in your .cshrc or .bashrc!\n');
    4444        fprintf('  ''ISSM'' will not  work at all until this is resolved\n\n');
    4545else
  • TabularUnified issm/branches/trunk-jpl-damage/startup.py

    r12004 r12168  
    55#  before handing over the prompt to the user if the environment variable
    66#  PYTHONSTARTUP is defined:
    7 #  export PYTHONSTARTUP=$ISSM_TIER/startup.py
     7#  export PYTHONSTARTUP=$ISSM_DIR/startup.py
    88#  This startup script should be run by users before trying to use ISSM.
    99
    1010import os,sys
    1111
    12  
    13 #First check we are running python 3 at least
    14 if sys.version_info[0] < 3:
    15         print("ISSM can only work in Python 3. Exiting python")
    16         sys.exit(1)
    17 
    18 #Recover ISSM_TIER, ISSM_DIR  and USERNAME
    19 ISSM_TIER=os.getenv('ISSM_TIER')
     12#Recover ISSM_DIR and USERNAME
     13ISSM_DIR=os.getenv('ISSM_DIR')
    2014USERNAME =os.getenv('USER')
    21 if(ISSM_TIER==None):
    22         raise NameError('"ISSM_TIER" environment variable is empty! You should define ISSM_TIER in your .cshrc or .bashrc!')
     15if(ISSM_DIR==None):
     16        raise NameError('"ISSM_DIR" environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!')
    2317
    2418#Now add all issm code paths necessary to run issm smoothly.
    2519#We capture the error output, so that we can warn the user to update
    26 #the variable ISSM_TIER in this file, in case it is not correctly setup.
     20#the variable ISSM_DIR in this file, in case it is not correctly setup.
    2721
    2822#ISSM path. Go through src/py and load everything we find  that looks like a python file
    29 for root,dirs,files in os.walk(ISSM_TIER+ '/src/py'):
     23for root,dirs,files in os.walk(ISSM_DIR+ '/src/py'):
     24        for file in files:
     25                if file.find(".py") != -1:
     26                        if file.find(".pyc") == -1:
     27                                #add to path
     28                                sys.path.append(root)
     29                                file=os.path.splitext(file)[0]
     30                                #__import__(file)
     31
     32for root,dirs,files in os.walk(ISSM_DIR+ '/src/m'):
    3033        for file in files:
    3134                if file.find(".py") != -1:
     
    3639                                #__import__(file)
    3740                               
    38 sys.path.append(ISSM_TIER + '/src/mex')
     41sys.path.append(ISSM_DIR + '/src/modules/python')
    3942
    4043#Deal with scipy import:
     
    7982from miscellaneous import *
    8083from private import *
    81 from TriMesh import *
     84from triangle import *
     85from setmask import *
    8286
    8387#}}}
  • TabularUnified issm/branches/trunk-jpl-damage/test/NightlyRun/runme.m

    r11684 r12168  
    3030%      md=runme('id',102,'procedure','model');
    3131
    32 %Get ISSM_TIER variable
    33 ISSM_TIER=issmtier();
     32%Get ISSM_DIR variable
     33ISSM_DIR=issmdir();
    3434
    3535%Check inputs
     
    168168                                        message=getReport(me2);
    169169                                        if strcmpi(output,'nightly')
    170                                                 fid=fopen([ISSM_TIER '/nightlylog/matlaberror.log'], 'at');
     170                                                fid=fopen([ISSM_DIR '/nightlylog/matlaberror.log'], 'at');
    171171                                                fprintf(fid,'%s',message);
    172172                                                fprintf(fid,'\n------------------------------------------------------------------\n');
     
    174174                                                disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,fieldname));
    175175                                        elseif strcmpi(output,'daily');
    176                                                 fid=fopen([ISSM_TIER '/dailylog/matlaberror.log'], 'at');
     176                                                fid=fopen([ISSM_DIR '/dailylog/matlaberror.log'], 'at');
    177177                                                fprintf(fid,'%s',message);
    178178                                                fprintf(fid,'\n------------------------------------------------------------------\n');
     
    193193                message=getReport(me);
    194194                if strcmpi(output,'nightly')
    195                         fid=fopen([ISSM_TIER '/nightlylog/matlaberror.log'], 'at');
     195                        fid=fopen([ISSM_DIR '/nightlylog/matlaberror.log'], 'at');
    196196                        fprintf(fid,'%s',message);
    197197                        fprintf(fid,'\n------------------------------------------------------------------\n');
     
    199199                        disp(sprintf(['FAILURE difference: N/A test id: %i test name: %s field: %s'],id,id_string,'N/A'));
    200200                elseif strcmpi(output,'daily');
    201                         fid=fopen([ISSM_TIER '/dailylog/matlaberror.log'], 'at');
     201                        fid=fopen([ISSM_DIR '/dailylog/matlaberror.log'], 'at');
    202202                        fprintf(fid,'%s',message);
    203203                        fprintf(fid,'\n------------------------------------------------------------------\n');
  • TabularUnified issm/branches/trunk-jpl-damage/test/NightlyRun/test448.m

    r11014 r12168  
    33md=parameterize(md,'../Par/SquareSheetShelf.par');
    44md=setflowequation(md,'macayeal','all');
    5 md.cluster=none;
    65md.initialization.vx(:)=0;
    76md.initialization.vy(:)=0;
  • TabularUnified issm/branches/trunk-jpl-damage/test/NightlyRun/test450.m

    r11014 r12168  
    33md=parameterize(md,'../Par/SquareSheetShelf.par');
    44md=setflowequation(md,'macayeal','all');
    5 md.cluster=none;
    65md.initialization.vx(:)=0;
    76md.initialization.vy(:)=0;
  • TabularUnified issm/branches/trunk-jpl-damage/test/NightlyRun/test452.m

    r11096 r12168  
    22md=setmask(md,'../Exp/SquareShelf.exp','');
    33md=parameterize(md,'../Par/SquareSheetShelf.par');
    4 md.cluster=none;
    54md.initialization.vx(:)=0;
    65md.initialization.vy(:)=0;
Note: See TracChangeset for help on using the changeset viewer.