@@ -33,7 +33,7 @@ def __init__(self, fine_level, coarse_level, base_transfer_params, space_transfe
3333 class __Pars (FrozenClass ):
3434 def __init__ (self , pars ):
3535 self .finter = False
36- self .coll_iorder = 1
36+ self .coll_iorder = 2
3737 self .coll_rorder = 1
3838 for k , v in pars .items ():
3939 setattr (self , k , v )
@@ -110,8 +110,7 @@ def restrict(self):
110110 tmp_u .append (self .space_transfer .restrict (F .u [m ]))
111111
112112 # restrict collocation values
113- G .u [0 ] = tmp_u [0 ]
114- for n in range (1 , SG .coll .num_nodes + 1 ):
113+ for n in range (0 , SG .coll .num_nodes + 1 ):
115114 G .u [n ] = self .Rcoll [n , 0 ] * tmp_u [0 ]
116115 for m in range (1 , SF .coll .num_nodes + 1 ):
117116 G .u [n ] += self .Rcoll [n , m ] * tmp_u [m ]
@@ -133,11 +132,11 @@ def restrict(self):
133132 tmp_tau .append (self .space_transfer .restrict (tauF [m ]))
134133
135134 # restrict fine level tau correction part in collocation
136- tauFG = [tmp_tau [ 0 ] ]
137- for n in range (1 , SG .coll .num_nodes ):
138- tauFG .append (self .Rcoll [n + 1 , 1 ] * tmp_tau [0 ])
135+ tauFG = []
136+ for n in range (1 , SG .coll .num_nodes + 1 ):
137+ tauFG .append (self .Rcoll [n , 1 ] * tmp_tau [0 ])
139138 for m in range (1 , SF .coll .num_nodes ):
140- tauFG [- 1 ] += self .Rcoll [n + 1 , m + 1 ] * tmp_tau [m ]
139+ tauFG [- 1 ] += self .Rcoll [n , m + 1 ] * tmp_tau [m ]
141140
142141 # build tau correction
143142 for m in range (SG .coll .num_nodes ):
@@ -150,10 +149,10 @@ def restrict(self):
150149 tmp_tau .append (self .space_transfer .restrict (F .tau [m ]))
151150
152151 # restrict possible tau correction from fine in collocation
153- for n in range (0 , SG .coll .num_nodes ):
154- G .tau [n ] += self .Rcoll [n + 1 , 1 ] * tmp_tau [0 ]
152+ for n in range (1 , SG .coll .num_nodes + 1 ):
153+ G .tau [n - 1 ] += self .Rcoll [n , 1 ] * tmp_tau [0 ]
155154 for m in range (1 , SF .coll .num_nodes ):
156- G .tau [n ] += self .Rcoll [n + 1 , m + 1 ] * tmp_tau [m ]
155+ G .tau [n - 1 ] += self .Rcoll [n , m + 1 ] * tmp_tau [m ]
157156 else :
158157 pass
159158
@@ -201,8 +200,7 @@ def prolong(self):
201200 tmp_u .append (self .space_transfer .prolong (G .u [m ] - G .uold [m ]))
202201
203202 # interpolate values in collocation
204- F .u [0 ] += tmp_u [0 ]
205- for n in range (1 , SF .coll .num_nodes + 1 ):
203+ for n in range (0 , SF .coll .num_nodes + 1 ):
206204 for m in range (0 , SG .coll .num_nodes + 1 ):
207205 F .u [n ] += self .Pcoll [n , m ] * tmp_u [m ]
208206
@@ -247,9 +245,7 @@ def prolong_f(self):
247245 tmp_f .append (self .space_transfer .prolong (G .f [m ] - G .fold [m ]))
248246
249247 # interpolate values in collocation
250- F .u [0 ] += tmp_u [0 ]
251- F .f [0 ] += tmp_f [0 ]
252- for n in range (1 , SF .coll .num_nodes + 1 ):
248+ for n in range (0 , SF .coll .num_nodes + 1 ):
253249 for m in range (0 , SG .coll .num_nodes + 1 ):
254250 F .u [n ] += self .Pcoll [n , m ] * tmp_u [m ]
255251 F .f [n ] += self .Pcoll [n , m ] * tmp_f [m ]
0 commit comments