我正在使用Palabos开源代码。该代码在this Github存储库中给出。我正在尝试使用tagLids函数选择一个盖子,我希望得到一个整数作为返回值。为此,我正在使用triangleBoundary3D.h和triangleBoundary3D.hh。
tagLids函数需要一个长方体坐标,它标记所有重心在给定长方体内部的盖子,并返回整数标签。
为此,我尝试使用以下代码。我在屏幕上写了“完成”以检查代码在哪里失败。我的代码是:
Array<T,3> upperRightCorner = Array<T,3>(0., 0., 0.);
Array<T,3> lowerLeftCorner = Array<T,3>(0.015, 0.015, 0.015);
TriangleBoundary3D<T> *triangleBoundary;
Cuboid<T> aCuboid;
aCuboid.lowerLeftCorner = lowerLeftCorner;
aCuboid.upperRightCorner = upperRightCorner;
pcout << "Done 1" << std::endl;
plint inlet1 = triangleBoundary->tagLids(aCuboid);
pcout << "Done 2" << std::endl;
pcout << inlet1 << std::endl;
,输出为:
Done 1
[ubuntu:03772] *** Process received signal ***
[ubuntu:03772] Signal: Segmentation fault (11)
[ubuntu:03772] Signal code: Address not mapped (1)
[ubuntu:03772] Failing at address: 0x150
[ubuntu:03772] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)
[0x7f233dcd6890]
[ubuntu:03772] [ 1] ./externalFlowAroundObstacle(+0x16194)[0x5560d67b1194]
[ubuntu:03772] [ 2] ./externalFlowAroundObstacle(+0x10a8a)[0x5560d67aba8a]
[ubuntu:03772] [ 3] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)
[0x7f233d8f4b97]
[ubuntu:03772] [ 4] ./externalFlowAroundObstacle(+0x110da)[0x5560d67ac0da]
[ubuntu:03772] *** End of error message ***
Segmentation fault (core dumped)
如何从tagLids函数获取整数?