[dune-pdelab] Time-dependent right hand side

Jö Fahlke jorrit at jorrit.de
Mon Aug 24 13:45:50 CEST 2015


Am Fri, 21. Aug 2015, 23:56:33 +0200 schrieb conf86 at web.de:
> Date: Fri, 21 Aug 2015 23:56:33 +0200
> From: conf86 at web.de
> To: dune-pdelab at dune-project.org
> Subject: [dune-pdelab] Time-dependent right hand side
> 
> Hi,
> 
> I'm currently trying to solve an instationary equation with time-dependent right-hand side.
> Therefore I tried to put 
>  void setTime ( double t ) { time = t ; } in class ProblemTimeLocalOperator
> like it is done in the course examples (example03_toperator.hh).
> 
> However, I get this error:
> 
>  /lib/include/dune/pdelab/gridoperator/default/localassembler.hh:115:9: error: request for member ‘setTime’ is ambiguous
>           lop.setTime(time_);
>           ^
>  In file included from problem_operator.hh:8:0,
>                   from problem.cc:61:
>  /lib/include/dune/pdelab/localoperator/idefault.hh:104:18: note: candidates are: void Dune::PDELab::InstationaryLocalOperatorDefaultMethods<R>::setTime(R) [with R = double]
>               void setTime (R t_)
>                    ^
>  In file included from problem.cc:61:0:
>  problem_operator.hh:41:8: note:                 void ProblemTimeLocalOperator<BCType>::setTime(double) [with BCType = BCTypeParam]
>       void setTime ( double t ) { time = t ; }

The actual local operator used seems to be derived from both
"Dune::PDELab::InstationaryLocalOperatorDefaultMethods<R>" and
"ProblemTimeLocalOperator<BCType>" like so:

  InstationaryLocalOperatorDefaultMethods   ProblemTimeLocalOperator
                                   |             |
                                   |             |
                                   v             v
                                   ActuallyUsedLOP

Both InstationaryLocalOperatorDefaultMethods and ProblemTimeLocalOperator seem
to contain a method setTime with the same signature, and so the compiler has
no idea which one to take.  The method should be overridden in
ActuallyUsedLOP, or ActuallyUsedLOP should explicitly specify which one of
both should be used e.g. by doing "using
ProblemTimeLocalOperator<BCType>::setTime;".

Unfortunately, the error message does not include the type name of the
actually used local operator (the type of "lop"), please include more of the
error message.  As is is now, I can't even tell whether the actually used
local operator is written by you or is something provided with PDELab.

> Another question is: Is this actually the right way to get time in order to put:
>  RF f = c * time; 
> or similar?
> Unfortunately, there seems to be no explicit example for f (or other terms), only for the Dirichlet boundary conditions where it is used in this way with setTime().

A bit more context would be helpful.  Where do you want to put that line?

Regards,
Jö.

-- 
Jorrit (Jö) Fahlke, Institute for Computational und Applied Mathematics,
University of Münster, Orleans-Ring 10, D-48149 Münster
Tel: +49 251 83 35146 Fax: +49 251 83 32729

Das Erststudium soll bis zum berufsqualifizierenden Abschluss
gebührenfrei bleiben, also bis zur Erlangung der Taxi-Lizenz.
-- Akrützel, Ausgabe vom 16.5.2002 (www.akruetzel.de)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 811 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune-pdelab/attachments/20150824/6f366840/attachment.sig>


More information about the dune-pdelab mailing list