Hi everyone, Instead of prescribing classical Dirichlet boundary conditions (i.e. the values for the solution field on the boundary) I am trying to impose the values for a specific degree of freedom inside my material. My idea was to iterate over all cells and their faces. Then I use the location of the center of the face to identify the faces, that have the right position. When I loop over all degrees of freedom of the face, I can find the DOFs that correspond to the correct base element, put these into a "boundary_values" vector and then use MatrixTools::apply_boundary_values to apply these values (see the following code snippet).
* typename hp::DoFHandler<dim>::active_cell_iteratorcell = dof_handler.begin_active();for (; cell!=dof_handler.end(); ++cell){ for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f) const Point<dim> face_center = cell->face(f)->center(); if (face_center[2] == 5.0) { cell->face(f)->get_dof_indices(local_dof_indices_face,0); for(unsigned int i = 0; i < dofs_per_face; ++i) { const unsigned int i_group = fe_face.system_to_base_index(i).first.first; if (i_group == V_dof) { boundary_values[local_dof_indices_face[i]]=0; } } }}MatrixTools::apply_boundary_values (boundary_values, system_matrix, locally_relevant_solution_update, system_rhs,false);* Here I try to apply the value for the electric potential (a scalar value, associated with the V_dof) on the middle plane of a cube with the sidelength 10 (i.e. *face_center[2] == 5.0*) This works fine, if the polynomial order of the FE_Q element is 1, however, if I increase the order it seems like the value is not applied to the DOFs between the vertices of the cell (see attached picture). When I apply the boundary conditions on the surfaces using *VectorTools::interpolate_boundary_values *I do not have this issue. Can anyone give me a tip, what might be the problem? Thank you, Markus -- 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/5b935808-c22f-4676-9418-6d7ee30228b9n%40googlegroups.com.