def __init__(self, username, password): self.username = username self.password = password self.cookie_file = '/dev/null' BC.__init__(self) self.reset()
vals = np.full(NYs, 1.0) Hy = sps.coo_matrix((vals, (rows, cols)), shape=(NYs, NY)) return sps.vstack([-Hy, np.sqrt(self.gamma) * self.L]) if __name__ == '__main__': L = np.array([1.0, 1.0]) N = np.array([32, 32]) g = Geom(L, N) g.calculate() ul = 2.0 ur = 1.0 bc = BC(g) bc.dirichlet(g, "left", ul) bc.dirichlet(g, "right", ur) # Hydraulic conductivity npr.seed(0) se = SEKernel(std_dev=1.0, cor_len=0.15, std_dev_noise=0.0) CY = se.covar(g.cells.centroids.T, g.cells.centroids.T) Nc = np.prod(N) Y = se.sample(CY, npr.randn(Nc)) K = np.exp(Y) # Problem prob = DarcyExp(g, bc) timer = time() u = prob.solve(Y)