← Back to team overview

dolfin team mailing list archive

Using Parametrized::readParameters()

 

I added a function readParameters() to Parametrized that subclasses
can overload to trigger reading of values on Parametrized::set().

Earlier, we read parameters on each solve() in PETScKrylovSolver,
which is pretty expensive on repeated solves, like in the ODE solver
where a system is repeatedly solved using the same solver object. The
same is true for the NewtonSolver I think. Each time, a string lookup
(hashed, but anyway expensive) occurs to get the value from the DOLFIN
parameter database and give it to PETSc (which is even more expensive).

Now, the values are only read when something has changed, as triggered
by a call to readParameters().

/Anders