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 
00248    virtual int initConnectivityBlock(int blockID,
00249                              int numConnectivityLists,
00250                              int rowPatternID,
00251                              int colPatternID) = 0;
00252 
00265    virtual int initConnectivity(int blockID,
00266                         int connectivityID,
00267                         const int* connectedIdentifiers) = 0;
00268 
00283    virtual int initConnectivity(int blockID,
00284                         int connectivityID,
00285                         const int* rowConnectedIdentifiers,
00286                         const int* colConnectedIdentifiers) = 0;
00287 
00300    virtual int initConnectivity(int patternID,
00301                         const int* connectedIdentifiers) = 0;
00302 
00317    virtual int initConnectivity(int rowPatternID,
00318                         const int* rowConnectedIdentifiers,
00319                         int colPatternID,
00320                         const int* colConnectedIdentifiers) = 0;
00321 
00337    virtual int initConnectivity(int idType,
00338                         int numRows,
00339                         const int* rowIDs,
00340                         const int* rowOffsets,
00341                         const int* packedColumnIDs) = 0;
00342 
00360    virtual int initConnectivity(int idType,
00361                         int fieldID,
00362                         int numRows,
00363                         const int* rowIDs,
00364                         const int* rowOffsets,
00365                         const int* packedColumnIDs) = 0;
00366 
00381    virtual int initConnectivity(int idType,
00382                         int numRows,
00383                         const int* rowIDs,
00384                         const int* rowLengths,
00385                         const int*const* columnIDs) = 0;
00386 
00389    virtual int initLagrangeConstraint(int constraintID,
00390                               int constraintIDType,
00391                               int numIDs,
00392                               const int* idTypes,
00393                               const int* IDs,
00394                               const int* fieldIDs) = 0;
00395 
00398    virtual int initPenaltyConstraint(int constraintID,
00399                              int constraintIDType,
00400                              int numIDs,
00401                              const int* idTypes,
00402                              const int* IDs,
00403                              const int* fieldIDs) = 0;
00404 
00407    virtual int initSlaveConstraint(int numIDs,
00408                            const int* idTypes,
00409                            const int* IDs,
00410                            const int* fieldIDs,
00411                            int offsetOfSlave,
00412                            int offsetIntoSlaveField,
00413                            const double* weights,
00414                            double rhsValue) = 0;
00415 
00416    virtual bool newSlaveData() = 0;
00417 
00420    virtual bool hasSlaveDof(int ID, int idType) = 0;
00421 
00426    virtual int initComplete() = 0;
00427 
00439    virtual fei::SharedPtr<fei::SparseRowGraph>
00440      createGraph(bool blockEntryGraph,
00441                  bool localRowGraph_includeSharedRows=false) = 0;
00442 
00446    virtual int compareStructure(const fei::MatrixGraph& matrixGraph,
00447                         bool& equivalent) const = 0;
00448 
00450    virtual int getNumConnectivityBlocks() const = 0;
00451 
00453    virtual std::map<int,fei::ConnectivityBlock*>& getConnectivityBlocks() = 0;
00455    virtual int getConnectivityBlockIDs(std::vector<int>& blockIDs) const = 0;
00456 
00459    virtual int getNumIDsPerConnectivityList(int blockID) const = 0;
00460 
00464    virtual int getConnectivityNumIndices(int blockID) const = 0;
00465 
00470    virtual int getConnectivityNumIndices(int blockID,
00471                                  int& numRowIndices,
00472                                  int& numColIndices) = 0;
00473 
00476    virtual int getConnectivityIndices(int blockID,
00477                               int connectivityID,
00478                               int indicesAllocLen,
00479                               int* indices,
00480                               int& numIndices) = 0;
00481 
00485    virtual int getConnectivityIndices(int blockID,
00486                               int connectivityID,
00487                               int rowIndicesAllocLen,
00488                               int* rowIndices,
00489                               int& numRowIndices,
00490                               int colIndicesAllocLen,
00491                               int* colIndices,
00492                               int& numColIndices) = 0;
00493 
00496    virtual int getPatternNumIndices(int patternID,
00497                             int& numIndices) = 0;
00498 
00501    virtual int getPatternIndices(int patternID,
00502                          const int* IDs,
00503                          std::vector<int>& indices) = 0;
00504 
00506    virtual int getLocalNumLagrangeConstraints() const = 0;
00507 
00510    virtual int getGlobalNumSlaveConstraints() const = 0;
00511 
00515    virtual ConstraintType* getLagrangeConstraint(int constraintID) = 0;
00516 
00520    virtual std::map<int, ConstraintType* >& getLagrangeConstraints() = 0;
00521 
00525    virtual ConstraintType* getPenaltyConstraint(int constraintID) = 0;
00526 
00530    virtual ConstraintType* getSlaveConstraint(int constraintID) = 0;
00531 
00535    virtual int getConstraintConnectivityIndices(ConstraintType* cr,
00536                                         std::vector<int>& globalIndices) = 0;
00537 
00541    virtual const fei::ConnectivityBlock* getConnectivityBlock(int blockID) const = 0;
00542 
00546    virtual fei::ConnectivityBlock* getConnectivityBlock(int blockID) = 0;
00547 
00549    virtual void setIndicesMode(int mode) = 0;
00550 
00552    virtual fei::SharedPtr<fei::FillableMat> getSlaveDependencyMatrix() = 0;
00553 
00557    virtual fei::Pattern* getPattern(int patternID) = 0;
00558 
00560    virtual int createSlaveMatrices() = 0;
00561 
00565    virtual fei::SharedPtr<fei::Reducer> getReducer() = 0;
00566 
00568    virtual fei::SharedPtr<fei::SparseRowGraph> getRemotelyOwnedGraphRows() = 0;
00569 
00571    virtual void getConstrainedIndices(std::vector<int>& crindices) const = 0;
00572 };//class MatrixGraph
00573 }//namespace fei
00574 
00575 #endif
00576 

Generated on Tue Jul 13 09:27:45 2010 for FEI by  doxygen 1.4.7