snl_fei_LinearSystem_FEData.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_FEData_hpp_
00010 #define _snl_fei_LinearSystem_FEData_hpp_
00011 
00012 #include <fei_macros.hpp>
00013 #include <fei_mpi.h>
00014 #include <fei_utils.hpp>
00015 #include <fei_LinearSystem.hpp>
00016 #include <fei_Vector.hpp>
00017 #include <fei_Matrix.hpp>
00018 #include <fei_fwd.hpp>
00019 
00020 namespace fei {
00021   class DirichletBCManager;
00022 }
00023 
00024 namespace snl_fei {
00027   class LinearSystem_FEData : public fei::LinearSystem {
00028   public:
00030     LinearSystem_FEData(fei::SharedPtr<FiniteElementData>& fedata,
00031       fei::SharedPtr<fei::MatrixGraph>& matrixGraph);
00032 
00034     virtual ~LinearSystem_FEData();
00035 
00037     int loadLagrangeConstraint(int constraintID,
00038              const double *weights,
00039              double rhsValue);
00040 
00042     int loadPenaltyConstraint(int constraintID,
00043             const double *weights,
00044             double penaltyValue,
00045             double rhsValue);
00046 
00050     int loadComplete(bool applyBCs=true,
00051                      bool globalAssemble=true);
00052 
00054     fei::SharedPtr<FiniteElementData> getFiniteElementData() { return( feData_ ); }
00055 
00062     int parameters(int numParams,
00063        const char* const* paramStrings)
00064       { return( feData_->parameters(numParams, (char**)paramStrings) ); }
00065 
00067     int parameters(const fei::ParameterSet& params)
00068       {
00069   int numParams = 0;
00070   const char** paramStrings = NULL;
00071   std::vector<std::string> stdstrings;
00072   fei::utils::convert_ParameterSet_to_strings(&params, stdstrings);
00073   fei::utils::strings_to_char_ptrs(stdstrings, numParams, paramStrings);
00074 
00075   int err = parameters(numParams, paramStrings);
00076 
00077   delete [] paramStrings;
00078 
00079   return(err);
00080       }
00081 
00083     int setBCValuesOnVector(fei::Vector* vector);
00084 
00086     void setLookup(Lookup* lookup)
00087       { lookup_ = lookup; }
00088 
00090     bool eqnIsEssentialBC(int globalEqnIndex) const;
00091 
00093     void getEssentialBCs(std::vector<int>& bcEqns,
00094                          std::vector<double>& bcVals) const;
00095 
00097     void getConstrainedEqns(std::vector<int>& crEqns) const;
00098 
00099   private:
00100     int implementBCs(bool applyBCs);
00101 
00102     MPI_Comm comm_;
00103     int localProc_;
00104     int numProcs_;
00105     fei::SharedPtr<fei::Matrix> matrix_;
00106     fei::SharedPtr<fei::Vector> soln_;
00107     fei::SharedPtr<fei::Vector> rhs_;
00108     fei::SharedPtr<FiniteElementData> feData_;
00109     Lookup* lookup_;
00110 
00111     std::vector<char*> attributeNames_;
00112     std::vector<void*> attributes_;
00113   };//class LinearSystem_FEData
00114 }//namespace snl_fei
00115 
00116 #endif // _snl_fei_LinearSystem_FEData_hpp_

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