In 1-D, GridGenerator::hyper_cube(triangulation, -1, 1);
will assign different boundary indicators to left and right side, even though colorize=false is default, see https://dealii.org/developer/doxygen/deal.II/namespaceGridGenerator.html#acea0cbcd68e52ce8113d1134b87de403 <https://dealii.org/developer/doxygen/deal.II/namespaceGridGenerator.html#acea0cbcd68e52ce8113d1134b87de403> I think left=0 and right=1. Due to this reason, bc may not be applied on both sides. Do the apply bc twice, once with indicator=0 and once with indicator=1. std::map<types::global_dof_index, double> boundary_values; VectorTools::interpolate_boundary_values(dof_handler, 0, // left boundary BoundaryValues<dim>(), boundary_values); MatrixTools::apply_boundary_values(boundary_values, system_matrix, solution, system_rhs); VectorTools::interpolate_boundary_values(dof_handler, 1, // right boundary BoundaryValues<dim>(), boundary_values); MatrixTools::apply_boundary_values(boundary_values, system_matrix, solution, system_rhs); Best praveen > On 07-Jun-2020, at 9:50 AM, 'Christoph Kammer' via deal.II User Group > <[email protected]> wrote: > > Hi Deal.ii team, > > I went through tutorial step-4 and I tried to use the solver for Poisson's > problem in 2D and rewrite it for a 1D problem. This is basically step-4 and > setting RHS f =1 and solving for homogeneous BCs. The program is compiling > just fine and executing, however, the solution I am getting from that doesn't > make any sense. The BCs aren't even satisfied at x = 1. > > Could anyone let me know what's going on here? Setting f = 1 and changing > everything to solve for homogeneous BC in 1D seems like a very simple problem. > > Thank you, > > Christoph -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/C66D5394-FFCF-426E-A66F-9F3CA5A0F7B0%40gmail.com.
