Hello, it is the first time i am using the GridGenerator and i am trying to create just a single element (3D) and add dirichlet BC on one side.
I did the following: repetitions[0] = 1; repetitions[1] = 1; // Only allow one element through the thickness // (modelling a plane strain condition) if (dim == 3) repetitions[dim-1] = 1; const Point<dim> bottom_left = (dim == 3 ? Point<dim>(0.0, 0.0, -0.5) : Point<dim>(0.0, 0.0)); const Point<dim> top_right = (dim == 3 ? Point<dim>(1.0, 1.0, 0.5) : Point<dim>(1.0, 1.0)); GridIn<dim> grid_in; grid_in.attach_triangulation(triangulation); GridGenerator::subdivided_hyper_rectangle(triangulation, repetitions, bottom_left, top_right,true); and it is working fine. Now i mark the faces to add the boundary conditions: const double tol_boundary = 1e-3; typename Triangulation<dim>::active_cell_iterator cell = triangulation.begin_active(), endc = triangulation.end(); for (; cell != endc; ++cell) for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell; ++face) if (cell->face(face)->at_boundary() == true) { if (std::abs(cell->face(face)->center()[0] - 1.0) < tol_boundary ) cell->face(face)->set_boundary_id(11); // +X faces else if (std::abs(cell->face(face)->center()[1] - 0.0) < tol_boundary) cell->face(face)->set_boundary_id(13); // +Y faces else if (std::abs(cell->face(face)->center()[0] - 0.0) < tol_boundary) cell->face(face)->set_boundary_id(10); // -X faces else if (dim == 3 && std::abs(std::abs(cell->face(face)->center ()[2]) - 0.5) < tol_boundary) cell->face(face)->set_boundary_id(12); // +Z and -Z faces } When i add the BC i cannot see any movement of my element: const int boundary_id1 = 11; VectorTools::interpolate_boundary_values(dof_handler_ref, boundary_id1, ZeroFunction<dim>(n_components ), constraints, fe.component_mask(u_fe)); const int boundary_id = 10; const double delta_u_x = load_rate*time.get_delta_t(); VectorTools::interpolate_boundary_values(dof_handler_ref, boundary_id, ConstantFunction<dim>(- delta_u_x,n_components), constraints, fe.component_mask( x_displacement)); Is there any reason why it is not working ? -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/9a785eb9-381d-44a3-89b0-4e61ccb3d13dn%40googlegroups.com.