Changeset 27845
- Timestamp:
- 07/22/23 14:39:45 (20 months ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/jenkins/mac-silicon-solid_earth
r27810 r27845 100 100 # - Excluding 2012 until it can be looked at by Eric ("FindParam error message: Parameter HydrologyModel not set") 101 101 # - Excluding 2091 until it can be debugged (resource starvation) 102 # - Excluding 2110:2113 until we can compile MEX modules natively for Silicon and then can debug differences in mesh generation between different platforms 102 103 # 103 104 MATLAB_NROPTIONS="'benchmark','slc','exclude',[2004 2006 2012 2051 2052 2053 2085 2424 2425]" 104 PYTHON_NROPTIONS="--benchmark slc --exclude 2004 2006 2012 2051 2052 2053 2085 2 424 2425"105 PYTHON_NROPTIONS="--benchmark slc --exclude 2004 2006 2012 2051 2052 2053 2085 2110:2113 2424 2425" -
issm/trunk-jpl/src/c/shared/Exp/exp.h
r24030 r27845 115 115 closed=xNew<bool>(nprof); 116 116 117 /*Re aset file pointer to beginning of file: */117 /*Reset file pointer to beginning of file: */ 118 118 fseek(fid,0,SEEK_SET); 119 119 -
issm/trunk-jpl/src/m/classes/mesh2d.m
r24884 r27845 76 76 function self = setdefaultparameters(self) % {{{ 77 77 78 % the connectivity is the averaged number of nodes linked to a79 % given node through an edge. This connectivity is used to initially80 % allocate memory to the stiffness matrix. A value of 16 seems to81 % give a good memory/time ration. This value can be checked in82 %t runk/test/Miscellaneous/runme.m78 %The connectivity is the average number of nodes linked to a given 79 %node through an edge. This connectivity is used to initially allocate 80 %memory to the stiffness matrix. A value of 16 seems to give a good 81 %memory/time ratio. This value can be checked in 82 %test/Miscellaneous/runme.m 83 83 self.average_vertex_connectivity=25; 84 84 end % }}} -
issm/trunk-jpl/src/m/classes/mesh2d.py
r27458 r27845 1 1 import numpy as np 2 from checkfield import checkfield 2 3 from fielddisplay import fielddisplay 3 from checkfield import checkfield4 4 import MatlabFuncs as m 5 5 from WriteData import WriteData … … 7 7 8 8 class mesh2d(object): 9 """ 10 MESH2D class definition 9 """mesh2d class definition 11 10 12 13 11 Usage: 12 mesh2d = mesh2d() 14 13 """ 15 14 16 15 def __init__(self): # {{{ 17 self.x = float('NaN')18 self.y = float('NaN')19 self.elements = float('NaN')16 self.x = np.nan 17 self.y = np.nan 18 self.elements = np.nan 20 19 self.numberofelements = 0 21 20 self.numberofvertices = 0 22 21 self.numberofedges = 0 23 22 24 self.lat = float('NaN')25 self.long = float('NaN')23 self.lat = np.nan 24 self.long = np.nan 26 25 self.epsg = 0 27 self.scale_factor = float('NaN')26 self.scale_factor = np.nan 28 27 29 self.vertexonboundary = float('NaN')30 self.edges = float('NaN')31 self.segments = float('NaN')32 self.segmentmarkers = float('NaN')33 self.vertexconnectivity = float('NaN')34 self.elementconnectivity = float('NaN')28 self.vertexonboundary = np.nan 29 self.edges = np.nan 30 self.segments = np.nan 31 self.segmentmarkers = np.nan 32 self.vertexconnectivity = np.nan 33 self.elementconnectivity = np.nan 35 34 self.average_vertex_connectivity = 0 36 35 37 self.extractedvertices = float('NaN')38 self.extractedelements = float('NaN')36 self.extractedvertices = np.nan 37 self.extractedelements = np.nan 39 38 40 #set defaults39 # Set defaults 41 40 self.setdefaultparameters() 42 41 … … 44 43 45 44 def __repr__(self): # {{{ 46 s tring = " 2D tria Mesh (horizontal):"45 s = ' 2D tria Mesh (horizontal):\n' 47 46 48 string = "%s\n%s" % (string, "\n Elements and vertices:") 49 string = "%s\n%s" % (string, fielddisplay(self, "numberofelements", "number of elements")) 50 string = "%s\n%s" % (string, fielddisplay(self, "numberofvertices", "number of vertices")) 51 string = "%s\n%s" % (string, fielddisplay(self, "elements", "vertex indices of the mesh elements")) 52 string = "%s\n%s" % (string, fielddisplay(self, "x", "vertices x coordinate [m]")) 53 string = "%s\n%s" % (string, fielddisplay(self, "y", "vertices y coordinate [m]")) 54 string = "%s\n%s" % (string, fielddisplay(self, "edges", "edges of the 2d mesh (vertex1 vertex2 element1 element2)")) 55 string = "%s\n%s" % (string, fielddisplay(self, "numberofedges", "number of edges of the 2d mesh")) 47 s += '{}\n'.format(' Elements and vertices:') 48 s += '{}\n'.format(fielddisplay(self, 'numberofelements', 'number of elements')) 49 s += '{}\n'.format(fielddisplay(self, 'numberofvertices', 'number of vertices')) 50 s += '{}\n'.format(fielddisplay(self, 'elements', 'vertex indices of the mesh elements')) 51 s += '{}\n'.format(fielddisplay(self, 'x', 'vertices x coordinate [m]')) 52 s += '{}\n'.format(fielddisplay(self, 'y', 'vertices y coordinate [m]')) 53 s += '{}\n'.format(fielddisplay(self, 'edges', 'edges of the 2d mesh (vertex1 vertex2 element1 element2)')) 54 s += '{}\n'.format(fielddisplay(self, 'numberofedges', 'number of edges of the 2d mesh')) 55 s += '\n' 56 s += '{}\n'.format(' Properties:') 57 s += '{}\n'.format(fielddisplay(self, 'vertexonboundary', 'vertices on the boundary of the domain flag list')) 58 s += '{}\n'.format(fielddisplay(self, 'segments', 'edges on domain boundary (vertex1 vertex2 element)')) 59 s += '{}\n'.format(fielddisplay(self, 'segmentmarkers', 'number associated to each segment')) 60 s += '{}\n'.format(fielddisplay(self, 'vertexconnectivity', 'list of elements connected to vertex_i')) 61 s += '{}\n'.format(fielddisplay(self, 'elementconnectivity', 'list of elements adjacent to element_i')) 62 s += '{}\n'.format(fielddisplay(self, 'average_vertex_connectivity', 'average number of vertices connected to one vertex')) 63 s += '\n' 64 s += '{}\n'.format(' Extracted model:') 65 s += '{}\n'.format(fielddisplay(self, 'extractedvertices', 'vertices extracted from the model')) 66 s += '{}\n'.format(fielddisplay(self, 'extractedelements', 'elements extracted from the model')) 67 s += '\n' 68 s += '{}\n'.format(' Projection:') 69 s += '{}\n'.format(fielddisplay(self, 'lat', 'vertices latitude [degrees]')) 70 s += '{}\n'.format(fielddisplay(self, 'long', 'vertices longitude [degrees]')) 71 s += '{}\n'.format(fielddisplay(self, 'epsg', 'EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)')) 72 s += '{}\n'.format(fielddisplay(self, 'scale_factor', 'Projection correction for volume, area, etc. computation')) 56 73 57 string = "%s%s" % (string, "\n\n Properties:") 58 string = "%s\n%s" % (string, fielddisplay(self, "vertexonboundary", "vertices on the boundary of the domain flag list")) 59 string = "%s\n%s" % (string, fielddisplay(self, "segments", "edges on domain boundary (vertex1 vertex2 element)")) 60 string = "%s\n%s" % (string, fielddisplay(self, "segmentmarkers", "number associated to each segment")) 61 string = "%s\n%s" % (string, fielddisplay(self, "vertexconnectivity", "list of elements connected to vertex_i")) 62 string = "%s\n%s" % (string, fielddisplay(self, "elementconnectivity", "list of elements adjacent to element_i")) 63 string = "%s\n%s" % (string, fielddisplay(self, "average_vertex_connectivity", "average number of vertices connected to one vertex")) 64 65 string = "%s%s" % (string, "\n\n Extracted model:") 66 string = "%s\n%s" % (string, fielddisplay(self, "extractedvertices", "vertices extracted from the model")) 67 string = "%s\n%s" % (string, fielddisplay(self, "extractedelements", "elements extracted from the model")) 68 69 string = "%s%s" % (string, "\n\n Projection:") 70 string = "%s\n%s" % (string, fielddisplay(self, "lat", "vertices latitude [degrees]")) 71 string = "%s\n%s" % (string, fielddisplay(self, "long", "vertices longitude [degrees]")) 72 string = "%s\n%s" % (string, fielddisplay(self, "epsg", "EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)")) 73 string = "%s\n%s" % (string, fielddisplay(self, "scale_factor", "Projection correction for volume, area, etc. computation")) 74 return string 74 return s 75 75 # }}} 76 76 77 77 def setdefaultparameters(self): # {{{ 78 # the connectivity is the averaged number of nodes linked to a79 # given node through an edge. This connectivity is used to initially80 # allocate memory to the stiffness matrix. A value of 16 seems to81 # give a good memory / time ration. This value can be checked in82 # trunk / test / Miscellaneous /runme.m78 # The connectivity is the average number of nodes linked to a given 79 # node through an edge. This connectivity is used to initially allocate 80 # memory to the stiffness matrix. A value of 16 seems to give a good 81 # memory/time ratio. This value can be checked in 82 # test/Miscellaneous/runme.m 83 83 self.average_vertex_connectivity = 25 84 84 … … 95 95 md = checkfield(md, 'fieldname', 'mesh.elements', 'size', [md.mesh.numberofelements, 3]) 96 96 if np.any(np.logical_not(m.ismember(np.arange(1, md.mesh.numberofvertices + 1), md.mesh.elements))): 97 md.checkmessage( "orphan nodes have been found. Check the mesh outline")97 md.checkmessage('orphan nodes have been found. Check the mesh outline') 98 98 md = checkfield(md, 'fieldname', 'mesh.numberofelements', '>', 0) 99 99 md = checkfield(md, 'fieldname', 'mesh.numberofvertices', '>', 0) 100 md = checkfield(md, 'fieldname', 'mesh.average_vertex_connectivity', '>=', 9, 'message', "'mesh.average_vertex_connectivity' should be at least 9 in 2d")100 md = checkfield(md, 'fieldname', 'mesh.average_vertex_connectivity', '>=', 9, 'message', '\'mesh.average_vertex_connectivity\' should be at least 9 in 2d') 101 101 md = checkfield(md, 'fieldname', 'mesh.segments', 'NaN', 1, 'Inf', 1, '>', 0, 'size', [np.nan, 3]) 102 102 if(np.size(self.scale_factor) > 1): … … 104 104 105 105 if solution == 'ThermalSolution': 106 md.checkmessage( "thermal not supported for 2d mesh")106 md.checkmessage('thermal not supported for 2d mesh') 107 107 108 108 return md … … 110 110 111 111 def domaintype(self): # {{{ 112 return "2Dhorizontal"112 return '2Dhorizontal' 113 113 # }}} 114 114 … … 118 118 119 119 def elementtype(self): # {{{ 120 return "Tria"120 return 'Tria' 121 121 # }}} 122 122 123 123 def marshall(self, prefix, md, fid): # {{{ 124 WriteData(fid, prefix, 'name', 'md.mesh.domain_type', 'data', "Domain"+ self.domaintype(), 'format', 'String')124 WriteData(fid, prefix, 'name', 'md.mesh.domain_type', 'data', 'Domain' + self.domaintype(), 'format', 'String') 125 125 WriteData(fid, prefix, 'name', 'md.mesh.domain_dimension', 'data', self.dimension(), 'format', 'Integer') 126 126 WriteData(fid, prefix, 'name', 'md.mesh.elementtype', 'data', self.elementtype(), 'format', 'String') -
issm/trunk-jpl/src/m/mesh/roundmesh.m
r27843 r27845 2 2 %ROUNDMESH - create an unstructured round mesh 3 3 % 4 % This script will generate a 4 % This script will generate an unstructured round mesh 5 5 % - radius : specifies the radius of the circle in meters 6 6 % - resolution : specifies the resolution in meters -
issm/trunk-jpl/src/m/mesh/roundmesh.py
r27843 r27845 10 10 """roundmesh - create an unstructured round mesh 11 11 12 This script will generate a 12 This script will generate an unstructured round mesh 13 13 - radius : specifies the radius of the circle in meters 14 14 - resolution : specifies the resolution in meters -
issm/trunk-jpl/src/m/mesh/triangle.py
r27799 r27845 12 12 """triangle - create model mesh using the triangle package 13 13 14 This routine creates a model mesh using Triangle and a domain outline, to within a certain resolution15 w here md is a @model object, domainname is the name of an Argus domain outline file,16 and resolution is a characteristic length for the mesh (same unit as the domain outline17 unit). Riftname is an optional argument (Argus domain outline) describing rifts.14 This routine creates a model mesh using Triangle and a domain outline, to 15 within a certain resolution where md is a @model object, domainname is the 16 name of an Argus domain outline file, and resolution is a characteristic 17 length for the mesh (same unit as the domain outline unit). Riftname is an optional argument (Argus domain outline) describing rifts. 18 18 19 19 Usage: … … 27 27 """ 28 28 29 # Figure out a characteristic area. Resolution is a node oriented concept (ex a 1000m resolution node would30 # be made of 1000 * 1000 area squares).29 # Figure out a characteristic area. Resolution is a node oriented concept 30 # (ex a 1000m resolution node would be made of 1000 * 1000 area squares). 31 31 32 32 if len(args) == 1: … … 37 37 resolution = args[1] 38 38 39 # Check that mesh was not already run, and warn user :39 # Check that mesh was not already run, and warn user 40 40 if md.mesh.numberofelements: 41 41 choice = input('This model already has a mesh. Are you sure you want to go ahead? (y / n)') … … 49 49 area = resolution ** 2 50 50 51 # Check that file exist (this is a veryvery common mistake)51 # Check that file exists (this is a very common mistake) 52 52 if not os.path.exists(domainname): 53 53 raise IOError('file {} not found'.format(domainname)) … … 86 86 md.mesh.segmentmarkers = segmentmarkers.astype(int) 87 87 88 # Fill in rest of fields :88 # Fill in rest of fields 89 89 md.mesh.numberofelements = np.size(md.mesh.elements, axis=0) 90 90 md.mesh.numberofvertices = np.size(md.mesh.x) … … 92 92 md.mesh.vertexonboundary[md.mesh.segments[:, 0:2] - 1] = 1 93 93 94 # Now, build the connectivity tables for this mesh .94 # Now, build the connectivity tables for this mesh 95 95 md.mesh.vertexconnectivity = NodeConnectivity(md.mesh.elements, md.mesh.numberofvertices) 96 96 md.mesh.elementconnectivity = ElementConnectivity(md.mesh.elements, md.mesh.vertexconnectivity)
Note:
See TracChangeset
for help on using the changeset viewer.