Model¶
-
class
emg3d.models.
Model
(grid, property_x=1.0, property_y=None, property_z=None, mu_r=None, epsilon_r=None, mapping='Resistivity', **kwargs)[source]¶ Bases:
object
Create a model instance.
Class to provide model parameters (x-, y-, and z-directed properties [resistivity or conductivity; linear or on log_10/log_e-scale], electric permittivity and magnetic permeability) to the solver. Relative magnetic permeability \(\mu_\mathrm{r}\) is by default set to one and electric permittivity \(\varepsilon_\mathrm{r}\) is by default set to zero, but they can also be provided (isotropically). Keep in mind that the multigrid method as implemented in emg3d only works for the diffusive approximation. As soon as the displacement-part in the Maxwell’s equations becomes too dominant it will fail (high frequencies or very high electric permittivity).
Parameters: - grid : TensorMesh
Grid on which to apply model.
- property_{x;y;z} : float or ndarray; default to 1.
Material property in x-, y-, and z-directions. If ndarray, they must have the shape of grid.vnC (F-ordered) or grid.nC.
By default, property refers to electrical resistivity. However, this can be changed with an appropriate map. For more info, see the description of the parameter mapping. The internals of emg3d work, irrelevant of the map, with electrical conductivities.
Resistivities and conductivities have to be bigger than zero and smaller than infinity (if provided on a linear scale; not on logarithmic scales).
- mu_r : None, float, or ndarray
Relative magnetic permeability (isotropic). If ndarray it must have the shape of grid.vnC (F-ordered) or grid.nC. Default is None, which corresponds to 1., but avoids the computation of zeta. Magnetic permeability has to be bigger than zero and smaller than infinity.
- epsilon_r : None, float, or ndarray
Relative electric permittivity (isotropic). If ndarray it must have the shape of grid.vnC (F-ordered) or grid.nC. The displacement part is completely neglected (diffusive approximation) if set to None, which is the default. Electric permittivity has to be bigger than zero and smaller than infinity.
- mapping : str
Defines what type the input property_{x;y;z}-values correspond to. By default, they represent resistivities (Ohm.m). The implemented types are:
- ‘Conductivity’; σ (S/m),
- ‘LgConductivity’; log_10(σ),
- ‘LnConductivity’; log_e(σ),
- ‘Resistivity’; ρ (Ohm.m); Default,
- ‘LgResistivity’; log_10(ρ),
- ‘LnResistivity’; log_e(ρ).
Attributes Summary
epsilon_r
Electric permittivity. mu_r
Magnetic permeability. property_x
Property in x-direction. property_y
Property in y-direction. property_z
Property in z-direction. Methods Summary
copy
()Return a copy of the Model. from_dict
(inp)Convert the dictionary into a Model instance. interpolate2grid
(grid, new_grid, …)Interpolate Model located on grid to new_grid. to_dict
([copy])Store the necessary information of the Model in a dict. Attributes Documentation
-
epsilon_r
¶ Electric permittivity.
-
mu_r
¶ Magnetic permeability.
-
property_x
¶ Property in x-direction.
-
property_y
¶ Property in y-direction.
-
property_z
¶ Property in z-direction.
Methods Documentation
-
classmethod
from_dict
(inp)[source]¶ Convert the dictionary into a Model instance.
Parameters: - inp : dict
Dictionary as obtained from
Model.to_dict()
. The dictionary needs the keys property_x, property_y, property_z, mu_r, epsilon_r, vnC, and mapping.
Returns: - obj :
Model
instance
-
interpolate2grid
(grid, new_grid, **grid2grid_opts)[source]¶ Interpolate Model located on grid to new_grid.
Parameters: - grid, new_grid : TensorMesh
Input and output model grids;
emg3d.meshes.TensorMesh
instances.- grid2grid_opts : dict
Passed through to
maps.grid2grid()
. Defaults are method=’volume’, log=True, and extrapolate=True.
Returns: - NewModel : Model
New
Model
instance on new_grid.