FEI Version of the Day
fei_LinearSystemCore.hpp
00001 #ifndef _fei_LinearSystemCore_hpp_
00002 #define _fei_LinearSystemCore_hpp_
00003 
00004 class Data;
00005 class Lookup;
00006 
00007 #include <fei_defs.h>
00008 #include <cstdlib>
00009 
00124 class LinearSystemCore {
00125  public:
00129    LinearSystemCore(){};
00130 
00137    virtual ~LinearSystemCore() {};
00138 
00139 
00142    virtual LinearSystemCore* clone() = 0;
00143 
00144 
00151    virtual int parameters(int numParams, const char*const * params) = 0;
00152 
00153 
00160    virtual int setLookup(Lookup& lookup) = 0;
00161 
00162 
00171    virtual int getProperty(const char* /*name*/, double& /*value*/)
00172      {
00173        return(-1);
00174      }
00175 
00193    virtual int setGlobalOffsets(int len, int* nodeOffsets,
00194                                  int* eqnOffsets, int* blkEqnOffsets) = 0;
00195 
00196 
00207    virtual int setConnectivities(GlobalID elemBlock,
00208                                   int numElements,
00209                                   int numNodesPerElem,
00210                                   const GlobalID* elemIDs,
00211                                   const int* const* connNodes) = 0;
00212 
00213 
00227    virtual int setStiffnessMatrices(GlobalID elemBlock,
00228                                      int numElems,
00229                                      const GlobalID* elemIDs,
00230                                      const double *const *const *stiff,
00231                                      int numEqnsPerElem,
00232                                      const int *const * eqnIndices) = 0;
00233 
00234 
00247    virtual int setLoadVectors(GlobalID elemBlock,
00248                                int numElems,
00249                                const GlobalID* elemIDs,
00250                                const double *const * load,
00251                                int numEqnsPerElem,
00252                                const int *const * eqnIndices) = 0;
00253 
00254 
00272    virtual int setMatrixStructure(int** ptColIndices,
00273                                    int* ptRrowLengths,
00274                                    int** blkColIndices,
00275                                    int* blkRowLengths,
00276                                    int* ptRowsPerBlkRow) = 0;
00277 
00278 
00299    virtual int setMultCREqns(int multCRSetID,
00300                               int numCRs, int numNodesPerCR,
00301                               int** nodeNumbers, int** eqnNumbers,
00302                               int* fieldIDs,
00303                               int* multiplierEqnNumbers) = 0;
00304 
00310    virtual int setPenCREqns(int penCRSetID,
00311                               int numCRs, int numNodesPerCR,
00312                               int** nodeNumbers, int** eqnNumbers,
00313                               int* fieldIDs) = 0;
00314 
00315 
00320    virtual int sumIntoSystemMatrix(int numPtRows, const int* ptRows,
00321                                     int numPtCols, const int* ptCols,
00322                                     int numBlkRows, const int* blkRows,
00323                                     int numBlkCols, const int* blkCols,
00324                                     const double* const* values) = 0;
00325 
00332    virtual int sumIntoSystemMatrix(int numPtRows, const int* ptRows,
00333                                     int numPtCols, const int* ptCols,
00334                                     const double* const* values) = 0;
00335 
00340    virtual int putIntoSystemMatrix(int numPtRows, const int* ptRows,
00341                                     int numPtCols, const int* ptCols,
00342                                     const double* const* values) = 0;
00343 
00349    virtual int getMatrixRowLength(int row, int& length) = 0;
00350 
00362    virtual int getMatrixRow(int row, double* coefs, int* indices,
00363                             int len, int& rowLength) = 0;
00364 
00367    virtual int sumIntoRHSVector(int num, const double* values,
00368                                  const int* indices) = 0;
00370    virtual int putIntoRHSVector(int num, const double* values,
00371                                  const int* indices) = 0;
00373    virtual int getFromRHSVector(int num, double* values,
00374                                  const int* indices) = 0;
00375 
00379    virtual int matrixLoadComplete() = 0;
00380 
00392    virtual int putNodalFieldData(int fieldID, int fieldSize,
00393                                   int* nodeNumbers, int numNodes,
00394                                   const double* data) = 0;
00395 
00396 
00400    virtual int resetMatrixAndVector(double s) = 0;
00401 
00404    virtual int resetMatrix(double s) = 0;
00405 
00408    virtual int resetRHSVector(double s) = 0;
00409 
00426    virtual int enforceEssentialBC(int* globalEqn, double* alpha,
00427                                    double* gamma, int len) = 0;
00428 
00448    virtual int enforceRemoteEssBCs(int numEqns, int* globalEqns,
00449                                           int** colIndices, int* colIndLen,
00450                                           double** coefs) = 0;
00451 
00456    virtual int getMatrixPtr(Data& data) = 0;
00457 
00463    virtual int copyInMatrix(double scalar, const Data& data) = 0;
00464 
00473    virtual int copyOutMatrix(double scalar, Data& data) = 0;
00474 
00480    virtual int sumInMatrix(double scalar, const Data& data) = 0;
00481 
00483    virtual int getRHSVectorPtr(Data& data) = 0;
00484 
00486    virtual int copyInRHSVector(double scalar, const Data& data) = 0;
00487 
00489    virtual int copyOutRHSVector(double scalar, Data& data) = 0;
00490 
00492    virtual int sumInRHSVector(double scalar, const Data& data) = 0;
00493 
00500    virtual int destroyMatrixData(Data& data) = 0;
00501 
00508    virtual int destroyVectorData(Data& data) = 0;
00509 
00522    virtual int setNumRHSVectors(int numRHSs, const int* rhsIDs) = 0;
00523 
00530    virtual int setRHSID(int rhsID) = 0;
00531 
00540    virtual int putInitialGuess(const int* eqnNumbers, const double* values,
00541                                 int len) = 0;
00542 
00551    virtual int getSolution(double* answers, int len) = 0;
00552 
00558    virtual int getSolnEntry(int eqnNumber, double& answer) = 0;
00559 
00566    virtual int formResidual(double* values, int len) = 0;
00567 
00577    virtual int launchSolver(int& solveStatus, int& iterations) = 0;
00578 
00586    virtual int writeSystem(const char* name) = 0;
00587 
00588    virtual double* getMatrixBeginPointer()
00589    { return NULL; }
00590 
00591    virtual int getMatrixOffset(int /*row*/, int /*col*/)
00592    { return -1; }
00593 
00594 };
00595 
00596 #endif
00597 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends