On 08/03/2017 03:16 AM, 'Maxi Miller' via deal.II User Group wrote:
> I am following example 52 for writing code which should solve a system of
> three equations. In it I can rewrite my equations such that my source term is
> zero, but my matrices on the left side are depending on time, which means that
> I have to reassemble the system matrix and the inverse system matrix at every
> time step. Is that a good idea, or rather performance-degrading?
Like all performance questions, it is not worth thinking about them *unless
you have concrete evidence* that your performance is too slow for what you
want to do. For example, if your solver takes 90% of the time, then it doesn't
make sense to look at the run time of the assembly.
> Furthermore I then have to call
> |
> assemble_system(time)
> |
> in the function
> |
> evaluate_diffusion(constdoubletime,constVector<double>&y)
> |
> but compilation fails with
> |
> error:passing ‘constStep52::Diffusion<3>’as‘this’argument discards qualifiers
> [-fpermissive]
> assemble_system(time);
> |
> but why? And how can I fix that?
Your evaluate_diffusion() function is declared as `const`. But you can only
call `const` functions from `const` functions, so you are not allowed to call
the non-`const` function assemble_system().
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email:
bang...@colostate.edu
www:
http://www.math.colostate.edu/~bangerth/