FEI Version of the Day
snl_fei_LinearSystem_General.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 _snl_fei_LinearSystem_General_hpp_
00010 #define _snl_fei_LinearSystem_General_hpp_
00011 
00012 #include <fei_macros.hpp>
00013 #include <fei_mpi.h>
00014 #include <fei_CSVec.hpp>
00015 #include <fei_LinearSystem.hpp>
00016 #include <fei_Matrix.hpp>
00017 #include <fei_Vector.hpp>
00018 #include <fei_fwd.hpp>
00019 #include <fei_Logger.hpp>
00020 
00021 namespace fei {
00022   class DirichletBCManager;
00023 }
00024 
00025 namespace snl_fei {
00027   class LinearSystem_General : public fei::LinearSystem,
00028                                private fei::Logger {
00029   public:
00031     LinearSystem_General(fei::SharedPtr<fei::MatrixGraph>& matrixGraph);
00032 
00034     virtual ~LinearSystem_General();
00035 
00038     int loadEssentialBCs(int numIDs,
00039                          const int* IDs,
00040                          int idType,
00041                          int fieldID,
00042                          int offsetIntoField,
00043                          const double* prescribedValues);
00044 
00047     int loadEssentialBCs(int numIDs,
00048                          const int* IDs,
00049                          int idType,
00050                          int fieldID,
00051                          const int* offsetIntoField,
00052                          const double* prescribedValues);
00053 
00055     int loadLagrangeConstraint(int constraintID,
00056              const double *weights,
00057              double rhsValue);
00058 
00060     int loadPenaltyConstraint(int constraintID,
00061             const double *weights,
00062             double penaltyValue,
00063             double rhsValue);
00064 
00068     int loadComplete(bool applyBCs=true,
00069                      bool globalAssemble=true);
00070 
00077     int parameters(int numParams,
00078        const char* const* paramStrings);
00079 
00081     int parameters(const fei::ParameterSet& params);
00082 
00084     int setBCValuesOnVector(fei::Vector* vector);
00085 
00087     bool eqnIsEssentialBC(int globalEqnIndex) const;
00088 
00090     void getEssentialBCs(std::vector<int>& bcEqns,
00091                          std::vector<double>& bcVals) const;
00092 
00094     void getConstrainedEqns(std::vector<int>& crEqns) const;
00095 
00096   private:
00097     void setName(const char* name);
00098 
00099     int fill_EssBCValues();
00100 
00101     int implementBCs(bool applyBCs);
00102 
00103     int enforceEssentialBC_LinSysCore();
00104 
00105     void enforceEssentialBC_step_1(fei::CSVec& essBCs);
00106 
00107     void enforceEssentialBC_step_2(fei::CSVec& essBCs);
00108 
00109     int getMatrixRow(fei::Matrix* matrix, int row,
00110          std::vector<double>& coefs,
00111          std::vector<int>& indices);
00112 
00113     MPI_Comm comm_;
00114 
00115     fei::CSVec* essBCvalues_;
00116     fei::CSVec* allEssBCs_;
00117 
00118     bool resolveConflictRequested_;
00119     bool bcs_trump_slaves_;
00120     bool explicitBCenforcement_;
00121     bool BCenforcement_no_column_mod_;
00122 
00123     int localProc_;
00124     int numProcs_;
00125 
00126     int firstLocalOffset_;
00127     int lastLocalOffset_;
00128 
00129     std::string name_;
00130     std::map<std::string, unsigned> named_loadcomplete_counter_;
00131 
00132     std::vector<int> iwork_;
00133     std::vector<double> dwork_;
00134     std::string dbgprefix_;
00135   };//class LinearSystem_General
00136 }//namespace snl_fei
00137 
00138 #endif // _snl_fei_LinearSystem_General_hpp_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends