[Dune] Dune::BlockVector and complex fieldtype
lauseras at studi.informatik.uni-stuttgart.de
lauseras at studi.informatik.uni-stuttgart.de
Sun Jun 22 14:17:01 CEST 2008
> Dear all,
>
> After defining an object v by
>
> Dune::BlockVector<Dune::FieldVector<std::complex<double>,1> > v;
>
> the intitialization
>
> v=0.0;
>
> causes "ambiguous overload error":
>
> Fehler: ambiguous overload für »operator=« in »v = 0.0«
> /usr/local/include/dune/istl/bvector.hh:424: Anmerkung: Kandidaten sind:
> Dune::BlockVector<B, A>& Dune::BlockVector<B, A>::operator=(const
> Dune::BlockVector<B, A>&) [with B =
> Dune::FieldVector<std::complex<double>, 1>, A = Dune::ISTLAllocator]
> /usr/local/include/dune/istl/bvector.hh:457: Anmerkung:
> Dune::BlockVector<B, A>& Dune::BlockVector<B, A>::operator=(const
> typename B::field_type&) [with B =
> Dune::FieldVector<std::complex<double>, 1>, A = Dune::ISTLAllocator]
>
> The problem arises also when I call "apply" for some iterative solver
> object from the istl-module in case of a complex valued matrix.
>
> What is the right way to use complex fieldtype?
Have you tried something like:
typedef std::complex<double> Scalar;
typedef Dune::FieldVector<Scalar,1> FVec;
typedef Dune::BlockVector<FVec> BVec;
int n = 15;
BVec v(n);
v = FVec(Scalar(0.0));
For me this compiles using gcc 4.2.1.
cheers
AND
More information about the Dune
mailing list