FEI  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fei_DirichletBCManager.hpp
1 #ifndef _fei_DirichletBCManager_hpp_
2 #define _fei_DirichletBCManager_hpp_
3 
4 /*--------------------------------------------------------------------*/
5 /* Copyright 2005 Sandia Corporation. */
6 /* Under the terms of Contract DE-AC04-94AL85000, there is a */
7 /* non-exclusive license for use of this work by or on behalf */
8 /* of the U.S. Government. Export of this program may require */
9 /* a license from the United States Government. */
10 /*--------------------------------------------------------------------*/
11 
12 #include <fei_DirichletBCRecord.hpp>
13 #include <SNL_FEI_Structure.hpp>
14 #include <fei_VectorSpace.hpp>
15 
16 #include <fei_Pool_alloc.hpp>
17 #include <map>
18 
19 class NodeDatabase;
20 class EqnBuffer;
21 
22 namespace fei {
23 class Matrix;
24 
25 class DirichletBCManager {
26  public:
27  DirichletBCManager(SNL_FEI_Structure* structure)
28  : structure_(structure), vecSpace_() {}
29 
30  DirichletBCManager(fei::SharedPtr<fei::VectorSpace> vecspace)
31  : structure_(NULL), vecSpace_(vecspace) {}
32 
33  ~DirichletBCManager(){}
34 
35  void addBCRecords(int numBCs,
36  int IDType,
37  int fieldID,
38  int offsetIntoField,
39  const int* IDs,
40  const double* prescribedValues);
41 
42  void addBCRecords(int numBCs,
43  int IDType,
44  int fieldID,
45  const int* IDs,
46  const int* offsetsIntoField,
47  const double* prescribedValues);
48 
49  int finalizeBCEqns(fei::Matrix& matrix,
50  bool throw_if_bc_slave_conflict=false);
51 
52  int finalizeBCEqns(EqnBuffer& bcEqns);
53 
54  size_t getNumBCRecords() const;
55 
56  void clearAllBCs();
57 
58  private:
59  int getEqnNumber(int IDType, int ID, int fieldID, int offsetIntoField);
60 
61  SNL_FEI_Structure* structure_;
63 
64  typedef std::map<int,double,std::less<int>,
66  bc_map bcs_;
67 };//class DirichletBCManager
68 }//namespace fei
69 #endif
70