Hello everyone,
I am new to Fenics and I want to create a polygonal mesh with a hole in it.
I have written
// Create mesh and function space
//UnitSquareMesh mesh(32, 32);
// 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);
But I keep getting following error :
Scanning dependencies of target demo_poisson [ 50%] Building CXX
object CMakeFiles/demo_poisson.dir/main.cpp.o [100%] Linking CXX
executable demo_poisson CMakeFiles/demo_poisson.dir/main.cpp.o: In
function 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: In function
mshr::CSGOperator::~CSGOperator()':
/home/fenics/local/include/mshr/CSGOperators.h:33: undefined reference
to
mshr::CSGGeometry::~CSGGeometry()'
CMakeFiles/demo_poisson.dir/main.cpp.o: In function
`mshr::CSGDifference::~CSGDifference()': ....
:_(
Anyone knows what is going on here ? Any help is appreciated, thanks in advance.