FEI  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
snl_fei_LinearSystem_General.hpp
1 /*--------------------------------------------------------------------*/
2 /* Copyright 2005 Sandia Corporation. */
3 /* Under the terms of Contract DE-AC04-94AL85000, there is a */
4 /* non-exclusive license for use of this work by or on behalf */
5 /* of the U.S. Government. Export of this program may require */
6 /* a license from the United States Government. */
7 /*--------------------------------------------------------------------*/
8 
9 #ifndef _snl_fei_LinearSystem_General_hpp_
10 #define _snl_fei_LinearSystem_General_hpp_
11 
12 #include <fei_macros.hpp>
13 #include <fei_mpi.h>
14 #include <fei_CSVec.hpp>
15 #include <fei_LinearSystem.hpp>
16 #include <fei_Matrix.hpp>
17 #include <fei_Vector.hpp>
18 #include <fei_fwd.hpp>
19 #include <fei_Logger.hpp>
20 
21 namespace fei {
22  class DirichletBCManager;
23 }
24 
25 namespace snl_fei {
27  class LinearSystem_General : public fei::LinearSystem,
28  private fei::Logger {
29  public:
32 
34  virtual ~LinearSystem_General();
35 
38  int loadEssentialBCs(int numIDs,
39  const int* IDs,
40  int idType,
41  int fieldID,
42  int offsetIntoField,
43  const double* prescribedValues);
44 
47  int loadEssentialBCs(int numIDs,
48  const int* IDs,
49  int idType,
50  int fieldID,
51  const int* offsetIntoField,
52  const double* prescribedValues);
53 
55  int loadLagrangeConstraint(int constraintID,
56  const double *weights,
57  double rhsValue);
58 
60  int loadPenaltyConstraint(int constraintID,
61  const double *weights,
62  double penaltyValue,
63  double rhsValue);
64 
68  int loadComplete(bool applyBCs=true,
69  bool globalAssemble=true);
70 
77  int parameters(int numParams,
78  const char* const* paramStrings);
79 
81  int parameters(const fei::ParameterSet& params);
82 
84  int setBCValuesOnVector(fei::Vector* vector);
85 
87  bool eqnIsEssentialBC(int globalEqnIndex) const;
88 
90  void getEssentialBCs(std::vector<int>& bcEqns,
91  std::vector<double>& bcVals) const;
92 
94  void getConstrainedEqns(std::vector<int>& crEqns) const;
95 
96  private:
97  void setName(const char* name);
98 
99  int fill_EssBCValues();
100 
101  int implementBCs(bool applyBCs);
102 
103  int enforceEssentialBC_LinSysCore();
104 
105  void enforceEssentialBC_step_1(fei::CSVec& essBCs);
106 
107  void enforceEssentialBC_step_2(fei::CSVec& essBCs);
108 
109  int getMatrixRow(fei::Matrix* matrix, int row,
110  std::vector<double>& coefs,
111  std::vector<int>& indices);
112 
113  MPI_Comm comm_;
114 
115  fei::CSVec* essBCvalues_;
116  fei::CSVec* allEssBCs_;
117 
118  bool resolveConflictRequested_;
119  bool bcs_trump_slaves_;
120  bool explicitBCenforcement_;
121  bool BCenforcement_no_column_mod_;
122 
123  int localProc_;
124  int numProcs_;
125 
126  int firstLocalOffset_;
127  int lastLocalOffset_;
128 
129  std::string name_;
130  std::map<std::string, unsigned> named_loadcomplete_counter_;
131 
132  std::vector<int> iwork_;
133  std::vector<double> dwork_;
134  std::string dbgprefix_;
135  };//class LinearSystem_General
136 }//namespace snl_fei
137 
138 #endif // _snl_fei_LinearSystem_General_hpp_
int loadEssentialBCs(int numIDs, const int *IDs, int idType, int fieldID, int offsetIntoField, const double *prescribedValues)
int parameters(int numParams, const char *const *paramStrings)
int loadPenaltyConstraint(int constraintID, const double *weights, double penaltyValue, double rhsValue)
int loadComplete(bool applyBCs=true, bool globalAssemble=true)
void getConstrainedEqns(std::vector< int > &crEqns) const
LinearSystem_General(fei::SharedPtr< fei::MatrixGraph > &matrixGraph)
void getEssentialBCs(std::vector< int > &bcEqns, std::vector< double > &bcVals) const
bool eqnIsEssentialBC(int globalEqnIndex) const
int loadLagrangeConstraint(int constraintID, const double *weights, double rhsValue)