smoothing¶
- emg3d.solver.smoothing(model, sfield, efield, nu, lr_dir)[source]¶
Reducing high-frequency error by smoothing.
Solves the linear equation system \(A x = b\) iteratively using the Gauss-Seidel method. This acts as smoother or, on the coarsest grid, as a direct solver.
This is a simple wrapper for the jitted computation in
emg3d.core.gauss_seidel
,emg3d.core.gauss_seidel_x
,emg3d.core.gauss_seidel_y
, andemg3d.core.gauss_seidel_z
(consult these functions for more details and corresponding theory).The electric fields are updated in-place.
This function is called by
emg3d.solver.multigrid
.- Parameters
- modelVolumeModel
Input model; a
emg3d.models.Model
instance.- sfieldField
Input source field; a
emg3d.fields.Field
instance.- efieldField
Input electric field; a
emg3d.fields.Field
instance.- nuint
Number of Gauss-Seidel steps; odd numbers are forward, even numbers are reversed. E.g.,
nu=2
is one symmetric Gauss-Seidel iteration, with a forward and a backward step.- lr_dirint
Direction of line relaxation.