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();
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: interface Matrix extends TOPS.Matrix, gov.cca.Port {
73: // local ownership of grid
74: int getDimen();
75: int getLower(in int dimen);
76: int getLength(in int dimen);
77:
78: // set various matrix characteristics
79: void setDimen(in int dim);
80: void setLower(in array<int,3> values);
81: void setLength(in array<int,3> values);
82: void setGhostLower(in array<int,3> values);
83: void setGhostLength(in array<int,3> values);
84: void setMat(in opaque m);
85:
86: // set a (block) row of nonzeros
87: void set[D1](in int i,in array<double,2> values);
88: void set[D2](in int i,in int j,in array<double,2> values);
89: void set[D3](in int i,in int j,in int k,in array<double,2> values);
90: void set[D4](in int i,in int j,in int k,in int l,in array<double,2> values);
91: }
92:
93: // The data lives on a structured grid
94: interface Solver extends TOPS.Solver {
95: int dimen();
96: int length(in int a);
98: void setDimen(in int dim);
99: void setLength(in int a,in int l);
100: void setStencilWidth(in int width);
101: int getStencilWidth();
102: void setLevels(in int levels);
103: }
104: }
106: class StructuredMatrix implements-all TOPS.Structured.Matrix, gov.cca.Component {}
107: class StructuredSolver implements-all TOPS.Structured.Solver,
108: gov.cca.Component,
109: gov.cca.ports.ParameterGetListener,
110: gov.cca.ports.ParameterSetListener {
111: gov.cca.Services getServices();
112: }
114: // ---------- Interfaces for system on unstructured grid
116: package Unstructured version 0.0.0 {
118: class Matrix implements-all TOPS.Matrix {
119: void set[Point](in int row,in int column,in array<double> values);
120: void set[Row](in int row,in array<int,1> columns,in array<double> values);
121: void set[Column](in array<int,1> rows,in int column,in array<double> values);
122: void set(in array<int,1> rows,in array<int,1> columns,in array<double> values);
123: }
125: // The data in the vectors is from an unstructured problem
126: interface Solver extends TOPS.Solver {
127: void setLocalSize(in int m);
128: int getLocalSize();
130: void setGhostPoints(in array<int,1> ghosts);
131: array<int,1> getGhostPoints();
132: void setPreallocation(in int d,in int od);
133: void setPreallocation[s](in array<int,1> d,in array<int,1> od);
134: }
135: }
136: class UnstructuredSolver implements-all TOPS.Unstructured.Solver,
137: gov.cca.Component,
138: gov.cca.ports.ParameterGetListener,
139: gov.cca.ports.ParameterSetListener {
140: gov.cca.Services getServices();
141: }
145: }