fei_MatrixGraph.hpp

00001 /*--------------------------------------------------------------------*/
00002 /*    Copyright 2005 Sandia Corporation.                              */
00003 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00004 /*    non-exclusive license for use of this work by or on behalf      */
00005 /*    of the U.S. Government.  Export of this program may require     */
00006 /*    a license from the United States Government.                    */
00007 /*--------------------------------------------------------------------*/
00008 
00009 #ifndef _fei_MatrixGraph_hpp_
00010 #define _fei_MatrixGraph_hpp_
00011 
00012 #include <fei_macros.hpp>
00013 #include <fei_SharedPtr.hpp>
00014 #include <fei_VectorSpace.hpp>
00015 #include <fei_Reducer.hpp>
00016 #include <snl_fei_Constraint.hpp>
00017 #include <fei_Record.hpp>
00018 #include <fei_SparseRowGraph.hpp>
00019 
00020 #include <vector>
00021 
00022 namespace fei {
00023   class ConnectivityBlock;
00024   class Pattern;
00025   class SparseRowGraph;
00027   typedef snl_fei::Constraint<fei::Record<int>*> ConstraintType;
00028 
00033 class MatrixGraph {
00034  public:
00036   class Factory {
00037   public:
00039     virtual ~Factory(){}
00040 
00045     virtual fei::SharedPtr<fei::MatrixGraph>
00046                  createMatrixGraph(fei::SharedPtr<fei::VectorSpace> rowSpace,
00047                                    fei::SharedPtr<fei::VectorSpace> columnSpace,
00048                                    const char* name) = 0;
00049   };
00050 
00051   enum { REDUCED_INDICES   = 0,
00052          UNREDUCED_INDICES = 1,
00053          BLOCK_ENTRY_GRAPH = 2,
00054          POINT_ENTRY_GRAPH = 3};
00055 
00057   virtual ~MatrixGraph(){}
00058 
00066   virtual void setParameters(const fei::ParameterSet& params) = 0;
00067 
00074   virtual void setRowSpace(fei::SharedPtr<fei::VectorSpace> rowSpace) = 0;
00075 
00079   virtual fei::SharedPtr<fei::VectorSpace> getRowSpace() = 0;
00080 
00087   virtual void setColumnSpace(fei::SharedPtr<fei::VectorSpace> columnSpace) = 0;
00088 
00092   virtual fei::SharedPtr<fei::VectorSpace> getColSpace() = 0;
00093 
00115   virtual int definePattern(int numIDs,
00116                      int idType) = 0;
00117 
00140   virtual int definePattern(int numIDs,
00141                     int idType,
00142                     int fieldID) = 0;
00143 
00168    virtual int definePattern(int numIDs,
00169                      int idType,
00170                      const int* numFieldsPerID,
00171                      const int* fieldIDs) = 0;
00172 
00196    virtual int definePattern(int numIDs,
00197                      const int* idTypes,
00198                      const int* numFieldsPerID,
00199                      const int* fieldIDs) = 0;
00200 
00223    virtual int initConnectivityBlock(int blockID,
00224                              int numConnectivityLists,
00225                              int patternID,
00226                              bool diagonal=false) = 0;
00227 
00250    virtual int initConnectivityBlock(int numConnectivityLists,
00251                                      int patternID,
00252                                      bool diagonal=false) = 0;
00253 
00274    virtual int initConnectivityBlock(int blockID,
00275                              int numConnectivityLists,
00276                              int rowPatternID,
00277                              int colPatternID) = 0;
00278 
00291    virtual int initConnectivity(int blockID,
00292                         int connectivityID,
00293                         const int* connectedIdentifiers) = 0;
00294 
00309    virtual int initConnectivity(int blockID,
00310                         int connectivityID,
00311                         const int* rowConnectedIdentifiers,
00312                         const int* colConnectedIdentifiers) = 0;
00313 
00326    virtual int initConnectivity(int patternID,
00327                         const int* connectedIdentifiers) = 0;
00328 
00343    virtual int initConnectivity(int rowPatternID,
00344                         const int* rowConnectedIdentifiers,
00345                         int colPatternID,
00346                         const int* colConnectedIdentifiers) = 0;
00347 
00363    virtual int initConnectivity(int idType,
00364                         int numRows,
00365                         const int* rowIDs,
00366                         const int* rowOffsets,
00367                         const int* packedColumnIDs) = 0;
00368 
00386    virtual int initConnectivity(int idType,
00387                         int fieldID,
00388                         int numRows,
00389                         const int* rowIDs,
00390                         const int* rowOffsets,
00391                         const int* packedColumnIDs) = 0;
00392 
00407    virtual int initConnectivity(int idType,
00408                         int numRows,
00409                         const int* rowIDs,
00410                         const int* rowLengths,
00411                         const int*const* columnIDs) = 0;
00412 
00415    virtual int initLagrangeConstraint(int constraintID,
00416                               int constraintIDType,
00417                               int numIDs,
00418                               const int* idTypes,
00419                               const int* IDs,
00420                               const int* fieldIDs) = 0;
00421 
00424    virtual int initPenaltyConstraint(int constraintID,
00425                              int constraintIDType,
00426                              int numIDs,
00427                              const int* idTypes,
00428                              const int* IDs,
00429                              const int* fieldIDs) = 0;
00430 
00433    virtual int initSlaveConstraint(int numIDs,
00434                            const int* idTypes,
00435                            const int* IDs,
00436                            const int* fieldIDs,
00437                            int offsetOfSlave,
00438                            int offsetIntoSlaveField,
00439                            const double* weights,
00440                            double rhsValue) = 0;
00441 
00442    virtual bool newSlaveData() = 0;
00443 
00446    virtual bool hasSlaveDof(int ID, int idType) = 0;
00447 
00452    virtual int initComplete() = 0;
00453 
00465    virtual fei::SharedPtr<fei::SparseRowGraph>
00466      createGraph(bool blockEntryGraph,
00467                  bool localRowGraph_includeSharedRows=false) = 0;
00468 
00472    virtual int compareStructure(const fei::MatrixGraph& matrixGraph,
00473                         bool& equivalent) const = 0;
00474 
00476    virtual int getNumConnectivityBlocks() const = 0;
00477 
00479    virtual std::map<int,fei::ConnectivityBlock*>& getConnectivityBlocks() = 0;
00481    virtual int getConnectivityBlockIDs(std::vector<int>& blockIDs) const = 0;
00482 
00485    virtual int getNumIDsPerConnectivityList(int blockID) const = 0;
00486 
00490    virtual int getConnectivityNumIndices(int blockID) const = 0;
00491 
00496    virtual int getConnectivityNumIndices(int blockID,
00497                                  int& numRowIndices,
00498                                  int& numColIndices) = 0;
00499 
00502    virtual int getConnectivityIndices(int blockID,
00503                               int connectivityID,
00504                               int indicesAllocLen,
00505                               int* indices,
00506                               int& numIndices) = 0;
00507 
00511    virtual int getConnectivityIndices(int blockID,
00512                               int connectivityID,
00513                               int rowIndicesAllocLen,
00514                               int* rowIndices,
00515                               int& numRowIndices,
00516                               int colIndicesAllocLen,
00517                               int* colIndices,
00518                               int& numColIndices) = 0;
00519 
00522    virtual int getPatternNumIndices(int patternID,
00523                             int& numIndices) = 0;
00524 
00527    virtual int getPatternIndices(int patternID,
00528                          const int* IDs,
00529                          std::vector<int>& indices) = 0;
00530 
00532    virtual int getLocalNumLagrangeConstraints() const = 0;
00533 
00536    virtual int getGlobalNumSlaveConstraints() const = 0;
00537 
00541    virtual ConstraintType* getLagrangeConstraint(int constraintID) = 0;
00542 
00546    virtual std::map<int, ConstraintType* >& getLagrangeConstraints() = 0;
00547 
00551    virtual ConstraintType* getPenaltyConstraint(int constraintID) = 0;
00552 
00556    virtual ConstraintType* getSlaveConstraint(int constraintID) = 0;
00557 
00561    virtual int getConstraintConnectivityIndices(ConstraintType* cr,
00562                                         std::vector<int>& globalIndices) = 0;
00563 
00567    virtual const fei::ConnectivityBlock* getConnectivityBlock(int blockID) const = 0;
00568 
00572    virtual fei::ConnectivityBlock* getConnectivityBlock(int blockID) = 0;
00573 
00575    virtual void setIndicesMode(int mode) = 0;
00576 
00578    virtual fei::SharedPtr<fei::FillableMat> getSlaveDependencyMatrix() = 0;
00579 
00583    virtual fei::Pattern* getPattern(int patternID) = 0;
00584 
00586    virtual int createSlaveMatrices() = 0;
00587 
00591    virtual fei::SharedPtr<fei::Reducer> getReducer() = 0;
00592 
00594    virtual fei::SharedPtr<fei::SparseRowGraph> getRemotelyOwnedGraphRows() = 0;
00595 
00597    virtual void getConstrainedIndices(std::vector<int>& crindices) const = 0;
00598 };//class MatrixGraph
00599 }//namespace fei
00600 
00601 #endif
00602 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends
Generated on Wed Apr 13 10:08:24 2011 for FEI by  doxygen 1.6.3