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:   }

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

 26:     package Initialize version 0.0.0 {
 27:       // Initialize the anything that is fixed for all solves
 28:       interface Once extends gov.cca.Port {
 29:         void   initializeOnce();
 30:       }

 32:       // Initialize anything that changes with each solve
 33:       interface EverySolve extends gov.cca.Port {
 34:         void   initializeEverySolve();
 35:       }
 36:     }

 38:     package Compute version 0.0.0 {
 39:       interface InitialGuess extends gov.cca.Port {
 40:         void   computeInitialGuess(in array<double> x);
 41:       }

 43:       // For nonlinear problems
 44:       interface Jacobian extends gov.cca.Port {
 45:         void   computeJacobian(in array<double> x ,in TOPS.Matrix J,in TOPS.Matrix B);
 46:       }

 48:       interface Residual extends gov.cca.Port {
 49:         void   computeResidual(in array<double> x,in array<double> f);
 50:       }

 52:       // For linear problems
 53:       interface Matrix extends gov.cca.Port {
 54:         void   computeMatrix(in TOPS.Matrix J,in TOPS.Matrix B);
 55:       }

 57:       interface RightHandSide extends gov.cca.Port {
 58:         void   computeRightHandSide(in array<double> b);
 59:       }
 60:     }
 61:   }


 64:   //  ---------- Interfaces/Classes for system on structured grid
 65:   package Structured version 0.0.0 {

 67:     // Sparse matrix interface for a structured grid problem
 68:     // This is modeled after the Babel/SIDL arrays interface
 69:     // essentially one can think of the sparse matrix as having
 70:     // a variable number of doubles at each grid point (while
 71:     // Babel/SIDL arrays have a fixed number)
 72:     class Matrix implements-all TOPS.Matrix {
 73:       // local ownership of grid
 74:       int    dimen();
 75:       int    lower(in int a);
 76:       int    length(in int a);

 78:       // set a (block) row of nonzeros
 79:       void   set[D1](in int i,in array<double,2> values);
 80:       void   set[D2](in int i,in int j,in array<double,2> values);
 81:       void   set[D3](in int i,in int j,in int k,in array<double,2> values);
 82:       void   set[D4](in int i,in int j,in int k,in int l,in array<double,2> values);
 83:     }

 85:     //   The data lives on a structured grid
 86:     interface Solver extends TOPS.Solver {
 87:       int  dimen();
 88:       int  length(in int a);

 90:       void setDimen(in int dim);
 91:       void setLength(in int a,in int l);
 92:       void setStencilWidth(in int width);
 93:       int  getStencilWidth();
 94:       void setLevels(in int levels);
 95:     }
 96:   }
 97:   class StructuredSolver implements-all TOPS.Structured.Solver, gov.cca.Component, gov.cca.ports.ParameterGetListener, gov.cca.ports.ParameterSetListener {
 98:     gov.cca.Services getServices();
 99:   }

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

103:   package Unstructured version 0.0.0 {

105:     class Matrix implements-all TOPS.Matrix {
106:       void   set[Point](in int row,in int column,in array<double> values);
107:       void   set[Row](in int row,in array<int,1> columns,in array<double> values);
108:       void   set[Column](in array<int,1> rows,in int column,in array<double> values);
109:       void   set(in array<int,1> rows,in array<int,1> columns,in array<double> values);
110:     }

112:     //   The data in the vectors is from an unstructured problem
113:     interface Solver extends TOPS.Solver {
114:       void         setLocalSize(in int m);
115:       int          getLocalSize();

117:       void         setGhostPoints(in array<int,1> ghosts);
118:       array<int,1> getGhostPoints();
119:       void         setPreallocation(in int d,in int od);
120:       void         setPreallocation[s](in array<int,1> d,in array<int,1> od);
121:     }
122:   }
123:   class UnstructuredSolver implements-all TOPS.Unstructured.Solver, gov.cca.Component, gov.cca.ports.ParameterGetListener, gov.cca.ports.ParameterSetListener {
124:     gov.cca.Services getServices();
125:   }



129: }