我是Fenics的新手,我只想创建一个带孔的多边形网格。我写了:
// Vector of points
std::vector<Point> pts;
pts.push_back(Point( 0.0, 0.0));
pts.push_back(Point( 4.0, 0.0));
pts.push_back(Point( 4.0, 8.0));
pts.push_back(Point( 0.0, 8.0));
pts.push_back(Point( 0.0, 8.0 / 2 + 0.5));
pts.push_back(Point( 1.0, 8.0 / 2 + 0.5));
pts.push_back(Point( 2.0, 8.0 / 4 ));
pts.push_back(Point( 1.0, 8.0 / 2 - 0.5));
pts.push_back(Point( 0.0, 8.0 / 2 - 0.5));
// Polygone
mshr::Polygon polyline(pts);
// Hole
mshr::Circle circle(Point(2.0, 7.0), 0.3);
// Difference: IT IS A SHARED POINTER
auto difference = polyline - circle;
// Create a simple mesh
Mesh mesh;
mshr::CSGCGALMeshGenerator2D generator;
// Mesh it!
generator.generate(*difference, mesh);
但我一直收到此错误消息,无法生成可执行文件:
扫描目标demo_poisson [50%]构建CXX的依赖关系 object CMakeFiles / demo_poisson.dir / main.cpp.o [100%]链接CXX 可执行的demo_poisson CMakeFiles / demo_poisson.dir / main.cpp.o:In 函数
mshr::CSGDifference::~CSGDifference()': /home/fenics/local/include/mshr/CSGOperators.h:67: undefined reference to
vtable for mshr :: CSGDifference' CMakeFiles / demo_poisson.dir / main.cpp.o:在函数中 `MSHR :: CSGOperator ::〜CSGOperator()':...............................
任何人都知道这里发生了什么?任何帮助表示赞赏,提前谢谢。