getfem-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Getfem-users] Numerical problem with GMM


From: Torquil Macdonald Sørensen
Subject: Re: [Getfem-users] Numerical problem with GMM
Date: Wed, 13 Jan 2016 14:42:45 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0

Thanks! It now works as expected, when not using an explicit cast.

- Torquil

On 13/01/16 13:02, Yves Renard wrote:
> Dear Torquil,
>
> I commited a fix that allows the operation "u*M(0,0)" or similar
> operations. The point is that the template implicit cast method are not
> considered by c++ name lookup (they are treated as explicit ones). So
> each operation that we want to support have to be overloaded
> explicitely. This is now done in gmm_vector.h.
>
> Yves.
>
>  
>
>
> Le 06/01/2016 12:52, Torquil Macdonald Sørensen a écrit :
>> Hi!
>>
>> I'm having some numerical problems using GMM. Consider the following
>> test program:
>>
>> *************************************
>> gmm::row_matrix<gmm::rsvector<double> > M(1, 1);
>> M(0, 0) = 0.9;
>>
>> std::complex<double> u = 1.0;
>>
>> std::cout << M(0, 0) << std::endl;
>> std::cout << u << std::endl;
>> std::cout << u*M(0, 0) << std::endl;
>> std::cout << u*double(M(0, 0)) << std::endl;
>> *************************************
>>
>> It prints:
>>
>> ************
>> 0.9
>> (1,0)
>> (0,0)
>> (0.9,0)
>> *************
>>
>> But the third line should not be 0. For some reason, I have to
>> explicitly cast to double to get the correct result for the
>> multiplication, as I have done in the line corresponding to the fourth
>> printed line.
>>
>> I'm using the GetFEM SVN revision 5217, and my test program is compiled
>> with the following command:
>>
>> /usr/bin/mpicxx   -DBOOST_SYSTEM_NO_DEPRECATED -I/usr/include/petsc
>> -I/home/tmac/usr/include  -std=c++14 -Wfatal-errors -Wall
>> -Wno-unknown-pragmas -Wno-deprecated-declarations
>> -Wno-unused-local-typedefs -fdiagnostics-show-option -DGMM_USES_BLAS
>> -I/home/tmac/usr/stow/getfem/include -DGMM_USES_LAPACK
>> -I/home/tmac/usr/stow/getfem/include -ggdb   -o
>> CMakeFiles/bug.exe.dir/bug.cpp.o -c /home/tmac/research/bug.cpp
>>
>> Some more info:
>>
>> $ getfem-config --configure-args
>> '--prefix=/home/tmac/usr/stow/getfem' '--enable-shared' '--with-pic'
>> '--disable-python' '--disable-matlab' '--disable-scilab'
>> '--disable-mumps' '--disable-par-mumps' 'MPICXX=mpicxx'
>> 'CXXFLAGS=-I/home/tmac/usr/include' 'LDFLAGS=-L/home/tmac/usr/lib
>> -L/home/tmac/usr/lib64' 'MPICC=mpicc' 'CFLAGS=-I/home/tmac/usr/include'
>> 'MPIFC=mpif90'
>>
>> $ gcc --version
>> gcc (Debian 5.3.1-5) 5.3.1 20160101
>>
>> $ getfem-config --build-flags
>> -I/home/tmac/usr/include -O3 -Wall -W -fmessage-length=0
>> -ftemplate-depth-100 -std=c++11 -fPIC -pedantic -Wshadow
>> -Wno-unknown-pragmas -Wno-variadic-macros -Wno-unused-but-set-variable
>> -Wpointer-arith -Wcast-qual -Wwrite-strings -Wconversion
>> -Wredundant-decls -Wno-long-long
>>
>> $ getfem-config --cflags
>> -DGMM_USES_BLAS -I/home/tmac/usr/stow/getfem/include -DGMM_USES_LAPACK
>> -I/home/tmac/usr/stow/getfem/include
>>
>> Torquil
>>
>> _______________________________________________
>> Getfem-users mailing list
>> address@hidden
>> https://mail.gna.org/listinfo/getfem-users
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]