diff --git a/notebooks/07-fdem/fwd_fdem_cyl.ipynb b/notebooks/07-fdem/fwd_fdem_cyl.ipynb index cc0dc579..56f6c7d4 100644 --- a/notebooks/07-fdem/fwd_fdem_cyl.ipynb +++ b/notebooks/07-fdem/fwd_fdem_cyl.ipynb @@ -69,21 +69,43 @@ "\n", "from simpeg import maps\n", "import simpeg.electromagnetics.frequency_domain as fdem\n", + "from simpeg.utils.solver_utils import get_default_solver\n", "\n", "import numpy as np\n", "import matplotlib as mpl\n", "import matplotlib.pyplot as plt\n", "\n", - "try:\n", - " from pymatsolver import Pardiso as Solver\n", - "except ImportError:\n", - " from simpeg import SolverLU as Solver\n", - "\n", "write_file = False\n", "\n", "# sphinx_gallery_thumbnail_number = 2" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Get solver\n", + "\n", + "Using the `simpeg.utils.solver_utils.get_default_solver` function, SimPEG can\n", + "automatically choose the best solver available for your system.\n", + "\n", + "For example, it’ll select `Pardiso` as the solver if you are running an Intel\n", + "CPU and have `pydiso` installed in your system. Alternatively, it can choose\n", + "`Mumps` if you are using Apple silicon and the `python-mumps` package is\n", + "installed. If no fast solver is available, it’ll choose SciPy's `SparseLU`\n", + "solver." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "solver = get_default_solver()\n", + "solver" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -305,7 +327,7 @@ "outputs": [], "source": [ "simulation = fdem.simulation.Simulation3DMagneticFluxDensity(\n", - " mesh, survey=survey, sigmaMap=model_map, solver=Solver\n", + " mesh, survey=survey, sigmaMap=model_map, solver=solver\n", ")" ] },