Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 28 additions & 6 deletions notebooks/07-fdem/fwd_fdem_cyl.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down Expand Up @@ -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",
")"
]
},
Expand Down