Skip to content

Providing both nullspace and nearnullspace in KSPSolve does not work #371

@echarala

Description

@echarala

In my PDE problem, I do know both nullspaces, one is associated with the U(1) invariance and the other with spatial rotational invariance O(2). At the numerical level, the former is always the case, but the latter depends on the mesh. Ideally, I would like to pass the former in nullspace and the latter in nearnullspace in KSPSolve.

For your convenience, I am attaching a MWE (with input data):

MWE.tar.gz

Upon running the code with -ksp_view -ksp_log options, it prints "has attached near null space", and thus it does not recognize the nullspace input. If I delete the "nearnullspace=Rot" option in the KSPSolve, it prints "has attached null space". If now I add "-ksp_constant_null_space", then it recognizes them both, but in my case I don't have a constant nullspace since it is provided explicitly.

I believe the FreeFEM wrapper in PETSc-code.hpp does not allow to use them both although on the PETSc side this seems to be not prohibitive. Looking at the old post "MatNullSpace -> nullspace #276 " by @cmdoug and @prj- , maybe the issue is there and is a very simple fix?

Many thanks for the help in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions