fei_DirichletBCManager.hpp

00001 #ifndef _fei_DirichletBCManager_hpp_
00002 #define _fei_DirichletBCManager_hpp_
00003 
00004 /*--------------------------------------------------------------------*/
00005 /*    Copyright 2005 Sandia Corporation.                              */
00006 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00007 /*    non-exclusive license for use of this work by or on behalf      */
00008 /*    of the U.S. Government.  Export of this program may require     */
00009 /*    a license from the United States Government.                    */
00010 /*--------------------------------------------------------------------*/
00011 
00012 #include <fei_DirichletBCRecord.hpp>
00013 #include <SNL_FEI_Structure.hpp>
00014 #include <fei_VectorSpace.hpp>
00015 
00016 #include <fei_Pool_alloc.hpp>
00017 #include <map>
00018 
00019 class NodeDatabase;
00020 class EqnBuffer;
00021 
00022 namespace fei {
00023 class Matrix;
00024 
00025 class DirichletBCManager {
00026  public:
00027   DirichletBCManager(SNL_FEI_Structure* structure)
00028    : structure_(structure), vecSpace_() {}
00029 
00030   DirichletBCManager(fei::SharedPtr<fei::VectorSpace> vecspace)
00031    : structure_(NULL), vecSpace_(vecspace) {}
00032 
00033   ~DirichletBCManager(){}
00034 
00035   void addBCRecords(int numBCs,
00036                     int IDType,
00037                     int fieldID,
00038                     int offsetIntoField,
00039                     const int* IDs,
00040                     const double* prescribedValues);
00041 
00042   void addBCRecords(int numBCs,
00043                     int IDType,
00044                     int fieldID,
00045                     const int* IDs,
00046                     const int* offsetsIntoField,
00047                     const double* prescribedValues);
00048 
00049   int finalizeBCEqns(fei::Matrix& matrix,
00050                      bool throw_if_bc_slave_conflict=false);
00051 
00052   int finalizeBCEqns(EqnBuffer& bcEqns);
00053 
00054   size_t getNumBCRecords() const;
00055 
00056   void clearAllBCs();
00057 
00058  private:
00059   int getEqnNumber(int IDType, int ID, int fieldID, int offsetIntoField);
00060 
00061   SNL_FEI_Structure* structure_;
00062   fei::SharedPtr<fei::VectorSpace> vecSpace_;
00063 
00064   typedef std::map<int,double,std::less<int>,
00065             fei_Pool_alloc<std::pair<const int, double> > > bc_map;
00066   bc_map bcs_;
00067 };//class DirichletBCManager
00068 }//namespace fei
00069 #endif
00070 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends
Generated on Wed Apr 13 10:08:23 2011 for FEI by  doxygen 1.6.3