Changeset 21408


Ignore:
Timestamp:
Nov 22, 2016, 2:31:19 AM (10 years ago)
Author:
bdef
Message:

CHG: uniformization fix

Location:
issm/trunk-jpl/test/NightlyRun
Files:
226 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/test/NightlyRun/IdToName.py

    r19049 r21408  
    1212        file_text  = infile.readlines()
    1313
    14         string='#Test Name:';
     14        string='#Test Name:'
    1515        name=file_text[0]
    1616        name=name[len(string)+1:-1]
  • issm/trunk-jpl/test/NightlyRun/runme.py

    r21151 r21408  
    11#!/usr/bin/env python
    22import os
    3 import glob
    4 import socket
    5 import numpy
    6 import sys
    7 import traceback
     3import numpy as np
     4from traceback import format_exc
     5from sys import float_info
     6from glob import glob
     7from socket import gethostname
    88
    99def runme(id=None,exclude=None,benchmark='nightly',procedure='check',output='none',rank=1,numprocs=1):
    … …  
    3434 
    3535            Usage:
    36                runme(varargin);
     36               runme(varargin)
    3737 
    3838            Examples:
    … …  
    4444        from parallelrange import parallelrange
    4545        from IdToName import IdToName
    46         from MatlabFuncs import strcmpi
    47         from MatlabFuncs import ismember
    4846        from arch import archread
    4947        from arch import archwrite
    … …  
    5553        #Process options
    5654        #GET benchmark {{{
    57         if not ismember(benchmark,['all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing','adolc','slr']):
     55        if not benchmark in ['all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing','adolc','slr']:
    5856                print "runme warning: benchmark '%s' not supported, defaulting to test 'nightly'." % benchmark
    5957                benchmark='nightly'
    6058        # }}}
    6159        #GET procedure {{{
    62         if not ismember(procedure,['check','update']):
     60        if not procedure in ['check','update']:
    6361                print "runme warning: procedure '%s' not supported, defaulting to test 'check'." % procedure
    6462                procedure='check'
    6563        # }}}
    6664        #GET output {{{
    67         if not ismember(output,['nightly','none']):
     65        if not output in ['nightly','none']:
    6866                print "runme warning: output '%s' not supported, defaulting to test 'none'." % output
    6967                output='none'
    … …  
    7472        # }}}
    7573        #GET ids  {{{
    76         flist=glob.glob('test*.py')    #File name must start with 'test' and must end by '.py' and must be different than 'test.py'
     74        flist=glob('test*.py')    #File name must start with 'test' and must end by '.py' and must be different than 'test.py'
    7775        list_ids=[int(file[4:-3]) for file in flist if not file == 'test.py']    #Keep test id only (skip 'test' and '.py')
    7876        #print 'list_ids =',list_ids
    … …  
    8179        list_ids=list_ids[i1:i2+1]
    8280        #print 'list_ids after parallelrange =',list_ids
    83 
     81       
    8482        if id:
    8583                if isinstance(id,list):
    … …  
    9088        else:
    9189                test_ids=set(list_ids)
    92         #print 'test_ids after list =',test_ids
     90               
     91                #print 'test_ids after list =',test_ids
    9392        # }}}
    9493        #GET exclude {{{
    … …  
    102101        # }}}
    103102        #Process Ids according to benchmarks {{{
    104         if   strcmpi(benchmark,'nightly'):
     103        if benchmark=='nightly':
    105104                test_ids=test_ids.intersection(set(range(1,1000)))
    106         elif strcmpi(benchmark,'validation'):
     105        elif benchmark=='validation':
    107106                test_ids=test_ids.intersection(set(range(1001,2000)))
    108         elif strcmpi(benchmark,'ismip'):
     107        elif benchmark=='ismip':
    109108                test_ids=test_ids.intersection(set(range(1101,1200)))
    110         elif strcmpi(benchmark,'eismint'):
     109        elif benchmark=='eismint':
    111110                test_ids=test_ids.intersection(set(range(1201,1300)))
    112         elif strcmpi(benchmark,'thermal'):
     111        elif benchmark=='thermal':
    113112                test_ids=test_ids.intersection(set(range(1301,1400)))
    114         elif strcmpi(benchmark,'mesh'):
     113        elif benchmark=='mesh':
    115114                test_ids=test_ids.intersection(set(range(1401,1500)))
    116         elif strcmpi(benchmark,'tranforcing'):
     115        elif benchmark=='tranforcing':
    117116                test_ids=test_ids.intersection(set(range(1501,1503)))
    118         elif strcmpi(benchmark,'referential'):
     117        elif benchmark=='referential':
    119118                test_ids=test_ids.intersection(set(range(1601,1603)))
    120         elif strcmpi(benchmark,'slr'):
     119        elif benchmark=='slr':
    121120                test_ids=test_ids.intersection(set(range(2001,2500)))
    122         elif strcmpi(benchmark,'adolc'):
     121        elif benchmark=='adolc':
    123122                test_ids=test_ids.intersection(set(range(3001,3200)))
    124123        #print 'test_ids after benchmark =',test_ids
    … …  
    141140                        #UPDATE ARCHIVE?
    142141                        archive_name='Archive'+str(id)
    143                         if strcmpi(procedure,'update'):
     142                        if procedure=='update':
    144143                                archive_file=os.path.join('..','Archives',archive_name+'.arch')
    145144                                if os.path.isfile(archive_file):
    146145                                        os.remove(archive_file)
    147146                                for k,fieldname in enumerate(field_names):
    148                                         field=numpy.array(field_values[k],dtype=float)
     147                                        field=np.array(field_values[k],dtype=float)
    149148                                        if len(field.shape) == 1:
    150                                                 if numpy.size(field):
    151                                                         field=field.reshape(numpy.size(field),1)
     149                                                if np.size(field):
     150                                                        field=field.reshape(np.size(field),1)
    152151                                                else:
    153152                                                        field=field.reshape(0,0)
    … …  
    171170                                        try:
    172171                                                #Get field and tolerance
    173                                                 field=numpy.array(field_values[k])
     172                                                field=np.array(field_values[k])
    174173                                                if len(field.shape) == 1:
    175                                                         if numpy.size(field):
    176                                                                 field=field.reshape(numpy.size(field),1)
     174                                                        if np.size(field):
     175                                                                field=field.reshape(np.size(field),1)
    177176                                                        else:
    178177                                                                field=field.reshape(0,0)
    … …  
    181180                                                #compare to archive
    182181                                                # Matlab uses base 1, so use base 1 in labels
    183                                                 archive=numpy.array(archread(archive_file,archive_name+'_field'+str(k+1)))
     182                                                archive=np.array(archread(archive_file,archive_name+'_field'+str(k+1)))
    184183                                                if archive == None:
    185184                                                        raise NameError("Field name '"+archive_name+'_field'+str(k+1)+"' does not exist in archive file.")
    186                                                 error_diff=numpy.amax(numpy.abs(archive-field),axis=0)/ \
    187                                                                    (numpy.amax(numpy.abs(archive),axis=0)+sys.float_info.epsilon)
     185                                                error_diff=np.amax(np.abs(archive-field),axis=0)/ \
     186                                                                   (np.amax(np.abs(archive),axis=0)+float_info.epsilon)
    188187
    189188                                                #disp test result
    190                                                 if (numpy.any(error_diff>tolerance) or numpy.isnan(error_diff)):
     189                                                if (np.any(error_diff>tolerance) or np.isnan(error_diff)):
    191190                                                        print 'ERROR   difference: %-7.2g > %7.2g test id: %i test name: %s field: %s' % \
    192191                                                                (error_diff,tolerance,id,id_string,fieldname)
    … …  
    198197
    199198                                                #something went wrong, print failure message:
    200                                                 print traceback.format_exc()
     199                                                print format_exc()
    201200                                                directory=os.getcwd().split('/')    #  not used?
    202                                                 if   strcmpi(output,'nightly'):
     201                                                if output=='nightly':
    203202                                                        fid=open(os.path.join(ISSM_DIR,'nightlylog','pythonerror.log'), 'a')
    204203                                                        fid.write('%s' % message)
    … …  
    214213
    215214                        #something went wrong, print failure message:
    216                         print traceback.format_exc()
     215                        print format_exc()
    217216                        directory=os.getcwd().split('/')    #  not used?
    218                         if   strcmpi(output,'nightly'):
     217                        if output=='nightly':
    219218                                fid=open(os.path.join(ISSM_DIR,'nightlylog','pythonerror.log'), 'a')
    220219                                fid.write('%s' % message)
    … …  
    254253        md = runme(args.id, args.exclude, args.benchmark, args.procedure, args.output, args.rank, args.numprocs)
    255254
    256         from MatlabFuncs import strcmpi
    257         if strcmpi(args.output,'nightly'):
     255        if args.output=='nightly':
    258256                print "PYTHONEXITEDCORRECTLY"
    259257
  • issm/trunk-jpl/test/NightlyRun/test101.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedStressSSA2d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
    99from massfluxatgate import massfluxatgate
    1010from generic import generic
    … …  
    1414md=parameterize(md,'../Par/SquareShelfConstrained.py')
    1515md=setflowequation(md,'SSA','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1717
    1818#outputs
    1919md.stressbalance.requested_outputs=['default','DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy','MassFlux1','MassFlux2','MassFlux3','MassFlux4','MassFlux5','MassFlux6']
    20 md.outputdefinition.definitions=[
    21                 massfluxatgate('name','MassFlux1','profilename','../Exp/MassFlux1.exp','definitionstring','Outputdefinition1'),
    22                 massfluxatgate('name','MassFlux2','profilename','../Exp/MassFlux2.exp','definitionstring','Outputdefinition2'),
    23                 massfluxatgate('name','MassFlux3','profilename','../Exp/MassFlux3.exp','definitionstring','Outputdefinition3'),
    24                 massfluxatgate('name','MassFlux4','profilename','../Exp/MassFlux4.exp','definitionstring','Outputdefinition4'),
    25                 massfluxatgate('name','MassFlux5','profilename','../Exp/MassFlux5.exp','definitionstring','Outputdefinition5'),
    26                 massfluxatgate('name','MassFlux6','profilename','../Exp/MassFlux6.exp','definitionstring','Outputdefinition6')
    27                 ]
     20md.outputdefinition.definitions=[massfluxatgate('name','MassFlux1','profilename','../Exp/MassFlux1.exp','definitionstring','Outputdefinition1'),
     21                                                                                                                                 massfluxatgate('name','MassFlux2','profilename','../Exp/MassFlux2.exp','definitionstring','Outputdefinition2'),
     22                                                                                                                                 massfluxatgate('name','MassFlux3','profilename','../Exp/MassFlux3.exp','definitionstring','Outputdefinition3'),
     23                                                                                                                                 massfluxatgate('name','MassFlux4','profilename','../Exp/MassFlux4.exp','definitionstring','Outputdefinition4'),
     24                                                                                                                                 massfluxatgate('name','MassFlux5','profilename','../Exp/MassFlux5.exp','definitionstring','Outputdefinition5'),
     25                                                                                                                                 massfluxatgate('name','MassFlux6','profilename','../Exp/MassFlux6.exp','definitionstring','Outputdefinition6')]
    2826
    2927md=solve(md,'Stressbalance')
    3028
    3129#Fields and tolerances to track changes
    32 field_names     =['Vx','Vy','Vel','Pressure',\
    33         'DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy','MassFlux1','MassFlux2','MassFlux3','MassFlux4','MassFlux5','MassFlux6']
    34 field_tolerances=[1e-13,1e-13,1e-13,1e-13,\
    35         1e-13,1e-13,1e-13,\
    36         1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13 ]
    37 field_values=[\
    38         md.results.StressbalanceSolution.Vx,\
    39         md.results.StressbalanceSolution.Vy,\
    40         md.results.StressbalanceSolution.Vel,\
    41         md.results.StressbalanceSolution.Pressure,\
    42         md.results.StressbalanceSolution.DeviatoricStressxx,\
    43         md.results.StressbalanceSolution.DeviatoricStressyy,\
    44         md.results.StressbalanceSolution.DeviatoricStressxy,\
    45         md.results.StressbalanceSolution.MassFlux1,\
    46         md.results.StressbalanceSolution.MassFlux2,\
    47         md.results.StressbalanceSolution.MassFlux3,\
    48         md.results.StressbalanceSolution.MassFlux4,\
    49         md.results.StressbalanceSolution.MassFlux5,\
    50         md.results.StressbalanceSolution.MassFlux6 ]
     30field_names     =['Vx','Vy','Vel','Pressure',
     31                                                                        'DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy',
     32                                                                        'MassFlux1','MassFlux2','MassFlux3','MassFlux4','MassFlux5','MassFlux6']
     33field_tolerances=[1e-13, 1e-13, 1e-13, 1e-13,
     34                                                                        1e-13, 1e-13, 1e-13,
     35                                                                        1e-13, 1e-13, 1e-13,
     36                                                                        1e-13, 1e-13, 1e-13 ]
     37field_values=[md.results.StressbalanceSolution.Vx,
     38                                                        md.results.StressbalanceSolution.Vy,
     39                                                        md.results.StressbalanceSolution.Vel,
     40                                                        md.results.StressbalanceSolution.Pressure,
     41                                                        md.results.StressbalanceSolution.DeviatoricStressxx,
     42                                                        md.results.StressbalanceSolution.DeviatoricStressyy,
     43                                                        md.results.StressbalanceSolution.DeviatoricStressxy,
     44                                                        md.results.StressbalanceSolution.MassFlux1,
     45                                                        md.results.StressbalanceSolution.MassFlux2,
     46                                                        md.results.StressbalanceSolution.MassFlux3,
     47                                                        md.results.StressbalanceSolution.MassFlux4,
     48                                                        md.results.StressbalanceSolution.MassFlux5,
     49                                                        md.results.StressbalanceSolution.MassFlux6 ]
  • issm/trunk-jpl/test/NightlyRun/test102.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedStressSSA3d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000)
    … …  
    1314md.extrude(3,2.)
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'Stressbalance')
    1718
  • issm/trunk-jpl/test/NightlyRun/test103.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedStressHO
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000)
    … …  
    1314md.extrude(3,2.)
    1415md=setflowequation(md,'HO','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md.stressbalance.requested_outputs=['default','StressTensorxx','StressTensoryy','StressTensorzz','StressTensorxy','StressTensorxz','StressTensoryz']
    1718md=solve(md,'Stressbalance')
    1819
    1920#Fields and tolerances to track changes
    20 field_names     =['Vx','Vy','Vz','Vel','Pressure',\
    21         'StressTensorxx','StressTensoryy','StressTensorzz','StressTensorxy','StressTensorxz','StressTensoryz']
    22 field_tolerances=[1e-09,1e-09,1e-09,1e-09,1e-09,\
    23         1e-09,1e-09,1e-09,1e-09,1e-09,1e-08]
    24 field_values=[\
    25         md.results.StressbalanceSolution.Vx,\
    26         md.results.StressbalanceSolution.Vy,\
    27         md.results.StressbalanceSolution.Vz,\
    28         md.results.StressbalanceSolution.Vel,\
    29         md.results.StressbalanceSolution.Pressure,\
    30         md.results.StressbalanceSolution.StressTensorxx,\
    31         md.results.StressbalanceSolution.StressTensoryy,\
    32         md.results.StressbalanceSolution.StressTensorzz,\
    33         md.results.StressbalanceSolution.StressTensorxy,\
    34         md.results.StressbalanceSolution.StressTensorxz,\
    35         md.results.StressbalanceSolution.StressTensoryz,\
    36         ]
     21field_names     =['Vx','Vy','Vz',
     22                                                                        'Vel','Pressure',
     23                                                                        'StressTensorxx','StressTensoryy','StressTensorzz',
     24                                                                        'StressTensorxy','StressTensorxz','StressTensoryz']
     25field_tolerances=[1e-09,1e-09,1e-09,
     26                                                                        1e-09,1e-09,
     27                                                                        1e-09,1e-09,1e-09,
     28                                                                        1e-09,1e-09,1e-08]
     29field_values=[md.results.StressbalanceSolution.Vx,
     30                                                        md.results.StressbalanceSolution.Vy,
     31                                                        md.results.StressbalanceSolution.Vz,
     32                                                        md.results.StressbalanceSolution.Vel,
     33                                                        md.results.StressbalanceSolution.Pressure,
     34                                                        md.results.StressbalanceSolution.StressTensorxx,
     35                                                        md.results.StressbalanceSolution.StressTensoryy,
     36                                                        md.results.StressbalanceSolution.StressTensorzz,
     37                                                        md.results.StressbalanceSolution.StressTensorxy,
     38                                                        md.results.StressbalanceSolution.StressTensorxz,
     39                                                        md.results.StressbalanceSolution.StressTensoryz,]
  • issm/trunk-jpl/test/NightlyRun/test104.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedStressFS
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000)
    … …  
    1314md.extrude(3,2.)
    1415md=setflowequation(md,'FS','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'Stressbalance')
    1718
    … …  
    1920field_names     =['Vx','Vy','Vz','Vel','Pressure']
    2021field_tolerances=[1e-08,1e-08,1e-06,1e-08,1e-08]
    21 field_values=[\
    22         md.results.StressbalanceSolution.Vx,\
    23         md.results.StressbalanceSolution.Vy,\
    24         md.results.StressbalanceSolution.Vz,\
    25         md.results.StressbalanceSolution.Vel,\
    26         md.results.StressbalanceSolution.Pressure,\
    27         ]
     22field_values=[md.results.StressbalanceSolution.Vx,
     23                                                        md.results.StressbalanceSolution.Vy,
     24                                                        md.results.StressbalanceSolution.Vz,
     25                                                        md.results.StressbalanceSolution.Vel,
     26                                                        md.results.StressbalanceSolution.Pressure]
  • issm/trunk-jpl/test/NightlyRun/test105.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedMasstransp2d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000)
    … …  
    1213md=parameterize(md,'../Par/SquareShelfConstrained.py')
    1314md=setflowequation(md,'SSA','all')
    14 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1516md=solve(md,'Masstransport')
    1617
  • issm/trunk-jpl/test/NightlyRun/test106.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedMasstransp2dDG
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from meshconvert import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',150000)
    … …  
    1415md=parameterize(md,'../Par/SquareShelfConstrained.py')
    1516md=setflowequation(md,'SSA','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md.masstransport.stabilization=3
    1819md.masstransport.spcthickness=md.geometry.thickness
  • issm/trunk-jpl/test/NightlyRun/test107.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedMasstransp3d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000)
    … …  
    1314md=setflowequation(md,'SSA','all')
    1415md.extrude(5,3.)
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'Masstransport')
    1718
  • issm/trunk-jpl/test/NightlyRun/test108.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedTherStea
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000)
    … …  
    1415md=setflowequation(md,'SSA','all')
    1516md.timestepping.time_step=0
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md=solve(md,'Thermal')
    1819
  • issm/trunk-jpl/test/NightlyRun/test109.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedTherTran
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000)
    … …  
    1314md.extrude(3,1.)
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md.transient.isstressbalance=False
    1718md.transient.ismasstransport=False
    … …  
    2425field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
    2526field_tolerances=[1e-13,1e-13]
    26 field_values=[\
    27         md.results.TransientSolution[0].Temperature,\
    28         md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
    29         ]
     27field_values=[md.results.TransientSolution[0].Temperature,
     28                                                        md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate]
  • issm/trunk-jpl/test/NightlyRun/test110.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedTranSSA2d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000)
    … …  
    1213md=parameterize(md,'../Par/SquareShelfConstrained.py')
    1314md=setflowequation(md,'SSA','all')
    14 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1516md.transient.requested_outputs=['IceVolume']
    1617
  • issm/trunk-jpl/test/NightlyRun/test1101.py

    r21060 r21408  
    11#Test Name: ISMIPAHO
    2 import numpy
     2import numpy as np
    33import shutil
    44from model import *
     5from socket import gethostname
    56from squaremesh import *
    67from setmask import *
    … …  
    89from setflowequation import *
    910from solve import *
    10 from MatlabFuncs import *
    11 from PythonFuncs import *
    1211
    1312"""
    … …  
    1817printingflag=False
    1918
    20 L_list=[5000.,10000.,20000.,40000.,80000.,160000.]
     19#L_list=[80000.]
     20L_list=[80000.]
    2121results=[]
    2222minvx=[]
    … …  
    3535
    3636        #Create dirichlet on the bed only
    37         md.stressbalance.spcvx=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
    38         md.stressbalance.spcvy=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
    39         md.stressbalance.spcvz=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
     37        md.stressbalance.spcvx=float('NaN')*np.ones((md.mesh.numberofvertices))
     38        md.stressbalance.spcvy=float('NaN')*np.ones((md.mesh.numberofvertices))
     39        md.stressbalance.spcvz=float('NaN')*np.ones((md.mesh.numberofvertices))
    4040
    41         pos=numpy.nonzero(md.mesh.vertexonbase)
     41        pos=np.where(md.mesh.vertexonbase)
    4242        md.stressbalance.spcvx[pos]=0.
    4343        md.stressbalance.spcvy[pos]=0.
    4444
    4545        #Create MPCs to have periodic boundary conditions
    46         posx=numpy.nonzero(md.mesh.x==0.)[0]
    47         posx2=numpy.nonzero(md.mesh.x==numpy.max(md.mesh.x))[0]
     46        posx=np.where(md.mesh.x==0.)[0]
     47        posx2=np.where(md.mesh.x==np.max(md.mesh.x))[0]
    4848
    49         posy=numpy.nonzero(logical_and_n(md.mesh.y==0.,md.mesh.x!=0.,md.mesh.x!=numpy.max(md.mesh.x)))[0]    #Don't take the same nodes two times
    50         posy2=numpy.nonzero(logical_and_n(md.mesh.y==numpy.max(md.mesh.y),md.mesh.x!=0.,md.mesh.x!=numpy.max(md.mesh.x)))[0]
     49        posy=np.where(np.logical_and.reduce((md.mesh.y==0.,md.mesh.x!=0.,md.mesh.x!=np.max(md.mesh.x))))[0] #Don't take the same nodes two times
     50        posy2=np.where(np.logical_and.reduce((md.mesh.y==np.max(md.mesh.y),md.mesh.x!=0.,md.mesh.x!=np.max(md.mesh.x))))[0]
    5151
    52         md.stressbalance.vertex_pairing=numpy.vstack((numpy.hstack((posx.reshape(-1,1)+1,posx2.reshape(-1,1)+1)),numpy.hstack((posy.reshape(-1,1)+1,posy2.reshape(-1,1)+1))))
     52        md.stressbalance.vertex_pairing=np.vstack((np.vstack((posx+1,posx2+1)).T,np.vstack((posy+1,posy2+1)).T))
    5353
    5454        #Compute the stressbalance
    55         md.cluster=generic('name',oshostname(),'np',8)
     55        md.cluster=generic('name',gethostname(),'np',8)
    5656        md=solve(md,'Stressbalance')
    5757
    … …  
    6161        vz=md.results.StressbalanceSolution.Vz
    6262        results.append(md.results.StressbalanceSolution)
    63         minvx.append(numpy.min(vx[-md.mesh.numberofvertices2d:]))
    64         maxvx.append(numpy.max(vx[-md.mesh.numberofvertices2d:]))
     63        minvx.append(np.min(vx[-md.mesh.numberofvertices2d:]))
     64        maxvx.append(np.max(vx[-md.mesh.numberofvertices2d:]))
    6565
    6666        #Now plot vx, vy, vz and vx on a cross section
    … …  
    6969                pass
    7070#               set(gcf,'Color','w')
    71 #               printmodel(['ismipaHOvx' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     71#               printmodel(['ismipaHOvx' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    7272#               shutil.move("ismipaHOvx%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
    7373#       plotmodel(md,'data',vy,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km')
    … …  
    7575                pass
    7676#               set(gcf,'Color','w')
    77 #               printmodel(['ismipaHOvy' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     77#               printmodel(['ismipaHOvy' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    7878#               shutil.move("ismipaHOvy%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
    7979#       plotmodel(md,'data',vz,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km')
    … …  
    8181                pass
    8282#               set(gcf,'Color','w')
    83 #               printmodel(['ismipaHOvz' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     83#               printmodel(['ismipaHOvz' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    8484#               shutil.move("ismipaHOvz%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
    8585
    … …  
    111111                pass
    112112#               set(gcf,'Color','w')
    113 #               printmodel(['ismipaHOvxsec' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     113#               printmodel(['ismipaHOvxsec' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    114114#               shutil.move("ismipaHOvxsec%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
    115115
    116116#Now plot the min and max values of vx for each size of the square
    117 #plot([5 10 20 40 80 160],minvx);ylim([0 18]);xlim([0 160])
     117#plot([5 10 20 40 80 160],minvx)ylim([0 18])xlim([0 160])
    118118if printingflag:
    119119        pass
    120120#       set(gcf,'Color','w')
    121 #       printmodel('ismipaHOminvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     121#       printmodel('ismipaHOminvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    122122#       shutil.move('ismipaHOminvx.png',ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
    123 #plot([5 10 20 40 80 160],maxvx);ylim([0 120]);xlim([0 160])
     123#plot([5 10 20 40 80 160],maxvx)ylim([0 120])xlim([0 160])
    124124if printingflag:
    125125        pass
    126126#       set(gcf,'Color','w')
    127 #       printmodel('ismipaHOmaxvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     127#       printmodel('ismipaHOmaxvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    128128#       shutil.move('ismipaHOmaxvx.png',ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
    129129
    130130#Fields and tolerances to track changes
    131 field_names     =[\
    132         'Vx5km','Vy5km','Vz5km',\
    133         'Vx10km','Vy10km','Vz10km',\
    134         'Vx20km','Vy20km','Vz20km',\
    135         'Vx40km','Vy40km','Vz40km',\
    136         'Vx80km','Vy80km','Vz80km',\
    137         'Vx160km','Vy160km','Vz160km'
    138 ]
    139 field_tolerances=[\
    140         1e-09,1e-09,1e-09,\
    141         1e-10,1e-10,1e-09,\
    142         1e-09,1e-09,1e-09,\
    143         1e-09,1e-08,1e-09,\
    144         1e-08,1e-08,1e-08,\
    145         1e-08,1e-07,1e-08,\
    146 ]
     131field_names     =['Vx80km','Vy80km','Vz80km']
     132field_tolerances=[1e-08,1e-08,1e-08]
    147133field_values=[]
    148134for result in results:
    149         field_values=field_values+[\
    150                 result.Vx,\
    151                 result.Vy,\
    152                 result.Vz,\
    153                 ]
     135        field_values=field_values+[result.Vx,result.Vy,result.Vz]
  • issm/trunk-jpl/test/NightlyRun/test1102.py

    r21060 r21408  
    11#Test Name: ISMIPAFS
    2 import numpy
     2import numpy as np
    33import shutil
    44from model import *
     5from socket import gethostname
    56from squaremesh import *
    67from setmask import *
    … …  
    89from setflowequation import *
    910from solve import *
    10 from MatlabFuncs import *
    11 from PythonFuncs import *
    1211
    1312"""
    … …  
    1817printingflag=False
    1918
    20 L_list=[5000.,10000.,20000.,40000.,80000.,160000.]
     19L_list=[80000.]
    2120results=[]
    2221minvx=[]
    … …  
    3130
    3231#       #Find elements at the corner and extract model
    33 #       posnodes=numpy.nonzero(numpy.logical_and(numpy.logical_or(md.mesh.x==0.,md.mesh.x==numpy.max(md.mesh.x)),numpy.logical_or(md.mesh.y==0.,md.mesh.y==numpy.max(md.mesh.y))))
    34 #       a=numpy.nonzero(ismember(md.mesh.elements,posnodes))[0]
    35 #       elements=numpy.ones((md.mesh.numberofelements),int)
     32#       posnodes=np.nonzero(np.logical_and.reduce(np.logical_or.reduce(md.mesh.x==0.,md.mesh.x==np.max(md.mesh.x)),np.logical_or.reduce(md.mesh.y==0.,md.mesh.y==np.max(md.mesh.y))))
     33#       a=np.nonzero(ismember(md.mesh.elements,posnodes))[0]
     34#       elements=np.ones((md.mesh.numberofelements),int)
    3635#       elements[a]=0
    3736#       md.modelextract(elements)
    … …  
    4241
    4342        #Create dirichlet on the bed only
    44         pos=numpy.nonzero(md.mesh.vertexonbase)
     43        pos=np.nonzero(md.mesh.vertexonbase)
    4544        md.stressbalance.spcvx[pos]=0.
    4645        md.stressbalance.spcvy[pos]=0.
    4746        md.stressbalance.spcvz[pos]=0.
    48 
    49 #       #Create MPCs to have periodic boundary conditions
    50 #       posx=numpy.nonzero(md.mesh.x==0.)[0]
    51 #       posx2=numpy.nonzero(md.mesh.x==numpy.max(md.mesh.x))[0]
    52 #       posx=numpy.nonzero(logical_and_n(md.mesh.x==0.,md.mesh.y!=0.,md.mesh.y!=numpy.max(md.mesh.y),numpy.logical_not(md.mesh.vertexonbase)))[0]
    53 #       posx2=numpy.nonzero(logical_and_n(md.mesh.x==numpy.max(md.mesh.x),md.mesh.y!=0.,md.mesh.y!=numpy.max(md.mesh.y),numpy.logical_not(md.mesh.vertexonbase)))[0]
    54 
    55 #       posy=numpy.nonzero(logical_and_n(md.mesh.y==0.,md.mesh.x!=0.,md.mesh.x!=numpy.max(md.mesh.x),numpy.logical_not(md.mesh.vertexonbase)))[0]    #Don't take the same nodes two times
    56 #       posy2=numpy.nonzero(logical_and_n(md.mesh.y==numpy.max(md.mesh.y),md.mesh.x!=0.,md.mesh.x!=numpy.max(md.mesh.x),numpy.logical_not(md.mesh.vertexonbase)))[0]
    57 
    58 #       md.stressbalance.vertex_pairing=numpy.vstack((numpy.hstack((posx.reshape(-1,1)+1,posx2.reshape(-1,1)+1)),numpy.hstack((posy.reshape(-1,1)+1,posy2.reshape(-1,1)+1))))
    5947
    6048        #Compute the stressbalance
    … …  
    6250        md.stressbalance.reltol=float('NaN')
    6351        md.stressbalance.restol=1.
    64         md.cluster=generic('name',oshostname(),'np',8)
     52        md.cluster=generic('name',gethostname(),'np',8)
    6553        md=solve(md,'Stressbalance')
    6654
    … …  
    7159        pressure=md.results.StressbalanceSolution.Pressure
    7260        results.append(md.results.StressbalanceSolution)
    73         minvx.append(numpy.min(vx[-md.mesh.numberofvertices2d:]))
    74         maxvx.append(numpy.max(vx[-md.mesh.numberofvertices2d:]))
     61        minvx.append(np.min(vx[-md.mesh.numberofvertices2d:]))
     62        maxvx.append(np.max(vx[-md.mesh.numberofvertices2d:]))
    7563
    7664        #Now plot vx, vy, vz and vx on a cross section
    … …  
    7967                pass
    8068#               set(gcf,'Color','w')
    81 #               printmodel(['ismipaFSvx' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     69#               printmodel(['ismipaFSvx' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    8270#               shutil.move("ismipaFSvx%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
    8371#       plotmodel(md,'data',vy,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km','figure',3)
    … …  
    8573                pass
    8674#               set(gcf,'Color','w')
    87 #               printmodel(['ismipaFSvy' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     75#               printmodel(['ismipaFSvy' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    8876#               shutil.move("ismipaFSvy%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
    8977#       plotmodel(md,'data',vz,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km','figure',4)
    … …  
    9179                pass
    9280#               set(gcf,'Color','w')
    93 #               printmodel(['ismipaFSvz' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     81#               printmodel(['ismipaFSvz' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    9482#               shutil.move("ismipaFSvz%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
    9583
    … …  
    121109                pass
    122110#               set(gcf,'Color','w')
    123 #               printmodel(['ismipaFSvxsec' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     111#               printmodel(['ismipaFSvxsec' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    124112#               shutil.move("ismipaFSvxsec.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
    125113
    126114#Now plot the min and max values of vx for each size of the square
    127 #plot([5 10 20 40 80 160],minvx);ylim([0 18])
     115#plot([5 10 20 40 80 160],minvx)ylim([0 18])
    128116if printingflag:
    129117        pass
    130118#       set(gcf,'Color','w')
    131 #       printmodel('ismipaFSminvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     119#       printmodel('ismipaFSminvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    132120#       shutil.move('ismipaFSminvx.png',ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
    133 #plot([5 10 20 40 80 160],maxvx);ylim([0 120])
     121#plot([5 10 20 40 80 160],maxvx)ylim([0 120])
    134122if printingflag:
    135123        pass
    136124#       set(gcf,'Color','w')
    137 #       printmodel('ismipaFSmaxvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     125#       printmodel('ismipaFSmaxvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    138126#       shutil.move('ismipaFSmaxvx.png',ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
    139127
    140128#Fields and tolerances to track changes
    141 field_names     =[\
    142         'Vx5km','Vy5km','Vz5km',\
    143         'Vx10km','Vy10km','Vz10km',\
    144         'Vx20km','Vy20km','Vz20km',\
    145         'Vx40km','Vy40km','Vz40km',\
    146         'Vx80km','Vy80km','Vz80km',\
    147         'Vx160km','Vy160km','Vz160km'
    148 ]
    149 field_tolerances=[\
    150         1e-12,1e-12,1e-12,\
    151         1e-12,1e-12,1e-12,\
    152         1e-12,1e-11,1e-12,\
    153         1e-12,1e-11,1e-12,\
    154         1e-12,1e-11,1e-12,\
    155         1e-12,1e-11,1e-12,\
    156 ]
     129field_names     =['Vx80km','Vy80km','Vz80km']
     130field_tolerances=[1e-12,1e-11,1e-12,]
    157131field_values=[]
    158132for result in results:
  • issm/trunk-jpl/test/NightlyRun/test1103.py

    r21060 r21408  
    11#Test Name: ISMIPBHO
    2 import numpy
     2import numpy as np
    33import shutil
    44from model import *
     5from socket import gethostname
    56from squaremesh import *
    67from setmask import *
    … …  
    89from setflowequation import *
    910from solve import *
    10 from MatlabFuncs import *
    11 from PythonFuncs import *
    1211
    1312"""
    … …  
    1817printingflag=False
    1918
    20 L_list=[5000.,10000.,20000.,40000.,80000.,160000.]
     19L_list=[80000.]
    2120results=[]
    2221minvx=[]
    … …  
    3534
    3635        #Create dirichlet on the bed only
    37         md.stressbalance.spcvx=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
    38         md.stressbalance.spcvy=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
    39         md.stressbalance.spcvz=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
    40         pos=numpy.nonzero(md.mesh.vertexonbase)
     36        md.stressbalance.spcvx=float('NaN')*np.ones((md.mesh.numberofvertices))
     37        md.stressbalance.spcvy=float('NaN')*np.ones((md.mesh.numberofvertices))
     38        md.stressbalance.spcvz=float('NaN')*np.ones((md.mesh.numberofvertices))
     39        pos=np.nonzero(md.mesh.vertexonbase)
    4140        md.stressbalance.spcvx[pos]=0.
    4241        md.stressbalance.spcvy[pos]=0.
    4342
    4443        #Create MPCs to have periodic boundary conditions
    45         posx=numpy.nonzero(md.mesh.x==0.)[0]
    46         posx2=numpy.nonzero(md.mesh.x==numpy.max(md.mesh.x))[0]
     44        posx=np.where(md.mesh.x==0.)[0]
     45        posx2=np.where(md.mesh.x==np.max(md.mesh.x))[0]
    4746
    48         posy=numpy.nonzero(logical_and_n(md.mesh.y==0.,md.mesh.x!=0.,md.mesh.x!=numpy.max(md.mesh.x)))[0]    #Don't take the same nodes two times
    49         posy2=numpy.nonzero(logical_and_n(md.mesh.y==numpy.max(md.mesh.y),md.mesh.x!=0.,md.mesh.x!=numpy.max(md.mesh.x)))[0]
     47        posy=np.where(np.logical_and.reduce((md.mesh.y==0.,md.mesh.x!=0.,md.mesh.x!=np.max(md.mesh.x))))[0]    #Don't take the same nodes two times
     48        posy2=np.where(np.logical_and.reduce((md.mesh.y==np.max(md.mesh.y),md.mesh.x!=0.,md.mesh.x!=np.max(md.mesh.x))))[0]
    5049
    51         md.stressbalance.vertex_pairing=numpy.vstack((numpy.hstack((posx.reshape(-1,1)+1,posx2.reshape(-1,1)+1)),numpy.hstack((posy.reshape(-1,1)+1,posy2.reshape(-1,1)+1))))
     50        md.stressbalance.vertex_pairing=np.vstack((np.vstack((posx+1,posx2+1)).T,np.vstack((posy+1,posy2+1)).T))
    5251
    5352        #Compute the stressbalance
    54         md.cluster=generic('name',oshostname(),'np',8)
     53        md.cluster=generic('name',gethostname(),'np',8)
    5554        md=solve(md,'Stressbalance')
    5655
    … …  
    6059        vz=md.results.StressbalanceSolution.Vz
    6160        results.append(md.results.StressbalanceSolution)
    62         minvx.append(numpy.min(vx[md.mesh.numberofvertices2d:]))
    63         maxvx.append(numpy.max(vx[md.mesh.numberofvertices2d:]))
     61        minvx.append(np.min(vx[md.mesh.numberofvertices2d:]))
     62        maxvx.append(np.max(vx[md.mesh.numberofvertices2d:]))
    6463
    6564        #Now plot vx, vy, vz and vx on a cross section
    … …  
    6867                pass
    6968#               set(gcf,'Color','w')
    70 #               printmodel(['ismipbHOvx' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     69#               printmodel(['ismipbHOvx' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    7170#               shutil.move("ismipbHOvx%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestB')
    7271#       plotmodel(md,'data',vz,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km')
    … …  
    7473                pass
    7574#               set(gcf,'Color','w')
    76 #               printmodel(['ismipbHOvz' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     75#               printmodel(['ismipbHOvz' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    7776#               shutil.move("ismipbHOvz%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestB')
    7877
    … …  
    104103                pass
    105104#               set(gcf,'Color','w')
    106 #               printmodel(['ismipbHOvxsec' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     105#               printmodel(['ismipbHOvxsec' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    107106#               shutil.move("ismipbHOvxsec%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestB')
    108107
    109108#Now plot the min and max values of vx for each size of the square
    110 #plot([5 10 20 40 80 160],minvx);ylim([0 14]);xlim([0 160])
     109#plot([5 10 20 40 80 160],minvx)ylim([0 14])xlim([0 160])
    111110if printingflag:
    112111        pass
    113112#       set(gcf,'Color','w')
    114 #       printmodel('ismipbHOminvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     113#       printmodel('ismipbHOminvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    115114#       shutil.move('ismipbHOminvx.png',ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestB')
    116 #plot([5 10 20 40 80 160],maxvx);ylim([0 120]);xlim([0 160])
     115#plot([5 10 20 40 80 160],maxvx)ylim([0 120])xlim([0 160])
    117116if printingflag:
    118117        pass
    119118#       set(gcf,'Color','w')
    120 #       printmodel('ismipbHOmaxvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     119#       printmodel('ismipbHOmaxvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    121120#       shutil.move('ismipbHOmaxvx.png',ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestB')
    122121
    123122#Fields and tolerances to track changes
    124 field_names     =[\
    125         'Vx5km','Vy5km','Vz5km',\
    126         'Vx10km','Vy10km','Vz10km',\
    127         'Vx20km','Vy20km','Vz20km',\
    128         'Vx40km','Vy40km','Vz40km',\
    129         'Vx80km','Vy80km','Vz80km',\
    130         'Vx160km','Vy160km','Vz160km'
    131 ]
    132 field_tolerances=[\
    133         1e-09,1e-09,1e-09,\
    134         1e-09,1e-09,1e-09,\
    135         1e-09,1e-09,1e-09,\
    136         1e-08,1e-08,1e-08,\
    137         1e-08,1e-07,1e-07,\
    138         1e-07,1e-06,1e-07,\
    139 ]
     123field_names     =['Vx80km','Vy80km','Vz80km']
     124field_tolerances=[1e-08,1e-07,1e-07]
    140125field_values=[]
    141126for result in results:
    142         field_values=field_values+[\
    143                 result.Vx,\
    144                 result.Vy,\
    145                 result.Vz,\
    146                 ]
     127        field_values=field_values+[result.Vx,result.Vy,result.Vz]
  • issm/trunk-jpl/test/NightlyRun/test1104.py

    r21060 r21408  
    11#Test Name: ISMIPBFS
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from squaremesh import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
    10 from PythonFuncs import *
    1110
    1211"""
    … …  
    1514"""
    1615
    17 L_list=[5000.,10000.,20000.,40000.,80000.,160000.]
     16L_list=[80000.]
    1817results=[]
    1918
    … …  
    2928
    3029        #Create dirichlet on the bed only
    31         md.stressbalance.spcvx=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
    32         md.stressbalance.spcvy=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
    33         md.stressbalance.spcvz=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
     30        md.stressbalance.spcvx=float('NaN')*np.ones((md.mesh.numberofvertices))
     31        md.stressbalance.spcvy=float('NaN')*np.ones((md.mesh.numberofvertices))
     32        md.stressbalance.spcvz=float('NaN')*np.ones((md.mesh.numberofvertices))
    3433
    35         pos=numpy.nonzero(md.mesh.vertexonbase)
     34        pos=np.where(md.mesh.vertexonbase)
    3635        md.stressbalance.spcvx[pos]=0.
    3736        md.stressbalance.spcvy[pos]=0.
    3837
    3938        #Create MPCs to have periodic boundary conditions
    40         posx=numpy.nonzero(md.mesh.x==0.)[0]
    41         posx2=numpy.nonzero(md.mesh.x==numpy.max(md.mesh.x))[0]
     39        posx=np.where(md.mesh.x==0.)[0]
     40        posx2=np.where(md.mesh.x==np.max(md.mesh.x))[0]
    4241
    43         posy=numpy.nonzero(logical_and_n(md.mesh.y==0.,md.mesh.x!=0.,md.mesh.x!=numpy.max(md.mesh.x)))[0]    #Don't take the same nodes two times
    44         posy2=numpy.nonzero(logical_and_n(md.mesh.y==numpy.max(md.mesh.y),md.mesh.x!=0.,md.mesh.x!=numpy.max(md.mesh.x)))[0]
     42        posy=np.where(np.logical_and.reduce((md.mesh.y==0.,md.mesh.x!=0.,md.mesh.x!=np.max(md.mesh.x))))[0]    #Don't take the same nodes two times
     43        posy2=np.where(np.logical_and.reduce((md.mesh.y==np.max(md.mesh.y),md.mesh.x!=0.,md.mesh.x!=np.max(md.mesh.x))))[0]
    4544
    46         md.stressbalance.vertex_pairing=numpy.vstack((numpy.hstack((posx.reshape(-1,1)+1,posx2.reshape(-1,1)+1)),numpy.hstack((posy.reshape(-1,1)+1,posy2.reshape(-1,1)+1))))
    47 
     45        md.stressbalance.vertex_pairing=np.vstack((np.vstack((posx+1,posx2+1)).T,np.vstack((posy+1,posy2+1)).T))
     46        print np.shape(md.stressbalance.vertex_pairing)
    4847        #Compute the stressbalance
    4948        md.stressbalance.abstol=float('NaN')
    50         md.cluster=generic('name',oshostname(),'np',8)
     49        md.cluster=generic('name',gethostname(),'np',8)
    5150        md=solve(md,'Stressbalance')
    52         pos=numpy.nonzero(logical_or_n(md.mesh.x==0.,md.mesh.y==0.,md.mesh.x==numpy.max(md.mesh.x),md.mesh.y==numpy.max(md.mesh.y)))
     51        pos=np.where(np.logical_or.reduce((md.mesh.x==0.,md.mesh.y==0.,md.mesh.x==np.max(md.mesh.x),md.mesh.y==np.max(md.mesh.y))))
    5352        md.stressbalance.spcvx[pos]=md.results.StressbalanceSolution.Vx[pos]
    5453        md.stressbalance.spcvy[pos]=md.results.StressbalanceSolution.Vy[pos]
    55         md.stressbalance.vertex_pairing=numpy.empty((0,2),int)
     54        md.stressbalance.vertex_pairing=np.empty((0,2),int)
    5655        md=setflowequation(md,'FS','all')
    5756        md=solve(md,'Stressbalance')
    … …  
    6665
    6766#Fields and tolerances to track changes
    68 field_names     =[\
    69         'Vx5km','Vy5km','Vz5km',\
    70         'Vx10km','Vy10km','Vz10km',\
    71         'Vx20km','Vy20km','Vz20km',\
    72         'Vx40km','Vy40km','Vz40km',\
    73         'Vx80km','Vy80km','Vz80km',\
    74         'Vx160km','Vy160km','Vz160km'
    75 ]
    76 field_tolerances=[\
    77         1e-08,1e-08,1e-08,\
    78         1e-08,1e-08,1e-08,\
    79         1e-08,1e-08,1e-08,\
    80         1e-08,1e-08,1e-08,\
    81         1e-08,1e-07,1e-08,\
    82         1e-07,1e-07,1e-07,\
    83 ]
     67field_names     =['Vx80km','Vy80km','Vz80km']
     68field_tolerances=[1e-08,1e-07,1e-08]
    8469field_values=[]
    8570for result in results:
    86         field_values=field_values+[\
    87                 result.Vx,\
    88                 result.Vy,\
    89                 result.Vz,\
    90                 ]
     71        field_values=field_values+[result.Vx,result.Vy,result.Vz]
  • issm/trunk-jpl/test/NightlyRun/test1105.py

    r21060 r21408  
    11#Test Name: ISMIPCHO
    2 import numpy
     2import numpy as np
    33import shutil
    44from model import *
     5from socket import gethostname
    56from squaremesh import *
    67from setmask import *
    … …  
    89from setflowequation import *
    910from solve import *
    10 from MatlabFuncs import *
    11 from PythonFuncs import *
    1211
    1312"""
    … …  
    1817printingflag=False
    1918
    20 L_list=[5000.,10000.,20000.,40000.,80000.,160000.]
     19L_list=[80000.]
    2120results=[]
    2221minvx=[]
    … …  
    3534
    3635        #Create MPCs to have periodic boundary conditions
    37         md.stressbalance.spcvx=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
    38         md.stressbalance.spcvy=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
    39         md.stressbalance.spcvz=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
     36        md.stressbalance.spcvx=float('NaN')*np.ones((md.mesh.numberofvertices))
     37        md.stressbalance.spcvy=float('NaN')*np.ones((md.mesh.numberofvertices))
     38        md.stressbalance.spcvz=float('NaN')*np.ones((md.mesh.numberofvertices))
    4039
    41         posx=numpy.nonzero(logical_and_n(md.mesh.x==0.,md.mesh.y!=0.,md.mesh.y!=L))[0]
    42         posx2=numpy.nonzero(logical_and_n(md.mesh.x==L,md.mesh.y!=0.,md.mesh.y!=L))[0]
     40        posx=np.where(np.logical_and.reduce((md.mesh.x==0.,md.mesh.y!=0.,md.mesh.y!=L)))[0]
     41        posx2=np.where(np.logical_and.reduce((md.mesh.x==L,md.mesh.y!=0.,md.mesh.y!=L)))[0]
    4342
    44         posy=numpy.nonzero(logical_and_n(md.mesh.y==0.,md.mesh.x!=0.,md.mesh.x!=L))[0]    #Don't take the same nodes two times
    45         posy2=numpy.nonzero(logical_and_n(md.mesh.y==L,md.mesh.x!=0.,md.mesh.x!=L))[0]
     43        posy=np.where(np.logical_and.reduce((md.mesh.y==0.,md.mesh.x!=0.,md.mesh.x!=L)))[0]    #Don't take the same nodes two times
     44        posy2=np.where(np.logical_and.reduce((md.mesh.y==L,md.mesh.x!=0.,md.mesh.x!=L)))[0]
    4645
    47         md.stressbalance.vertex_pairing=numpy.vstack((numpy.hstack((posx.reshape(-1,1)+1,posx2.reshape(-1,1)+1)),numpy.hstack((posy.reshape(-1,1)+1,posy2.reshape(-1,1)+1))))
     46        md.stressbalance.vertex_pairing=np.vstack((np.vstack((posx+1,posx2+1)).T,np.vstack((posy+1,posy2+1)).T))
    4847
    4948        #Add spc on the corners
    50         pos=numpy.nonzero(logical_and_n(numpy.logical_or(md.mesh.x==0.,md.mesh.x==L),numpy.logical_or(md.mesh.y==0.,md.mesh.y==L),md.mesh.vertexonbase))
     49        pos=np.where(np.logical_and.reduce((np.logical_or(md.mesh.x==0.,md.mesh.x==L),np.logical_or(md.mesh.y==0.,md.mesh.y==L),md.mesh.vertexonbase)))
    5150        md.stressbalance.spcvx[pos]=0.
    5251        md.stressbalance.spcvy[pos]=0.
    … …  
    7170       
    7271        #Spc the bed at zero for vz
    73         pos=numpy.nonzero(md.mesh.vertexonbase)
     72        pos=np.where(md.mesh.vertexonbase)
    7473        md.stressbalance.spcvz[pos]=0.
    7574
    7675        #Compute the stressbalance
    77         md.cluster=generic('name',oshostname(),'np',8)
     76        md.cluster=generic('name',gethostname(),'np',8)
    7877        md=solve(md,'Stressbalance')
    7978
    … …  
    8382        vz=md.results.StressbalanceSolution.Vz
    8483        results.append(md.results.StressbalanceSolution)
    85         minvx.append(numpy.min(vx[-md.mesh.numberofvertices2d:]))
    86         maxvx.append(numpy.max(vx[-md.mesh.numberofvertices2d:]))
     84        minvx.append(np.min(vx[-md.mesh.numberofvertices2d:]))
     85        maxvx.append(np.max(vx[-md.mesh.numberofvertices2d:]))
    8786
    8887        #Now plot vx, vy, vz and vx on a cross section
    … …  
    9190                pass
    9291#               set(gcf,'Color','w')
    93 #               printmodel(['ismipcHOvx' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     92#               printmodel(['ismipcHOvx' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    9493#               shutil.move("ismipcHOvx%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestC')
    9594#       plotmodel(md,'data',vy,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km','figure',3)
    … …  
    9796                pass
    9897#               set(gcf,'Color','w')
    99 #               printmodel(['ismipcHOvy' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     98#               printmodel(['ismipcHOvy' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    10099#               shutil.move("ismipcHOvy%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestC')
    101100#       plotmodel(md,'data',vz,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km','figure',4)
    … …  
    103102                pass
    104103#               set(gcf,'Color','w')
    105 #               printmodel(['ismipcHOvz' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     104#               printmodel(['ismipcHOvz' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    106105#               shutil.move("ismipcHOvz%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestC')
    107106
    … …  
    133132                pass
    134133#               set(gcf,'Color','w')
    135 #               printmodel(['ismipcHOvxsec' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     134#               printmodel(['ismipcHOvxsec' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    136135#               shutil.move("ismipcHOvxsec%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestC')
    137136
    138137#Now plot the min and max values of vx for each size of the square
    139 #plot([5 10 20 40 80 160],minvx);ylim([4 18]);xlim([0 160])
     138#plot([5 10 20 40 80 160],minvx)ylim([4 18])xlim([0 160])
    140139if printingflag:
    141140        pass
    142141#       set(gcf,'Color','w')
    143 #       printmodel('ismipcHOminvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     142#       printmodel('ismipcHOminvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    144143#       shutil.move('ismipcHOminvx.png',ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestC')
    145 #plot([5 10 20 40 80 160],maxvx);ylim([0 200]); xlim([0 160])
     144#plot([5 10 20 40 80 160],maxvx)ylim([0 200]) xlim([0 160])
    146145if printingflag:
    147146        pass
    148147#       set(gcf,'Color','w')
    149 #       printmodel('ismipcHOmaxvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     148#       printmodel('ismipcHOmaxvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    150149#       shutil.move('ismipcHOmaxvx.png',ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestC')
    151150
    152151#Fields and tolerances to track changes
    153 field_names     =[\
    154         'Vx5km','Vy5km','Vz5km',\
    155         'Vx10km','Vy10km','Vz10km',\
    156         'Vx20km','Vy20km','Vz20km',\
    157         'Vx40km','Vy40km','Vz40km',\
    158         'Vx80km','Vy80km','Vz80km',\
    159         'Vx160km','Vy160km','Vz160km'
    160 ]
    161 field_tolerances=[\
    162         1e-08,1e-07,1e-07,\
    163         1e-09,1e-07,1e-07,\
    164         1e-09,1e-09,1e-07,\
    165         1e-09,1e-09,1e-08,\
    166         1e-09,1e-08,1e-08,\
    167         1e-09,1e-08,1e-08,\
    168 ]
     152field_names     =['Vx80km','Vy80km','Vz80km']
     153field_tolerances=[1e-09,1e-08,1e-08]
    169154field_values=[]
    170155for result in results:
    171         field_values=field_values+[\
    172                 result.Vx,\
    173                 result.Vy,\
    174                 result.Vz,\
    175                 ]
     156        field_values=field_values+[result.Vx,result.Vy,result.Vz]
  • issm/trunk-jpl/test/NightlyRun/test1106.py

    r21060 r21408  
    11#Test Name: ISMIPCFS
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
    10 from PythonFuncs import *
    1110
    1211"""
    … …  
    1514"""
    1615
    17 L_list=[5000.,10000.,20000.,40000.,80000.,160000.]
     16L_list=[80000.]
    1817results=[]
    1918
    … …  
    2221        md=setmask(md,'','')    #ice sheet test
    2322        md=parameterize(md,'../Par/ISMIPC.py')
    24         md.friction.coefficient=numpy.sqrt(md.constants.yts*(1000.+1000.*numpy.sin(md.mesh.x.reshape(-1,1)*2.*numpy.pi/L)*numpy.sin(md.mesh.y.reshape(-1,1)*2.*numpy.pi/L)))
     23        md.friction.coefficient=np.sqrt(md.constants.yts*(1000.+1000.*np.sin(md.mesh.x*2.*np.pi/L)*np.sin(md.mesh.y*2.*np.pi/L)))
    2524        md.extrude(10,1.)
    2625
    2726        #Add spc on the borders
    28         pos=numpy.nonzero(logical_or_n(md.mesh.x==0.,md.mesh.x==numpy.max(md.mesh.x),md.mesh.y==0.,md.mesh.y==numpy.max(md.mesh.y)))
     27        pos=np.where(np.logical_or.reduce((md.mesh.x==0.,md.mesh.x==np.max(md.mesh.x),md.mesh.y==0.,md.mesh.y==np.max(md.mesh.y))))
    2928        md.stressbalance.spcvx[pos]=0.
    3029        md.stressbalance.spcvy[pos]=0.
    … …  
    5150
    5251        #Compute the stressbalance
    53         md.cluster=generic('name',oshostname(),'np',8)
     52        md.cluster=generic('name',gethostname(),'np',8)
    5453        md=solve(md,'Stressbalance')
    5554
    … …  
    6362
    6463#Fields and tolerances to track changes
    65 field_names     =[\
    66         'Vx5km','Vy5km','Vz5km',\
    67         'Vx10km','Vy10km','Vz10km',\
    68         'Vx20km','Vy20km','Vz20km',\
    69         'Vx40km','Vy40km','Vz40km',\
    70         'Vx80km','Vy80km','Vz80km',\
    71         'Vx160km','Vy160km','Vz160km'
    72 ]
    73 field_tolerances=[\
    74         1e-12,1e-12,1e-11,\
    75         1e-12,1e-12,1e-12,\
    76         1e-12,1e-12,1e-12,\
    77         1e-12,1e-12,1e-12,\
    78         1e-12,1e-12,1e-12,\
    79         1e-12,1e-11,1e-12,\
    80 ]
     64field_names     =['Vx80km','Vy80km','Vz80km']
     65field_tolerances=[1e-12,1e-12,1e-12]
    8166field_values=[]
    8267for result in results:
    83         field_values=field_values+[\
    84                 result.Vx,\
    85                 result.Vy,\
    86                 result.Vz,\
    87                 ]
     68        field_values=field_values+[result.Vx,result.Vy,result.Vz]
  • issm/trunk-jpl/test/NightlyRun/test1107.py

    r21060 r21408  
    11#Test Name: ISMIPDHO
    2 import numpy
     2import numpy as np
    33import shutil
    44from model import *
     5from socket import gethostname
    56from squaremesh import *
    67from setmask import *
    … …  
    89from setflowequation import *
    910from solve import *
    10 from MatlabFuncs import *
    11 from PythonFuncs import *
    1211
    1312"""
    … …  
    1817printingflag=False
    1918
    20 L_list=[5000.,10000.,20000.,40000.,80000.,160000.]
     19L_list=[80000.]
    2120results=[]
    2221minvx=[]
    … …  
    3534
    3635        #We need one grd on dirichlet: the 4 corners are set to zero
    37         md.stressbalance.spcvx=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
    38         md.stressbalance.spcvy=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
    39         md.stressbalance.spcvz=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
     36        md.stressbalance.spcvx=float('NaN')*np.ones((md.mesh.numberofvertices))
     37        md.stressbalance.spcvy=float('NaN')*np.ones((md.mesh.numberofvertices))
     38        md.stressbalance.spcvz=float('NaN')*np.ones((md.mesh.numberofvertices))
    4039
    4140        #Create MPCs to have periodic boundary conditions
    42 #       posx=find(md.mesh.x==0. & ~(md.mesh.y==0. & md.mesh.vertexonbase) & ~(md.mesh.y==L & md.mesh.vertexonbase));
    43         posx=numpy.nonzero(logical_and_n(md.mesh.x==0.,numpy.logical_not(numpy.logical_and(md.mesh.y==0.,md.mesh.vertexonbase)),numpy.logical_not(numpy.logical_and(md.mesh.y==L,md.mesh.vertexonbase))))[0]
    44 #       posx2=find(md.mesh.x==max(md.mesh.x) & ~(md.mesh.y==0. & md.mesh.vertexonbase) & ~(md.mesh.y==L & md.mesh.vertexonbase));
    45         posx2=numpy.nonzero(logical_and_n(md.mesh.x==numpy.max(md.mesh.x),numpy.logical_not(numpy.logical_and(md.mesh.y==0.,md.mesh.vertexonbase)),numpy.logical_not(numpy.logical_and(md.mesh.y==L,md.mesh.vertexonbase))))[0]
     41#       posx=find(md.mesh.x==0. & ~(md.mesh.y==0. & md.mesh.vertexonbase) & ~(md.mesh.y==L & md.mesh.vertexonbase))
     42        posx=np.where(np.logical_and.reduce((md.mesh.x==0.,np.logical_not(np.logical_and(md.mesh.y==0.,md.mesh.vertexonbase)),np.logical_not(np.logical_and(md.mesh.y==L,md.mesh.vertexonbase)))))[0]
     43#       posx2=find(md.mesh.x==max(md.mesh.x) & ~(md.mesh.y==0. & md.mesh.vertexonbase) & ~(md.mesh.y==L & md.mesh.vertexonbase))
     44        posx2=np.where(np.logical_and.reduce((md.mesh.x==np.max(md.mesh.x),np.logical_not(np.logical_and(md.mesh.y==0.,md.mesh.vertexonbase)),np.logical_not(np.logical_and(md.mesh.y==L,md.mesh.vertexonbase)))))[0]
    4645
    47         posy=numpy.nonzero(logical_and_n(md.mesh.y==0.,md.mesh.x!=0.,md.mesh.x!=numpy.max(md.mesh.x)))[0]    #Don't take the same nodes two times
    48         posy2=numpy.nonzero(logical_and_n(md.mesh.y==numpy.max(md.mesh.y),md.mesh.x!=0.,md.mesh.x!=numpy.max(md.mesh.x)))[0]
     46        posy=np.where(np.logical_and.reduce((md.mesh.y==0.,md.mesh.x!=0.,md.mesh.x!=np.max(md.mesh.x))))[0]    #Don't take the same nodes two times
     47        posy2=np.where(np.logical_and.reduce((md.mesh.y==np.max(md.mesh.y),md.mesh.x!=0.,md.mesh.x!=np.max(md.mesh.x))))[0]
    4948
    50         md.stressbalance.vertex_pairing=numpy.vstack((numpy.hstack((posx.reshape(-1,1)+1,posx2.reshape(-1,1)+1)),numpy.hstack((posy.reshape(-1,1)+1,posy2.reshape(-1,1)+1))))
     49        md.stressbalance.vertex_pairing=np.vstack((np.vstack((posx+1,posx2+1)).T,np.vstack((posy+1,posy2+1)).T))
    5150
    5251        #Add spc on the corners
    53         pos=numpy.nonzero(logical_and_n(numpy.logical_or(md.mesh.x==0.,md.mesh.x==L),numpy.logical_or(md.mesh.y==0.,md.mesh.y==L),md.mesh.vertexonbase))
     52        pos=np.where(np.logical_and.reduce((np.logical_or(md.mesh.x==0.,md.mesh.x==L),np.logical_or(md.mesh.y==0.,md.mesh.y==L),md.mesh.vertexonbase)))
    5453        md.stressbalance.spcvy[:]=0.
    5554        md.stressbalance.spcvx[pos]=0.
    … …  
    6867       
    6968        #Spc the bed at zero for vz
    70         pos=numpy.nonzero(md.mesh.vertexonbase)
     69        pos=np.where(md.mesh.vertexonbase)
    7170        md.stressbalance.spcvz[pos]=0.
    7271
    7372        #Compute the stressbalance
    74         md.cluster=generic('name',oshostname(),'np',8)
     73        md.cluster=generic('name',gethostname(),'np',8)
    7574        md=solve(md,'Stressbalance')
    7675
    … …  
    8079        vz=md.results.StressbalanceSolution.Vz
    8180        results.append(md.results.StressbalanceSolution)
    82         minvx.append(numpy.min(vx[-md.mesh.numberofvertices2d:]))
    83         maxvx.append(numpy.max(vx[-md.mesh.numberofvertices2d:]))
     81        minvx.append(np.min(vx[-md.mesh.numberofvertices2d:]))
     82        maxvx.append(np.max(vx[-md.mesh.numberofvertices2d:]))
    8483
    8584        #Now plot vx, vy, vz and vx on a cross section
    … …  
    8887                pass
    8988#               set(gcf,'Color','w')
    90 #               printmodel(['ismipdHOvx' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     89#               printmodel(['ismipdHOvx' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    9190#               shutil.move("ismipdHOvx%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestD')
    9291#       plotmodel(md,'data',vz,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km','figure',3)
    … …  
    9493                pass
    9594#               set(gcf,'Color','w')
    96 #               printmodel(['ismipdHOvz' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     95#               printmodel(['ismipdHOvz' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    9796#               shutil.move("ismipdHOvz%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestD')
    9897
    … …  
    124123                pass
    125124#               set(gcf,'Color','w')
    126 #               printmodel(['ismipdHOvxsec' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     125#               printmodel(['ismipdHOvxsec' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    127126#               shutil.move("ismipdHOvxsec%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestD')
    128127
    129128#Now plot the min and max values of vx for each size of the square
    130 #plot([5 10 20 40 80 160],minvx);ylim([2 18]);xlim([0 160])
     129#plot([5 10 20 40 80 160],minvx)ylim([2 18])xlim([0 160])
    131130if printingflag:
    132131        pass
    133132#       set(gcf,'Color','w')
    134 #       printmodel('ismipdHOminvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     133#       printmodel('ismipdHOminvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    135134#       shutil.move('ismipdHOminvx.png',ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestD')
    136 #plot([5 10 20 40 80 160],maxvx);ylim([0 300]);xlim([0 160])
     135#plot([5 10 20 40 80 160],maxvx)ylim([0 300])xlim([0 160])
    137136if printingflag:
    138137        pass
    139138#       set(gcf,'Color','w')
    140 #       printmodel('ismipdHOmaxvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     139#       printmodel('ismipdHOmaxvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
    141140#       shutil.move('ismipdHOmaxvx.png',ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestD')
    142141
    143142#Fields and tolerances to track changes
    144 field_names     =[\
    145         'Vx5km','Vy5km','Vz5km',\
    146         'Vx10km','Vy10km','Vz10km',\
    147         'Vx20km','Vy20km','Vz20km',\
    148         'Vx40km','Vy40km','Vz40km',\
    149         'Vx80km','Vy80km','Vz80km',\
    150         'Vx160km','Vy160km','Vz160km'
    151 ]
    152 field_tolerances=[\
    153         1e-07,1e-08,1e-06,\
    154         1e-08,1e-08,1e-06,\
    155         1e-08,1e-08,1e-07,\
    156         1e-08,1e-08,1e-07,\
    157         1e-08,1e-08,1e-07,\
    158         1e-07,1e-08,1e-06,\
    159 ]
     143field_names     =['Vx80km','Vy80km','Vz80km']
     144field_tolerances=[1e-08,1e-08,1e-07]
    160145field_values=[]
    161146for result in results:
    162         field_values=field_values+[\
    163                 result.Vx,\
    164                 result.Vy,\
    165                 result.Vz,\
    166                 ]
     147        field_values=field_values+[result.Vx,result.Vy,result.Vz]
  • issm/trunk-jpl/test/NightlyRun/test1108.py

    r21060 r21408  
    11#Test Name: ISMIPDFS
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from bamg import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011from PythonFuncs import *
    1112
    … …  
    1516"""
    1617
    17 L_list=[5000.,10000.,20000.,40000.,80000.,160000.]
     18L_list=[80000.]
    1819results=[]
    1920
    … …  
    3031
    3132        #We need one grd on dirichlet: the 4 corners are set to zero
    32         md.stressbalance.spcvx=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
    33         md.stressbalance.spcvy=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
    34         md.stressbalance.spcvz=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
     33        md.stressbalance.spcvx=float('NaN')*np.ones((md.mesh.numberofvertices))
     34        md.stressbalance.spcvy=float('NaN')*np.ones((md.mesh.numberofvertices))
     35        md.stressbalance.spcvz=float('NaN')*np.ones((md.mesh.numberofvertices))
    3536       
    36         pos=numpy.nonzero(logical_and_n(md.mesh.vertexonbase,numpy.logical_or(md.mesh.x==0.,md.mesh.x==numpy.max(md.mesh.x)),numpy.logical_or(md.mesh.y==0.,md.mesh.y==numpy.max(md.mesh.y))))
     37        pos=np.nonzero(logical_and.reduce_n(md.mesh.vertexonbase,np.logical_or.reduce(md.mesh.x==0.,md.mesh.x==np.max(md.mesh.x)),np.logical_or.reduce(md.mesh.y==0.,md.mesh.y==np.max(md.mesh.y))))
    3738        md.stressbalance.spcvx[pos]=0.
    3839        md.stressbalance.spcvy[pos]=0.
    … …  
    4041
    4142        #Create MPCs to have periodic boundary conditions
    42         posx=numpy.nonzero(md.mesh.x==0.)[0]
    43         posx2=numpy.nonzero(md.mesh.x==numpy.max(md.mesh.x))[0]
     43        posx=np.nonzero(md.mesh.x==0.)[0]
     44        posx2=np.nonzero(md.mesh.x==np.max(md.mesh.x))[0]
    4445
    45         posy=numpy.nonzero(logical_and_n(md.mesh.y==0.,md.mesh.x!=0.,md.mesh.x!=numpy.max(md.mesh.x)))[0]    #Don't take the same nodes two times
    46         posy2=numpy.nonzero(logical_and_n(md.mesh.y==numpy.max(md.mesh.y),md.mesh.x!=0.,md.mesh.x!=numpy.max(md.mesh.x)))[0]
     46        posy=np.nonzero(logical_and.reduce_n(md.mesh.y==0.,md.mesh.x!=0.,md.mesh.x!=np.max(md.mesh.x)))[0]    #Don't take the same nodes two times
     47        posy2=np.nonzero(logical_and.reduce_n(md.mesh.y==np.max(md.mesh.y),md.mesh.x!=0.,md.mesh.x!=np.max(md.mesh.x)))[0]
    4748
    48         md.stressbalance.vertex_pairing=numpy.vstack((numpy.hstack((posx.reshape(-1,1)+1,posx2.reshape(-1,1)+1)),numpy.hstack((posy.reshape(-1,1)+1,posy2.reshape(-1,1)+1))))
     49        md.stressbalance.vertex_pairing=np.vstack((np.hstack((posx.reshape(-1,1)+1,posx2.reshape(-1,1)+1)),np.hstack((posy.reshape(-1,1)+1,posy2.reshape(-1,1)+1))))
    4950
    5051        #Compute the stressbalance
    51         md.cluster=generic('name',oshostname(),'np',8)
     52        md.cluster=generic('name',gethostname(),'np',8)
    5253        md.verbose=verbose('convergence',True)
    5354        md=solve(md,'Stressbalance')
    5455        md.stressbalance.reltol=float('NaN')
    5556        md.stressbalance.abstol=float('NaN')
    56         md.stressbalance.vertex_pairing=numpy.empty((0,2))
     57        md.stressbalance.vertex_pairing=np.empty((0,2))
    5758        #We need one grid on dirichlet: the 4 corners are set to zero
    58         md.stressbalance.spcvx=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
    59         md.stressbalance.spcvy=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
    60         md.stressbalance.spcvz=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
    61         pos=numpy.nonzero(logical_or_n(md.mesh.y==0.,md.mesh.x==0.,md.mesh.x==numpy.max(md.mesh.x),md.mesh.y==numpy.max(md.mesh.y)))    #Don't take the same nodes two times
     59        md.stressbalance.spcvx=float('NaN')*np.ones((md.mesh.numberofvertices))
     60        md.stressbalance.spcvy=float('NaN')*np.ones((md.mesh.numberofvertices))
     61        md.stressbalance.spcvz=float('NaN')*np.ones((md.mesh.numberofvertices))
     62        pos=np.nonzero(logical_or.reduce_n(md.mesh.y==0.,md.mesh.x==0.,md.mesh.x==np.max(md.mesh.x),md.mesh.y==np.max(md.mesh.y)))    #Don't take the same nodes two times
    6263        md.stressbalance.spcvx[pos]=md.results.StressbalanceSolution.Vx[pos]
    6364        md.stressbalance.spcvy[pos]=md.results.StressbalanceSolution.Vy[pos]
    … …  
    7475
    7576#Fields and tolerances to track changes
    76 field_names     =[\
    77         'Vx5km','Vy5km','Vz5km',\
    78         'Vx10km','Vy10km','Vz10km',\
    79         'Vx20km','Vy20km','Vz20km',\
    80         'Vx40km','Vy40km','Vz40km',\
    81         'Vx80km','Vy80km','Vz80km',\
    82         'Vx160km','Vy160km','Vz160km'
    83 ]
    84 field_tolerances=[\
    85         1e-07,1e-07,1e-07,\
    86         1e-08,1e-08,1e-08,\
    87         1e-08,1e-07,1e-07,\
    88         1e-08,1e-08,1e-08,\
    89         1e-08,1e-07,1e-07,\
    90         1e-07,1e-06,1e-07,\
    91 ]
     77field_names     =['Vx80km','Vy80km','Vz80km']
     78field_tolerances=[1e-08,1e-07,1e-07]
    9279field_values=[]
    9380for result in results:
  • issm/trunk-jpl/test/NightlyRun/test111.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedTranHO
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',200000)
    … …  
    1314md.extrude(3,1.)
    1415md=setflowequation(md,'HO','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md.transient.requested_outputs=['IceVolume']
    1718md=solve(md,'Transient')
  • issm/trunk-jpl/test/NightlyRun/test112.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedSurfSlop2d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000)
    … …  
    1213md=parameterize(md,'../Par/SquareShelfConstrained.py')
    1314md=setflowequation(md,'SSA','all')
    14 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1516md=solve(md,'SurfaceSlope')
    1617
  • issm/trunk-jpl/test/NightlyRun/test113.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedSurfSlope3d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000)
    … …  
    1314md.extrude(5,1.)
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'SurfaceSlope')
    1718
  • issm/trunk-jpl/test/NightlyRun/test114.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedBedSlop2d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000)
    … …  
    1213md=parameterize(md,'../Par/SquareShelfConstrained.py')
    1314md=setflowequation(md,'SSA','all')
    14 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1516md=solve(md,'BedSlope')
    1617
  • issm/trunk-jpl/test/NightlyRun/test115.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedBedSlop3d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000)
    … …  
    1314md.extrude(5,1.)
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'BedSlope')
    1718
  • issm/trunk-jpl/test/NightlyRun/test116.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedBalThic2d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',150000)
    … …  
    1314md=parameterize(md,'../Par/SquareShelfConstrained.py')
    1415#Add boundary conditions on thickness on the border
    15 pos=numpy.nonzero(md.mesh.vertexonboundary)
     16pos=np.nonzero(md.mesh.vertexonboundary)
    1617md.balancethickness.spcthickness[pos]=md.geometry.thickness[pos]
    1718md=setflowequation(md,'SSA','all')
    18 md.cluster=generic('name',oshostname(),'np',3)
     19md.cluster=generic('name',gethostname(),'np',3)
    1920md=solve(md,'Balancethickness')
    2021
  • issm/trunk-jpl/test/NightlyRun/test119.py

    r19049 r21408  
    11#Test Name: SquareBamgMesh
    2 import numpy
     2import numpy as np
    33import time
    44from model import *
     5from socket import gethostname
    56from bamg import *
    6 from MatlabFuncs import *
     7
    78
    89#Simple mesh
    … …  
    1213
    1314#hVertices
    14 md=bamg(model(),'domain','../Exp/Square.exp','hmax',300000.,'hVertices',numpy.array([10000.,100000.,400000.,100000.]).reshape(-1,1),'rand',False)
     15md=bamg(model(),'domain','../Exp/Square.exp','hmax',300000.,'hVertices',np.array([10000.,100000.,400000.,100000.]).reshape(-1,1),'rand',False)
    1516x2=md.mesh.x
    1617y2=md.mesh.y
  • issm/trunk-jpl/test/NightlyRun/test120.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedEnthalpyStea
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',180000)
    … …  
    1516md=setflowequation(md,'SSA','all')
    1617md.timestepping.time_step=0
    17 md.initialization.waterfraction=numpy.zeros(md.mesh.numberofvertices)
    18 md.initialization.watercolumn=numpy.zeros(md.mesh.numberofvertices)
    19 md.thermal.isenthalpy = 1;
    20 md.thermal.isdynamicbasalspc = 1;
     18md.initialization.waterfraction=np.zeros(md.mesh.numberofvertices)
     19md.initialization.watercolumn=np.zeros(md.mesh.numberofvertices)
     20md.thermal.isenthalpy = 1
     21md.thermal.isdynamicbasalspc = 1
    2122
    22 md.cluster=generic('name',oshostname(),'np',3)
     23md.cluster=generic('name',gethostname(),'np',3)
    2324md=solve(md,'Thermal')
    2425
    … …  
    2627field_names     =['Enthalpy','Waterfraction','Temperature']
    2728field_tolerances=[1e-13,2e-10,1e-13]
    28 field_values=[\
    29         md.results.ThermalSolution.Enthalpy,\
    30         md.results.ThermalSolution.Waterfraction,\
    31         md.results.ThermalSolution.Temperature,\
    32         ]
     29field_values=[md.results.ThermalSolution.Enthalpy,
     30                                                        md.results.ThermalSolution.Waterfraction,
     31                                                        md.results.ThermalSolution.Temperature]
  • issm/trunk-jpl/test/NightlyRun/test1201.py

    r21060 r21408  
    11#Test Name: EISMINTMassConservation
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from bamg import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112"""
    … …  
    1415
    1516printingflag=False
    16 
    1717results=[]
    1818
    … …  
    2424        md.smb.mass_balance[:]=0.
    2525        md=setflowequation(md,'SSA','all')
    26         md.cluster=generic('name',oshostname(),'np',8)
     26        md.cluster=generic('name',gethostname(),'np',8)
    2727
    2828        print "      initial velocity"
    29         md.initialization.vx=numpy.zeros((md.mesh.numberofvertices,1))
    30         md.initialization.vy=-400.*numpy.ones((md.mesh.numberofvertices,1))
     29        md.initialization.vx=np.zeros((md.mesh.numberofvertices))
     30        md.initialization.vy=-400.*np.ones((md.mesh.numberofvertices))
    3131
    3232        #Stabilization
    … …  
    3737
    3838        #spc thickness
    39         pos=numpy.nonzero(md.mesh.y>199999.9)[0]
    40         times=numpy.arange(0,501)
    41         md.masstransport.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices+1,numpy.size(times)))
     39        pos=np.where(md.mesh.y>199999.9)[0]
     40        times=np.arange(0,501)
     41        md.masstransport.spcthickness=float('NaN')*np.ones((md.mesh.numberofvertices+1,np.size(times)))
    4242        md.masstransport.spcthickness[-1,:]=times
    43         md.masstransport.spcthickness[pos,:]=numpy.tile(500.+100.*numpy.sin(2.*numpy.pi*times/200.),(numpy.size(pos),1))
     43        md.masstransport.spcthickness[pos,:]=500.+100.*np.sin(2.*np.pi*times/200.)
    4444        if stabilization==3:
    45                 pos=numpy.nonzero(numpy.isnan(md.masstransport.spcthickness))
     45                pos=np.nonzero(np.isnan(md.masstransport.spcthickness))
    4646                md.masstransport.spcthickness[pos]=500.    #No NaN for DG
    4747
    … …  
    5454
    5555#plot results
    56 #[elements,x,y,z,s,h1]=SectionValues(md,results[0],'../Exp/CrossLineEISMINT.exp',100.);
    57 #[elements,x,y,z,s,h2]=SectionValues(md,results[1],'../Exp/CrossLineEISMINT.exp',100.);
    58 #[elements,x,y,z,s,h3]=SectionValues(md,results[2],'../Exp/CrossLineEISMINT.exp',100.);
    59 #[elements,x,y,z,s,hth]=SectionValues(md, 500+100*sin(2*pi/200*(500-md.mesh.y/400)),'../Exp/CrossLineEISMINT.exp',100.);
     56#[elements,x,y,z,s,h1]=SectionValues(md,results[0],'../Exp/CrossLineEISMINT.exp',100.)
     57#[elements,x,y,z,s,h2]=SectionValues(md,results[1],'../Exp/CrossLineEISMINT.exp',100.)
     58#[elements,x,y,z,s,h3]=SectionValues(md,results[2],'../Exp/CrossLineEISMINT.exp',100.)
     59#[elements,x,y,z,s,hth]=SectionValues(md, 500+100*sin(2*pi/200*(500-md.mesh.y/400)),'../Exp/CrossLineEISMINT.exp',100.)
    6060#plot(s,h1,'r',s,h2,'b',s,h3,'g',s,hth,'k')
    6161#legend('Art. diff.','No Art. diff.','D.G.','Theoretical')
    … …  
    6363        pass
    6464#       set(gcf,'Color','w')
    65 #       export_fig([issmdir() '/website/doc_pdf/validation/Images/EISMINT/IceShelf/eismintmasscthickness.pdf']);
     65#       export_fig([issmdir() '/website/doc_pdf/validation/Images/EISMINT/IceShelf/eismintmasscthickness.pdf'])
    6666
    6767#Fields and tolerances to track changes
    68 field_names     =[ \
    69         'ThicknessArtDiff','ThicknessNoArtDiff','ThicknessDG' \
    70 ]
    71 field_tolerances=[\
    72         1e-13, 1e-13, 1e-13\
    73 ]
    74 field_values=[
    75         results[0], \
    76         results[1], \
    77         results[2], \
    78 ]
     68field_names     =['ThicknessArtDiff','ThicknessNoArtDiff','ThicknessDG']
     69field_tolerances=[1e-13, 1e-13, 1e-13]
     70field_values=[results[0],results[1],results[2]]
  • issm/trunk-jpl/test/NightlyRun/test1202.py

    r21060 r21408  
    11#Test Name: EISMINTStress1
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112"""
    … …  
    2324
    2425#Compute solution for SSA's model
    25 md.cluster=generic('name',oshostname(),'np',8)
     26md.cluster=generic('name',gethostname(),'np',8)
    2627md=solve(md,'Stressbalance')
    2728
    … …  
    3536        pass
    3637#       set(gcf,'Color','w')
    37 #       printmodel('eismintdiag1vx','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off');
    38 #       system(['mv eismintdiag1vx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf ']);
     38#       printmodel('eismintdiag1vx','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off')
     39#       system(['mv eismintdiag1vx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
    3940
    4041#plotmodel(md,'data',vy,'contourlevels',{-100,-200,-300,-400,-500,-600,-700,-800,-900,-1000},...
    … …  
    4344        pass
    4445#       set(gcf,'Color','w')
    45 #       printmodel('eismintdiag1vy','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off');
    46 #       system(['mv eismintdiag1vy.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf ']);
     46#       printmodel('eismintdiag1vy','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off')
     47#       system(['mv eismintdiag1vy.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
    4748
    4849#Fields and tolerances to track changes
    4950field_names     =['Vx','Vy']
    5051field_tolerances=[1e-13,1e-13]
    51 field_values=[\
    52         vx, \
    53         vy, \
    54         ]
     52field_values=[vx,vy]
  • issm/trunk-jpl/test/NightlyRun/test1203.py

    r21060 r21408  
    11#Test Name: EISMINTStress2
    2 import numpy
     2import numpy as np
    33import sys
    44from model import *
     5from socket import gethostname
    56from triangle import *
    67from setmask import *
    … …  
    89from setflowequation import *
    910from solve import *
    10 from MatlabFuncs import *
     11
    1112
    1213"""
    … …  
    2425
    2526#Impose a non zero velocity on the upper boundary condition (y=max(y))
    26 pos=numpy.nonzero(md.mesh.y==numpy.max(md.mesh.y))
    27 md.stressbalance.spcvy[pos]=400.*(((md.mesh.x[pos].reshape(-1,1)-100000.)/25000.)**2-numpy.ones((numpy.size(pos),1)))*heaviside((1.+sys.float_info.epsilon)*numpy.ones((numpy.size(pos),1))-((md.mesh.x[pos].reshape(-1,1)-100000.)/25000.)**2)
     27pos=np.where(md.mesh.y==np.max(md.mesh.y))
     28heavyside=np.where(np.logical_and(md.mesh.y==np.max(md.mesh.y),((1.+sys.float_info.epsilon)*np.ones((np.size(md.mesh.y)))-((md.mesh.x-100000.)/25000.)**2)>0))
     29md.stressbalance.spcvy[pos]=np.zeros((np.size(pos)))
     30md.stressbalance.spcvy[heavyside]=400.*(((md.mesh.x[heavyside]-100000.)/25000.)**2-np.ones((np.size(heavyside))))
    2831
    2932#Compute solution for SSA's model
    30 md.cluster=generic('name',oshostname(),'np',8)
     33md.cluster=generic('name',gethostname(),'np',8)
    3134md=solve(md,'Stressbalance')
    3235
    … …  
    4043        pass
    4144#       set(gcf,'Color','w')
    42 #       printmodel('eismintdiag2vx','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off');
    43 #       system(['mv eismintdiag2vx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf ']);
     45#       printmodel('eismintdiag2vx','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off')
     46#       system(['mv eismintdiag2vx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
    4447#plotmodel(md,'data',vy,'contourlevels',{-100,-200,-300,-400,-500,-600,-700,-800,-900,-1000},...
    4548#       'contourcolor','k')
    … …  
    4750        pass
    4851#       set(gcf,'Color','w')
    49 #       printmodel('eismintdiag2vy','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off');
    50 #       system(['mv eismintdiag2vy.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf ']);
     52#       printmodel('eismintdiag2vy','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off')
     53#       system(['mv eismintdiag2vy.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
    5154
    5255#Fields and tolerances to track changes
    5356field_names     =['Vx','Vy']
    5457field_tolerances=[1e-13,1e-13]
    55 field_values=[\
    56         vx, \
    57         vy, \
    58         ]
     58field_values=[vx,vy]
  • issm/trunk-jpl/test/NightlyRun/test1204.py

    r21060 r21408  
    11#Test Name: EISMINTTran2
    2 import numpy
     2import numpy as np
    33import sys
    44from model import *
     5from socket import gethostname
    56from triangle import *
    67from setmask import *
    … …  
    89from setflowequation import *
    910from solve import *
    10 from MatlabFuncs import *
     11
    1112
    1213"""
    … …  
    2425
    2526#Impose a non zero velocity on the upper boundary condition (y=max(y))
    26 pos=numpy.nonzero(md.mesh.y==max(md.mesh.y))
    27 md.stressbalance.spcvy[pos]=400.*(((md.mesh.x[pos].reshape(-1,1)-100000.)/25000.)**2-numpy.ones((numpy.size(pos),1)))*heaviside((1.+sys.float_info.epsilon)*numpy.ones((numpy.size(pos),1))-((md.mesh.x[pos].reshape(-1,1)-100000.)/25000.)**2)
     27pos=np.where(md.mesh.y==np.max(md.mesh.y))
     28heavyside=np.where(np.logical_and(md.mesh.y==np.max(md.mesh.y),((1.+sys.float_info.epsilon)*np.ones((np.size(md.mesh.y)))-((md.mesh.x-100000.)/25000.)**2)>0))
     29md.stressbalance.spcvy[pos]=np.zeros((np.size(pos)))
     30md.stressbalance.spcvy[heavyside]=400.*(((md.mesh.x[heavyside]-100000.)/25000.)**2-np.ones((np.size(heavyside))))
    2831
    2932#Compute solution for SSA's model
    30 md.cluster=generic('name',oshostname(),'np',8)
     33md.cluster=generic('name',gethostname(),'np',8)
    3134md=solve(md,'Stressbalance')
    3235
    … …  
    4447        pass
    4548#       set(gcf,'Color','w')
    46 #       printmodel('eisminttrans2vx','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off');
    47 #       system(['mv eisminttrans2vx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf ']);
     49#       printmodel('eisminttrans2vx','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off')
     50#       system(['mv eisminttrans2vx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
    4851
    4952#plotmodel(md,'data',(md.results.TransientSolution(end).Vy))
    … …  
    5154        pass
    5255#       set(gcf,'Color','w')
    53 #       printmodel('eisminttrans2vy','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off');
    54 #       system(['mv eisminttrans2vy.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf ']);
     56#       printmodel('eisminttrans2vy','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off')
     57#       system(['mv eisminttrans2vy.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
    5558
    5659#plotmodel(md,'data',(md.results.TransientSolution(end).Thickness))
    … …  
    5861        pass
    5962#       set(gcf,'Color','w')
    60 #       printmodel('eisminttrans2thickness','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off');
    61 #       system(['mv eisminttrans2thickness.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf ']);
     63#       printmodel('eisminttrans2thickness','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off')
     64#       system(['mv eisminttrans2thickness.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
    6265
    6366#Fields and tolerances to track changes
    6467field_names     =['Vx','Vy','Thickness']
    6568field_tolerances=[1e-13,1e-13,1e-13]
    66 field_values=[\
    67         md.results.TransientSolution[-1].Vx, \
    68         md.results.TransientSolution[-1].Vy, \
    69         md.results.TransientSolution[-1].Thickness, \
    70         ]
     69field_values=[md.results.TransientSolution[-1].Vx,
     70                                                        md.results.TransientSolution[-1].Vy,
     71                                                        md.results.TransientSolution[-1].Thickness]
  • issm/trunk-jpl/test/NightlyRun/test1205.py

    r21060 r21408  
    11#Test Name: EISMINTRoundIceSheetStaticSIA
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from roundmesh import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112"""
    … …  
    2829vx_obs=constant/2.*md.mesh.x*(md.geometry.thickness)**-1
    2930vy_obs=constant/2.*md.mesh.y*(md.geometry.thickness)**-1
    30 vel_obs=numpy.sqrt((md.inversion.vx_obs)**2+(md.inversion.vy_obs)**2)
     31vel_obs=np.sqrt((md.inversion.vx_obs)**2+(md.inversion.vy_obs)**2)
    3132
    3233#We extrude the model to have a 3d model
    33 md.extrude(numlayers,1.);
     34md.extrude(numlayers,1.)
    3435md=setflowequation(md,'SIA','all')
    3536
    3637#Spc the nodes on the bed
    37 pos=numpy.nonzero(md.mesh.vertexonbase)
     38pos=np.where(md.mesh.vertexonbase)
    3839md.stressbalance.spcvx[pos]=0.
    3940md.stressbalance.spcvy[pos]=0.
    … …  
    4142
    4243#Now we can solve the problem
    43 md.cluster=generic('name',oshostname(),'np',8)
     44md.cluster=generic('name',gethostname(),'np',8)
    4445md=solve(md,'Stressbalance')
    4546
    … …  
    4748vx=md.results.StressbalanceSolution.Vx
    4849vy=md.results.StressbalanceSolution.Vy
    49 vel=numpy.zeros((md.mesh.numberofvertices2d,1))
     50vel=np.zeros((md.mesh.numberofvertices2d))
    5051
    5152for i in xrange(0,md.mesh.numberofvertices2d):
    5253        node_vel=0.
    5354        for j in xrange(0,md.mesh.numberoflayers-1):
    54                 node_vel=node_vel+1./(2.*(md.mesh.numberoflayers-1))*\
    55                         (numpy.sqrt(vx[i+(j+1)*md.mesh.numberofvertices2d,0]**2+vy[i+(j+1)*md.mesh.numberofvertices2d,0]**2)+\
    56                         numpy.sqrt(vx[i+j*md.mesh.numberofvertices2d,0]**2+vy[i+j*md.mesh.numberofvertices2d,0]**2))
    57         vel[i,0]=node_vel
     55                node_vel=node_vel+1./(2.*(md.mesh.numberoflayers-1))*(np.sqrt(vx[i+(j+1)*md.mesh.numberofvertices2d,0]**2+vy[i+(j+1)*md.mesh.numberofvertices2d,0]**2)+np.sqrt(vx[i+j*md.mesh.numberofvertices2d,0]**2+vy[i+j*md.mesh.numberofvertices2d,0]**2))
     56        vel[i]=node_vel
    5857
    5958#Plot of the velocity from the exact and calculated solutions
    … …  
    6261#subplot(2,2,1)
    6362#p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
    64 #vel,'FaceColor','interp','EdgeColor','none');
     63#vel,'FaceColor','interp','EdgeColor','none')
    6564#title('Modelled velocity','FontSize',14,'FontWeight','bold')
    66 #colorbar;
    67 #caxis([0 200]);
     65#colorbar
     66#caxis([0 200])
    6867   
    6968#subplot(2,2,2)
    7069#p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
    71 #vel_obs,'FaceColor','interp','EdgeColor','none');
     70#vel_obs,'FaceColor','interp','EdgeColor','none')
    7271#title('Analytical velocity','FontSize',14,'FontWeight','bold')
    73 #colorbar;
    74 #caxis([0 200]);
     72#colorbar
     73#caxis([0 200])
    7574
    7675#subplot(2,2,3)
    77 #hold on;
    78 #plot(sqrt((md.mesh.x(1:md.mesh.numberofvertices2d)).^2+(md.mesh.y(1:md.mesh.numberofvertices2d)).^2),vel,'r.');
    79 #plot(sqrt((md.mesh.x2d).^2+(md.mesh.y2d).^2),vel_obs,'b.');
    80 #title('Analytical vs calculated velocity','FontSize',14,'FontWeight','bold');
    81 #xlabel('distance to the center of the icesheet [m]','FontSize',14,'FontWeight','bold');
    82 #ylabel('velocity [m/yr]','FontSize',14,'FontWeight','bold');
    83 #legend('calculated velocity','exact velocity');
    84 #axis([0 750000 0 200]);
    85 #hold off;
     76#hold on
     77#plot(sqrt((md.mesh.x(1:md.mesh.numberofvertices2d)).^2+(md.mesh.y(1:md.mesh.numberofvertices2d)).^2),vel,'r.')
     78#plot(sqrt((md.mesh.x2d).^2+(md.mesh.y2d).^2),vel_obs,'b.')
     79#title('Analytical vs calculated velocity','FontSize',14,'FontWeight','bold')
     80#xlabel('distance to the center of the icesheet [m]','FontSize',14,'FontWeight','bold')
     81#ylabel('velocity [m/yr]','FontSize',14,'FontWeight','bold')
     82#legend('calculated velocity','exact velocity')
     83#axis([0 750000 0 200])
     84#hold off
    8685
    8786#subplot(2,2,4)
    8887#p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
    89 #abs(vel-vel_obs)./vel_obs*100,'FaceColor','interp','EdgeColor','none');
     88#abs(vel-vel_obs)./vel_obs*100,'FaceColor','interp','EdgeColor','none')
    9089#title('Relative misfit [%]','FontSize',14,'FontWeight','bold')
    91 #colorbar;
    92 #caxis([0 100]);
     90#colorbar
     91#caxis([0 100])
    9392
    9493if printingflag:
    9594        pass
    9695#       set(gcf,'Color','w')
    97 #       printmodel('SIAstatic','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off');
    98 #       system(['mv SIAstatic.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceSheet']);
     96#       printmodel('SIAstatic','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off')
     97#       system(['mv SIAstatic.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceSheet'])
    9998
    10099#Fields and tolerances to track changes
    101 field_names     =[ \
    102         'Vx','Vy','Vel', \
    103 ]
    104 field_tolerances=[ \
    105         1e-13,1e-13,1e-13, \
    106 ]
    107 field_values=[ \
    108         vx,vy,vel, \
    109 ]
     100field_names     =['Vx','Vy','Vel']
     101field_tolerances=[1e-13,1e-13,1e-13]
     102field_values=[vx,vy,vel]
  • issm/trunk-jpl/test/NightlyRun/test1206.py

    r21060 r21408  
    11#Test Name: EISMINTRoundIceSheetStaticHO
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from roundmesh import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112"""
    … …  
    2627#Calculation of the analytical 2d velocity field
    2728constant=0.3
    28 vx_obs=constant/2.*md.mesh.x.reshape(-1,1)*(md.geometry.thickness)**-1
    29 vy_obs=constant/2.*md.mesh.y.reshape(-1,1)*(md.geometry.thickness)**-1
    30 vel_obs=numpy.sqrt((md.inversion.vx_obs)**2+(md.inversion.vy_obs)**2)
     29vx_obs=constant/2.*md.mesh.x*(md.geometry.thickness)**-1
     30vy_obs=constant/2.*md.mesh.y*(md.geometry.thickness)**-1
     31vel_obs=np.sqrt((md.inversion.vx_obs)**2+(md.inversion.vy_obs)**2)
    3132
    3233#We extrude the model to have a 3d model
    … …  
    3536
    3637#Spc the nodes on the bed
    37 pos=numpy.nonzero(md.mesh.vertexonbase)
     38pos=np.where(md.mesh.vertexonbase)
    3839md.stressbalance.spcvx[pos]=0.
    3940md.stressbalance.spcvy[pos]=0.
    … …  
    4142
    4243#Now we can solve the problem
    43 md.cluster=generic('name',oshostname(),'np',8)
     44md.cluster=generic('name',gethostname(),'np',8)
    4445md=solve(md,'Stressbalance')
    4546
    … …  
    4748vx=md.results.StressbalanceSolution.Vx
    4849vy=md.results.StressbalanceSolution.Vy
    49 vel=numpy.zeros((md.mesh.numberofvertices2d,1))
     50vel=np.zeros((md.mesh.numberofvertices2d))
    5051
    5152for i in xrange(0,md.mesh.numberofvertices2d):
    … …  
    5354        for j in xrange(0,md.mesh.numberoflayers-1):
    5455                node_vel=node_vel+1./(2.*(md.mesh.numberoflayers-1))*\
    55                         (numpy.sqrt(vx[i+(j+1)*md.mesh.numberofvertices2d,0]**2+vy[i+(j+1)*md.mesh.numberofvertices2d,0]**2)+\
    56                         numpy.sqrt(vx[i+j*md.mesh.numberofvertices2d,0]**2+vy[i+j*md.mesh.numberofvertices2d,0]**2))
    57         vel[i,0]=node_vel
     56                        (np.sqrt(vx[i+(j+1)*md.mesh.numberofvertices2d,0]**2+vy[i+(j+1)*md.mesh.numberofvertices2d,0]**2)+\
     57                        np.sqrt(vx[i+j*md.mesh.numberofvertices2d,0]**2+vy[i+j*md.mesh.numberofvertices2d,0]**2))
     58        vel[i]=node_vel
    5859
    5960#Plot of the velocity from the exact and calculated solutions
    … …  
    6162#subplot(2,2,1)
    6263#p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
    63 #vel,'FaceColor','interp','EdgeColor','none');
     64#vel,'FaceColor','interp','EdgeColor','none')
    6465#title('Modelled velocity','FontSize',14,'FontWeight','bold')
    65 #colorbar;
    66 #caxis([0 200]);
     66#colorbar
     67#caxis([0 200])
    6768   
    6869#subplot(2,2,2)
    6970#p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
    70 #vel_obs,'FaceColor','interp','EdgeColor','none');
     71#vel_obs,'FaceColor','interp','EdgeColor','none')
    7172#title('Analytical velocity','FontSize',14,'FontWeight','bold')
    72 #colorbar;
    73 #caxis([0 200]);
     73#colorbar
     74#caxis([0 200])
    7475
    7576#subplot(2,2,3)
    76 #hold on;
    77 #plot(sqrt((md.mesh.x(1:md.mesh.numberofvertices2d)).^2+(md.mesh.y(1:md.mesh.numberofvertices2d)).^2),vel,'r.');
    78 #plot(sqrt((md.mesh.x2d).^2+(md.mesh.y2d).^2),vel_obs,'b.');
    79 #title('Analytical vs calculated velocity','FontSize',14,'FontWeight','bold');
    80 #xlabel('distance to the center of the icesheet [m]','FontSize',14,'FontWeight','bold');
    81 #ylabel('velocity [m/yr]','FontSize',14,'FontWeight','bold');
    82 #legend('calculated velocity','exact velocity');
    83 #axis([0 750000 0 200]);
    84 #hold off;
     77#hold on
     78#plot(sqrt((md.mesh.x(1:md.mesh.numberofvertices2d)).^2+(md.mesh.y(1:md.mesh.numberofvertices2d)).^2),vel,'r.')
     79#plot(sqrt((md.mesh.x2d).^2+(md.mesh.y2d).^2),vel_obs,'b.')
     80#title('Analytical vs calculated velocity','FontSize',14,'FontWeight','bold')
     81#xlabel('distance to the center of the icesheet [m]','FontSize',14,'FontWeight','bold')
     82#ylabel('velocity [m/yr]','FontSize',14,'FontWeight','bold')
     83#legend('calculated velocity','exact velocity')
     84#axis([0 750000 0 200])
     85#hold off
    8586
    8687#subplot(2,2,4)
    8788#p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
    88 #abs(vel-vel_obs)./vel_obs*100,'FaceColor','interp','EdgeColor','none');
     89#abs(vel-vel_obs)./vel_obs*100,'FaceColor','interp','EdgeColor','none')
    8990#title('Relative misfit [%]','FontSize',14,'FontWeight','bold')
    90 #colorbar;
    91 #caxis([0 100]);
     91#colorbar
     92#caxis([0 100])
    9293
    9394if printingflag:
    9495        pass
    9596#       set(gcf,'Color','w')
    96 #       printmodel('HOstatic','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off');
    97 #       system(['mv HOstatic.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceSheet']);
     97#       printmodel('HOstatic','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off')
     98#       system(['mv HOstatic.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceSheet'])
    9899
    99100#Fields and tolerances to track changes
    100 field_names     =[ \
    101         'Vx','Vy','Vel', \
    102 ]
    103 field_tolerances=[ \
    104         1e-12,1e-12,1e-12, \
    105 ]
    106 field_values=[ \
    107         vx,vy,vel, \
    108 ]
     101field_names     =['Vx','Vy','Vel']
     102field_tolerances=[1e-12,1e-12,1e-12]
     103field_values=[vx,vy,vel]
  • issm/trunk-jpl/test/NightlyRun/test1207.py

    r21060 r21408  
    11#Test Name: EISMINTRoundIceSheetStaticFS
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from roundmesh import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112"""
    … …  
    2627#Calculation of the analytical 2d velocity field
    2728constant=0.3
    28 vx_obs=constant/2.*md.mesh.x.reshape(-1,1)*(md.geometry.thickness)**-1
    29 vy_obs=constant/2.*md.mesh.y.reshape(-1,1)*(md.geometry.thickness)**-1
    30 vel_obs=numpy.sqrt((md.inversion.vx_obs)**2+(md.inversion.vy_obs)**2)
     29vx_obs=constant/2.*md.mesh.x*(md.geometry.thickness)**-1
     30vy_obs=constant/2.*md.mesh.y*(md.geometry.thickness)**-1
     31vel_obs=np.sqrt((md.inversion.vx_obs)**2+(md.inversion.vy_obs)**2)
    3132
    3233#We extrude the model to have a 3d model
    … …  
    3536
    3637#Spc the nodes on the bed
    37 pos=numpy.nonzero(md.mesh.vertexonbase)
     38pos=np.where(md.mesh.vertexonbase)
    3839md.stressbalance.spcvx[pos]=0.
    3940md.stressbalance.spcvy[pos]=0.
    … …  
    4142
    4243#Now we can solve the problem
    43 md.cluster=generic('name',oshostname(),'np',8)
     44md.cluster=generic('name',gethostname(),'np',8)
    4445md=solve(md,'Stressbalance')
    4546
    … …  
    4748vx=md.results.StressbalanceSolution.Vx
    4849vy=md.results.StressbalanceSolution.Vy
    49 vel=numpy.zeros((md.mesh.numberofvertices2d,1))
     50vel=np.zeros((md.mesh.numberofvertices2d))
    5051
    5152for i in xrange(0,md.mesh.numberofvertices2d):
    … …  
    5354        for j in xrange(0,md.mesh.numberoflayers-1):
    5455                node_vel=node_vel+1./(2.*(md.mesh.numberoflayers-1))*\
    55                         (numpy.sqrt(vx[i+(j+1)*md.mesh.numberofvertices2d,0]**2+vy[i+(j+1)*md.mesh.numberofvertices2d,0]**2)+\
    56                         numpy.sqrt(vx[i+j*md.mesh.numberofvertices2d,0]**2+vy[i+j*md.mesh.numberofvertices2d,0]**2))
    57         vel[i,0]=node_vel
     56                        (np.sqrt(vx[i+(j+1)*md.mesh.numberofvertices2d,0]**2+vy[i+(j+1)*md.mesh.numberofvertices2d,0]**2)+\
     57                        np.sqrt(vx[i+j*md.mesh.numberofvertices2d,0]**2+vy[i+j*md.mesh.numberofvertices2d,0]**2))
     58        vel[i]=node_vel
    5859
    5960#Plot of the velocity from the exact and calculated solutions
    … …  
    6162#subplot(2,2,1)
    6263#p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
    63 #vel,'FaceColor','interp','EdgeColor','none');
     64#vel,'FaceColor','interp','EdgeColor','none')
    6465#title('Modelled velocity','FontSize',14,'FontWeight','bold')
    65 #colorbar;
    66 #caxis([0 200]);
     66#colorbar
     67#caxis([0 200])
    6768   
    6869#subplot(2,2,2)
    6970#p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
    70 #vel_obs,'FaceColor','interp','EdgeColor','none');
     71#vel_obs,'FaceColor','interp','EdgeColor','none')
    7172#title('Analytical velocity','FontSize',14,'FontWeight','bold')
    72 #colorbar;
    73 #caxis([0 200]);
     73#colorbar
     74#caxis([0 200])
    7475
    7576#subplot(2,2,3)
    76 #hold on;
    77 #plot(sqrt((md.mesh.x(1:md.mesh.numberofvertices2d)).^2+(md.mesh.y(1:md.mesh.numberofvertices2d)).^2),vel,'r.');
    78 #plot(sqrt((md.mesh.x2d).^2+(md.mesh.y2d).^2),vel_obs,'b.');
    79 #title('Analytical vs calculated velocity','FontSize',14,'FontWeight','bold');
    80 #xlabel('distance to the center of the icesheet [m]','FontSize',14,'FontWeight','bold');
    81 #ylabel('velocity [m/yr]','FontSize',14,'FontWeight','bold');
    82 #legend('calculated velocity','exact velocity');
    83 #axis([0 750000 0 200]);
    84 #hold off;
     77#hold on
     78#plot(sqrt((md.mesh.x(1:md.mesh.numberofvertices2d)).^2+(md.mesh.y(1:md.mesh.numberofvertices2d)).^2),vel,'r.')
     79#plot(sqrt((md.mesh.x2d).^2+(md.mesh.y2d).^2),vel_obs,'b.')
     80#title('Analytical vs calculated velocity','FontSize',14,'FontWeight','bold')
     81#xlabel('distance to the center of the icesheet [m]','FontSize',14,'FontWeight','bold')
     82#ylabel('velocity [m/yr]','FontSize',14,'FontWeight','bold')
     83#legend('calculated velocity','exact velocity')
     84#axis([0 750000 0 200])
     85#hold off
    8586
    8687#subplot(2,2,4)
    8788#p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
    88 #abs(vel-vel_obs)./vel_obs*100,'FaceColor','interp','EdgeColor','none');
     89#abs(vel-vel_obs)./vel_obs*100,'FaceColor','interp','EdgeColor','none')
    8990#title('Relative misfit [%]','FontSize',14,'FontWeight','bold')
    90 #colorbar;
    91 #caxis([0 100]);
     91#colorbar
     92#caxis([0 100])
    9293
    9394if printingflag:
    9495        pass
    9596#       set(gcf,'Color','w')
    96 #       printmodel('FSstatic','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off');
    97 #       system(['mv FSstatic.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceSheet']);
     97#       printmodel('FSstatic','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off')
     98#       system(['mv FSstatic.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceSheet'])
    9899
    99100#Fields and tolerances to track changes
    100 field_names     =[ \
    101         'Vx','Vy','Vel', \
    102 ]
    103 field_tolerances=[ \
    104         1e-12,1e-12,1e-12, \
    105 ]
    106 field_values=[ \
    107         vx,vy,vel, \
    108 ]
     101field_names     =['Vx','Vy','Vel']
     102field_tolerances=[1e-12,1e-12,1e-12]
     103field_values=[vx,vy,vel]
  • issm/trunk-jpl/test/NightlyRun/test1208.py

    r21060 r21408  
    11#Test Name: EISMINTA
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112"""
    … …  
    2627
    2728#Spc the nodes on the bed
    28 pos=numpy.nonzero(md.mesh.vertexonbase)
     29pos=np.where(md.mesh.vertexonbase)
    2930md.stressbalance.spcvx[pos]=0.
    3031md.stressbalance.spcvy[pos]=0.
    … …  
    3940
    4041#Now we can solve the problem
    41 md.cluster=generic('name',oshostname(),'np',8)
     42md.cluster=generic('name',gethostname(),'np',8)
    4243md=solve(md,'Transient')
    4344
    … …  
    4546field_names     =['Vx','Vy','Vz','Vel','Pressure','Thickness','Base','Surface','Temperature','BasalforcingsGroundediceMeltingRate']
    4647field_tolerances=[1e-08,1e-08,1e-07,1e-08,1e-08,1e-08,1e-08,1e-08,1e-07,1e-07]
    47 field_values=[\
    48         md.results.TransientSolution[-1].Vx,\
    49         md.results.TransientSolution[-1].Vy,\
    50         md.results.TransientSolution[-1].Vz,\
    51         md.results.TransientSolution[-1].Vel,\
    52         md.results.TransientSolution[-1].Pressure,\
    53         md.results.TransientSolution[-1].Thickness,\
    54         md.results.TransientSolution[-1].Base,\
    55         md.results.TransientSolution[-1].Surface,\
    56         md.results.TransientSolution[-1].Temperature,\
    57         md.results.TransientSolution[-1].BasalforcingsGroundediceMeltingRate,\
    58         ]
     48field_values=[md.results.TransientSolution[-1].Vx,
     49                                                        md.results.TransientSolution[-1].Vy,
     50                                                        md.results.TransientSolution[-1].Vz,
     51                                                        md.results.TransientSolution[-1].Vel,
     52                                                        md.results.TransientSolution[-1].Pressure,
     53                                                        md.results.TransientSolution[-1].Thickness,
     54                                                        md.results.TransientSolution[-1].Base,
     55                                                        md.results.TransientSolution[-1].Surface,
     56                                                        md.results.TransientSolution[-1].Temperature,
     57                                                        md.results.TransientSolution[-1].BasalforcingsGroundediceMeltingRate]
  • issm/trunk-jpl/test/NightlyRun/test121.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedEnthalpyTran
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000)
    … …  
    1314md.extrude(3,1.)
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3);
    16 md.initialization.waterfraction=numpy.zeros((md.mesh.numberofvertices,1))
    17 md.initialization.watercolumn=numpy.zeros((md.mesh.numberofvertices,1))
     16md.cluster=generic('name',gethostname(),'np',3)
     17md.initialization.waterfraction=np.zeros((md.mesh.numberofvertices))
     18md.initialization.watercolumn=np.zeros((md.mesh.numberofvertices))
    1819md.transient.isstressbalance=False
    1920md.transient.ismasstransport=False
  • issm/trunk-jpl/test/NightlyRun/test122.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedTransHOEnth
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',200000)
    … …  
    1314md.extrude(3,1.)
    1415md=setflowequation(md,'HO','all')
    15 md.initialization.waterfraction=numpy.zeros((md.mesh.numberofvertices,1))
    16 md.initialization.watercolumn=numpy.zeros((md.mesh.numberofvertices,1))
     16md.initialization.waterfraction=np.zeros((md.mesh.numberofvertices))
     17md.initialization.watercolumn=np.zeros((md.mesh.numberofvertices))
    1718md.thermal.isenthalpy=1
    1819md.thermal.isdynamicbasalspc=1
    1920md.thermal.stabilization=2
    20 md.cluster=generic('name',oshostname(),'np',3)
     21md.cluster=generic('name',gethostname(),'np',3)
    2122md=solve(md,'Transient')
    2223
  • issm/trunk-jpl/test/NightlyRun/test125.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedRestartTranSSA2d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910from massfluxatgate import massfluxatgate
    1011from generic import generic
    … …  
    1516md=parameterize(md,'../Par/SquareShelfConstrained.py')
    1617md=setflowequation(md,'SSA','all')
    17 md.cluster=generic('name',oshostname(),'np',1)
     18md.cluster=generic('name',gethostname(),'np',1)
    1819md.transient.requested_outputs=['IceVolume','TotalSmb']
    1920
    20 md.verbose=verbose('solution',1);
     21md.verbose=verbose('solution',1)
    2122md.settings.recording_frequency=5
    2223
    … …  
    2930
    3031#Fields and tolerances to track changes
    31 field_names     =['Vx1','Vy1','Vel1','TotalSmb1','Bed1','Surface1','Thickness1','Volume1','Vx2','Vy2','Vel2','TotalSmb2','Bed2','Surface2','Thickness2','Volume2','Vx3','Vy3','Vel3','TotalSmb3','Bed3','Surface3','Thickness3','Volume3'];
     32field_names     =['Vx1','Vy1','Vel1','TotalSmb1','Bed1','Surface1','Thickness1','Volume1','Vx2','Vy2','Vel2','TotalSmb2','Bed2','Surface2','Thickness2','Volume2','Vx3','Vy3','Vel3','TotalSmb3','Bed3','Surface3','Thickness3','Volume3']
    3233field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    3334                1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
  • issm/trunk-jpl/test/NightlyRun/test126.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedRestartTranHO3d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910from massfluxatgate import massfluxatgate
    1011from generic import generic
    … …  
    1415md=setmask(md,'all','')
    1516md=parameterize(md,'../Par/SquareShelfConstrained.py')
    16 md.cluster=generic('name',oshostname(),'np',1)
     17md.cluster=generic('name',gethostname(),'np',1)
    1718md.transient.requested_outputs=['IceVolume','TotalSmb']
    1819md.extrude(3,1.)
    1920md=setflowequation(md,'HO','all')
    2021
    21 md.verbose=verbose('solution',1);
     22md.verbose=verbose('solution',1)
    2223md.settings.recording_frequency=5
    2324
    … …  
    3031
    3132#Fields and tolerances to track changes
    32 field_names     =['Vx1','Vy1','Vel1','TotalSmb1','Bed1','Surface1','Thickness1','Volume1','Temperature1','Pressure1','Vx2','Vy2','Vel2','TotalSmb2','Bed2','Surface2','Thickness2','Volume2','Temperature2','Pressure2','Vx3','Vy3','Vel3','TotalSmb3','Bed3','Surface3','Thickness3','Volume3','Temperature3','Pressure3'];
     33field_names     =['Vx1','Vy1','Vel1','TotalSmb1','Bed1','Surface1','Thickness1','Volume1','Temperature1','Pressure1','Vx2','Vy2','Vel2','TotalSmb2','Bed2','Surface2','Thickness2','Volume2','Temperature2','Pressure2','Vx3','Vy3','Vel3','TotalSmb3','Bed3','Surface3','Thickness3','Volume3','Temperature3','Pressure3']
    3334field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    3435                1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
  • issm/trunk-jpl/test/NightlyRun/test1301.py

    r21060 r21408  
    11#Test Name: ThermalMelting
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    89from paterson import *
    910from solve import *
    10 from MatlabFuncs import *
     11
    1112
    1213"""
    … …  
    2728
    2829#Some conditions specific to melting test
    29 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1),int)
    30 md.initialization.temperature=273.15*numpy.ones((md.mesh.numberofvertices,1))
    31 pos=numpy.nonzero(md.mesh.vertexonsurface)[0]
     30md.initialization.pressure=np.zeros((md.mesh.numberofvertices,1),int)
     31md.initialization.temperature=273.15*np.ones((md.mesh.numberofvertices))
     32pos=np.nonzero(md.mesh.vertexonsurface)[0]
    3233md.thermal.spctemperature[pos]=md.initialization.temperature[pos]
    3334md.materials.rheology_B=paterson(md.initialization.temperature)
    … …  
    3940
    4041#modeled results
    41 md.cluster=generic('name',oshostname(),'np',2)
     42md.cluster=generic('name',gethostname(),'np',2)
    4243md=solve(md,'Thermal')
    4344
    4445#plot results
    4546comp_melting=md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate
    46 relative=numpy.abs((comp_melting-melting)/melting)*100.
    47 relative[numpy.nonzero(comp_melting==melting)[0]]=0.
     47relative=np.abs((comp_melting-melting)/melting)*100.
     48relative[np.nonzero(comp_melting==melting)[0]]=0.
    4849#plotmodel(md,'data',comp_melting,'title','Modeled melting','data',melting,'title','Analytical melting',...
    4950#       'data',comp_melting-melting,'title','Absolute error','data',relative,'title','Relative error [%]',...
    … …  
    5253        pass
    5354#       set(gcf,'Color','w')
    54 #       printmodel('thermalmelting','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off');
    55 #       system(['mv thermalmelting.png ' ISSM_DIR '/website/doc_pdf/validation/Images/Thermal ']);
     55#       printmodel('thermalmelting','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off')
     56#       system(['mv thermalmelting.png ' ISSM_DIR '/website/doc_pdf/validation/Images/Thermal '])
    5657
    5758#Fields and tolerances to track changes
  • issm/trunk-jpl/test/NightlyRun/test1302.py

    r21060 r21408  
    11#Test Name: ThermalAdvection
    2 import numpy
     2import numpy as np
    33import sys
    44from model import *
     5from socket import gethostname
    56from triangle import *
    67from setmask import *
    … …  
    89from setflowequation import *
    910from solve import *
    10 from MatlabFuncs import *
     11
    1112
    1213"""
    … …  
    2627
    2728#Thermal boundary conditions
    28 pos1=numpy.nonzero(md.mesh.elementonbase)[0]
     29pos1=np.where(np.isnan(md.mesh.lowerelements))[0]
    2930md.thermal.spctemperature[md.mesh.elements[pos1,0:3]-1]=10.
    30 pos2=numpy.nonzero(md.mesh.elementonsurface)[0]
     31pos2=np.where(np.isnan(md.mesh.upperelements))[0]
    3132md.thermal.spctemperature[md.mesh.elements[pos2,3:6]-1]=0.
    32 md.initialization.vz=0.1*numpy.ones((md.mesh.numberofvertices,1))
    33 md.initialization.vel=numpy.sqrt( md.initialization.vx**2+ md.initialization.vy**2+ md.initialization.vz**2)
    34 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1),int)
     33md.initialization.vz=0.1*np.ones((md.mesh.numberofvertices))
     34md.initialization.vel=np.sqrt(md.initialization.vx**2+ md.initialization.vy**2+ md.initialization.vz**2)
     35md.initialization.pressure=np.zeros((md.mesh.numberofvertices),int)
    3536
    3637md.thermal.stabilization=2
    … …  
    3839#d2T/dz2-w*rho_ice*c/k*dT/dz=0   T(surface)=0  T(bed)=10   => T=A exp(alpha z)+B
    3940alpha=0.1/md.constants.yts*md.materials.rho_ice*md.materials.heatcapacity/md.materials.thermalconductivity    #alpha=w rho_ice c /k  and w=0.1m/an
    40 A=10./(numpy.exp(alpha*(-1000.))-1.)    #A=T(bed)/(exp(alpha*bed)-1)  with bed=-1000 T(bed)=10
     41A=10./(np.exp(alpha*(-1000.))-1.)    #A=T(bed)/(exp(alpha*bed)-1)  with bed=-1000 T(bed)=10
    4142B=-A
    42 md.initialization.temperature=A*numpy.exp(alpha*md.mesh.z)+B
     43md.initialization.temperature=A*np.exp(alpha*md.mesh.z)+B
    4344
    4445#modeled results
    45 md.cluster=generic('name',oshostname(),'np',2)
     46md.cluster=generic('name',gethostname(),'np',2)
    4647md=solve(md,'Thermal')
    4748
    4849#plot results
    4950comp_temp=md.results.ThermalSolution.Temperature
    50 relative=numpy.abs((comp_temp-md.initialization.temperature)/md.initialization.temperature)*100.
    51 relative[numpy.nonzero(comp_temp==md.initialization.temperature)[0]]=0.
     51relative=np.abs((comp_temp-md.initialization.temperature)/md.initialization.temperature)*100.
     52relative[np.nonzero(comp_temp==md.initialization.temperature)[0]]=0.
    5253#plotmodel(md,'data',comp_temp,'title','Modeled temperature [K]','data',md.initialization.temperature,'view',3,...
    5354#       'title','Analytical temperature [K]','view',3,'data',comp_temp-md.initialization.temperature,...
    … …  
    5758        pass
    5859#       set(gcf,'Color','w')
    59 #       printmodel('thermaladvection','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off');
    60 #       system(['mv thermaladvection.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT ']);
     60#       printmodel('thermaladvection','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off')
     61#       system(['mv thermaladvection.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT '])
    6162
    6263#Fields and tolerances to track changes
  • issm/trunk-jpl/test/NightlyRun/test1303.py

    r21060 r21408  
    11#Test Name: ThermalConduction
    2 import numpy
     2import numpy as np
    33import sys
    44from model import *
     5from socket import gethostname
    56from triangle import *
    67from setmask import *
    … …  
    89from setflowequation import *
    910from solve import *
    10 from MatlabFuncs import *
     11
    1112
    1213"""
    … …  
    2627md=setflowequation(md,'HO','all')
    2728
    28 pos1=numpy.nonzero(md.mesh.elementonbase)[0]
     29
     30pos1=np.where(np.isnan(md.mesh.lowerelements))[0]
    2931md.thermal.spctemperature[md.mesh.elements[pos1,0:3]-1]=10.
    30 pos2=numpy.nonzero(md.mesh.elementonsurface)[0]
     32pos2=np.where(np.isnan(md.mesh.upperelements))[0]
    3133md.thermal.spctemperature[md.mesh.elements[pos2,3:6]-1]=0.
    32 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1),int)
     34md.initialization.pressure=np.zeros((md.mesh.numberofvertices),int)
    3335
    3436#analytical results
    … …  
    3840
    3941#modeled results
    40 md.cluster=generic('name',oshostname(),'np',2)
     42md.cluster=generic('name',gethostname(),'np',2)
    4143md=solve(md,'Thermal')
    4244
    4345#plot results
    4446comp_temp=md.results.ThermalSolution.Temperature
    45 relative=numpy.abs((comp_temp-md.initialization.temperature)/md.initialization.temperature)*100.
    46 relative[numpy.nonzero(comp_temp==md.initialization.temperature)[0]]=0.
     47relative=np.abs((comp_temp-md.initialization.temperature)/md.initialization.temperature)*100.
     48relative[np.nonzero(comp_temp==md.initialization.temperature)[0]]=0.
    4749#plotmodel(md,'data',comp_temp,'title','Modeled temperature [K]','data',md.initialization.temperature,'view',3,...
    4850#       'title','Analytical temperature [K]','view',3,'data',comp_temp-md.initialization.temperature,...
    … …  
    5254        pass
    5355#       set(gcf,'Color','w')
    54 #       printmodel('thermalconduction','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off');
    55 #       system(['mv thermalconduction.png ' ISSM_DIR '/website/doc_pdf/validation/Images/Thermal ']);
     56#       printmodel('thermalconduction','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off')
     57#       system(['mv thermalconduction.png ' ISSM_DIR '/website/doc_pdf/validation/Images/Thermal '])
    5658
    5759#Fields and tolerances to track changes
  • issm/trunk-jpl/test/NightlyRun/test1304.py

    r21060 r21408  
    11#Test Name: ThermalGeothermalFlux
    2 import numpy
     2import numpy as np
    33import sys
    44from model import *
     5from socket import gethostname
    56from triangle import *
    67from setmask import *
    … …  
    89from setflowequation import *
    910from solve import *
    10 from MatlabFuncs import *
     11
    1112
    1213"""
    … …  
    2627md=setflowequation(md,'HO','all')
    2728
    28 pos2=numpy.nonzero(md.mesh.elementonsurface)[0]
     29pos2=np.where(np.isnan(md.mesh.upperelements))[0]
    2930md.thermal.spctemperature[md.mesh.elements[pos2,3:6]-1]=0.
    30 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1),int)
     31md.initialization.pressure=np.zeros((md.mesh.numberofvertices),int)
    3132md.basalforcings.geothermalflux[:]=0.1    #100mW/m^2
    3233
    … …  
    3738
    3839#modeled results
    39 md.cluster=generic('name',oshostname(),'np',2)
     40md.cluster=generic('name',gethostname(),'np',2)
    4041md=solve(md,'Thermal')
    4142
    4243#plot results
    4344comp_temp=md.results.ThermalSolution.Temperature
    44 relative=numpy.abs((comp_temp-md.initialization.temperature)/md.initialization.temperature)*100.
    45 relative[numpy.nonzero(comp_temp==md.initialization.temperature)[0]]=0.
     45relative=np.abs((comp_temp-md.initialization.temperature)/md.initialization.temperature)*100.
     46relative[np.where(comp_temp==md.initialization.temperature)[0]]=0.
    4647#plotmodel(md,'data',comp_temp,'title','Modeled temperature [K]','data',md.initialization.temperature,'view',3,...
    4748#       'title','Analytical temperature','view',3,'data',comp_temp-md.initialization.temperature,...
    … …  
    5152        pass
    5253#       set(gcf,'Color','w')
    53 #       printmodel('thermalgeothermalflux','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off');
    54 #       system(['mv thermalgeothermalflux.png ' ISSM_DIR '/website/doc_pdf/validation/Images/Thermal ']);
     54#       printmodel('thermalgeothermalflux','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off')
     55#       system(['mv thermalgeothermalflux.png ' ISSM_DIR '/website/doc_pdf/validation/Images/Thermal '])
    5556
    5657#Fields and tolerances to track changes
  • issm/trunk-jpl/test/NightlyRun/test1501.py

    r21060 r21408  
    11#Test Name: SquareShelfTranSawTooth2d
    2 import numpy
     2import numpy as np
    33import sys
    44from model import *
     5from socket import gethostname
    56from triangle import *
    67from setmask import *
    … …  
    89from setflowequation import *
    910from solve import *
    10 from MatlabFuncs import *
     11
    1112
    1213printingflag = False
    … …  
    1617md=parameterize(md,'../Par/SquareShelf.py')
    1718md=setflowequation(md,'SSA','all')
    18 md.cluster=generic('name',oshostname(),'np',3)
     19md.cluster=generic('name',gethostname(),'np',3)
    1920md.transient.isthermal=False
    2021
    … …  
    2425
    2526#Solve for thinning rate -> -1 * surface mass balance
    26 smb= 2.*numpy.ones((md.mesh.numberofvertices,1))
     27smb= 2.*np.ones((md.mesh.numberofvertices))
    2728md.smb.mass_balance= smb
    2829md.basalforcings.groundedice_melting_rate= smb
    … …  
    3738smb = md.smb.mass_balance
    3839
    39 #tooth= [ [ones(400,1)*(smb') - 10.]' [ones(400,1)*(smb')]' ];
    40 tooth=numpy.hstack((numpy.tile(smb-10.,(1,400)),numpy.tile(smb,(1,400))))
    41 #smb=[ [ones(399,1)*(smb')]' smb  tooth tooth];
    42 smb=numpy.hstack((numpy.tile(smb,(1,399)),smb,tooth,tooth))
    43 
    44 #md.smb.mass_balance= smb;
    45 #md.smb.mass_balance(end+1,:)=[1.:2000.];
    46 md.smb.mass_balance=numpy.vstack((smb,numpy.arange(1,2001)))
     40#tooth= [ [ones(400,1)*(smb') - 10.]' [ones(400,1)*(smb')]' ]
     41tooth=np.hstack((np.tile(smb-10.,(1,400)),np.tile(smb,(1,400))))
     42#smb=[ [ones(399,1)*(smb')]' smb  tooth tooth]
     43smb=np.hstack((np.tile(smb,(1,399)),smb,tooth,tooth))
     44
     45#md.smb.mass_balance= smb
     46#md.smb.mass_balance(end+1,:)=[1.:2000.]
     47md.smb.mass_balance=np.vstack((smb,np.arange(1,2001)))
    4748
    4849md=solve(md,'Transient')
    … …  
    106107
    107108        """
    108         starttime = 360;
    109         endtime = 2000;
    110         res = 40;
    111         ts = [starttime:res:endtime];
    112 
    113         index = md.mesh.elements;
    114         x1=md.mesh.x(index(:,1)); x2=md.mesh.x(index(:,2)); x3=md.mesh.x(index(:,3));
    115         y1=md.mesh.y(index(:,1)); y2=md.mesh.y(index(:,2)); y3=md.mesh.y(index(:,3));
    116         areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1)));
    117 
    118         thickness = [];
    119         volume = [];
    120         massbal = [];
    121         velocity = [];
     109        starttime = 360
     110        endtime = 2000
     111        res = 40
     112        ts = [starttime:res:endtime]
     113
     114        index = md.mesh.elements
     115        x1=md.mesh.x(index(:)) x2=md.mesh.x(index(:,2)) x3=md.mesh.x(index(:,3))
     116        y1=md.mesh.y(index(:)) y2=md.mesh.y(index(:,2)) y3=md.mesh.y(index(:,3))
     117        areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1)))
     118
     119        thickness = []
     120        volume = []
     121        massbal = []
     122        velocity = []
    122123        for t=starttime:endtime
    123                 thickness = [thickness (md.results.TransientSolution(t).Thickness)];
    124                 volume = [volume mean(md.results.TransientSolution(t).Thickness.value,2).*areas];
    125                 massbal = [massbal (md.results.TransientSolution(t).SmbMassBalance)];
    126                 velocity = [velocity (md.results.TransientSolution(t).Vel)];
     124                thickness = [thickness (md.results.TransientSolution(t).Thickness)]
     125                volume = [volume mean(md.results.TransientSolution(t).Thickness.value,2).*areas]
     126                massbal = [massbal (md.results.TransientSolution(t).SmbMassBalance)]
     127                velocity = [velocity (md.results.TransientSolution(t).Vel)]
    127128        end
    128129
    129130        figure('Position', [0 0 860 932])
    130131
    131         options = plotoptions('data','transient_movie','unit','km');
    132         options = options.list{1};
    133         options = checkplotoptions(md,options);
     132        options = plotoptions('data','transient_movie','unit','km')
     133        options = options.list{1}
     134        options = checkplotoptions(md,options)
    134135
    135136        %loop over the time steps
    136         results=md.results.TransientSolution;
    137         count = 1;
     137        results=md.results.TransientSolution
     138        count = 1
    138139        for i=ts
    139140
    140141                subplot(5,9,[28:31 37:40])
    141142                set(gca,'pos',get(gca,'pos')+[-0.08 -0.08 0.07 0.08])
    142                 field = 'Thickness';
     143                field = 'Thickness'
    143144
    144145                %process data
    145                 [x y z elements is2d isplanet]=processmesh(md,results(i).(field),options);
    146                 [data datatype]=processdata(md,results(i).(field),options);
    147 
    148                 titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year'];
     146                [x y z elements is2d isplanet]=processmesh(md,results(i).(field),options)
     147                [data datatype]=processdata(md,results(i).(field),options)
     148
     149                titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year']
    149150                plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
    150                 options=changefieldvalue(options,'title',titlestring);
    151                 options=addfielddefault(options,'colorbar',1);
    152                 options=changefieldvalue(options,'caxis',[0 max(max(thickness))]);
    153                 applyoptions(md,[],options);
     151                options=changefieldvalue(options,'title',titlestring)
     152                options=addfielddefault(options,'colorbar',1)
     153                options=changefieldvalue(options,'caxis',[0 max(max(thickness))])
     154                applyoptions(md,[],options)
    154155
    155156                subplot(5,9,[33:36 42:45])
    156157                set(gca,'pos',get(gca,'pos')+[-0.00 -0.08 0.07 0.08])
    157                 field = 'Vel';
     158                field = 'Vel'
    158159
    159160                %process data
    160                 [x y z elements is2d isplanet]=processmesh(md,results(i).(field),options);
    161                 [data datatype]=processdata(md,results(i).(field),options);
    162 
    163                 titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year'];
     161                [x y z elements is2d isplanet]=processmesh(md,results(i).(field),options)
     162                [data datatype]=processdata(md,results(i).(field),options)
     163
     164                titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year']
    164165                plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
    165                 options=changefieldvalue(options,'title',titlestring);
    166                 options=addfielddefault(options,'colorbar',1);
    167                 options=changefieldvalue(options,'caxis',[0 max(max(velocity))]);
    168                 applyoptions(md,[],options);
     166                options=changefieldvalue(options,'title',titlestring)
     167                options=addfielddefault(options,'colorbar',1)
     168                options=changefieldvalue(options,'caxis',[0 max(max(velocity))])
     169                applyoptions(md,[],options)
    169170
    170171                subplot(5,4,1:4)
    … …  
    173174                plot(starttime:endtime,mean(massbal),'k','LineWidth', 4)
    174175                hold on
    175                 ya = ylim;
     176                ya = ylim
    176177                plot([i i], ya, 'r', 'LineWidth',6)
    177                 ylim(ya); xlim([starttime endtime]);
     178                ylim(ya) xlim([starttime endtime])
    178179                title('Surface Mass Balance','FontSize',14)
    179180                ylabel('m/year','FontSize',14)
    … …  
    184185                plot(starttime:endtime,sum(volume)/1000/1000/1000,'LineWidth',4)
    185186                hold on
    186                 ya = ylim;
     187                ya = ylim
    187188                plot([i i], ya, 'r', 'LineWidth',6)
    188                 ylim(ya); xlim([starttime endtime]);
     189                ylim(ya) xlim([starttime endtime])
    189190                title('Ice Volume','FontSize',14)
    190191                ylabel('km^3','FontSize',14)
    … …  
    195196                plot(starttime:endtime,mean(velocity)/1000, 'LineWidth', 4)
    196197                hold on
    197                 ya = ylim;
     198                ya = ylim
    198199                plot([i i], ya, 'r', 'LineWidth',6)
    199                 ylim(ya); xlim([starttime endtime]);
     200                ylim(ya) xlim([starttime endtime])
    200201                title('Mean Velocity','FontSize', 14)
    201202                ylabel('km/year','FontSize', 14)
    202203                xlabel('year','FontSize', 14)
    203204
    204                 set(gcf,'Renderer','zbuffer','color','white'); %fixes a bug on Mac OS X (not needed in future Matlab version)
     205                set(gcf,'Renderer','zbuffer','color','white') %fixes a bug on Mac OS X (not needed in future Matlab version)
    205206                if i==starttime,
    206207                        %initialize images and frame
    207                         frame=getframe(gcf);
    208                         [images,map]=rgb2ind(frame.cdata,256,'nodither');
    209                         images(1,1,1,length(ts))=0;
     208                        frame=getframe(gcf)
     209                        [images,map]=rgb2ind(frame.cdata,256,'nodither')
     210                        images(1,1,1,length(ts))=0
    210211                else
    211                         frame=getframe(gcf);
    212                         images(:,:,1,count) = rgb2ind(frame.cdata,map,'nodither');
     212                        frame=getframe(gcf)
     213                        images(:,:,1,count) = rgb2ind(frame.cdata,map,'nodither')
    213214                end
    214215
    215                 count = count+1;
     216                count = count+1
    216217
    217218        end
    218219
    219         filename='transawtooth2d.gif';
     220        filename='transawtooth2d.gif'
    220221        imwrite(images,map,filename,'DelayTime',1.0,'LoopCount',inf)
    221222        """
  • issm/trunk-jpl/test/NightlyRun/test1502.py

    r21060 r21408  
    11#Test Name: SquareShelfTranSawTooth3d
    2 import numpy
     2import numpy as np
    33import sys
    44from model import *
     5from socket import gethostname
    56from triangle import *
    67from setmask import *
    … …  
    89from setflowequation import *
    910from solve import *
    10 from MatlabFuncs import *
     11
    1112
    1213printingflag = False
    … …  
    1718md=setflowequation(md,'SSA','all')
    1819md.extrude(3,1.)
    19 md.cluster=generic('name',oshostname(),'np',2)
     20md.cluster=generic('name',gethostname(),'np',2)
    2021md.transient.isthermal=False
    2122
    … …  
    2526
    2627#Solve for thinning rate -> -1 * surface mass balance
    27 smb= 2.*numpy.ones((md.mesh.numberofvertices,1))
     28smb= 2.*np.ones((md.mesh.numberofvertices))
    2829md.smb.mass_balance= smb
    2930md.basalforcings.groundedice_melting_rate= smb
    … …  
    3839smb = md.smb.mass_balance
    3940
    40 #tooth= [ [ones(400,1)*(smb') - 10.]' [ones(400,1)*(smb')]' ];
    41 tooth=numpy.hstack((numpy.tile(smb-10.,(1,400)),numpy.tile(smb,(1,400))))
    42 #smb=[ [ones(399,1)*(smb')]' smb  tooth tooth];
    43 smb=numpy.hstack((numpy.tile(smb,(1,399)),smb,tooth,tooth))
    44 
    45 #md.smb.mass_balance= smb;
    46 #md.smb.mass_balance(end+1,:)=[1.:2000.];
    47 md.smb.mass_balance=numpy.vstack((smb,numpy.arange(1,2001)))
     41#tooth= [ [ones(400,1)*(smb') - 10.]' [ones(400,1)*(smb')]' ]
     42tooth=np.hstack((np.tile(smb-10.,(1,400)),np.tile(smb,(1,400))))
     43#smb=[ [ones(399,1)*(smb')]' smb  tooth tooth]
     44smb=np.hstack((np.tile(smb,(1,399)),smb,tooth,tooth))
     45
     46#md.smb.mass_balance= smb
     47#md.smb.mass_balance(end+1,:)=[1.:2000.]
     48md.smb.mass_balance=np.vstack((smb,np.arange(1,2001)))
    4849
    4950md=solve(md,'Transient')
    … …  
    112113        """
    113114
    114         starttime = 360;
    115         endtime = 2000;
    116         res = 40;
    117         ts = [starttime:res:endtime];
    118 
    119         index = md.mesh.elements;
    120         x1=md.mesh.x(index(:,1)); x2=md.mesh.x(index(:,2)); x3=md.mesh.x(index(:,3));
    121         y1=md.mesh.y(index(:,1)); y2=md.mesh.y(index(:,2)); y3=md.mesh.y(index(:,3));
    122         areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1)));
    123 
    124         thickness = [];
    125         volume = [];
    126         massbal = [];
    127         velocity = [];
     115        starttime = 360
     116        endtime = 2000
     117        res = 40
     118        ts = [starttime:res:endtime]
     119
     120        index = md.mesh.elements
     121        x1=md.mesh.x(index(:)) x2=md.mesh.x(index(:,2)) x3=md.mesh.x(index(:,3))
     122        y1=md.mesh.y(index(:)) y2=md.mesh.y(index(:,2)) y3=md.mesh.y(index(:,3))
     123        areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1)))
     124
     125        thickness = []
     126        volume = []
     127        massbal = []
     128        velocity = []
    128129        for t=starttime:endtime
    129                 thickness = [thickness (md.results.TransientSolution(t).Thickness)];
    130                 volume = [volume mean(md.results.TransientSolution(t).Thickness.value,2).*areas];
    131                 massbal = [massbal (md.results.TransientSolution(t).SmbMassBalance)];
    132                 velocity = [velocity (md.results.TransientSolution(t).Vel)];
     130                thickness = [thickness (md.results.TransientSolution(t).Thickness)]
     131                volume = [volume mean(md.results.TransientSolution(t).Thickness.value,2).*areas]
     132                massbal = [massbal (md.results.TransientSolution(t).SmbMassBalance)]
     133                velocity = [velocity (md.results.TransientSolution(t).Vel)]
    133134        end
    134135
    135136        figure('Position', [0 0 1060 1060])
    136137
    137         options = plotoptions('data','transient_movie','unit','km');
    138         options = options.list{1};
    139         options = checkplotoptions(md,options);
     138        options = plotoptions('data','transient_movie','unit','km')
     139        options = options.list{1}
     140        options = checkplotoptions(md,options)
    140141
    141142        %loop over the time steps
    142         results=md.results.TransientSolution;
    143         count = 1;
     143        results=md.results.TransientSolution
     144        count = 1
    144145        for i=ts
    145146
    146147                subplot(5,9,[28:31 37:40])
    147148                set(gca,'pos',get(gca,'pos')+[-0.08 -0.08 0.07 0.08])
    148                 field = 'Thickness';
     149                field = 'Thickness'
    149150
    150151                %process data
    151                 [x y z elements is2d isplanet]=processmesh(md,results(i).(field),options);
    152                 [data datatype]=processdata(md,results(i).(field),options);
    153 
    154                 titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year'];
     152                [x y z elements is2d isplanet]=processmesh(md,results(i).(field),options)
     153                [data datatype]=processdata(md,results(i).(field),options)
     154
     155                titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year']
    155156                plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
    156                 options=changefieldvalue(options,'title',titlestring);
    157                 options=addfielddefault(options,'colorbar',1);
    158                 options=changefieldvalue(options,'caxis',[0 max(max(thickness))]);
    159                 applyoptions(md,[],options);
     157                options=changefieldvalue(options,'title',titlestring)
     158                options=addfielddefault(options,'colorbar',1)
     159                options=changefieldvalue(options,'caxis',[0 max(max(thickness))])
     160                applyoptions(md,[],options)
    160161
    161162                subplot(5,9,[33:36 42:45])
    162163                set(gca,'pos',get(gca,'pos')+[-0.01 -0.08 0.07 0.08])
    163                 field = 'Vel';
     164                field = 'Vel'
    164165
    165166                %process data
    166                 [x y z elements is2d isplanet]=processmesh(md,results(i).(field),options);
    167                 [data datatype]=processdata(md,results(i).(field),options);
    168 
    169                 titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year'];
     167                [x y z elements is2d isplanet]=processmesh(md,results(i).(field),options)
     168                [data datatype]=processdata(md,results(i).(field),options)
     169
     170                titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year']
    170171                plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
    171                 options=changefieldvalue(options,'title',titlestring);
    172                 options=addfielddefault(options,'colorbar',1);
    173                 options=changefieldvalue(options,'caxis',[0 max(max(velocity))]);
    174                 applyoptions(md,[],options);
     172                options=changefieldvalue(options,'title',titlestring)
     173                options=addfielddefault(options,'colorbar',1)
     174                options=changefieldvalue(options,'caxis',[0 max(max(velocity))])
     175                applyoptions(md,[],options)
    175176
    176177                subplot(5,4,1:4)
    … …  
    179180                plot(starttime:endtime,mean(massbal),'k','LineWidth', 4)
    180181                hold on
    181                 ya = ylim;
     182                ya = ylim
    182183                plot([i i], ya, 'r', 'LineWidth',6)
    183                 ylim(ya); xlim([starttime endtime]);
     184                ylim(ya) xlim([starttime endtime])
    184185                title('Surface Mass Balance','FontSize',14)
    185186                ylabel('m/year','FontSize',14)
    … …  
    190191                plot(starttime:endtime,sum(volume)/1000/1000/1000,'LineWidth',4)
    191192                hold on
    192                 ya = ylim;
     193                ya = ylim
    193194                plot([i i], ya, 'r', 'LineWidth',6)
    194                 ylim(ya); xlim([starttime endtime]);
     195                ylim(ya) xlim([starttime endtime])
    195196                title('Ice Volume','FontSize',14)
    196197                ylabel('km^3','FontSize',14)
    … …  
    201202                plot(starttime:endtime,mean(velocity)/1000, 'LineWidth', 4)
    202203                hold on
    203                 ya = ylim;
     204                ya = ylim
    204205                plot([i i], ya, 'r', 'LineWidth',6)
    205                 ylim(ya); xlim([starttime endtime]);
     206                ylim(ya) xlim([starttime endtime])
    206207                title('Mean Velocity','FontSize', 14)
    207208                ylabel('km/year','FontSize', 14)
    208209                xlabel('year','FontSize', 14)
    209210
    210                 set(gcf,'Renderer','zbuffer','color','white'); %fixes a bug on Mac OS X (not needed in future Matlab version)
     211                set(gcf,'Renderer','zbuffer','color','white') %fixes a bug on Mac OS X (not needed in future Matlab version)
    211212                if i==starttime,
    212213                        %initialize images and frame
    213                         frame=getframe(gcf);
    214                         [images,map]=rgb2ind(frame.cdata,256,'nodither');
    215                         images(1,1,1,length(ts))=0;
     214                        frame=getframe(gcf)
     215                        [images,map]=rgb2ind(frame.cdata,256,'nodither')
     216                        images(1,1,1,length(ts))=0
    216217                else
    217                         frame=getframe(gcf);
    218                         images(:,:,1,count) = rgb2ind(frame.cdata,map,'nodither');
     218                        frame=getframe(gcf)
     219                        images(:,:,1,count) = rgb2ind(frame.cdata,map,'nodither')
    219220                end
    220221
    221                 count = count+1;
     222                count = count+1
    222223
    223224        end
    224225
    225         filename='transawtooth3d.gif';
     226        filename='transawtooth3d.gif'
    226227        imwrite(images,map,filename,'DelayTime',1.0,'LoopCount',inf)
    227228        """
  • issm/trunk-jpl/test/NightlyRun/test1601.py

    r21060 r21408  
    11#Test Name: SquareShelfSSA2dRotation
    2 import numpy
     2import numpy as np
    33import sys
    44from model import *
     5from socket import gethostname
    56from triangle import *
    67from setmask import *
    … …  
    89from setflowequation import *
    910from solve import *
    10 from MatlabFuncs import *
     11
    1112
    1213md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1415md=parameterize(md,'../Par/SquareShelf.py')
    1516md=setflowequation(md,'SSA','all')
    16 md.stressbalance.spcvx[numpy.nonzero(md.mesh.y>0.)]=float('NaN')
     17md.stressbalance.spcvx[np.nonzero(md.mesh.y>0.)]=float('NaN')
    1718md.initialization.vx[:]=0.
    1819md.initialization.vy[:]=0.
    19 md.initialization.vel=numpy.zeros_like(md.initialization.vx)
     20md.initialization.vel=np.zeros_like(md.initialization.vx)
    2021
    21 md.cluster=generic('name',oshostname(),'np',2)
     22md.cluster=generic('name',gethostname(),'np',2)
    2223md=solve(md,'Stressbalance')
    2324vel0=md.results.StressbalanceSolution.Vel
    2425
    25 theta=30.*numpy.pi/180.
     26theta=30.*np.pi/180.
    2627x=md.mesh.x
    2728y=md.mesh.y
    28 md.mesh.x=numpy.cos(theta)*x-numpy.sin(theta)*y
    29 md.mesh.y=numpy.sin(theta)*x+numpy.cos(theta)*y
     29md.mesh.x=np.cos(theta)*x-np.sin(theta)*y
     30md.mesh.y=np.sin(theta)*x+np.cos(theta)*y
    3031
    31 md.stressbalance.referential[:,0:3]=numpy.tile([numpy.cos(theta),numpy.sin(theta),0],(md.mesh.numberofvertices,1))
    32 md.stressbalance.referential[:,3: ]=numpy.tile([0,0,1],(md.mesh.numberofvertices,1))
     32md.stressbalance.referential[:,0:3]=np.tile([np.cos(theta),np.sin(theta),0],(md.mesh.numberofvertices))
     33md.stressbalance.referential[:,3: ]=np.tile([0,0,1],(md.mesh.numberofvertices))
    3334md=solve(md,'Stressbalance')
    3435vel1=md.results.StressbalanceSolution.Vel
    3536
    3637#plotmodel(md,'data',vel0,'data',vel1,'data',vel1-vel0,'title','Cartesian CS','title','Rotated CS','title','difference')
    37 print "Error between Cartesian and rotated CS: %g" % (numpy.max(numpy.abs(vel0-vel1))/(numpy.max(numpy.abs(vel0))+sys.float_info.epsilon))
     38print "Error between Cartesian and rotated CS: %g" % (np.max(np.abs(vel0-vel1))/(np.max(np.abs(vel0))+sys.float_info.epsilon))
    3839
    3940#Now, put CS back to normal except on the side where the spc are applied
    40 pos=numpy.nonzero(numpy.logical_or(x==0.,x==1000000.))[0]
     41pos=np.nonzero(np.logical_or.reduce(x==0.,x==1000000.))[0]
    4142md.stressbalance.referential[:]=float('NaN')
    42 md.stressbalance.referential[pos,0:3]=numpy.tile([numpy.cos(theta),numpy.sin(theta),0],(len(pos),1))
    43 md.stressbalance.referential[pos,3: ]=numpy.tile([0,0,1],(len(pos),1))
     43md.stressbalance.referential[pos,0:3]=np.tile([np.cos(theta),np.sin(theta),0],(len(pos)))
     44md.stressbalance.referential[pos,3: ]=np.tile([0,0,1],(len(pos)))
    4445md=solve(md,'Stressbalance')
    4546vel2=md.results.StressbalanceSolution.Vel
    4647
    4748#plotmodel(md,'data',vel0,'data',vel2,'data',vel2-vel0,'title','Cartesian CS','title','Rotated CS','title','difference')
    48 print "Error between Cartesian and rotated CS: %g" % (numpy.max(numpy.abs(vel0-vel2))/(numpy.max(numpy.abs(vel0))+sys.float_info.epsilon))
     49print "Error between Cartesian and rotated CS: %g" % (np.max(np.abs(vel0-vel2))/(np.max(np.abs(vel0))+sys.float_info.epsilon))
    4950
    5051#Fields and tolerances to track changes
  • issm/trunk-jpl/test/NightlyRun/test1602.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfHORotation
    2 import numpy
     2import numpy as np
    33import sys
    44from model import *
     5from socket import gethostname
    56from triangle import *
    67from setmask import *
    … …  
    89from setflowequation import *
    910from solve import *
    10 from MatlabFuncs import *
     11
    1112
    1213md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1516md.extrude(5,1.)
    1617md=setflowequation(md,'HO','all')
    17 md.stressbalance.spcvx[numpy.nonzero(md.mesh.y>0.)]=float('NaN')
     18md.stressbalance.spcvx[np.nonzero(md.mesh.y>0.)]=float('NaN')
    1819md.initialization.vx[:]=0.
    1920md.initialization.vy[:]=0.
    20 md.initialization.vel=numpy.zeros_like(md.initialization.vx)
     21md.initialization.vel=np.zeros_like(md.initialization.vx)
    2122
    22 md.cluster=generic('name',oshostname(),'np',3)
     23md.cluster=generic('name',gethostname(),'np',3)
    2324md=solve(md,'Stressbalance')
    2425vel0=md.results.StressbalanceSolution.Vel
    2526
    26 theta=30.*numpy.pi/180.
     27theta=30.*np.pi/180.
    2728x=md.mesh.x
    2829y=md.mesh.y
    29 md.mesh.x=numpy.cos(theta)*x-numpy.sin(theta)*y
    30 md.mesh.y=numpy.sin(theta)*x+numpy.cos(theta)*y
     30md.mesh.x=np.cos(theta)*x-np.sin(theta)*y
     31md.mesh.y=np.sin(theta)*x+np.cos(theta)*y
    3132
    32 md.stressbalance.referential[:,0:3]=numpy.tile([numpy.cos(theta),numpy.sin(theta),0],(md.mesh.numberofvertices,1))
    33 md.stressbalance.referential[:,3: ]=numpy.tile([0,0,1],(md.mesh.numberofvertices,1))
     33md.stressbalance.referential[:,0:3]=np.tile([np.cos(theta),np.sin(theta),0],(md.mesh.numberofvertices))
     34md.stressbalance.referential[:,3: ]=np.tile([0,0,1],(md.mesh.numberofvertices))
    3435md=solve(md,'Stressbalance')
    3536vel1=md.results.StressbalanceSolution.Vel
    3637
    3738#plotmodel(md,'data',vel0,'data',vel1,'data',vel1-vel0,'title','Cartesian CS','title','Rotated CS','title','difference','view#all',2)
    38 print "Error between Cartesian and rotated CS: %g" % (numpy.max(numpy.abs(vel0-vel1))/(numpy.max(numpy.abs(vel0))+sys.float_info.epsilon))
     39print "Error between Cartesian and rotated CS: %g" % (np.max(np.abs(vel0-vel1))/(np.max(np.abs(vel0))+sys.float_info.epsilon))
    3940
    4041#Fields and tolerances to track changes
    … …  
    4344field_values=[\
    4445        vel1, \
    45         ];
     46        ]
  • issm/trunk-jpl/test/NightlyRun/test2001.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedGia2d
    2 import numpy
     2import numpy as np
    33import copy
    44from model import *
     5from socket import gethostname
    56from triangle import *
    67from setmask import *
    … …  
    89from setflowequation import *
    910from solve import *
    10 from MatlabFuncs import *
     11
    1112
    1213#Define a model
    … …  
    2223md.timestepping.start_time=2400000 # 2,400 kyr
    2324md.timestepping.final_time=2500000 # 2,500 kyr
    24 md.geometry.thickness=numpy.hstack((\
    25                 numpy.vstack((md.geometry.thickness*0.0, 0.0)),\
    26                 numpy.vstack((md.geometry.thickness/2.0, 0.1)),\
    27                 numpy.vstack((md.geometry.thickness, 0.2)),\
    28                 numpy.vstack((md.geometry.thickness, 1.0)),\
    29                 numpy.vstack((md.geometry.thickness, md.timestepping.start_time)),\
    30                 ))
     25md.geometry.thickness=np.vstack((np.hstack((md.geometry.thickness*0.0, 0.0)),
     26                                                                                                                                 np.hstack((md.geometry.thickness/2.0, 0.1)),
     27                                                                                                                                 np.hstack((md.geometry.thickness, 0.2)),
     28                                                                                                                                 np.hstack((md.geometry.thickness, 1.0)),
     29                                                                                                                                 np.hstack((md.geometry.thickness, md.timestepping.start_time)))).T
    3130
    3231#Solve for GIA deflection
    33 md.cluster=generic('name',oshostname(),'np',3)
     32md.cluster=generic('name',gethostname(),'np',3)
    3433md=solve(md,'Gia')
    3534
    … …  
    3736field_names     =['GiaW','GiadWdt']
    3837field_tolerances=[1e-13,1e-13]
    39 field_values    =[\
    40                 md.results.GiaSolution.GiaW,\
    41                 md.results.GiaSolution.GiadWdt,\
    42                 ]
     38field_values    =[md.results.GiaSolution.GiaW,
     39                                                                        md.results.GiaSolution.GiadWdt]
    4340
  • issm/trunk-jpl/test/NightlyRun/test2002.py

    r21085 r21408  
    11#Test Name: EarthSlr
    2 from MatlabFuncs import *
    3 from PythonFuncs import *
    42from model import *
    5 from numpy import *
     3from socket import gethostname
     4import numpy as np
    65from parameterize import *
    76from solve import *
    … …  
    1211from love_numbers import *
    1312
    14 #mesh earth: 
    15 md=model() 
     13#mesh earth:
     14md=model()
    1615md.mesh=gmshplanet('radius',6.371012*10**3,'resolution',700.) #500 km resolution mesh
    1716
    1817#parameterize slr solution:
    19 #slr loading:  {{{
    20 md.slr.deltathickness=zeros((md.mesh.numberofelements,1))
    21 md.slr.sealevel=zeros((md.mesh.numberofvertices,1))
     18#slr loading:
     19md.slr.deltathickness=np.zeros((md.mesh.numberofelements))
     20md.slr.sealevel=np.zeros((md.mesh.numberofvertices))
    2221#antarctica
    23 late=numpy.sum(md.mesh.lat[md.mesh.elements-1],axis=1)/3
    24 longe=numpy.sum(md.mesh.long[md.mesh.elements-1],axis=1)/3
    25 pos=numpy.nonzero(late <-80)
     22late=np.sum(md.mesh.lat[md.mesh.elements-1],axis=1)/3
     23longe=np.sum(md.mesh.long[md.mesh.elements-1],axis=1)/3
     24pos=np.where(late <-80)
    2625md.slr.deltathickness[pos]=-100
    2726#greenland
    28 pos=numpy.nonzero(logical_and_n(late > 70,late < 80,longe>-60,longe<-30))
     27pos=np.where(np.logical_and.reduce((late > 70,late < 80,longe>-60,longe<-30)))
    2928md.slr.deltathickness[pos]=-100
    3029
    31 #elastic loading from love numbers: 
     30#elastic loading from love numbers:
    3231nlov=101
    33 md.slr.love_h = love_numbers('h')[:nlov];
    34 md.slr.love_k = love_numbers('k')[:nlov];
    35 md.slr.love_l = love_numbers('l')[:nlov];
     32md.slr.love_h = love_numbers('h')[:nlov]
     33md.slr.love_k = love_numbers('k')[:nlov]
     34md.slr.love_l = love_numbers('l')[:nlov]
    3635
    37 #}}}
    38 #mask:  {{{
    39 md.mask=maskpsl() # use maskpsl class (instead of mask) to store the ocean function as a ocean_levelset
    40 mask=gmtmask(md.mesh.lat,md.mesh.long)
     36#mask:
     37md.mask=maskpsl() # use maskpsl class (instead of mask) to store the ocean function as a ocean_levelset
     38mask=gmtmask(md.mesh.lat,md.mesh.long)
    4139
    42 icemask=ones((md.mesh.numberofvertices,1))
    43 pos=nonzero(mask==0)[0];  icemask[pos]=-1
    44 pos=nonzero(sum(mask[md.mesh.elements.astype(int)-1],axis=1)<3)[0]
     40icemask=np.ones((md.mesh.numberofvertices))
     41pos=np.where(mask==0)[0] 
     42icemask[pos]=-1
     43pos=np.where(np.sum(mask[md.mesh.elements.astype(int)-1],axis=1)<3)[0]
    4544icemask[md.mesh.elements[pos,:].astype(int)-1]=-1
    4645md.mask.ice_levelset=icemask
    4746
    48 md.mask.ocean_levelset=zeros((md.mesh.numberofvertices,1))
    49 pos=numpy.nonzero(md.mask.ice_levelset==1)
     47md.mask.ocean_levelset=np.zeros((md.mesh.numberofvertices))
     48pos=np.where(md.mask.ice_levelset==1)
    5049md.mask.ocean_levelset[pos]=1
    5150
    5251#make sure that the ice level set is all inclusive:
    53 md.mask.land_levelset=zeros((md.mesh.numberofvertices,1))
    54 md.mask.groundedice_levelset=-ones((md.mesh.numberofvertices,1))
     52md.mask.land_levelset=np.zeros((md.mesh.numberofvertices))
     53md.mask.groundedice_levelset=-np.ones((md.mesh.numberofvertices))
    5554
    56 #make sure wherever there is an ice load, that the mask is set to ice: 
    57 pos=nonzero(md.slr.deltathickness)[0];
     55#make sure wherever there is an ice load, that the mask is set to ice:
     56pos=np.nonzero(md.slr.deltathickness)[0]
    5857icemask[md.mesh.elements[pos,:]-1]=-1
    59 # }}}
     58
    6059
    6160#geometry
    6261di=md.materials.rho_ice/md.materials.rho_water
    63 md.geometry.thickness=ones((md.mesh.numberofvertices,1))
    64 md.geometry.surface=(1-di)*zeros((md.mesh.numberofvertices,1))
     62md.geometry.thickness=np.ones((md.mesh.numberofvertices))
     63md.geometry.surface=(1-di)*np.zeros((md.mesh.numberofvertices))
    6564md.geometry.base=md.geometry.surface-md.geometry.thickness
    6665md.geometry.bed=md.geometry.base
    6766
    6867#materials
    69 md.initialization.temperature=273.25*ones((md.mesh.numberofvertices,1))
     68md.initialization.temperature=273.25*np.ones((md.mesh.numberofvertices))
    7069md.materials.rheology_B=paterson(md.initialization.temperature)
    71 md.materials.rheology_n=3*ones((md.mesh.numberofelements,1))
     70md.materials.rheology_n=3*np.ones((md.mesh.numberofelements))
    7271
    7372#Miscellaneous
    … …  
    7574
    7675#Solution parameters
    77 md.slr.reltol=NaN
     76md.slr.reltol=np.nan
    7877md.slr.abstol=1e-3
    7978
    … …  
    8281md.slr.elastic=0
    8382md=solve(md,'Sealevelrise')
    84 Seustatic=md.results.SealevelriseSolution.Sealevel;
     83Seustatic=md.results.SealevelriseSolution.Sealevel
    8584
    8685#eustatic + rigid run:
    … …  
    8887md.slr.elastic=0
    8988md=solve(md,'Sealevelrise')
    90 Srigid=md.results.SealevelriseSolution.Sealevel;
     89Srigid=md.results.SealevelriseSolution.Sealevel
    9190
    9291#eustatic + rigid + elastic run:
    … …  
    9493md.slr.elastic=1
    9594md=solve(md,'Sealevelrise')
    96 Selastic=md.results.SealevelriseSolution.Sealevel;
     95Selastic=md.results.SealevelriseSolution.Sealevel
    9796
    9897#eustatic + rigid + elastic + rotation run:
    9998md.slr.rigid=1
    10099md.slr.elastic=1
    101 md.slr.rotation=1;
    102 md=solve(md,'Sealevelrise');
    103 Srotation=md.results.SealevelriseSolution.Sealevel;
     100md.slr.rotation=1
     101md=solve(md,'Sealevelrise')
     102Srotation=md.results.SealevelriseSolution.Sealevel
    104103
    105104#Fields and tolerances to track changes
  • issm/trunk-jpl/test/NightlyRun/test201.py

    r21060 r21408  
    11#Test Name: SquareShelfStressSSA2d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910from ContourToMesh import *
    1011
    … …  
    1314md=parameterize(md,'../Par/SquareShelf.py')
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'Stressbalance')
    1718
  • issm/trunk-jpl/test/NightlyRun/test202.py

    r21060 r21408  
    11#Test Name: SquareShelfStressSSA3d
    2 from MatlabFuncs import *
     2
    33from model import *
    4 from numpy import *
     4from socket import gethostname
     5import numpy as np
    56from triangle import *
    67from setmask import *
    … …  
    1516md.extrude(3,2.)
    1617md=setflowequation(md,'SSA','all')
    17 md.cluster=generic('name',oshostname(),'np',3)
     18md.cluster=generic('name',gethostname(),'np',3)
    1819md=solve(md,'Stressbalance')
    1920
  • issm/trunk-jpl/test/NightlyRun/test203.py

    r21060 r21408  
    11#Test Name: SquareShelfStressHO
    2 from MatlabFuncs import *
     2
    33from model import *
    4 from numpy import *
     4from socket import gethostname
     5import numpy as np
    56from triangle import *
    67from setmask import *
    … …  
    1516md.extrude(3,2.)
    1617md=setflowequation(md,'HO','all')
    17 md.cluster=generic('name',oshostname(),'np',3)
     18md.cluster=generic('name',gethostname(),'np',3)
    1819md=solve(md,'Stressbalance')
    1920
  • issm/trunk-jpl/test/NightlyRun/test204.py

    r21060 r21408  
    11#Test Name: SquareShelfStressFS
    2 from MatlabFuncs import *
     2
    33from model import *
    4 from numpy import *
     4from socket import gethostname
     5import numpy as np
    56from triangle import *
    67from setmask import *
    … …  
    1516md.extrude(3,2.)
    1617md=setflowequation(md,'FS','all')
    17 md.cluster=generic('name',oshostname(),'np',3)
    18 md.stressbalance.shelf_dampening=1;
    19 md.timestepping.time_step=0;
     18md.cluster=generic('name',gethostname(),'np',3)
     19md.stressbalance.shelf_dampening=1
     20md.timestepping.time_step=0
    2021md1=solve(md,'Stressbalance')
    21 md.stressbalance.shelf_dampening=0;
     22md.stressbalance.shelf_dampening=0
    2223md=solve(md,'Stressbalance')
    2324
  • issm/trunk-jpl/test/NightlyRun/test205.py

    r21060 r21408  
    11#Test Name: SquareShelfStressMHOPenalties
    2 from MatlabFuncs import *
     2
    33from model import *
    4 from numpy import *
     4from socket import gethostname
     5import numpy as np
    56from triangle import *
    67from setmask import *
    … …  
    1516md.extrude(3,2.)
    1617md=setflowequation(md,'HO','../Exp/SquareHalfRight.exp','fill','SSA','coupling','penalties')
    17 md.cluster=generic('name',oshostname(),'np',3)
     18md.cluster=generic('name',gethostname(),'np',3)
    1819md=solve(md,'Stressbalance')
    1920
  • issm/trunk-jpl/test/NightlyRun/test206.py

    r21060 r21408  
    11#Test Name: SquareShelfTherStea
    2 from MatlabFuncs import *
     2
    33from model import *
    4 from numpy import *
     4from socket import gethostname
     5import numpy as np
    56from triangle import *
    67from setmask import *
    … …  
    1617md=setflowequation(md,'SSA','all')
    1718md.timestepping.time_step=0
    18 md.cluster=generic('name',oshostname(),'np',3)
     19md.cluster=generic('name',gethostname(),'np',3)
    1920md=solve(md,'Thermal')
    2021
    … …  
    2425field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
    2526field_tolerances=[1e-13,5e-6]
    26 field_values=[\
    27         md.results.ThermalSolution.Temperature,\
    28         md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate,\
    29         ]
     27field_values=[md.results.ThermalSolution.Temperature,
     28                                                        md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate]
  • issm/trunk-jpl/test/NightlyRun/test207.py

    r21060 r21408  
    11#Test Name: SquareShelfTherTran
    2 from MatlabFuncs import *
     2
    33from model import *
    4 from numpy import *
     4from socket import gethostname
     5import numpy as np
    56from triangle import *
    67from setmask import *
    … …  
    1516md.extrude(3,1.)
    1617md=setflowequation(md,'SSA','all')
    17 md.cluster=generic('name',oshostname(),'np',3)
     18md.cluster=generic('name',gethostname(),'np',3)
    1819md.transient.isstressbalance=False
    1920md.transient.ismasstransport=False
  • issm/trunk-jpl/test/NightlyRun/test208.py

    r21060 r21408  
    11#Test Name: SquareShelfTranSSA2d
    2 from MatlabFuncs import *
     2
    33from model import *
    4 from numpy import *
     4from socket import gethostname
     5import numpy as np
    56from triangle import *
    67from setmask import *
    … …  
    1516md.basalforcings.floatingice_melting_rate[:]=1.
    1617md=setflowequation(md,'SSA','all')
    17 md.cluster=generic('name',oshostname(),'np',3)
     18md.cluster=generic('name',gethostname(),'np',3)
    1819md.transient.requested_outputs=['default','FloatingArea','GroundedArea','TotalFloatingBmb','TotalGroundedBmb']
    1920md=solve(md,'Transient')
  • issm/trunk-jpl/test/NightlyRun/test209.py

    r21060 r21408  
    11#Test Name: SquareShelfTranSSA3d
    2 from MatlabFuncs import *
     2
    33from model import *
    4 from numpy import *
     4from socket import gethostname
     5import numpy as np
    56from triangle import *
    67from setmask import *
    … …  
    1516md.extrude(3,1.)
    1617md=setflowequation(md,'SSA','all')
    17 md.cluster=generic('name',oshostname(),'np',3)
     18md.cluster=generic('name',gethostname(),'np',3)
    1819md=solve(md,'Transient')
    1920
  • issm/trunk-jpl/test/NightlyRun/test210.py

    r21060 r21408  
    11#Test Name: SquareShelfTranHO
    2 from MatlabFuncs import *
     2
    33from model import *
    4 from numpy import *
     4from socket import gethostname
     5import numpy as np
    56from triangle import *
    67from setmask import *
    … …  
    1516md.extrude(3,1.)
    1617md=setflowequation(md,'HO','all')
    17 md.cluster=generic('name',oshostname(),'np',3)
     18md.cluster=generic('name',gethostname(),'np',3)
    1819md=solve(md,'Transient')
    1920
  • issm/trunk-jpl/test/NightlyRun/test211.py

    r21060 r21408  
    11#Test Name: SquareShelfTranFS
    2 from MatlabFuncs import *
     2
    33from model import *
    4 from numpy import *
     4from socket import gethostname
     5import numpy as np
    56from triangle import *
    67from setmask import *
    … …  
    1617md=setflowequation(md,'FS','all')
    1718md.stressbalance.reltol=NaN
    18 md.cluster=generic('name',oshostname(),'np',3)
     19md.cluster=generic('name',gethostname(),'np',3)
    1920md=solve(md,'Transient')
    2021
  • issm/trunk-jpl/test/NightlyRun/test212.py

    r21060 r21408  
    11#Test Name: SquareShelfCMBSSA2d
    2 from MatlabFuncs import *
     2
    33from model import *
    4 from numpy import *
     4from socket import gethostname
     5import numpy as np
    56from triangle import *
    67from setmask import *
    … …  
    2021md.inversion.iscontrol=1
    2122md.inversion.control_parameters=['MaterialsRheologyBbar']
    22 md.inversion.min_parameters=10**6*ones((md.mesh.numberofvertices,1))
    23 md.inversion.max_parameters=2.*10**9*ones((md.mesh.numberofvertices,1))
     23md.inversion.min_parameters=10**6*ones((md.mesh.numberofvertices))
     24md.inversion.max_parameters=2.*10**9*ones((md.mesh.numberofvertices))
    2425md.inversion.nsteps=2
    2526md.inversion.cost_functions=[101]
    26 md.inversion.cost_functions_coefficients=ones((md.mesh.numberofvertices,1))
    27 md.inversion.gradient_scaling=10**7*ones((md.inversion.nsteps,1))
    28 md.inversion.maxiter_per_step=2.*ones((md.inversion.nsteps,1))
    29 md.inversion.step_threshold=0.3*ones((md.inversion.nsteps,1))
     27md.inversion.cost_functions_coefficients=ones((md.mesh.numberofvertices))
     28md.inversion.gradient_scaling=10**7*ones((md.inversion.nsteps))
     29md.inversion.maxiter_per_step=2.*ones((md.inversion.nsteps))
     30md.inversion.step_threshold=0.3*ones((md.inversion.nsteps))
    3031md.inversion.vx_obs=md.initialization.vx
    3132md.inversion.vy_obs=md.initialization.vy
    3233
    3334
    34 md.cluster=generic('name',oshostname(),'np',3)
     35md.cluster=generic('name',gethostname(),'np',3)
    3536md=solve(md,'Stressbalance')
    3637
  • issm/trunk-jpl/test/NightlyRun/test213.py

    r21060 r21408  
    11#Test Name: SquareShelfCMBSSA3d
    2 from MatlabFuncs import *
     2
    33from model import *
    4 from numpy import *
     4from socket import gethostname
     5import numpy as np
    56from triangle import *
    67from setmask import *
    … …  
    2122md.inversion.iscontrol=1
    2223md.inversion.control_parameters=['MaterialsRheologyBbar']
    23 md.inversion.min_parameters=10**6*ones((md.mesh.numberofvertices,1))
    24 md.inversion.max_parameters=2.*10**9*ones((md.mesh.numberofvertices,1))
     24md.inversion.min_parameters=10**6*ones((md.mesh.numberofvertices))
     25md.inversion.max_parameters=2.*10**9*ones((md.mesh.numberofvertices))
    2526md.inversion.nsteps=2
    2627md.inversion.cost_functions=[101]
    27 md.inversion.cost_functions_coefficients=ones((md.mesh.numberofvertices,1))
    28 md.inversion.gradient_scaling=10**7*ones((md.inversion.nsteps,1))
    29 md.inversion.maxiter_per_step=2.*ones((md.inversion.nsteps,1))
    30 md.inversion.step_threshold=0.3*ones((md.inversion.nsteps,1))
     28md.inversion.cost_functions_coefficients=ones((md.mesh.numberofvertices))
     29md.inversion.gradient_scaling=10**7*ones((md.inversion.nsteps))
     30md.inversion.maxiter_per_step=2.*ones((md.inversion.nsteps))
     31md.inversion.step_threshold=0.3*ones((md.inversion.nsteps))
    3132md.inversion.vx_obs=md.initialization.vx
    3233md.inversion.vy_obs=md.initialization.vy
    3334
    3435
    35 md.cluster=generic('name',oshostname(),'np',3)
     36md.cluster=generic('name',gethostname(),'np',3)
    3637md=solve(md,'Stressbalance')
    3738
  • issm/trunk-jpl/test/NightlyRun/test214.py

    r21060 r21408  
    11#Test Name: SquareShelfCMBHO
    2 from MatlabFuncs import *
     2
    33from model import *
    4 from numpy import *
     4from socket import gethostname
     5import numpy as np
    56from triangle import *
    67from setmask import *
    … …  
    2122md.inversion.iscontrol=1
    2223md.inversion.control_parameters=['MaterialsRheologyBbar']
    23 md.inversion.min_parameters=10**6*ones((md.mesh.numberofvertices,1))
    24 md.inversion.max_parameters=2.*10**9*ones((md.mesh.numberofvertices,1))
     24md.inversion.min_parameters=10**6*ones((md.mesh.numberofvertices))
     25md.inversion.max_parameters=2.*10**9*ones((md.mesh.numberofvertices))
    2526md.inversion.nsteps=2
    2627md.inversion.cost_functions=[101]
    27 md.inversion.cost_functions_coefficients=ones((md.mesh.numberofvertices,1))
    28 md.inversion.gradient_scaling=10**7*ones((md.inversion.nsteps,1))
    29 md.inversion.maxiter_per_step=2.*ones((md.inversion.nsteps,1))
    30 md.inversion.step_threshold=0.3*ones((md.inversion.nsteps,1))
     28md.inversion.cost_functions_coefficients=ones((md.mesh.numberofvertices))
     29md.inversion.gradient_scaling=10**7*ones((md.inversion.nsteps))
     30md.inversion.maxiter_per_step=2.*ones((md.inversion.nsteps))
     31md.inversion.step_threshold=0.3*ones((md.inversion.nsteps))
    3132md.inversion.vx_obs=md.initialization.vx
    3233md.inversion.vy_obs=md.initialization.vy
    3334
    3435
    35 md.cluster=generic('name',oshostname(),'np',3)
     36md.cluster=generic('name',gethostname(),'np',3)
    3637md=solve(md,'Stressbalance')
    3738
  • issm/trunk-jpl/test/NightlyRun/test215.py

    r21060 r21408  
    11#Test Name: SquareShelfCMBFS
    2 from MatlabFuncs import *
     2
    33from model import *
    4 from numpy import *
     4from socket import gethostname
     5import numpy as np
    56from triangle import *
    67from setmask import *
    … …  
    2122md.inversion.iscontrol=1
    2223md.inversion.control_parameters=['MaterialsRheologyBbar']
    23 md.inversion.min_parameters=10**6*ones((md.mesh.numberofvertices,1))
    24 md.inversion.max_parameters=2.*10**9*ones((md.mesh.numberofvertices,1))
     24md.inversion.min_parameters=10**6*ones((md.mesh.numberofvertices))
     25md.inversion.max_parameters=2.*10**9*ones((md.mesh.numberofvertices))
    2526md.inversion.nsteps=2
    2627md.inversion.cost_functions=[101]
    27 md.inversion.cost_functions_coefficients=ones((md.mesh.numberofvertices,1))
    28 md.inversion.gradient_scaling=10**7*ones((md.inversion.nsteps,1))
    29 md.inversion.maxiter_per_step=2.*ones((md.inversion.nsteps,1))
    30 md.inversion.step_threshold=0.3*ones((md.inversion.nsteps,1))
     28md.inversion.cost_functions_coefficients=ones((md.mesh.numberofvertices))
     29md.inversion.gradient_scaling=10**7*ones((md.inversion.nsteps))
     30md.inversion.maxiter_per_step=2.*ones((md.inversion.nsteps))
     31md.inversion.step_threshold=0.3*ones((md.inversion.nsteps))
    3132md.inversion.vx_obs=md.initialization.vx
    3233md.inversion.vy_obs=md.initialization.vy
    3334
    3435
    35 md.cluster=generic('name',oshostname(),'np',3)
     36md.cluster=generic('name',gethostname(),'np',3)
    3637md=solve(md,'Stressbalance')
    3738
  • issm/trunk-jpl/test/NightlyRun/test216.py

    r21060 r21408  
    11#Test Name: SquareShelfStressSSA2dRift
    2 from MatlabFuncs import *
     2
    33from model import *
    4 from numpy import *
     4from socket import gethostname
     5import numpy as np
    56from triangle import *
    67from meshprocessrifts import *
    … …  
    1617md=parameterize(md,'../Par/SquareShelf2.py')
    1718md=setflowequation(md,'SSA','all')
    18 md.cluster=generic('name',oshostname(),'np',3)
     19md.cluster=generic('name',gethostname(),'np',3)
    1920
    2021# rift settings
  • issm/trunk-jpl/test/NightlyRun/test217.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrained
    2 from MatlabFuncs import *
     2
    33from model import *
    4 from numpy import *
     4from socket import gethostname
     5import numpy as np
    56from triangle import *
    67from setmask import *
    … …  
    1516md=parameterize(md,'../Par/SquareShelf.py')
    1617md=setflowequation(md,'SSA','all')
    17 md.cluster=generic('name',oshostname(),'np',3)
     18md.cluster=generic('name',gethostname(),'np',3)
    1819
    1920# redo the parameter file for this special shelf.
    … …  
    3334
    3435h=1000.
    35 md.geometry.thickness=h*ones((md.mesh.numberofvertices,1))
     36md.geometry.thickness=h*ones((md.mesh.numberofvertices))
    3637md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
    3738md.geometry.surface=md.geometry.base+md.geometry.thickness
    3839
    3940# Initial velocity and pressure
    40 md.initialization.vx=zeros((md.mesh.numberofvertices,1))
    41 md.initialization.vy=zeros((md.mesh.numberofvertices,1))
    42 md.initialization.vz=zeros((md.mesh.numberofvertices,1))
    43 md.initialization.pressure=zeros((md.mesh.numberofvertices,1))
     41md.initialization.vx=zeros((md.mesh.numberofvertices))
     42md.initialization.vy=zeros((md.mesh.numberofvertices))
     43md.initialization.vz=zeros((md.mesh.numberofvertices))
     44md.initialization.pressure=zeros((md.mesh.numberofvertices))
    4445
    4546# Materials
    46 md.initialization.temperature=(273.-20.)*ones((md.mesh.numberofvertices,1))
     47md.initialization.temperature=(273.-20.)*ones((md.mesh.numberofvertices))
    4748md.materials.rheology_B=paterson(md.initialization.temperature)
    48 md.materials.rheology_n=3.*ones((md.mesh.numberofelements,1))
     49md.materials.rheology_n=3.*ones((md.mesh.numberofelements))
    4950
    5051# Boundary conditions:
    51 md.stressbalance.spcvx=float(nan)*ones((md.mesh.numberofvertices,1))
    52 md.stressbalance.spcvy=float(nan)*ones((md.mesh.numberofvertices,1))
    53 md.stressbalance.spcvz=float(nan)*ones((md.mesh.numberofvertices,1))
     52md.stressbalance.spcvx=float(nan)*ones((md.mesh.numberofvertices))
     53md.stressbalance.spcvy=float(nan)*ones((md.mesh.numberofvertices))
     54md.stressbalance.spcvz=float(nan)*ones((md.mesh.numberofvertices))
    5455
    5556# constrain flanks to 0 normal velocity
    56 pos=numpy.nonzero(numpy.logical_or(md.mesh.x==xmin,md.mesh.x==xmax))
     57pos=np.nonzero(np.logical_or.reduce(md.mesh.x==xmin,md.mesh.x==xmax))
    5758md.stressbalance.spcvx[pos]=0
    5859md.stressbalance.spcvz[pos]=float(nan)
    5960
    6061# constrain grounding line to 0 velocity
    61 pos=numpy.nonzero(md.mesh.y==ymin)
     62pos=np.nonzero(md.mesh.y==ymin)
    6263md.stressbalance.spcvx[pos]=0
    6364md.stressbalance.spcvy[pos]=0
    … …  
    6566# icefront
    6667nodeonicefront=zeros(md.mesh.numberofvertices)
    67 pos=numpy.nonzero(md.mesh.y==ymax)
     68pos=np.nonzero(md.mesh.y==ymax)
    6869nodeonicefront[pos]=1
    6970md.mask.ice_levelset=-1+nodeonicefront
    … …  
    7273
    7374# create analytical solution: strain rate is constant = ((rho_ice*g*h)/4B)^3 (Paterson, 4th Edition, page 292.
    74 # ey_c=(md.materials.rho_ice*md.constants.g*(1-di)*md.geometry.thickness./(4*md.materials.rheology_B)).^3;
    75 # vy_c=ey_c.*md.mesh.y*md.constants.yts;
     75# ey_c=(md.materials.rho_ice*md.constants.g*(1-di)*md.geometry.thickness./(4*md.materials.rheology_B)).^3
     76# vy_c=ey_c.*md.mesh.y*md.constants.yts
    7677
    7778# Fields and tolerances to track changes
  • issm/trunk-jpl/test/NightlyRun/test219.py

    r21060 r21408  
    11#Test Name: SquareShelfStressSSAHOTiling
    2 from MatlabFuncs import *
     2
    33from model import *
    4 from numpy import *
     4from socket import gethostname
     5import numpy as np
    56from triangle import *
    67from setmask import *
    … …  
    1516md.extrude(3,2.)
    1617md=setflowequation(md,'HO','../Exp/SquareHalfRight.exp','fill','SSA')
    17 md.cluster=generic('name',oshostname(),'np',3)
     18md.cluster=generic('name',gethostname(),'np',3)
    1819md=solve(md,'Stressbalance')
    1920
  • issm/trunk-jpl/test/NightlyRun/test220.py

    r21060 r21408  
    11#Test Name: SquareShelfStressHOFS3dTiling
    2 from MatlabFuncs import *
     2
    33from model import *
    4 from numpy import *
     4from socket import gethostname
     5import numpy as np
    56from triangle import *
    67from setmask import *
    … …  
    1516md.extrude(2,1.)
    1617md=setflowequation(md,'FS','../Exp/SquareHalfRight.exp','fill','HO')
    17 md.cluster=generic('name',oshostname(),'np',3)
     18md.cluster=generic('name',gethostname(),'np',3)
    1819md=solve(md,'Stressbalance')
    1920
  • issm/trunk-jpl/test/NightlyRun/test221.py

    r21060 r21408  
    11#Test Name: SquareShelfStressSSAFS3dTiling
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',120000.)
    … …  
    1314md.extrude(2,1.)
    1415md=setflowequation(md,'FS','../Exp/SquareHalfRight.exp','fill','SSA')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md.stressbalance.viscosity_overshoot=0
    1718md=solve(md,'Stressbalance')
  • issm/trunk-jpl/test/NightlyRun/test222.py

    r21060 r21408  
    11#Test Name: SquareShelfStressSSA2dTransientIncrHydro
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1213md=parameterize(md,'../Par/SquareShelf.py')
    1314md=setflowequation(md,'SSA','all')
    14 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1516md.masstransport.hydrostatic_adjustment='Incremental'
    1617md=solve(md,'Transient')
  • issm/trunk-jpl/test/NightlyRun/test223.py

    r21060 r21408  
    11#Test Name: SquareShelfStressSSA2dTransientIncrNonHydro
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1415md.geometry.base=md.geometry.base+50.
    1516md.geometry.surface=md.geometry.surface+50.
    16 md.cluster=generic('name',oshostname(),'np',1)
     17md.cluster=generic('name',gethostname(),'np',1)
    1718md.masstransport.hydrostatic_adjustment='Incremental'
    1819md=solve(md,'Transient')
  • issm/trunk-jpl/test/NightlyRun/test224.py

    r21060 r21408  
    11#Test Name: SquareShelfStressHOTransientIncrHydro
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',200000.)
    … …  
    1314md.extrude(3,1.)
    1415md=setflowequation(md,'HO','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md.masstransport.hydrostatic_adjustment='Incremental'
    1718md=solve(md,'Transient')
  • issm/trunk-jpl/test/NightlyRun/test225.py

    r21060 r21408  
    11#Test Name: SquareShelfStressHOTransientIncrNonHydro
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',200000.)
    … …  
    1516md.extrude(3,1.)
    1617md=setflowequation(md,'HO','all')
    17 md.cluster=generic('name',oshostname(),'np',3)
     18md.cluster=generic('name',gethostname(),'np',3)
    1819md.masstransport.hydrostatic_adjustment='Incremental'
    1920md=solve(md,'Transient')
  • issm/trunk-jpl/test/NightlyRun/test226.py

    r21060 r21408  
    11#Test Name: SquareShelfTranCflSSA2d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1213md=parameterize(md,'../Par/SquareShelf.py')
    1314md=setflowequation(md,'SSA','all')
    14 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1516md.timestepping.time_adapt=1.
    1617md.timestepping.final_time=15.
  • issm/trunk-jpl/test/NightlyRun/test227.py

    r21060 r21408  
    11#Test Name: SquareShelfTranCflHO
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',200000.)
    … …  
    1314md.extrude(3,1.)
    1415md=setflowequation(md,'HO','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md.timestepping.time_adapt=1.
    1718md.timestepping.final_time=20.
  • issm/trunk-jpl/test/NightlyRun/test228.py

    r21060 r21408  
    11#Test Name: SquareShelfTranForceNeg2d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1314md=parameterize(md,'../Par/SquareShelf.py')
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617
    1718md.timestepping.time_step=1.
    … …  
    2021
    2122#Set up transient
    22 smb=numpy.ones((md.mesh.numberofvertices,1))*3.6
    23 smb=numpy.hstack((smb,smb*-1.))
     23smb=np.ones((md.mesh.numberofvertices))*3.6
     24smb=np.vstack((smb,smb*-1.)).T
    2425
    25 md.smb.mass_balance=numpy.vstack((smb,[1.5,3.]))
     26md.smb.mass_balance=np.vstack((smb,[1.5,3.]))
    2627md.transient.isthermal=False
    2728
    … …  
    2930
    3031#Fields and tolerances to track changes
    31 field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1', \
    32         'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2', \
    33         'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3', \
    34         'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
    35 field_tolerances=[1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
    36         1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
    37         1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
    38         1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
    39 field_values=[\
    40         md.results.TransientSolution[0].Vx,\
    41         md.results.TransientSolution[0].Vy,\
    42         md.results.TransientSolution[0].Vel,\
    43         md.results.TransientSolution[0].Pressure,\
    44         md.results.TransientSolution[0].Base,\
    45         md.results.TransientSolution[0].Surface,\
    46         md.results.TransientSolution[0].Thickness,\
    47         md.results.TransientSolution[0].SmbMassBalance,\
    48         md.results.TransientSolution[1].Vx,\
    49         md.results.TransientSolution[1].Vy,\
    50         md.results.TransientSolution[1].Vel,\
    51         md.results.TransientSolution[1].Pressure,\
    52         md.results.TransientSolution[1].Base,\
    53         md.results.TransientSolution[1].Surface,\
    54         md.results.TransientSolution[1].Thickness,\
    55         md.results.TransientSolution[1].SmbMassBalance,\
    56         md.results.TransientSolution[2].Vx,\
    57         md.results.TransientSolution[2].Vy,\
    58         md.results.TransientSolution[2].Vel,\
    59         md.results.TransientSolution[2].Pressure,\
    60         md.results.TransientSolution[2].Base,\
    61         md.results.TransientSolution[2].Surface,\
    62         md.results.TransientSolution[2].Thickness,\
    63         md.results.TransientSolution[2].SmbMassBalance,\
    64         md.results.TransientSolution[3].Vx,\
    65         md.results.TransientSolution[3].Vy,\
    66         md.results.TransientSolution[3].Vel,\
    67         md.results.TransientSolution[3].Pressure,\
    68         md.results.TransientSolution[3].Base,\
    69         md.results.TransientSolution[3].Surface,\
    70         md.results.TransientSolution[3].Thickness,\
    71         md.results.TransientSolution[3].SmbMassBalance,\
    72         ]
     32field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',
     33                                                 'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',
     34                                                 'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3',
     35                                                 'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
     36field_tolerances=[1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
     37                                                                        1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
     38                                                                        1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
     39                                                                        1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
     40field_values=[md.results.TransientSolution[0].Vx,
     41                                                        md.results.TransientSolution[0].Vy,
     42                                                        md.results.TransientSolution[0].Vel,
     43                                                        md.results.TransientSolution[0].Pressure,
     44                                                        md.results.TransientSolution[0].Base,
     45                                                        md.results.TransientSolution[0].Surface,
     46                                                        md.results.TransientSolution[0].Thickness,
     47                                                        md.results.TransientSolution[0].SmbMassBalance,
     48                                                        md.results.TransientSolution[1].Vx,
     49                                                        md.results.TransientSolution[1].Vy,
     50                                                        md.results.TransientSolution[1].Vel,
     51                                                        md.results.TransientSolution[1].Pressure,
     52                                                        md.results.TransientSolution[1].Base,
     53                                                        md.results.TransientSolution[1].Surface,
     54                                                        md.results.TransientSolution[1].Thickness,
     55                                                        md.results.TransientSolution[1].SmbMassBalance,
     56                                                        md.results.TransientSolution[2].Vx,
     57                                                        md.results.TransientSolution[2].Vy,
     58                                                        md.results.TransientSolution[2].Vel,
     59                                                        md.results.TransientSolution[2].Pressure,
     60                                                        md.results.TransientSolution[2].Base,
     61                                                        md.results.TransientSolution[2].Surface,
     62                                                        md.results.TransientSolution[2].Thickness,
     63                                                        md.results.TransientSolution[2].SmbMassBalance,
     64                                                        md.results.TransientSolution[3].Vx,
     65                                                        md.results.TransientSolution[3].Vy,
     66                                                        md.results.TransientSolution[3].Vel,
     67                                                        md.results.TransientSolution[3].Pressure,
     68                                                        md.results.TransientSolution[3].Base,
     69                                                        md.results.TransientSolution[3].Surface,
     70                                                        md.results.TransientSolution[3].Thickness,
     71                                                        md.results.TransientSolution[3].SmbMassBalance]
  • issm/trunk-jpl/test/NightlyRun/test229.py

    r21060 r21408  
    11#Test Name: SquareShelfTranForcePos2d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1314md=parameterize(md,'../Par/SquareShelf.py')
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617
    1718md.timestepping.time_step=1.
    … …  
    2021
    2122#Set up transient
    22 smb=numpy.ones((md.mesh.numberofvertices,1))*3.6
    23 smb=numpy.hstack((smb,smb*2.))
     23smb=np.ones((md.mesh.numberofvertices))*3.6
     24smb=np.vstack((smb,smb*2.)).T
    2425
    25 md.smb.mass_balance=numpy.vstack((smb,[1.5,3.]))
     26md.smb.mass_balance=np.vstack((smb,[1.5,3.]))
    2627md.transient.isthermal=False
    2728
    … …  
    2930
    3031#Fields and tolerances to track changes
    31 field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1', \
    32         'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2', \
    33         'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3', \
    34         'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
    35 field_tolerances=[1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
    36         1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
    37         1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
    38         1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
    39 field_values=[\
    40         md.results.TransientSolution[0].Vx,\
    41         md.results.TransientSolution[0].Vy,\
    42         md.results.TransientSolution[0].Vel,\
    43         md.results.TransientSolution[0].Pressure,\
    44         md.results.TransientSolution[0].Base,\
    45         md.results.TransientSolution[0].Surface,\
    46         md.results.TransientSolution[0].Thickness,\
    47         md.results.TransientSolution[0].SmbMassBalance,\
    48         md.results.TransientSolution[1].Vx,\
    49         md.results.TransientSolution[1].Vy,\
    50         md.results.TransientSolution[1].Vel,\
    51         md.results.TransientSolution[1].Pressure,\
    52         md.results.TransientSolution[1].Base,\
    53         md.results.TransientSolution[1].Surface,\
    54         md.results.TransientSolution[1].Thickness,\
    55         md.results.TransientSolution[1].SmbMassBalance,\
    56         md.results.TransientSolution[2].Vx,\
    57         md.results.TransientSolution[2].Vy,\
    58         md.results.TransientSolution[2].Vel,\
    59         md.results.TransientSolution[2].Pressure,\
    60         md.results.TransientSolution[2].Base,\
    61         md.results.TransientSolution[2].Surface,\
    62         md.results.TransientSolution[2].Thickness,\
    63         md.results.TransientSolution[2].SmbMassBalance,\
    64         md.results.TransientSolution[3].Vx,\
    65         md.results.TransientSolution[3].Vy,\
    66         md.results.TransientSolution[3].Vel,\
    67         md.results.TransientSolution[3].Pressure,\
    68         md.results.TransientSolution[3].Base,\
    69         md.results.TransientSolution[3].Surface,\
    70         md.results.TransientSolution[3].Thickness,\
    71         md.results.TransientSolution[3].SmbMassBalance,\
    72         ]
     32field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',
     33                                                 'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',
     34                                                 'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3',
     35                                                 'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
     36field_tolerances=[1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
     37                                                                        1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
     38                                                                        1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
     39                                                                        1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
     40field_values=[md.results.TransientSolution[0].Vx,
     41                                                        md.results.TransientSolution[0].Vy,
     42                                                        md.results.TransientSolution[0].Vel,
     43                                                        md.results.TransientSolution[0].Pressure,
     44                                                        md.results.TransientSolution[0].Base,
     45                                                        md.results.TransientSolution[0].Surface,
     46                                                        md.results.TransientSolution[0].Thickness,
     47                                                        md.results.TransientSolution[0].SmbMassBalance,
     48                                                        md.results.TransientSolution[1].Vx,
     49                                                        md.results.TransientSolution[1].Vy,
     50                                                        md.results.TransientSolution[1].Vel,
     51                                                        md.results.TransientSolution[1].Pressure,
     52                                                        md.results.TransientSolution[1].Base,
     53                                                        md.results.TransientSolution[1].Surface,
     54                                                        md.results.TransientSolution[1].Thickness,
     55                                                        md.results.TransientSolution[1].SmbMassBalance,
     56                                                        md.results.TransientSolution[2].Vx,
     57                                                        md.results.TransientSolution[2].Vy,
     58                                                        md.results.TransientSolution[2].Vel,
     59                                                        md.results.TransientSolution[2].Pressure,
     60                                                        md.results.TransientSolution[2].Base,
     61                                                        md.results.TransientSolution[2].Surface,
     62                                                        md.results.TransientSolution[2].Thickness,
     63                                                        md.results.TransientSolution[2].SmbMassBalance,
     64                                                        md.results.TransientSolution[3].Vx,
     65                                                        md.results.TransientSolution[3].Vy,
     66                                                        md.results.TransientSolution[3].Vel,
     67                                                        md.results.TransientSolution[3].Pressure,
     68                                                        md.results.TransientSolution[3].Base,
     69                                                        md.results.TransientSolution[3].Surface,
     70                                                        md.results.TransientSolution[3].Thickness,
     71                                                        md.results.TransientSolution[3].SmbMassBalance]
  • issm/trunk-jpl/test/NightlyRun/test230.py

    r21060 r21408  
    11#Test Name: SquareShelfTranForceNeg3d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',350000.)
    … …  
    1415md.extrude(3,1.)
    1516md=setflowequation(md,'SSA','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718
    1819md.timestepping.time_step=1.
    … …  
    2122
    2223#Set up transient
    23 smb=numpy.ones((md.mesh.numberofvertices,1))*3.6
    24 smb=numpy.hstack((smb,smb*-1.))
     24smb=np.ones((md.mesh.numberofvertices))*3.6
     25smb=np.vstack((smb,smb*-1.)).T
    2526
    26 md.smb.mass_balance=numpy.vstack((smb,[1.5,3.]))
     27md.smb.mass_balance=np.vstack((smb,[1.5,3.]))
    2728md.transient.isthermal=False
    2829
    … …  
    3031
    3132#Fields and tolerances to track changes
    32 field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1', \
    33         'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2', \
    34         'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3', \
    35         'Vx4','Vy4','Vz4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassbalance4']
    36 field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    37         1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    38         1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    39         1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
    40 field_values=[\
    41         md.results.TransientSolution[0].Vx,\
    42         md.results.TransientSolution[0].Vy,\
    43         md.results.TransientSolution[0].Vz,\
    44         md.results.TransientSolution[0].Vel,\
    45         md.results.TransientSolution[0].Pressure,\
    46         md.results.TransientSolution[0].Base,\
    47         md.results.TransientSolution[0].Surface,\
    48         md.results.TransientSolution[0].Thickness,\
    49         md.results.TransientSolution[0].SmbMassBalance,\
    50         md.results.TransientSolution[1].Vx,\
    51         md.results.TransientSolution[1].Vy,\
    52         md.results.TransientSolution[1].Vz,\
    53         md.results.TransientSolution[1].Vel,\
    54         md.results.TransientSolution[1].Pressure,\
    55         md.results.TransientSolution[1].Base,\
    56         md.results.TransientSolution[1].Surface,\
    57         md.results.TransientSolution[1].Thickness,\
    58         md.results.TransientSolution[1].SmbMassBalance,\
    59         md.results.TransientSolution[2].Vx,\
    60         md.results.TransientSolution[2].Vy,\
    61         md.results.TransientSolution[2].Vz,\
    62         md.results.TransientSolution[2].Vel,\
    63         md.results.TransientSolution[2].Pressure,\
    64         md.results.TransientSolution[2].Base,\
    65         md.results.TransientSolution[2].Surface,\
    66         md.results.TransientSolution[2].Thickness,\
    67         md.results.TransientSolution[2].SmbMassBalance,\
    68         md.results.TransientSolution[3].Vx,\
    69         md.results.TransientSolution[3].Vy,\
    70         md.results.TransientSolution[3].Vz,\
    71         md.results.TransientSolution[3].Vel,\
    72         md.results.TransientSolution[3].Pressure,\
    73         md.results.TransientSolution[3].Base,\
    74         md.results.TransientSolution[3].Surface,\
    75         md.results.TransientSolution[3].Thickness,\
    76         md.results.TransientSolution[3].SmbMassBalance,\
    77         ]
     33field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',
     34                                                                        'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',
     35                                                                        'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3',
     36                                                                        'Vx4','Vy4','Vz4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassbalance4']
     37field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
     38                                                                        1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
     39                                                                        1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
     40                                                                        1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
     41field_values=[md.results.TransientSolution[0].Vx,
     42                                                        md.results.TransientSolution[0].Vy,
     43                                                        md.results.TransientSolution[0].Vz,
     44                                                        md.results.TransientSolution[0].Vel,
     45                                                        md.results.TransientSolution[0].Pressure,
     46                                                        md.results.TransientSolution[0].Base,
     47                                                        md.results.TransientSolution[0].Surface,
     48                                                        md.results.TransientSolution[0].Thickness,
     49                                                        md.results.TransientSolution[0].SmbMassBalance,
     50                                                        md.results.TransientSolution[1].Vx,
     51                                                        md.results.TransientSolution[1].Vy,
     52                                                        md.results.TransientSolution[1].Vz,
     53                                                        md.results.TransientSolution[1].Vel,
     54                                                        md.results.TransientSolution[1].Pressure,
     55                                                        md.results.TransientSolution[1].Base,
     56                                                        md.results.TransientSolution[1].Surface,
     57                                                        md.results.TransientSolution[1].Thickness,
     58                                                        md.results.TransientSolution[1].SmbMassBalance,
     59                                                        md.results.TransientSolution[2].Vx,
     60                                                        md.results.TransientSolution[2].Vy,
     61                                                        md.results.TransientSolution[2].Vz,
     62                                                        md.results.TransientSolution[2].Vel,
     63                                                        md.results.TransientSolution[2].Pressure,
     64                                                        md.results.TransientSolution[2].Base,
     65                                                        md.results.TransientSolution[2].Surface,
     66                                                        md.results.TransientSolution[2].Thickness,
     67                                                        md.results.TransientSolution[2].SmbMassBalance,
     68                                                        md.results.TransientSolution[3].Vx,
     69                                                        md.results.TransientSolution[3].Vy,
     70                                                        md.results.TransientSolution[3].Vz,
     71                                                        md.results.TransientSolution[3].Vel,
     72                                                        md.results.TransientSolution[3].Pressure,
     73                                                        md.results.TransientSolution[3].Base,
     74                                                        md.results.TransientSolution[3].Surface,
     75                                                        md.results.TransientSolution[3].Thickness,
     76                                                        md.results.TransientSolution[3].SmbMassBalance]
  • issm/trunk-jpl/test/NightlyRun/test231.py

    r21060 r21408  
    11#Test Name: SquareShelfTranForcePos3d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',350000.)
    … …  
    1415md.extrude(3,1.)
    1516md=setflowequation(md,'SSA','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718
    1819md.timestepping.time_step=1.
    … …  
    2122
    2223#Set up transient
    23 smb=numpy.ones((md.mesh.numberofvertices,1))*3.6
    24 smb=numpy.hstack((smb,smb*2.))
     24smb=np.ones((md.mesh.numberofvertices))*3.6
     25smb=np.vstack((smb,smb*2.)).T
    2526
    26 md.smb.mass_balance=numpy.vstack((smb,[1.5,3.]))
     27md.smb.mass_balance=np.vstack((smb,[1.5,3.]))
    2728md.transient.isthermal=False
    2829
    … …  
    3031
    3132#Fields and tolerances to track changes
    32 field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1', \
    33         'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2', \
    34         'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3', \
    35         'Vx4','Vy4','Vz4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassbalance4']
    36 field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    37         1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    38         1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    39         1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
    40 field_values=[\
    41         md.results.TransientSolution[0].Vx,\
    42         md.results.TransientSolution[0].Vy,\
    43         md.results.TransientSolution[0].Vz,\
    44         md.results.TransientSolution[0].Vel,\
    45         md.results.TransientSolution[0].Pressure,\
    46         md.results.TransientSolution[0].Base,\
    47         md.results.TransientSolution[0].Surface,\
    48         md.results.TransientSolution[0].Thickness,\
    49         md.results.TransientSolution[0].SmbMassBalance,\
    50         md.results.TransientSolution[1].Vx,\
    51         md.results.TransientSolution[1].Vy,\
    52         md.results.TransientSolution[1].Vz,\
    53         md.results.TransientSolution[1].Vel,\
    54         md.results.TransientSolution[1].Pressure,\
    55         md.results.TransientSolution[1].Base,\
    56         md.results.TransientSolution[1].Surface,\
    57         md.results.TransientSolution[1].Thickness,\
    58         md.results.TransientSolution[1].SmbMassBalance,\
    59         md.results.TransientSolution[2].Vx,\
    60         md.results.TransientSolution[2].Vy,\
    61         md.results.TransientSolution[2].Vz,\
    62         md.results.TransientSolution[2].Vel,\
    63         md.results.TransientSolution[2].Pressure,\
    64         md.results.TransientSolution[2].Base,\
    65         md.results.TransientSolution[2].Surface,\
    66         md.results.TransientSolution[2].Thickness,\
    67         md.results.TransientSolution[2].SmbMassBalance,\
    68         md.results.TransientSolution[3].Vx,\
    69         md.results.TransientSolution[3].Vy,\
    70         md.results.TransientSolution[3].Vz,\
    71         md.results.TransientSolution[3].Vel,\
    72         md.results.TransientSolution[3].Pressure,\
    73         md.results.TransientSolution[3].Base,\
    74         md.results.TransientSolution[3].Surface,\
    75         md.results.TransientSolution[3].Thickness,\
    76         md.results.TransientSolution[3].SmbMassBalance,\
    77         ]
     33field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',
     34                                                                        'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',
     35                                                                        'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3',
     36                                                                        'Vx4','Vy4','Vz4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassbalance4']
     37field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
     38                                                                        1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
     39                                                                        1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
     40                                                                        1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
     41field_values=[md.results.TransientSolution[0].Vx,
     42                                                        md.results.TransientSolution[0].Vy,
     43                                                        md.results.TransientSolution[0].Vz,
     44                                                        md.results.TransientSolution[0].Vel,
     45                                                        md.results.TransientSolution[0].Pressure,
     46                                                        md.results.TransientSolution[0].Base,
     47                                                        md.results.TransientSolution[0].Surface,
     48                                                        md.results.TransientSolution[0].Thickness,
     49                                                        md.results.TransientSolution[0].SmbMassBalance,
     50                                                        md.results.TransientSolution[1].Vx,
     51                                                        md.results.TransientSolution[1].Vy,
     52                                                        md.results.TransientSolution[1].Vz,
     53                                                        md.results.TransientSolution[1].Vel,
     54                                                        md.results.TransientSolution[1].Pressure,
     55                                                        md.results.TransientSolution[1].Base,
     56                                                        md.results.TransientSolution[1].Surface,
     57                                                        md.results.TransientSolution[1].Thickness,
     58                                                        md.results.TransientSolution[1].SmbMassBalance,
     59                                                        md.results.TransientSolution[2].Vx,
     60                                                        md.results.TransientSolution[2].Vy,
     61                                                        md.results.TransientSolution[2].Vz,
     62                                                        md.results.TransientSolution[2].Vel,
     63                                                        md.results.TransientSolution[2].Pressure,
     64                                                        md.results.TransientSolution[2].Base,
     65                                                        md.results.TransientSolution[2].Surface,
     66                                                        md.results.TransientSolution[2].Thickness,
     67                                                        md.results.TransientSolution[2].SmbMassBalance,
     68                                                        md.results.TransientSolution[3].Vx,
     69                                                        md.results.TransientSolution[3].Vy,
     70                                                        md.results.TransientSolution[3].Vz,
     71                                                        md.results.TransientSolution[3].Vel,
     72                                                        md.results.TransientSolution[3].Pressure,
     73                                                        md.results.TransientSolution[3].Base,
     74                                                        md.results.TransientSolution[3].Surface,
     75                                                        md.results.TransientSolution[3].Thickness,
     76                                                        md.results.TransientSolution[3].SmbMassBalance]
  • issm/trunk-jpl/test/NightlyRun/test232.py

    r21304 r21408  
    11#Test Name: SquareShelfTherTranForcTemp
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1415md.extrude(3,1.)
    1516md=setflowequation(md,'SSA','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
    17 md.thermal.spctemperature=numpy.vstack((numpy.vstack((md.thermal.spctemperature, md.thermal.spctemperature+5., md.thermal.spctemperature+10., md.thermal.spctemperature+15.)).T, [1.5,2.5,3.5,4.]))
     17md.cluster=generic('name',gethostname(),'np',3)
     18md.thermal.spctemperature=np.vstack((np.vstack((md.thermal.spctemperature, md.thermal.spctemperature+5., md.thermal.spctemperature+10., md.thermal.spctemperature+15.)).T, [1.5,2.5,3.5,4.]))
    1819md.timestepping.time_step=1.
    1920md.timestepping.final_time=4.
  • issm/trunk-jpl/test/NightlyRun/test233.py

    r21304 r21408  
    11#Test Name: SquareShelfTranHOForcTemp
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',200000.)
    … …  
    1415md.extrude(3,1.)
    1516md=setflowequation(md,'HO','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
    17 md.thermal.spctemperature=numpy.vstack((numpy.vstack((md.thermal.spctemperature, md.thermal.spctemperature+5.)).T, [1.,2.]))
     17md.cluster=generic('name',gethostname(),'np',3)
     18md.thermal.spctemperature=np.vstack((np.vstack((md.thermal.spctemperature, md.thermal.spctemperature+5.)).T, [1.,2.]))
    1819md.timestepping.time_step=0.5
    1920md.timestepping.final_time=2.
  • issm/trunk-jpl/test/NightlyRun/test236.py

    r21060 r21408  
    11#Test Name: SquareShelfTranIspddIsdeltaSSA2d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1415
    1516# Use of ispdd and isdelta18o methods
    16 md.smb = SMBpdd();
     17md.smb = SMBpdd()
    1718md.smb.isdelta18o=1
    1819md.smb.ismungsm=0
    … …  
    2021# Add temperature, precipitation and delta18o needed to measure the surface mass balance
    2122# creating delta18o
    22 delta18o=numpy.loadtxt('../Data/delta18o.data')
     23delta18o=np.loadtxt('../Data/delta18o.data')
    2324md.smb.delta18o=delta18o
    2425# creating delta18oSurface
    25 md.smb.delta18o_surface = numpy.zeros((2,numpy.size(delta18o,axis=1)))
     26md.smb.delta18o_surface = np.zeros((2,np.size(delta18o,axis=1)))
    2627md.smb.delta18o_surface[1,:] = delta18o[1,:]
    2728
    2829# creating Present day and lgm temperatures
    2930# Same temperature over the all region:
    30 tmonth=numpy.ones(12)*(238.15+20.)
    31 md.smb.temperatures_presentday=numpy.zeros((md.mesh.numberofvertices+1,12))
    32 md.smb.temperatures_lgm=numpy.zeros((md.mesh.numberofvertices+1,12))
     31tmonth=np.ones(12)*(238.15+20.)
     32md.smb.temperatures_presentday=np.zeros((md.mesh.numberofvertices+1,12))
     33md.smb.temperatures_lgm=np.zeros((md.mesh.numberofvertices+1,12))
    3334for imonth in xrange(0,12):
    3435    md.smb.temperatures_presentday[0:md.mesh.numberofvertices,imonth]=tmonth[imonth]
    … …  
    3940
    4041# creating initialization and spc temperatures initialization and spc
    41 md.thermal.spctemperature=numpy.mean(md.smb.temperatures_lgm[0:md.mesh.numberofvertices,:],axis=1).reshape(-1,1)    #-10*ones(md.mesh.numberofvertices,1)
    42 md.thermal.spctemperature=numpy.tile(md.thermal.spctemperature,(1,md.timestepping.final_time/md.timestepping.time_step))
    43 itemp=numpy.arange(0,md.timestepping.final_time,md.timestepping.time_step)
    44 md.thermal.spctemperature=numpy.vstack((md.thermal.spctemperature,itemp.reshape(1,-1)))
     42md.thermal.spctemperature=np.mean(md.smb.temperatures_lgm[0:md.mesh.numberofvertices,:],axis=1).reshape(-1,1)    #-10*ones(md.mesh.numberofvertices,1)
     43md.thermal.spctemperature=np.tile(md.thermal.spctemperature,(1,md.timestepping.final_time/md.timestepping.time_step))
     44itemp=np.arange(0,md.timestepping.final_time,md.timestepping.time_step)
     45md.thermal.spctemperature=np.vstack((md.thermal.spctemperature,itemp.reshape(1,-1)))
    4546
    4647md.initialization.temperature=md.smb.temperatures_lgm[0:md.mesh.numberofvertices,0]    #*ones(md.mesh.numberofvertices,1)
    … …  
    4849
    4950# creating precipitation
    50 md.smb.precipitations_presentday=numpy.zeros((md.mesh.numberofvertices+1,12))
    51 md.smb.precipitations_lgm=numpy.zeros((md.mesh.numberofvertices+1,12))
     51md.smb.precipitations_presentday=np.zeros((md.mesh.numberofvertices+1,12))
     52md.smb.precipitations_lgm=np.zeros((md.mesh.numberofvertices+1,12))
    5253for imonth in xrange(0,12):
    5354    md.smb.precipitations_presentday[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5
    … …  
    5758
    5859# Interpolation factors
    59 md.smb.Tdiff=0.5*numpy.ones((2,md.timestepping.final_time))
    60 md.smb.sealev=0.5*numpy.ones((2,md.timestepping.final_time))
     60md.smb.Tdiff=0.5*np.ones((2,md.timestepping.final_time))
     61md.smb.sealev=0.5*np.ones((2,md.timestepping.final_time))
    6162# Year of each data point
    62 md.smb.Tdiff[1,1:md.timestepping.final_time]=numpy.arange(1.,md.timestepping.final_time)
    63 md.smb.sealev[1,1:md.timestepping.final_time]=numpy.arange(1.,md.timestepping.final_time)
     63md.smb.Tdiff[1,1:md.timestepping.final_time]=np.arange(1.,md.timestepping.final_time)
     64md.smb.sealev[1,1:md.timestepping.final_time]=np.arange(1.,md.timestepping.final_time)
    6465
    6566# time steps and resolution
    … …  
    7172md.transient.requested_outputs=['default','SmbMonthlytemperatures']
    7273md=setflowequation(md,'SSA','all')
    73 md.cluster=generic('name',oshostname(),'np',3)
     74md.cluster=generic('name',gethostname(),'np',3)
    7475md=solve(md,'Transient')
    7576
    … …  
    7778field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMonthlytemperatures1','SmbMassBalance1',\
    7879                            'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMonthlytemperatures2','SmbMassBalance2',\
    79                                       'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMonthlytemperatures3','SmbMassBalance3'];
     80                                      'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMonthlytemperatures3','SmbMassBalance3']
    8081field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    8182                            1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    82                                  1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13];
     83                                 1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
    8384field_values=[\
    8485        md.results.TransientSolution[0].Vx,\
  • issm/trunk-jpl/test/NightlyRun/test237.py

    r21060 r21408  
    11#Test Name: SquareShelfTranIspddIsdeltaSSA3d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011from generic import generic
    1112
    … …  
    1516
    1617# Use of ispdd and isdelta18o methods
    17 md.smb = SMBpdd();
     18md.smb = SMBpdd()
    1819md.smb.isdelta18o=0
    1920md.smb.ismungsm=1
    … …  
    2627# creating Present day and lgm temperatures
    2728# Same temperature over the all region:
    28 tmonth=numpy.ones(12)*(238.15+20.)
    29 md.smb.temperatures_presentday=numpy.zeros((md.mesh.numberofvertices+1,12))
    30 md.smb.temperatures_lgm=numpy.zeros((md.mesh.numberofvertices+1,12))
     29tmonth=np.ones(12)*(238.15+20.)
     30md.smb.temperatures_presentday=np.zeros((md.mesh.numberofvertices+1,12))
     31md.smb.temperatures_lgm=np.zeros((md.mesh.numberofvertices+1,12))
    3132for imonth in xrange(0,12):
    3233    md.smb.temperatures_presentday[0:md.mesh.numberofvertices,imonth]=tmonth[imonth]
    … …  
    3738
    3839# creating initialization and spc temperatures initialization and spc
    39 md.thermal.spctemperature=numpy.mean(md.smb.temperatures_lgm[0:md.mesh.numberofvertices,:],axis=1).reshape(-1,1)    #-10*ones(md.mesh.numberofvertices,1)
    40 md.thermal.spctemperature=numpy.tile(md.thermal.spctemperature,(1,md.timestepping.final_time/md.timestepping.time_step))
    41 itemp=numpy.arange(0,md.timestepping.final_time,md.timestepping.time_step)
    42 md.thermal.spctemperature=numpy.vstack((md.thermal.spctemperature,itemp.reshape(1,-1)))
     40md.thermal.spctemperature=np.mean(md.smb.temperatures_lgm[0:md.mesh.numberofvertices,:],axis=1).reshape(-1,1)    #-10*ones(md.mesh.numberofvertices,1)
     41md.thermal.spctemperature=np.tile(md.thermal.spctemperature,(1,md.timestepping.final_time/md.timestepping.time_step))
     42itemp=np.arange(0,md.timestepping.final_time,md.timestepping.time_step)
     43md.thermal.spctemperature=np.vstack((md.thermal.spctemperature,itemp.reshape(1,-1)))
    4344
    4445md.initialization.temperature=md.smb.temperatures_lgm[0:md.mesh.numberofvertices,0].reshape(-1,1)   #*ones(md.mesh.numberofvertices,1)
    … …  
    4647
    4748# creating precipitation
    48 md.smb.precipitations_presentday=numpy.zeros((md.mesh.numberofvertices+1,12))
    49 md.smb.precipitations_lgm=numpy.zeros((md.mesh.numberofvertices+1,12))
     49md.smb.precipitations_presentday=np.zeros((md.mesh.numberofvertices+1,12))
     50md.smb.precipitations_lgm=np.zeros((md.mesh.numberofvertices+1,12))
    5051for imonth in xrange(0,12):
    5152    md.smb.precipitations_presentday[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5
    … …  
    5556
    5657fsize=int(md.timestepping.final_time/md.timestepping.time_step)+2
    57 md.smb.Pfac=numpy.zeros((2,fsize))
    58 md.smb.Tdiff=numpy.zeros((2,fsize))
    59 md.smb.sealev=numpy.zeros((2,fsize))
     58md.smb.Pfac=np.zeros((2,fsize))
     59md.smb.Tdiff=np.zeros((2,fsize))
     60md.smb.sealev=np.zeros((2,fsize))
    6061for iint in xrange(0,fsize):
    6162    # Interpolation factors
    … …  
    7273md.extrude(3,1.)
    7374md=setflowequation(md,'SSA','all')
    74 md.cluster=generic('name',oshostname(),'np',1)
     75md.cluster=generic('name',gethostname(),'np',1)
    7576md=solve(md,'Transient')
    7677
    … …  
    7879field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1','SmbMonthlytemperatures1','SmbMassBalance1',\
    7980                'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2','SmbMonthlytemperatures2','SmbMassBalance2',\
    80                 'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3','SmbMonthlytemperatures3','SmbMassBalance3'];
     81                'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3','SmbMonthlytemperatures3','SmbMassBalance3']
    8182field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,1e-8,1e-8,1e-13,1e-8,1e-13,1e-13,\
    8283                1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,1e-8,1e-8,7e-13,1e-7,1e-13,1e-13,\
    83                 1e-13,1e-13,1e-08,1e-13,1e-13,1e-8,1e-8,1e-8,7e-13,5e-7,1e-13,1e-13];
     84                1e-13,1e-13,1e-08,1e-13,1e-13,1e-8,1e-8,1e-8,7e-13,5e-7,1e-13,1e-13]
    8485field_values=[\
    8586        md.results.TransientSolution[0].Vx,\
  • issm/trunk-jpl/test/NightlyRun/test238.py

    r21060 r21408  
    11#Test Name: SquareShelfTranIspddIsdeltaO18pdSSA2d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1415
    1516# Use of ispdd and isdelta18o methods
    16 md.smb = SMBd18opdd();
    17 md.smb.isd18opd=1;
     17md.smb = SMBd18opdd()
     18md.smb.isd18opd=1
    1819
    1920# Add temperature, precipitation and delta18o needed to measure the surface mass balance
    2021# creating delta18o
    21 delta18o=numpy.loadtxt('../Data/delta18o.data')
     22delta18o=np.loadtxt('../Data/delta18o.data')
    2223md.smb.delta18o=delta18o
    2324
    2425# creating Present day temperatures
    2526# Same temperature over the all region:
    26 tmonth=numpy.ones(12)*(238.15+20.)
    27 md.smb.temperatures_presentday=numpy.zeros((md.mesh.numberofvertices+1,12))
     27tmonth=np.ones(12)*(238.15+20.)
     28md.smb.temperatures_presentday=np.zeros((md.mesh.numberofvertices+1,12))
    2829for imonth in xrange(0,12):
    2930    md.smb.temperatures_presentday[0:md.mesh.numberofvertices,imonth]=tmonth[imonth]
    … …  
    3233
    3334# creating initialization and spc temperatures initialization and spc
    34 md.thermal.spctemperature=numpy.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices,:],axis=1).reshape(-1,1)
     35md.thermal.spctemperature=np.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices,:],axis=1).reshape(-1,1)
    3536md.thermal.spctemperature=md.thermal.spctemperature-10
    3637md.initialization.temperature=md.thermal.spctemperature
    … …  
    3839
    3940# creating precipitation
    40 md.smb.precipitations_presentday=numpy.zeros((md.mesh.numberofvertices+1,12))
     41md.smb.precipitations_presentday=np.zeros((md.mesh.numberofvertices+1,12))
    4142for imonth in xrange(0,12):
    4243    md.smb.precipitations_presentday[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5
    … …  
    4445
    4546# time steps and resolution
    46 md.timestepping.time_step=20;
    47 md.settings.output_frequency=1;
    48 md.timestepping.final_time=60;
     47md.timestepping.time_step=20
     48md.settings.output_frequency=1
     49md.timestepping.final_time=60
    4950
    5051#
    5152md.transient.requested_outputs=['default','SmbMonthlytemperatures']
    5253md=setflowequation(md,'SSA','all')
    53 md.cluster=generic('name',oshostname(),'np',3)
     54md.cluster=generic('name',gethostname(),'np',3)
    5455md=solve(md,'Transient')
    5556
    … …  
    5758field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMonthlytemperatures1','SmbMassBalance1',\
    5859                            'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMonthlytemperatures2','SmbMassBalance2',\
    59                                       'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMonthlytemperatures3','SmbMassBalance3'];
     60                                      'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMonthlytemperatures3','SmbMassBalance3']
    6061field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    6162                            1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    62                                  1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13];
     63                                 1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
    6364field_values=[\
    6465        md.results.TransientSolution[0].Vx,\
  • issm/trunk-jpl/test/NightlyRun/test239.py

    r21060 r21408  
    11#Test Name: SquareShelfTranIspddIsdeltaO18pdInterpSSA2d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1415
    1516# Use of ispdd and isdelta18o methods
    16 md.smb = SMBd18opdd();
    17 md.smb.isd18opd=1;
     17md.smb = SMBd18opdd()
     18md.smb.isd18opd=1
    1819
    1920# Add temperature, precipitation and delta18o needed to measure the surface mass balance
    2021# creating delta18o
    21 delta18o=numpy.loadtxt('../Data/delta18o.data')
     22delta18o=np.loadtxt('../Data/delta18o.data')
    2223md.smb.delta18o=delta18o
    2324
    2425# creating Present day temperatures
    2526# Same temperature over the all region:
    26 tmonth=numpy.ones(12)*(238.15+20.)
    27 md.smb.temperatures_presentday=numpy.zeros((md.mesh.numberofvertices+1,12))
     27tmonth=np.ones(12)*(238.15+20.)
     28md.smb.temperatures_presentday=np.zeros((md.mesh.numberofvertices+1,12))
    2829for imonth in xrange(0,12):
    2930    md.smb.temperatures_presentday[0:md.mesh.numberofvertices,imonth]=tmonth[imonth]
    … …  
    3233
    3334# creating initialization and spc temperatures initialization and spc
    34 md.thermal.spctemperature=numpy.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices,:],axis=1).reshape(-1,1)
     35md.thermal.spctemperature=np.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices,:],axis=1).reshape(-1,1)
    3536md.thermal.spctemperature=md.thermal.spctemperature-10
    3637md.initialization.temperature=md.thermal.spctemperature
    … …  
    3839
    3940# creating precipitation
    40 md.smb.precipitations_presentday=numpy.zeros((md.mesh.numberofvertices+1,12))
     41md.smb.precipitations_presentday=np.zeros((md.mesh.numberofvertices+1,12))
    4142for imonth in xrange(0,12):
    4243    md.smb.precipitations_presentday[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5
    … …  
    4445
    4546# time steps and resolution
    46 md.timestepping.time_step=0.5;
    47 md.settings.output_frequency=1;
    48 md.timestepping.final_time=2;
     47md.timestepping.time_step=0.5
     48md.settings.output_frequency=1
     49md.timestepping.final_time=2
    4950
    5051#
    5152md.transient.requested_outputs=['default','SmbMonthlytemperatures']
    5253md=setflowequation(md,'SSA','all')
    53 md.cluster=generic('name',oshostname(),'np',3)
     54md.cluster=generic('name',gethostname(),'np',3)
    5455md=solve(md,'Transient')
    5556
    … …  
    5758field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMonthlytemperatures1','SmbMassBalance1',\
    5859                            'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMonthlytemperatures2','SmbMassBalance2',\
    59                                       'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMonthlytemperatures3','SmbMassBalance3'];
     60                                      'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMonthlytemperatures3','SmbMassBalance3']
    6061field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    6162                            1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    62                                  1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13];
     63                                 1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
    6364field_values=[\
    6465        md.results.TransientSolution[0].Vx,\
  • issm/trunk-jpl/test/NightlyRun/test240.py

    r21060 r21408  
    11#Test Name: SquareShelfTranIspddIsdeltaO18pdNoInterpSSA2d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1415
    1516# Use of ispdd and isdelta18o methods
    16 md.smb = SMBd18opdd();
    17 md.smb.isd18opd=1;
     17md.smb = SMBd18opdd()
     18md.smb.isd18opd=1
    1819
    1920# Add temperature, precipitation and delta18o needed to measure the surface mass balance
    2021# creating delta18o
    21 delta18o=numpy.loadtxt('../Data/delta18o.data')
     22delta18o=np.loadtxt('../Data/delta18o.data')
    2223md.smb.delta18o=delta18o
    2324
    2425# creating Present day temperatures
    2526# Same temperature over the all region:
    26 tmonth=numpy.ones(12)*(238.15+20.)
    27 md.smb.temperatures_presentday=numpy.zeros((md.mesh.numberofvertices+1,12))
     27tmonth=np.ones(12)*(238.15+20.)
     28md.smb.temperatures_presentday=np.zeros((md.mesh.numberofvertices+1,12))
    2829for imonth in xrange(0,12):
    2930    md.smb.temperatures_presentday[0:md.mesh.numberofvertices,imonth]=tmonth[imonth]
    … …  
    3233
    3334# creating initialization and spc temperatures initialization and spc
    34 md.thermal.spctemperature=numpy.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices,:],axis=1).reshape(-1,1)
     35md.thermal.spctemperature=np.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices,:],axis=1).reshape(-1,1)
    3536md.thermal.spctemperature=md.thermal.spctemperature-10
    3637md.initialization.temperature=md.thermal.spctemperature
    … …  
    3839
    3940# creating precipitation
    40 md.smb.precipitations_presentday=numpy.zeros((md.mesh.numberofvertices+1,12))
     41md.smb.precipitations_presentday=np.zeros((md.mesh.numberofvertices+1,12))
    4142for imonth in xrange(0,12):
    4243    md.smb.precipitations_presentday[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5
    … …  
    4445
    4546# time steps and resolution
    46 md.timestepping.time_step=0.5;
    47 md.settings.output_frequency=1;
    48 md.timestepping.final_time=2;
    49 md.timestepping.interp_forcings=0;
     47md.timestepping.time_step=0.5
     48md.settings.output_frequency=1
     49md.timestepping.final_time=2
     50md.timestepping.interp_forcings=0
    5051
    5152#
    5253md.transient.requested_outputs=['default','SmbMonthlytemperatures']
    5354md=setflowequation(md,'SSA','all')
    54 md.cluster=generic('name',oshostname(),'np',3)
     55md.cluster=generic('name',gethostname(),'np',3)
    5556md=solve(md,'Transient')
    5657
    … …  
    5859field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMonthlytemperatures1','SmbMassBalance1',\
    5960                            'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMonthlytemperatures2','SmbMassBalance2',\
    60                                       'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMonthlytemperatures3','SmbMassBalance3'];
     61                                      'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMonthlytemperatures3','SmbMassBalance3']
    6162field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    6263                            1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    63                                  1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13];
     64                                 1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
    6465field_values=[\
    6566        md.results.TransientSolution[0].Vx,\
  • issm/trunk-jpl/test/NightlyRun/test241.py

    r21060 r21408  
    11#Test Name: SquareShelfTranForceNoInterp2d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1314md=parameterize(md,'../Par/SquareShelf.py')
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617
    1718md.timestepping.time_step=1.
    … …  
    2122
    2223#Set up transient
    23 smb=numpy.ones((md.mesh.numberofvertices,1))*3.6
    24 smb=numpy.hstack((smb,smb*-1.))
     24smb=np.ones((md.mesh.numberofvertices))*3.6
     25smb=np.vstack((smb,smb*-1.)).T
    2526
    26 md.smb.mass_balance=numpy.vstack((smb,[1.5,3.]))
     27md.smb.mass_balance=np.vstack((smb,[1.5,3.]))
    2728md.transient.isthermal=False
    2829
    … …  
    3031
    3132#Fields and tolerances to track changes
    32 field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1', \
    33         'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2', \
    34         'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3', \
    35         'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
    36 field_tolerances=[1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
    37         1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
    38         1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
    39         1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
    40 field_values=[\
    41         md.results.TransientSolution[0].Vx,\
    42         md.results.TransientSolution[0].Vy,\
    43         md.results.TransientSolution[0].Vel,\
    44         md.results.TransientSolution[0].Pressure,\
    45         md.results.TransientSolution[0].Base,\
    46         md.results.TransientSolution[0].Surface,\
    47         md.results.TransientSolution[0].Thickness,\
    48         md.results.TransientSolution[0].SmbMassBalance,\
    49         md.results.TransientSolution[1].Vx,\
    50         md.results.TransientSolution[1].Vy,\
    51         md.results.TransientSolution[1].Vel,\
    52         md.results.TransientSolution[1].Pressure,\
    53         md.results.TransientSolution[1].Base,\
    54         md.results.TransientSolution[1].Surface,\
    55         md.results.TransientSolution[1].Thickness,\
    56         md.results.TransientSolution[1].SmbMassBalance,\
    57         md.results.TransientSolution[2].Vx,\
    58         md.results.TransientSolution[2].Vy,\
    59         md.results.TransientSolution[2].Vel,\
    60         md.results.TransientSolution[2].Pressure,\
    61         md.results.TransientSolution[2].Base,\
    62         md.results.TransientSolution[2].Surface,\
    63         md.results.TransientSolution[2].Thickness,\
    64         md.results.TransientSolution[2].SmbMassBalance,\
    65         md.results.TransientSolution[3].Vx,\
    66         md.results.TransientSolution[3].Vy,\
    67         md.results.TransientSolution[3].Vel,\
    68         md.results.TransientSolution[3].Pressure,\
    69         md.results.TransientSolution[3].Base,\
    70         md.results.TransientSolution[3].Surface,\
    71         md.results.TransientSolution[3].Thickness,\
    72         md.results.TransientSolution[3].SmbMassBalance,\
    73         ]
     33field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',
     34                                                 'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',
     35                                                 'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3',
     36                                                 'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
     37field_tolerances=[1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
     38                                                                        1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
     39                                                                        1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
     40                                                                        1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
     41field_values=[md.results.TransientSolution[0].Vx,
     42                                                        md.results.TransientSolution[0].Vy,
     43                                                        md.results.TransientSolution[0].Vel,
     44                                                        md.results.TransientSolution[0].Pressure,
     45                                                        md.results.TransientSolution[0].Base,
     46                                                        md.results.TransientSolution[0].Surface,
     47                                                        md.results.TransientSolution[0].Thickness,
     48                                                        md.results.TransientSolution[0].SmbMassBalance,
     49                                                        md.results.TransientSolution[1].Vx,
     50                                                        md.results.TransientSolution[1].Vy,
     51                                                        md.results.TransientSolution[1].Vel,
     52                                                        md.results.TransientSolution[1].Pressure,
     53                                                        md.results.TransientSolution[1].Base,
     54                                                        md.results.TransientSolution[1].Surface,
     55                                                        md.results.TransientSolution[1].Thickness,
     56                                                        md.results.TransientSolution[1].SmbMassBalance,
     57                                                        md.results.TransientSolution[2].Vx,
     58                                                        md.results.TransientSolution[2].Vy,
     59                                                        md.results.TransientSolution[2].Vel,
     60                                                        md.results.TransientSolution[2].Pressure,
     61                                                        md.results.TransientSolution[2].Base,
     62                                                        md.results.TransientSolution[2].Surface,
     63                                                        md.results.TransientSolution[2].Thickness,
     64                                                        md.results.TransientSolution[2].SmbMassBalance,
     65                                                        md.results.TransientSolution[3].Vx,
     66                                                        md.results.TransientSolution[3].Vy,
     67                                                        md.results.TransientSolution[3].Vel,
     68                                                        md.results.TransientSolution[3].Pressure,
     69                                                        md.results.TransientSolution[3].Base,
     70                                                        md.results.TransientSolution[3].Surface,
     71                                                        md.results.TransientSolution[3].Thickness,
     72                                                        md.results.TransientSolution[3].SmbMassBalance]
  • issm/trunk-jpl/test/NightlyRun/test242.py

    r21060 r21408  
    11#Test Name: SquareShelfTranForceNoInterp3d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',350000.)
    … …  
    1415md.extrude(3,1.)
    1516md=setflowequation(md,'HO','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718
    1819md.timestepping.time_step=1.
    … …  
    2223
    2324#Set up transient
    24 smb=numpy.ones((md.mesh.numberofvertices,1))*3.6
    25 smb=numpy.hstack((smb,smb*-1.))
     25smb=np.ones((md.mesh.numberofvertices))*3.6
     26smb=np.vstack((smb,smb*-1.)).T
    2627
    27 md.smb.mass_balance=numpy.vstack((smb,[1.5,3.]))
     28md.smb.mass_balance=np.vstack((smb,[1.5,3.]))
    2829md.transient.isthermal=False
    2930
    … …  
    3132
    3233#Fields and tolerances to track changes
    33 field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1', \
    34         'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2', \
    35         'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3', \
    36         'Vx4','Vy4','Vz4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassbalance4']
    37 field_tolerances=[\
    38                 1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-13,\
    39                 1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-13,\
    40                 1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-13,\
    41                 1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-13]
    42 field_values=[\
    43         md.results.TransientSolution[0].Vx,\
    44         md.results.TransientSolution[0].Vy,\
    45         md.results.TransientSolution[0].Vz,\
    46         md.results.TransientSolution[0].Vel,\
    47         md.results.TransientSolution[0].Pressure,\
    48         md.results.TransientSolution[0].Base,\
    49         md.results.TransientSolution[0].Surface,\
    50         md.results.TransientSolution[0].Thickness,\
    51         md.results.TransientSolution[0].SmbMassBalance,\
    52         md.results.TransientSolution[1].Vx,\
    53         md.results.TransientSolution[1].Vy,\
    54         md.results.TransientSolution[1].Vz,\
    55         md.results.TransientSolution[1].Vel,\
    56         md.results.TransientSolution[1].Pressure,\
    57         md.results.TransientSolution[1].Base,\
    58         md.results.TransientSolution[1].Surface,\
    59         md.results.TransientSolution[1].Thickness,\
    60         md.results.TransientSolution[1].SmbMassBalance,\
    61         md.results.TransientSolution[2].Vx,\
    62         md.results.TransientSolution[2].Vy,\
    63         md.results.TransientSolution[2].Vz,\
    64         md.results.TransientSolution[2].Vel,\
    65         md.results.TransientSolution[2].Pressure,\
    66         md.results.TransientSolution[2].Base,\
    67         md.results.TransientSolution[2].Surface,\
    68         md.results.TransientSolution[2].Thickness,\
    69         md.results.TransientSolution[2].SmbMassBalance,\
    70         md.results.TransientSolution[3].Vx,\
    71         md.results.TransientSolution[3].Vy,\
    72         md.results.TransientSolution[3].Vz,\
    73         md.results.TransientSolution[3].Vel,\
    74         md.results.TransientSolution[3].Pressure,\
    75         md.results.TransientSolution[3].Base,\
    76         md.results.TransientSolution[3].Surface,\
    77         md.results.TransientSolution[3].Thickness,\
    78         md.results.TransientSolution[3].SmbMassBalance,\
    79         ]
     34field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',
     35                                                                        'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',
     36                                                                        'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3',
     37                                                                        'Vx4','Vy4','Vz4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassbalance4']
     38field_tolerances=[1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-13,
     39                                                                        1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-13,
     40                                                                        1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-13,
     41                                                                        1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-13]
     42field_values=[md.results.TransientSolution[0].Vx,
     43                                                        md.results.TransientSolution[0].Vy,
     44                                                        md.results.TransientSolution[0].Vz,
     45                                                        md.results.TransientSolution[0].Vel,
     46                                                        md.results.TransientSolution[0].Pressure,
     47                                                        md.results.TransientSolution[0].Base,
     48                                                        md.results.TransientSolution[0].Surface,
     49                                                        md.results.TransientSolution[0].Thickness,
     50                                                        md.results.TransientSolution[0].SmbMassBalance,
     51                                                        md.results.TransientSolution[1].Vx,
     52                                                        md.results.TransientSolution[1].Vy,
     53                                                        md.results.TransientSolution[1].Vz,
     54                                                        md.results.TransientSolution[1].Vel,
     55                                                        md.results.TransientSolution[1].Pressure,
     56                                                        md.results.TransientSolution[1].Base,
     57                                                        md.results.TransientSolution[1].Surface,
     58                                                        md.results.TransientSolution[1].Thickness,
     59                                                        md.results.TransientSolution[1].SmbMassBalance,
     60                                                        md.results.TransientSolution[2].Vx,
     61                                                        md.results.TransientSolution[2].Vy,
     62                                                        md.results.TransientSolution[2].Vz,
     63                                                        md.results.TransientSolution[2].Vel,
     64                                                        md.results.TransientSolution[2].Pressure,
     65                                                        md.results.TransientSolution[2].Base,
     66                                                        md.results.TransientSolution[2].Surface,
     67                                                        md.results.TransientSolution[2].Thickness,
     68                                                        md.results.TransientSolution[2].SmbMassBalance,
     69                                                        md.results.TransientSolution[3].Vx,
     70                                                        md.results.TransientSolution[3].Vy,
     71                                                        md.results.TransientSolution[3].Vz,
     72                                                        md.results.TransientSolution[3].Vel,
     73                                                        md.results.TransientSolution[3].Pressure,
     74                                                        md.results.TransientSolution[3].Base,
     75                                                        md.results.TransientSolution[3].Surface,
     76                                                        md.results.TransientSolution[3].Thickness,
     77                                                        md.results.TransientSolution[3].SmbMassBalance]
  • issm/trunk-jpl/test/NightlyRun/test270.py

    r21056 r21408  
    11#Test Name: SquareShelfStressSSA2dDamage
    2 import numpy
    3 from model import model
     2import numpy as np
     3from model import *
     4 from socket import gethostnamemodel
    45from triangle import triangle
    56from setmask import setmask
    … …  
    910from matdamageice import matdamageice
    1011from generic import generic
    11 from socket import gethostname as oshostname
     12from socket import gethostname
    1213
    1314md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1617md=parameterize(md,'../Par/SquareShelf.py')
    1718md.damage.isdamage=1
    18 md.damage.D=0.5*numpy.ones(md.mesh.numberofvertices)
    19 md.damage.spcdamage=numpy.nan*numpy.ones(md.mesh.numberofvertices)
     19md.damage.D=0.5*np.ones(md.mesh.numberofvertices)
     20md.damage.spcdamage=np.nan*np.ones(md.mesh.numberofvertices)
    2021md=setflowequation(md,'SSA','all')
    21 md.cluster=generic('name',oshostname(),'np',3)
     22md.cluster=generic('name',gethostname(),'np',3)
    2223md=solve(md,'Stressbalance')
    2324
  • issm/trunk-jpl/test/NightlyRun/test272.py

    r21056 r21408  
    11#Test Name: SquareShelfCMDSSA2dDamage
    2 import numpy
    3 from model import model
     2import numpy as np
     3from model import *
     4 from socket import gethostnamemodel
    45from triangle import triangle
    56from setmask import setmask
    … …  
    78from setflowequation import setflowequation
    89from solve import solve
    9 from socket import gethostname as oshostname
     10from socket import gethostname
    1011from matdamageice import matdamageice
    1112from generic import generic
    … …  
    1617md=parameterize(md,'../Par/SquareShelf.py')
    1718md.damage.isdamage=1
    18 md.damage.D=0.5*numpy.ones(md.mesh.numberofvertices)
    19 md.damage.spcdamage=numpy.nan*numpy.ones(md.mesh.numberofvertices)
     19md.damage.D=0.5*np.ones(md.mesh.numberofvertices)
     20md.damage.spcdamage=np.nan*np.ones(md.mesh.numberofvertices)
    2021md=setflowequation(md,'SSA','all')
    2122
    … …  
    2324md.inversion.iscontrol=1
    2425md.inversion.control_parameters=['DamageDbar']
    25 md.inversion.min_parameters=10**-13*numpy.ones((md.mesh.numberofvertices,1))
    26 md.inversion.max_parameters=numpy.ones((md.mesh.numberofvertices,1))
     26md.inversion.min_parameters=10**-13*np.ones((md.mesh.numberofvertices))
     27md.inversion.max_parameters=np.ones((md.mesh.numberofvertices))
    2728md.inversion.nsteps=2
    2829md.inversion.cost_functions=[101]
    29 md.inversion.cost_functions_coefficients=numpy.ones((md.mesh.numberofvertices,1))
    30 md.inversion.gradient_scaling=0.9*numpy.ones((md.inversion.nsteps,1))
    31 md.inversion.maxiter_per_step=2.*numpy.ones((md.inversion.nsteps,1))
    32 md.inversion.step_threshold=0.99*numpy.ones((md.inversion.nsteps,1))
     30md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices))
     31md.inversion.gradient_scaling=0.9*np.ones((md.inversion.nsteps))
     32md.inversion.maxiter_per_step=2.*np.ones((md.inversion.nsteps))
     33md.inversion.step_threshold=0.99*np.ones((md.inversion.nsteps))
    3334md.inversion.vx_obs=md.initialization.vx
    3435md.inversion.vy_obs=md.initialization.vy
    3536
    36 md.cluster=generic('name',oshostname(),'np',3)
     37md.cluster=generic('name',gethostname(),'np',3)
    3738md=solve(md,'Stressbalance')
    3839
  • issm/trunk-jpl/test/NightlyRun/test273.py

    r21056 r21408  
    11#Test Name: SquareShelfStressSSA2dDamageUpdate
    2 import numpy
    3 from model import model
     2import numpy as np
     3from model import *
     4 from socket import gethostnamemodel
    45from triangle import triangle
    56from setmask import setmask
    … …  
    910from matdamageice import matdamageice
    1011from generic import generic
    11 from socket import gethostname as oshostname
     12from socket import gethostname
    1213
    1314md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1617md=parameterize(md,'../Par/SquareShelf.py')
    1718md.damage.isdamage=1
    18 md.damage.D=0.*numpy.ones(md.mesh.numberofvertices)
    19 md.damage.spcdamage=numpy.nan*numpy.ones(md.mesh.numberofvertices)
     19md.damage.D=0.*np.ones(md.mesh.numberofvertices)
     20md.damage.spcdamage=np.nan*np.ones(md.mesh.numberofvertices)
    2021md=setflowequation(md,'SSA','all')
    21 md.cluster=generic('name',oshostname(),'np',3)
     22md.cluster=generic('name',gethostname(),'np',3)
    2223
    2324md.stressbalance.requested_outputs=['default','NewDamage']
  • issm/trunk-jpl/test/NightlyRun/test274.py

    r21056 r21408  
    11#Test Name: SquareShelfStressSSA2dDamageRift
    2 import numpy
    3 from model import model
     2import numpy as np
     3from model import *
     4 from socket import gethostnamemodel
    45from triangle import triangle
    56from setmask import setmask
    … …  
    78from setflowequation import setflowequation
    89from solve import solve
    9 from socket import gethostname as oshostname
     10from socket import gethostname
    1011from matdamageice import matdamageice
    1112from meshprocessrifts import meshprocessrifts
    … …  
    1819md=parameterize(md,'../Par/SquareShelf2.py')
    1920md.damage.isdamage=1
    20 md.damage.D=0.5*numpy.ones(md.mesh.numberofvertices)
    21 md.damage.spcdamage=numpy.nan*numpy.ones(md.mesh.numberofvertices)
     21md.damage.D=0.5*np.ones(md.mesh.numberofvertices)
     22md.damage.spcdamage=np.nan*np.ones(md.mesh.numberofvertices)
    2223md=setflowequation(md,'SSA','all')
    2324
    24 md.cluster=generic('name',oshostname(),'np',3)
     25md.cluster=generic('name',gethostname(),'np',3)
    2526print md.rifts.riftstruct[0]['fill']
    2627md=solve(md,'Stressbalance')
  • issm/trunk-jpl/test/NightlyRun/test275.py

    r21060 r21408  
    11#Test Name: SquareShelfDamageEvolutionSSA2dPralong
    2 import numpy
     2import numpy as np
    33from triangle import triangle
    4 from model import model
     4from model import *
     5 from socket import gethostnamemodel
    56from setmask import setmask
    67from parameterize import parameterize
    … …  
    89from setflowequation import setflowequation
    910from generic import generic
    10 from socket import gethostname as oshostname
     11from socket import gethostname
    1112from solve import solve
    1213from matdamageice import matdamageice
    … …  
    1718md=parameterize(md,'../Par/SquareShelf.py')
    1819md.damage.isdamage=1
    19 md.damage.D=0.1*numpy.ones(md.mesh.numberofvertices)
    20 md.damage.spcdamage=numpy.nan*numpy.ones(md.mesh.numberofvertices)
     20md.damage.D=0.1*np.ones(md.mesh.numberofvertices)
     21md.damage.spcdamage=np.nan*np.ones(md.mesh.numberofvertices)
    2122md.damage.law=1
    2223
    … …  
    3132
    3233md=setflowequation(md,'SSA','all')
    33 md.cluster=generic('name',oshostname(),'np',3)
     34md.cluster=generic('name',gethostname(),'np',3)
    3435md=solve(md,'DamageEvolution')
    3536
  • issm/trunk-jpl/test/NightlyRun/test280.py

    r21060 r21408  
    11#Test Name: SquareShelfStressSSA2dHigherOrder
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910from ContourToMesh import *
    1011
    … …  
    1314md=parameterize(md,'../Par/SquareShelf.py')
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617
    1718field_names=[]
  • issm/trunk-jpl/test/NightlyRun/test285.py

    r21060 r21408  
    11#Test Name: SquareShelfStressHOHigherOrder
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910from ContourToMesh import *
    1011
    11 md=triangle(model(),'../Exp/Square.exp',150000.);
    12 md=setmask(md,'all','');
    13 md=parameterize(md,'../Par/SquareShelf.py');
     12md=triangle(model(),'../Exp/Square.exp',150000.)
     13md=setmask(md,'all','')
     14md=parameterize(md,'../Par/SquareShelf.py')
    1415md.extrude(3,2.)
    15 md=setflowequation(md,'HO','all');
    16 md.cluster=generic('name',oshostname(),'np',3);
     16md=setflowequation(md,'HO','all')
     17md.cluster=generic('name',gethostname(),'np',3)
    1718
    1819field_names=[]
  • issm/trunk-jpl/test/NightlyRun/test290.py

    r21060 r21408  
    11#Test Name: SquareShelfStressFSP2P1
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910from ContourToMesh import *
    1011
    11 md=triangle(model(),'../Exp/Square.exp',150000.);
    12 md=setmask(md,'all','');
    13 md=parameterize(md,'../Par/SquareShelf.py');
     12md=triangle(model(),'../Exp/Square.exp',150000.)
     13md=setmask(md,'all','')
     14md=parameterize(md,'../Par/SquareShelf.py')
    1415md.extrude(3,2.)
    15 md=setflowequation(md,'FS','all');
    16 md.flowequation.fe_FS='TaylorHood';
    17 md.cluster=generic('name',oshostname(),'np',3);
    18 md=solve(md,'Stressbalance');
     16md=setflowequation(md,'FS','all')
     17md.flowequation.fe_FS='TaylorHood'
     18md.cluster=generic('name',gethostname(),'np',3)
     19md=solve(md,'Stressbalance')
    1920
    2021#Fields and tolerances to track changes
    21 field_names     =['Vx', 'Vy', 'Vz', 'Vel','Pressure'];
     22field_names     =['Vx', 'Vy', 'Vz', 'Vel','Pressure']
    2223field_tolerances=[5e-5,5e-5,8e-5,5e-5,1e-7]
    2324field_values=[\
    … …  
    2728        md.results.StressbalanceSolution.Vel,\
    2829        md.results.StressbalanceSolution.Pressure,\
    29         ];
     30        ]
  • issm/trunk-jpl/test/NightlyRun/test291.py

    r21060 r21408  
    11#Test Name: SquareShelfStressFSP4z
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910from ContourToMesh import *
    1011
    … …  
    1516md=setflowequation(md,'FS','all')
    1617md.flowequation.fe_FS='OneLayerP4z'
    17 md.cluster=generic('name',oshostname(),'np',1)
     18md.cluster=generic('name',gethostname(),'np',1)
    1819md=solve(md,'Stressbalance')
    1920
    2021#Fields and tolerances to track changes
    21 field_names     =['Vx', 'Vy', 'Vz', 'Vel','Pressure'];
     22field_names     =['Vx', 'Vy', 'Vz', 'Vel','Pressure']
    2223field_tolerances=[5e-5,5e-5,8e-5,5e-5,1e-7]
    2324field_values=[\
    … …  
    2728        md.results.StressbalanceSolution.Vel,\
    2829        md.results.StressbalanceSolution.Pressure,\
    29         ];
     30        ]
  • issm/trunk-jpl/test/NightlyRun/test292.py

    r21060 r21408  
    11#Test Name: SquareShelfTranSSA2dFloatingMeltParam
    2 from MatlabFuncs import *
     2
    33from model import *
    4 from numpy import *
     4from socket import gethostname
     5import numpy as np
    56from triangle import *
    67from setmask import *
    … …  
    1516md=parameterize(md,'../Par/SquareShelf.py')
    1617md=setflowequation(md,'SSA','all')
    17 md.cluster=generic('name',oshostname(),'np',3)
     18md.cluster=generic('name',gethostname(),'np',3)
    1819md.basalforcings=linearbasalforcings(md.basalforcings)
    1920md=solve(md,'Transient')
  • issm/trunk-jpl/test/NightlyRun/test3001.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedStressSSA2dAdolc
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',50000.)
    … …  
    1213md=parameterize(md,'../Par/SquareShelfConstrained.py')
    1314md=setflowequation(md,'SSA','all')
    14 md.cluster=generic('name',oshostname(),'np',1)
     15md.cluster=generic('name',gethostname(),'np',1)
    1516md.stressbalance.requested_outputs=['default','DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy']
    1617md.autodiff.isautodiff=True
  • issm/trunk-jpl/test/NightlyRun/test3002.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedStressSSA3dAdolc
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1314md.extrude(3,2.)
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',1)
     16md.cluster=generic('name',gethostname(),'np',1)
    1617md.autodiff.isautodiff=True
    1718md=solve(md,'Stressbalance')
  • issm/trunk-jpl/test/NightlyRun/test3003.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedStressHOAdolc
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1314md.extrude(3,2.)
    1415md=setflowequation(md,'HO','all')
    15 md.cluster=generic('name',oshostname(),'np',1)
     16md.cluster=generic('name',gethostname(),'np',1)
    1617md.stressbalance.requested_outputs=['default','StressTensorxx','StressTensoryy','StressTensorzz','StressTensorxy','StressTensorxz','StressTensoryz']
    1718md.autodiff.isautodiff=True
  • issm/trunk-jpl/test/NightlyRun/test3004.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedStressFSAdolc
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1314md.extrude(3,2.)
    1415md=setflowequation(md,'FS','all')
    15 md.cluster=generic('name',oshostname(),'np',1)
     16md.cluster=generic('name',gethostname(),'np',1)
    1617md.autodiff.isautodiff=True
    1718md=solve(md,'Stressbalance')
  • issm/trunk-jpl/test/NightlyRun/test3005.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedMasstransp2dAdolc
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1213md=parameterize(md,'../Par/SquareShelfConstrained.py')
    1314md=setflowequation(md,'SSA','all')
    14 md.cluster=generic('name',oshostname(),'np',1)
     15md.cluster=generic('name',gethostname(),'np',1)
    1516md.autodiff.isautodiff=True
    1617md=solve(md,'Masstransport')
  • issm/trunk-jpl/test/NightlyRun/test3006.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedMasstransp2dDGAdolc
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from meshconvert import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1415md=parameterize(md,'../Par/SquareShelfConstrained.py')
    1516md=setflowequation(md,'SSA','all')
    16 md.cluster=generic('name',oshostname(),'np',1)
     17md.cluster=generic('name',gethostname(),'np',1)
    1718md.masstransport.stabilization=3
    1819md.masstransport.spcthickness=md.geometry.thickness
  • issm/trunk-jpl/test/NightlyRun/test3007.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedMasstransp3dAdolc
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1314md=setflowequation(md,'SSA','all')
    1415md.extrude(5,3.)
    15 md.cluster=generic('name',oshostname(),'np',1)
     16md.cluster=generic('name',gethostname(),'np',1)
    1617md.autodiff.isautodiff=True
    1718md=solve(md,'Masstransport')
  • issm/trunk-jpl/test/NightlyRun/test3008.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedTherSteaAdolc
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1415md=setflowequation(md,'SSA','all')
    1516md.timestepping.time_step=0
    16 md.cluster=generic('name',oshostname(),'np',1)
     17md.cluster=generic('name',gethostname(),'np',1)
    1718md.autodiff.isautodiff=True
    1819md=solve(md,'Thermal')
  • issm/trunk-jpl/test/NightlyRun/test3009.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedTherTranAdolc
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1314md.extrude(3,1.)
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',1)
     16md.cluster=generic('name',gethostname(),'np',1)
    1617md.transient.isstressbalance=False
    1718md.transient.ismasstransport=False
  • issm/trunk-jpl/test/NightlyRun/test301.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedStressSSA2d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1213md=parameterize(md,'../Par/SquareSheetConstrained.py')
    1314md=setflowequation(md,'SSA','all')
    14 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1516md=solve(md,'Stressbalance')
    1617
  • issm/trunk-jpl/test/NightlyRun/test3010.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedTranSSA2dAdolc
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1213md=parameterize(md,'../Par/SquareShelfConstrained.py')
    1314md=setflowequation(md,'SSA','all')
    14 md.cluster=generic('name',oshostname(),'np',1)
     15md.cluster=generic('name',gethostname(),'np',1)
    1516md.transient.requested_outputs=['IceVolume']
    1617
  • issm/trunk-jpl/test/NightlyRun/test3015.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedMasstransp2dAdolcForwardDifference
    2 import numpy
     2import numpy as np
    33import copy
    44from model import *
     5from socket import gethostname
    56from triangle import *
    67from setmask import *
    … …  
    1112from SetIceShelfBC import *
    1213from solve import *
    13 from MatlabFuncs import *
     14
    1415
    1516#This test runs test3005 with autodiff on, and checks that
    … …  
    2122md=parameterize(md,'../Par/SquareShelfConstrained.py')
    2223md=setflowequation(md,'SSA','all')
    23 md.cluster=generic('name',oshostname(),'np',1)
     24md.cluster=generic('name',gethostname(),'np',1)
    2425md.masstransport.requested_outputs=['IceVolume']
    2526md.verbose=verbose('autodiff',True)
  • issm/trunk-jpl/test/NightlyRun/test3019.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedTherTranAdolcReverseVsForward
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    910from dependent import *
    1011from solve import *
    11 from MatlabFuncs import *
     12
    1213
    1314#test reverse scalar vs forward vectorial drivers in ADOLC, using the test3009 setup, equivalent to test109 setup.
    … …  
    1617md=parameterize(md,'../Par/SquareShelfConstrained.py')
    1718md=setflowequation(md,'SSA','all')
    18 md.cluster=generic('name',oshostname(),'np',1)
     19md.cluster=generic('name',gethostname(),'np',1)
    1920#md.toolkits.DefaultAnalysis=issmgslsolver()
    2021
    … …  
    3334
    3435#now run vectorial forward mode
    35 md.autodiff.independents=[independent('name','md.geometry.thickness','type','vertex','nods',md.mesh.numberofvertices,'fov_forward_indices',numpy.arange(1,md.mesh.numberofvertices+1))]
     36md.autodiff.independents=[independent('name','md.geometry.thickness','type','vertex','nods',md.mesh.numberofvertices,'fov_forward_indices',np.arange(1,md.mesh.numberofvertices+1))]
    3637md.autodiff.dependents=[dependent('name','MaxVel','type','scalar')]
    3738md.autodiff.driver='fov_forward'
  • issm/trunk-jpl/test/NightlyRun/test302.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedStressSIA2d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1213md=parameterize(md,'../Par/SquareSheetConstrained.py')
    1314md=setflowequation(md,'SIA','all')
    14 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1516md=solve(md,'Stressbalance')
    1617
  • issm/trunk-jpl/test/NightlyRun/test3020.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedTranAdolcReverseVsForward
    2 import numpy
     2import numpy as np
    33import copy
    44from model import *
     5from socket import gethostname
    56from triangle import *
    67from setmask import *
    … …  
    1112from SetIceShelfBC import *
    1213from solve import *
    13 from MatlabFuncs import *
     14
    1415
    1516#This test runs test3020 with autodiff on, and checks that
    … …  
    2122md=parameterize(md,'../Par/SquareShelfConstrained.py')
    2223md=setflowequation(md,'SSA','all')
    23 md.cluster=generic('name',oshostname(),'np',1)
     24md.cluster=generic('name',gethostname(),'np',1)
    2425md.transient.requested_outputs=['IceVolume','MaxVel']
    2526md.verbose=verbose('autodiff',True)
  • issm/trunk-jpl/test/NightlyRun/test303.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedStressSIASSA2d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1213md=parameterize(md,'../Par/SquareSheetConstrained.py')
    1314md=setflowequation(md,'SIA','../Exp/SquareHalfRight.exp','fill','SSA')
    14 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1516md=solve(md,'Stressbalance')
    1617
  • issm/trunk-jpl/test/NightlyRun/test304.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedStressSSA3d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1314md.extrude(3,2.)
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'Stressbalance')
    1718
  • issm/trunk-jpl/test/NightlyRun/test305.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedStressSIA3d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1314md.extrude(5,2.)
    1415md=setflowequation(md,'SIA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'Stressbalance')
    1718
  • issm/trunk-jpl/test/NightlyRun/test306.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedStressSIASSA3d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1314md.extrude(4,2.)
    1415md=setflowequation(md,'SIA','../Exp/SquareHalfRight.exp','fill','SSA')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'Stressbalance')
    1718
  • issm/trunk-jpl/test/NightlyRun/test307.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedStressHO
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1314md.extrude(3,1.)
    1415md=setflowequation(md,'HO','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'Stressbalance')
    1718
  • issm/trunk-jpl/test/NightlyRun/test308.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedStressFS
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1314md.extrude(3,1.)
    1415md=setflowequation(md,'FS','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'Stressbalance')
    1718
  • issm/trunk-jpl/test/NightlyRun/test309.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedMasstransp2d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1213md=parameterize(md,'../Par/SquareSheetConstrained.py')
    1314md=setflowequation(md,'SSA','all')
    14 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1516md=solve(md,'Masstransport')
    1617
  • issm/trunk-jpl/test/NightlyRun/test310.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedMasstransp2dDG
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from meshconvert import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1617md.masstransport.stabilization=3
    1718md.masstransport.spcthickness=md.geometry.thickness
    18 md.cluster=generic('name',oshostname(),'np',3)
     19md.cluster=generic('name',gethostname(),'np',3)
    1920md=solve(md,'Masstransport')
    2021
  • issm/trunk-jpl/test/NightlyRun/test3101.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedStressSSA2dAdolcMumps
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',50000.)
    … …  
    1213md=parameterize(md,'../Par/SquareShelfConstrained.py')
    1314md=setflowequation(md,'SSA','all')
    14 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1516md.stressbalance.requested_outputs=['default','DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy']
    1617
  • issm/trunk-jpl/test/NightlyRun/test3102.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedStressSSA3dAdolcMumps
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1314md.extrude(3,2.)
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md.autodiff.isautodiff=True
    1718
  • issm/trunk-jpl/test/NightlyRun/test3103.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedStressHOAdolcMumps
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1314md.extrude(3,2.)
    1415md=setflowequation(md,'HO','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md.stressbalance.requested_outputs=['default','StressTensorxx','StressTensoryy','StressTensorzz','StressTensorxy','StressTensorxz','StressTensoryz']
    1718
  • issm/trunk-jpl/test/NightlyRun/test3104.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedStressFSAdolcMumps
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1314md.extrude(3,2.)
    1415md=setflowequation(md,'FS','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617
    1718md.autodiff.isautodiff=True
  • issm/trunk-jpl/test/NightlyRun/test3105.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedMasstransp2dAdolcMumps
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1213md=parameterize(md,'../Par/SquareShelfConstrained.py')
    1314md=setflowequation(md,'SSA','all')
    14 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1516
    1617md.autodiff.isautodiff=True
  • issm/trunk-jpl/test/NightlyRun/test3106.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedMasstransp2dDGAdolcMumps
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from meshconvert import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1415md=parameterize(md,'../Par/SquareShelfConstrained.py')
    1516md=setflowequation(md,'SSA','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md.masstransport.stabilization=3
    1819md.masstransport.spcthickness=md.geometry.thickness
  • issm/trunk-jpl/test/NightlyRun/test3107.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedMasstransp3dAdolcMumps
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1314md=setflowequation(md,'SSA','all')
    1415md.extrude(5,3.)
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617
    1718md.autodiff.isautodiff=True
  • issm/trunk-jpl/test/NightlyRun/test3108.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedTherSteaAdolcMumps
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1415md=setflowequation(md,'SSA','all')
    1516md.timestepping.time_step=0
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718
    1819md.autodiff.isautodiff=True
  • issm/trunk-jpl/test/NightlyRun/test3109.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedTherTranAdolcMumps
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1314md.extrude(3,1.)
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md.transient.isstressbalance=False
    1718md.transient.ismasstransport=False
  • issm/trunk-jpl/test/NightlyRun/test311.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedMasstransp3d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1314md=setflowequation(md,'SSA','all')
    1415md.extrude(5,0.5)
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'Masstransport')
    1718
  • issm/trunk-jpl/test/NightlyRun/test3110.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrainedTranSSA2dAdolcMumps
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1213md=parameterize(md,'../Par/SquareShelfConstrained.py')
    1314md=setflowequation(md,'SSA','all')
    14 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1516
    1617md.transient.requested_outputs=['IceVolume']
  • issm/trunk-jpl/test/NightlyRun/test3119.py

    r21060 r21408  
    1 import numpy
     1import numpy as np
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    89from dependent import *
    910from solve import *
    10 from MatlabFuncs import *
     11
    1112
    1213#test reverse scalar vs forward vectorial drivers in ADOLC, using the test3009 setup, equivalent to test109 setup.
    … …  
    1516md=parameterize(md,'../Par/SquareShelfConstrained.py')
    1617md=setflowequation(md,'SSA','all')
    17 md.cluster=generic('name',oshostname(),'np',3)
     18md.cluster=generic('name',gethostname(),'np',3)
    1819
    1920md.autodiff.isautodiff=True
  • issm/trunk-jpl/test/NightlyRun/test312.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedTherStea
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1415md=setflowequation(md,'SSA','all')
    1516md.timestepping.time_step=0.
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md=solve(md,'Thermal')
    1819
  • issm/trunk-jpl/test/NightlyRun/test313.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedTherTran
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1314md.extrude(3,1.)
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md.verbose=verbose('convergence',True,'solution',True)
    1718md.transient.isstressbalance=False
  • issm/trunk-jpl/test/NightlyRun/test314.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedTranSIA2d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1213md=parameterize(md,'../Par/SquareSheetConstrained.py')
    1314md=setflowequation(md,'SIA','all')
    14 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1516md.transient.requested_outputs=['default','GroundedArea','FloatingArea','IceVolume']
    1617md=solve(md,'Transient')
  • issm/trunk-jpl/test/NightlyRun/test315.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedTranSIA3d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1314md.extrude(5,1.2)
    1415md=setflowequation(md,'SIA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'Transient')
    1718
  • issm/trunk-jpl/test/NightlyRun/test316.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedTranSSA2d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1213md=parameterize(md,'../Par/SquareSheetConstrained.py')
    1314md=setflowequation(md,'SSA','all')
    14 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1516md=solve(md,'Transient')
    1617
  • issm/trunk-jpl/test/NightlyRun/test317.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedTranHO
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',200000.)
    … …  
    1415md.extrude(3,1.)
    1516md=setflowequation(md,'HO','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md.transient.requested_outputs=['default','GroundedArea','FloatingArea','TotalFloatingBmb','TotalGroundedBmb']
    1819md=solve(md,'Transient')
  • issm/trunk-jpl/test/NightlyRun/test318.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedSteaSIA3d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1314md.extrude(4,1.)
    1415md=setflowequation(md,'SIA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md.timestepping.time_step=0
    1718md=solve(md,'Steadystate')
  • issm/trunk-jpl/test/NightlyRun/test319.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedCMDragSSA2d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',200000.)
    … …  
    1718md.inversion.iscontrol=1
    1819md.inversion.control_parameters=['FrictionCoefficient']
    19 md.inversion.min_parameters=1.*numpy.ones((md.mesh.numberofvertices,1))
    20 md.inversion.max_parameters=200.*numpy.ones((md.mesh.numberofvertices,1))
     20md.inversion.min_parameters=1.*np.ones((md.mesh.numberofvertices))
     21md.inversion.max_parameters=200.*np.ones((md.mesh.numberofvertices))
    2122md.inversion.nsteps=2
    2223md.inversion.cost_functions=[103,501]
    23 md.inversion.cost_functions_coefficients=numpy.ones((md.mesh.numberofvertices,2))
     24md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices,2))
    2425md.inversion.cost_functions_coefficients[:,1]=2.*10**-7
    25 md.inversion.gradient_scaling=3.*numpy.ones((md.inversion.nsteps,1))
    26 md.inversion.maxiter_per_step=2*numpy.ones(md.inversion.nsteps)
    27 md.inversion.step_threshold=0.3*numpy.ones(md.inversion.nsteps)
     26md.inversion.gradient_scaling=3.*np.ones((md.inversion.nsteps))
     27md.inversion.maxiter_per_step=2*np.ones(md.inversion.nsteps)
     28md.inversion.step_threshold=0.3*np.ones(md.inversion.nsteps)
    2829md.inversion.vx_obs=md.initialization.vx
    2930md.inversion.vy_obs=md.initialization.vy
    3031
    31 md.cluster=generic('name',oshostname(),'np',3)
     32md.cluster=generic('name',gethostname(),'np',3)
    3233md=solve(md,'Stressbalance')
    3334
  • issm/trunk-jpl/test/NightlyRun/test320.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedCMDragSSA3d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',200000.)
    … …  
    1819md.inversion.iscontrol=1
    1920md.inversion.control_parameters=['FrictionCoefficient']
    20 md.inversion.min_parameters=1.*numpy.ones((md.mesh.numberofvertices,1))
    21 md.inversion.max_parameters=200.*numpy.ones((md.mesh.numberofvertices,1))
     21md.inversion.min_parameters=1.*np.ones((md.mesh.numberofvertices))
     22md.inversion.max_parameters=200.*np.ones((md.mesh.numberofvertices))
    2223md.inversion.nsteps=2
    2324md.inversion.cost_functions=[103,501]
    24 md.inversion.cost_functions_coefficients=numpy.ones((md.mesh.numberofvertices,2))
     25md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices,2))
    2526md.inversion.cost_functions_coefficients[:,1]=2.*10**-7
    26 md.inversion.gradient_scaling=3.*numpy.ones((md.inversion.nsteps,1))
    27 md.inversion.maxiter_per_step=2*numpy.ones(md.inversion.nsteps)
    28 md.inversion.step_threshold=0.3*numpy.ones(md.inversion.nsteps)
     27md.inversion.gradient_scaling=3.*np.ones((md.inversion.nsteps))
     28md.inversion.maxiter_per_step=2*np.ones(md.inversion.nsteps)
     29md.inversion.step_threshold=0.3*np.ones(md.inversion.nsteps)
    2930md.inversion.vx_obs=md.initialization.vx
    3031md.inversion.vy_obs=md.initialization.vy
    3132
    32 md.cluster=generic('name',oshostname(),'np',3)
     33md.cluster=generic('name',gethostname(),'np',3)
    3334md=solve(md,'Stressbalance')
    3435
  • issm/trunk-jpl/test/NightlyRun/test321.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedCMDragHO
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',200000.)
    … …  
    1819md.inversion.iscontrol=1
    1920md.inversion.control_parameters=['FrictionCoefficient']
    20 md.inversion.min_parameters=1.*numpy.ones((md.mesh.numberofvertices,1))
    21 md.inversion.max_parameters=200.*numpy.ones((md.mesh.numberofvertices,1))
     21md.inversion.min_parameters=1.*np.ones((md.mesh.numberofvertices))
     22md.inversion.max_parameters=200.*np.ones((md.mesh.numberofvertices))
    2223md.inversion.nsteps=2
    2324md.inversion.cost_functions=[102,501]
    24 md.inversion.cost_functions_coefficients=numpy.ones((md.mesh.numberofvertices,2))
     25md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices,2))
    2526md.inversion.cost_functions_coefficients[:,1]=2*10**-7
    26 md.inversion.gradient_scaling=3.*numpy.ones((md.inversion.nsteps,1))
    27 md.inversion.maxiter_per_step=2*numpy.ones(md.inversion.nsteps)
    28 md.inversion.step_threshold=0.3*numpy.ones(md.inversion.nsteps)
     27md.inversion.gradient_scaling=3.*np.ones((md.inversion.nsteps))
     28md.inversion.maxiter_per_step=2*np.ones(md.inversion.nsteps)
     29md.inversion.step_threshold=0.3*np.ones(md.inversion.nsteps)
    2930md.inversion.vx_obs=md.initialization.vx
    3031md.inversion.vy_obs=md.initialization.vy
    3132
    32 md.cluster=generic('name',oshostname(),'np',3)
     33md.cluster=generic('name',gethostname(),'np',3)
    3334md=solve(md,'Stressbalance')
    3435
  • issm/trunk-jpl/test/NightlyRun/test322.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedCMDragFS
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',200000.)
    … …  
    1819md.inversion.iscontrol=1
    1920md.inversion.control_parameters=['FrictionCoefficient']
    20 md.inversion.min_parameters=1.*numpy.ones((md.mesh.numberofvertices,1))
    21 md.inversion.max_parameters=200.*numpy.ones((md.mesh.numberofvertices,1))
     21md.inversion.min_parameters=1.*np.ones((md.mesh.numberofvertices))
     22md.inversion.max_parameters=200.*np.ones((md.mesh.numberofvertices))
    2223md.inversion.nsteps=2
    2324md.inversion.cost_functions=[104,501]
    24 md.inversion.cost_functions_coefficients=numpy.ones((md.mesh.numberofvertices,2))
     25md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices,2))
    2526md.inversion.cost_functions_coefficients[:,1]=2.*10**-7
    26 md.inversion.gradient_scaling=3.*numpy.ones((md.inversion.nsteps,1))
    27 md.inversion.maxiter_per_step=2*numpy.ones(md.inversion.nsteps)
    28 md.inversion.step_threshold=0.3*numpy.ones(md.inversion.nsteps)
     27md.inversion.gradient_scaling=3.*np.ones((md.inversion.nsteps))
     28md.inversion.maxiter_per_step=2*np.ones(md.inversion.nsteps)
     29md.inversion.step_threshold=0.3*np.ones(md.inversion.nsteps)
    2930md.inversion.vx_obs=md.initialization.vx
    3031md.inversion.vy_obs=md.initialization.vy
    3132
    32 md.cluster=generic('name',oshostname(),'np',3)
     33md.cluster=generic('name',gethostname(),'np',3)
    3334md=solve(md,'Stressbalance')
    3435
  • issm/trunk-jpl/test/NightlyRun/test323.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedTranCflSSA2d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1314md=parameterize(md,'../Par/SquareSheetConstrained.py')
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md.timestepping.time_adapt=1
    1718md.timestepping.final_time=1120.
  • issm/trunk-jpl/test/NightlyRun/test324.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedTranCflSIA3d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1415md.extrude(5,1.2)
    1516md=setflowequation(md,'SIA','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md.timestepping.time_adapt=1
    1819md.timestepping.final_time=16000.
  • issm/trunk-jpl/test/NightlyRun/test325.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedEnthalpyStea
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1516md=setflowequation(md,'SSA','all')
    1617md.timestepping.time_step=0.
    17 md.initialization.waterfraction=numpy.zeros((md.mesh.numberofvertices,1))
    18 md.initialization.watercolumn=numpy.zeros((md.mesh.numberofvertices,1))
     18md.initialization.waterfraction=np.zeros((md.mesh.numberofvertices))
     19md.initialization.watercolumn=np.zeros((md.mesh.numberofvertices))
    1920md.thermal.isenthalpy = 1
    2021md.thermal.isdynamicbasalspc = 1
    2122
    22 md.cluster=generic('name',oshostname(),'np',3)
     23md.cluster=generic('name',gethostname(),'np',3)
    2324md=solve(md,'Thermal')
    2425
  • issm/trunk-jpl/test/NightlyRun/test326.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedEnthalpyTran
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',180000.)
    … …  
    1415md.extrude(3,1.)
    1516md=setflowequation(md,'SSA','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
    17 md.initialization.waterfraction=numpy.zeros((md.mesh.numberofvertices,1))
    18 md.initialization.watercolumn=numpy.zeros((md.mesh.numberofvertices,1))
     17md.cluster=generic('name',gethostname(),'np',3)
     18md.initialization.waterfraction=np.zeros((md.mesh.numberofvertices))
     19md.initialization.watercolumn=np.zeros((md.mesh.numberofvertices))
    1920md.transient.isstressbalance=False
    2021md.transient.ismasstransport=False
  • issm/trunk-jpl/test/NightlyRun/test327.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedTransHOEnth
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',200000.)
    … …  
    1415md.extrude(3,1.)
    1516md=setflowequation(md,'HO','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
    17 md.initialization.waterfraction=numpy.zeros((md.mesh.numberofvertices,1))
    18 md.initialization.watercolumn=numpy.zeros((md.mesh.numberofvertices,1))
     17md.cluster=generic('name',gethostname(),'np',3)
     18md.initialization.waterfraction=np.zeros((md.mesh.numberofvertices))
     19md.initialization.watercolumn=np.zeros((md.mesh.numberofvertices))
    1920md.initialization.temperature[:]=272.
    20 md.thermal.spctemperature[numpy.nonzero(md.mesh.vertexonsurface)[0]]=272.
     21md.thermal.spctemperature[np.nonzero(md.mesh.vertexonsurface)[0]]=272.
    2122md.thermal.isenthalpy=1
    2223md.thermal.isdynamicbasalspc=1
  • issm/trunk-jpl/test/NightlyRun/test328.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedSmbGradients2d
    2 import numpy
    32import copy
    43from model import *
     4from socket import gethostname
    55from triangle import *
    66from setmask import *
    … …  
    88from setflowequation import *
    99from solve import *
    10 from MatlabFuncs import *
    1110
    1211md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1413md=parameterize(md,'../Par/SquareSheetConstrained.py')
    1514md=setflowequation(md,'SSA','all')
    16 md.smb = SMBgradients();
     15md.smb = SMBgradients()
    1716md.smb.b_pos=-100. + 0.00005*md.mesh.x - 0.0001*md.mesh.y
    1817md.smb.b_neg=250. + 0.000051*md.mesh.x - 0.00011*md.mesh.y
    1918md.transient.requested_outputs=['default','TotalSmb']
    20 md.smb.href=copy.deepcopy(md.geometry.surface).reshape(-1)
    21 md.smb.smbref= 1000. - 0.001*md.mesh.x - 0.005*md.mesh.y;
    22 md.cluster=generic('name',oshostname(),'np',3)
     19md.smb.href=copy.deepcopy(md.geometry.surface)
     20md.smb.smbref= 1000. - 0.001*md.mesh.x - 0.005*md.mesh.y
     21md.cluster=generic('name',gethostname(),'np',3)
    2322md=solve(md,'Transient')
    2423
    2524#Fields and tolerances to track changes
    26 field_names     =['Vx1','Vy1','Vel1','Bed1','Surface1','Thickness1','SMB1','TotalSmb1','Vx2','Vy2','Vel2','Bed2','Surface2','Thickness2','SMB2','TotalSmb2','Vx3','Vy3','Vel3','Bed3','Surface3','Thickness3','SMB3','TotalSmb3']
    27 field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
    28 field_values=[\
    29         md.results.TransientSolution[0].Vx,\
    30         md.results.TransientSolution[0].Vy,\
    31         md.results.TransientSolution[0].Vel,\
    32         md.results.TransientSolution[0].Base,\
    33         md.results.TransientSolution[0].Surface,\
    34         md.results.TransientSolution[0].Thickness,\
    35         md.results.TransientSolution[0].SmbMassBalance,\
    36         md.results.TransientSolution[0].TotalSmb,\
    37         md.results.TransientSolution[1].Vx,\
    38         md.results.TransientSolution[1].Vy,\
    39         md.results.TransientSolution[1].Vel,\
    40         md.results.TransientSolution[1].Base,\
    41         md.results.TransientSolution[1].Surface,\
    42         md.results.TransientSolution[1].Thickness,\
    43         md.results.TransientSolution[1].TotalSmb,\
    44         md.results.TransientSolution[1].SmbMassBalance,\
    45         md.results.TransientSolution[2].Vx,\
    46         md.results.TransientSolution[2].Vy,\
    47         md.results.TransientSolution[2].Vel,\
    48         md.results.TransientSolution[2].Base,\
    49         md.results.TransientSolution[2].Surface,\
    50         md.results.TransientSolution[2].Thickness,\
    51         md.results.TransientSolution[2].SmbMassBalance,\
    52         md.results.TransientSolution[2].TotalSmb,\
    53         ]
     25field_names     =['Vx1','Vy1','Vel1',
     26                                                                        'Bed1','Surface1','Thickness1',
     27                                                                        'SMB1','TotalSmb1',
     28                                                                        'Vx2','Vy2','Vel2','Bed2',
     29                                                                        'Surface2','Thickness2',
     30                                                                        'SMB2','TotalSmb2','Vx3','Vy3',
     31                                                                        'Vel3','Bed3','Surface3',
     32                                                                        'Thickness3','SMB3','TotalSmb3']
     33field_tolerances=[1e-13,1e-13,1e-13,
     34                                                                        1e-13,1e-13,1e-13,
     35                                                                        1e-13,1e-13,1e-13,
     36                                                                        1e-13,1e-13,1e-13,
     37                                                                        1e-13,1e-13,1e-13,
     38                                                                        1e-13,1e-13,1e-13,
     39                                                                        1e-13,1e-13,1e-13,
     40                                                                        1e-13,1e-13,1e-13]
     41field_values=[md.results.TransientSolution[0].Vx,
     42                                                        md.results.TransientSolution[0].Vy,
     43                                                        md.results.TransientSolution[0].Vel,
     44                                                        md.results.TransientSolution[0].Base,
     45                                                        md.results.TransientSolution[0].Surface,
     46                                                        md.results.TransientSolution[0].Thickness,
     47                                                        md.results.TransientSolution[0].SmbMassBalance,
     48                                                        md.results.TransientSolution[0].TotalSmb,
     49                                                        md.results.TransientSolution[1].Vx,
     50                                                        md.results.TransientSolution[1].Vy,
     51                                                        md.results.TransientSolution[1].Vel,
     52                                                        md.results.TransientSolution[1].Base,
     53                                                        md.results.TransientSolution[1].Surface,
     54                                                        md.results.TransientSolution[1].Thickness,
     55                                                        md.results.TransientSolution[1].TotalSmb,
     56                                                        md.results.TransientSolution[1].SmbMassBalance,
     57                                                        md.results.TransientSolution[2].Vx,
     58                                                        md.results.TransientSolution[2].Vy,
     59                                                        md.results.TransientSolution[2].Vel,
     60                                                        md.results.TransientSolution[2].Base,
     61                                                        md.results.TransientSolution[2].Surface,
     62                                                        md.results.TransientSolution[2].Thickness,
     63                                                        md.results.TransientSolution[2].SmbMassBalance,
     64                                                        md.results.TransientSolution[2].TotalSmb]
  • issm/trunk-jpl/test/NightlyRun/test329.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedSmbGradients3d
    2 import numpy
    32import copy
    43from model import *
     4from socket import gethostname
    55from triangle import *
    66from setmask import *
    … …  
    88from setflowequation import *
    99from solve import *
    10 from MatlabFuncs import *
    1110
    1211md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1514md.extrude(3,1)
    1615md=setflowequation(md,'HO','all')
    17 md.smb = SMBgradients();
     16md.smb = SMBgradients()
    1817md.smb.b_pos=-100. + 0.00005*md.mesh.x - 0.0001*md.mesh.y
    1918md.smb.b_neg=250. + 0.000051*md.mesh.x - 0.00011*md.mesh.y
    20 md.smb.href=copy.deepcopy(md.geometry.surface).reshape(-1)
    21 md.smb.smbref= 1000. - 0.001*md.mesh.x - 0.005*md.mesh.y;
     19md.smb.href=copy.deepcopy(md.geometry.surface)
     20md.smb.smbref= 1000. - 0.001*md.mesh.x - 0.005*md.mesh.y
    2221md.transient.requested_outputs=['default','TotalSmb']
    23 md.cluster=generic('name',oshostname(),'np',3)
     22md.cluster=generic('name',gethostname(),'np',3)
    2423md=solve(md,'Transient')
    2524
    2625#Fields and tolerances to track changes
    27 field_names     =['Vx1','Vy1','Vz1','Vel1','Bed1','Surface1','Thickness1','Temperature1','SMB1','TotalSmb1','Vx2','Vy2','Vz2','Vel2','Bed2','Surface2','Thickness2','Temperature2','SMB2','TotalSmb2','Vx3','Vy3','Vz3','Vel3','Bed3','Surface3','Thickness3','Temperature3','SMB3','TotalSmb3']
    28 field_tolerances=[1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
    29         1e-09,1e-09,1e-10,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
    30         1e-09,5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
    31 field_values=[\
    32         md.results.TransientSolution[0].Vx,\
    33         md.results.TransientSolution[0].Vy,\
    34         md.results.TransientSolution[0].Vz,\
    35         md.results.TransientSolution[0].Vel,\
    36         md.results.TransientSolution[0].Base,\
    37         md.results.TransientSolution[0].Surface,\
    38         md.results.TransientSolution[0].Thickness,\
    39         md.results.TransientSolution[0].Temperature,\
    40         md.results.TransientSolution[0].SmbMassBalance,\
    41         md.results.TransientSolution[0].TotalSmb,\
    42         md.results.TransientSolution[1].Vx,\
    43         md.results.TransientSolution[1].Vy,\
    44         md.results.TransientSolution[1].Vz,\
    45         md.results.TransientSolution[1].Vel,\
    46         md.results.TransientSolution[1].Base,\
    47         md.results.TransientSolution[1].Surface,\
    48         md.results.TransientSolution[1].Thickness,\
    49         md.results.TransientSolution[1].Temperature,\
    50         md.results.TransientSolution[1].SmbMassBalance,\
    51         md.results.TransientSolution[1].TotalSmb,\
    52         md.results.TransientSolution[2].Vx,\
    53         md.results.TransientSolution[2].Vy,\
    54         md.results.TransientSolution[2].Vz,\
    55         md.results.TransientSolution[2].Vel,\
    56         md.results.TransientSolution[2].Base,\
    57         md.results.TransientSolution[2].Surface,\
    58         md.results.TransientSolution[2].Thickness,\
    59         md.results.TransientSolution[2].Temperature,\
    60         md.results.TransientSolution[2].SmbMassBalance,\
    61         md.results.TransientSolution[2].TotalSmb,\
    62         ]
     26field_names     =['Vx1','Vy1','Vz1','Vel1',
     27                                                                        'Bed1','Surface1','Thickness1',
     28                                                                        'Temperature1','SMB1','TotalSmb1',
     29                                                                        'Vx2','Vy2','Vz2','Vel2',
     30                                                                        'Bed2','Surface2','Thickness2',
     31                                                                        'Temperature2','SMB2','TotalSmb2',
     32                                                                        'Vx3','Vy3','Vz3','Vel3',
     33                                                                        'Bed3','Surface3','Thickness3',
     34                                                                        'Temperature3','SMB3','TotalSmb3']
     35field_tolerances=[1e-09,1e-09,1e-09,1e-09,
     36                                                                        1e-10,1e-10,1e-10,
     37                                                                        1e-10,1e-10,1e-10,
     38                                                                        1e-09,1e-09,1e-10,1e-09,
     39                                                                        1e-10,1e-10,1e-10,
     40                                                                        1e-10,1e-10,1e-10,
     41                                                                        1e-09,5e-09,1e-09,1e-09,
     42                                                                        1e-10,1e-10,1e-10,
     43                                                                        1e-10,1e-10,1e-10]
     44field_values=[md.results.TransientSolution[0].Vx,
     45                                                        md.results.TransientSolution[0].Vy,
     46                                                        md.results.TransientSolution[0].Vz,
     47                                                        md.results.TransientSolution[0].Vel,
     48                                                        md.results.TransientSolution[0].Base,
     49                                                        md.results.TransientSolution[0].Surface,
     50                                                        md.results.TransientSolution[0].Thickness,
     51                                                        md.results.TransientSolution[0].Temperature,
     52                                                        md.results.TransientSolution[0].SmbMassBalance,
     53                                                        md.results.TransientSolution[0].TotalSmb,
     54                                                        md.results.TransientSolution[1].Vx,
     55                                                        md.results.TransientSolution[1].Vy,
     56                                                        md.results.TransientSolution[1].Vz,
     57                                                        md.results.TransientSolution[1].Vel,
     58                                                        md.results.TransientSolution[1].Base,
     59                                                        md.results.TransientSolution[1].Surface,
     60                                                        md.results.TransientSolution[1].Thickness,
     61                                                        md.results.TransientSolution[1].Temperature,
     62                                                        md.results.TransientSolution[1].SmbMassBalance,
     63                                                        md.results.TransientSolution[1].TotalSmb,
     64                                                        md.results.TransientSolution[2].Vx,
     65                                                        md.results.TransientSolution[2].Vy,
     66                                                        md.results.TransientSolution[2].Vz,
     67                                                        md.results.TransientSolution[2].Vel,
     68                                                        md.results.TransientSolution[2].Base,
     69                                                        md.results.TransientSolution[2].Surface,
     70                                                        md.results.TransientSolution[2].Thickness,
     71                                                        md.results.TransientSolution[2].Temperature,
     72                                                        md.results.TransientSolution[2].SmbMassBalance,
     73                                                        md.results.TransientSolution[2].TotalSmb]
  • issm/trunk-jpl/test/NightlyRun/test3300.py

    r21281 r21408  
    11import numpy as np
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112from generic import generic
    … …  
    1819md.transient.issmb=True
    1920md=setflowequation(md,'SSA','all')
    20 md.cluster=generic('name',oshostname(),'np',1)
     21md.cluster=generic('name',gethostname(),'np',1)
    2122md.hydrology=hydrologydc()
    2223md.hydrology=md.hydrology.initialize(md)
    … …  
    2627md.hydrology.sedimentlimit=400.0
    2728md.hydrology.sediment_thickness=20.0
    28 md.initialization.sediment_head=np.zeros((md.mesh.numberofvertices,1))
    29 md.hydrology.spcsediment_head=float('NaN')*np.ones((md.mesh.numberofvertices,1))
    30 md.basalforcings.groundedice_melting_rate = 2.0*np.ones((md.mesh.numberofvertices,1))
    31 md.hydrology.sediment_transmitivity=1.5e-4*np.ones((md.mesh.numberofvertices,1))
     29md.initialization.sediment_head=np.zeros((md.mesh.numberofvertices))
     30md.hydrology.spcsediment_head=float('NaN')*np.ones((md.mesh.numberofvertices))
     31md.basalforcings.groundedice_melting_rate = 2.0*np.ones((md.mesh.numberofvertices))
     32md.hydrology.sediment_transmitivity=1.5e-4*np.ones((md.mesh.numberofvertices))
    3233
    33 md.initialization.epl_head=np.zeros((md.mesh.numberofvertices,1))
    34 md.initialization.epl_thickness=np.ones((md.mesh.numberofvertices,1))
    35 md.hydrology.spcepl_head=float('NaN')*np.ones((md.mesh.numberofvertices,1))
    36 md.hydrology.mask_eplactive_node=np.zeros((md.mesh.numberofvertices,1))
     34md.initialization.epl_head=np.zeros((md.mesh.numberofvertices))
     35md.initialization.epl_thickness=np.ones((md.mesh.numberofvertices))
     36md.hydrology.spcepl_head=float('NaN')*np.ones((md.mesh.numberofvertices))
     37md.hydrology.mask_eplactive_node=np.zeros((md.mesh.numberofvertices))
    3738
    3839md.hydrology.epl_conductivity=1.5e-2
    … …  
    6162totvol=np.zeros(4001)
    6263time=np.arange(0.002,8.001,0.002)
    63 store=md.constants.g*md.hydrology.sediment_porosity*md.materials.rho_freshwater*((md.hydrology.sediment_compressibility/md.hydrology.sediment_porosity)+md.hydrology.water_compressibility);
    64 sedstore=20.0*store;
     64store=md.constants.g*md.hydrology.sediment_porosity*md.materials.rho_freshwater*((md.hydrology.sediment_compressibility/md.hydrology.sediment_porosity)+md.hydrology.water_compressibility)
     65sedstore=20.0*store
    6566for i in range(0,4000):
    6667        sedvol[i]=np.mean(md.results.TransientSolution[i].SedimentHead)*sedstore
  • issm/trunk-jpl/test/NightlyRun/test332.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedHydrologyDC
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    89from setflowequation import *
    910from solve import *
    10 from MatlabFuncs import *
     11
    1112
    1213from generic import generic
    … …  
    2021
    2122md=setflowequation(md,'SSA','all')
    22 md.cluster=generic('name',oshostname(),'np',1)
     23md.cluster=generic('name',gethostname(),'np',1)
    2324md.hydrology=hydrologydc()
    2425md.hydrology=md.hydrology.initialize(md)
    … …  
    2728md.hydrology.sedimentlimit_flag=1
    2829md.hydrology.sedimentlimit=8000.0
    29 md.initialization.sediment_head=numpy.zeros((md.mesh.numberofvertices,1))
    30 md.hydrology.spcsediment_head=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
    31 pos=numpy.nonzero(md.mesh.y==0.)[0]
     30md.initialization.sediment_head=np.zeros((md.mesh.numberofvertices))
     31md.hydrology.spcsediment_head=float('NaN')*np.ones((md.mesh.numberofvertices))
     32pos=np.nonzero(md.mesh.y==0.)[0]
    3233md.hydrology.spcsediment_head[pos]=0.0
    33 md.basalforcings.groundedice_melting_rate = 2.0*numpy.ones((md.mesh.numberofvertices,1))
    34 md.basalforcings.floatingice_melting_rate = 0.0*numpy.ones((md.mesh.numberofvertices,1))
    35 md.hydrology.sediment_transmitivity= 3.0*numpy.ones((md.mesh.numberofvertices,1))
     34md.basalforcings.groundedice_melting_rate = 2.0*np.ones((md.mesh.numberofvertices))
     35md.basalforcings.floatingice_melting_rate = 0.0*np.ones((md.mesh.numberofvertices))
     36md.hydrology.sediment_transmitivity= 3.0*np.ones((md.mesh.numberofvertices))
    3637md.timestepping.time_step=0
    3738md.timestepping.final_time=1.0
  • issm/trunk-jpl/test/NightlyRun/test333.py

    r21281 r21408  
    22import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    89from setflowequation import *
    910from solve import *
    10 from MatlabFuncs import *
     11
    1112
    1213from generic import generic
    … …  
    1920md.transient.issmb=True
    2021md=setflowequation(md,'SSA','all')
    21 md.cluster=generic('name',oshostname(),'np',1)
     22md.cluster=generic('name',gethostname(),'np',1)
    2223md.hydrology=hydrologydc()
    2324md.hydrology=md.hydrology.initialize(md)
    … …  
    2627md.hydrology.sedimentlimit_flag=1
    2728md.hydrology.sedimentlimit=800.0
    28 md.initialization.sediment_head=np.zeros((md.mesh.numberofvertices,1))
    29 md.hydrology.spcsediment_head=float('NaN')*np.ones((md.mesh.numberofvertices,1))
     29md.initialization.sediment_head=np.zeros((md.mesh.numberofvertices))
     30md.hydrology.spcsediment_head=float('NaN')*np.ones((md.mesh.numberofvertices))
    3031
    31 md.basalforcings.groundedice_melting_rate = 2.0*np.ones((md.mesh.numberofvertices,1))
    32 md.basalforcings.floatingice_melting_rate = 0.0*np.ones((md.mesh.numberofvertices,1))
    33 md.hydrology.sediment_transmitivity= 3.0*np.ones((md.mesh.numberofvertices,1))
     32md.basalforcings.groundedice_melting_rate = 2.0*np.ones((md.mesh.numberofvertices))
     33md.basalforcings.floatingice_melting_rate = 0.0*np.ones((md.mesh.numberofvertices))
     34md.hydrology.sediment_transmitivity= 3.0*np.ones((md.mesh.numberofvertices))
    3435
    35 md.initialization.epl_head=np.zeros((md.mesh.numberofvertices,1))
    36 md.initialization.epl_thickness=np.ones((md.mesh.numberofvertices,1))
    37 md.hydrology.spcepl_head=float('NaN')*np.ones((md.mesh.numberofvertices,1))
    38 md.hydrology.mask_eplactive_node=np.zeros((md.mesh.numberofvertices,1))
     36md.initialization.epl_head=np.zeros((md.mesh.numberofvertices))
     37md.initialization.epl_thickness=np.ones((md.mesh.numberofvertices))
     38md.hydrology.spcepl_head=float('NaN')*np.ones((md.mesh.numberofvertices))
     39md.hydrology.mask_eplactive_node=np.zeros((md.mesh.numberofvertices))
    3940md.hydrology.epl_conductivity=30
    4041md.hydrology.epl_initial_thickness=1
    … …  
    5051eplvol=np.zeros(10)
    5152time=np.arange(0.2,2.1,0.2)
    52 store=md.constants.g*md.hydrology.sediment_porosity*md.materials.rho_freshwater*((md.hydrology.sediment_compressibility/md.hydrology.sediment_porosity)+md.hydrology.water_compressibility);
    53 sedstore=20.0*store;
     53store=md.constants.g*md.hydrology.sediment_porosity*md.materials.rho_freshwater*((md.hydrology.sediment_compressibility/md.hydrology.sediment_porosity)+md.hydrology.water_compressibility)
     54sedstore=20.0*store
    5455for i in range(0,10):
    5556        sedvol[i]=np.mean(md.results.TransientSolution[i].SedimentHead)*sedstore
  • issm/trunk-jpl/test/NightlyRun/test334.py

    r21281 r21408  
    22import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    89from setflowequation import *
    910from solve import *
    10 from MatlabFuncs import *
     11
    1112
    1213from generic import generic
    … …  
    1819md.transient.ishydrology=True
    1920md=setflowequation(md,'SSA','all')
    20 md.cluster=generic('name',oshostname(),'np',1)
     21md.cluster=generic('name',gethostname(),'np',1)
    2122md.hydrology=hydrologydc()
    2223md.hydrology=md.hydrology.initialize(md)
    … …  
    2526md.hydrology.sedimentlimit_flag=1
    2627md.hydrology.sedimentlimit=8000.0
    27 md.initialization.sediment_head=np.zeros((md.mesh.numberofvertices,1))
    28 md.hydrology.spcsediment_head=float('NaN')*np.ones((md.mesh.numberofvertices,1))
     28md.initialization.sediment_head=np.zeros((md.mesh.numberofvertices))
     29md.hydrology.spcsediment_head=float('NaN')*np.ones((md.mesh.numberofvertices))
    2930md.hydrology.spcsediment_head[np.where(md.mesh.y==0)]=0.0
    3031
    31 md.basalforcings.groundedice_melting_rate = 2.0*np.ones((md.mesh.numberofvertices,1))
    32 md.basalforcings.floatingice_melting_rate = 0.0*np.ones((md.mesh.numberofvertices,1))
    33 md.hydrology.sediment_transmitivity= 3.0*np.ones((md.mesh.numberofvertices,1))
     32md.basalforcings.groundedice_melting_rate = 2.0*np.ones((md.mesh.numberofvertices))
     33md.basalforcings.floatingice_melting_rate = 0.0*np.ones((md.mesh.numberofvertices))
     34md.hydrology.sediment_transmitivity= 3.0*np.ones((md.mesh.numberofvertices))
    3435
    3536md.timestepping.time_step=0
  • issm/trunk-jpl/test/NightlyRun/test335.py

    r21281 r21408  
    22import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    89from setflowequation import *
    910from solve import *
    10 from MatlabFuncs import *
     11
    1112
    1213from generic import generic
    … …  
    1920md.transient.issmb=True
    2021md=setflowequation(md,'SSA','all')
    21 md.cluster=generic('name',oshostname(),'np',1)
     22md.cluster=generic('name',gethostname(),'np',1)
    2223md.hydrology=hydrologydc()
    2324md.hydrology=md.hydrology.initialize(md)
    … …  
    2627md.hydrology.sedimentlimit_flag=1
    2728md.hydrology.sedimentlimit=800.0
    28 md.initialization.sediment_head=np.zeros((md.mesh.numberofvertices,1))
    29 md.hydrology.spcsediment_head=float('NaN')*np.ones((md.mesh.numberofvertices,1))
    30 md.basalforcings.groundedice_melting_rate = 2.0*np.ones((md.mesh.numberofvertices,1))
    31 md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices,1))
    32 md.hydrology.sediment_transmitivity=3*np.ones((md.mesh.numberofvertices,1))
     29md.initialization.sediment_head=np.zeros((md.mesh.numberofvertices))
     30md.hydrology.spcsediment_head=float('NaN')*np.ones((md.mesh.numberofvertices))
     31md.basalforcings.groundedice_melting_rate = 2.0*np.ones((md.mesh.numberofvertices))
     32md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices))
     33md.hydrology.sediment_transmitivity=3*np.ones((md.mesh.numberofvertices))
    3334
    34 md.initialization.epl_head=np.zeros((md.mesh.numberofvertices,1))
    35 md.initialization.epl_thickness=np.ones((md.mesh.numberofvertices,1))
    36 md.hydrology.spcepl_head=float('NaN')*np.ones((md.mesh.numberofvertices,1))
    37 md.hydrology.mask_eplactive_node=np.zeros((md.mesh.numberofvertices,1))
     35md.initialization.epl_head=np.zeros((md.mesh.numberofvertices))
     36md.initialization.epl_thickness=np.ones((md.mesh.numberofvertices))
     37md.hydrology.spcepl_head=float('NaN')*np.ones((md.mesh.numberofvertices))
     38md.hydrology.mask_eplactive_node=np.zeros((md.mesh.numberofvertices))
    3839md.hydrology.epl_conductivity=30
    3940md.hydrology.epl_initial_thickness=1
  • issm/trunk-jpl/test/NightlyRun/test336.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedSmbComponents2d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1314md=parameterize(md,'../Par/SquareShelf.py')
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617
    1718md.timestepping.time_step=1.
    … …  
    2021
    2122#Set up transient
    22 smb=numpy.ones((md.mesh.numberofvertices,1))*3.6
    23 smb=numpy.hstack((smb,smb*-1.))
     23smb=np.ones((md.mesh.numberofvertices))*3.6
     24smb=np.vstack((smb,smb*-1.)).T
    2425
    25 md.smb=SMBcomponents();
    26 md.smb.accumulation=numpy.vstack((smb*2, [1.5,3.]));
    27 md.smb.runoff=numpy.vstack((smb/2, [1.5,3.]));
    28 md.smb.evaporation=numpy.vstack((smb/2, [1.5,3.]));
     26md.smb=SMBcomponents()
     27md.smb.accumulation=np.vstack((smb*2, [1.5,3.]))
     28md.smb.runoff=np.vstack((smb/2, [1.5,3.]))
     29md.smb.evaporation=np.vstack((smb/2, [1.5,3.]))
    2930md.transient.isthermal=False
    3031
    … …  
    3233
    3334#Fields and tolerances to track changes
    34 field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1', \
    35         'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2', \
    36         'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3', \
    37         'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
    38 field_tolerances=[1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
    39         1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
    40         1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
    41         1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
    42 field_values=[\
    43         md.results.TransientSolution[0].Vx,\
    44         md.results.TransientSolution[0].Vy,\
    45         md.results.TransientSolution[0].Vel,\
    46         md.results.TransientSolution[0].Pressure,\
    47         md.results.TransientSolution[0].Base,\
    48         md.results.TransientSolution[0].Surface,\
    49         md.results.TransientSolution[0].Thickness,\
    50         md.results.TransientSolution[0].SmbMassBalance,\
    51         md.results.TransientSolution[1].Vx,\
    52         md.results.TransientSolution[1].Vy,\
    53         md.results.TransientSolution[1].Vel,\
    54         md.results.TransientSolution[1].Pressure,\
    55         md.results.TransientSolution[1].Base,\
    56         md.results.TransientSolution[1].Surface,\
    57         md.results.TransientSolution[1].Thickness,\
    58         md.results.TransientSolution[1].SmbMassBalance,\
    59         md.results.TransientSolution[2].Vx,\
    60         md.results.TransientSolution[2].Vy,\
    61         md.results.TransientSolution[2].Vel,\
    62         md.results.TransientSolution[2].Pressure,\
    63         md.results.TransientSolution[2].Base,\
    64         md.results.TransientSolution[2].Surface,\
    65         md.results.TransientSolution[2].Thickness,\
    66         md.results.TransientSolution[2].SmbMassBalance,\
    67         md.results.TransientSolution[3].Vx,\
    68         md.results.TransientSolution[3].Vy,\
    69         md.results.TransientSolution[3].Vel,\
    70         md.results.TransientSolution[3].Pressure,\
    71         md.results.TransientSolution[3].Base,\
    72         md.results.TransientSolution[3].Surface,\
    73         md.results.TransientSolution[3].Thickness,\
    74         md.results.TransientSolution[3].SmbMassBalance,\
    75         ]
     35field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',
     36                                                 'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',
     37                                                 'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3',
     38                                                 'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
     39field_tolerances=[1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
     40                                                                        1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
     41                                                                        1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
     42                                                                        1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
     43field_values=[md.results.TransientSolution[0].Vx,
     44                                                        md.results.TransientSolution[0].Vy,
     45                                                        md.results.TransientSolution[0].Vel,
     46                                                        md.results.TransientSolution[0].Pressure,
     47                                                        md.results.TransientSolution[0].Base,
     48                                                        md.results.TransientSolution[0].Surface,
     49                                                        md.results.TransientSolution[0].Thickness,
     50                                                        md.results.TransientSolution[0].SmbMassBalance,
     51                                                        md.results.TransientSolution[1].Vx,
     52                                                        md.results.TransientSolution[1].Vy,
     53                                                        md.results.TransientSolution[1].Vel,
     54                                                        md.results.TransientSolution[1].Pressure,
     55                                                        md.results.TransientSolution[1].Base,
     56                                                        md.results.TransientSolution[1].Surface,
     57                                                        md.results.TransientSolution[1].Thickness,
     58                                                        md.results.TransientSolution[1].SmbMassBalance,
     59                                                        md.results.TransientSolution[2].Vx,
     60                                                        md.results.TransientSolution[2].Vy,
     61                                                        md.results.TransientSolution[2].Vel,
     62                                                        md.results.TransientSolution[2].Pressure,
     63                                                        md.results.TransientSolution[2].Base,
     64                                                        md.results.TransientSolution[2].Surface,
     65                                                        md.results.TransientSolution[2].Thickness,
     66                                                        md.results.TransientSolution[2].SmbMassBalance,
     67                                                        md.results.TransientSolution[3].Vx,
     68                                                        md.results.TransientSolution[3].Vy,
     69                                                        md.results.TransientSolution[3].Vel,
     70                                                        md.results.TransientSolution[3].Pressure,
     71                                                        md.results.TransientSolution[3].Base,
     72                                                        md.results.TransientSolution[3].Surface,
     73                                                        md.results.TransientSolution[3].Thickness,
     74                                                        md.results.TransientSolution[3].SmbMassBalance]
  • issm/trunk-jpl/test/NightlyRun/test337.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedSmbComponents3d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1415md.extrude(3,1.)
    1516md=setflowequation(md,'HO','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718
    1819md.timestepping.time_step=1.
    … …  
    2122
    2223#Set up transient
    23 smb=numpy.ones((md.mesh.numberofvertices,1))*3.6
    24 smb=numpy.hstack((smb,smb*-1.))
     24smb=np.ones((md.mesh.numberofvertices))*3.6
     25smb=np.vstack((smb,smb*-1.)).T
    2526
    26 md.smb=SMBcomponents();
    27 md.smb.accumulation=numpy.vstack((smb*2, [1.5,3.]));
    28 md.smb.runoff=numpy.vstack((smb/2, [1.5,3.]));
    29 md.smb.evaporation=numpy.vstack((smb/2, [1.5,3.]));
     27md.smb=SMBcomponents()
     28md.smb.accumulation=np.vstack((smb*2, [1.5,3.]))
     29md.smb.runoff=np.vstack((smb/2, [1.5,3.]))
     30md.smb.evaporation=np.vstack((smb/2, [1.5,3.]))
    3031md.transient.isthermal=False
    3132
    … …  
    3334
    3435#Fields and tolerances to track changes
    35 field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1', \
    36         'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2', \
    37         'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3', \
    38         'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
    39 field_tolerances=[\
    40                 5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,\
    41                 5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,\
    42                 5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,\
    43                 5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10]
    44 field_values=[\
    45         md.results.TransientSolution[0].Vx,\
    46         md.results.TransientSolution[0].Vy,\
    47         md.results.TransientSolution[0].Vel,\
    48         md.results.TransientSolution[0].Pressure,\
    49         md.results.TransientSolution[0].Base,\
    50         md.results.TransientSolution[0].Surface,\
    51         md.results.TransientSolution[0].Thickness,\
    52         md.results.TransientSolution[0].SmbMassBalance,\
    53         md.results.TransientSolution[1].Vx,\
    54         md.results.TransientSolution[1].Vy,\
    55         md.results.TransientSolution[1].Vel,\
    56         md.results.TransientSolution[1].Pressure,\
    57         md.results.TransientSolution[1].Base,\
    58         md.results.TransientSolution[1].Surface,\
    59         md.results.TransientSolution[1].Thickness,\
    60         md.results.TransientSolution[1].SmbMassBalance,\
    61         md.results.TransientSolution[2].Vx,\
    62         md.results.TransientSolution[2].Vy,\
    63         md.results.TransientSolution[2].Vel,\
    64         md.results.TransientSolution[2].Pressure,\
    65         md.results.TransientSolution[2].Base,\
    66         md.results.TransientSolution[2].Surface,\
    67         md.results.TransientSolution[2].Thickness,\
    68         md.results.TransientSolution[2].SmbMassBalance,\
    69         md.results.TransientSolution[3].Vx,\
    70         md.results.TransientSolution[3].Vy,\
    71         md.results.TransientSolution[3].Vel,\
    72         md.results.TransientSolution[3].Pressure,\
    73         md.results.TransientSolution[3].Base,\
    74         md.results.TransientSolution[3].Surface,\
    75         md.results.TransientSolution[3].Thickness,\
    76         md.results.TransientSolution[3].SmbMassBalance,\
    77         ]
     36field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',
     37                                                 'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',
     38                                                 'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3',
     39                                                 'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
     40field_tolerances=[5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,
     41                                                                        5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,
     42                                                                        5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,
     43                                                                        5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10]
     44field_values=[md.results.TransientSolution[0].Vx,
     45                                                        md.results.TransientSolution[0].Vy,
     46                                                        md.results.TransientSolution[0].Vel,
     47                                                        md.results.TransientSolution[0].Pressure,
     48                                                        md.results.TransientSolution[0].Base,
     49                                                        md.results.TransientSolution[0].Surface,
     50                                                        md.results.TransientSolution[0].Thickness,
     51                                                        md.results.TransientSolution[0].SmbMassBalance,
     52                                                        md.results.TransientSolution[1].Vx,
     53                                                        md.results.TransientSolution[1].Vy,
     54                                                        md.results.TransientSolution[1].Vel,
     55                                                        md.results.TransientSolution[1].Pressure,
     56                                                        md.results.TransientSolution[1].Base,
     57                                                        md.results.TransientSolution[1].Surface,
     58                                                        md.results.TransientSolution[1].Thickness,
     59                                                        md.results.TransientSolution[1].SmbMassBalance,
     60                                                        md.results.TransientSolution[2].Vx,
     61                                                        md.results.TransientSolution[2].Vy,
     62                                                        md.results.TransientSolution[2].Vel,
     63                                                        md.results.TransientSolution[2].Pressure,
     64                                                        md.results.TransientSolution[2].Base,
     65                                                        md.results.TransientSolution[2].Surface,
     66                                                        md.results.TransientSolution[2].Thickness,
     67                                                        md.results.TransientSolution[2].SmbMassBalance,
     68                                                        md.results.TransientSolution[3].Vx,
     69                                                        md.results.TransientSolution[3].Vy,
     70                                                        md.results.TransientSolution[3].Vel,
     71                                                        md.results.TransientSolution[3].Pressure,
     72                                                        md.results.TransientSolution[3].Base,
     73                                                        md.results.TransientSolution[3].Surface,
     74                                                        md.results.TransientSolution[3].Thickness,
     75                                                        md.results.TransientSolution[3].SmbMassBalance]
  • issm/trunk-jpl/test/NightlyRun/test338.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedSmbMeltComponents2d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1314md=parameterize(md,'../Par/SquareShelf.py')
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617
    1718md.timestepping.time_step=1.
    1819md.settings.output_frequency=1
    19 md.timestepping.final_time=4.
     20md.timestepping.final_time=400.
    2021
    2122#Set up transient
    22 smb=numpy.ones((md.mesh.numberofvertices,1))*3.6
    23 smb=numpy.hstack((smb,smb*-1.))
     23smb=np.ones((md.mesh.numberofvertices))*3.6
     24smb=np.vstack((smb,smb*-1.)).T
    2425
    25 md.smb=SMBmeltcomponents();
    26 md.smb.accumulation=numpy.vstack((smb, [1.5,3.]));
    27 md.smb.evaporation=numpy.vstack((smb/2, [1.5,3.]));
    28 md.smb.melt=numpy.vstack((smb/2, [1.5,3.]));
    29 md.smb.refreeze=numpy.vstack((smb, [1.5,3.]));
     26md.smb=SMBmeltcomponents()
     27md.smb.accumulation=np.vstack((smb, [1.5,3.]))
     28md.smb.evaporation=np.vstack((smb/2, [1.5,3.]))
     29md.smb.melt=np.vstack((smb/2, [1.5,3.]))
     30md.smb.refreeze=np.vstack((smb, [1.5,3.]))
    3031md.transient.isthermal=False
    3132
    … …  
    3334
    3435#Fields and tolerances to track changes
    35 field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1', \
    36         'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2', \
    37         'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3', \
    38         'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
    39 field_tolerances=[1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
    40         1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
    41         1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
    42         1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
    43 field_values=[\
    44         md.results.TransientSolution[0].Vx,\
    45         md.results.TransientSolution[0].Vy,\
    46         md.results.TransientSolution[0].Vel,\
    47         md.results.TransientSolution[0].Pressure,\
    48         md.results.TransientSolution[0].Base,\
    49         md.results.TransientSolution[0].Surface,\
    50         md.results.TransientSolution[0].Thickness,\
    51         md.results.TransientSolution[0].SmbMassBalance,\
    52         md.results.TransientSolution[1].Vx,\
    53         md.results.TransientSolution[1].Vy,\
    54         md.results.TransientSolution[1].Vel,\
    55         md.results.TransientSolution[1].Pressure,\
    56         md.results.TransientSolution[1].Base,\
    57         md.results.TransientSolution[1].Surface,\
    58         md.results.TransientSolution[1].Thickness,\
    59         md.results.TransientSolution[1].SmbMassBalance,\
    60         md.results.TransientSolution[2].Vx,\
    61         md.results.TransientSolution[2].Vy,\
    62         md.results.TransientSolution[2].Vel,\
    63         md.results.TransientSolution[2].Pressure,\
    64         md.results.TransientSolution[2].Base,\
    65         md.results.TransientSolution[2].Surface,\
    66         md.results.TransientSolution[2].Thickness,\
    67         md.results.TransientSolution[2].SmbMassBalance,\
    68         md.results.TransientSolution[3].Vx,\
    69         md.results.TransientSolution[3].Vy,\
    70         md.results.TransientSolution[3].Vel,\
    71         md.results.TransientSolution[3].Pressure,\
    72         md.results.TransientSolution[3].Base,\
    73         md.results.TransientSolution[3].Surface,\
    74         md.results.TransientSolution[3].Thickness,\
    75         md.results.TransientSolution[3].SmbMassBalance,\
    76         ]
     36field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',
     37                                                 'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',
     38                                                 'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3',
     39                                                 'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
     40field_tolerances=[1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
     41                                                                        1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
     42                                                                        1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
     43                                                                        1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
     44field_values=[md.results.TransientSolution[0].Vx,
     45                                                        md.results.TransientSolution[0].Vy,
     46                                                        md.results.TransientSolution[0].Vel,
     47                                                        md.results.TransientSolution[0].Pressure,
     48                                                        md.results.TransientSolution[0].Base,
     49                                                        md.results.TransientSolution[0].Surface,
     50                                                        md.results.TransientSolution[0].Thickness,
     51                                                        md.results.TransientSolution[0].SmbMassBalance,
     52                                                        md.results.TransientSolution[1].Vx,
     53                                                        md.results.TransientSolution[1].Vy,
     54                                                        md.results.TransientSolution[1].Vel,
     55                                                        md.results.TransientSolution[1].Pressure,
     56                                                        md.results.TransientSolution[1].Base,
     57                                                        md.results.TransientSolution[1].Surface,
     58                                                        md.results.TransientSolution[1].Thickness,
     59                                                        md.results.TransientSolution[1].SmbMassBalance,
     60                                                        md.results.TransientSolution[2].Vx,
     61                                                        md.results.TransientSolution[2].Vy,
     62                                                        md.results.TransientSolution[2].Vel,
     63                                                        md.results.TransientSolution[2].Pressure,
     64                                                        md.results.TransientSolution[2].Base,
     65                                                        md.results.TransientSolution[2].Surface,
     66                                                        md.results.TransientSolution[2].Thickness,
     67                                                        md.results.TransientSolution[2].SmbMassBalance,
     68                                                        md.results.TransientSolution[3].Vx,
     69                                                        md.results.TransientSolution[3].Vy,
     70                                                        md.results.TransientSolution[3].Vel,
     71                                                        md.results.TransientSolution[3].Pressure,
     72                                                        md.results.TransientSolution[3].Base,
     73                                                        md.results.TransientSolution[3].Surface,
     74                                                        md.results.TransientSolution[3].Thickness,
     75                                                        md.results.TransientSolution[3].SmbMassBalance]
  • issm/trunk-jpl/test/NightlyRun/test339.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedSmbMeltComponents3d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Square.exp',150000.)
    … …  
    1415md.extrude(3,1.)
    1516md=setflowequation(md,'HO','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718
    1819md.timestepping.time_step=1.
    … …  
    2122
    2223#Set up transient
    23 smb=numpy.ones((md.mesh.numberofvertices,1))*3.6
    24 smb=numpy.hstack((smb,smb*-1.))
     24smb=np.ones((md.mesh.numberofvertices))*3.6
     25smb=np.vstack((smb,smb*-1.)).T
    2526
    26 md.smb=SMBmeltcomponents();
    27 md.smb.accumulation=numpy.vstack((smb, [1.5,3.]));
    28 md.smb.evaporation=numpy.vstack((smb/2, [1.5,3.]));
    29 md.smb.melt=numpy.vstack((smb/2, [1.5,3.]));
    30 md.smb.refreeze=numpy.vstack((smb, [1.5,3.]));
     27md.smb=SMBmeltcomponents()
     28md.smb.accumulation=np.vstack((smb, [1.5,3.]))
     29md.smb.evaporation=np.vstack((smb/2, [1.5,3.]))
     30md.smb.melt=np.vstack((smb/2, [1.5,3.]))
     31md.smb.refreeze=np.vstack((smb, [1.5,3.]))
    3132md.transient.isthermal=False
    3233
    … …  
    3435
    3536#Fields and tolerances to track changes
    36 field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1', \
    37         'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2', \
    38         'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3', \
    39         'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
    40 field_tolerances=[\
    41                 1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,\
    42                 1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,\
    43                 1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,\
    44                 1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10]
    45 field_values=[\
    46         md.results.TransientSolution[0].Vx,\
    47         md.results.TransientSolution[0].Vy,\
    48         md.results.TransientSolution[0].Vel,\
    49         md.results.TransientSolution[0].Pressure,\
    50         md.results.TransientSolution[0].Base,\
    51         md.results.TransientSolution[0].Surface,\
    52         md.results.TransientSolution[0].Thickness,\
    53         md.results.TransientSolution[0].SmbMassBalance,\
    54         md.results.TransientSolution[1].Vx,\
    55         md.results.TransientSolution[1].Vy,\
    56         md.results.TransientSolution[1].Vel,\
    57         md.results.TransientSolution[1].Pressure,\
    58         md.results.TransientSolution[1].Base,\
    59         md.results.TransientSolution[1].Surface,\
    60         md.results.TransientSolution[1].Thickness,\
    61         md.results.TransientSolution[1].SmbMassBalance,\
    62         md.results.TransientSolution[2].Vx,\
    63         md.results.TransientSolution[2].Vy,\
    64         md.results.TransientSolution[2].Vel,\
    65         md.results.TransientSolution[2].Pressure,\
    66         md.results.TransientSolution[2].Base,\
    67         md.results.TransientSolution[2].Surface,\
    68         md.results.TransientSolution[2].Thickness,\
    69         md.results.TransientSolution[2].SmbMassBalance,\
    70         md.results.TransientSolution[3].Vx,\
    71         md.results.TransientSolution[3].Vy,\
    72         md.results.TransientSolution[3].Vel,\
    73         md.results.TransientSolution[3].Pressure,\
    74         md.results.TransientSolution[3].Base,\
    75         md.results.TransientSolution[3].Surface,\
    76         md.results.TransientSolution[3].Thickness,\
    77         md.results.TransientSolution[3].SmbMassBalance,\
    78         ]
     37field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',
     38                                                 'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',
     39                                                 'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3',
     40                                                 'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
     41field_tolerances=[1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,
     42                                                                        1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,
     43                                                                        1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,
     44                                                                        1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10]
     45field_values=[md.results.TransientSolution[0].Vx,
     46                                                        md.results.TransientSolution[0].Vy,
     47                                                        md.results.TransientSolution[0].Vel,
     48                                                        md.results.TransientSolution[0].Pressure,
     49                                                        md.results.TransientSolution[0].Base,
     50                                                        md.results.TransientSolution[0].Surface,
     51                                                        md.results.TransientSolution[0].Thickness,
     52                                                        md.results.TransientSolution[0].SmbMassBalance,
     53                                                        md.results.TransientSolution[1].Vx,
     54                                                        md.results.TransientSolution[1].Vy,
     55                                                        md.results.TransientSolution[1].Vel,
     56                                                        md.results.TransientSolution[1].Pressure,
     57                                                        md.results.TransientSolution[1].Base,
     58                                                        md.results.TransientSolution[1].Surface,
     59                                                        md.results.TransientSolution[1].Thickness,
     60                                                        md.results.TransientSolution[1].SmbMassBalance,
     61                                                        md.results.TransientSolution[2].Vx,
     62                                                        md.results.TransientSolution[2].Vy,
     63                                                        md.results.TransientSolution[2].Vel,
     64                                                        md.results.TransientSolution[2].Pressure,
     65                                                        md.results.TransientSolution[2].Base,
     66                                                        md.results.TransientSolution[2].Surface,
     67                                                        md.results.TransientSolution[2].Thickness,
     68                                                        md.results.TransientSolution[2].SmbMassBalance,
     69                                                        md.results.TransientSolution[3].Vx,
     70                                                        md.results.TransientSolution[3].Vy,
     71                                                        md.results.TransientSolution[3].Vel,
     72                                                        md.results.TransientSolution[3].Pressure,
     73                                                        md.results.TransientSolution[3].Base,
     74                                                        md.results.TransientSolution[3].Surface,
     75                                                        md.results.TransientSolution[3].Thickness,
     76                                                        md.results.TransientSolution[3].SmbMassBalance]
  • issm/trunk-jpl/test/NightlyRun/test341.py

    r21060 r21408  
    11#Test Name: SquareSheetConstrainedCMm1qn3DragHO
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from m1qn3inversion import *
    56from triangle import *
    … …  
    89from setflowequation import *
    910from solve import *
    10 from MatlabFuncs import *
    1111
    12 md=triangle(model(),'../Exp/Square.exp',200000.);
    13 md=setmask(md,'','');
    14 md=parameterize(md,'../Par/SquareSheetConstrained.py');
     12
     13md=triangle(model(),'../Exp/Square.exp',200000.)
     14md=setmask(md,'','')
     15md=parameterize(md,'../Par/SquareSheetConstrained.py')
    1516md.extrude(3,1.)
    16 md=setflowequation(md,'HO','all');
     17md=setflowequation(md,'HO','all')
    1718
    1819#control parameters
    19 md.inversion=m1qn3inversion(md.inversion);
    20 md.inversion.iscontrol=1;
     20md.inversion=m1qn3inversion(md.inversion)
     21md.inversion.iscontrol=1
    2122md.inversion.control_parameters=['FrictionCoefficient']
    22 md.inversion.min_parameters=1.*numpy.ones((md.mesh.numberofvertices,1))
    23 md.inversion.max_parameters=200.*numpy.ones((md.mesh.numberofvertices,1))
     23md.inversion.min_parameters=1.*np.ones((md.mesh.numberofvertices))
     24md.inversion.max_parameters=200.*np.ones((md.mesh.numberofvertices))
    2425md.inversion.maxsteps=2
    2526md.inversion.maxiter=6
    2627md.inversion.cost_functions=[102,501]
    27 md.inversion.cost_functions_coefficients=numpy.ones((md.mesh.numberofvertices,2))
     28md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices,2))
    2829md.inversion.cost_functions_coefficients[:,1]=2.*10**-7
    29 md.inversion.vx_obs=md.initialization.vx;
    30 md.inversion.vy_obs=md.initialization.vy;
     30md.inversion.vx_obs=md.initialization.vx
     31md.inversion.vy_obs=md.initialization.vy
    3132
    32 md.cluster=generic('name',oshostname(),'np',3);
    33 md=solve(md,'Stressbalance');
     33md.cluster=generic('name',gethostname(),'np',3)
     34md=solve(md,'Stressbalance')
    3435
    3536#Fields and tolerances to track changes
  • issm/trunk-jpl/test/NightlyRun/test401.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfStressSSA2d
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1314md=parameterize(md,'../Par/SquareSheetShelf.py')
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'Stressbalance')
    1718
  • issm/trunk-jpl/test/NightlyRun/test402.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfStressSSA3d
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1415md.extrude(4,1.)
    1516md=setflowequation(md,'SSA','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md=solve(md,'Stressbalance')
    1819
  • issm/trunk-jpl/test/NightlyRun/test403.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfStressHO
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1415md.extrude(5,1.)
    1516md=setflowequation(md,'HO','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md=solve(md,'Stressbalance')
    1819
  • issm/trunk-jpl/test/NightlyRun/test404.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfStressFS
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1415md.extrude(3,1.)
    1516md=setflowequation(md,'FS','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md=solve(md,'Stressbalance')
    1819
  • issm/trunk-jpl/test/NightlyRun/test405.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfStressMHOPenalties
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1415md.extrude(5,1.)
    1516md=setflowequation(md,'SSA','../Exp/SquareHalfRight.exp','fill','HO','coupling','penalties')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md=solve(md,'Stressbalance')
    1819
  • issm/trunk-jpl/test/NightlyRun/test406.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfTherStea
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1415md.extrude(4,1.)
    1516md=setflowequation(md,'HO','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md.timestepping.time_step=0.
    1819md=solve(md,'Thermal')
  • issm/trunk-jpl/test/NightlyRun/test407.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfTherTran
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1415md.extrude(4,1.)
    1516md=setflowequation(md,'HO','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md.transient.isstressbalance=False
    1819md.transient.ismasstransport=False
  • issm/trunk-jpl/test/NightlyRun/test408.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfTranSSA3d
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1516md=setflowequation(md,'SSA','all')
    1617md.transient.isthermal=False
    17 md.cluster=generic('name',oshostname(),'np',3)
     18md.cluster=generic('name',gethostname(),'np',3)
    1819md.transient.requested_outputs=['default','GroundedArea','FloatingArea','TotalFloatingBmb','TotalGroundedBmb','TotalSmb']
    1920md=solve(md,'Transient')
  • issm/trunk-jpl/test/NightlyRun/test409.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfTranMHOPenalties
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1415md.extrude(3,1.)
    1516md=setflowequation(md,'SSA','../Exp/SquareHalfRight.exp','fill','HO','coupling','penalties')
    16 md.cluster=generic('name',oshostname(),'np',3)
    17 md.transient.requested_outputs=['default','GroundedArea'];
     17md.cluster=generic('name',gethostname(),'np',3)
     18md.transient.requested_outputs=['default','GroundedArea']
    1819md=solve(md,'Transient')
    1920
  • issm/trunk-jpl/test/NightlyRun/test410.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfSteaSSA3d
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1415md.extrude(3,2.)
    1516md=setflowequation(md,'SSA','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md.timestepping.time_step=0
    1819md=solve(md,'Steadystate')
  • issm/trunk-jpl/test/NightlyRun/test411.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfSteaHO
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1415md.extrude(3,2.)
    1516md=setflowequation(md,'HO','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md.timestepping.time_step=0.
    1819md=solve(md,'Steadystate')
  • issm/trunk-jpl/test/NightlyRun/test415.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfCMDragSteaSSA3d
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1819md.inversion.iscontrol=1
    1920md.inversion.control_parameters=['FrictionCoefficient']
    20 md.inversion.min_parameters=1.*numpy.ones((md.mesh.numberofvertices,1))
    21 md.inversion.max_parameters=200.*numpy.ones((md.mesh.numberofvertices,1))
     21md.inversion.min_parameters=1.*np.ones((md.mesh.numberofvertices))
     22md.inversion.max_parameters=200.*np.ones((md.mesh.numberofvertices))
    2223md.inversion.nsteps=2
    2324md.inversion.cost_functions=[103,501]
    24 md.inversion.cost_functions_coefficients=numpy.ones((md.mesh.numberofvertices,2))
     25md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices,2))
    2526md.inversion.cost_functions_coefficients[:,1]=2.*10**-7
    26 md.inversion.gradient_scaling=3.*numpy.ones((md.inversion.nsteps,1))
    27 md.inversion.maxiter_per_step=2*numpy.ones((md.inversion.nsteps,1))
    28 md.inversion.step_threshold=0.3*numpy.ones((md.inversion.nsteps,1))
     27md.inversion.gradient_scaling=3.*np.ones((md.inversion.nsteps))
     28md.inversion.maxiter_per_step=2*np.ones((md.inversion.nsteps))
     29md.inversion.step_threshold=0.3*np.ones((md.inversion.nsteps))
    2930md.timestepping.time_step=0.
    3031md.inversion.vx_obs=md.initialization.vx
    3132md.inversion.vy_obs=md.initialization.vy
    3233
    33 md.cluster=generic('name',oshostname(),'np',3)
     34md.cluster=generic('name',gethostname(),'np',3)
    3435md=solve(md,'Steadystate')
    3536
  • issm/trunk-jpl/test/NightlyRun/test416.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfCMDragSteaHO
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1819md.inversion.iscontrol=1
    1920md.inversion.control_parameters=['FrictionCoefficient']
    20 md.inversion.min_parameters=1.*numpy.ones((md.mesh.numberofvertices,1))
    21 md.inversion.max_parameters=200.*numpy.ones((md.mesh.numberofvertices,1))
     21md.inversion.min_parameters=1.*np.ones((md.mesh.numberofvertices))
     22md.inversion.max_parameters=200.*np.ones((md.mesh.numberofvertices))
    2223md.inversion.nsteps=2
    2324md.inversion.cost_functions=[102,501]
    24 md.inversion.cost_functions_coefficients=numpy.ones((md.mesh.numberofvertices,2))
     25md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices,2))
    2526md.inversion.cost_functions_coefficients[:,1]=2.*10**-7
    26 md.inversion.gradient_scaling=3.*numpy.ones((md.inversion.nsteps,1))
    27 md.inversion.maxiter_per_step=2*numpy.ones((md.inversion.nsteps,1))
    28 md.inversion.step_threshold=0.3*numpy.ones((md.inversion.nsteps,1))
     27md.inversion.gradient_scaling=3.*np.ones((md.inversion.nsteps))
     28md.inversion.maxiter_per_step=2*np.ones((md.inversion.nsteps))
     29md.inversion.step_threshold=0.3*np.ones((md.inversion.nsteps))
    2930md.timestepping.time_step=0.
    3031md.inversion.vx_obs=md.initialization.vx
    3132md.inversion.vy_obs=md.initialization.vy
    3233
    33 md.cluster=generic('name',oshostname(),'np',3)
     34md.cluster=generic('name',gethostname(),'np',3)
    3435md=solve(md,'Steadystate')
    3536
  • issm/trunk-jpl/test/NightlyRun/test419.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfStressSSAHOTiling
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1415md.extrude(5,1.)
    1516md=setflowequation(md,'SSA','../Exp/SquareHalfRight.exp','fill','HO')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md=solve(md,'Stressbalance')
    1819
  • issm/trunk-jpl/test/NightlyRun/test421.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfStressHOFS3dTiling
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1415md.extrude(5,1.)
    1516md=setflowequation(md,'FS','../Exp/SquareHalfRight.exp','fill','HO')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md=solve(md,'Stressbalance')
    1819
  • issm/trunk-jpl/test/NightlyRun/test422.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfStressSSAFS3dTiling
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1415md.extrude(5,1.)
    1516md=setflowequation(md,'FS','../Exp/SquareHalfRight.exp','fill','SSA')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md.stressbalance.reltol=0.4
    1819md=solve(md,'Stressbalance')
  • issm/trunk-jpl/test/NightlyRun/test423.py

    r21060 r21408  
    11#Test Name: RoundSheetShelfGLMigrationSSA2d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from roundmesh import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112radius=1.e6
    … …  
    1415md=roundmesh(model(),radius,50000.)
    1516#fix center node to 0,0
    16 rad=numpy.sqrt(md.mesh.x**2+md.mesh.y**2)
    17 pos=numpy.argmin(rad)
     17rad=np.sqrt(md.mesh.x**2+md.mesh.y**2)
     18pos=np.argmin(rad)
    1819md.mesh.x[pos]=0.
    1920md.mesh.y[pos]=0.    #the closest node to the center is changed to be exactly at the center
    20 xelem=numpy.mean(md.mesh.x[md.mesh.elements.astype(int)-1],axis=1)
    21 yelem=numpy.mean(md.mesh.y[md.mesh.elements.astype(int)-1],axis=1)
    22 rad=numpy.sqrt(xelem**2+yelem**2)
    23 flags=numpy.zeros(md.mesh.numberofelements)
    24 pos=numpy.nonzero(rad>=(radius-shelfextent))
     21xelem=np.mean(md.mesh.x[md.mesh.elements.astype(int)-1],axis=1)
     22yelem=np.mean(md.mesh.y[md.mesh.elements.astype(int)-1],axis=1)
     23rad=np.sqrt(xelem**2+yelem**2)
     24flags=np.zeros(md.mesh.numberofelements)
     25pos=np.nonzero(rad>=(radius-shelfextent))
    2526flags[pos]=1
    2627md=setmask(md,flags,'')
    2728md=parameterize(md,'../Par/RoundSheetShelf.py')
    2829md=setflowequation(md,'SSA','all')
    29 md.cluster=generic('name',oshostname(),'np',3)
     30md.cluster=generic('name',gethostname(),'np',3)
    3031
    3132md.transient.isthermal=False
  • issm/trunk-jpl/test/NightlyRun/test424.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfGroundingLine2dAggressive
    2 import numpy
    32from model import *
    4 from MatlabFuncs import *
     3from socket import gethostname
    54from triangle import *
    65from setmask import *
    … …  
    1514md.initialization.vx[:]=0.
    1615md.initialization.vy[:]=0.
    17 md.geometry.base=-700.-abs(md.mesh.y.reshape(-1,1)-500000.)/1000.
    18 md.geometry.bed =-700.-abs(md.mesh.y.reshape(-1,1)-500000.)/1000.
     16md.geometry.base=-700.-abs(md.mesh.y-500000.)/1000.
     17md.geometry.bed =-700.-abs(md.mesh.y-500000.)/1000.
    1918md.geometry.thickness[:]=1000.
    2019md.geometry.surface=md.geometry.base+md.geometry.thickness
    … …  
    2524md.transient.requested_outputs=['IceVolume','IceVolumeAboveFloatation']
    2625
    27 md.cluster=generic('name',oshostname(),'np',3)
     26md.cluster=generic('name',gethostname(),'np',3)
    2827md=solve(md,'Transient')
    2928
    3029#Fields and tolerances to track changes
    31 field_names     =['Bed1','Surface1','Thickness1','Floatingice1','IceVolume1','IceVolumeAboveFloatation1',\
    32         'Bed2','Surface2','Thickness2','Floatingice2','IceVolume2','IceVolumeAboveFloatation2',\
    33         'Bed3','Surface3','Thickness3','Floatingice3','IceVolume3','IceVolumeAboveFloatation3']
    34 field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    35         1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    36         1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
    37 field_values=[\
    38         md.results.TransientSolution[0].Base,\
    39         md.results.TransientSolution[0].Surface,\
    40         md.results.TransientSolution[0].Thickness,\
    41         md.results.TransientSolution[0].MaskGroundediceLevelset,\
    42         md.results.TransientSolution[0].IceVolume,\
    43         md.results.TransientSolution[0].IceVolumeAboveFloatation,\
    44         md.results.TransientSolution[1].Base,\
    45         md.results.TransientSolution[1].Surface,\
    46         md.results.TransientSolution[1].Thickness,\
    47         md.results.TransientSolution[1].MaskGroundediceLevelset,\
    48         md.results.TransientSolution[1].IceVolume,\
    49         md.results.TransientSolution[1].IceVolumeAboveFloatation,\
    50         md.results.TransientSolution[2].Base,\
    51         md.results.TransientSolution[2].Surface,\
    52         md.results.TransientSolution[2].Thickness,\
    53         md.results.TransientSolution[2].MaskGroundediceLevelset,\
    54         md.results.TransientSolution[2].IceVolume,\
    55         md.results.TransientSolution[2].IceVolumeAboveFloatation,\
    56         ]
     30field_names     =['Bed1','Surface1','Thickness1','Floatingice1','IceVolume1','IceVolumeAboveFloatation1',
     31                                                                        'Bed2','Surface2','Thickness2','Floatingice2','IceVolume2','IceVolumeAboveFloatation2',
     32                                                                        'Bed3','Surface3','Thickness3','Floatingice3','IceVolume3','IceVolumeAboveFloatation3']
     33field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
     34                                                                        1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
     35                                                                        1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
     36field_values=[md.results.TransientSolution[0].Base,
     37                                                        md.results.TransientSolution[0].Surface,
     38                                                        md.results.TransientSolution[0].Thickness,
     39                                                        md.results.TransientSolution[0].MaskGroundediceLevelset,
     40                                                        md.results.TransientSolution[0].IceVolume,
     41                                                        md.results.TransientSolution[0].IceVolumeAboveFloatation,
     42                                                        md.results.TransientSolution[1].Base,
     43                                                        md.results.TransientSolution[1].Surface,
     44                                                        md.results.TransientSolution[1].Thickness,
     45                                                        md.results.TransientSolution[1].MaskGroundediceLevelset,
     46                                                        md.results.TransientSolution[1].IceVolume,
     47                                                        md.results.TransientSolution[1].IceVolumeAboveFloatation,
     48                                                        md.results.TransientSolution[2].Base,
     49                                                        md.results.TransientSolution[2].Surface,
     50                                                        md.results.TransientSolution[2].Thickness,
     51                                                        md.results.TransientSolution[2].MaskGroundediceLevelset,
     52                                                        md.results.TransientSolution[2].IceVolume,
     53                                                        md.results.TransientSolution[2].IceVolumeAboveFloatation]
  • issm/trunk-jpl/test/NightlyRun/test425.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfGroundingLine2dSoft
    2 import numpy
    32from model import *
    4 from MatlabFuncs import *
     3from socket import gethostname
    54from triangle import *
    65from setmask import *
    … …  
    1514md.initialization.vx[:]=0.
    1615md.initialization.vy[:]=0.
    17 md.geometry.base=-700.-abs(md.mesh.y.reshape(-1,1)-500000.)/1000.
    18 md.geometry.bed =-700.-abs(md.mesh.y.reshape(-1,1)-500000.)/1000.
     16md.geometry.base=-700.-abs(md.mesh.y-500000.)/1000.
     17md.geometry.bed =-700.-abs(md.mesh.y-500000.)/1000.
    1918md.geometry.thickness[:]=1300.
    2019md.geometry.surface=md.geometry.base+md.geometry.thickness
    … …  
    2423md.groundingline.migration='SoftMigration'
    2524
    26 md.cluster=generic('name',oshostname(),'np',3)
     25md.cluster=generic('name',gethostname(),'np',3)
    2726md=solve(md,'Transient')
    2827
    2928#Fields and tolerances to track changes
    30 field_names     =['Bed1','Surface1','Thickness1','Floatingice1',\
    31         'Bed2','Surface2','Thickness2','Floatingice2',\
    32         'Bed3','Surface3','Thickness3','Floatingice3']
    33 field_tolerances=[1e-13,1e-13,1e-13,1e-13,\
    34         1e-13,1e-13,1e-13,1e-13,\
    35         1e-13,1e-13,1e-13,1e-13]
    36 field_values=[\
    37         md.results.TransientSolution[0].Base,\
    38         md.results.TransientSolution[0].Surface,\
    39         md.results.TransientSolution[0].Thickness,\
    40         md.results.TransientSolution[0].MaskGroundediceLevelset,\
    41         md.results.TransientSolution[1].Base,\
    42         md.results.TransientSolution[1].Surface,\
    43         md.results.TransientSolution[1].Thickness,\
    44         md.results.TransientSolution[1].MaskGroundediceLevelset,\
    45         md.results.TransientSolution[2].Base,\
    46         md.results.TransientSolution[2].Surface,\
    47         md.results.TransientSolution[2].Thickness,\
    48         md.results.TransientSolution[2].MaskGroundediceLevelset,\
    49         ]
     29field_names     =['Bed1','Surface1','Thickness1','Floatingice1',
     30                                                                        'Bed2','Surface2','Thickness2','Floatingice2',
     31                                                                        'Bed3','Surface3','Thickness3','Floatingice3']
     32field_tolerances=[1e-13,1e-13,1e-13,1e-13,
     33                                                                        1e-13,1e-13,1e-13,1e-13,
     34                                                                        1e-13,1e-13,1e-13,1e-13]
     35field_values=[md.results.TransientSolution[0].Base,
     36                                                        md.results.TransientSolution[0].Surface,
     37                                                        md.results.TransientSolution[0].Thickness,
     38                                                        md.results.TransientSolution[0].MaskGroundediceLevelset,
     39                                                        md.results.TransientSolution[1].Base,
     40                                                        md.results.TransientSolution[1].Surface,
     41                                                        md.results.TransientSolution[1].Thickness,
     42                                                        md.results.TransientSolution[1].MaskGroundediceLevelset,
     43                                                        md.results.TransientSolution[2].Base,
     44                                                        md.results.TransientSolution[2].Surface,
     45                                                        md.results.TransientSolution[2].Thickness,
     46                                                        md.results.TransientSolution[2].MaskGroundediceLevelset]
  • issm/trunk-jpl/test/NightlyRun/test426.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfGroundingLine3dAggressive
    2 import numpy
    32from model import *
    4 from MatlabFuncs import *
     3from socket import gethostname
    54from triangle import *
    65from setmask import *
    … …  
    1413md.initialization.vx[:]=0.
    1514md.initialization.vy[:]=0.
    16 md.geometry.base=-700.-abs(md.mesh.y.reshape(-1,1)-500000.)/1000.
    17 md.geometry.bed =-700.-abs(md.mesh.y.reshape(-1,1)-500000.)/1000.
     15md.geometry.base=-700.-abs(md.mesh.y-500000.)/1000.
     16md.geometry.bed =-700.-abs(md.mesh.y-500000.)/1000.
    1817md.geometry.thickness[:]=1000.
    1918md.geometry.surface=md.geometry.base+md.geometry.thickness
    2019md.smb.mass_balance[:]=100.
    21 md.extrude(3,1.);
    22 md=setflowequation(md,'SSA','all');
     20md.extrude(3,1.)
     21md=setflowequation(md,'SSA','all')
    2322md.transient.isstressbalance=False
    2423md.transient.isgroundingline=True
    2524md.groundingline.migration='AggressiveMigration'
    2625md.transient.requested_outputs=['IceVolume','IceVolumeAboveFloatation']
    27 md.cluster=generic('name',oshostname(),'np',3)
     26md.cluster=generic('name',gethostname(),'np',3)
    2827
    2928md=solve(md,'Transient')
    3029
    3130#Fields and tolerances to track changes
    32 field_names     =['Bed1','Surface1','Thickness1','Floatingice1','IceVolume1','IceVolumeAboveFloatation1',\
    33         'Bed2','Surface2','Thickness2','Floatingice2','IceVolume2','IceVolumeAboveFloatation2',\
    34         'Bed3','Surface3','Thickness3','Floatingice3','IceVolume3','IceVolumeAboveFloatation3',]
     31field_names     =['Bed1','Surface1','Thickness1','Floatingice1','IceVolume1','IceVolumeAboveFloatation1',
     32                                                                        'Bed2','Surface2','Thickness2','Floatingice2','IceVolume2','IceVolumeAboveFloatation2',
     33                                                                        'Bed3','Surface3','Thickness3','Floatingice3','IceVolume3','IceVolumeAboveFloatation3',]
    3534
    36 field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    37         1e-11,1e-10,1e-11,3e-11,2e-12,5e-12,\
    38         1e-10,1e-10,1e-10,5e-11,2e-12,5e-12]
     35field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
     36                                                                        1e-11,1e-10,1e-11,3e-11,2e-12,5e-12,
     37                                                                        1e-10,1e-10,1e-10,5e-11,2e-12,5e-12]
    3938
    40 field_values=[\
    41         md.results.TransientSolution[0].Base,\
    42         md.results.TransientSolution[0].Surface,\
    43         md.results.TransientSolution[0].Thickness,\
    44         md.results.TransientSolution[0].MaskGroundediceLevelset,\
    45         md.results.TransientSolution[0].IceVolume,\
    46         md.results.TransientSolution[0].IceVolumeAboveFloatation,\
    47         md.results.TransientSolution[1].Base,\
    48         md.results.TransientSolution[1].Surface,\
    49         md.results.TransientSolution[1].Thickness,\
    50         md.results.TransientSolution[1].MaskGroundediceLevelset,\
    51         md.results.TransientSolution[1].IceVolume,\
    52         md.results.TransientSolution[1].IceVolumeAboveFloatation,\
    53         md.results.TransientSolution[2].Base,\
    54         md.results.TransientSolution[2].Surface,\
    55         md.results.TransientSolution[2].Thickness,\
    56         md.results.TransientSolution[2].MaskGroundediceLevelset,\
    57         md.results.TransientSolution[2].IceVolume,\
    58         md.results.TransientSolution[2].IceVolumeAboveFloatation,\
    59         ]
     39field_values=[md.results.TransientSolution[0].Base,
     40                                                        md.results.TransientSolution[0].Surface,
     41                                                        md.results.TransientSolution[0].Thickness,
     42                                                        md.results.TransientSolution[0].MaskGroundediceLevelset,
     43                                                        md.results.TransientSolution[0].IceVolume,
     44                                                        md.results.TransientSolution[0].IceVolumeAboveFloatation,
     45                                                        md.results.TransientSolution[1].Base,
     46                                                        md.results.TransientSolution[1].Surface,
     47                                                        md.results.TransientSolution[1].Thickness,
     48                                                        md.results.TransientSolution[1].MaskGroundediceLevelset,
     49                                                        md.results.TransientSolution[1].IceVolume,
     50                                                        md.results.TransientSolution[1].IceVolumeAboveFloatation,
     51                                                        md.results.TransientSolution[2].Base,
     52                                                        md.results.TransientSolution[2].Surface,
     53                                                        md.results.TransientSolution[2].Thickness,
     54                                                        md.results.TransientSolution[2].MaskGroundediceLevelset,
     55                                                        md.results.TransientSolution[2].IceVolume,
     56                                                        md.results.TransientSolution[2].IceVolumeAboveFloatation]
  • issm/trunk-jpl/test/NightlyRun/test427.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfGroundingLine3dSoft
    2 import numpy
    32from model import *
    4 from MatlabFuncs import *
    5 from triangle import *
     3from socket import gethostname
     4
    65from setmask import *
    76from parameterize import *
    … …  
    1413md.initialization.vx[:]=0.
    1514md.initialization.vy[:]=0.
    16 md.geometry.base=-700.-abs(md.mesh.y.reshape(-1,1)-500000.)/1000.
    17 md.geometry.bed =-700.-abs(md.mesh.y.reshape(-1,1)-500000.)/1000.
     15md.geometry.base=-700.-abs(md.mesh.y-500000.)/1000.
     16md.geometry.bed =-700.-abs(md.mesh.y-500000.)/1000.
    1817md.geometry.thickness[:]=1300
    1918md.geometry.surface=md.geometry.base+md.geometry.thickness
    … …  
    2524md.transient.isgroundingline=True
    2625md.groundingline.migration='SoftMigration'
    27 md.cluster=generic('name',oshostname(),'np',3)
     26md.cluster=generic('name',gethostname(),'np',3)
    2827md=solve(md,'Transient')
    2928
    3029#Fields and tolerances to track changes
    31 field_names     =['Bed1','Surface1','Thickness1','Floatingice1',\
    32         'Bed2','Surface2','Thickness2','Floatingice2',\
    33         'Bed3','Surface3','Thickness3','Floatingice3']
    34 field_tolerances=[1e-13,1e-13,1e-13,1e-13,\
    35         5e-12,3e-12,7e-12,2e-11,\
    36         1e-10,5e-11,1e-10,7e-10]
    37 field_values=[\
    38         md.results.TransientSolution[0].Base,\
    39         md.results.TransientSolution[0].Surface,\
    40         md.results.TransientSolution[0].Thickness,\
    41         md.results.TransientSolution[0].MaskGroundediceLevelset,\
    42         md.results.TransientSolution[1].Base,\
    43         md.results.TransientSolution[1].Surface,\
    44         md.results.TransientSolution[1].Thickness,\
    45         md.results.TransientSolution[1].MaskGroundediceLevelset,\
    46         md.results.TransientSolution[2].Base,\
    47         md.results.TransientSolution[2].Surface,\
    48         md.results.TransientSolution[2].Thickness,\
    49         md.results.TransientSolution[2].MaskGroundediceLevelset,\
    50         ]
     30field_names     =['Bed1','Surface1','Thickness1','Floatingice1',
     31                                                                        'Bed2','Surface2','Thickness2','Floatingice2',
     32                                                                        'Bed3','Surface3','Thickness3','Floatingice3']
     33field_tolerances=[1e-13,1e-13,1e-13,1e-13,
     34                                                                        5e-12,3e-12,7e-12,2e-11,
     35                                                                        1e-10,5e-11,1e-10,7e-10]
     36field_values=[md.results.TransientSolution[0].Base,
     37                                                        md.results.TransientSolution[0].Surface,
     38                                                        md.results.TransientSolution[0].Thickness,
     39                                                        md.results.TransientSolution[0].MaskGroundediceLevelset,
     40                                                        md.results.TransientSolution[1].Base,
     41                                                        md.results.TransientSolution[1].Surface,
     42                                                        md.results.TransientSolution[1].Thickness,
     43                                                        md.results.TransientSolution[1].MaskGroundediceLevelset,
     44                                                        md.results.TransientSolution[2].Base,
     45                                                        md.results.TransientSolution[2].Surface,
     46                                                        md.results.TransientSolution[2].Thickness,
     47                                                        md.results.TransientSolution[2].MaskGroundediceLevelset]
  • issm/trunk-jpl/test/NightlyRun/test428.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfStressSSA2dNewton
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1516md.stressbalance.isnewton=1
    1617md.stressbalance.restol=0.0001
    17 md.cluster=generic('name',oshostname(),'np',3)
     18md.cluster=generic('name',gethostname(),'np',3)
    1819md=solve(md,'Stressbalance')
    1920
  • issm/trunk-jpl/test/NightlyRun/test429.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfStressHONewton
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1617md.stressbalance.isnewton=1
    1718md.stressbalance.restol=0.0001
    18 md.cluster=generic('name',oshostname(),'np',3)
     19md.cluster=generic('name',gethostname(),'np',3)
    1920md=solve(md,'Stressbalance')
    2021
  • issm/trunk-jpl/test/NightlyRun/test431.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfSteaEnthalpySSA3d
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1415md.extrude(3,2.)
    1516md=setflowequation(md,'SSA','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md.timestepping.time_step=0.
    1819md.thermal.isenthalpy=1
    1920md.thermal.isdynamicbasalspc=1
    20 md.initialization.waterfraction=numpy.zeros((md.mesh.numberofvertices,1))
    21 md.initialization.watercolumn=numpy.zeros((md.mesh.numberofvertices,1))
     21md.initialization.waterfraction=np.zeros((md.mesh.numberofvertices))
     22md.initialization.watercolumn=np.zeros((md.mesh.numberofvertices))
    2223md=solve(md,'Steadystate')
    2324
  • issm/trunk-jpl/test/NightlyRun/test432.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfSteaEnthalpyHO
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1415md.extrude(3,2.)
    1516md=setflowequation(md,'HO','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md.timestepping.time_step=0.
    1819md.thermal.isenthalpy=1
    19 md.initialization.waterfraction=numpy.zeros((md.mesh.numberofvertices,1))
    20 md.initialization.watercolumn=numpy.zeros((md.mesh.numberofvertices,1))
     20md.initialization.waterfraction=np.zeros((md.mesh.numberofvertices))
     21md.initialization.watercolumn=np.zeros((md.mesh.numberofvertices))
    2122md=solve(md,'Steadystate')
    2223
  • issm/trunk-jpl/test/NightlyRun/test433.py

    r21060 r21408  
    11#Test Name: RoundSheetShelfGLMigrationSSA3d
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from roundmesh import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112radius=1.e6
    … …  
    1415md=roundmesh(model(),radius,50000.)
    1516#fix center node to 0,0
    16 rad=numpy.sqrt(md.mesh.x**2+md.mesh.y**2)
    17 pos=numpy.argmin(rad)
     17rad=np.sqrt(md.mesh.x**2+md.mesh.y**2)
     18pos=np.argmin(rad)
    1819md.mesh.x[pos]=0.
    1920md.mesh.y[pos]=0.    #the closest node to the center is changed to be exactly at the center
    20 xelem=numpy.mean(md.mesh.x[md.mesh.elements.astype(int)-1],axis=1)
    21 yelem=numpy.mean(md.mesh.y[md.mesh.elements.astype(int)-1],axis=1)
    22 rad=numpy.sqrt(xelem**2+yelem**2)
    23 flags=numpy.zeros(md.mesh.numberofelements)
    24 pos=numpy.nonzero(rad>=(radius-shelfextent))
     21xelem=np.mean(md.mesh.x[md.mesh.elements.astype(int)-1],axis=1)
     22yelem=np.mean(md.mesh.y[md.mesh.elements.astype(int)-1],axis=1)
     23rad=np.sqrt(xelem**2+yelem**2)
     24flags=np.zeros(md.mesh.numberofelements)
     25pos=np.nonzero(rad>=(radius-shelfextent))
    2526flags[pos]=1
    2627md=setmask(md,flags,'')
    … …  
    2829md=setflowequation(md,'SSA','all')
    2930md.extrude(3,1.)
    30 md.cluster=generic('name',oshostname(),'np',3)
     31md.cluster=generic('name',gethostname(),'np',3)
    3132
    3233md.transient.isthermal=False
  • issm/trunk-jpl/test/NightlyRun/test434.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfL1L2
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1415md.extrude(4,1.)
    1516md=setflowequation(md,'L1L2','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md=solve(md,'Stressbalance')
    1819
  • issm/trunk-jpl/test/NightlyRun/test450.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfStressSSAHigherOrder
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1314md=parameterize(md,'../Par/SquareSheetShelf.py')
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617
    1718field_names=[]
  • issm/trunk-jpl/test/NightlyRun/test455.py

    r21060 r21408  
    11#Test Name: SquareSheetShelfStressHOHigherOrder
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1415md.extrude(5,1.)
    1516md=setflowequation(md,'HO','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718
    1819field_names=[]
  • issm/trunk-jpl/test/NightlyRun/test501.py

    r21060 r21408  
    11#Test Name: PigStressSSA2d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Pig.exp',20000.)
    … …  
    1213md=parameterize(md,'../Par/Pig.py')
    1314md=setflowequation(md,'SSA','all')
    14 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1516md=solve(md,'Stressbalance')
    1617
  • issm/trunk-jpl/test/NightlyRun/test502.py

    r21060 r21408  
    11#Test Name: PigStressHO
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Pig.exp',20000.)
    … …  
    1314md.extrude(3,0.9)
    1415md=setflowequation(md,'HO','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'Stressbalance')
    1718
  • issm/trunk-jpl/test/NightlyRun/test503.py

    r21060 r21408  
    11#Test Name: PigStressFS
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Pig.exp',20000.)
    … …  
    1314md.extrude(3,0.9)
    1415md=setflowequation(md,'FS','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'Stressbalance')
    1718
  • issm/trunk-jpl/test/NightlyRun/test504.py

    r21060 r21408  
    11#Test Name: PigTranSSA2d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Pig.exp',20000.)
    … …  
    1213md=parameterize(md,'../Par/Pig.py')
    1314md=setflowequation(md,'SSA','all')
    14 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1516md=solve(md,'Transient')
    1617
  • issm/trunk-jpl/test/NightlyRun/test505.py

    r21060 r21408  
    11#Test Name: PigTranSSA3d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Pig.exp',30000.)
    … …  
    1314md.extrude(3,1.)
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'Transient')
    1718
  • issm/trunk-jpl/test/NightlyRun/test506.py

    r21060 r21408  
    11#Test Name: PigTranHO
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Pig.exp',30000.)
    … …  
    1314md.extrude(2,1.)
    1415md=setflowequation(md,'HO','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'Transient')
    1718
  • issm/trunk-jpl/test/NightlyRun/test507.py

    r21060 r21408  
    11#Test Name: PigTranFS
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Pig.exp',30000.)
    … …  
    1314md.extrude(2,1.)
    1415md=setflowequation(md,'FS','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'Transient')
    1718
  • issm/trunk-jpl/test/NightlyRun/test508.py

    r21060 r21408  
    11#Test Name: PigSteaSSA3d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Pig.exp',35000.)
    … …  
    1314md.extrude(3,1.1)
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md.timestepping.time_step=0.
    1718md=solve(md,'Steadystate')
  • issm/trunk-jpl/test/NightlyRun/test509.py

    r21060 r21408  
    11#Test Name: PigSteaHO
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Pig.exp',30000.)
    … …  
    1314md.extrude(3,1.)
    1415md=setflowequation(md,'HO','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md.timestepping.time_step=0.
    1718md.thermal.penalty_threshold=7
  • issm/trunk-jpl/test/NightlyRun/test510.py

    r21060 r21408  
    11#Test Name: PigSteaFS
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Pig.exp',20000.)
    … …  
    1314md.extrude(2,1.)
    1415md=setflowequation(md,'FS','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md.timestepping.time_step=0.
    1718md=solve(md,'Steadystate')
  • issm/trunk-jpl/test/NightlyRun/test511.py

    r21060 r21408  
    11#Test Name: PigCMBFS
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Pig.exp',11000.)
    … …  
    2324md.inversion.iscontrol=1
    2425md.inversion.control_parameters=['MaterialsRheologyBbar']
    25 md.inversion.min_parameters=10.**6*numpy.ones((md.mesh.numberofvertices,1))
    26 md.inversion.max_parameters=2.*10**9*numpy.ones((md.mesh.numberofvertices,1))
     26md.inversion.min_parameters=10.**6*np.ones((md.mesh.numberofvertices))
     27md.inversion.max_parameters=2.*10**9*np.ones((md.mesh.numberofvertices))
    2728md.inversion.nsteps=2
    2829md.inversion.cost_functions=[101]
    29 md.inversion.cost_functions_coefficients=numpy.ones((md.mesh.numberofvertices,1))
    30 md.inversion.gradient_scaling=10.**8*numpy.ones((md.inversion.nsteps,1))
    31 md.inversion.maxiter_per_step=2.*numpy.ones((md.inversion.nsteps,1))
    32 md.inversion.step_threshold=0.99*numpy.ones((md.inversion.nsteps,1))
     30md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices))
     31md.inversion.gradient_scaling=10.**8*np.ones((md.inversion.nsteps))
     32md.inversion.maxiter_per_step=2.*np.ones((md.inversion.nsteps))
     33md.inversion.step_threshold=0.99*np.ones((md.inversion.nsteps))
    3334md.inversion.vx_obs=md.initialization.vx
    3435md.inversion.vy_obs=md.initialization.vy
    3536
    36 md.cluster=generic('name',oshostname(),'np',1)
     37md.cluster=generic('name',gethostname(),'np',1)
    3738md=solve(md,'Stressbalance')
    3839
  • issm/trunk-jpl/test/NightlyRun/test512.py

    r21060 r21408  
    11#Test Name: PigCMDragHO
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from triangle import *
    56from setmask import *
    … …  
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112md=triangle(model(),'../Exp/Pig.exp',20000.)
    … …  
    1819md.inversion.iscontrol=1
    1920md.inversion.control_parameters=['FrictionCoefficient']
    20 md.inversion.min_parameters=1.*numpy.ones((md.mesh.numberofvertices,1))
    21 md.inversion.max_parameters=200.*numpy.ones((md.mesh.numberofvertices,1))
     21md.inversion.min_parameters=1.*np.ones((md.mesh.numberofvertices))
     22md.inversion.max_parameters=200.*np.ones((md.mesh.numberofvertices))
    2223md.inversion.nsteps=2
    2324md.inversion.cost_functions=[103,501]
    24 md.inversion.cost_functions_coefficients=numpy.ones((md.mesh.numberofvertices,2))
     25md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices,2))
    2526md.inversion.cost_functions_coefficients[:,1]=2.*10**-7
    26 md.inversion.gradient_scaling=3.*numpy.ones((md.inversion.nsteps,1))
    27 md.inversion.maxiter_per_step=2.*numpy.ones((md.inversion.nsteps,1))
    28 md.inversion.step_threshold=2.99*numpy.ones((md.inversion.nsteps,1))
     27md.inversion.gradient_scaling=3.*np.ones((md.inversion.nsteps))
     28md.inversion.maxiter_per_step=2.*np.ones((md.inversion.nsteps))
     29md.inversion.step_threshold=2.99*np.ones((md.inversion.nsteps))
    2930md.inversion.vx_obs=md.initialization.vx
    3031md.inversion.vy_obs=md.initialization.vy
    3132
    32 md.cluster=generic('name',oshostname(),'np',3)
     33md.cluster=generic('name',gethostname(),'np',3)
    3334md=solve(md,'Stressbalance')
    3435
  • issm/trunk-jpl/test/NightlyRun/test513.py

    r21060 r21408  
    11#Test Name: PigCMDragSteaSSA3d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Pig.exp',30000.)
    … …  
    1718md.inversion.iscontrol=1
    1819md.inversion.control_parameters=['FrictionCoefficient']
    19 md.inversion.min_parameters=1.*numpy.ones((md.mesh.numberofvertices,1))
    20 md.inversion.max_parameters=200.*numpy.ones((md.mesh.numberofvertices,1))
     20md.inversion.min_parameters=1.*np.ones((md.mesh.numberofvertices))
     21md.inversion.max_parameters=200.*np.ones((md.mesh.numberofvertices))
    2122md.inversion.nsteps=2
    2223md.inversion.cost_functions=[103,501]
    23 md.inversion.cost_functions_coefficients=numpy.ones((md.mesh.numberofvertices,2))
     24md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices,2))
    2425md.inversion.cost_functions_coefficients[:,1]=2.*10**-7
    25 md.inversion.gradient_scaling=3.*numpy.ones((md.inversion.nsteps,1))
    26 md.inversion.maxiter_per_step=2.*numpy.ones((md.inversion.nsteps,1))
    27 md.inversion.step_threshold=0.99*numpy.ones((md.inversion.nsteps,1))
     26md.inversion.gradient_scaling=3.*np.ones((md.inversion.nsteps))
     27md.inversion.maxiter_per_step=2.*np.ones((md.inversion.nsteps))
     28md.inversion.step_threshold=0.99*np.ones((md.inversion.nsteps))
    2829md.inversion.vx_obs=md.initialization.vx
    2930md.inversion.vy_obs=md.initialization.vy
    … …  
    3132
    3233md.thermal.penalty_lock=5
    33 md.cluster=generic('name',oshostname(),'np',3)
     34md.cluster=generic('name',gethostname(),'np',3)
    3435md=solve(md,'Steadystate')
    3536
  • issm/trunk-jpl/test/NightlyRun/test514.py

    r19049 r21408  
    11#Test Name: PigBamgMesh
    2 import numpy
     2import numpy as np
    33import copy
    44from model import *
     5from socket import gethostname
    56from bamg import *
    67from setmask import *
    … …  
    89from ComputeHessian import *
    910from ComputeMetric import *
    10 from MatlabFuncs import *
     11
    1112
    1213#Simple mesh 1
    13 hVertices=10000.*numpy.ones((27,1))
     14hVertices=10000.*np.ones((27))
    1415hVertices[0:5]=1000.
    1516md=bamg(model(),'domain','../Exp/Pig.exp','hmax',20000.,'hVertices',hVertices,'gradation',3.,'geometricalmetric',1)
    … …  
    3839
    3940#refine existing mesh 3
    40 hVertices=float('nan')*numpy.ones((md.mesh.numberofvertices,1))
    41 hVertices[numpy.nonzero(md.mesh.vertexonboundary)]=500.
     41hVertices=float('nan')*np.ones((md.mesh.numberofvertices))
     42hVertices[np.nonzero(md.mesh.vertexonboundary)]=500.
    4243md2=bamg(copy.deepcopy(md),'metric',md.miscellaneous.dummy,'hmin',1000.,'hmax',20000.,'gradation',3.,'geometricalmetric',1,'anisomax',1.,'hVertices',hVertices)
    4344x5=md2.mesh.x
    … …  
    4546
    4647#refine existing mesh 4
    47 md2=bamg(copy.deepcopy(md),'field',md.inversion.vy_obs,'hmin',1000.,'hmax',20000.,'gradation',3.,'geometricalmetric',1,'Hessiantype',0,'err',numpy.array([[1.]]))
     48md2=bamg(copy.deepcopy(md),'field',md.inversion.vy_obs,'hmin',1000.,'hmax',20000.,'gradation',3.,'geometricalmetric',1,'Hessiantype',0,'err',np.array([[1.]]))
    4849x6=md2.mesh.x
    4950y6=md2.mesh.y
    5051
    5152#refine existing mesh 5
    52 md2=bamg(copy.deepcopy(md),'field',numpy.hstack((md.inversion.vy_obs,md.geometry.thickness)),'hmin',1000.,'hmax',20000.,'gradation',3.,'geometricalmetric',1,'Hessiantype',1,'err',numpy.array([[10.,100.]]))
     53md2=bamg(copy.deepcopy(md),'field',np.hstack((md.inversion.vy_obs,md.geometry.thickness)),'hmin',1000.,'hmax',20000.,'gradation',3.,'geometricalmetric',1,'Hessiantype',1,'err',np.array([[10.,100.]]))
    5354x7=md2.mesh.x
    5455y7=md2.mesh.y
  • issm/trunk-jpl/test/NightlyRun/test515.py

    r21060 r21408  
    11#Test Name: PigTherTranSUPG
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Pig.exp',30000.)
    … …  
    1415md=setflowequation(md,'HO','all')
    1516md.thermal.stabilization=2
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md.transient.isstressbalance=False
    1819md.transient.ismasstransport=False
  • issm/trunk-jpl/test/NightlyRun/test516.py

    r21060 r21408  
    11#Test Name: PigTherSteaSUPG
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1516md=setflowequation(md,'HO','all')
    1617md.thermal.stabilization=2
    17 md.cluster=generic('name',oshostname(),'np',3)
     18md.cluster=generic('name',gethostname(),'np',3)
    1819md.timestepping.time_step=0
    1920md.thermal.penalty_threshold=40
  • issm/trunk-jpl/test/NightlyRun/test530.py

    r21060 r21408  
    11#Test Name: PigBalVel1
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Pig.exp',20000.)
    … …  
    1213md=parameterize(md,'../Par/Pig.py')
    1314md=setflowequation(md,'SSA','all')
    14 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1516md=solve(md,'Balancevelocity')
    1617
  • issm/trunk-jpl/test/NightlyRun/test531.py

    r21060 r21408  
    11#Test Name: PigBalVel2
    22from model import *
     3from socket import gethostname
    34from triangle import *
    45from setmask import *
    … …  
    67from setflowequation import *
    78from solve import *
    8 from MatlabFuncs import *
     9
    910
    1011md=triangle(model(),'../Exp/Pig.exp',20000.)
    … …  
    1415md.initialization.vy[:]=0.
    1516md=setflowequation(md,'SSA','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md=solve(md,'Balancevelocity')
    1819
  • issm/trunk-jpl/test/NightlyRun/test601.py

    r21060 r21408  
    11#Test Name: 79NorthMasstransp2d
    22from model import *
    3 from MatlabFuncs import *
     3from socket import gethostname
     4
    45from triangle import *
    56from setmask import *
    … …  
    1213md=parameterize(md,'../Par/79North.py')
    1314md=setflowequation(md,'SSA','all')
    14 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1516md=solve(md,'Masstransport')
    1617
  • issm/trunk-jpl/test/NightlyRun/test602.py

    r21060 r21408  
    11#Test Name: 79NorthMasstransp2dDG
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from meshconvert import *
    … …  
    1718md.masstransport.stabilization=3
    1819md.masstransport.spcthickness=md.geometry.thickness
    19 md.cluster=generic('name',oshostname(),'np',3)
     20md.cluster=generic('name',gethostname(),'np',3)
    2021md=solve(md,'Masstransport')
    2122
  • issm/trunk-jpl/test/NightlyRun/test603.py

    r21060 r21408  
    11#Test Name: 79NorthMasstransp3d
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1415md.extrude(6,1.)
    1516md=setflowequation(md,'SSA','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md=solve(md,'Masstransport')
    1819
  • issm/trunk-jpl/test/NightlyRun/test604.py

    r21060 r21408  
    11#Test Name: 79NorthSurfSlop2d
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1314md=parameterize(md,'../Par/79North.py')
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'SurfaceSlope')
    1718
  • issm/trunk-jpl/test/NightlyRun/test605.py

    r21060 r21408  
    11#Test Name: 79NorthSurfSlop3d
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1415md.extrude(5,1.5)
    1516md=setflowequation(md,'HO','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md=solve(md,'SurfaceSlope')
    1819
  • issm/trunk-jpl/test/NightlyRun/test606.py

    r21060 r21408  
    11#Test Name: 79NorthBedSlop2d
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1314md=parameterize(md,'../Par/79North.py')
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'BedSlope')
    1718
  • issm/trunk-jpl/test/NightlyRun/test607.py

    r21060 r21408  
    11#Test Name: 79NorthBedSlop3d
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1415md.extrude(2,1.)
    1516md=setflowequation(md,'SSA','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     17md.cluster=generic('name',gethostname(),'np',3)
    1718md=solve(md,'BedSlope')
    1819
  • issm/trunk-jpl/test/NightlyRun/test608.py

    r21060 r21408  
    11#Test Name: 79NorthBalThic2d
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    1314md=parameterize(md,'../Par/79North.py')
    1415md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1617md=solve(md,'Balancethickness')
    1718
  • issm/trunk-jpl/test/NightlyRun/test611.py

    r21060 r21408  
    11#Test Name: 79NorthCMBalThic2dCG
    2 import numpy
     2import numpy as np
    33from model import *
    4 from MatlabFuncs import *
     4from socket import gethostname
     5
    56from triangle import *
    67from setmask import *
    … …  
    2021md.inversion.control_parameters=['BalancethicknessThickeningRate']
    2122md.inversion.thickness_obs=md.geometry.thickness
    22 md.inversion.min_parameters=-50.*numpy.ones((md.mesh.numberofvertices,1))
    23 md.inversion.max_parameters=50.*numpy.ones((md.mesh.numberofvertices,1))
     23md.inversion.min_parameters=-50.*np.ones((md.mesh.numberofvertices))
     24md.inversion.max_parameters=50.*np.ones((md.mesh.numberofvertices))
    2425md.inversion.cost_functions=[201]
    25 md.inversion.cost_functions_coefficients=numpy.ones((md.mesh.numberofvertices,1))
    26 md.inversion.gradient_scaling=10./md.constants.yts*numpy.ones((md.inversion.nsteps,1))
    27 md.inversion.maxiter_per_step=4*numpy.ones((md.inversion.nsteps,1))
    28 md.inversion.step_threshold=0.99*numpy.ones((md.inversion.nsteps,1))
     26md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices))
     27md.inversion.gradient_scaling=10./md.constants.yts*np.ones((md.inversion.nsteps))
     28md.inversion.maxiter_per_step=4*np.ones((md.inversion.nsteps))
     29md.inversion.step_threshold=0.99*np.ones((md.inversion.nsteps))
    2930
    30 md.cluster=generic('name',oshostname(),'np',3)
     31md.cluster=generic('name',gethostname(),'np',3)
    3132md=solve(md,'Balancethickness')
    3233
  • issm/trunk-jpl/test/NightlyRun/test613.py

    r21060 r21408  
    11#Test Name: 79NorthCMBalThicVxVy
    2 import numpy
     2import numpy as np
    33import copy
    44from model import *
     5from socket import gethostname
    56from triangle import *
    67from meshconvert import *
    … …  
    910from setflowequation import *
    1011from solve import *
    11 from MatlabFuncs import *
     12
    1213
    1314md=triangle(model(),'../Exp/79North.exp',10000.)
    … …  
    1920#Ice sheet only
    2021md=md.extract(md.mask.groundedice_levelset>0.)
    21 pos=numpy.nonzero(md.mesh.vertexonboundary)
     22pos=np.nonzero(md.mesh.vertexonboundary)
    2223md.balancethickness.spcthickness[pos]=md.geometry.thickness[pos]
    2324
    … …  
    2829md.inversion.control_parameters=['Vx','Vy']
    2930md.balancethickness.stabilization=1
    30 md.inversion.gradient_scaling=numpy.hstack((10./md.constants.yts*numpy.ones((md.inversion.nsteps,1)),10./md.constants.yts*numpy.ones((md.inversion.nsteps,1))))
    31 md.inversion.min_parameters=numpy.hstack((-2000.*numpy.ones((md.mesh.numberofvertices,1)),-2000.*numpy.ones((md.mesh.numberofvertices,1))))
    32 md.inversion.max_parameters=numpy.hstack((+2000.*numpy.ones((md.mesh.numberofvertices,1)),+2000.*numpy.ones((md.mesh.numberofvertices,1))))
     31md.inversion.gradient_scaling=np.vstack((10./md.constants.yts*np.ones((md.inversion.nsteps)),10./md.constants.yts*np.ones((md.inversion.nsteps)))).T
     32md.inversion.min_parameters=np.vstack((-2000.*np.ones((md.mesh.numberofvertices)),-2000.*np.ones((md.mesh.numberofvertices)))).T
     33md.inversion.max_parameters=np.vstack((+2000.*np.ones((md.mesh.numberofvertices)),+2000.*np.ones((md.mesh.numberofvertices)))).T
    3334md.inversion.cost_functions=[201]
    34 md.inversion.cost_functions_coefficients=numpy.ones((md.mesh.numberofvertices,1))
    35 md.inversion.maxiter_per_step=4*numpy.ones((md.inversion.nsteps,1))
    36 md.inversion.step_threshold=0.99*numpy.ones((md.inversion.nsteps,1))
     35md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices))
     36md.inversion.maxiter_per_step=4*np.ones((md.inversion.nsteps))
     37md.inversion.step_threshold=0.99*np.ones((md.inversion.nsteps))
    3738
    3839md.verbose.control=1
    39 md.cluster=generic('name',oshostname(),'np',3)
     40md.cluster=generic('name',gethostname(),'np',3)
    4041md=solve(md,'Balancethickness')
    4142
    … …  
    4344field_names     =['Gradient1','Gradient2','Misfits','Vx','Vy','Thickness']
    4445field_tolerances=[1e-12,1e-12,1e-12,1e-12,1e-12,1e-12]
    45 field_values=[\
    46         md.results.BalancethicknessSolution.Gradient1,\
    47         md.results.BalancethicknessSolution.Gradient2,\
    48         md.results.BalancethicknessSolution.J,\
    49         md.results.BalancethicknessSolution.Vx,\
    50         md.results.BalancethicknessSolution.Vy,\
    51         md.results.BalancethicknessSolution.Thickness,\
    52 ]
     46field_values=[md.results.BalancethicknessSolution.Gradient1,
     47                                                        md.results.BalancethicknessSolution.Gradient2,
     48                                                        md.results.BalancethicknessSolution.J,
     49                                                        md.results.BalancethicknessSolution.Vx,
     50                                                        md.results.BalancethicknessSolution.Vy,
     51                                                        md.results.BalancethicknessSolution.Thickness]
  • issm/trunk-jpl/test/NightlyRun/test801.py

    r21060 r21408  
    11#Test Name: ValleyGlacierLevelsetSSA2d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    4 from squaremesh import *
    55from setmask import *
    66from parameterize import *
    77from setflowequation import *
    88from solve import *
    9 from MatlabFuncs import *
     9
    1010
    1111md=triangle(model(),'../Exp/Square.exp',50000)
    … …  
    1313md=parameterize(md,'../Par/ValleyGlacierShelf.py')
    1414md=setflowequation(md,'SSA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1616
    1717#Transient
    … …  
    2727
    2828#Fields and tolerances to track changes
    29 field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1',\
    30                 'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2',\
    31                 'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3']
    32 field_tolerances=[1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,\
    33                 1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,\
    34                 1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12]
    35 field_values=[\
    36         md.results.TransientSolution[0].Vx,\
    37         md.results.TransientSolution[0].Vy,\
    38         md.results.TransientSolution[0].Vel,\
    39         md.results.TransientSolution[0].Pressure,\
    40         md.results.TransientSolution[0].Thickness,\
    41         md.results.TransientSolution[0].Surface,\
    42         md.results.TransientSolution[0].MaskIceLevelset,\
    43         md.results.TransientSolution[1].Vx,\
    44         md.results.TransientSolution[1].Vy,\
    45         md.results.TransientSolution[1].Vel,\
    46         md.results.TransientSolution[1].Pressure,\
    47         md.results.TransientSolution[1].Thickness,\
    48         md.results.TransientSolution[1].Surface,\
    49         md.results.TransientSolution[1].MaskIceLevelset,\
    50         md.results.TransientSolution[2].Vx,\
    51         md.results.TransientSolution[2].Vy,\
    52         md.results.TransientSolution[2].Vel,\
    53         md.results.TransientSolution[2].Pressure,\
    54         md.results.TransientSolution[2].Thickness,\
    55         md.results.TransientSolution[2].Surface,\
    56         md.results.TransientSolution[2].MaskIceLevelset,\
    57         ]
     29field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1',
     30                                                                        'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2',
     31                                                                        'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3']
     32field_tolerances=[1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,
     33                                                                        1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,
     34                                                                        1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12]
     35field_values=[md.results.TransientSolution[0].Vx,
     36                                                        md.results.TransientSolution[0].Vy,
     37                                                        md.results.TransientSolution[0].Vel,
     38                                                        md.results.TransientSolution[0].Pressure,
     39                                                        md.results.TransientSolution[0].Thickness,
     40                                                        md.results.TransientSolution[0].Surface,
     41                                                        md.results.TransientSolution[0].MaskIceLevelset,
     42                                                        md.results.TransientSolution[1].Vx,
     43                                                        md.results.TransientSolution[1].Vy,
     44                                                        md.results.TransientSolution[1].Vel,
     45                                                        md.results.TransientSolution[1].Pressure,
     46                                                        md.results.TransientSolution[1].Thickness,
     47                                                        md.results.TransientSolution[1].Surface,
     48                                                        md.results.TransientSolution[1].MaskIceLevelset,
     49                                                        md.results.TransientSolution[2].Vx,
     50                                                        md.results.TransientSolution[2].Vy,
     51                                                        md.results.TransientSolution[2].Vel,
     52                                                        md.results.TransientSolution[2].Pressure,
     53                                                        md.results.TransientSolution[2].Thickness,
     54                                                        md.results.TransientSolution[2].Surface,
     55                                                        md.results.TransientSolution[2].MaskIceLevelset]
  • issm/trunk-jpl/test/NightlyRun/test802.py

    r21060 r21408  
    11#Test Name: ValleyGlacierLevelsetThermalSSA3d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    4 from squaremesh import *
    55from setmask import *
    66from parameterize import *
    77from setflowequation import *
    88from solve import *
    9 from MatlabFuncs import *
     9
    1010
    1111md=triangle(model(),'../Exp/Square.exp',50000)
    … …  
    1414md.extrude(3,2.)
    1515md=setflowequation(md,'SSA','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1717
    1818#Thermal model
    19 pos_surf=numpy.nonzero(md.mesh.vertexonsurface)[0]
     19pos_surf=np.nonzero(md.mesh.vertexonsurface)[0]
    2020md.thermal.spctemperature[pos_surf]=md.initialization.temperature[pos_surf]
    2121
    … …  
    3232
    3333#Fields and tolerances to track changes
    34 field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1','Temperature1',\
    35                 'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2','Temperature2',\
    36                 'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3','Temperature3']
    37 field_tolerances=[1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,\
    38                 1e-9,1e-9,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,\
    39                 1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
    40 field_values=[\
    41         md.results.TransientSolution[0].Vx,\
    42         md.results.TransientSolution[0].Vy,\
    43         md.results.TransientSolution[0].Vel,\
    44         md.results.TransientSolution[0].Pressure,\
    45         md.results.TransientSolution[0].Thickness,\
    46         md.results.TransientSolution[0].Surface,\
    47         md.results.TransientSolution[0].MaskIceLevelset,\
    48         md.results.TransientSolution[0].Temperature,\
    49         md.results.TransientSolution[1].Vx,\
    50         md.results.TransientSolution[1].Vy,\
    51         md.results.TransientSolution[1].Vel,\
    52         md.results.TransientSolution[1].Pressure,\
    53         md.results.TransientSolution[1].Thickness,\
    54         md.results.TransientSolution[1].Surface,\
    55         md.results.TransientSolution[1].MaskIceLevelset,\
    56         md.results.TransientSolution[1].Temperature,\
    57         md.results.TransientSolution[2].Vx,\
    58         md.results.TransientSolution[2].Vy,\
    59         md.results.TransientSolution[2].Vel,\
    60         md.results.TransientSolution[2].Pressure,\
    61         md.results.TransientSolution[2].Thickness,\
    62         md.results.TransientSolution[2].Surface,\
    63         md.results.TransientSolution[2].MaskIceLevelset,\
    64         md.results.TransientSolution[2].Temperature,\
    65         ]
     34field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1','Temperature1',
     35                                                                        'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2','Temperature2',
     36                                                                        'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3','Temperature3']
     37field_tolerances=[1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,
     38                                                                        1e-9,1e-9,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,
     39                                                                        1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
     40field_values=[md.results.TransientSolution[0].Vx,
     41                                                        md.results.TransientSolution[0].Vy,
     42                                                        md.results.TransientSolution[0].Vel,
     43                                                        md.results.TransientSolution[0].Pressure,
     44                                                        md.results.TransientSolution[0].Thickness,
     45                                                        md.results.TransientSolution[0].Surface,
     46                                                        md.results.TransientSolution[0].MaskIceLevelset,
     47                                                        md.results.TransientSolution[0].Temperature,
     48                                                        md.results.TransientSolution[1].Vx,
     49                                                        md.results.TransientSolution[1].Vy,
     50                                                        md.results.TransientSolution[1].Vel,
     51                                                        md.results.TransientSolution[1].Pressure,
     52                                                        md.results.TransientSolution[1].Thickness,
     53                                                        md.results.TransientSolution[1].Surface,
     54                                                        md.results.TransientSolution[1].MaskIceLevelset,
     55                                                        md.results.TransientSolution[1].Temperature,
     56                                                        md.results.TransientSolution[2].Vx,
     57                                                        md.results.TransientSolution[2].Vy,
     58                                                        md.results.TransientSolution[2].Vel,
     59                                                        md.results.TransientSolution[2].Pressure,
     60                                                        md.results.TransientSolution[2].Thickness,
     61                                                        md.results.TransientSolution[2].Surface,
     62                                                        md.results.TransientSolution[2].MaskIceLevelset,
     63                                                        md.results.TransientSolution[2].Temperature]
  • issm/trunk-jpl/test/NightlyRun/test803.py

    r21060 r21408  
    11#Test Name: ValleyGlacierLevelsetEnthalpyHO3d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    4 from squaremesh import *
    55from setmask import *
    66from parameterize import *
    77from setflowequation import *
    88from solve import *
    9 from MatlabFuncs import *
     9
    1010
    1111md=triangle(model(),'../Exp/Square.exp',50000)
    … …  
    1414md.extrude(3,2.)
    1515md=setflowequation(md,'HO','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1717
    1818#Thermal model
    19 pos_surf=numpy.nonzero(md.mesh.vertexonsurface)[0]
     19pos_surf=np.nonzero(md.mesh.vertexonsurface)[0]
    2020md.thermal.spctemperature[pos_surf]=md.initialization.temperature[pos_surf]
    2121md.thermal.isenthalpy=True
    … …  
    3434
    3535#Fields and tolerances to track changes
    36 field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1','Enthalpy1','Watercolumn1',\
    37                 'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2','Enthalpy2','Watercolumn2',\
    38                 'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3','Enthalpy3','Watercolumn3']
    39 field_tolerances=[1e-10,1e-10,1e-10,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    40                 1e-9,1e-9,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,1e-10,\
    41                 1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
    42 field_values=[\
    43         md.results.TransientSolution[0].Vx,\
    44         md.results.TransientSolution[0].Vy,\
    45         md.results.TransientSolution[0].Vel,\
    46         md.results.TransientSolution[0].Pressure,\
    47         md.results.TransientSolution[0].Thickness,\
    48         md.results.TransientSolution[0].Surface,\
    49         md.results.TransientSolution[0].MaskIceLevelset,\
    50         md.results.TransientSolution[0].Enthalpy,\
    51         md.results.TransientSolution[0].Watercolumn,\
    52         md.results.TransientSolution[1].Vx,\
    53         md.results.TransientSolution[1].Vy,\
    54         md.results.TransientSolution[1].Vel,\
    55         md.results.TransientSolution[1].Pressure,\
    56         md.results.TransientSolution[1].Thickness,\
    57         md.results.TransientSolution[1].Surface,\
    58         md.results.TransientSolution[1].MaskIceLevelset,\
    59         md.results.TransientSolution[1].Enthalpy,\
    60         md.results.TransientSolution[1].Watercolumn,\
    61         md.results.TransientSolution[2].Vx,\
    62         md.results.TransientSolution[2].Vy,\
    63         md.results.TransientSolution[2].Vel,\
    64         md.results.TransientSolution[2].Pressure,\
    65         md.results.TransientSolution[2].Thickness,\
    66         md.results.TransientSolution[2].Surface,\
    67         md.results.TransientSolution[2].MaskIceLevelset,\
    68         md.results.TransientSolution[2].Enthalpy,\
    69         md.results.TransientSolution[2].Watercolumn,\
    70         ]
     36field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1','Enthalpy1','Watercolumn1',
     37                                                                        'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2','Enthalpy2','Watercolumn2',
     38                                                                        'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3','Enthalpy3','Watercolumn3']
     39field_tolerances=[1e-10,1e-10,1e-10,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
     40                                                                        1e-9,1e-9,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,1e-10,
     41                                                                        1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
     42field_values=[md.results.TransientSolution[0].Vx,
     43                                                        md.results.TransientSolution[0].Vy,
     44                                                        md.results.TransientSolution[0].Vel,
     45                                                        md.results.TransientSolution[0].Pressure,
     46                                                        md.results.TransientSolution[0].Thickness,
     47                                                        md.results.TransientSolution[0].Surface,
     48                                                        md.results.TransientSolution[0].MaskIceLevelset,
     49                                                        md.results.TransientSolution[0].Enthalpy,
     50                                                        md.results.TransientSolution[0].Watercolumn,
     51                                                        md.results.TransientSolution[1].Vx,
     52                                                        md.results.TransientSolution[1].Vy,
     53                                                        md.results.TransientSolution[1].Vel,
     54                                                        md.results.TransientSolution[1].Pressure,
     55                                                        md.results.TransientSolution[1].Thickness,
     56                                                        md.results.TransientSolution[1].Surface,
     57                                                        md.results.TransientSolution[1].MaskIceLevelset,
     58                                                        md.results.TransientSolution[1].Enthalpy,
     59                                                        md.results.TransientSolution[1].Watercolumn,
     60                                                        md.results.TransientSolution[2].Vx,
     61                                                        md.results.TransientSolution[2].Vy,
     62                                                        md.results.TransientSolution[2].Vel,
     63                                                        md.results.TransientSolution[2].Pressure,
     64                                                        md.results.TransientSolution[2].Thickness,
     65                                                        md.results.TransientSolution[2].Surface,
     66                                                        md.results.TransientSolution[2].MaskIceLevelset,
     67                                                        md.results.TransientSolution[2].Enthalpy,
     68                                                        md.results.TransientSolution[2].Watercolumn]
  • issm/trunk-jpl/test/NightlyRun/test804.py

    r21060 r21408  
    11#Test Name: ValleyGlacierLevelsetCalvingSIA2d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    4 from squaremesh import *
    55from setmask import *
    66from parameterize import *
    77from setflowequation import *
    88from solve import *
    9 from MatlabFuncs import *
     9
    1010
    1111md=triangle(model(),'../Exp/Square.exp',50000)
    … …  
    1313md=parameterize(md,'../Par/ValleyGlacierShelf.py')
    1414md=setflowequation(md,'SIA','all')
    15 md.cluster=generic('name',oshostname(),'np',3)
     15md.cluster=generic('name',gethostname(),'np',3)
    1616
    1717#Transient
    … …  
    2222md.transient.isgroundingline=True
    2323md.transient.isgia=False
    24 md.transient.ismovingfront=True;
     24md.transient.ismovingfront=True
    2525
    26 md.calving.calvingrate=1000.*numpy.ones((md.mesh.numberofvertices,1))
    27 md.calving.meltingrate=numpy.zeros((md.mesh.numberofvertices,1))
     26md.calving.calvingrate=1000.*np.ones((md.mesh.numberofvertices))
     27md.calving.meltingrate=np.zeros((md.mesh.numberofvertices))
    2828
    2929md=solve(md,'Transient')
    3030
    3131#Fields and tolerances to track changes
    32 field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1',\
    33                 'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2',\
    34                 'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3']
    35 field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
    36                 2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,\
    37                 2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13]
    38 field_values=[\
    39         md.results.TransientSolution[0].Vx,\
    40         md.results.TransientSolution[0].Vy,\
    41         md.results.TransientSolution[0].Vel,\
    42         md.results.TransientSolution[0].Pressure,\
    43         md.results.TransientSolution[0].Thickness,\
    44         md.results.TransientSolution[0].Surface,\
    45         md.results.TransientSolution[0].MaskIceLevelset,\
    46         md.results.TransientSolution[1].Vx,\
    47         md.results.TransientSolution[1].Vy,\
    48         md.results.TransientSolution[1].Vel,\
    49         md.results.TransientSolution[1].Pressure,\
    50         md.results.TransientSolution[1].Thickness,\
    51         md.results.TransientSolution[1].Surface,\
    52         md.results.TransientSolution[1].MaskIceLevelset,\
    53         md.results.TransientSolution[2].Vx,\
    54         md.results.TransientSolution[2].Vy,\
    55         md.results.TransientSolution[2].Vel,\
    56         md.results.TransientSolution[2].Pressure,\
    57         md.results.TransientSolution[2].Thickness,\
    58         md.results.TransientSolution[2].Surface,\
    59         md.results.TransientSolution[2].MaskIceLevelset,\
    60 
    61         ]
     32field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1',
     33                                                                        'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2',
     34                                                                        'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3']
     35field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
     36                                                                        2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,
     37                                                                        2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13]
     38field_values=[md.results.TransientSolution[0].Vx,
     39                                                        md.results.TransientSolution[0].Vy,
     40                                                        md.results.TransientSolution[0].Vel,
     41                                                        md.results.TransientSolution[0].Pressure,
     42                                                        md.results.TransientSolution[0].Thickness,
     43                                                        md.results.TransientSolution[0].Surface,
     44                                                        md.results.TransientSolution[0].MaskIceLevelset,
     45                                                        md.results.TransientSolution[1].Vx,
     46                                                        md.results.TransientSolution[1].Vy,
     47                                                        md.results.TransientSolution[1].Vel,
     48                                                        md.results.TransientSolution[1].Pressure,
     49                                                        md.results.TransientSolution[1].Thickness,
     50                                                        md.results.TransientSolution[1].Surface,
     51                                                        md.results.TransientSolution[1].MaskIceLevelset,
     52                                                        md.results.TransientSolution[2].Vx,
     53                                                        md.results.TransientSolution[2].Vy,
     54                                                        md.results.TransientSolution[2].Vel,
     55                                                        md.results.TransientSolution[2].Pressure,
     56                                                        md.results.TransientSolution[2].Thickness,
     57                                                        md.results.TransientSolution[2].Surface,
     58                                                        md.results.TransientSolution[2].MaskIceLevelset]
  • issm/trunk-jpl/test/NightlyRun/test805.py

    r21060 r21408  
    11#Test Name: ValleyGlacierLevelsetEnthCalvingHO3d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    4 from squaremesh import *
    55from setmask import *
    66from parameterize import *
    77from setflowequation import *
    88from solve import *
    9 from MatlabFuncs import *
     9
    1010
    1111md=triangle(model(),'../Exp/Square.exp',50000)
    … …  
    1414md.extrude(3,2.)
    1515md=setflowequation(md,'HO','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1717
    1818#Thermal model
    19 pos_surf=numpy.nonzero(md.mesh.vertexonsurface)[0]
     19pos_surf=np.nonzero(md.mesh.vertexonsurface)[0]
    2020md.thermal.spctemperature[pos_surf]=md.initialization.temperature[pos_surf]
    2121md.thermal.isenthalpy=True
    … …  
    2929md.transient.isgroundingline=True
    3030md.transient.isgia=False
    31 md.transient.ismovingfront=True;
     31md.transient.ismovingfront=True
    3232
    33 md.calving.calvingrate=1000.*numpy.ones((md.mesh.numberofvertices,1))
    34 md.calving.meltingrate=numpy.zeros((md.mesh.numberofvertices,1))
     33md.calving.calvingrate=1000.*np.ones((md.mesh.numberofvertices))
     34md.calving.meltingrate=np.zeros((md.mesh.numberofvertices))
    3535
    3636md=solve(md,'Transient')
    3737
    3838#Fields and tolerances to track changes
    39 field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1','Enthalpy1','Watercolumn1',\
    40                 'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2','Enthalpy2','Watercolumn2',\
    41                 'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3','Enthalpy3','Watercolumn3']
    42 field_tolerances=[1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,\
    43                 1e-9,1e-9,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,1e-10,\
    44                 1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
    45 field_values=[\
    46         md.results.TransientSolution[0].Vx,\
    47         md.results.TransientSolution[0].Vy,\
    48         md.results.TransientSolution[0].Vel,\
    49         md.results.TransientSolution[0].Pressure,\
    50         md.results.TransientSolution[0].Thickness,\
    51         md.results.TransientSolution[0].Surface,\
    52         md.results.TransientSolution[0].MaskIceLevelset,\
    53         md.results.TransientSolution[0].Enthalpy,\
    54         md.results.TransientSolution[0].Watercolumn,\
    55         md.results.TransientSolution[1].Vx,\
    56         md.results.TransientSolution[1].Vy,\
    57         md.results.TransientSolution[1].Vel,\
    58         md.results.TransientSolution[1].Pressure,\
    59         md.results.TransientSolution[1].Thickness,\
    60         md.results.TransientSolution[1].Surface,\
    61         md.results.TransientSolution[1].MaskIceLevelset,\
    62         md.results.TransientSolution[1].Enthalpy,\
    63         md.results.TransientSolution[1].Watercolumn,\
    64         md.results.TransientSolution[2].Vx,\
    65         md.results.TransientSolution[2].Vy,\
    66         md.results.TransientSolution[2].Vel,\
    67         md.results.TransientSolution[2].Pressure,\
    68         md.results.TransientSolution[2].Thickness,\
    69         md.results.TransientSolution[2].Surface,\
    70         md.results.TransientSolution[2].MaskIceLevelset,\
    71         md.results.TransientSolution[2].Enthalpy,\
    72         md.results.TransientSolution[2].Watercolumn,\
    73         ]
     39field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1','Enthalpy1','Watercolumn1',
     40                                                                        'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2','Enthalpy2','Watercolumn2',
     41                                                                        'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3','Enthalpy3','Watercolumn3']
     42field_tolerances=[1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,
     43                                                                        1e-9,1e-9,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,1e-10,
     44                                                                        1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
     45field_values=[md.results.TransientSolution[0].Vx,
     46                                                        md.results.TransientSolution[0].Vy,
     47                                                        md.results.TransientSolution[0].Vel,
     48                                                        md.results.TransientSolution[0].Pressure,
     49                                                        md.results.TransientSolution[0].Thickness,
     50                                                        md.results.TransientSolution[0].Surface,
     51                                                        md.results.TransientSolution[0].MaskIceLevelset,
     52                                                        md.results.TransientSolution[0].Enthalpy,
     53                                                        md.results.TransientSolution[0].Watercolumn,
     54                                                        md.results.TransientSolution[1].Vx,
     55                                                        md.results.TransientSolution[1].Vy,
     56                                                        md.results.TransientSolution[1].Vel,
     57                                                        md.results.TransientSolution[1].Pressure,
     58                                                        md.results.TransientSolution[1].Thickness,
     59                                                        md.results.TransientSolution[1].Surface,
     60                                                        md.results.TransientSolution[1].MaskIceLevelset,
     61                                                        md.results.TransientSolution[1].Enthalpy,
     62                                                        md.results.TransientSolution[1].Watercolumn,
     63                                                        md.results.TransientSolution[2].Vx,
     64                                                        md.results.TransientSolution[2].Vy,
     65                                                        md.results.TransientSolution[2].Vel,
     66                                                        md.results.TransientSolution[2].Pressure,
     67                                                        md.results.TransientSolution[2].Thickness,
     68                                                        md.results.TransientSolution[2].Surface,
     69                                                        md.results.TransientSolution[2].MaskIceLevelset,
     70                                                        md.results.TransientSolution[2].Enthalpy,
     71                                                        md.results.TransientSolution[2].Watercolumn]
  • issm/trunk-jpl/test/NightlyRun/test806.py

    r21060 r21408  
    11#Test Name: SquareShelfLevelsetCalvingSSA2dLevermann
    22from model import *
     3from socket import gethostname
    34from triangle import *
    4 from squaremesh import *
    55from setmask import *
    66from parameterize import *
    77from setflowequation import *
    88from solve import *
    9 from MatlabFuncs import *
    10 import numpy
     9
     10import numpy as np
    1111
    1212md=triangle(model(),'../Exp/Square.exp',50000.)
    … …  
    1414md=parameterize(md,'../Par/SquareShelf.py')
    1515md=setflowequation(md,'SSA','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1717
    1818x = md.mesh.x
    … …  
    2121Lx = (xmax-xmin)
    2222alpha = 2./3.
    23 md.mask.ice_levelset = numpy.float_((x - alpha*Lx)>0) - numpy.float_((x - alpha*Lx)<0)
     23md.mask.ice_levelset = np.float_((x - alpha*Lx)>0) - np.float_((x - alpha*Lx)<0)
    2424
    2525md.timestepping.time_step=10
    … …  
    3333md.transient.isgroundingline=False
    3434md.transient.isgia=False
    35 md.transient.ismovingfront=True;
     35md.transient.ismovingfront=True
    3636
    3737md.calving=calvinglevermann()
    38 md.calving.coeff=4.89e13*numpy.ones((md.mesh.numberofvertices,1))
    39 md.calving.meltingrate=numpy.zeros((md.mesh.numberofvertices,1))
    40 md.levelset.spclevelset=numpy.float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
     38md.calving.coeff=4.89e13*np.ones((md.mesh.numberofvertices))
     39md.calving.meltingrate=np.zeros((md.mesh.numberofvertices))
     40md.levelset.spclevelset=np.float('NaN')*np.ones((md.mesh.numberofvertices))
    4141
    4242md.transient.requested_outputs=['default','StrainRateparallel','StrainRateperpendicular','Calvingratex','Calvingratey','CalvingCalvingrate']
    … …  
    4545
    4646#Fields and tolerances to track changes
    47 field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1','StrainRateparallel1','StrainRateperpendicular1','CalvingCalvingrate1',\
    48                 'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2','StrainRateparallel2','StrainRateperpendicular2','CalvingCalvingrate2',\
    49                 'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3','StrainRateparallel3','StrainRateperpendicular3','CalvingCalvingrate3']
    50 field_tolerances=[1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,\
    51                 2e-11,2e-11,2e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,\
    52                 2e-11,2e-11,2e-11,1e-11,1e-11,1e-11,1e-11,5e-11,5e-11,1e-11]
    53 field_values=[\
    54         md.results.TransientSolution[0].Vx,\
    55         md.results.TransientSolution[0].Vy,\
    56         md.results.TransientSolution[0].Vel,\
    57         md.results.TransientSolution[0].Pressure,\
    58         md.results.TransientSolution[0].Thickness,\
    59         md.results.TransientSolution[0].Surface,\
    60         md.results.TransientSolution[0].MaskIceLevelset,\
    61         md.results.TransientSolution[0].StrainRateparallel,\
    62         md.results.TransientSolution[0].StrainRateperpendicular,\
    63         md.results.TransientSolution[0].CalvingCalvingrate,\
    64         md.results.TransientSolution[1].Vx,\
    65         md.results.TransientSolution[1].Vy,\
    66         md.results.TransientSolution[1].Vel,\
    67         md.results.TransientSolution[1].Pressure,\
    68         md.results.TransientSolution[1].Thickness,\
    69         md.results.TransientSolution[1].Surface,\
    70         md.results.TransientSolution[1].MaskIceLevelset,\
    71         md.results.TransientSolution[1].StrainRateparallel,\
    72         md.results.TransientSolution[1].StrainRateperpendicular,\
    73         md.results.TransientSolution[1].CalvingCalvingrate,\
    74         md.results.TransientSolution[2].Vx,\
    75         md.results.TransientSolution[2].Vy,\
    76         md.results.TransientSolution[2].Vel,\
    77         md.results.TransientSolution[2].Pressure,\
    78         md.results.TransientSolution[2].Thickness,\
    79         md.results.TransientSolution[2].Surface,\
    80         md.results.TransientSolution[2].MaskIceLevelset,\
    81         md.results.TransientSolution[2].StrainRateparallel,\
    82         md.results.TransientSolution[2].StrainRateperpendicular,\
    83         md.results.TransientSolution[2].CalvingCalvingrate,\
    84 
    85         ]
     47field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1','StrainRateparallel1','StrainRateperpendicular1','CalvingCalvingrate1',
     48                                                                        'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2','StrainRateparallel2','StrainRateperpendicular2','CalvingCalvingrate2',
     49                                                                        'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3','StrainRateparallel3','StrainRateperpendicular3','CalvingCalvingrate3']
     50field_tolerances=[1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,
     51                                                                        2e-11,2e-11,2e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,
     52                                                                        2e-11,2e-11,2e-11,1e-11,1e-11,1e-11,1e-11,5e-11,5e-11,1e-11]
     53field_values=[md.results.TransientSolution[0].Vx,
     54                                                        md.results.TransientSolution[0].Vy,
     55                                                        md.results.TransientSolution[0].Vel,
     56                                                        md.results.TransientSolution[0].Pressure,
     57                                                        md.results.TransientSolution[0].Thickness,
     58                                                        md.results.TransientSolution[0].Surface,
     59                                                        md.results.TransientSolution[0].MaskIceLevelset,
     60                                                        md.results.TransientSolution[0].StrainRateparallel,
     61                                                        md.results.TransientSolution[0].StrainRateperpendicular,
     62                                                        md.results.TransientSolution[0].CalvingCalvingrate,
     63                                                        md.results.TransientSolution[1].Vx,
     64                                                        md.results.TransientSolution[1].Vy,
     65                                                        md.results.TransientSolution[1].Vel,
     66                                                        md.results.TransientSolution[1].Pressure,
     67                                                        md.results.TransientSolution[1].Thickness,
     68                                                        md.results.TransientSolution[1].Surface,
     69                                                        md.results.TransientSolution[1].MaskIceLevelset,
     70                                                        md.results.TransientSolution[1].StrainRateparallel,
     71                                                        md.results.TransientSolution[1].StrainRateperpendicular,
     72                                                        md.results.TransientSolution[1].CalvingCalvingrate,
     73                                                        md.results.TransientSolution[2].Vx,
     74                                                        md.results.TransientSolution[2].Vy,
     75                                                        md.results.TransientSolution[2].Vel,
     76                                                        md.results.TransientSolution[2].Pressure,
     77                                                        md.results.TransientSolution[2].Thickness,
     78                                                        md.results.TransientSolution[2].Surface,
     79                                                        md.results.TransientSolution[2].MaskIceLevelset,
     80                                                        md.results.TransientSolution[2].StrainRateparallel,
     81                                                        md.results.TransientSolution[2].StrainRateperpendicular,
     82                                                        md.results.TransientSolution[2].CalvingCalvingrate]
  • issm/trunk-jpl/test/NightlyRun/test807.py

    r21060 r21408  
    11#Test Name: SquareShelfLevelsetMeltingSSA2d
    22from model import *
     3from socket import gethostname
    34from triangle import *
    4 from squaremesh import *
    55from setmask import *
    66from parameterize import *
    77from setflowequation import *
    88from solve import *
    9 from MatlabFuncs import *
    10 import numpy
     9
     10import numpy as np
    1111
    1212md=triangle(model(),'../Exp/Square.exp',50000.)
    … …  
    1414md=parameterize(md,'../Par/SquareShelf.py')
    1515md=setflowequation(md,'SSA','all')
    16 md.cluster=generic('name',oshostname(),'np',3)
     16md.cluster=generic('name',gethostname(),'np',3)
    1717
    1818x = md.mesh.x
    … …  
    2121Lx = (xmax-xmin)
    2222alpha = 2./3.
    23 md.mask.ice_levelset = numpy.float_((x - alpha*Lx)>0) - numpy.float_((x - alpha*Lx)<0)
     23md.mask.ice_levelset = np.float_((x - alpha*Lx)>0) - np.float_((x - alpha*Lx)<0)
    2424
    2525md.timestepping.time_step=10
    … …  
    3333md.transient.isgroundingline=False
    3434md.transient.isgia=False
    35 md.transient.ismovingfront=True;
     35md.transient.ismovingfront=True
    3636
    37 md.calving.calvingrate=numpy.zeros((md.mesh.numberofvertices,1))
    38 md.calving.meltingrate=10000*numpy.ones((md.mesh.numberofvertices,1))
    39 md.levelset.spclevelset=numpy.float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
     37md.calving.calvingrate=np.zeros((md.mesh.numberofvertices))
     38md.calving.meltingrate=10000*np.ones((md.mesh.numberofvertices))
     39md.levelset.spclevelset=np.float('NaN')*np.ones((md.mesh.numberofvertices))
    4040
    4141md=solve(md,'Transient')
    4242
    4343#Fields and tolerances to track changes
    44 field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1',\
    45                 'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2',\
    46                 'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3']
    47 field_tolerances=[1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,\
    48                 2e-11,2e-11,2e-11,1e-11,1e-11,1e-11,5e-11,\
    49                 2e-11,2e-11,2e-11,1e-11,1e-11,1e-11,5e-11]
    50 field_values=[\
    51         md.results.TransientSolution[0].Vx,\
    52         md.results.TransientSolution[0].Vy,\
    53         md.results.TransientSolution[0].Vel,\
    54         md.results.TransientSolution[0].Pressure,\
    55         md.results.TransientSolution[0].Thickness,\
    56         md.results.TransientSolution[0].Surface,\
    57         md.results.TransientSolution[0].MaskIceLevelset,\
    58         md.results.TransientSolution[1].Vx,\
    59         md.results.TransientSolution[1].Vy,\
    60         md.results.TransientSolution[1].Vel,\
    61         md.results.TransientSolution[1].Pressure,\
    62         md.results.TransientSolution[1].Thickness,\
    63         md.results.TransientSolution[1].Surface,\
    64         md.results.TransientSolution[1].MaskIceLevelset,\
    65         md.results.TransientSolution[2].Vx,\
    66         md.results.TransientSolution[2].Vy,\
    67         md.results.TransientSolution[2].Vel,\
    68         md.results.TransientSolution[2].Pressure,\
    69         md.results.TransientSolution[2].Thickness,\
    70         md.results.TransientSolution[2].Surface,\
    71         md.results.TransientSolution[2].MaskIceLevelset,\
    72 
    73         ]
     44field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1',
     45                                                                        'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2',
     46                                                                        'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3']
     47field_tolerances=[1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,
     48                                                                        2e-11,2e-11,2e-11,1e-11,1e-11,1e-11,5e-11,
     49                                                                        2e-11,2e-11,2e-11,1e-11,1e-11,1e-11,5e-11]
     50field_values=[md.results.TransientSolution[0].Vx,
     51                                                        md.results.TransientSolution[0].Vy,
     52                                                        md.results.TransientSolution[0].Vel,
     53                                                        md.results.TransientSolution[0].Pressure,
     54                                                        md.results.TransientSolution[0].Thickness,
     55                                                        md.results.TransientSolution[0].Surface,
     56                                                        md.results.TransientSolution[0].MaskIceLevelset,
     57                                                        md.results.TransientSolution[1].Vx,
     58                                                        md.results.TransientSolution[1].Vy,
     59                                                        md.results.TransientSolution[1].Vel,
     60                                                        md.results.TransientSolution[1].Pressure,
     61                                                        md.results.TransientSolution[1].Thickness,
     62                                                        md.results.TransientSolution[1].Surface,
     63                                                        md.results.TransientSolution[1].MaskIceLevelset,
     64                                                        md.results.TransientSolution[2].Vx,
     65                                                        md.results.TransientSolution[2].Vy,
     66                                                        md.results.TransientSolution[2].Vel,
     67                                                        md.results.TransientSolution[2].Pressure,
     68                                                        md.results.TransientSolution[2].Thickness,
     69                                                        md.results.TransientSolution[2].Surface,
     70                                                        md.results.TransientSolution[2].MaskIceLevelset]
Note: See TracChangeset for help on using the changeset viewer.