Hi,
Since a long time I was struggling to get the following code running
#include "mfem.hpp"
#include <iostream>
using namespace mfem;
int main(int argc, char *argv[])
{
// Mesh *mesh = new Mesh("../data/inline-tri.mesh", 1, 1);
// Mesh *mesh = new Mesh("../data/inline-quad.mesh", 1, 1);
// Mesh *mesh = new Mesh("../data/inline-tet.mesh", 1, 1);
Mesh *mesh = new Mesh("../data/inline-hex.mesh", 1, 1);
int dim = mesh->Dimension();
for (int ref_levels = 0; ref_levels < 2; ref_levels++)
{
mesh->UniformRefinement();
Array<int> edges, orientation;
if (dim == 3)
for(int i = 0; i<mesh->GetNFaces(); i++)
mesh->GetFaceEdges(i, edges, orientation);
else
for(int i = 0; i<mesh->GetNEdges(); i++)
mesh->GetEdgeVertices(i, edges);
}
delete mesh;
return 0;
}
It gave an error for all 4 meshes using previous versions of MFEM. Using MFEM 3.4 triangular and tetrahedral meshes are working, due to the call of DeleteLazyTables(); in LocalRefinement. However, it is not called inside QuadUniformRefinement() or HexUniformRefinement(). I added it to the very beginning of those functions for myself, and it seems to be working. I am not entirely sure if that is the best place to delete the old tables. Do you have any suggestions?
Is there any reason behind the absence of DeleteLazyTables(); inside those two functions?
Regards,
Tamas
Yes, this is a recent fix - see #492. I guess I simply forgot to add the call to DeleteLazyTables() in the quad/hex refinement methods.
Thanks for reporting the issue.
Do you think it is okay to call DeleteLazyTables() at the very beginning of the quad/hex refinement?
Yes, I think that is okay. Feel free to make a PR to fix this issue.
Most helpful comment
Yes, I think that is okay. Feel free to make a PR to fix this issue.