Пример #1
0
def PSolve(tn, u, fu, r, z, gamma, delta, lr, P_data, vtemp):
	data = ctypes.cast(P_data, PUserData).contents
	
	z[:] = r

	for jx in range(MX):
		for jy in range(MY):
			cvodes.denGETRS(data.P[jx][jy], NUM_SPECIES, data.pivot[jx][jy], z.ptrto(jx*NUM_SPECIES + jy*NSMX))
	return 0
Пример #2
0
def PSolveB(t, c, cB, fcB, r, z, gamma, delta, lr, P_data, vtemp):
	wdata = ctypes.cast(P_data, PWebData).contents
	
	z[:] = r
	
	GSIter(-gamma, z, vtemp, wdata)
	
	iv = 0
	for jy in range(wdata.my):
		igy = wdata.jigy[jy]
		for jx in range(wdata.mx):
			igx = wdata.jigx[jx]
			ig = igx + igy*wdata.ngx
			cvodes.denGETRS(wdata.P[ig], wdata.mp, wdata.pivot[ig], z.ptrto(iv))
			iv += wdata.mp
	
	return 0
Пример #3
0
def PSolve(tn, c, fc, r, z, gamma, delta, lr, P_data, vtemp):
    wdata = ctypes.cast(P_data, PWebData).contents

    z[:] = r

    GSIter(gamma, z, vtemp, wdata)

    iv = 0
    for jy in range(wdata.my):
        igy = wdata.jigy[jy]
        for jx in range(wdata.mx):
            igx = wdata.jigx[jx]
            ig = igx + igy * wdata.ngx
            cvodes.denGETRS(wdata.P[ig], wdata.mp, wdata.pivot[ig], z.ptrto(iv))
            iv += wdata.mp

    z[NEQ] = r[NEQ] + gamma * doubleIntgr(z, ISPEC, wdata)
    return 0