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

Benedikt Oswald benedikt.oswald at psi.ch
Tue Jan 11 13:56:28 CET 2011


Hi Oliver, thanks...but:

when I read the documentation for the method two_norm() it says that it calculates
the square root of the sum of the square of the elements, but for a complex vector
one would require that the method calculates the square root over the sum of
the element times its complex conjugate ?

what do you think on this ? 

Greetings, Benedikt



On Jan 7, 2011, at 4:36 PM, Oliver Sander wrote:

> Hi Benedikt!
> AFAIK this should work.
> Best,
> Oliver
> 
> Am 06.01.2011 15:16, schrieb Benedikt Oswald:
>> 
>> Dear Dune, what will happen when I use a code sequence like this:
>> 
>> 
>> Dune::FieldVector<std::complex<double>,3> electricField
>> 
>> then assign some values to the vector's components and
>> eventually calculate the two_norm of the vector like this:
>> 
>> double length = electricField.two_norm();
>> 
>> 
>> Will this correctly evaluate ?
>> 
>> 
>> Thanks for having a look and greetings, Benedikt
>> 
>> 
>> 
>> 
>> 
>> --------------------------------------------------------------------------------------------------------------------------------------------------------------------
>> 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
>>   
> 
> _______________________________________________
> 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.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20110111/9a0370c2/attachment.htm>


More information about the Dune mailing list