Coder Social home page Coder Social logo

Comments (6)

wence- avatar wence- commented on July 25, 2024

I think the problem is that your system is getting really badly conditioned and gmres is losing too much information in the restart. If I run with:

solver_parameters={'ksp_gmres_restart': 200, 'ksp_monitor_singular_value': True}

I get convergence of the largest problem:

L_inf norm: 0.131777047356
L2 norm: 0.131777047355
L_inf norm: 0.146869663844
L2 norm: 0.059711026174
L_inf norm: 0.0389459143339
L2 norm: 0.01596968206
L_inf norm: 0.0107924786456
L2 norm: 0.00426911884399

But PETSc estimates the condition number of the last problem as 6e5, and it takes 5100 iterations to converge (the system has 21000 dofs).

In conclusion, can you build a better PC by using schur complements?

from firedrake.

wence- avatar wence- commented on July 25, 2024

Answer, yes:

   solve(a == L, out, solver_parameters={'pc_type': 'fieldsplit',
                                          'pc_fieldsplit_type': 'schur',
                                          'ksp_type': 'cg',
                                          'pc_fieldsplit_schur_fact_type': 'FULL',
                                          'fieldsplit_0_ksp_type': 'cg',
                                          'fieldsplit_1_ksp_type': 'cg',
                                          'ksp_monitor': True})
    Residual norms for firedrake_snes_0_ solve.
    0 KSP Residual norm 9.416491472343e+00 
    1 KSP Residual norm 1.853245163915e-11 
L_inf norm: 0.131777047356
L2 norm: 0.131777047355
    Residual norms for firedrake_snes_1_ solve.
    0 KSP Residual norm 6.507015022039e+00 
    1 KSP Residual norm 2.674064589955e-12 
L_inf norm: 0.146868545809
L2 norm: 0.0597100588258
    Residual norms for firedrake_snes_2_ solve.
    0 KSP Residual norm 1.592744048817e+01 
    1 KSP Residual norm 3.561132153579e-05 
    2 KSP Residual norm 1.700162704754e-10 
L_inf norm: 0.0389818965915
L2 norm: 0.0159811969722
    Residual norms for firedrake_snes_3_ solve.
    0 KSP Residual norm 4.509605854437e+01 
    1 KSP Residual norm 5.140400988667e-05 
    2 KSP Residual norm 3.452288755060e-10 
L_inf norm: 0.0098520605559
L2 norm: 0.0040541386656

In about 3 seconds.

from firedrake.

wence- avatar wence- commented on July 25, 2024

Is this appropriately addressed?

from firedrake.

dorugeber avatar dorugeber commented on July 25, 2024

i think i'm happy with it now.

from firedrake.

kynan avatar kynan commented on July 25, 2024

What does "happy" mean? Do we get the right answer or not?

from firedrake.

wence- avatar wence- commented on July 25, 2024

This test is in master and passing, hence closing.

from firedrake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.