aDiffP = aDiffP + sp.coo_matrix( (0. * TKL[extF], (extFacesCells[0], extFacesCells[0])), shape=(nVol, nVol)) e = np.ones((1, nVol)) EaDiffP = sp.csc_matrix( np.concatenate((np.concatenate( (d * aDiffP.T.todense(), (mesK * e).T), axis=1), np.array([np.append((mesK * e).T, 0.)])), axis=0)) # -----------------------------------Dirichlet Boundary condition------------------------------------------ # aDiffP = aDiffP + sp.coo_matrix(-TKL[extF], (extFacesCells[0], extFacesCells[0]), shape=(nVol, nVol)) test = CellVariable(mesh=mesh, value=0.) phi = CellVariable(name="$\phi(t,x,y)$", mesh=mesh, value=0.0, hasOld=1) sF = sigmaF.SigmaF2D(params.sF, xt, yt, Rs=0.05) F = sF extendedF = np.append(mesK * F, 0.) phi_new = la.spsolve(d * EaDiffP, extendedF) phi.setValue(phi_new[0:nVol]) phi.updateOld() # ------------------------------------------ THE IMMUNE CELLS ------------------------------ # ----------------------------------------- The diffusion matrix ----------------------------------------- aDiffE = np.zeros((nVol, nVol)) aDiffE = sp.csc_matrix(aDiffE) aDiffE = aDiffE + sp.coo_matrix(
# -----------------------------------Neumann Boundary condition------------------------------------------ aDiffP = aDiffP + sp.coo_matrix( (0. * TKL[extF], (extFacesCells[0], extFacesCells[0])), shape=(nVol, nVol)) e = np.ones((1, nVol)) EaDiffP = sp.csc_matrix( np.concatenate((np.concatenate( (d * aDiffP.T.todense(), (mesK * e).T), axis=1), np.array([np.append((mesK * e).T, 0.)])), axis=0)) # -----------------------------------Dirichlet Boundary condition------------------------------------------ test = CellVariable(mesh=mesh, value=0.) phi = CellVariable(name="$\phi(t,x,y)$", mesh=mesh, value=0.0, hasOld=1) # sF = sigmaF.SigmaF2D(params.sF, xt, yt, Rs=0.05) sF = sigmaF.SigmaF2D(1. / x_s, xt, yt, Rs=0.05 / (x_s**2)) F = sF extendedF = np.append(mesK * U * F, 0.) phi_new = la.spsolve(EaDiffP, extendedF) phi.setValue(phi_new[0:nVol]) phi.updateOld() # ------------------------------------------ The Chemoattractant ------------------------------ aDiffE = np.zeros((nVol, nVol)) aDiffE = sp.csc_matrix(aDiffE) aDiffE = aDiffE + sp.coo_matrix( (-TKL[intF], (intFacesCells[0], intFacesCells[0])), shape=(nVol, nVol)) aDiffE = aDiffE + sp.coo_matrix( (TKL[intF], (intFacesCells[0], intFacesCells[1])), shape=(nVol, nVol)) aDiffE = aDiffE + sp.coo_matrix(