[Dune] Field Vector with K = std::complex<double> ?

Christian Engwer christi at uni-hd.de
Wed Jan 12 12:29:44 CET 2011


On Wed, Jan 12, 2011 at 12:03:33PM +0100, Benedikt Oswald wrote:
> Hello
> 
> currently doing some tests with FieldVectors employing the std::complex<double> type,
> it appears that I can not assign a real valued vector to a complex value one;
> 
> the error message is something like:  can not assign vector to non-scalar.
> 
> Of course, doing it element wise works fine.
> 
> But would there be a more elegant way of doing this ?

This should not be too difficult. You have to modify the
copy-constructor. Make it a template function taking any kind of
FieldVector<K>. Error-Messsages might become a bit unreadable...

I'm not sure when I'll find the time to change this, but we are happy
for all patches ;-)

Christian

> 
> Thanks, Benedikt
> 
> 
> 
> 
> On Jan 11, 2011, at 3:57 PM, Andreas Dedner wrote:
> 
> > Hi.
> > As a first step, it would be a good idea, if you could simply add a test to
> > dune-common/dune/common/test/fvectortest.cc
> > There is already some interface checks for FieldVector<complex> I think
> > but some
> > semantics checks would be a good idea and worth having.
> > Best
> > Andreas
> > 
> > On 11/01/11 13:22, Markus Blatt wrote:
> >> Hi,
> >> 
> >> On Tue, Jan 11, 2011 at 01:59:30PM +0100, Oliver Sander wrote:
> >> 
> >>> If you really want to know what the code does then go and read it.
> >>> It's just C++ after all.  I wouldn't do anything else at this point either.
> >>> 
> >> it is not as easy as one might think. You have to know that the
> >> interesting things happen in some TMP in dune/common/densevector.hh.
> >> 
> >> After a glance at the code  it seems to do the right thing, here.
> >> 
> >> But please keep in mind that the behaviour for non real types is not
> >> well tested.
> >> Actually I tried to make it work last autumn, but ran into troubles
> >> because of inter-module dependancies with pdelab. At that time there
> >> was now other resolution besides reverting my patches. We hope to
> >> resolve these issues by March. 
> >> 
> >> Cheers,
> >> 
> >> Markus
> >> 
> >> _______________________________________________
> >> Dune mailing list
> >> Dune at dune-project.org
> >> http://lists.dune-project.org/mailman/listinfo/dune
> >> 
> > 
> > 
> > _______________________________________________
> > Dune mailing list
> > Dune at dune-project.org
> > http://lists.dune-project.org/mailman/listinfo/dune
> 
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------
> Benedikt Oswald, Dr. sc. techn., dipl. El. Ing. ETH, www.psi.ch, Computational Accelerator Scientist, http://amas.web.psi.ch
> Paul Scherrer  Institute (PSI), CH-5232 Villigen, Suisse, benedikt.oswald at psi.ch, +41(0)56 310 32 12
> 
> "Passion is required for any great work, and for the revolution passion and audacity are required in big doses.",
>  Ernesto 'Che' Guevara, Letter to his parents.
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------
> 
> 
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
> 




More information about the Dune mailing list