TensorMesh#
- class emg3d.meshes.TensorMesh(h, origin=None, **kwargs)[source]#
Bases:
discretize.tensor_mesh.TensorMesh
A slightly modified version of
discretize.TensorMesh
.Adds a few custom attributes (
__eq__
,copy
, and{to;from}_dict
) todiscretize.TensorMesh
.It falls back to a minimal
emg3d.meshes.BaseMesh
if discretize is not installed. Nothing fancy is possible with the minimal TensorMesh, particularly no plotting.- Parameters
- h[array_like, array_like, array_like]
Cell widths in x, y, and z directions.
- originarray_like
Origin (x, y, z).
Methods Summary
copy
()Return a copy of the TensorMesh.
from_dict
(inp)Convert dictionary into
emg3d.meshes.TensorMesh
instance.to_dict
([copy])Store the necessary information in a dict for serialization.
Methods Documentation
- classmethod from_dict(inp)[source]#
Convert dictionary into
emg3d.meshes.TensorMesh
instance.- Parameters
- inpdict
Dictionary as obtained from
emg3d.meshes.TensorMesh.to_dict
. The dictionary needs the keyshx
,hy
,hz
, andorigin
.
- Returns
- meshTensorMesh
A
emg3d.meshes.TensorMesh
instance.