[MOAB-dev] Possible bug in moab::Core::get_coords

Iulian Grindeanu iulian at mcs.anl.gov
Wed Jul 28 11:31:14 CDT 2010


Dear Roman,
Yes,  the array should be filled correctly, so it is a bug; I cannot reproduce it, unfortunately, I may need to 
upgrade everything.
You can also try to clear the range, every time, before getting connectivity. 

Thanks,
Iulian

----- Original Message -----
From: "Roman Putanowicz" <putanowr at l5.pk.edu.pl>
To: iulian at mcs.anl.gov
Cc: moab-dev at mcs.anl.gov
Sent: Wednesday, July 28, 2010 10:51:53 AM GMT -06:00 US/Canada Central
Subject: Re: [MOAB-dev] Possible bug in moab::Core::get_coords

> 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? 
Dear Iulian,

Thank you for your answer. Using std::vector instead of Range helps.
It is the second time I make this mistake :(. 

However, regardless of the order of vertices (i.e. std::vector versus
Range) the function get_coords should fill the coords array properly,
shouldn't it?

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