My BoundaryValues-function looks like
template <int dim>
    class BoundaryValues : public Function<dim>
    {
        public:
            BoundaryValues () : Function<dim>() {}

            virtual double value (const Point<dim>   &p,
                                  const unsigned int  component = 0) const;
    };


    template <int dim>
    double BoundaryValues<dim>::value (const Point<dim> &p,
                                       const unsigned int /*component*/) 
const
    {
        return std::sin(2 * numbers::PI * (p[0]+p[1])) + OFFSET;
    }

Thus I do not think that that is the problem. Assembly of the matrix and 
the residual is done using a second constraint matrix called 
"newton_constraints", defined as 
newton_constraints.clear();
        newton_constraints.reinit(solution_relevant_partitioning);
        DoFTools::make_hanging_node_constraints(dof_handler, 
newton_constraints);
        VectorTools::interpolate_boundary_values(dof_handler, 0, 
ZeroFunction<dim>(), newton_constraints);
        newton_constraints.close();
in the following way:
newton_constraints.distribute_local_to_global(cell_residual, 
local_dof_indices, local_residual);
or
newton_constraints.distribute_local_to_global(cell_matrix, cell_rhs, 
local_dof_indices, system_matrix, system_rhs);

in order to keep the zero boundary conditions for the newton update. 



Am Dienstag, 26. September 2017 03:15:47 UTC+2 schrieb Wolfgang Bangerth:
>
> On 09/25/2017 01:25 PM, 'Maxi Miller' via deal.II User Group wrote: 
> > 
> > I do not understand the reason why that happens. Is it a mathematical 
> > problem? Or rather a problem in my code? Afaik the gradients should not 
> > depend on the offset, thus I do not know where to look for the problem 
> here. 
>
> Did you adjust the boundary values in the same way as the initial 
> values? Because if you don't, your initial guess will have a sharp 
> boundary layer where it drops from OFFSET to zero, and that leads to a 
> very large non-linearity. 
>
> Best 
>   W. 
>
> -- 
> ------------------------------------------------------------------------ 
> Wolfgang Bangerth          email:                 [email protected] 
> <javascript:> 
>                             www: http://www.math.colostate.edu/~bangerth/ 
>

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to