Hello,
I would like to create a mesh containing several "hyper_cube_with_cylindrical_hole".
I studied tutorial 49 and tried the following:
void CellProb::make_grid ()
{
Triangulation<2> tria1;
GridGenerator::hyper_cube_with_cylindrical_hole (tria1, 0.25, 1.0);
Triangulation<2> tria3;
GridGenerator::hyper_cube_with_cylindrical_hole (tria3, 0.25, 1.0);
GridTools::shift (Point<2>(0,-2), tria3);
Triangulation<2> triangulation2;
GridGenerator::merge_triangulations (tria1, tria3, triangulation2);
mesh_info(triangulation2, "grid-2.eps");
std::cout << "Number of active cells: "
<< triangulation.n_active_cells()
<< std::endl;
std::cout << "Total number of cells: "
<< triangulation.n_cells()
<< std::endl;
}
but I get the following report:
============================ Remaking Makefile.dep
==============debug========= cell.cc -> cell.g.o
============================ Linking cell
============================ Running cell
terminate called after throwing an instance of 'dealii::internal::Triangulation::ExcGridHasInvalidCell'
what(): --------------------------------------------------------
An error occurred in line <1672> of file </usr/local_rwth/sw/deal.II/deal.II-7.3.0/source/grid/tria.cc> in function
static void dealii::internal::Triangulation::Implementation::create_triangulation(const std::vector<dealii::Point<spacedim, double>, std::allocator<dealii::Point<spacedim, double>>> &, const std::vector<dealii::CellData<2>, std::allocator<dealii::CellData<2>>> &, const dealii::SubCellData &, dealii::Triangulation<2, spacedim> &) [with spacedim = 2]
The violated condition was:
needed_lines.find(std::make_pair(line_vertices.second, line_vertices.first)) == needed_lines.end()
The name and call sequence of the exception was:
ExcGridHasInvalidCell(cell)
Additional Information:
Something went wrong when making cell 9. Read the docs and the source code for more information.
--------------------------------------------------------
make: *** [run] Aborted (core dumped)
I played around with the shift function but nothing helped.
Is there a function I missed?
My second question:
I tried grid_2 (from tutorial 49) with the simple version of Poisson's equation and I get the following:
============================ Remaking Makefile.dep
==============debug========= cell.cc -> cell.g.o
============================ Linking cell
============================ Running cell
Mesh info:
dimension: 2
no. of cells: 224
boundary indicators: 0(88 times)
written to grid-2.eps
Number of active cells: 224
Total number of cells: 294
--------------------------------------------------------
An error occurred in line <230> of file </usr/local_rwth/sw/deal.II/deal.II-7.3.0/source/dofs/dof_handler_policy.cc> in function
static unsigned int dealii::internal::DoFHandler::Policy::Implementation::distribute_dofs(unsigned int, unsigned int, dealii::DoFHandler<dim, spacedim> &) [with dim = 2, spacedim = 2]
The violated condition was:
tria.n_levels() > 0
The name and call sequence of the exception was:
ExcMessage("Empty triangulation")
Additional Information:
Empty triangulation
Stacktrace:
-----------
#0 /usr/local_rwth/sw/deal.II/deal.II-7.3.0/lib/libdeal_II.g.so.7.3.0: unsigned int dealii::internal::DoFHandler::Policy::Implementation::distribute_dofs<2, 2>(unsigned int, unsigned int, dealii::DoFHandler<2, 2>&)
#1 /usr/local_rwth/sw/deal.II/deal.II-7.3.0/lib/libdeal_II.g.so.7.3.0: dealii::internal::DoFHandler::Policy::Sequential<2, 2>::distribute_dofs(dealii::DoFHandler<2, 2>&) const
#2 /usr/local_rwth/sw/deal.II/deal.II-7.3.0/lib/libdeal_II.g.so.7.3.0: dealii::DoFHandler<2, 2>::distribute_dofs(dealii::FiniteElement<2, 2> const&)
#3 ./cell: CellProb::setup_system()
#4 ./cell: CellProb::run()
#5 ./cell: main
--------------------------------------------------------
make: *** [run] Aborted (core dumped)
Why is the triangulation empty?
I called "triangulation.refine_global (2)" because the documentation says "since it will most likely be repopulated soon by the next refinement process", but it did not help.
Thank you a lot,
Val