Hello, we noticed that edgnr got removed from the python API after introducing EdgeDescriptor. The current EdgeDescriptor constructor does not take any arguments, I would have expected consistency with FaceDescriptor.
We opened a ngsPETSc PR to address this new API, I am expecting that the EdgeDescriptor should enable us to add many edges under the same index at once, but my efforts have been futile.
Hi, yes this should be exactly the intent. It was already longer planned to make this consistent to the FaceDescriptor setup and bring more consistency between the different geometry interfaces with that.
What did you try and how? Do you have a minimal example of your problem?
Adding a constructor taking arguments is a good point, I just added that.
Best
Christopher
Here’s a minimal failing example. We want to externally refine a mesh. The method for external refinement does not project points to the boundary, so we mimic this by setting the geometry to None. We then reconstruct the refined mesh with netgen, with the correct geometry, and we hope that the points get properly projected to the boundary. However this is not the case, fine points on the boundary are still on the coarse edge.
mfe_edgenr.py (1.7 KB)
Hi Pablo,
are you sure this was ever working before?
I just looked into the AddElement function: When adding 1D elements, the project_geometry is not used at all - Christopher, can you add that?
The indices seem to match, if I refine the new mesh, the level 2 vertices get projected.
best, Joachim
Hi Joachim,
We were able to project edges with the old API (edge-by-edge). Maybe the MFE script is doing it wrongly with the new API.
just pushed “fix project_geometry for adding 1D elements in groups”,
your mwe is working with that, but certainly needs more testing.
Joachim
Thanks, Joachim. Has this landed in 6.2.2605.post5.dev0?
sorry no, I was too slow, you have to wait for the next one. I thought you are compiling anyway.
That’s alright. I had issues the first time I tried to compile netgen (no sudo access). I’d like to test the fix before you publish the next release.
Would this work?
index = rngmesh.Add(ngm.EdgeDescriptor(bc=index, edgenr=index))
rngmesh.AddElements(dim=1,
index=index,
data=nodes, base=1,
project_geometry=True)
Should I be expecting the same interface as FaceDescriptor?
Yes exactly. I think before you did a loop over the 1d elements and added them seperately. The project_geometry was only implemented in the single add element for 1d. The bulk did only work for 2d elements. Now after Joachims fix it should also work for 1d elements like this.