22 typedef std::vector<fei::DirichletBCRecord>
DBCvec;
25 #define fei_file "fei_DirichletBCManager.cpp"
40 throw std::runtime_error(
"fei::DirichletBCManager has NULL SNL_FEI_Structure.");
46 throw std::runtime_error(
"fei::DirichletBCManager::getEqnNumber failed to get node.");
51 catch(std::runtime_error& exc) {
53 osstr <<
"fei::DirichletBCManager::finalizeBCEqns caught exception: "
54 << exc.what() <<
" BC IDType="<<IDType<<
", ID="<<ID
55 <<
", fieldID="<<fieldID;
60 return eqn + offsetIntoField;
69 const double* prescribedValues)
71 for(
int i=0; i<numBCs; ++i) {
72 int eqn =
getEqnNumber(IDType, IDs[i], fieldID, offsetIntoField);
74 bc_map::iterator iter =
bcs_.lower_bound(eqn);
76 if (iter ==
bcs_.end() || iter->first != eqn) {
77 bcs_.insert(iter, std::make_pair(eqn, prescribedValues[i]));
80 else iter->second = prescribedValues[i];
89 const int* offsetsIntoField,
90 const double* prescribedValues)
92 for(
int i=0; i<numBCs; ++i) {
93 int eqn =
getEqnNumber(IDType, IDs[i], fieldID, offsetsIntoField[i]);
95 bc_map::iterator iter =
bcs_.lower_bound(eqn);
97 if (iter ==
bcs_.end() || iter->first != eqn) {
98 bcs_.insert(iter, std::make_pair(eqn, prescribedValues[i]));
101 else iter->second = prescribedValues[i];
107 bool throw_if_bc_slave_conflict)
110 bool haveSlaves = reducer.
get()!=NULL;
118 bc_map::iterator iter =
bcs_.begin(), iter_end =
bcs_.end();
120 for(; iter!=iter_end; ++iter) {
122 int eqn = iter->first;
126 if (throw_if_bc_slave_conflict) {
128 osstr <<
"fei BCManager::finalizeBCeqns ERROR, eqn="<<eqn
129 <<
" is both a BC eqn and slave-constraint eqn.";
130 throw std::runtime_error(osstr.str());
136 double* ptr = &iter->second;
150 bc_map::iterator iter =
bcs_.begin(), iter_end =
bcs_.end();
152 for(; iter!=iter_end; ++iter) {
153 int eqn = iter->first;
154 double coef = iter->second;
int addEqn(int eqnNumber, const double *coefs, const int *indices, int len, bool accumulate, bool create_indices_union=false)
int getEqnNumber(int IDType, int ID, int fieldID, int offsetIntoField)
std::vector< fei::DirichletBCRecord > DBCvec
virtual fei::SharedPtr< fei::Reducer > getReducer()=0
NodeDatabase & getNodeDatabase()
bool getFieldEqnNumber(int fieldID, int &eqnNumber) const
SNL_FEI_Structure * structure_
int getGlobalIndex(int idType, int ID, int fieldID, int fieldOffset, int whichComponentOfField, int &globalIndex)
void addBCRecords(int numBCs, int IDType, int fieldID, int offsetIntoField, const int *IDs, const double *prescribedValues)
int finalizeBCEqns(fei::Matrix &matrix, bool throw_if_bc_slave_conflict=false)
virtual fei::SharedPtr< fei::MatrixGraph > getMatrixGraph() const =0
std::ostream & console_out()
virtual int copyIn(int numRows, const int *rows, int numCols, const int *cols, const double *const *values, int format=0)=0
size_t getNumBCRecords() const
bool isSlaveEqn(int unreducedEqn) const
int getNodeWithID(GlobalID nodeID, const NodeDescriptor *&node) const
#define FEI_OSTRINGSTREAM
fei::SharedPtr< fei::VectorSpace > vecSpace_