47 #include <Xyce_config.h>
54 #include "N_LAS_Vector.h"
55 #include "N_LAS_Matrix.h"
56 #include "Epetra_MapColoring.h"
72 (
const Teuchos::RCP<Epetra_MapColoring>&
74 Linear::Vector* cloneVector,
75 bool useVoltageScaleFactor,
76 double voltageScaleFactor)
78 use_voltage_scale_factor_ = useVoltageScaleFactor;
79 voltage_scale_factor_ = voltageScaleFactor;
80 color_map_ = color_map;
81 tmp_vector_ptr_ =
new Linear::Vector(*cloneVector);
107 (
double time_step_size)
109 time_step_size_ = time_step_size;
121 (
const Linear::Vector * solution, Linear::Vector * residual_vector)
135 (Linear::Matrix * jacobian)
146 jacobian->getDiagonal(*tmp_vector_ptr_);
150 double value = 1.0 / time_step_size_;
154 if (!use_voltage_scale_factor_)
156 tmp_vector_ptr_->addScalar(value);
160 for (std::size_t i = 0; i < tmp_vector_ptr_->localLength(); ++i)
162 if ( (*color_map_)[i] == 0)
164 (*tmp_vector_ptr_)[i] += value * voltage_scale_factor_;
168 (*tmp_vector_ptr_)[i] +=
value;
175 jacobian->replaceDiagonal(*tmp_vector_ptr_);
Xyce::Linear::Vector * tmp_vector_ptr_
Pure virtual class to augment a linear system.
const T & value(const ParameterBase &entity, const Descriptor &descriptor)
Returns the value of the parameter for the entity.
void setProgressVariable(double time_step_size)
Set the progress variable (time step size for pseudo transient).
~AugmentLinSysPseudoTransient()
Dtor.
void augmentJacobian(Xyce::Linear::Matrix *jacobian)
Augments the Jacobian.
void augmentResidual(const Xyce::Linear::Vector *solution, Xyce::Linear::Vector *residual_vector)
Augments the Residual.
AugmentLinSysPseudoTransient(const Teuchos::RCP< Epetra_MapColoring > &color_map, Xyce::Linear::Vector *cloneVector, bool useVoltageScaleFactor=false, double voltageScaleFactor=1.0)
Ctor.