getfem-users
[Top][All Lists]
Advanced

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

Re: [Getfem-users] MACHINE-DEPENDENT ERROR in getfem::mesh::add_point


From: Yves Renard
Subject: Re: [Getfem-users] MACHINE-DEPENDENT ERROR in getfem::mesh::add_point
Date: Wed, 25 Mar 2015 20:02:46 +0100 (CET)



Dear Domenico,

There is of course no reason for your program to crash.
If you can send the smallest compilable program which is crashing, I can have a 
look to it.

Yves.

----- Original Message -----
From: "Domenico Notaro" <address@hidden>
To: address@hidden
Sent: Wednesday, March 25, 2015 5:44:50 PM
Subject: [Getfem-users] MACHINE-DEPENDENT ERROR in getfem::mesh::add_point



Dear GetFEM++ Users, 




I have an "invalid pointer" error in building a 1D mesh immersed in a 3D 
domain. I have no problem on my office's computer (i7 with Ubuntu12.04, 
GetFem-4.3) but just on my own laptop (i5 with Ubuntu14.04, GetFem-4.3). 




I tried with a very simple mesh made by one segment that I discretize with 50 
elements. The error occurs when I add the second point of the second element. 

The code is the following (I added some control print because I am not able in 
debugging): 

/// Read an arc from pts file and write to lpoints 
std::vector<base_node> lpoints; 

// build lpoints ... 

#ifdef __VERBOSE__ 
cout << " Found an arc with " << lpoints.size() << " points." << endl; 
#endif 
/// Insert the arc into the 1D mesh 
for (size_type i=0; i<lpoints.size()-1; ++i ) { 
cout << "for i=" << i << endl; 
// We need a couple of global indexes 
// Points in the pts file are: begin, end, point, point, ... 
size_type ii = (i==0) ? 0 : i+1; 
size_type jj; 
if (ii == lpoints.size()-1) jj = 1; 
else if (ii == 0) jj = 2; 
else jj = ii+1; 
cout << " ii=" << ii << " jj=" << jj << endl; 
cout << " p" << ii << "="<< lpoints[ii] 
<< " p" << jj << "="<< lpoints[jj] << endl; 

std::vector<size_type> ind; 
ind.push_back(mh1D.add_point(lpoints[ii])); 
cout << " ind" << ii << "="<< ind[0] << endl; 
ind.push_back(mh1D.add_point(lpoints[jj])); 
cout << " ind" << jj << "="<< ind[1] << endl; 

//std::string MESH_TYPE1 = "GT_PK(1," + poly_deg + ")"; 
size_type cv = mh1D.add_convex(bgeot::geometric_trans_descriptor(MESH_TYPE), 
ind.begin()); 


I tried also: 


//size_type cv = mh1D.add_segment_by_points(lpoints[ii], lpoints[jj]); 

and/or: 


//ind.clear(); 




} /* end of for loop */ 




but the error doesn't change. The output is the following: 

Importing the 1D mesh for the vessel ... 
Found an arc with 51 points. 
for i=0 
ii=0 jj=2 
p0=[11, 1, 1] p2=[10.78, 1.168, 1.052] 
ind0=0 
ind2=1 
for i=1 
ii=2 jj=3 
p2=[10.78, 1.168, 1.052] p3=[10.56, 1.336, 1.104] 
ind2=1 
*** Error in `./MCirc': free(): invalid pointer: 0x0000000001dc9c80 *** 
Aborted (core dumped) 




Do you have any suggestion? 




Thank you in advance, 

domenico_notaro 


_______________________________________________
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]