How to implemente the Neumann bc for laplacian

128 views
Skip to first unread message

ztdep...@gmail.com

unread,
Aug 23, 2022, 9:54:19 AM8/23/22
to deal.II User Group
In step 3 , I want to implemente the Neumann bc for all the boundary condition. which tutorial show this procedure.

Marco Feder

unread,
Aug 23, 2022, 12:54:24 PM8/23/22
to deal.II User Group

Hi,

step-7 (https://www.dealii.org/current/doxygen/deal.II/step_7.html) shows this procedure. Be careful that if you apply Neumann BCs on all your boundary, then the solution is determined up to a constant and you need to add an additional constraint to your solution. Also, you need to satisfy a compatibility condition between the r.h.s. and the neumann data.

Best,
Marco

Marco Feder

unread,
Aug 23, 2022, 12:56:59 PM8/23/22
to deal.II User Group
Actually, it turns out there's a tutorial program doing precisely what you are looking for: step-11 (https://www.dealii.org/developer/doxygen/deal.II/step_11.html)

Best,
Marco

ztdep...@gmail.com

unread,
Aug 26, 2022, 7:48:41 AM8/26/22
to deal.II User Group
    it seems I cann't get a converged solution . which Solver  should i use to treat this situation?The error message is as follows .


   This error message can indicate that you have simply not allowed a
    sufficiently large number of iterations for your iterative solver to
    converge. This often happens when you increase the size of your
    problem. In such cases, the last residual will likely still be very
    small, and you can make the error go away by increasing the allowed
    number of iterations when setting up the SolverControl object that
    determines the maximal number of iterations you allow.
   
    The other situation where this error may occur is when your matrix is
    not invertible (e.g., your matrix has a null-space), or if you try to
    apply the wrong solver to a matrix (e.g., using CG for a matrix that
    is not symmetric or not positive definite). In these cases, the
    residual in the last iteration is likely going to be large.


Marco Feder

unread,
Aug 26, 2022, 8:01:11 AM8/26/22
to dea...@googlegroups.com
What are the data (rhs, Neumann condition,...) of your problem ?
What is the value of the residual ?

Best,
Marco

--
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 a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/0KK8UDeFgRg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/8262a85f-01b0-4b9e-b1f8-ee5a0b3361b3n%40googlegroups.com.

ztdep...@gmail.com

unread,
Aug 26, 2022, 8:42:34 AM8/26/22
to deal.II User Group
I solve Laplacian problem with "-0.5*std::exp(-2.0*0.963740544195800*p(0))" as exact solution, I apply Neumaan bc on all 4 boundaries. 
the solver feedback the error. no solution is obtained. 

Marco Feder

unread,
Aug 26, 2022, 11:04:27 AM8/26/22
to dea...@googlegroups.com
With your u(x,y) you get as (manufactured) rhs:

f(x,y) \approx 1.8 e^(-1.9 x)

I don’t think that with these data your condition

\int_\Omega f + \int_{\partial \Omega} \partial_n u = 0

is satisfied.


Best,
Marco

Wolfgang Bangerth

unread,
Aug 26, 2022, 11:49:08 AM8/26/22
to dea...@googlegroups.com
On 8/26/22 06:42, ztdep...@gmail.com wrote:
> I solve Laplacian problem with
> "-0.5*std::exp(-2.0*0.963740544195800*p(0))" as exact solution, I apply
> Neumaan bc on all 4 boundaries.

As someone noted earlier in this thread, the Laplace problem with *only*
Neumann boundary conditions does not have a unique solution: If u(x,y)
is a solution, then u(x,y)+c is also a solution for any constant c. You
shouldn't expect the solver to provide you with a solution.

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/
Reply all
Reply to author
Forward
0 new messages