Releases: emsig/emg3d
Fourier
-
New routine:
emg3d.utils.Fourier
, a class to handle Fourier-transform related stuff for time-domain modelling. See the example notebooks for its usage.
-
Utilities:
Fields
and returned receiver-arrays (EMArray
) both have amplitude (.amp
) and phase (.pha
) attributes.Fields
have attributes containing frequency-information (freq
,smu0
).- New class
SourceField
; a subclass ofField
, addingvector
andv{x,y,z}
attributes for the real valued source vectors. - The
Model
is not frequency-dependent any longer and does NOT take afreq
-parameter any more (currently it still takes it, but it is deprecated and will be removed in the future). data_write
automatically removes_vol
fromTensorMesh
instances and_eta_{x,y,z}
,_zeta
fromModel
instances. This makes the archives smaller, and they are not required, as they are simply reconstructed if needed.
-
Internal changes:
- The multigrid method, as implemented, only works for the diffusive approximation. Nevertheless, we always used
\sigma-i\omega\epsilon
, hence a complex number. This is now changed and\epsilon
set to 0,
leaving only\sigma
. - Change time convention from
exp(-iwt)
toexp(iwt)
, as used inempymod
and commonly in CSEM. Removed the parameterconjugate
from the solver, to simplify. - Change own private class variables from
__
to_
. res
andmu_r
are now checked to ensure they are >0;freq
is checked to ensure !=0.
- The multigrid method, as implemented, only works for the diffusive approximation. Nevertheless, we always used
-
New dependencies and maintenance:
empymod
is a new dependency.- Travis now checks all the url's in the documentation, so there should be no
broken links down the road. (Check is allowed to fail, it is visual QC.)
-
Bugfixes:
- Fixes to the
setuptools_scm
-implementation (MANIFEST.in
).
- Fixes to the
setuptools_scm
- Implement
setuptools_scm
for versioning (adds git hashes for dev-versions).
Laplace
-
Laplace-domain calculation: By providing a negative
freq
-value toutils.get_source_field
andutils.Model
, the calculation is carried out in the real Laplace domains = freq
instead of the complex frequency
domains = 2i*pi*freq
. -
New meshing helper routines (particularly useful for transient modelling where frequency-dependent/adaptive meshes are inevitable):
utils.get_hx_h0
to get cell widths and origin for given parameters including a few fixed interfaces (center plus two, e.g. top anomaly, sea-floor, and sea-surface).utils.get_cell_numbers
to get good values of number of cells for given primes.
-
Speed-up
njitted.volume_average
significantly thanks to @jcapriot. -
Bugfixes and other minor things:
- Abort if l2-norm is NaN (only works for MG).
- Workaround for the case where a
sslsolver
is used together with a provided initialefield
. - Changed parameter
rho
tores
for consistency reasons inutils.get_domain
. - Changed parameter
h_min
tomin_width
for consistency reasons inutils.get_stretched_h
.
JOSS article
- Version of the JOSS article, https://doi.org/10.21105/joss.01463 .
- New function
utils.grid2grid
to move from one grid to another. Both functions (utils.get_receiver
andutils.grid2grid
) can be used for fields and model parameters (with or without extrapolation). They are very similar, the former taking coordinates (x, y, z) as new points, the latter one another TensorMesh instance. - New jitted function
njitted.volume_average
for interpolation using the volume-average technique. - New parameter
conjugate
insolver.solver
to permit both Fourier transform conventions. - Added
exit_status
andexit_message
toinfo_dict
. - Add section
Related ecosystem
to documentation.
H-field
-
New routines:
utils.get_h_field
: Small routine to calculate the magnetic field from the electric field using Faraday's law.utils.get_receiver
: Small wrapper to interpolate a field at receiver positions. Added 3D spline interpolation; is the new default.
-
Re-implemented the possibility to define isotropic magnetic permeabilities in
utils.Model
. Magnetic permeability is not tri-axially included in the solver currently; however, it would not be too difficult to include if there is a need. -
CPU-graph added on top of RAM-graph.
-
Expand
utils.Field
to work with pickle/shelve. -
Jit
np.linalg.norm
(njitted.l2norm
). -
Use
scooby
(soft dependency) for versioning, renameVersion
toReport
(backwards incompatible). -
Bug fixes:
- Small bugfix introduced in ebd2c9d:
sc_cycle
andlr_cycle
was not updated any longer at the end of a cycle (only affectedsslsolver=True
. - Small bugfix in
utils.get_hx
.
- Small bugfix introduced in ebd2c9d:
CPU & RAM
Further speed and memory improvements:
-
Add CPU & RAM-page to documentation.
-
Change loop-order from x-z-y to z-x-y in Gauss-Seidel smoothing with line relaxation in y-direction. Hence reversed lexicographical order. This results in a significant speed-up, as x is the fastest changing axis.
-
Move total residual calculation from
solver.residual
intonjitted.amat_x
. -
Simplifications in
utils
:- Simplify
utils.get_source_field
. - Simplify
utils.Model
. - Removed unused timing-stuff from early development.
- Simplify
Memory
RegularGridInterpolator
- Replace
scipy.interpolate.RegularGridInterpolator
with a custom tailored version of it (solver.RegularGridProlongator
); results in twice as fast prolongation. - Simplify the fine-grid calculation in
prolongation
without usinggridE*
; memory friendlier. - Submission to JOSS.
- Add Multi-what?-page to documentation.
- Some major refactoring, particularly in
solver
. - Removed
discretize
as hard dependency. - Rename
rdir
andldir
(and relatedp*dir
;*cycle
) to the more descriptivesc_dir
andlr_dir
.
Accepts any grid size
- First open-source version.
- Include RTD, Travis, Coveralls, Codacy, and Zenodo. No benchmarks yet.
- Accepts now any grid size (warns if a bad grid size for MG is provided).
- Coarsens now to the lowest level of each dimension, not only to the coarsest level of the smallest dimension.
- Combined
restrict_rx
,restrict_ry
, andrestrict_rz
torestrict
. - Improve speed by passing pre-allocated arrays to jitted functions.
- Store
res_y
,res_z
and correspondingeta_y
,eta_z
only ifres_y
,res_z
were provided in initial call toutils.model
. - Change
zeta
tov_mu_r
. - Include rudimentary
TensorMesh
-class inutils
; removes hard dependency ondiscretize
. - Bugfix: Take a provided
efield
into account; don't return if provided.