cburstedde / p4est

The "p4est" forest-of-octrees library

Home Page:www.p4est.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using both p4est and p8est in an application

arthurbawin opened this issue · comments

Hello !

I use p4est in gmsh, to compute and store a mesh size field that is used during unstructured mesh generation. The goal is to deal with 2D and 3D models with the same code, so I'd like to be able to generate both octrees and quadtrees, with the decision being made at runtime when a model is loaded. For 3D models, I use p8est to create an octree around it and store the size field in the octree. For 2D planar models, I currently create an octree and only work on the slice of octants that have an intersection with the z = 0 plane. The 3D works as intended, but the 2D looks like a huge waste of time and resources to me, having to deal with the whole octree, but I haven't found another solution yet, since as I understand it the choice between p4est and p8est has to be made at compile time.

Am I understanding it wrong ? Or is there a workaround I could use to choose between p4est and p8est at runtime ?

Thanks,
Arthur