mirror of
https://github.com/wassname/simpeg.git
synced 2026-06-28 16:14:19 +08:00
27 lines
724 B
Python
27 lines
724 B
Python
import numpy as np
|
|
import unittest
|
|
from SimPEG import *
|
|
from TestUtils import checkDerivative
|
|
from scipy.sparse.linalg import dsolve
|
|
|
|
|
|
class ProblemTests(unittest.TestCase):
|
|
|
|
def setUp(self):
|
|
|
|
a = np.array([1, 1, 1])
|
|
b = np.array([1, 2])
|
|
c = np.array([1, 4])
|
|
self.mesh2 = Mesh.TensorMesh([a, b], np.array([3, 5]))
|
|
self.p2 = Problem.BaseProblem(self.mesh2, None)
|
|
self.reg = Inverse.Regularization(self.mesh2)
|
|
|
|
def test_regularization(self):
|
|
derChk = lambda m: [self.reg.modelObj(m), self.reg.modelObjDeriv(m)]
|
|
mSynth = np.random.randn(self.mesh2.nC)
|
|
checkDerivative(derChk, mSynth, plotIt=False)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|