mirror of
https://github.com/wassname/simpeg.git
synced 2026-06-29 17:53:35 +08:00
change field--> fields
This commit is contained in:
+3
-3
@@ -56,12 +56,12 @@ class BaseData(object):
|
||||
|
||||
Where P is a projection of the fields onto the data space.
|
||||
"""
|
||||
if u is None: u = self.prob.field(m)
|
||||
return Utils.mkvc(self.projectField(u))
|
||||
if u is None: u = self.prob.fields(m)
|
||||
return Utils.mkvc(self.projectFields(u))
|
||||
|
||||
|
||||
@Utils.count
|
||||
def projectField(self, u):
|
||||
def projectFields(self, u):
|
||||
"""
|
||||
This function projects the fields onto the data space.
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ class DCProblem(Problem.BaseProblem):
|
||||
A = D*Msig*G
|
||||
return A.tocsc()
|
||||
|
||||
def field(self, m):
|
||||
def fields(self, m):
|
||||
A = self.createMatrix(m)
|
||||
solve = Solver(A)
|
||||
phi = solve.solve(self.data.RHS)
|
||||
@@ -98,7 +98,7 @@ class DCProblem(Problem.BaseProblem):
|
||||
J(v) = - P ( A(m)^{-1} ( G\\text{sdiag}(Du)\\nabla_m(M(mT(m))) v ) )
|
||||
"""
|
||||
if u is None:
|
||||
u = self.field(m)
|
||||
u = self.fields(m)
|
||||
|
||||
u = self.data.reshapeFields(u)
|
||||
|
||||
@@ -123,7 +123,7 @@ class DCProblem(Problem.BaseProblem):
|
||||
"""Takes data, turns it into a model..ish"""
|
||||
|
||||
if u is None:
|
||||
u = self.field(m)
|
||||
u = self.fields(m)
|
||||
|
||||
u = self.data.reshapeFields(u)
|
||||
v = self.data.reshapeFields(v)
|
||||
@@ -214,7 +214,7 @@ if __name__ == '__main__':
|
||||
# Create some data
|
||||
data = prob.createSyntheticData(mSynth, std=0.05, P=P, RHS=q)
|
||||
|
||||
u = prob.field(mSynth)
|
||||
u = prob.fields(mSynth)
|
||||
u = data.reshapeFields(u)
|
||||
M.plotImage(u[:,10])
|
||||
plt.show()
|
||||
|
||||
@@ -9,7 +9,7 @@ class LinearProblem(Problem.BaseProblem):
|
||||
Problem.BaseProblem.__init__(self, mesh, model, **kwargs)
|
||||
self.G = G
|
||||
|
||||
def field(self, m, u=None):
|
||||
def fields(self, m, u=None):
|
||||
return self.G.dot(m)
|
||||
|
||||
def J(self, m, v, u=None):
|
||||
|
||||
@@ -73,7 +73,7 @@ class BaseObjFunction(object):
|
||||
self.u_current = None
|
||||
self.m_current = m
|
||||
|
||||
u = self.data.prob.field(m)
|
||||
u = self.data.prob.fields(m)
|
||||
self.u_current = u
|
||||
|
||||
phi_d = self.dataObj(m, u=u)
|
||||
@@ -160,7 +160,7 @@ class BaseObjFunction(object):
|
||||
\\frac{\partial \mu_\\text{data}}{\partial \mathbf{m}} = \mathbf{J}^\\top \mathbf{W \circ R}
|
||||
|
||||
"""
|
||||
if u is None: u = self.data.prob.field(m)
|
||||
if u is None: u = self.data.prob.fields(m)
|
||||
|
||||
R = self.data.residualWeighted(m, u=u)
|
||||
|
||||
@@ -204,7 +204,7 @@ class BaseObjFunction(object):
|
||||
\\frac{\partial^2 \mu_\\text{data}}{\partial^2 \mathbf{m}} = \mathbf{J}^\\top \mathbf{W \circ W J}
|
||||
|
||||
"""
|
||||
if u is None: u = self.data.prob.field(m)
|
||||
if u is None: u = self.data.prob.fields(m)
|
||||
|
||||
R = self.data.residualWeighted(m, u=u)
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ class BetaEstimate(Parameter):
|
||||
u = objFunc.u_current
|
||||
|
||||
if u is None:
|
||||
u = data.prob.field(m)
|
||||
u = data.prob.fields(m)
|
||||
|
||||
x0 = np.random.rand(*m.shape)
|
||||
t = x0.dot(objFunc.dataObj2Deriv(m,x0,u=u))
|
||||
|
||||
+1
-1
@@ -142,7 +142,7 @@ class BaseProblem(object):
|
||||
"""
|
||||
return self.Jt(m, v, u)
|
||||
|
||||
def field(self, m):
|
||||
def fields(self, m):
|
||||
"""
|
||||
The field given the model.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user