Hi all, I want to solve a 2D linear elastic problem with a Dirichlet boundary condition that keeps only one node fixed. And I encountered convergence problem by modifying codes in step-8 as following:
In the setup_system() function, I used the "add_line" functions to contrain dof 0 and dof 1 to zero: ---------------------------------------------- hanging_node_constraints.clear(); DoFTools::make_hanging_node_constraints(dof_handler, hanging_node_constraints); hanging_node_constraints.add_line(0); hanging_node_constraints.add_line(1); hanging_node_constraints.close(); ---------------------------------------------- In my case there is actually no hanging nodes (I used a 4*4 mesh without refinement in this test). And I commented the codes in assemble_system() that applies Dirichlet b.c. (I just want to fix one node) as: ---------------------------------------------- // std::map<types::global_dof_index, double> boundary_values; // VectorTools::interpolate_boundary_values(dof_handler, 0, ZeroFunction<dim>(dim), boundary_values); // MatrixTools::apply_boundary_values(boundary_values, system_matrix, solution, system_rhs); ---------------------------------------------- By modifying with above codes, the cg solver does not converge. I guess this may be caused by the way the constraints are applied. *Actually I just want to apply the Dirichlet b.c. on one node with the same commend as "VectorTools::interpolate_boundary_values(dof_handler, 0, ZeroFunction<dim>(dim), boundary_values);", but this **function only supports interpolation on basis of boundary id instead of specific dofs or nodes.* *So is there a way to apply Dirichlet b.c. on one node (I mean in form of natural boundary condition instead of constrains)?* Many thanks in advance! Best, Pai -- 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.