You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ENH: Don't shift horizontal coordinates by default while draping electrodes #1750
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.
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.
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:
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.
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.
Activity
santisoler commentedon Feb 2, 2026
cc @dccowan
dccowan commentedon Feb 2, 2026
Some things to consider:
Ultimately, I would advise changing the default value to cater to a less common situation.
dccowan commentedon Apr 15, 2026
@santisoler do we want to close this issue?
santisoler commentedon Apr 16, 2026
Sorry for dropping the ball on this one.
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.
If we shift only the vertical coordinate to cell centers, then no electrode will end up in a node. For example:
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.
dccowan commentedon Aug 27, 2026
I think we added all the desired options to the shift_to_discrete_topography functionality. Close this issue?
santisoler commentedon Sep 4, 2026
Just to clarify, the
shift_to_discrete_topogrpahystill 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.
jcapriot commentedon Nov 14, 2026
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=Trueas the default either. I think what we really want depends on the formulation:topo_cell_cutoff="top",shift_horizontal=False).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, havedrape_electrodes_on_topographypick the drape for the formulation (aformulationargument is probably the simplest, since the survey doesn't know its simulation), and change the default with aBreakingChangeWarningfirst.