get_source_field¶
-
emg3d.fields.
get_source_field
(grid, src, freq, strength=0, msrc=False, length=1.0, decimals=6)[source]¶ Return the source field.
The source field is given in Equation 2 in [Muld06],
\[s \mu_0 \mathbf{J}_\mathrm{s} ,\]where \(s = \mathrm{i} \omega\). Either finite length dipoles, infinitesimal small point dipoles, or arbitrarily shaped segments can be defined, whereas the returned source field corresponds to a normalized (1 Am) source distributed within the cell(s) it resides (can be changed with the strength-parameter).
The adjoint of the trilinear interpolation is used to distribute the point(s) to the grid edges, which corresponds to the discretization of a Dirac ([PlDM07]).
Parameters: - grid : TensorMesh
Model grid; a
emg3d.meshes.TensorMesh
instance.- src : list of floats
Source coordinates (m). There are three formats:
- Finite length dipole:
[x0, x1, y0, y1, z0, z1]
. - Point dipole:
[x, y, z, azimuth, dip]
. - Arbitrarily shaped source:
[[x-coo], [y-coo], [z-coo]]
.
Point dipoles will be converted internally to finite length dipoles of
length
. In the case of a point dipole one can setmsrc=True
, which will create a square loop oflength``x``length
perpendicular to the dipole.- Finite length dipole:
- freq : float
Source frequency (Hz), used to compute the Laplace parameter s. Either positive or negative:
- freq > 0: Frequency domain, hence \(s = -\mathrm{i}\omega = -2\mathrm{i}\pi f\) (complex);
- freq < 0: Laplace domain, hence \(s = f\) (real).
- strength : float or complex, optional
Source strength (A):
- If 0, output is normalized to a source of 1 m length, and source strength of 1 A.
- If != 0, output is returned for given source length and strength.
Default is 0.
- msrc : bool, optional
Shortcut to create a magnetic source. If True, the format of
src
must be that of a point dipole:[x, y, z, azimuth, dip]
(for the other formats settingmsrc
has no effect). It then creates a square loop perpendicular to this dipole, with side-length 1.- length : float, optional
Length (m) of the point dipole when converted to a finite length dipole, or edge-length (m) of the square loop if
msrc=True
. Default is 1.0.- decimals: int, optional
Grid nodes and source coordinates are rounded to given number of decimals. Default is 6 (micrometer).
Returns: - sfield :
SourceField()
instance Source field, normalized to 1 A m.