Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GMSH quad mesh with some cells with negative weight #13347

Closed
tjhei opened this issue Feb 7, 2022 · 7 comments
Closed

GMSH quad mesh with some cells with negative weight #13347

tjhei opened this issue Feb 7, 2022 · 7 comments

Comments

@tjhei
Copy link
Member

tjhei commented Feb 7, 2022

I have a valid 2d mesh from GMSH that consists of two parts and GMSH decided to export half of the cells with a negative and half with a positive measure.

Reading it currently fails, but it works fine if we remove the AssertThrow:

AssertThrow(n_negative_cells == 0 || n_negative_cells == cells.size(),

@singima is working on a patch with a test case.

@bangerth
Copy link
Member

bangerth commented Feb 7, 2022

That is probably relatively easy to fix for a 2d mesh in 2d space. I don't know what to do about it for a 2d mesh in 3d, or in general a 3d mesh in 3d, though.

@tjhei
Copy link
Member Author

tjhei commented Feb 8, 2022

That is probably relatively easy to fix for a 2d mesh in 2d space

It is. Patch is coming soon. I am coaching @singima through that.

3d mesh in 3d

For that case we also flip all cells with negative measure already. Why do you think that is an issue?

I don't know what to do about it for a 2d mesh in 3d,

I agree. The code for checking/changing measures currently only runs for dim=spacedim. For other cases we probably fail if we encounter negative cell measures during a computation, see #13346

@bangerth
Copy link
Member

bangerth commented Feb 8, 2022

What do we do in 3d? Just swap the upper and lower four vertices? If we already do that, much the better of course!

@tjhei
Copy link
Member Author

tjhei commented Feb 8, 2022

Just swap the upper and lower four vertices?

else if (dim == 3)
{
// swap the front and back faces in 3D
std::swap(cell.vertices[0], cell.vertices[2]);
std::swap(cell.vertices[1], cell.vertices[3]);
std::swap(cell.vertices[4], cell.vertices[6]);
std::swap(cell.vertices[5], cell.vertices[7]);
}

@agrayver
Copy link
Contributor

agrayver commented Feb 9, 2022

Maybe related #3201

@tjhei
Copy link
Member Author

tjhei commented Feb 9, 2022

Indeed, thank you! @singima here you have a simple test case!

@tjhei
Copy link
Member Author

tjhei commented Feb 26, 2022

fixed by #13444

@tjhei tjhei closed this as completed Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants