Using STL files for domain descriptions

Hi,

I am new to Palabos. I have read through the user guide and somewhat understand the code. I have also done the tutorials and that has helped. I am now building my own simulation and I am using the aneurysm code as a base. My problem is very similar, however, the geometry is different. I am using an STL file to describe the geometry. The code compiles just fine. However, everytime I try to run the code I get the error below.

I am not sure what I am doing wrong. There isn’t a really clear explanation (for beginners) on reading in an STL file and defining the boundaries for the domain based on the STL file. I would really appreciate any help. It would be helpful to know which parts of the code must be modified if I am using a different STL file.

It would be useful to have a tutorial posted up explaining how to read an STL file to define a simulation domain and how to assign boundaries for the STL file. The aneurysm code is a bit advanced for beginner users to learn from.

Thanks and Regards,

Muaaz Bhamjee

aneurysm: /usr/local/palabos-v1.3r0/src/offLattice/triangleSet.hh:105: void plb::TriangleSet::readSTL(std::string) [with T = double, std::string = std::basic_string]: Assertion fp != __null' failed. [muaaz-Dell-System-XPS-L502X:03259] *** Process received signal *** [muaaz-Dell-System-XPS-L502X:03259] Signal: Aborted (6) [muaaz-Dell-System-XPS-L502X:03259] Signal code: (-6) aneurysm: /usr/local/palabos-v1.3r0/src/offLattice/triangleSet.hh:105: void plb::TriangleSet<T>::readSTL(std::string) [with T = double, std::string = std::basic_string<char>]: Assertionfp != __null’ failed.
[muaaz-Dell-System-XPS-L502X:03260] *** Process received signal ***
[muaaz-Dell-System-XPS-L502X:03260] Signal: Aborted (6)
[muaaz-Dell-System-XPS-L502X:03260] Signal code: (-6)
aneurysm: /usr/local/palabos-v1.3r0/src/offLattice/triangleSet.hh:105: void plb::TriangleSet::readSTL(std::string) [with T = double, std::string = std::basic_string]: Assertion fp != __null' failed. [muaaz-Dell-System-XPS-L502X:03261] *** Process received signal *** [muaaz-Dell-System-XPS-L502X:03261] Signal: Aborted (6) [muaaz-Dell-System-XPS-L502X:03261] Signal code: (-6) aneurysm: /usr/local/palabos-v1.3r0/src/offLattice/triangleSet.hh:105: void plb::TriangleSet<T>::readSTL(std::string) [with T = double, std::string = std::basic_string<char>]: Assertionfp != __null’ failed.
[muaaz-Dell-System-XPS-L502X:03262] *** Process received signal ***
[muaaz-Dell-System-XPS-L502X:03262] Signal: Aborted (6)
[muaaz-Dell-System-XPS-L502X:03262] Signal code: (-6)
[muaaz-Dell-System-XPS-L502X:03261] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0) [0x7feae233fcb0]
[muaaz-Dell-System-XPS-L502X:03261] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x7feae1fa7425]
[muaaz-Dell-System-XPS-L502X:03261] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x17b) [0x7feae1faab8b]
[muaaz-Dell-System-XPS-L502X:03261] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x2f0ee) [0x7feae1fa00ee]
[muaaz-Dell-System-XPS-L502X:03261] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x2f192) [0x7feae1fa0192]
[muaaz-Dell-System-XPS-L502X:03261] [ 5] aneurysm() [0x48d6c9]
[muaaz-Dell-System-XPS-L502X:03261] [ 6] aneurysm(_Z14readParametersRKN3plb9XMLreaderE+0x1102) [0x48e7d2]
[muaaz-Dell-System-XPS-L502X:03261] [ 7] aneurysm(main+0x13a) [0x48789a]
[muaaz-Dell-System-XPS-L502X:03261] [ 8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7feae1f9276d]
[muaaz-Dell-System-XPS-L502X:03261] [ 9] aneurysm() [0x489961]
[muaaz-Dell-System-XPS-L502X:03261] *** End of error message ***
[muaaz-Dell-System-XPS-L502X:03262] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0) [0x7f34f29accb0]
[muaaz-Dell-System-XPS-L502X:03262] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x7f34f2614425]
[muaaz-Dell-System-XPS-L502X:03262] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x17b) [0x7f34f2617b8b]
[muaaz-Dell-System-XPS-L502X:03262] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x2f0ee) [0x7f34f260d0ee]
[muaaz-Dell-System-XPS-L502X:03262] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x2f192) [0x7f34f260d192]
[muaaz-Dell-System-XPS-L502X:03262] [ 5] aneurysm() [0x48d6c9]
[muaaz-Dell-System-XPS-L502X:03262] [ 6] aneurysm(_Z14readParametersRKN3plb9XMLreaderE+0x1102) [0x48e7d2]
[muaaz-Dell-System-XPS-L502X:03262] [ 7] aneurysm(main+0x13a) [0x48789a]
[muaaz-Dell-System-XPS-L502X:03262] [ 8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f34f25ff76d]
[muaaz-Dell-System-XPS-L502X:03262] [ 9] aneurysm() [0x489961]
[muaaz-Dell-System-XPS-L502X:03262] *** End of error message ***
[muaaz-Dell-System-XPS-L502X:03259] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0) [0x7f449eca7cb0]
[muaaz-Dell-System-XPS-L502X:03259] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x7f449e90f425]
[muaaz-Dell-System-XPS-L502X:03259] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x17b) [0x7f449e912b8b]
[muaaz-Dell-System-XPS-L502X:03259] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x2f0ee) [0x7f449e9080ee]
[muaaz-Dell-System-XPS-L502X:03259] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x2f192) [0x7f449e908192]
[muaaz-Dell-System-XPS-L502X:03259] [ 5] aneurysm() [0x48d6c9]
[muaaz-Dell-System-XPS-L502X:03259] [ 6] aneurysm(_Z14readParametersRKN3plb9XMLreaderE+0x1102) [0x48e7d2]
[muaaz-Dell-System-XPS-L502X:03259] [ 7] aneurysm(main+0x13a) [0x48789a]
[muaaz-Dell-System-XPS-L502X:03259] [ 8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f449e8fa76d]
[muaaz-Dell-System-XPS-L502X:03259] [ 9] aneurysm() [0x489961]
[muaaz-Dell-System-XPS-L502X:03259] *** End of error message ***
[muaaz-Dell-System-XPS-L502X:03260] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0) [0x7fe055132cb0]
[muaaz-Dell-System-XPS-L502X:03260] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x7fe054d9a425]
[muaaz-Dell-System-XPS-L502X:03260] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x17b) [0x7fe054d9db8b]
[muaaz-Dell-System-XPS-L502X:03260] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x2f0ee) [0x7fe054d930ee]
[muaaz-Dell-System-XPS-L502X:03260] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x2f192) [0x7fe054d93192]
[muaaz-Dell-System-XPS-L502X:03260] [ 5] aneurysm() [0x48d6c9]
[muaaz-Dell-System-XPS-L502X:03260] [ 6] aneurysm(_Z14readParametersRKN3plb9XMLreaderE+0x1102) [0x48e7d2]
[muaaz-Dell-System-XPS-L502X:03260] [ 7] aneurysm(main+0x13a) [0x48789a]
[muaaz-Dell-System-XPS-L502X:03260] [ 8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7fe054d8576d]
[muaaz-Dell-System-XPS-L502X:03260] [ 9] aneurysm() [0x489961]
[muaaz-Dell-System-XPS-L502X:03260] *** End of error message ***

mpirun noticed that process rank 3 with PID 3262 on node muaaz-Dell-System-XPS-L502X exited on signal 6 (Aborted).

Dear Muaaz,

The error that you get:

aneurysm: /usr/local/palabos-v1.3r0/src/offLattice/triangleSet.hh:105: void plb::TriangleSet::readSTL(std::string) [with T = double, std::string = std::basic_string]: Assertion `fp != __null’ failed.

means that the STL file that you give cannot be found on disk. So, either the name is wrong, or the file does not exist, or the path is wrong, or something like that…

Cheers,
Dimitris

Hi,

Thank you. I found the problem. However, now the simulation begins and then stops with the error below. Any idea what I am still doing wrong?

Thanks and Kind Regards,

Muaaz Bhamjee

Reynolds number, based on provided inlet diameter: 119522

Running new simulation at level 0
uLB=308.765
nuLB=0.0062
tau=0.5186
dx=0.005
dt=0.154382
[muaaz-Dell-System-XPS-L502X:06325] *** Process received signal ***
[muaaz-Dell-System-XPS-L502X:06325] Signal: Segmentation fault (11)
[muaaz-Dell-System-XPS-L502X:06325] Signal code: Address not mapped (1)
[muaaz-Dell-System-XPS-L502X:06325] Failing at address: 0x10
[muaaz-Dell-System-XPS-L502X:06325] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0) [0x7facc321fcb0]
[muaaz-Dell-System-XPS-L502X:06325] [ 1] ./aneurysm(_ZN3plb17computeBaryCenterIdEENS_5ArrayIT_Lm3EEERKNS_21TriangularSurfaceMeshIS2_EERKNS_3LidE+0x17) [0x4bec47]
[muaaz-Dell-System-XPS-L502X:06325] [ 2] ./aneurysm(_Z11setOpeningsRSt6vectorIPN3plb17BoundaryProfile3DIdNS0_5ArrayIdLm3EEEEESaIS5_EERNS0_18TriangleBoundary3DIdEEddd+0x43d) [0x48f54d]
[muaaz-Dell-System-XPS-L502X:06325] [ 3] ./aneurysm(_Z3runlPN3plb19MultiBlockLattice3DIdNS_11descriptors15D3Q19DescriptorEEE+0x5e1) [0x495ef1]
[muaaz-Dell-System-XPS-L502X:06325] [ 4] ./aneurysm(main+0x297) [0x4879f7]
[muaaz-Dell-System-XPS-L502X:06325] [ 5] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7facc2e7276d]
[muaaz-Dell-System-XPS-L502X:06325] [ 6] ./aneurysm() [0x489961]
[muaaz-Dell-System-XPS-L502X:06325] *** End of error message ***
Segmentation fault (core dumped)

seven years passed. Did you solve this problem? I’ve the same one and it is really unbelievable no one ever solve this topic. ^^

Hey Simone,
What are you trying to do ?
If you’re just trying to use an STL as a geometry I can help you with that :slight_smile:

I try to explain. I’ve already create a geometry with solid works and I saved the *.STL file. The geometry is that one depicted in the picture below. I checked the geometry with Palabos tool *.stlcheck with a positive output. Then I used aneurysm showcase to try to simulate the behaviour of the fluid, but the following error comes out:

unning new simulation at level 0
uLB=837.67
nuLB=0.0062
tau=0.5186
dx=25.02
dt=1.04793e+06
*[ubuntu:03433] *** Process received signal ****
[ubuntu:03433] Signal: Segmentation fault (11)
[ubuntu:03433] Signal code: Address not mapped (1)
[ubuntu:03433] Failing at address: 0x10
[ubuntu:03433] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7fc4f7f2f3c0]
[ubuntu:03433] [ 1] ./isokin(+0x39cf3)[0x55a386d46cf3]
[ubuntu:03433] [ 2] ./isokin(+0x3cf8a)[0x55a386d49f8a]
[ubuntu:03433] [ 3] ./isokin(+0x360d3)[0x55a386d430d3]
[ubuntu:03433] [ 4] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7fc4f7d4d0b3]
[ubuntu:03433] [ 5] ./isokin(+0x37e2e)[0x55a386d44e2e]
*[ubuntu:03433] *** End of error message ****
Segmentation fault (core dumped)

Hmmm so a few things i can think of.
First i’m assuming you did change the domain and everything from the anyeursm case ? that model is quite small, someone else had a similar problem where when they were loading the STL from solid works, since STL doesn’t perserve units they ended up with a massive model that was basically completely outside their domain. (Imported geometry beyond bounds and local boundary conditions)

one other thing(and i think this is the issue) you might want to check is that when you make a model in solid works the walls have two layers. When palabos imports this it could have issues, in my case I had to delete all the walls i didn’t need so that I basically just had the surface of the model.
Best,
Cats

Marvellous. Great suggestions. I’m going to check immediatly and I’ll return with an answer. Thank you very much. I’m very new with Palabos, and it is not so trivial to learn by user’s guide.

Best,

SMN

Ok. I modified the STL considering only the wall (monlayer).I changed the domain of aneurysm in a correct way (I think) and trying to follow the geometry I want to simulate. Sincerly in the aneurysm code I did not understand where I’ve to specify the scale factor.

At the moment the output error is different:

[ubuntu:03762] *** Process received signal ***
[ubuntu:03762] Signal: Segmentation fault (11)
[ubuntu:03762] Signal code: Address not mapped (1)
[ubuntu:03762] Failing at address: (nil)
[ubuntu:03762] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7fe5a43443c0]
[ubuntu:03762] [ 1] /lib/x86_64-linux-gnu/libc.so.6(fread+0x25)[0x7fe5a41c1005]
[ubuntu:03762] [ 2] ./isokin(+0x38fff)[0x55e73fa28fff]
[ubuntu:03762] [ 3] ./isokin(+0x35f0a)[0x55e73fa25f0a]
[ubuntu:03762] [ 4] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7fe5a41620b3]
[ubuntu:03762] [ 5] ./isokin(+0x37e2e)[0x55e73fa27e2e]
[ubuntu:03762] *** End of error message ***
Segmentation fault (core dumped)

any suggestions?

In the aneurysm code the scaling is done automatically since that has the grid refinement.
Are you manually defining boundaries ? or are you using the automatic inlet outlet detection ?

seg faults are very hard to solve like this as their quite broad.
can you send me the mesh ? I can try to run it when i have a minute

I used the automatic inlet outlet detection, modyfing the *.xml following the rule of aneurysm code. I defined a direction(z one) and serial type of boundary (i.e. Inlet Outlet Outlet Outlet).
Then I even modyfied in the *.cpp the inlet point.

I share with you the *.STL. Is it sufficient? May I send it by e-mail or in which way?

Hi Simone,

Apologies for the delayed response, I was on academic leave for the last two weeks. I did solve this problem and I posted the solution on this thread: Triangular Surface Mesh Error

Please let me know if that helps solve your problem.

Thanks and Kind Regards,

Muaaz.