Changeset 20778


Ignore:
Timestamp:
06/20/16 12:31:52 (9 years ago)
Author:
ayfeng
Message:

Add spec to allow for dynamically loading test scripts

Location:
issm/trunk-jpl/jenkins/javascript/karma/scripts/specs
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/jenkins/javascript/karma/scripts/specs/1.spec.js

    r20767 r20778  
    1 //describe("test101", function() {
    2     //it("contains test101", function() {
    3         //console.log('creating model');
     1describe("test101", function() {
     2    it("contains test101", function() {
     3    //Test Name: SquareShelfConstrainedEnthalpyTran
     4    function zeros(...args) {
     5        var array = [];
     6        for (var i = 0; i < args[0]; ++i) {
     7            array.push(args.length == 1 ? 0 : zeros(args.slice(1)));
     8        }
     9        return array;
     10    }
     11    var md = new model();
     12    triangle(md,square[0],180000.);
     13    setmask(md,'all','');
     14    parameterize(md);
     15    md.extrude(md,3,1.);
     16    setflowequation(md,'SSA','all');
     17    //md.cluster=generic('name',oshostname(),'np',3);
     18    md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
     19    md.initialization.watercolumn=zeros(md.mesh.numberofvertices,1);
     20    md.transient.isstressbalance=0;
     21    md.transient.ismasstransport=0;
     22    md.transient.issmb=1;
     23    md.transient.isthermal=1;
     24    md.transient.isgroundingline=0;
     25    md.thermal.isenthalpy=1;
     26    md.thermal.isdynamicbasalspc=1;
     27    md=solve(md,TransientSolutionEnum());
     28
     29    //Fields and tolerances to track changes
     30    field_names     =['Enthalpy1','Waterfraction1','Temperature1',
     31        'Enthalpy2','Waterfraction2','Temperature2',
     32        'Enthalpy3','Waterfraction3','Temperature3'];
     33    field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-9,1e-13];
     34    field_values=[
     35        (md.results.TransientSolution[0](1).Enthalpy),
     36        (md.results.TransientSolution[0](1).Waterfraction),
     37        (md.results.TransientSolution[0](1).Temperature),
     38        (md.results.TransientSolution[0](2).Enthalpy),
     39        (md.results.TransientSolution[0](2).Waterfraction),
     40        (md.results.TransientSolution[0](2).Temperature),
     41        (md.results.TransientSolution[0](3).Enthalpy),
     42        (md.results.TransientSolution[0](3).Waterfraction),
     43        (md.results.TransientSolution[0](3).Temperature),
     44        ];
     45    });
     46})
     47
     48//describe("test102", function() {
     49    //it("contains test102", function() {
     50        ////Test Name: SquareShelfConstrainedStressSSA3d
    451        //var md = new model();
     52        //triangle(md,square[0],180000.);
     53        //setmask(md,'all','');
     54        //parameterize(md);
     55        //md.extrude(md,3,2.);
     56        //setflowequation(md,'SSA','all');
     57        ////md.cluster=generic('name',oshostname(),'np',3);
     58        //md=solve(md,StressbalanceSolutionEnum());
    559
    6         //console.log('meshing');
    7         //triangle(md,square[0],40000);
     60        ////Fields and tolerances to track changes
     61        //field_names     =['Vx','Vy','Vz','Vel','Pressure'];
     62        //field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13];
     63        //field_values=[
     64            //(md.results.StressbalanceSolution[0].Vx),
     65            //(md.results.StressbalanceSolution[0].Vy),
     66            //(md.results.StressbalanceSolution[0].Vz),
     67            //(md.results.StressbalanceSolution[0].Vel),
     68            //(md.results.StressbalanceSolution[0].Pressure),
     69            //];
     70    //});
     71//})
    872
    9         //console.log('parameterization');
     73//describe("test103", function() {
     74    //it("contains test103", function() {
     75        ////Test Name: SquareShelfConstrainedBedSlop2d
     76        //var md = new model();
     77        //triangle(md,square[0],150000.);
    1078        //setmask(md,'all','');
    1179        //parameterize(md);
    1280        //setflowequation(md,'SSA','all');
    13         //md.verbose.solution=2;  md.verbose.convergence=0;
     81        ////md.cluster=generic('name',oshostname(),'np',3);
     82        //md=solve(md,BedSlopeSolutionEnum());
    1483
    15         //md=solve(md,StressbalanceSolutionEnum(),'checkconsistency','no');
    16 
    17         //console.log(md.results['StressbalanceSolution'][0]['Vel']);
     84        ////Fields and tolerances to track changes
     85        //field_names     =['BedSlopeX','BedSlopeY'];
     86        //field_tolerances=[1e-13,1e-13];
     87        //field_values=[
     88            //(md.results.BedSlopeSolution[0].BedSlopeX),
     89            //(md.results.BedSlopeSolution[0].BedSlopeY),
     90            //];
    1891    //});
    1992//})
     
    42115            //];
    43116    //});
    44 //})
    45 
    46 describe("test103", function() {
    47     it("contains test103", function() {
    48         //Test Name: SquareShelfConstrainedBedSlop2d
    49         var md = new model();
    50         triangle(md,square[0],150000.);
    51         setmask(md,'all','');
    52         parameterize(md);
    53         setflowequation(md,'SSA','all');
    54         //md.cluster=generic('name',oshostname(),'np',3);
    55         md=solve(md,BedSlopeSolutionEnum());
    56 
    57         //Fields and tolerances to track changes
    58         field_names     =['BedSlopeX','BedSlopeY'];
    59         field_tolerances=[1e-13,1e-13];
    60         field_values=[
    61             (md.results.BedSlopeSolution[0].BedSlopeX),
    62             (md.results.BedSlopeSolution[0].BedSlopeY),
    63             ];
    64     });
    65 })
    66 
    67 describe("test102", function() {
    68     it("contains test102", function() {
    69         //Test Name: SquareShelfConstrainedStressSSA3d
    70         var md = new model();
    71         triangle(md,square[0],180000.);
    72         setmask(md,'all','');
    73         parameterize(md);
    74         md.extrude(md,3,2.);
    75         setflowequation(md,'SSA','all');
    76         //md.cluster=generic('name',oshostname(),'np',3);
    77         md=solve(md,StressbalanceSolutionEnum());
    78 
    79         //Fields and tolerances to track changes
    80         field_names     =['Vx','Vy','Vz','Vel','Pressure'];
    81         field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13];
    82         field_values=[
    83             (md.results.StressbalanceSolution[0].Vx),
    84             (md.results.StressbalanceSolution[0].Vy),
    85             (md.results.StressbalanceSolution[0].Vz),
    86             (md.results.StressbalanceSolution[0].Vel),
    87             (md.results.StressbalanceSolution[0].Pressure),
    88             ];
    89     });
    90 });
     117//});
Note: See TracChangeset for help on using the changeset viewer.