47 #include <Xyce_config.h>
52 #include <N_UTL_fwd.h>
57 #include "N_LAS_Vector.h"
58 #include "N_LAS_Matrix.h"
59 #include "N_ERH_ErrorMgr.h"
75 IO::InitialConditionsData::NodeNamePairMap & op_in,
76 const NodeNameMap & allNodes_in, N_PDS_Comm * pdsCommPtr
78 allNodes_(allNodes_in),
81 pdsCommPtr_ (pdsCommPtr),
120 (
const Linear::Vector * solution, Linear::Vector * residual_vector)
122 residualPtr_ = residual_vector;
123 solutionPtr_ = solution;
125 #ifdef Xyce_PARALLEL_MPI
126 pmap_ = residualPtr_->pmap();
142 IO::InitialConditionsData::NodeNamePairMap::iterator op_i;
143 IO::InitialConditionsData::NodeNamePairMap::iterator op_end =
op_.end();
144 int i, row, rowLen, global_row, numRows;
145 std::vector<int> col;
146 std::vector<double> val;
147 std::vector<double> resTmp;
150 std::map<int,std::string> rowOut;
156 numRows = jacobian->getLocalNumRows();
159 for (row=0 ; row<numRows ; ++row)
161 #ifdef Xyce_PARALLEL_MPI
162 global_row =
pmap_->localToGlobalIndex(row);
166 rowLen = jacobian->getRowLength(global_row);
170 jacobian->getRowCopy(global_row, rowLen, rowLen, &val[0], &col[0]);
172 for (i=0 ; i<rowLen ; ++i)
175 if (GID == global_row)
189 #ifdef Xyce_PARALLEL_MPI
196 std::vector<int> buf(numG_tot,0);
197 std::vector<int> buf_g(numG_tot,0);
198 std::set<int>::iterator skip_i=
skipGID.begin();
199 std::set<int>::iterator skip_end=
skipGID.end();
200 for ( ; skip_i != skip_end ; ++skip_i)
201 buf[myPos++] = *skip_i;
202 pdsCommPtr_->sumAll (&buf[0], &buf_g[0], numG_tot);
204 for (i=0 ; i < numG_tot ; i++)
211 std::set<int>::iterator skipLIDEnd =
skipLID.end();
212 std::set<int>::iterator skipGIDEnd =
skipGID.end();
213 for ( ; op_i != op_end ; ++op_i)
215 row = (*op_i).second.first;
216 if (
skipLID.find(row) == skipLIDEnd)
218 #ifdef Xyce_PARALLEL_MPI
219 global_row =
pmap_->localToGlobalIndex(row);
223 rowLen = jacobian->getRowLength(global_row);
226 jacobian->getRowCopy(global_row, rowLen, rowLen, &val[0], &col[0]);
228 Linear::Vector & residual = (*residualPtr_);
230 for (i=0 ; i<rowLen ; i++)
235 if (
skipGID.find(GID) == skipGIDEnd)
237 if (GID == global_row)
248 residual[row] += val[i] *
249 (
const_cast<Linear::Vector*
>(
solutionPtr_))->getElementByGlobalIndex(GID);
252 jacobian->shirleyPutRow(global_row, rowLen, &val[0], &col[0]);
~AugmentLinSysOPStart()
Dtor.
Pure virtual class to augment a linear system.
void augmentResidual(const Xyce::Linear::Vector *solution, Xyce::Linear::Vector *residual_vector)
Augments the Residual.
void augmentJacobian(Xyce::Linear::Matrix *jacobian)
Augments the Jacobian.
Xyce::IO::InitialConditionsData::NodeNamePairMap & op_
map of specified variables
AugmentLinSysOPStart(Xyce::IO::InitialConditionsData::NodeNamePairMap &, const Xyce::NodeNameMap &, N_PDS_Comm *)
const Xyce::Linear::Vector * solutionPtr_