Actual source code: tops.sidl

  2: package TOPS version 0.0.0 {

  4:   // For passing matrix values from application to solver
  5:   interface Matrix {
  6:       void   apply(in array<double> x,in array<double> y);
  7:       void   zero();
  8:   }

 10:   interface Solver extends gov.cca.Port {

 12:       // Pass in command line arguments to Solver
 13:       void          Initialize(in array<string,1> args);
 14:       void          solve();

 16:       void          setBlockSize(in int bs);

 18:       array<double> getSolution();
 19:       void          setSolution(in array<double> location);

 21:       // Allows setting/accessing solver parameters
 22:       void   setValue(in string key, in string value);
 23:       void   setValue[Int](in string key, in int value);
 24:       void   setValue[Bool](in string key, in bool value);
 25:       void   setValue[Double](in string key, in double value);
 26:       string getValue(in string key);
 27:       int    getValueInt(in string key);
 28:       bool   getValueBool(in string key);
 29:       double getValueDouble(in string key);
 30:   }

 32:   // Interfaces inherited by the user to define the algebraic problem
 33:   package System version 0.0.0 {

 35:     package Initialize version 0.0.0 {
 36:       // Initialize the anything that is fixed for all solves
 37:       interface Once extends gov.cca.Port {
 38:         void   initializeOnce();
 39:       }

 41:       // Initialize anything that changes with each solve
 42:       interface EverySolve extends gov.cca.Port {
 43:         void   initializeEverySolve();
 44:       }
 45:     }

 47:     package Compute version 0.0.0 {
 48:       interface InitialGuess extends gov.cca.Port {
 49:         void   computeInitialGuess(in array<double> x);
 50:       }

 52:       // For nonlinear problems
 53:       interface Jacobian extends gov.cca.Port {
 54:         void   computeJacobian(in array<double> x ,in TOPS.Matrix J,in TOPS.Matrix B);
 55:       }

 57:       interface Residual extends gov.cca.Port {
 58:         void   computeResidual(in array<double> x,in array<double> f);
 59:       }

 61:       // For linear problems
 62:       interface Matrix extends gov.cca.Port {
 63:         void   computeMatrix(in TOPS.Matrix J,in TOPS.Matrix B);
 64:       }

 66:       interface RightHandSide extends gov.cca.Port {
 67:         void   computeRightHandSide(in array<double> b);
 68:       }
 69:     }
 70:   }


 73:   //  ---------- Interfaces/Classes for system on structured grid
 74:   package Structured version 0.0.0 {

 76:     // Sparse matrix interface for a structured grid problem
 77:     // This is modeled after the Babel/SIDL arrays interface
 78:     // essentially one can think of the sparse matrix as having
 79:     // a variable number of doubles at each grid point (while
 80:     // Babel/SIDL arrays have a fixed number)
 81:     class Matrix implements-all TOPS.Matrix {
 82:       // local ownership of grid
 83:       int    dimen();
 84:       int    lower(in int a);
 85:       int    length(in int a);

 87:       // set a (block) row of nonzeros
 88:       void   set[D1](in int i,in array<double,2> values);
 89:       void   set[D2](in int i,in int j,in array<double,2> values);
 90:       void   set[D3](in int i,in int j,in int k,in array<double,2> values);
 91:       void   set[D4](in int i,in int j,in int k,in int l,in array<double,2> values);
 92:     }

 94:     //   The data lives on a structured grid
 95:     interface Solver extends TOPS.Solver {
 96:       int  dimen();
 97:       int  length(in int a);

 99:       void setDimen(in int dim);
100:       void setLength(in int a,in int l);
101:       void setStencilWidth(in int width);
102:       int  getStencilWidth();
103:       void setLevels(in int levels);
104:     }
105:   }
106:   class StructuredSolver implements-all TOPS.Structured.Solver, gov.cca.Component, gov.cca.ports.ParameterGetListener, gov.cca.ports.ParameterSetListener {
107:     gov.cca.Services getServices();
108:   }

110:   //  ---------- Interfaces for system on unstructured grid

112:   package Unstructured version 0.0.0 {

114:     class Matrix implements-all TOPS.Matrix {
115:       void   set[Point](in int row,in int column,in array<double> values);
116:       void   set[Row](in int row,in array<int,1> columns,in array<double> values);
117:       void   set[Column](in array<int,1> rows,in int column,in array<double> values);
118:       void   set(in array<int,1> rows,in array<int,1> columns,in array<double> values);
119:     }

121:     //   The data in the vectors is from an unstructured problem
122:     interface Solver extends TOPS.Solver {
123:       void         setLocalSize(in int m);
124:       int          getLocalSize();

126:       void         setGhostPoints(in array<int,1> ghosts);
127:       array<int,1> getGhostPoints();
128:       void         setPreallocation(in int d,in int od);
129:       void         setPreallocation[s](in array<int,1> d,in array<int,1> od);
130:     }
131:   }
132:   class UnstructuredSolver implements-all TOPS.Unstructured.Solver, gov.cca.Component, gov.cca.ports.ParameterGetListener, gov.cca.ports.ParameterSetListener {
133:     gov.cca.Services getServices();
134:   }



138: }