Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions simpeg_drivers-assets/uijson/direct_current_2d_forward.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,16 @@
"value": 1,
"visible": false
},
"solver_type": {
"choiceList": [
"Pardiso",
"Mumps"
],
"group": "Compute",
"label": "Direct solver",
"tooltip": "Direct solver to use for the forward calculations",
"value": "Pardiso"
},
"tile_spatial": 1,
"max_chunk_size": {
"min": 0,
Expand Down
10 changes: 10 additions & 0 deletions simpeg_drivers-assets/uijson/direct_current_2d_inversion.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,16 @@
"value": 1,
"visible": false
},
"solver_type": {
"choiceList": [
"Pardiso",
"Mumps"
],
"group": "Compute",
"label": "Direct solver",
"tooltip": "Direct solver to use for the forward calculations",
"value": "Pardiso"
},
"tile_spatial": 1,
"store_sensitivities": {
"choiceList": [
Expand Down
10 changes: 10 additions & 0 deletions simpeg_drivers-assets/uijson/direct_current_3d_forward.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,16 @@
"value": 1,
"visible": false
},
"solver_type": {
"choiceList": [
"Pardiso",
"Mumps"
],
"group": "Compute",
"label": "Direct solver",
"tooltip": "Direct solver to use for the forward calculations",
"value": "Pardiso"
},
"tile_spatial": {
"group": "Compute",
"label": "Number of tiles",
Expand Down
10 changes: 10 additions & 0 deletions simpeg_drivers-assets/uijson/direct_current_3d_inversion.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,16 @@
"value": 1,
"visible": false
},
"solver_type": {
"choiceList": [
"Pardiso",
"Mumps"
],
"group": "Compute",
"label": "Direct solver",
"tooltip": "Direct solver to use for the forward calculations",
"value": "Pardiso"
},
"tile_spatial": {
"group": "Compute",
"label": "Number of tiles",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,16 @@
"value": 1,
"visible": false
},
"solver_type": {
"choiceList": [
"Pardiso",
"Mumps"
],
"group": "Compute",
"label": "Direct solver",
"tooltip": "Direct solver to use for the forward calculations",
"value": "Pardiso"
},
"tile_spatial": 1,
"max_chunk_size": {
"min": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,16 @@
"value": 1,
"visible": false
},
"solver_type": {
"choiceList": [
"Pardiso",
"Mumps"
],
"group": "Compute",
"label": "Direct solver",
"tooltip": "Direct solver to use for the forward calculations",
"value": "Pardiso"
},
"tile_spatial": 1,
"store_sensitivities": {
"choiceList": [
Expand Down
10 changes: 10 additions & 0 deletions simpeg_drivers-assets/uijson/fem_forward.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@
"value": 1,
"visible": false
},
"solver_type": {
"choiceList": [
"Pardiso",
"Mumps"
],
"group": "Compute",
"label": "Direct solver",
"tooltip": "Direct solver to use for the forward calculations",
"value": "Pardiso"
},
"tile_spatial": {
"group": "Compute",
"label": "Number of tiles",
Expand Down
10 changes: 10 additions & 0 deletions simpeg_drivers-assets/uijson/fem_inversion.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,16 @@
"value": 1,
"visible": false
},
"solver_type": {
"choiceList": [
"Pardiso",
"Mumps"
],
"group": "Compute",
"label": "Direct solver",
"tooltip": "Direct solver to use for the forward calculations",
"value": "Pardiso"
},
"tile_spatial": {
"group": "Compute",
"label": "Number of tiles",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,16 @@
"value": 1,
"visible": false
},
"solver_type": {
"choiceList": [
"Pardiso",
"Mumps"
],
"group": "Compute",
"label": "Direct solver",
"tooltip": "Direct solver to use for the forward calculations",
"value": "Pardiso"
},
"tile_spatial": 1,
"max_chunk_size": {
"min": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,16 @@
"value": 1,
"visible": false
},
"solver_type": {
"choiceList": [
"Pardiso",
"Mumps"
],
"group": "Compute",
"label": "Direct solver",
"tooltip": "Direct solver to use for the forward calculations",
"value": "Pardiso"
},
"tile_spatial": 1,
"max_ram": "",
"store_sensitivities": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,16 @@
"value": 1,
"visible": false
},
"solver_type": {
"choiceList": [
"Pardiso",
"Mumps"
],
"group": "Compute",
"label": "Direct solver",
"tooltip": "Direct solver to use for the forward calculations",
"value": "Pardiso"
},
"tile_spatial": {
"group": "Compute",
"label": "Number of tiles",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,16 @@
"value": 1,
"visible": false
},
"solver_type": {
"choiceList": [
"Pardiso",
"Mumps"
],
"group": "Compute",
"label": "Direct solver",
"tooltip": "Direct solver to use for the forward calculations",
"value": "Pardiso"
},
"tile_spatial": {
"group": "Compute",
"label": "Number of tiles",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,16 @@
"value": 1,
"visible": false
},
"solver_type": {
"choiceList": [
"Pardiso",
"Mumps"
],
"group": "Compute",
"label": "Direct solver",
"tooltip": "Direct solver to use for the forward calculations",
"value": "Pardiso"
},
"tile_spatial": 1,
"max_chunk_size": {
"min": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,16 @@
"value": 1,
"visible": false
},
"solver_type": {
"choiceList": [
"Pardiso",
"Mumps"
],
"group": "Compute",
"label": "Direct solver",
"tooltip": "Direct solver to use for the forward calculations",
"value": "Pardiso"
},
"tile_spatial": 1,
"store_sensitivities": {
"choiceList": [
Expand Down
10 changes: 10 additions & 0 deletions simpeg_drivers-assets/uijson/magnetotellurics_forward.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,16 @@
"value": 1,
"visible": false
},
"solver_type": {
"choiceList": [
"Pardiso",
"Mumps"
],
"group": "Compute",
"label": "Direct solver",
"tooltip": "Direct solver to use for the forward calculations",
"value": "Pardiso"
},
"tile_spatial": {
"group": "Compute",
"label": "Number of tiles",
Expand Down
10 changes: 10 additions & 0 deletions simpeg_drivers-assets/uijson/magnetotellurics_inversion.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,16 @@
"value": 1,
"visible": false
},
"solver_type": {
"choiceList": [
"Pardiso",
"Mumps"
],
"group": "Compute",
"label": "Direct solver",
"tooltip": "Direct solver to use for the forward calculations",
"value": "Pardiso"
},
"tile_spatial": {
"group": "Compute",
"label": "Number of tiles",
Expand Down
10 changes: 10 additions & 0 deletions simpeg_drivers-assets/uijson/tdem_forward.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,16 @@
"value": 1,
"visible": false
},
"solver_type": {
"choiceList": [
"Pardiso",
"Mumps"
],
"group": "Compute",
"label": "Direct solver",
"tooltip": "Direct solver to use for the forward calculations",
"value": "Pardiso"
},
"tile_spatial": {
"group": "Compute",
"label": "Number of tiles",
Expand Down
10 changes: 10 additions & 0 deletions simpeg_drivers-assets/uijson/tdem_inversion.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,16 @@
"value": 1,
"visible": false
},
"solver_type": {
"choiceList": [
"Pardiso",
"Mumps"
],
"group": "Compute",
"label": "Direct solver",
"tooltip": "Direct solver to use for the forward calculations",
"value": "Pardiso"
},
"tile_spatial": {
"group": "Compute",
"label": "Number of tiles",
Expand Down
10 changes: 10 additions & 0 deletions simpeg_drivers-assets/uijson/tipper_forward.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@
"value": 1,
"visible": false
},
"solver_type": {
"choiceList": [
"Pardiso",
"Mumps"
],
"group": "Compute",
"label": "Direct solver",
"tooltip": "Direct solver to use for the forward calculations",
"value": "Pardiso"
},
"tile_spatial": {
"group": "Compute",
"label": "Number of tiles",
Expand Down
10 changes: 10 additions & 0 deletions simpeg_drivers-assets/uijson/tipper_inversion.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,16 @@
"value": 1,
"visible": false
},
"solver_type": {
"choiceList": [
"Pardiso",
"Mumps"
],
"group": "Compute",
"label": "Direct solver",
"tooltip": "Direct solver to use for the forward calculations",
"value": "Pardiso"
},
"tile_spatial": {
"group": "Compute",
"label": "Number of tiles",
Expand Down
2 changes: 1 addition & 1 deletion simpeg_drivers/components/factories/simulation_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self, params: BaseParams | BaseOptions):
]:
import pymatsolver.direct as solver_module

self.solver = solver_module.Pardiso
self.solver = getattr(solver_module, params.solver_type)

def concrete_object(self):
if self.factory_type in ["magnetic scalar", "magnetic vector"]:
Expand Down
11 changes: 11 additions & 0 deletions simpeg_drivers/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from __future__ import annotations

import multiprocessing
from enum import Enum
from logging import getLogger
from pathlib import Path
from typing import ClassVar, TypeAlias
Expand Down Expand Up @@ -56,6 +57,15 @@ def at_least_one(cls, data):
return data


class SolverType(str, Enum):
"""
Supported solvers.
"""

Pardiso = "Pardiso"
Mumps = "Mumps"


class CoreOptions(BaseData):
"""
Core parameters shared by inverse and forward operations.
Expand Down Expand Up @@ -94,6 +104,7 @@ class CoreOptions(BaseData):
mesh: Octree | DrapeModel | None
starting_model: float | FloatData
active_cells: ActiveCellsOptions
solver_type: SolverType = SolverType.Pardiso
tile_spatial: int = 1
parallelized: bool = True
n_cpu: int | None = None
Expand Down
Loading