47 #include <Xyce_config.h>
54 #include "N_LAS_Vector.h"
55 #include "N_LAS_Matrix.h"
56 #include "Epetra_MapColoring.h"
69 const std::vector<int>& vnodeGIDVec,
70 N_LAS_Vector* cloneVector,
71 double scaledEndValue,
73 node_list_type_(NLT_VoltageNodes),
74 vnodeGIDVec_(vnodeGIDVec),
76 scaled_end_value_(scaledEndValue),
77 residualConductance_(resCond)
91 GStepping(
const Teuchos::RefCountPtr<Epetra_MapColoring>& color_map,
92 N_LAS_Vector* cloneVector,
93 double scaledEndValue,
95 node_list_type_(NLT_AllVoltageUnknowns),
96 scaled_end_value_(scaledEndValue),
97 residualConductance_(resCond)
113 delete tmp_vector_ptr_;
131 conductance_ = pow(10.0, conductance) - pow(10.0, scaled_end_value_) + residualConductance_;
143 N_LAS_Vector * residualVector)
145 if (node_list_type_ == NLT_VoltageNodes)
147 std::vector<int>::const_iterator i = vnodeGIDVec_.begin();
148 std::vector<int>::const_iterator stop = vnodeGIDVec_.end();
149 for ( ; i < stop; ++i)
151 double value = conductance_ *
152 (
const_cast<N_LAS_Vector*
>(solution))->getElementByGlobalIndex(*i);
154 residualVector->sumElementByGlobalIndex(*i, value);
159 for (std::size_t i = 0; i < tmp_vector_ptr_->localLength(); ++i)
161 if ( (*color_map_)[i] == 0)
163 (*residualVector)[i] += conductance_ * (
const_cast<N_LAS_Vector&
>(*solution))[i];
180 jacobian->getDiagonal(*tmp_vector_ptr_);
182 if (node_list_type_ == NLT_VoltageNodes)
184 std::vector<int>::const_iterator i = vnodeGIDVec_.begin();
185 std::vector<int>::const_iterator stop = vnodeGIDVec_.end();
186 for ( ; i < stop; ++i)
188 tmp_vector_ptr_->sumElementByGlobalIndex(*i, conductance_);
193 for (std::size_t i = 0; i < tmp_vector_ptr_->localLength(); ++i)
195 if ( (*color_map_)[i] == 0)
197 (*tmp_vector_ptr_)[i] += conductance_;
202 jacobian->replaceDiagonal(*tmp_vector_ptr_);