Changeset 27451
- Timestamp:
- 12/03/22 20:02:23 (2 years ago)
- Location:
- issm/trunk-jpl/src/m/classes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/stressbalance.m
r27031 r27451 115 115 disp(sprintf('\n !!! Warning: no spc applied, model might not be well posed if no basal friction is applied, check for solution crash\n')); 116 116 end 117 %CHECK THAT EACH LINE SCONTAINS ONLY NAN VALUES OR NO NAN VALUES117 %CHECK THAT EACH LINE CONTAINS ONLY NAN VALUES OR NO NAN VALUES 118 118 if any(sum(isnan(md.stressbalance.referential),2)~=0 & sum(isnan(md.stressbalance.referential),2)~=6), 119 119 md = checkmessage(md,['Each line of stressbalance.referential should contain either only NaN values or no NaN values']); -
issm/trunk-jpl/src/m/classes/stressbalance.py
r27031 r27451 154 154 md = checkfield(md, 'fieldname', 'stressbalance.vertex_pairing', '>', 0) 155 155 # Singular solution 156 # if ~any((~isnan(md.stressbalance.spcvx) + ~isnan(md.stressbalance.spcvy)) == 2),157 156 if (not np.any(np.logical_or(np.logical_not(np.isnan(md.stressbalance.spcvx)), np.logical_not(np.isnan(md.stressbalance.spcvy))))) & (not np.any(md.mask.ocean_levelset>0)): 158 print("\n !!! Warning: no spc applied, model might not be well posed if no basal friction is applied, check for solution crash\n") 159 # CHECK THAT EACH LINES CONTAINS ONLY NAN VALUES OR NO NAN VALUES 160 # if any(sum(isnan(md.stressbalance.referential), 2)~=0 & sum(isnan(md.stressbalance.referential), 2)~=6), 157 print('\n !!! Warning: no spc applied, model might not be well posed if no basal friction is applied, check for solution crash\n') 158 # CHECK THAT EACH LINES CONTAIN ONLY NAN VALUES OR NO NAN VALUES 161 159 if np.any(np.logical_and(np.sum(np.isnan(md.stressbalance.referential), axis=1) != 0, np.sum(np.isnan(md.stressbalance.referential), axis=1) != 6)): 162 md.checkmessage( "Each line of stressbalance.referential should contain either only NaN values or no NaN values")160 md.checkmessage('Each line of stressbalance.referential should contain either only NaN values or no NaN values') 163 161 # CHECK THAT THE TWO VECTORS PROVIDED ARE ORTHOGONAL 164 # if any(sum(isnan(md.stressbalance.referential), 2) == 0),165 162 if np.any(np.sum(np.isnan(md.stressbalance.referential), axis=1) == 0): 166 163 pos = [i for i, item in enumerate(np.sum(np.isnan(md.stressbalance.referential), axis=1)) if item == 0] 167 # np.inner (and np.dot) calculate all the dot product permutations, resulting in a full matrix multiply168 # if np.any(np.abs(np.inner(md.stressbalance.referential[pos, 0:2], md.stressbalance.referential[pos, 3:5]).diagonal()) > sys.float_info.epsilon):169 # md.checkmessage("Vectors in stressbalance.referential (columns 1 to 3 and 4 to 6) must be orthogonal")170 164 for item in md.stressbalance.referential[pos, :]: 171 165 if np.abs(np.inner(item[0:2], item[3:5])) > sys.float_info.epsilon: 172 md.checkmessage( "Vectors in stressbalance.referential (columns 1 to 3 and 4 to 6) must be orthogonal")166 md.checkmessage('Vectors in stressbalance.referential (columns 1 to 3 and 4 to 6) must be orthogonal') 173 167 # CHECK THAT NO rotation specified for FS Grounded ice at base 174 168 if m.strcmp(md.mesh.domaintype(), '3D') and md.flowequation.isFS: 175 169 pos = np.nonzero(np.logical_and(md.mask.ocean_levelset, md.mesh.vertexonbase)) 176 170 if np.any(np.logical_not(np.isnan(md.stressbalance.referential[pos, :]))): 177 md.checkmessage( "no referential should be specified for basal vertices of grounded ice")171 md.checkmessage('no referential should be specified for basal vertices of grounded ice') 178 172 if md.flowequation.isMOLHO: 179 173 md = checkfield(md, 'fieldname', 'stressbalance.spcvx_base', 'Inf', 1, 'timeseries', 1)
Note:
See TracChangeset
for help on using the changeset viewer.