Changeset 22096


Ignore:
Timestamp:
09/16/17 15:59:41 (8 years ago)
Author:
kruegern
Message:

NEW: completed test2084.py and modified corresponding py files

Location:
issm/trunk-jpl
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/geometry.py

    r21584 r22096  
    4747                if (solution=='TransientSolution' and md.transient.isgia) or (solution=='GiaSolution'):
    4848                        md = checkfield(md,'fieldname','geometry.thickness','NaN',1,'Inf',1,'>=',0,'timeseries',1)
     49                elif solution=='LoveSolution':
     50                        return
    4951                else:
    5052                        md = checkfield(md,'fieldname','geometry.surface'  ,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
  • issm/trunk-jpl/src/m/classes/mask.py

    r21303 r22096  
    3838        #}}}
    3939        def checkconsistency(self,md,solution,analyses):    # {{{
     40                if(solution=='LoveSolution'):
     41                        return
    4042
    4143                md = checkfield(md,'fieldname','mask.ice_levelset'        ,'size',[md.mesh.numberofvertices])
  • issm/trunk-jpl/src/m/classes/materials.py

    r22004 r22096  
    77def naturetointeger(strnat): #{{{
    88   
    9     intnat=np.array(len(strnat))
     9    intnat=np.zeros(len(strnat))
    1010    for i in range(len(intnat)):
    1111        if strnat[i]=='damageice':
     
    181181
    182182                    self.viscosity=[1e21,1e40] #mantle and lithosphere viscosity (respectively) [Pa.s]
    183                     self.lame_mu=[1.45*1e11,6.7*10^10]  # (Pa) #lithosphere and mantle shear modulus (respectively) [Pa]
     183                    self.lame_mu=[1.45*1e11,6.7*1e10]  # (Pa) #lithosphere and mantle shear modulus (respectively) [Pa]
    184184                    self.lame_lambda=self.lame_mu  # (Pa) #mantle and lithosphere lamba parameter (respectively) [Pa]
    185                     self.burgers_viscosity=[NaN,NaN]
    186                     self.burgers_mu=[NaN,NaN]
     185                    self.burgers_viscosity=[np.nan,np.nan]
     186                    self.burgers_mu=[np.nan,np.nan]
    187187                    self.isburgers=[0,0]
    188188                    self.density=[5.51*1e3,5.50*1e3]  # (Pa) #mantle and lithosphere density [kg/m^3]
     
    228228                   
    229229                    for i in range(md.materials.numlayers-1):
    230                         if md.materials.issolid[i] and md.materials.issolid[i+1]: #if there are at least two consecutive indices that contain issolid = 0
    231                             raise RuntimeError("%s%i%s"%('2 or more adjacent fluid layers detected starting at layer',i,'This is not supported yet. Consider merging them.'))
     230                        if (not md.materials.issolid[i]) and (not md.materials.issolid[i+1]): #if there are at least two consecutive indices that contain issolid = 0
     231                            raise RuntimeError("%s%i%s"%('2 or more adjacent fluid layers detected starting at layer ',i,'. This is not supported yet. Consider merging them.'))
    232232
    233233                else:
     
    237237        # }}}
    238238        def marshall(self,prefix,md,fid):    # {{{
    239            
     239
    240240            #1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum
    241241            WriteData(fid,prefix,'name','md.materials.type','data',6,'format','Integer')
  • issm/trunk-jpl/src/m/classes/mesh2d.py

    r21575 r22096  
    8282        #}}}
    8383        def checkconsistency(self,md,solution,analyses):    # {{{
     84                if(solution=='LoveSolution'):
     85                        return
    8486
    8587                md = checkfield(md,'fieldname','mesh.x','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
  • issm/trunk-jpl/test/NightlyRun/test2084.py

    r22062 r22096  
    1 
    2 #Test Name: GiaCaron. Forward Love number solution for a viscoelastic earth, model M3-L70-V01 from Spada, G., Barletta, V. R., Klemann, V., Riva, R. E. M., Martinec, Z., Gasperini, P., Lund, B., Wolf, D., Vermeersen, L. L. A. and King, M. A. (2011), A benchmark study for glacial isostatic adjustment codes. Geophysical Journal International, 185: 106–132. doi:10.1111/j.1365-246X.2011.04952.x
     1#Test Name: GiaCaron. Forward Love number solution for a viscoelastic earth,
     2#       model M3-L70-V01 from Spada, G., Barletta, V. R., Klemann, V., Riva, R. E. M.,
     3#       Martinec, Z., Gasperini, P., Lund, B., Wolf, D., Vermeersen, L. L. A.
     4#       and King, M. A. (2011), A benchmark study for glacial isostatic
     5#       adjustment codes. Geophysical Journal International,
     6#       185: 106-132. doi:10.1111/j.1365-246X.2011.04952.x
     7
    38from model import *
    49from socket import gethostname
    510from solve import *
    6 from numpy import *
     11from numpy import *
     12from generic import generic
     13from materials import *
     14
    715md=model()
    8 md.cluster=generic('name',oshostname(),'np',1)
     16md.cluster=generic('name',gethostname(),'np',1)
     17
    918md.materials=materials('litho')
    1019md.miscellaneous.name='FourierLoveTest'
     20
    1121md.verbose=verbose('111111101')
    1222cst=365.25*24*3600*1000
     23
    1324md.materials.numlayers=6
    14 md.materials.radius =[10, 1222.5, 3.4800e+03,5.7010e+03,5.9510e+03,6.3010e+03,6.3710e+03]*1e3
    15 md.materials.density=[1.0750e4, 1.0750e+04,4.9780e+03,3.8710e+03,3.4380e+03,3.0370e+03]
    16 md.materials.lame_mu=[1e-5,0,2.2834e+00,1.0549e+00,7.0363e-01,5.0605e-01]*1e11
    17 md.materials.viscosity=[0,0,2.0000e+00,1.0000e+00,1.0000e+00,1.0000e+25]*1e21
    18 md.materials.lame_lambda=md.materials.lame_mu*0+5e14
    19 md.materials.issolid=[1, 0, 1, 1, 1, 1]
    20 md.materials.isburgers=zeros(md.materials.numlayers,1)
     25md.materials.radius=np.array([10,1222.5,3.4800e+03,5.7010e+03,5.9510e+03,
     26                                6.3010e+03,6.3710e+03]).reshape(-1,1)*1e3
     27md.materials.density=np.array([1.0750e4,1.0750e+04,4.9780e+03,3.8710e+03,
     28                                3.4380e+03,3.0370e+03]).reshape(-1,1)
     29md.materials.lame_mu=np.array([1e-5,0,2.2834e+00,1.0549e+00,7.0363e-01,
     30                                5.0605e-01]).reshape(-1,1)*1e11
     31md.materials.viscosity=np.array([0,0,2.0000e+00,1.0000e+00,1.0000e+00,
     32                                1.0000e+25]).reshape(-1,1)*1e21
     33md.materials.lame_lambda=np.array(md.materials.lame_mu)*0+5e14
     34md.materials.issolid=np.array([1,0,1,1,1,1]).reshape(-1,1)
     35md.materials.isburgers=np.zeros((md.materials.numlayers,1))
     36
    2137md.love.allow_layer_deletion=1
    22 
    23 md.love.frequencies=([0]*2*pi)/cst
     38md.love.frequencies=(np.array([0])*2*pi).reshape(-1,1)/cst
     39md.love.nfreq=len(md.love.frequencies)
     40md.love.sh_nmax=256
     41
     42md.materials.burgers_mu=md.materials.lame_mu
     43md.materials.burgers_viscosity=md.materials.viscosity
     44
     45md=solve(md,'lv')
     46
     47
     48
     49#Fields and tolerances to track changes
     50#loading love numbers
     51field_names=['LoveHe','LoveKe','LoveLe']
     52field_tolerances=[3.2e-9,3.2e-9,3.2e-9]
     53field_values=[
     54np.array(md.results.LoveSolution.LoveHr)[:,0],
     55np.array(md.results.LoveSolution.LoveKr)[:,0],
     56np.array(md.results.LoveSolution.LoveLr)[:,0]
     57]
     58
     59md.love.frequencies=(np.array([1e-3,1e-2,1e-1,1,-1e-3,-1e-2,-1e-1,
     60                                -1])*2*pi).reshape(-1,1)/cst
    2461md.love.nfreq=len(md.love.frequencies)
    2562md.love.sh_nmax=256
    2663md.materials.burgers_mu=md.materials.lame_mu
    2764md.materials.burgers_viscosity=md.materials.viscosity
    28 md=solve(md,'lv')
     65
     66md=solve(md,'lv')
     67
     68
     69
    2970#Fields and tolerances to track changes
    3071#loading love numbers
    31 field_names=['LoveHe','LoveKe','LoveLe']
    32 field_tolerances=[1e-13,1e-13,1e-13]
    33 field_values=[\
    34 (md.results.LoveSolution.LoveHr[:][0]),\
    35 (md.results.LoveSolution.LoveKr[:][0]),\
    36 (md.results.LoveSolution.LoveLr[:][0]),\
    37 ]
    38 
    39 
    40 md.love.frequencies=([1e-3, 1e-2, 1e-1, 1, -1e-3, -1e-2, -1e-1, -1]*2*pi)/cst
    41 md.love.nfreq=len(md.love.frequencies)
    42 md.love.sh_nmax=256
    43 md.materials.burgers_mu=md.materials.lame_mu
    44 md.materials.burgers_viscosity=md.materials.viscosity
    45 md=solve(md,'lv')
    46 #Fields and tolerances to track changes
    47 #loading love numbers
    48 field_names=concatenate([field_names,['LoveHlr','LoveKlr','LoveLlr','LoveHli','LoveKli','LoveLli']])
    49 field_tolerances=concatenate([field_tolerances,[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]])
    50 field_values=concatenate([field_values,[\
    51 (md.results.LoveSolution.LoveHr[:][:]),\
    52 (md.results.LoveSolution.LoveKr[:][:]),\
    53 (md.results.LoveSolution.LoveLr[:][:])),\
    54 (md.results.LoveSolution.LoveHi[:][:]),\
    55 (md.results.LoveSolution.LoveKi[:][:]),\
    56 (md.results.LoveSolution.LoveLi[:][:]),\
    57 ]])
    58 
    59 
     72field_names+=['LoveHlr','LoveKlr','LoveLlr','LoveHli','LoveKli','LoveLli']
     73field_tolerances+=[3.2e-9,3.2e-9,3.2e-9,3.2e-9,3.2e-9,3.2e-9]
     74field_values+=[
     75np.array(md.results.LoveSolution.LoveHr),
     76np.array(md.results.LoveSolution.LoveKr),
     77np.array(md.results.LoveSolution.LoveLr),
     78np.array(md.results.LoveSolution.LoveHi),
     79np.array(md.results.LoveSolution.LoveKi),
     80np.array(md.results.LoveSolution.LoveLi)
     81]
    6082
    6183md.love.forcing_type=9
    6284md.love.sh_nmin=2
    63 md.love.frequencies=([0, 1e-4, 1e-3, 1e-2, 1e-1, 1, -1e-4, -1e-3, -1e-2, -1e-1, -1]*2*pi)/cst
    64 md.love.nfreq=len(md.love.frequencies)
    65 md=solve(md,'lv')
    66 #tidal love numbers
    67 field_names=concatenate([field_names,['LoveHtr','LoveKtr','LoveLtr','LoveHti','LoveKti','LoveLti']])
    68 field_tolerances=concatenate([field_tolerances,[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]])
    69 field_values=concatenate([field_values,[\
    70 (md.results.LoveSolution.LoveHr[:][0]),\
    71 (md.results.LoveSolution.LoveKr[:][0]),\
    72 (md.results.LoveSolution.LoveLr[:][0]),\
    73 (md.results.LoveSolution.LoveHr[:][1:]),\
    74 (md.results.LoveSolution.LoveKr[:][1:]),\
    75 (md.results.LoveSolution.LoveLr[:][1:]),\
    76 (md.results.LoveSolution.LoveHi[:][1:]),\
    77 (md.results.LoveSolution.LoveKi[:][1:]),\
    78 (md.results.LoveSolution.LoveLi[:][1:]),\
    79 ]])
     85md.love.frequencies=((np.array([0,1e-3,1e-2,1e-1,1,-1e-3,
     86                                -1e-2,-1e-1,-1])*2*pi).reshape(-1,1)/cst)
     87md.love.nfreq=len(md.love.frequencies)
     88
     89md=solve(md,'lv')
     90
     91
     92
     93#tidal love numbers, check
     94field_names+=['LoveHtr','LoveKtr','LoveLtr','LoveHti','LoveKti','LoveLti']
     95field_tolerances+=[3.2e-9,3.2e-9,3.2e-9,3.2e-9,3.2e-9,3.2e-9,3.2e-9,3.2e-9,3.2e-9]
     96field_values+=[
     97np.array(md.results.LoveSolution.LoveHr)[:,0],
     98np.array(md.results.LoveSolution.LoveKr)[:,0],
     99np.array(md.results.LoveSolution.LoveLr)[:,0],
     100np.array(md.results.LoveSolution.LoveHr)[:,1:],
     101np.array(md.results.LoveSolution.LoveKr)[:,1:],
     102np.array(md.results.LoveSolution.LoveLr)[:,1:],
     103np.array(md.results.LoveSolution.LoveHi)[:,1:],
     104np.array(md.results.LoveSolution.LoveKi)[:,1:],
     105np.array(md.results.LoveSolution.LoveLi)[:,1:]
     106]
    80107
    81108
     
    120147#       (md.results.LoveSolution.LoveLi[:][1:]),\
    121148#       ]
    122 #Model VSS96 from Vermeersen, L.L.A., Sabadini, R. & Spada, G., 1996a. Analytical visco-elastic relaxation models, Geophys. Res. Lett., 23, 697–700.
    123 md.materials.radius=[10, 1222.5, 3480., 3600., 3630.5, 3700., 3900., 4000., 4200., 4300., 4500., 4600., 4800., 4900., 5100., 5200., 5400., 5500., 5600.5, 5650., 5701., 5736., 5771.5, 5821., 5951., 5970.5, 6016., 6061., 6150.5, 6151.5, 6251., 6371.]*1e3
    124 md.materials.lame_mu=[1e-5, 0., 2.933, 2.8990002, 2.8550003, 2.7340002, 2.675, 2.559, 2.502, 2.388, 2.331, 2.215, 2.157, 2.039, 1.979, 1.8560001, 1.794, 1.73, 1.639, 1.2390001, 1.224, 1.21, 1.128, 0.97700006, 0.906, 0.79, 0.773, 0.741, 0.656, 0.665, 0.602]*1e11
    125 md.materials.density=[10925., 10925., 5506.42, 5491.45, 5456.57, 5357.06, 5307.24, 5207.13, 5156.69, 5054.69, 5002.99, 4897.83, 4844.22, 4734.6, 4678.44, 4563.07, 4503.72, 4443.16, 4412.41, 3992.14, 3983.99, 3975.84, 3912.82, 3786.78, 3723.78, 3516.39, 3489.51, 3435.78, 3359.5, 3367.1, 3184.3]
    126 md.materials.viscosity=[0., 0., 8E+21, 8.5E+21, 9E+21, 3.E+22, 4.E+22, 5E+22, 6.E+22, 5E+22, 4.5E+22, 3.E+22, 2.5E+22, 1.8E+22, 1.3E+22, 8E+21, 7E+21, 6.5E+21, 6.E+21, 5.5E+21, 5.E+21, 55E+21, 45E+21, 2.5E+21, 27E+21, 1.5E+21, 10E+20, 6.E+20, 5.5E+20, 2.E+20, 1.E40]
    127 md.materials.lame_lambda=md.materials.lame_mu*0+5e14
    128 md.materials.issolid=ones(len(md.materials.mu))
     149#Model VSS96 from Vermeersen, L.L.A., Sabadini, R. & Spada, G., 1996a. Analytical visco-elastic relaxation models, Geophys. Res. Lett., 23, 697-700.
     150
     151md.materials.radius=np.array([10,1222.5,3480.,3600.,3630.5,3700.,3900.,4000.,
     152                                4200.,4300.,4500.,4600.,4800.,4900.,5100.,5200.,
     153                                5400.,5500.,5600.5,5650.,5701.,5736.,5771.5,
     154                                5821.,5951.,5970.5,6016.,6061.,6150.5,6151.5,
     155                                6251.,6371.]).reshape(-1,1)*1e3
     156md.materials.lame_mu=np.array([1e-5,0.,2.933,2.8990002,2.8550003,2.7340002,2.675,
     157                                2.559,2.502,2.388,2.331,2.215,2.157,2.039,1.979,
     158                                1.8560001,1.794,1.73,1.639,1.2390001,1.224,1.21,
     159                                1.128,0.97700006,0.906,0.79,0.773,0.741,0.656,0.665,
     160                                0.602]).reshape(-1,1)*1e11
     161md.materials.density=np.array([10925.,10925.,5506.42,5491.45,5456.57,5357.06,
     162                                5307.24,5207.13,5156.69,5054.69,5002.99,4897.83,
     163                                4844.22,4734.6,4678.44,4563.07,4503.72,4443.16,
     164                                4412.41,3992.14,3983.99,3975.84,3912.82,3786.78,
     165                                3723.78,3516.39,3489.51,3435.78,3359.5,3367.1,
     166                                3184.3]).reshape(-1,1)
     167md.materials.viscosity=np.array([0.,0.,7.999999999999999E+21,8.5E+21,
     168                                8.999999999999999E+21,3.E+22,4.E+22,
     169                                5.0000000000000004E+22,6.E+22,
     170                                5.0000000000000004E+22,4.5E+22,3.E+22,
     171                                2.5000000000000002E+22,1.7999999999999998E+22,
     172                                1.3E+22,7.999999999999999E+21,6.999999999999999E+21,
     173                                6.5E+21,6.E+21,5.5E+21,5.E+21,4.4999999999999995E+21,
     174                                3.9999999999999995E+21,2.5E+21,
     175                                1.9999999999999997E+21,1.5E+21,9.999999999999999E+20,
     176                                6.E+20,5.5000000000000007E+20,2.E+20,
     177                                1.E40]).reshape(-1,1)
     178md.materials.lame_lambda=np.array(md.materials.lame_mu)*0+5e14
     179md.materials.issolid=np.ones(len(md.materials.lame_mu)).reshape(-1,1)
    129180md.materials.issolid[1]=0
    130181md.materials.numlayers=len(md.materials.lame_mu)
     
    135186md.love.sh_nmin=1
    136187md.love.sh_nmax=100
    137 md=solve(md,'lv')
    138 md.love.frequencies=([0, 1e-4, 1e-2, 1, -1e-4, -1e-2, -1]*2*pi)/cst
    139 md.love.nfreq=len(md.love.frequencies)
    140 field_names=concatenate([field_names,['LoveHmr','LoveKmr','LoveLmr','LoveHmi','LoveKmi','LoveLmi']])
    141 field_tolerances=concatenate([field_tolerances,[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]])
    142 field_values=concatenate([field_values,[\
    143 (md.results.LoveSolution.LoveHr[:][0]),\
    144 (md.results.LoveSolution.LoveKr[:][0]),\
    145 (md.results.LoveSolution.LoveLr[:][0]),\
    146 (md.results.LoveSolution.LoveHr[:][1:]),\
    147 (md.results.LoveSolution.LoveKr[:][1:]),\
    148 (md.results.LoveSolution.LoveLr[:][1:]),\
    149 (md.results.LoveSolution.LoveHi[:][1:]),\
    150 (md.results.LoveSolution.LoveKi[:][1:]),\
    151 (md.results.LoveSolution.LoveLi[:][1:]),\
    152 ]])
     188
     189md=solve(md,'lv')
     190
     191
     192
     193md.love.frequencies=(np.array([0,1e-3,1e-2,1,-1e-3,-1e-2,
     194                                -1])*2*pi).reshape(-1,1)/cst
     195md.love.nfreq=len(md.love.frequencies)
     196
     197field_names+=['LoveHmr','LoveKmr','LoveLmr','LoveHmi','LoveKmi','LoveLmi']
     198field_tolerances+=[3.2e-9,3.2e-9,3.2e-9,3.2e-9,3.2e-9,3.2e-9,3.2e-9,3.2e-9,3.2e-9]
     199field_values+=[
     200np.array(md.results.LoveSolution.LoveHr)[:,0],
     201np.array(md.results.LoveSolution.LoveKr)[:,0],
     202np.array(md.results.LoveSolution.LoveLr)[:,0],
     203np.array(md.results.LoveSolution.LoveHr)[:,1:],
     204np.array(md.results.LoveSolution.LoveKr)[:,1:],
     205np.array(md.results.LoveSolution.LoveLr)[:,1:],
     206np.array(md.results.LoveSolution.LoveHi)[:,1:],
     207np.array(md.results.LoveSolution.LoveKi)[:,1:],
     208np.array(md.results.LoveSolution.LoveLi)[:,1:]
     209]
Note: See TracChangeset for help on using the changeset viewer.