Skip to content

ENH: Don't shift horizontal coordinates by default while draping electrodes #1750

Open

Description

@santisoler

The issue

Currently the shift_to_discrete_topography and the Survey.drape_electrodes_on_topography shift the horizontal coordinates of the electrodes to to cell centers by default.

This could cause some issues, specially if the users carefully designed their mesh (or survey) so the electrodes fall above nodes in the mesh. For example, in this post: Asymmetry in apparent chargeability pseudosection, where the asymmetry wasn't coming from any bug in the simulation, but from the fact that the electrodes were shifted horizontally and users might not notice that.

Is there any benefit on shifting horizontal coordinates of the electrodes by default?

Idea

So, what if we change the default value of shift_horizontal from True to False?

If we decide to do so, we should raise a warning (like a BreakingChangeWarning) to let users know of this change in behaviour.

Activity

  1. santisoler commented on Feb 2, 2026

    @santisoler
    MemberAuthor
  2. dccowan commented on Feb 2, 2026

    @dccowan
    Member

    Some things to consider:

    • What we are really trying to avoid are cases where electrodes end up on nodes with corners almost completely exposed to air cells.
    • The current default is probably the most reliable for ensuring success amongst SimPEG's user base, considering there is a wide range of proficiency in numerical modeling.
    • I would suggest that when using this functionality, there is a print out that tells the user what was shifted.
    • The instructions provided in the comprehensive tutorials for DC/IP could be updated if we feel more details would be useful.

    Ultimately, I would advise changing the default value to cater to a less common situation.

  3. dccowan commented on Apr 15, 2026

    @dccowan
    Member

    @santisoler do we want to close this issue?

  4. santisoler commented on Apr 16, 2026

    @santisoler
    MemberAuthor

    Sorry for dropping the ball on this one.

    Ultimately, I would advise changing the default value to cater to a less common situation.

    I agree on this one in the general case. Nonetheless, I still don't see a clear benefit of shifting the horizontal coordinates by default.

    What we are really trying to avoid are cases where electrodes end up on nodes with corners almost completely exposed to air cells.

    If we shift only the vertical coordinate to cell centers, then no electrode will end up in a node. For example:

    Image

    If there's no clear benefit of shifting them horizontally, I'd also advise to choose the simpler modification of the survey (shifting just the vertical coordinate). On the other hand, this might end up with electrodes on faces or edges. I'm not 100% sure if that could be a problem.

    On a broader subject, during one of the SimPEG meetings in February, @jcapriot, @lheagy and I discussed about best approaches to shift electrodes based on the type of simulation (nodal, cell centered) and its formulation. Maybe we could bring this subject up in a next meeting.

  5. dccowan commented on Aug 27, 2026

    @dccowan
    Member

    I think we added all the desired options to the shift_to_discrete_topography functionality. Close this issue?

  6. santisoler commented on Sep 4, 2026

    @santisoler
    MemberAuthor

    Just to clarify, the shift_to_discrete_topogrpahy still shifts the horizontal coordinates by default.

    But yes, I'm closing this issue since there are several reasons why leaving that behavior as default is probably the best decision.

  7. jcapriot commented on Nov 14, 2026

    @jcapriot
    Member

    Re-opening this one, since it came up again in #1840 (where the shift was also putting some electrodes off of the discrete surface on tree meshes, and on tensor meshes with uneven widths).

    I'm not sold on shift_horizontal=True as the default either. I think what we really want depends on the formulation:

    • For the nodal simulations the potential lives on nodes that already sit on the discrete surface, so the electrodes can just be draped straight down (topo_cell_cutoff="top", shift_horizontal=False).
    • For the cell centered simulations, drape them straight down, then shift them "inwards" by half the vertical size of the cell they sit over (topo_cell_cutoff="center", shift_horizontal=False). If that leaves an electrode next to an exposed side or corner of the discrete surface (at a step, where the neighboring cell at that elevation is air), also shift it inwards by half the horizontal width of its cell, so its interpolation doesn't reach into the air cells. That avoids the electrodes on corners exposed to air that Devin brought up, without moving every electrode.

    So I'd propose we add that inward shift to shift_to_discrete_topography, have drape_electrodes_on_topography pick the drape for the formulation (a formulation argument is probably the simplest, since the survey doesn't know its simulation), and change the default with a BreakingChangeWarning first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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