Hello, I have a problem with volume meshing.
Netgen is very fast and of high quality for dividing surface mesh.
When I use opencacade to read a brep file, perform Boolean union on the shapes in the file, and then convert them to shapes for occ_geom=Ng_oCC_Load_Shape (shape), the number of volume meshes is always 0.
With the same parameters, when I directly use occ_geom=Ng-OCC_Load_SREP (inputFilePath. c_st()), the volume mesh can be divided.
maybe the occ-shape contains only a shell ?
You can use ngsolve.occ Python interface to analyze your occ-shape, or use the occ topology explorer in the legacy Netgen gui.
Joachim
Thank you very much for your reply, Professor.
I think I have found the problem through testing in the past two days. The main issue lies in the Boolean operation of the OCC library. After stacking two overlapping boxes together, the shape obtained by simply performing Boolean operation cannot be closed, which leads to the occurrence of this problem. If others have the same problem, it is recommended to check the graphic closure property of occ_geo read in.
Then I have another question that I would like to ask you. Netgen, I currently have a relatively fast speed for generating triangular meshes. Changing:mp= meshParameters.quad_daminated to 1 to partition quadrilateral meshes is relatively slower.
1、Are there any settings that can speed up the generation of quadrilateral meshes?
2、Are there any settings to speed up the generation of volumetric meshes?
I look forward to your reply, thank you.
Hello,
I am facing a problem in using NetGen mesher + opencascade with its C++ interface. The problem:
- I import a single plain cube STEP file (cube.step), use nglib_occ function “Ng_OCC_Load_IGES” to create occ_geom. Then I mesh it. I get tetrahedral volume mesh as expected.
- I import two or more “touching” cubes IGES file (threeCubes.iges), using same code as above. I get zero volume elements. Surface elements are also not conformal between the two cubes.
Could you please tell me what I am doing wrong?
Please find attached both the step and iges files.
cube.step (7.3 KB)
threeCubes.iges (44.1 KB)
Hi,
I solved my previous question. But, now I have another question.
How can one import TopoDS_Shape of Open-Cascade to generate mesh strictly using C++ nglib_occ interface?
I see that OCCGeometry object can be created by taking TopoDS_Shape as input. But, OCCGeometry is not visible in nglib.h or in nglib_occ.h. As a result, when I try to create OCCGeometry by taking TopoDS_Shape as input as follows,
TopoDS_Shape shape = reader.Shape();
occ_geom = (Ng_OCC_Geometry*)new netgen::OCCGeometry(shape);
I get an error that OCCGeometry is unknown object.
Note, that I am “linking” nglib library to my C++ program. That is, I am not compiling nglib source files together with by C++ program.
the nglib is an old interface that is kept for backward compatibility but directly using the C++ interface is recommended now.
If you need a C wrapper library we recommend to create your own in the style of the nglib.
best