xref: /petsc/share/petsc/saws/js/main.js (revision 3aa2d9e3a17455108487be9a174c0f069d9014ad)
1//this data structure is used to hold all of the solver options and matrix properties (perhaps should use two separate ones?)
2var matInfo = {};
3
4//some global boolean variables to keep track of what the user wants to display
5var displayCmdOptions = true;
6var displayTree       = true;
7var displayMatrix     = true;
8//var displayDiagram    = true;
9
10//holds the cmd options to copy to the clipboard
11var clipboardText     = "";
12
13//holds the colors used in the diagram drawing
14var colors = ["black","red","blue","green"];
15
16//  This function is run when the page is first visited
17$(document).ready(function(){
18
19    matInfo["0"] = { //all false by default
20        logstruc: false,
21        symm: false,
22        posdef: false,
23    };
24
25    //to start, append the first div (div0) in the table and the first pc/ksp options dropdown
26    $("#results").append("<div id=\"leftPanel\" style=\"background-color:lightblue;float:left;\"> </div> <div id=\"rightPanel\" style=\"float:left;padding-left:30px;\"></div>");
27    $("#leftPanel").append("<div id=\"solver0\"> </div><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>");
28
29    $("#solver0").append("<b>Root Solver Options (Matrix is <input type=\"checkbox\" id=\"symm0\">symmetric, <input type=\"checkbox\" id=\"posdef0\">positive definite, <input type=\"checkbox\" id=\"logstruc0\">block structured)</b>");//text: Solver Level: 0
30    $("#solver0").append("<br><b>KSP &nbsp;</b><select id=\"ksp_type0\"></select>");
31    $("#solver0").append("<br><b>PC &nbsp;&nbsp;&nbsp;</b><select id=\"pc_type0\"></select>");
32
33    populateList("pc","0");
34    populateList("ksp","0");
35
36    $("#pc_type0").trigger("change");//display options for sub-solvers (if any)
37    $("#ksp_type0").trigger("change");//just to record ksp (see listLogic.js)
38    $("#symm0").trigger("change");//blur out posdef. will also set the default root pc/ksp for the first time (see events.js)
39
40    /* $(function() { //needed for jqueryUI tool tip to override native javascript tooltip
41        $(document).tooltip();
42    });*/
43
44    $("#displayCmdOptions").attr("checked",true);
45    $("#displayTree").attr("checked",true);
46    $("#displayMatrix").attr("checked",true);
47    //$("#displayDiagram").attr("checked",true);
48
49});
50