-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFCF.py
More file actions
19 lines (15 loc) · 832 Bytes
/
FCF.py
File metadata and controls
19 lines (15 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from blockops import BlockOperator, BlockIteration, I
nBlocks = 8
phi = BlockOperator(r'\phi', cost=4) # integration operator
phiD = BlockOperator(r'\phi_{\Delta}', cost=1) # inverse approximate integration operator
chi = BlockOperator(r'\chi', cost=0.1) # transmission operator
blockOps = dict(I=I, phi=phi, phiD=phiD, chi=chi)
parareal_fcf = BlockIteration(
update="(I-phiD**(-1))*phi**(-1)*chi*phi**(-1)*chi*u_{n-1}^k + phiD**(-1)*chi* u_{n}^{k+1}",
predictor="phiD**(-1)*chi",
propagator=phi**(-1)*chi,
**blockOps)
parareal_fcf.plotGraph(N=nBlocks, K=nBlocks, figSize=(6.4*2, 4.8*2))
# parareal_fcf.plotGraphForOneBlock(N=nBlocks, K=nBlocks, plotBlock=4, plotIter=2, figSize=(6.4*2, 4.8*2))
fig = parareal_fcf.plotSchedule(N=nBlocks, K=nBlocks, nProc=nBlocks, schedulerType="BLOCK-BY-BLOCK")
fig.show()