Skip to content

[BUG] - Sign mismatch between docstrings and implementation in SNES_Poisson and SNES_Darcy #214

@jcgraciosa

Description

@jcgraciosa

These are minor bugs, but may be confusing to users due to mismatches between documentation and code behaviour.

Bug 1 — SNES_Poisson docstring: wrong sign

The class docstring states:

∇·[κ∇u] = f

But the code comment below (line 218 of solvers.py) says:

# For the Poisson equation: -∇·(k∇u) = f

Numerical tests also confirm that this code comment is correct.

Bug 2 — SNES_Darcy / DarcyFlowModel: v_Field sign

The SNES_Darcy docstring states:

v = κ∇h − s

The DarcyFlowModel docstring states:

q_i = κ_ij (∂p/∂x_j − s_j)

But in solvers.py, the projected velocity is set as:

self._v_projector.uw_function = -self.darcy_flux

so the actual v_Field = −κ·(∇h − s) has opposite sign to both docstrings.

  • What version code?
    Latest development branch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions