@@ -38,11 +38,11 @@ def create_test_mesh():
3838 """Create a simple 3D test mesh"""
3939 print ("Creating test mesh..." )
4040
41- # Create a 20x20x10 mesh with 5m cells
42- nx , ny , nz = 20 , 20 , 10
43- hx = torch .ones (nx ) * 5 .0 # 5m cell size
44- hy = torch .ones (ny ) * 5 .0
45- hz = torch .ones (nz ) * 5 .0
41+ # Create a small 6x6x4 mesh with 10m cells for faster testing
42+ nx , ny , nz = 6 , 6 , 4
43+ hx = torch .ones (nx ) * 10 .0 # 10m cell size
44+ hy = torch .ones (ny ) * 10 .0
45+ hz = torch .ones (nz ) * 10 .0
4646
4747 mesh = TensorMesh ([hx , hy , hz ])
4848 print (f" Mesh shape: { mesh .shape_cells } " )
@@ -64,9 +64,9 @@ def test_basic_magnetic_dipole():
6464 mesh = create_test_mesh ()
6565
6666 # Create receiver locations (line profile)
67- rx_x = torch .linspace (10 , 90 , 9 ) # 9 receivers from 10m to 90m
68- rx_y = torch .ones_like (rx_x ) * 50 # At y=50m
69- rx_z = torch .ones_like (rx_x ) * 2.5 # At z=2. 5m (just above surface)
67+ rx_x = torch .linspace (15 , 45 , 4 ) # 4 receivers from 15m to 45m
68+ rx_y = torch .ones_like (rx_x ) * 30 # At y=30m (center)
69+ rx_z = torch .ones_like (rx_x ) * 5.0 # At z=5m (just above surface)
7070 rx_locs = torch .stack ([rx_x , rx_y , rx_z ], dim = 1 )
7171
7272 print (f"Receiver locations: { rx_locs .shape } " )
@@ -81,7 +81,7 @@ def test_basic_magnetic_dipole():
8181 source = MagneticDipole (
8282 receiver_list = receivers ,
8383 frequency = 1000.0 , # 1 kHz
84- location = torch .tensor ([50 .0 , 50 .0 , 0.0 ]), # Center of domain at surface
84+ location = torch .tensor ([30 .0 , 30 .0 , 0.0 ]), # Center of domain at surface
8585 moment = 1.0 ,
8686 orientation = "z" ,
8787 )
@@ -98,10 +98,10 @@ def test_basic_magnetic_dipole():
9898 # Add a conductive block
9999 cell_centers = mesh .cell_centers
100100 block_mask = (
101- (cell_centers [:, 0 ] > 40 )
102- & (cell_centers [:, 0 ] < 60 )
103- & (cell_centers [:, 1 ] > 40 )
104- & (cell_centers [:, 1 ] < 60 )
101+ (cell_centers [:, 0 ] > 20 )
102+ & (cell_centers [:, 0 ] < 40 )
103+ & (cell_centers [:, 1 ] > 20 )
104+ & (cell_centers [:, 1 ] < 40 )
105105 & (cell_centers [:, 2 ] > 10 )
106106 & (cell_centers [:, 2 ] < 30 )
107107 )
@@ -147,10 +147,10 @@ def test_multiple_frequencies():
147147 mesh = create_test_mesh ()
148148
149149 # Single receiver location
150- rx_loc = torch .tensor ([[50 .0 , 50 .0 , 2.5 ]])
150+ rx_loc = torch .tensor ([[30 .0 , 30 .0 , 5.0 ]])
151151
152152 sources = []
153- frequencies = [100.0 , 1000.0 , 10000.0 ] # 100 Hz, 1 kHz, 10 kHz
153+ frequencies = [1000.0 , 10000.0 ] # 1 kHz, 10 kHz (reduced to 2 frequencies)
154154
155155 for freq in frequencies :
156156 receivers = [
@@ -161,7 +161,7 @@ def test_multiple_frequencies():
161161 source = MagneticDipole (
162162 receiver_list = receivers ,
163163 frequency = freq ,
164- location = torch .tensor ([50 .0 , 50 .0 , 0.0 ]),
164+ location = torch .tensor ([30 .0 , 30 .0 , 0.0 ]),
165165 moment = 1.0 ,
166166 orientation = "z" ,
167167 )
@@ -202,7 +202,7 @@ def test_different_sources():
202202 print ("=" * 60 )
203203
204204 mesh = create_test_mesh ()
205- rx_loc = torch .tensor ([[60 .0 , 50 .0 , 2.5 ]])
205+ rx_loc = torch .tensor ([[40 .0 , 30 .0 , 5.0 ]])
206206
207207 # Test each source type
208208 source_tests = []
@@ -213,7 +213,7 @@ def test_different_sources():
213213 mag_dipole = MagneticDipole (
214214 receiver_list = receivers ,
215215 frequency = 1000.0 ,
216- location = torch .tensor ([50 .0 , 50 .0 , 0.0 ]),
216+ location = torch .tensor ([30 .0 , 30 .0 , 0.0 ]),
217217 moment = 1.0 ,
218218 orientation = "z" ,
219219 )
@@ -234,7 +234,7 @@ def test_different_sources():
234234 elec_dipole = ElectricDipole (
235235 receiver_list = receivers ,
236236 frequency = 1000.0 ,
237- location = torch .tensor ([50 .0 , 50 .0 , 0.0 ]),
237+ location = torch .tensor ([30 .0 , 30 .0 , 0.0 ]),
238238 current = 1.0 ,
239239 length = 1.0 ,
240240 orientation = "z" ,
@@ -256,7 +256,7 @@ def test_different_sources():
256256 loop_source = LoopSource (
257257 receiver_list = receivers ,
258258 frequency = 1000.0 ,
259- location = torch .tensor ([50 .0 , 50 .0 , 0.0 ]),
259+ location = torch .tensor ([30 .0 , 30 .0 , 0.0 ]),
260260 radius = 10.0 ,
261261 current = 1.0 ,
262262 orientation = "z" ,
@@ -283,7 +283,7 @@ def test_receivers():
283283 print ("=" * 60 )
284284
285285 mesh = create_test_mesh ()
286- rx_loc = torch .tensor ([[60 .0 , 50 .0 , 2.5 ]])
286+ rx_loc = torch .tensor ([[40 .0 , 30 .0 , 5.0 ]])
287287
288288 receiver_tests = []
289289
@@ -317,7 +317,7 @@ def test_receivers():
317317 source = MagneticDipole (
318318 receiver_list = [receiver ],
319319 frequency = 1000.0 ,
320- location = torch .tensor ([50 .0 , 50 .0 , 0.0 ]),
320+ location = torch .tensor ([30 .0 , 30 .0 , 0.0 ]),
321321 moment = 1.0 ,
322322 orientation = "z" ,
323323 )
0 commit comments