FEI  Version of the Day
snl_fei_LinearSystem_FEData.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_FEData_hpp_
10 #define _snl_fei_LinearSystem_FEData_hpp_
11 
12 #include <fei_macros.hpp>
13 #include <fei_mpi.h>
14 #include <fei_utils.hpp>
15 #include <fei_LinearSystem.hpp>
16 #include <fei_Vector.hpp>
17 #include <fei_Matrix.hpp>
18 #include <fei_fwd.hpp>
19 
20 namespace fei {
21  class DirichletBCManager;
22 }
23 
24 namespace snl_fei {
28  public:
32 
34  virtual ~LinearSystem_FEData();
35 
37  int loadLagrangeConstraint(int constraintID,
38  const double *weights,
39  double rhsValue);
40 
42  int loadPenaltyConstraint(int constraintID,
43  const double *weights,
44  double penaltyValue,
45  double rhsValue);
46 
50  int loadComplete(bool applyBCs=true,
51  bool globalAssemble=true);
52 
55 
62  int parameters(int numParams,
63  const char* const* paramStrings)
64  { return( feData_->parameters(numParams, (char**)paramStrings) ); }
65 
67  int parameters(const fei::ParameterSet& params)
68  {
69  int numParams = 0;
70  const char** paramStrings = NULL;
71  std::vector<std::string> stdstrings;
73  fei::utils::strings_to_char_ptrs(stdstrings, numParams, paramStrings);
74 
75  int err = parameters(numParams, paramStrings);
76 
77  delete [] paramStrings;
78 
79  return(err);
80  }
81 
83  int setBCValuesOnVector(fei::Vector* vector);
84 
86  void setLookup(Lookup* lookup)
87  { lookup_ = lookup; }
88 
90  bool eqnIsEssentialBC(int globalEqnIndex) const;
91 
93  void getEssentialBCs(std::vector<int>& bcEqns,
94  std::vector<double>& bcVals) const;
95 
97  void getConstrainedEqns(std::vector<int>& crEqns) const;
98 
99  private:
100  int implementBCs(bool applyBCs);
101 
102  MPI_Comm comm_;
103  int localProc_;
104  int numProcs_;
109  Lookup* lookup_;
110 
111  std::vector<char*> attributeNames_;
112  std::vector<void*> attributes_;
113  };//class LinearSystem_FEData
114 }//namespace snl_fei
115 
116 #endif // _snl_fei_LinearSystem_FEData_hpp_
fei::Vector
Definition: fei_Vector.hpp:57
snl_fei::LinearSystem_FEData::LinearSystem_FEData
LinearSystem_FEData(fei::SharedPtr< FiniteElementData > &fedata, fei::SharedPtr< fei::MatrixGraph > &matrixGraph)
Definition: snl_fei_LinearSystem_FEData.cpp:33
snl_fei::LinearSystem_FEData::loadPenaltyConstraint
int loadPenaltyConstraint(int constraintID, const double *weights, double penaltyValue, double rhsValue)
Definition: snl_fei_LinearSystem_FEData.cpp:173
snl_fei::LinearSystem_FEData::setLookup
void setLookup(Lookup *lookup)
Definition: snl_fei_LinearSystem_FEData.hpp:86
fei::SharedPtr< FiniteElementData >
snl_fei::LinearSystem_FEData
Definition: snl_fei_LinearSystem_FEData.hpp:27
snl_fei::LinearSystem_FEData::setBCValuesOnVector
int setBCValuesOnVector(fei::Vector *vector)
Definition: snl_fei_LinearSystem_FEData.cpp:106
snl_fei::LinearSystem_FEData::parameters
int parameters(const fei::ParameterSet &params)
Definition: snl_fei_LinearSystem_FEData.hpp:67
fei::LinearSystem
Definition: fei_LinearSystem.hpp:26
fei::ParameterSet
Definition: fei_ParameterSet.hpp:46
snl_fei::LinearSystem_FEData::loadLagrangeConstraint
int loadLagrangeConstraint(int constraintID, const double *weights, double rhsValue)
Definition: snl_fei_LinearSystem_FEData.cpp:164
fei::utils::convert_ParameterSet_to_strings
void convert_ParameterSet_to_strings(const fei::ParameterSet *paramset, std::vector< std::string > &paramStrings)
Definition: fei_utils.cpp:270
snl_fei::LinearSystem_FEData::getFiniteElementData
fei::SharedPtr< FiniteElementData > getFiniteElementData()
Definition: snl_fei_LinearSystem_FEData.hpp:54
fei::utils::strings_to_char_ptrs
void strings_to_char_ptrs(std::vector< std::string > &stdstrings, int &numStrings, const char **&charPtrs)
Definition: fei_utils.cpp:178
snl_fei::LinearSystem_FEData::loadComplete
int loadComplete(bool applyBCs=true, bool globalAssemble=true)
Definition: snl_fei_LinearSystem_FEData.cpp:72
snl_fei::LinearSystem_FEData::parameters
int parameters(int numParams, const char *const *paramStrings)
Definition: snl_fei_LinearSystem_FEData.hpp:62
fei
Definition: fei_ArrayUtils.hpp:16
snl_fei::LinearSystem_FEData::~LinearSystem_FEData
virtual ~LinearSystem_FEData()
Definition: snl_fei_LinearSystem_FEData.cpp:47
snl_fei::LinearSystem_FEData::eqnIsEssentialBC
bool eqnIsEssentialBC(int globalEqnIndex) const
Definition: snl_fei_LinearSystem_FEData.cpp:52
FiniteElementData::parameters
virtual int parameters(int numParams, char **params)=0
snl_fei::LinearSystem_FEData::getConstrainedEqns
void getConstrainedEqns(std::vector< int > &crEqns) const
Definition: snl_fei_LinearSystem_FEData.cpp:66
Lookup
Definition: fei_Lookup.hpp:40
snl_fei::LinearSystem_FEData::getEssentialBCs
void getEssentialBCs(std::vector< int > &bcEqns, std::vector< double > &bcVals) const
Definition: snl_fei_LinearSystem_FEData.cpp:59