restriction

emg3d.solver.restriction(grid, model, sfield, residual, sc_dir)[source]

Downsampling of grid, model, and fields to a coarser grid.

The restriction of the residual is used as source term for the coarse grid.

Corresponds to Equations 8 and 9 in [Muld06] and surrounding text. In the case of the restriction of the residual, this function is a wrapper for the jitted functions emg3d.core.restrict_weights() and emg3d.core.restrict() (@njit can not [yet] access class attributes). See these functions for more details and corresponding theory.

This function is called by multigrid().

Parameters:
grid : emg3d.meshes.TensorMesh

Input grid.

model : emg3d.models.VolumeModel

Input model.

sfield : emg3d.fields.SourceField

Input source field.

sc_dir : int

Direction of semicoarsening (0, 1, 2, or 3).

Returns:
cgrid : emg3d.meshes.TensorMesh

Coarse grid.

cmodel : emg3d.models.VolumeModel

Coarse model.

csfield : emg3d.fields.SourceField

Coarse source field. Corresponds to restriction of fine-grid residual.

cefield : emg3d.fields.Field

Coarse electric field, complex zeroes.