Skip to content

Commit beefd6b

Browse files
authored
Use choclo as engine in potential field simulations (#32)
Choose Choclo as the engine for running potential field simulations. Add `choclo>=0.3.0` to the `environment.yml`.
1 parent dd2d075 commit beefd6b

10 files changed

+21
-7
lines changed

environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ dependencies:
1111
- nbconvert
1212
- simpeg==0.23.*
1313
- discretize==0.10.*
14+
- choclo==0.3.0
1415
- pymatsolver

notebooks/03-gravity/fwd_gravity_anomaly_3d.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@
609609
" rhoMap=model_map,\n",
610610
" active_cells=active_cells,\n",
611611
" store_sensitivities=\"forward_only\",\n",
612-
" engine=\"geoana\",\n",
612+
" engine=\"choclo\",\n",
613613
")"
614614
]
615615
},

notebooks/03-gravity/fwd_gravity_gradiometry_3d.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@
637637
" rhoMap=model_map,\n",
638638
" active_cells=active_cells,\n",
639639
" store_sensitivities=\"forward_only\",\n",
640-
" engine=\"geoana\",\n",
640+
" engine=\"choclo\",\n",
641641
")"
642642
]
643643
},

notebooks/03-gravity/inv_gravity_anomaly_3d.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@
609609
" mesh=tensor_mesh,\n",
610610
" rhoMap=tensor_model_map,\n",
611611
" active_cells=active_tensor_cells,\n",
612-
" engine=\"geoana\",\n",
612+
" engine=\"choclo\",\n",
613613
")"
614614
]
615615
},

notebooks/04-magnetics/fwd_magnetics_induced_3d.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@
601601
" chiMap=model_map,\n",
602602
" active_cells=active_cells,\n",
603603
" store_sensitivities=\"forward_only\",\n",
604-
" engine=\"geoana\",\n",
604+
" engine=\"choclo\",\n",
605605
")"
606606
]
607607
},

notebooks/04-magnetics/fwd_magnetics_mvi_3d.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,9 @@
707707
"- the mapping from the model to the active cells\n",
708708
"- the model type: \"scalar\" for susceptibility model, \"vector\" for magnetic vector model\n",
709709
"\n",
710-
"This is accomplished by setting each one of the aforementioned items as a property of the simulation object. Additional keyword arguments can also be set which impact the forward simulation. Because we are only simulating data for a single model, there is no benefit to storing the sensitivities for the forward simulation. ``store_sensitivities`` property to *'forward_only'*"
710+
"This is accomplished by setting each one of the aforementioned items as a property of the simulation object. Additional keyword arguments can also be set which impact the forward simulation. Because we are only simulating data for a single model, there is no benefit to storing the sensitivities for the forward simulation. ``store_sensitivities`` property to *'forward_only'*\n",
711+
"\n",
712+
"> By choosing `engine=\"choclo\"` we can make our simulation to run the faster and more memory efficient implementation of the magnetic forward that uses [Numba](https://numba.pydata.org/) and [Choclo](https://www.fatiando.org/choclo) under the hood. To do so, we need to have [Choclo installed](https://www.fatiando.org/choclo/latest/install.html)."
711713
]
712714
},
713715
{
@@ -730,6 +732,7 @@
730732
" chiMap=model_map,\n",
731733
" active_cells=active_cells,\n",
732734
" store_sensitivities=\"forward_only\",\n",
735+
" engine=\"choclo\",\n",
733736
")"
734737
]
735738
},

notebooks/04-magnetics/inv_magnetics_induced_3d.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@
622622
" model_type=\"scalar\",\n",
623623
" chiMap=tensor_model_map,\n",
624624
" active_cells=active_tensor_cells,\n",
625-
" engine=\"geoana\",\n",
625+
" engine=\"choclo\",\n",
626626
")"
627627
]
628628
},
@@ -1281,6 +1281,7 @@
12811281
" model_type=\"scalar\",\n",
12821282
" chiMap=tree_model_map,\n",
12831283
" active_cells=ind_tree_active,\n",
1284+
" engine=\"choclo\",\n",
12841285
")"
12851286
]
12861287
},

notebooks/11-joint-inversion/plot_inv_3_cross_gradient_pf.ipynb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,11 @@
524524
"outputs": [],
525525
"source": [
526526
"simulation_grav = gravity.simulation.Simulation3DIntegral(\n",
527-
" survey=survey_grav, mesh=mesh, rhoMap=wires.density, active_cells=ind_active\n",
527+
" survey=survey_grav,\n",
528+
" mesh=mesh,\n",
529+
" rhoMap=wires.density,\n",
530+
" active_cells=ind_active,\n",
531+
" engine=\"choclo\",\n",
528532
")\n",
529533
"\n",
530534
"simulation_mag = magnetics.simulation.Simulation3DIntegral(\n",
@@ -533,6 +537,7 @@
533537
" model_type=\"scalar\",\n",
534538
" chiMap=wires.susceptibility,\n",
535539
" active_cells=ind_active,\n",
540+
" engine=\"choclo\",\n",
536541
")"
537542
]
538543
},

notebooks/12-pgi-inversion/plot_inv_1_joint_pf_pgi_full_info_tutorial.ipynb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@
376376
" mesh=mesh,\n",
377377
" rhoMap=wires.den,\n",
378378
" active_cells=actv,\n",
379+
" engine=\"choclo\",\n",
379380
")\n",
380381
"dmis_grav = data_misfit.L2DataMisfit(data=data_grav, simulation=simulation_grav)\n",
381382
"# Mag problem\n",
@@ -384,6 +385,7 @@
384385
" mesh=mesh,\n",
385386
" chiMap=wires.sus,\n",
386387
" active_cells=actv,\n",
388+
" engine=\"choclo\",\n",
387389
")\n",
388390
"dmis_mag = data_misfit.L2DataMisfit(data=data_mag, simulation=simulation_mag)"
389391
]

notebooks/12-pgi-inversion/plot_inv_2_joint_pf_pgi_no_info_tutorial.ipynb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@
370370
" mesh=mesh,\n",
371371
" rhoMap=wires.den,\n",
372372
" active_cells=actv,\n",
373+
" engine=\"choclo\",\n",
373374
")\n",
374375
"dmis_grav = data_misfit.L2DataMisfit(data=data_grav, simulation=simulation_grav)\n",
375376
"# Mag problem\n",
@@ -378,6 +379,7 @@
378379
" mesh=mesh,\n",
379380
" chiMap=wires.sus,\n",
380381
" active_cells=actv,\n",
382+
" engine=\"choclo\",\n",
381383
")\n",
382384
"dmis_mag = data_misfit.L2DataMisfit(data=data_mag, simulation=simulation_mag)"
383385
]

0 commit comments

Comments
 (0)