I’m using the finite element library for some calculations, and I’ve encountered a bizarre problem.
I basically have the following for loop:
MeshBase::const_node_iterator node_it = mesh.nodes_begin();
for (unsigned int i=0;i<n_nodes;i++ , node_it++){
const Node* node2 = *node_it;
Point dumpoint( (*node2)(0), (*node2)(1), (*node2)(2));
Number dumreal= (Number) mesh_data.get_data(node2)[0];
// std::cout << dumreal <<std::endl;
dummap[dumpoint] = mesh_data.get_data(node2)[0];
}
If I uncomment the line with cout, it works. Otherwise I get a segfault. It doesn’t matter what I print:
std::cout << std::endl;
An important note is that dummap is a global
std::map<Point,Number>
Using valgrind showed that the problem was with some char* array I allocated somewhere else.
Thanks ^^