Skip to content

PETSC Laplacian Boundary condition #3442

Description

@totork

Hi all!

I am currently fighting with some simulations that include laplace inversions with PETSC, specifically with frequent inversion fails when I want to run with the inner flag 2 (no local gradient) and the outer flag 16 (setting from value). I tried to look a little bit through the code and found the following code

// Set boundary conditions
if (!isInnerBoundaryFlagSet(INVERT_RHS)) {
BOUT_FOR_SERIAL(index, indexer->getRegionInnerX()) {
rhs(index) = isInnerBoundaryFlagSet(INVERT_SET) ? x0[index] : 0.0;
}
}
if (!isOuterBoundaryFlagSet(INVERT_RHS)) {
BOUT_FOR_SERIAL(index, indexer->getRegionOuterX()) {
rhs(index) = isInnerBoundaryFlagSet(INVERT_SET) ? x0[index] : 0.0;
}
}

Does this work as intended? I have to look a little bit more through the code to understand if there is a reason for this, but I found it counter-intuitive that i check the inner boundary when setting the outer boundary

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions