Clear coefficient matrix and residual between assemblies.
Request that the user specify a suitable operator for clearing the coefficient matrix, and call it just prior to assemble().
This commit is contained in:
@@ -66,7 +66,8 @@ namespace Opm {
|
||||
class JacobianSystem ,
|
||||
template <class> class VNorm ,
|
||||
template <class> class VNeg ,
|
||||
template <class> class VZero >
|
||||
template <class> class VZero ,
|
||||
template <class> class MZero >
|
||||
class ImplicitTransport {
|
||||
public:
|
||||
ImplicitTransport(Model& model)
|
||||
@@ -87,14 +88,16 @@ namespace Opm {
|
||||
ImplicitTransportDetails::NRReport& rpt ) {
|
||||
|
||||
typedef typename JacobianSystem::vector_type vector_type;
|
||||
typedef typename JacobianSystem::matrix_type matrix_type;
|
||||
|
||||
asm_.createSystem(g, sys_);
|
||||
|
||||
VZero<vector_type>::zero(sys_.vector().writableResidual());
|
||||
|
||||
model_.initStep(state, g, sys_);
|
||||
model_.initIteration(state, g, sys_);
|
||||
|
||||
MZero<matrix_type>::zero(sys_.writableMatrix());
|
||||
VZero<vector_type>::zero(sys_.vector().writableResidual());
|
||||
|
||||
asm_.assemble(state, g, src, dt, sys_);
|
||||
|
||||
const double nrm_res0 =
|
||||
@@ -121,6 +124,9 @@ namespace Opm {
|
||||
sys_.vector().addIncrement();
|
||||
model_.initIteration(state, g, sys_);
|
||||
|
||||
MZero<matrix_type>::zero(sys_.writableMatrix());
|
||||
VZero<vector_type>::zero(sys_.vector().writableResidual());
|
||||
|
||||
asm_.assemble(state, g, src, dt, sys_);
|
||||
rpt.norm_res =
|
||||
VNorm<vector_type>::norm(sys_.vector().residual());
|
||||
|
||||
Reference in New Issue
Block a user