def __init__(self, conf, nls=None, context=None, **kwargs): TimeSteppingSolver.__init__(self, conf, nls=nls, context=context, **kwargs) self.ts = TimeStepper.from_conf(self.conf) nd = self.ts.n_digit self.stage_format = '---- ' + \ self.name + ' stage {}: linear system sol error {}'+ \ ' ----' format = '\n\n====== time %%e (step %%%dd of %%%dd) =====' % (nd, nd) self.format = format self.verbose = self.conf.verbose self.post_stage_hook = lambda x: x limiters = {} if self.conf.limiters is not None: limiters = self.conf.limiters # what if we have more fields or limiters? for field_name, limiter in limiters.items(): self.post_stage_hook = limiter(context.fields[field_name], verbose=self.verbose)
def __init__(self, conf, **kwargs): TimeSteppingSolver.__init__(self, conf, **kwargs) self.ts = TimeStepper.from_conf(self.conf) nd = self.ts.n_digit format = '====== time %%e (step %%%dd of %%%dd) =====' % (nd, nd) self.format = format
def __init__(self, conf, nls=None, context=None, **kwargs): TimeSteppingSolver.__init__(self, conf, nls=nls, context=context, **kwargs) self.ts = TimeStepper.from_conf(self.conf) nd = self.ts.n_digit format = '====== time %%e (step %%%dd of %%%dd) =====' % (nd, nd) self.format = format self.verbose = self.conf.verbose