[Top][All Lists]

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

[Getfem-users] Numerical problem with GMM

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


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:


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'

$ 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


reply via email to

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