[MOAB-dev] Possible bug in moab::Core::get_coords
iulian at mcs.anl.gov
iulian at mcs.anl.gov
Wed Jul 28 10:15:53 CDT 2010
Hello,
Thanks for sending the bug.
I could not reproduce it, because I have gcc 4.2.4
Still, you should not use Range for connectivity, because the vertices will be returned in the increasing order of the handles (this is why you had for the last edge 1 4 , and not 4 1; see definition of the Range)
You should use std::vector, like in
...
moab::ErrorCode ierr;
std::vector<moab::EntityHandle> vertices;
ierr = imesh->get_connectivity(&handle, 1, vertices);
RINS(imesh, ierr);
double coords[6];
...
Can you try changing the code, and let us know if the bug still shows up?
Thanks,
Iulian
----- Original Message -----
From: "Roman Putanowicz" <putanowr at l5.pk.edu.pl>
To: moab-dev at mcs.anl.gov
Sent: Tuesday, July 27, 2010 9:46:57 PM GMT -06:00 US/Canada Central
Subject: [MOAB-dev] Possible bug in moab::Core::get_coords
Dear All,
The same program, same data, two different machines and two different outputs.
Could someone of you, please, confirm the results so I can exclude
some stupid configuration bug (like wrong lib version though I have checked
that :)
In the attachment there is a simple program and data file.
The program finds the length of a perimeter of a skin of a triangle mesh.
I run it on two machines:
machne A:
gcc --version : gcc (Debian 4.4.4-6) 4.4.4
uname -srm : Linux 2.6.32-trunk-686 i686
machine B:
gcc --version : gcc (Debian 4.3.2-1.1) 4.3.2
uname -srm : Linux 2.6.26-2-amd64 x86_64
MOAB svn version 4070
Running the program I got:
Machine A: | Machine B
---------------------+---------------------------
V: 1 2 | V: 1 2
0 0 0 1 0 0 | 0 0 0 1 0 0
V: 2 3 | V: 2 3
1 0 0 1 1 0 | 1 0 0 1 1 0
V: 3 4 | V: 3 4
1 1 0 0 1 0 | 1 1 0 0 1 0
V: 1 4 | V: 1 4
0 1 0 0 1 0 | 0 0 0 0 1 0 <<--------- BINGO
Perim length: 3 | Perim length: 4
For the test data (unit square mesh) correct anser is of course B.
( BTW why the vertices of the last edge are 1 4 and not 4 1 ? )
Compiling the program
g++ -I INC_PATH -L LIB_PATH coordsBug.cxx -lMOAB -o coordsBug
Running:
coordsBug two_triangles.vtk
Thanks in advance for any hint.
Regards,
Roman
--
Roman Putanowicz, PhD < putanowr at l5.pk.edu.pl >
Institute for Computational Civil Engng (L-5)
Dept. of Civil Engng, Cracow Univ. of Technology
www.l5.pk.edu.pl, tel. +48 12 628 2569, fax 2034
More information about the moab-dev
mailing list