Skip to content

Commit c6f35b2

Browse files
committed
Mirror the simulation_1d to fem
1 parent e712370 commit c6f35b2

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from ....electromagnetics.frequency_domain.simulation_1d import (
2+
Simulation1DLayered as Sim,
3+
)
4+
5+
from ...simulation import getJtJdiag, Jvec, Jtvec
6+
7+
Sim._delete_on_model_update = ["_Jmatrix", "_jtjdiag", "_J"]
8+
9+
10+
@property
11+
def Jmatrix(self):
12+
"""
13+
Sensitivity matrix stored on disk
14+
Return the diagonal of JtJ
15+
"""
16+
if getattr(self, "_Jmatrix", None) is None:
17+
Jmat = self._getJ(self.model)
18+
self._Jmatrix = Jmat["ds"] * self.sigmaDeriv
19+
20+
return self._Jmatrix
21+
22+
23+
Sim.getJtJdiag = getJtJdiag
24+
Sim.Jvec = Jvec
25+
Sim.Jtvec = Jtvec
26+
Sim.Jmatrix = Jmatrix

0 commit comments

Comments
 (0)