Dear Daniel, I have applied periodic boundary condition on displacement field for a square 2D domain and in order to apply boundary displacement I want to consider relative displacement between pair faces, namely, u_x (0,y)=u_x(L,y)+delta_x and u_y (x,0)=u_y(x,L)+delta_y , using "constraints.set_inhomogeneity" . I have used the following code for relative displacement between pair faces:
{ IndexSet selected_dofs_x; std::set< types::boundary_id > boundary_ids_x= std::set<types::boundary_id>(); boundary_ids_x.insert(0); DoFTools::extract_boundary_dofs(dof_handler, fe.component_mask(x_displacement), selected_dofs_x, boundary_ids_x); unsigned int nb_dofs_face_x = selected_dofs_x.n_elements(); IndexSet::ElementIterator dofs_x = selected_dofs_x.begin(); double relative_displacement_x; if (timestep <10) relative_displacement_x = -0.1e-9; else relative_displacement_x = -0.01e-9; for(unsigned int i = 0; i < nb_dofs_face_x; i++) { constraints.set_inhomogeneity(*dofs_x, (apply_dirichlet_bc ? relative_displacement_x : 0.0)); dofs_x++; } } { IndexSet selected_dofs_y; std::set< types::boundary_id > boundary_ids_y= std::set<types::boundary_id>(); boundary_ids_y.insert(2); DoFTools::extract_boundary_dofs(dof_handler, fe.component_mask(y_displacement), selected_dofs_y, boundary_ids_y); unsigned int nb_dofs_face_y = selected_dofs_y.n_elements(); IndexSet::ElementIterator dofs_y = selected_dofs_y.begin(); double relative_displacement_y; if (timestep <10) relative_displacement_y = 0.05e-9; else relative_displacement_y = 0.005e-9; for(unsigned int i = 0; i < nb_dofs_face_y; i++) { constraints.set_inhomogeneity(*dofs_y, (apply_dirichlet_bc ? relative_displacement_y : 0.0)); dofs_y++; } } Periodic boundary condition works great without boundary displacement and I can apply boundary displacement without any problem in two conditions : First, considering displacement between only two faces for example left and right faces, second, applying periodicity for only one components of displacement on pair faces, namely, u_x for left and right faces and u_y for top and bottom faces. However, considering periodicity for the both displacement components on pair faces and at the same time, applying both u_x (0,y)=u_x(L,y)+delta_x and u_y (x,0)=u_y(x,L)+delta_y, the corner elements get distorted. In the attached picture you can see what happens. Any hint about the source of error would be appreciated. Thanks, Hamed -- 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. For more options, visit https://groups.google.com/d/optout.