FEI  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fei_LinearSystem.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 _fei_LinearSystem_hpp_
10 #define _fei_LinearSystem_hpp_
11 
12 #include <fei_macros.hpp>
13 #include <fei_SharedPtr.hpp>
14 #include <fei_MatrixGraph.hpp>
15 #include <fei_Matrix.hpp>
16 #include <fei_Vector.hpp>
17 #include <fei_DirichletBCManager.hpp>
18 
19 namespace fei {
20  class Factory;
21  class ParameterSet;
22 
26  class LinearSystem {
27  public:
29  class Factory {
30  public:
32  virtual ~Factory(){}
33 
36  createLinearSystem(fei::SharedPtr<fei::MatrixGraph>& matrixGraph);
37  };
38 
41 
43  virtual ~LinearSystem();
44 
51  virtual int parameters(int numParams,
52  const char* const* paramStrings) = 0;
53 
56  virtual int parameters(const fei::ParameterSet& params) = 0;
57 
59  virtual void setMatrix(fei::SharedPtr<fei::Matrix>& matrix);
60 
63  { return(matrix_); }
64 
67  { fei::SharedPtr<const fei::Matrix> const_mat(matrix_);
68  return(const_mat); }
69 
71  virtual void setRHS(fei::SharedPtr<fei::Vector>& rhs)
72  { rhs_ = rhs; }
73 
76  { return(rhs_); }
77 
80  { fei::SharedPtr<const fei::Vector> const_rhs(rhs_);
81  return(const_rhs); }
82 
85  { soln_ = soln; }
86 
89  { return(soln_); }
90 
93  { fei::SharedPtr<const fei::Vector> const_soln(soln_);
94  return(const_soln); }
95 
98  virtual int putAttribute(const char* name,
99  void* attribute);
100 
102  virtual int getAttribute(const char* name,
103  void*& attribute);
104 
120  virtual int loadEssentialBCs(int numIDs,
121  const int* IDs,
122  int idType,
123  int fieldID,
124  int offsetIntoField,
125  const double* prescribedValues);
126 
143  virtual int loadEssentialBCs(int numIDs,
144  const int* IDs,
145  int idType,
146  int fieldID,
147  const int* offsetsIntoField,
148  const double* prescribedValues);
149 
158  virtual int loadLagrangeConstraint(int constraintID,
159  const double *weights,
160  double rhsValue) = 0;
161 
171  virtual int loadPenaltyConstraint(int constraintID,
172  const double *weights,
173  double penaltyValue,
174  double rhsValue) = 0;
175 
179  virtual int loadComplete(bool applyBCs=true,
180  bool globalAssemble=true) = 0;
181 
185  virtual int setBCValuesOnVector(fei::Vector* vector) = 0;
186 
190  virtual bool eqnIsEssentialBC(int globalEqnIndex) const = 0;
191 
196  virtual void getEssentialBCs(std::vector<int>& bcEqns,
197  std::vector<double>& bcVals) const = 0;
198 
202  virtual void getConstrainedEqns(std::vector<int>& crEqns) const = 0;
203 
204  protected:
208 
210  fei::DirichletBCManager* dbcManager_;
211 
212  std::vector<char*> attributeNames_;
213  std::vector<void*> attributes_;
214  };//class LinearSystem
215 }//namespace fei
216 
217 #endif // _fei_LinearSystem_hpp_
virtual void setMatrix(fei::SharedPtr< fei::Matrix > &matrix)
virtual int loadEssentialBCs(int numIDs, const int *IDs, int idType, int fieldID, int offsetIntoField, const double *prescribedValues)
virtual fei::SharedPtr< fei::Matrix > getMatrix()
virtual int loadLagrangeConstraint(int constraintID, const double *weights, double rhsValue)=0
virtual bool eqnIsEssentialBC(int globalEqnIndex) const =0
virtual int parameters(int numParams, const char *const *paramStrings)=0
virtual void setSolutionVector(fei::SharedPtr< fei::Vector > &soln)
virtual int loadPenaltyConstraint(int constraintID, const double *weights, double penaltyValue, double rhsValue)=0
virtual fei::SharedPtr< fei::Vector > getRHS()
virtual void setRHS(fei::SharedPtr< fei::Vector > &rhs)
virtual void getEssentialBCs(std::vector< int > &bcEqns, std::vector< double > &bcVals) const =0
virtual int loadComplete(bool applyBCs=true, bool globalAssemble=true)=0
virtual void getConstrainedEqns(std::vector< int > &crEqns) const =0
virtual int putAttribute(const char *name, void *attribute)
virtual int getAttribute(const char *name, void *&attribute)
virtual int setBCValuesOnVector(fei::Vector *vector)=0
LinearSystem(fei::SharedPtr< fei::MatrixGraph > &matrixGraph)
virtual fei::SharedPtr< fei::Vector > getSolutionVector()