29 #define fei_file "snl_fei_LinearSystem_FEData.cpp"
35 : fei::LinearSystem(matrixGraph),
36 comm_(matrixGraph->getRowSpace()->getCommunicator()),
60 std::vector<double>& bcVals)
const
68 matrixGraph_->getConstrainedIndices(crEqns);
75 if (dbcManager_ == NULL) {
80 if (matrix_.get() != NULL && globalAssemble) {
81 err = matrix_->gatherFromOverlap();
83 fei::console_out() <<
"snl_fei::LinearSystem_FEData::loadComplete, ERROR in matrix."
84 <<
"gatherFromOverlap(), data may be incorrect."<<
FEI_ENDL;
90 if (rhs_.get() != NULL && globalAssemble) {
91 err = rhs_->gatherFromOverlap();
93 fei::console_out() <<
"snl_fei::LinearSystem_FEData::loadComplete, ERROR rhs."
94 <<
"gatherFromOverlap(), data may be incorrect."<<
FEI_ENDL;
100 CHK_ERR( implementBCs(applyBCs) );
102 return(feData_->loadComplete());
114 std::vector<int> essEqns;
115 std::vector<double> essGamma;
120 bool zeroSharedRows =
false;
123 CHK_ERR( dbcManager_->finalizeBCEqns(bcEqns) );
126 std::map<int,fei::FillableMat*>::iterator
127 it = remotes.begin(),
128 it_end = remotes.end();
129 for(; it!=it_end; ++it) {
137 int len = essEqns.size();
138 essEqns.resize(len*3);
139 int* nodeNumbers = &essEqns[0]+len;
140 int* dof_ids = nodeNumbers+len;
143 int* essEqnsPtr = &essEqns[0];
144 double* gammaPtr = &essGamma[0];
146 for(
int i=0; i<len; ++i) {
147 int eqn = essEqnsPtr[i];
148 nodeNumbers[i] = lookup_->getAssociatedNodeNumber(eqn);
149 int fieldID = lookup_->getAssociatedFieldID(eqn);
150 int base_eqn = lookup_->getEqnNumber(nodeNumbers[i], fieldID);
155 CHK_ERR( feData_->setDirichletBCs(len, nodeNumbers, dof_ids, gammaPtr) );
165 const double *weights,
174 const double *weights,
LinearSystem_FEData(fei::SharedPtr< FiniteElementData > &fedata, fei::SharedPtr< fei::MatrixGraph > &matrixGraph)
int setBCValuesOnVector(fei::Vector *vector)
virtual ~LinearSystem_FEData()
int implementBCs(bool applyBCs)
std::map< int, FillableMat * > & getRemotelyOwnedMatrices()
void getConstrainedEqns(std::vector< int > &crEqns) const
bool eqnIsEssentialBC(int globalEqnIndex) const
void Barrier(MPI_Comm comm)
fei::FieldDofMap< int > & getFieldDofMap()
int loadPenaltyConstraint(int constraintID, const double *weights, double penaltyValue, double rhsValue)
LocalOrdinal get_dof_id(LocalOrdinal fieldID, LocalOrdinal offset)
int gatherFromOverlap(bool accumulate=true)
int loadLagrangeConstraint(int constraintID, const double *weights, double rhsValue)
fei::SharedPtr< T > getMatrix()
std::ostream & console_out()
void separate_BC_eqns(const fei::FillableMat &mat, std::vector< int > &bcEqns, std::vector< double > &bcVals)
int localProc(MPI_Comm comm)
void getEssentialBCs(std::vector< int > &bcEqns, std::vector< double > &bcVals) const
int loadComplete(bool applyBCs=true, bool globalAssemble=true)
int numProcs(MPI_Comm comm)
int getNumIndices_Owned() const