Hello,

please correct me, if I am wrong:

If you take a look at step-25:
The part

       double initial_rhs_norm = 0.;
       bool first_iteration = true;
       do
         {
           assemble_system ();
 
           if (first_iteration == true)
             initial_rhs_norm = system_rhs.l2_norm();
 
           const unsigned int n_iterations
             = solve ();
 
           solution += solution_update;
 
           if (first_iteration == true)
             std::cout << "    " << n_iterations;
           else
             std::cout << '+' << n_iterations;
           first_iteration = false;
         }
       while (system_rhs.l2_norm() > 1e-6 * initial_rhs_norm);
 
       std::cout << " CG iterations per nonlinear step."
                 << std::endl;

in the void SineGordonEquation::run
should be what you are searching for.

But your assemble_system, compute_nl_term and compute_nl_matrix look
different (actually you could use the implemented compute_nl_* with
theta=1, but you would have a useless old_solution bothering your
processor - but you can modify them), because the discretization now
reads (in the case of homogeneous neumann boundary conditions):
F_h(U^l)  = A U^l + S(u^l) = -rhs for newton step
F_h'(U^l) = A + N (u^l) = system matrix for newton step

where A_{ij}=-(\nabla \varphi_i, \nabla \varphi_j)_{\Omega}
 S_j(u^l) = (sin(u^l), \varphi_j)_{\Omega}
 N_j(u^l) = (cos(u^l), \varphi_j)_{\Omega}

If I may comment one more thing: If you are not interested in them,
beware of the spatially homogeneous solutions if you have homogeneous
neumann boundary conditions or the one spatially homogeneous solution if
you have homogeneous dirichlet boundary conditions.

Cheers,
Steffen

Am Dienstag, den 11.01.2011, 18:30 +0200 schrieb [email protected]:
> Dear all,
> 
> I'm trying to solve the *time-independent* 2D sine-Gordon equation (u_{xx} +
> u_{yy} - sin(u) = 0) using deal.II. Is anybody aware of any implementation
> existing, or perhaps any other elliptic semilinear PDE, or even a Newton 
> method
> implementation for elliptic non-linear PDEs?
> 
> Please note that I'm aware of tutorial 25 which solves the sine-Gordon 
> equation,
> however, it solves the *time-dependent* one and I can't see how I can make use
> of it.
> 
> Thanks in advance.
> _______________________________________________
> dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii


_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to