template void ElastoDynamics::make_grid() { uint n_x, n_y, n_z; // Both preconfigured cases consist of a rectangle Point point_bottom; Point point_tip; // boundary IDs are obtained through colorize = true uint id_flap_long_bottom; uint id_flap_long_top; uint id_flap_short_bottom; uint id_flap_short_top; uint id_flap_out_of_plane_bottom; uint id_flap_out_of_plane_top; // Hron & Turek FSI3 case if (parameters.scenario == "FSI3") { // FSI 3 n_x = 4; n_y = 16; n_z = 24; point_bottom = dim == 3 ? Point(0.5, 0.0, -0.3) : Point(0.24899, 0.19); point_tip = dim == 3 ? Point(0.52, 0.35, 0.3) : Point(0.6, 0.21); // IDs for FSI3 id_flap_long_bottom = 0; // x direction id_flap_long_top = 1; id_flap_short_bottom = 2; // y direction id_flap_short_top = 3; } else { // Flap_perp case n_x = 3; n_y = 36; n_z = dim == 3 ? 36 :1; point_bottom = dim == 3 ? Point(-0.05, 0, -1) : Point(-0.05, 0); point_tip = dim == 3 ? Point(0.05, 4, 1) : Point(0.05, 1); // IDs for PF id_flap_long_bottom = 0; // x direction id_flap_long_top = 1; id_flap_short_bottom = 2; // y direction id_flap_short_top = 3; } // Same for both scenarios, only relevant for quasi-2D id_flap_out_of_plane_bottom = 4; // z direction id_flap_out_of_plane_top = 5; // Vector of dim values denoting the number of cells to generate in that // direction const std::vector repetitions = dim == 2 ? std::vector({n_x, n_y}) : std::vector({n_x, n_y, n_z}); GridGenerator::subdivided_hyper_rectangle ( triangulation, repetitions, point_bottom, point_tip, true ); // Refine all cells global_refinement times const unsigned int global_refinement = 0; triangulation.refine_global(global_refinement); // Set the desired IDs for clamped boundaries and out_of_plane clamped // boundaries. The interface ID (refering to the coupling) is specified in // the Constructor, since it is needed by the Constructor of the Adapter // class. clamped_mesh_id = 0; out_of_plane_clamped_mesh_id = 4; // The IDs must not be the same: std::string error_message ( "The interface_id cannot be the same as the clamped one" ); AssertThrow ( clamped_mesh_id != interface_boundary_id, ExcMessage(error_message) ); AssertThrow ( out_of_plane_clamped_mesh_id != interface_boundary_id, ExcMessage(error_message) ); AssertThrow ( interface_boundary_id == adapter.deal_boundary_interface_id, ExcMessage("Wrong interface ID in the Adapter specified") ); // Iterate over all cells and set the IDs for (const auto &cell : triangulation.active_cell_iterators()) { for (const auto &face : cell->face_iterators()) { if (face->at_boundary() == true) { if ( face->boundary_id() == id_flap_short_top || face->boundary_id() == id_flap_long_bottom || face->boundary_id() == id_flap_long_top // fully immersed 3d flap || face->boundary_id() == id_flap_out_of_plane_bottom || face->boundary_id() == id_flap_out_of_plane_top ) { // Boundaries for the interface face->set_boundary_id(interface_boundary_id); } else if ( face->boundary_id() == id_flap_short_bottom ) { // Boundaries clamped in all directions face->set_boundary_id(clamped_mesh_id); } } } } }