
Hello everybody,
first of all, sorry for my bad English.
I have a very simple question. I want to construct my own grids. In the process, i stumbled upon this problem: I wanted to have two adjacent cells in two dimenson, one very "wide" and one very "large", so that i can do some testing with anisotropic refinement. So i made by following the (very nice) tutorials this very simple grid:
void adapt_grid_spiel()
{
Triangulation<2> triangulation;
static const Point<2> vertices_1[] = {
Point<2> (0,0),
Point<2> (10,0),
Point<2> (12,0),
Point<2> (13,18),
Point<2> (10,2),
Point<2> (0,2)
};
const unsigned int n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
const std::vector<Point<2>> vertices (&vertices_1[0],&vertices_1[n_vertices]);
static const int cell_vertices[][GeometryInfo<2>::vertices_per_cell] =
{
{0,5,4,1},{1,2,3,4}
};
std::vector<CellData<2>> cells(2, CellData<2>());
for (unsigned int i=0; i<2; ++i)
{
for(unsigned int j =0;j<GeometryInfo<2>::vertices_per_cell; ++j)
cells[i].vertices[j] = cell_vertices[i][j];
}
triangulation.create_triangulation(vertices,cells,SubCellData());
std::ofstream out ("grid-3.eps");
GridOut grid_out;
grid_out.write_eps (triangulation, out);
std::cout << "Grid written to grid-3.eps.\n";
}
If i run this, i get the following picture. In every other grid, i created manually by selecting vertices and cells, i had no crossing faces (lines). I can't find my mistake.
I would be very glad, if somebody could help me. :)
With kind regards,
Felix Hagemann