Changeset 25129
- Timestamp:
- 06/23/20 21:34:00 (5 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/m/classes/giaivins.m ¶
r25056 r25129 11 11 end 12 12 methods 13 function self = extrude(self,md) % {{{14 self.mantle_viscosity=project3d(md,'vector',self.mantle_viscosity,'type','node');15 self.lithosphere_thickness=project3d(md,'vector',self.lithosphere_thickness,'type','node');16 end % }}}17 13 function self = giaivins(varargin) % {{{ 18 14 switch nargin … … 70 66 71 67 end % }}} 68 function self = extrude(self,md) % {{{ 69 self.mantle_viscosity=project3d(md,'vector',self.mantle_viscosity,'type','node'); 70 self.lithosphere_thickness=project3d(md,'vector',self.lithosphere_thickness,'type','node'); 71 end % }}} 72 72 end 73 73 end -
TabularUnified issm/trunk-jpl/src/m/classes/giaivins.py ¶
r24213 r25129 1 import numpy as np 2 3 from checkfield import checkfield 1 4 from fielddisplay import fielddisplay 2 5 from project3d import project3d 3 from checkfield import checkfield4 6 from WriteData import WriteData 5 7 … … 7 9 class giaivins(object): 8 10 """ 9 GIA class definition 11 GIA class definition for Ivins and James model 10 12 11 13 Usage: … … 13 15 """ 14 16 15 def __init__(self ): #{{{16 self.mantle_viscosity = float('NaN')17 self.lithosphere_thickness = float('NaN')18 self.cross_section_shape = 017 def __init__(self, *args): #{{{ 18 self.mantle_viscosity = np.nan 19 self.lithosphere_thickness = np.nan 20 self.cross_section_shape = 0 19 21 20 #set defaults 21 self.setdefaultparameters() 22 nargin = len(args) 22 23 24 if nargin == 0: 25 self.setdefaultparameters() 26 else: 27 raise Exception('constructor not supported') 23 28 #}}} 24 29 25 def __repr__(self): # {{{ 26 string = ' giaivins solution parameters:' 30 def __repr__(self): #{{{ 31 s = ' giaivins solution parameters:' 32 s += "{}\n".format(fielddisplay(self, 'mantle_viscosity', 'mantle viscosity constraints (NaN means no constraint) (Pa s)')) 33 s += "{}\n".format(fielddisplay(self, 'lithosphere_thickness', 'lithosphere thickness constraints (NaN means no constraint) (m)')) 34 s += "{}\n".format(fielddisplay(self, 'cross_section_shape', "1: square-edged, 2: elliptical-sedged surface")) 27 35 28 string = "%s\n%s" % (string, fielddisplay(self, 'mantle_viscosity', 'mantle viscosity constraints (NaN means no constraint) (Pa s)')) 29 string = "%s\n%s" % (string, fielddisplay(self, 'lithosphere_thickness', 'lithosphere thickness constraints (NaN means no constraint) (m)')) 30 string = "%s\n%s" % (string, fielddisplay(self, 'cross_section_shape', "1: square-edged, 2: elliptical - edged surface")) 31 return string 36 return s 32 37 #}}} 33 38 34 def extrude(self, md): #{{{35 self. mantle_viscosity = project3d(md, 'vector', self.mantle_viscosity, 'type', 'node')36 self.lithosphere_thickness = project3d(md, 'vector', self.lithosphere_thickness, 'type', 'node') 39 def setdefaultparameters(self): #{{{ 40 self.cross_section_shape = 1 41 37 42 return self 38 43 #}}} 39 44 40 def setdefaultparameters(self): # {{{ 41 self.cross_section_shape = 1 42 return self 43 #}}} 44 45 def checkconsistency(self, md, solution, analyses): # {{{ 46 # Early return 47 if ('GiaAnalysis' not in analyses): 45 def checkconsistency(self, md, solution, analyses): #{{{ 46 if not 'GiaAnalysis' in analyses: 48 47 return md 49 48 … … 56 55 57 56 return md 58 # 57 #}}} 59 58 60 def marshall(self, prefix, md, fid): # {{{ 61 59 def marshall(self, prefix, md, fid): #{{{ 62 60 WriteData(fid, prefix, 'object', self, 'fieldname', 'mantle_viscosity', 'format', 'DoubleMat', 'mattype', 1) 63 61 WriteData(fid, prefix, 'object', self, 'fieldname', 'lithosphere_thickness', 'format', 'DoubleMat', 'mattype', 1, 'scale', 10.**3.) 64 62 WriteData(fid, prefix, 'object', self, 'fieldname', 'cross_section_shape', 'format', 'Integer') 65 # }}} 63 #}}} 64 65 def extrude(self, md): #{{{ 66 self.mantle_viscosity = project3d(md, 'vector', self.mantle_viscosity, 'type', 'node') 67 self.lithosphere_thickness = project3d(md, 'vector', self.lithosphere_thickness, 'type', 'node') 68 return self 69 #}}} -
TabularUnified issm/trunk-jpl/src/m/classes/giamme.m ¶
r25085 r25129 14 14 end 15 15 methods 16 function self = extrude(self,md) % {{{17 for i=1:length(self.Ngia),18 self.Ngia{i}=project3d(md,'vector',self.Ngia{i},'type','node','layer',1);19 self.Ugia{i}=project3d(md,'vector',self.Ugia{i},'type','node','layer',1);20 end21 end % }}}22 16 function self = giamme(varargin) % {{{ 23 17 switch nargin … … 74 68 75 69 end % }}} 70 function self = extrude(self,md) % {{{ 71 for i=1:length(self.Ngia), 72 self.Ngia{i}=project3d(md,'vector',self.Ngia{i},'type','node','layer',1); 73 self.Ugia{i}=project3d(md,'vector',self.Ugia{i},'type','node','layer',1); 74 end 75 end % }}} 76 76 end 77 77 end -
TabularUnified issm/trunk-jpl/src/m/classes/mesh3dsurface.m ¶
r24919 r25129 73 73 function obj = setdefaultparameters(obj) % {{{ 74 74 75 % the connectivity is the averaged number of nodes linked to a76 % given node through an edge. This connectivity is used to initially77 %allocate memory to the stiffness matrix. A value of 16 seems to 78 %give a good memory/time ratio n. This value can be checked in79 %t runk/test/Miscellaneous/runme.m75 %The connectivity is the average number of nodes linked to a given 76 %node through an edge. This connectivity is used to initially 77 %allocate memory to the stiffness matrix. A value of 16 seems to 78 %give a good memory/time ratio. This value can be checked in 79 %test/NightlyRun/runme.py. 80 80 obj.average_vertex_connectivity=25; 81 81 end % }}} -
TabularUnified issm/trunk-jpl/src/m/classes/mesh3dsurface.py ¶
r24919 r25129 9 9 10 10 class mesh3dsurface(object): 11 #MESH3DSURFACE class definition 12 # 13 # Usage: 14 # mesh3dsurface = mesh3dsurface(); 11 ''' 12 MESH3DSURFACE class definition 13 14 Usage: 15 mesh3dsurface = mesh3dsurface() 16 ''' 17 15 18 def __init__(self, *args): # {{{ 16 19 self.x = np.nan … … 84 87 # }}} 85 88 86 def loadobj(self): # {{{87 # This def is directly called by matlab when a model() selfect is88 # loaded. Update old properties here89 90 #2014 Oct. 1st91 if isstruct(self):92 oldself = self93 #Assign property values from struct94 self = structtoobj(mesh3dsurface(), oldself)95 if isfield(oldself, 'hemisphere'):96 print('md.mesh.hemisphere has been automatically converted to EPSG code')97 if strcmpi(oldself.hemisphere, 'n'):98 self.epsg = 341399 else:100 self.epsg = 3031101 return self102 # }}}103 104 89 def setdefaultparameters(self): # {{{ 105 # the connectivity is the averaged number of nodes linked to a106 # given node through an edge. This connectivity is used to initially107 # allocate memory to the stiffness matrix. A value of 16 seems to108 # give a good memory / time ration. This value can be checked in109 #t runk / test / Miscellaneous / runme.m90 #The connectivity is the average number of nodes linked to a given node 91 #through an edge. This connectivity is used to initially allocate 92 #memory to the stiffness matrix. A value of 16 seems to give a good 93 #memory/time ratio. This value can be checked in 94 #test/NightlyRun/runme.py. 110 95 self.average_vertex_connectivity = 25 96 111 97 return self 112 98 # }}} -
TabularUnified issm/trunk-jpl/src/m/classes/model.py ¶
r25125 r25129 54 54 from transient import transient 55 55 from giaivins import giaivins 56 from giamme import giamme 56 57 from esa import esa 57 58 from autodiff import autodiff … … 117 118 self.calving = calving() 118 119 self.frontalforcings = frontalforcings() 119 self.gia = gia ivins()120 self.gia = giamme() 120 121 self.love = fourierlove() 121 122 self.esa = esa() -
TabularUnified issm/trunk-jpl/src/m/parameterization/parameterize.py ¶
r24213 r25129 4 4 5 5 def parameterize(md, parametername): 6 """6 ''' 7 7 PARAMETERIZE - parameterize a model 8 8 9 from a parameter python file, start filling in all the model fields that were not10 filled in by the mesh.py and mask.py model methods.11 Warning: the parameter file must be able to be run in Python9 From a parameter Python file, start filling in all the model fields 10 that were not filled in by the mesh.py and mask.py model methods. 11 Warning: the parameter file must be able to be run in Python 12 12 13 Usage:14 md = parameterize(md, parametername)13 Usage: 14 md = parameterize(md, parametername) 15 15 16 Example:17 md = parameterize(md, 'Square.par')18 """16 Example: 17 md = parameterize(md, 'Square.par') 18 ''' 19 19 20 20 #some checks -
TabularUnified issm/trunk-jpl/test/NightlyRun/test2001.py ¶
r25125 r25129 4 4 import numpy as np 5 5 6 from giaivins import giaivins 6 7 from model import * 7 8 from parameterize import * … … 39 40 #Solve for GIA deflection 40 41 md.cluster = generic('name', gethostname(), 'np', 3) 42 md.verbose = verbose('1111111') 41 43 md = solve(md, 'Gia') 42 44 -
TabularUnified issm/trunk-jpl/test/NightlyRun/test2051.py ¶
r24214 r25129 1 1 #Test Name: GiaIvinsBenchmarksAB2dA1 2 2 import numpy as np 3 3 4 from model import * 4 5 from socket import gethostname … … 33 34 field_names = ['GiaW', 'GiadWdt'] 34 35 field_tolerances = [1e-13, 1e-13] 35 field_values = [md.results.GiaSolution. GiaW, md.results.GiaSolution.GiadWdt]36 field_values = [md.results.GiaSolution.UGia, md.results.GiaSolution.UGiaRate] -
TabularUnified issm/trunk-jpl/test/NightlyRun/test2052.py ¶
r24214 r25129 1 1 #Test Name: GiaIvinsBenchmarksAB2dA2 2 2 import numpy as np 3 3 4 from model import * 4 5 from socket import gethostname -
TabularUnified issm/trunk-jpl/test/Par/GiaIvinsBenchmarksAB.py ¶
r25075 r25129 1 1 #Geometry specific to Experiments A and B 2 3 2 import os.path 4 3 import inspect 4 5 5 import numpy as np 6 6 7 from arch import * 8 from giaivins import giaivins 7 9 from InterpFromMeshToMesh2d import * 8 10 from paterson import * -
TabularUnified issm/trunk-jpl/test/Par/GiaIvinsBenchmarksCD.py ¶
r24862 r25129 31 31 md.gia.mantle_viscosity = 1e21 * np.ones((md.mesh.numberofvertices, )) #in Pa.s 32 32 md.gia.lithosphere_thickness = 100 * np.ones((md.mesh.numberofvertices, )) #in km 33 md.materials.lithosphere_shear_modulus = 6.7 * 1e10 #in Pa33 md.materials.lithosphere_shear_modulus = 6.7e10 #in Pa 34 34 md.materials.lithosphere_density = 3.32 #in g / cm^3 35 md.materials.mantle_shear_modulus = 1.45 * 1e11 #in Pa35 md.materials.mantle_shear_modulus = 1.45e11 #in Pa 36 36 md.materials.mantle_density = 3.34 #in g / cm^3 37 37 -
TabularUnified issm/trunk-jpl/test/Par/SquareSheetConstrained.py ¶
r24862 r25129 63 63 #GIA: 64 64 md.gia.lithosphere_thickness = 100. * np.ones((md.mesh.numberofvertices)) # in km 65 md.gia.mantle_viscosity = 1. * 10**21 * np.ones((md.mesh.numberofvertices)) # in Pa.s66 md.materials.lithosphere_shear_modulus = 6.7 * 10**10 # in Pa65 md.gia.mantle_viscosity = 1.e21 * np.ones((md.mesh.numberofvertices)) # in Pa.s 66 md.materials.lithosphere_shear_modulus = 6.7e10 # in Pa 67 67 md.materials.lithosphere_density = 3.32 # in g / cm^ - 3 68 md.materials.mantle_shear_modulus = 1.45 * 10**11 # in Pa68 md.materials.mantle_shear_modulus = 1.45e11 # in Pa 69 69 md.materials.mantle_density = 3.34 # in g / cm^ - 3 70 70
Note:
See TracChangeset
for help on using the changeset viewer.