Compilation warnings

Dear all,

I try to build a flow simulation using a domain simulation definition from an STL file (complex boundaries) with a free surface.
To do so, I try to mix two example codes, the first one from “aneurysm” for the STL side and the second, the “damBreak3d” for the free surface aspect.
As I’m at the beginning, I start to take part of the code located in the aneurysm.cpp file and go step by step. :slight_smile:
I can read the STL file and print some information of the readed file.
I try then to go to the next step which is transform the surface geometry to a TriangleBoundary3D structure. I add the following lines:

DEFscaledMesh* defmesh = new DEFscaledMesh(*triangleSet,resolution,referenceDirection,margin,(plint)0);
TriangleBoundary3D boundary(*defmesh);
delete defmesh;

Fisrt, when I compile with this new lines, I get lots of warnings (but no errors). When I try to run the simulation, it take all the 6 Gb of RAM and finish to crash with following :

terminate called after throwing an instance of ‘std::bad_alloc’
what(): std::bad_alloc
[teslac2050:04799] *** Process received signal ***
[teslac2050:04799] Signal: Aborted (6)
[teslac2050:04799] Signal code: (-6)
[teslac2050:04799] [ 0] /lib/ [0x7f0a9f3b3ff0]
[teslac2050:04799] [ 1] /lib/ [0x7f0a9f0751b5]
[teslac2050:04799] [ 2] /lib/ [0x7f0a9f077fc0]
[teslac2050:04799] [ 3] /usr/lib/ [0x7f0a9fb25dc5]
[teslac2050:04799] [ 4] /usr/lib/ [0x7f0a9fb24166]
[teslac2050:04799] [ 5] /usr/lib/ [0x7f0a9fb24193]
[teslac2050:04799] [ 6] /usr/lib/ [0x7f0a9fb2428e]
[teslac2050:04799] [ 7] /usr/lib/ [0x7f0a9fb2471d]
[teslac2050:04799] [ 8] ./lbmrdc(_ZNSt6vectorIlSaIlEE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPlS1_EERKl+0x11d) [0x48868d]
[teslac2050:04799] [ 9] ./lbmrdc(_ZN3plb21TriangularSurfaceMeshIdE11detectHolesEv+0x440) [0x4ae740]
[teslac2050:04799] [10] ./lbmrdc(_ZN3plb21TriangularSurfaceMeshIdE10closeHolesEv+0x26) [0x4ae946]
[teslac2050:04799] [11] ./lbmrdc(_ZN3plb18TriangleBoundary3DIdE10closeHolesEv+0x20) [0x4aecf0]
[teslac2050:04799] [12] ./lbmrdc() [0x475eff]
[teslac2050:04799] [13] ./lbmrdc(main+0x293) [0x477303]
[teslac2050:04799] [14] /lib/ [0x7f0a9f061c8d]
[teslac2050:04799] [15] ./lbmrdc() [0x46fec9]
[teslac2050:04799] *** End of error message ***

How to resolve this.

I found a way to not make the program crash,
I replace the line :
TriangleBoundary3D boundary(*defmesh);
by :
TriangleBoundary3D boundary(*defmesh,false);

go to the next step …


I wonder if there isn’t an issue with your STL file. Possible issues include: zero-area triangles, non-manifold vertices, non-manifold edges, and others. You can spot this kind of problems by loading your file into Meshlab and apply one of the filters, such as “remove zero-are triangles” etc.


Thanks for that.
I think you are right. I must have a problem in the STL file.
Will have a look to that.