Changeset 20809


Ignore:
Timestamp:
06/24/16 16:21:44 (9 years ago)
Author:
ayfeng
Message:

CHG: Add find,fill functions for 2D matrices to common helper lib
CHG: Implement extrude for thermal module
FIX: Invalid reference to md in stressbalance

Location:
issm/trunk-jpl/jenkins/javascript/karma/lib/bin
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/jenkins/javascript/karma/lib/bin/matlabfunc.js

    r20800 r20809  
    1818    return matrix.length * (matrix.constructor === Array ? matrix[0].length : 1);
    1919}
     20
     21function ArrayFill2D(arr, value) {
     22    for (var i = 0; i < newarr.length; ++i) {
     23        for (var j = 0; j < newarr[0].length; ++j) {
     24            arr[i][j] = value;
     25        }
     26    }
     27    return arr;
     28}
     29
     30function ArrayFindNot2D(array, value) {
     31    var indices = [];
     32
     33    for (var i = 0; i < array.length; ++i) {
     34        for (var j = 0; j < array[0].length; ++j) {
     35            if (array[i][j] !== value) {
     36                indices.push(array[i][j]);
     37            }
     38        }
     39    }
     40
     41    return indices;
     42}
  • issm/trunk-jpl/jenkins/javascript/karma/lib/bin/stressbalance.js

    r20808 r20809  
    7676                return "stressbalance";
    7777        }// }}}
    78     this.extrude = function() {//{{{
     78    this.extrude = function(md) {//{{{
    7979        this.spcvx=project3d(md,'vector',this.spcvx,'type','node');
    8080        this.spcvy=project3d(md,'vector',this.spcvy,'type','node');
Note: See TracChangeset for help on using the changeset viewer.