MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / Integrate

Method Integrate

python/timestepping.py:29–43  ·  view source on GitHub ↗
(self, u_start: ngs.GridFunction,
                  end_time: float,
                  start_time: Optional[float] = None,
                  newton_args: Optional[dict] = None,
                  callback: Optional[Callable] = None)

Source from the content-addressed store, hash-verified

27 self._lin_solver_args = lin_solver_args
28
29 def Integrate(self, u_start: ngs.GridFunction,
30 end_time: float,
31 start_time: Optional[float] = None,
32 newton_args: Optional[dict] = None,
33 callback: Optional[Callable] = None):
34 u = u_start
35 if start_time is not None:
36 self.time.Set(start_time)
37 while self.time.Get() < end_time * (1-1e-10):
38 dt = min(self.dt.Get(), end_time - self.time.Get())
39 self.time.Set(self.time.Get() + dt)
40 self.Step(u, dt=dt, newton_args=newton_args)
41 if callback is not None:
42 callback(self.time.Get(), u)
43 return u
44
45 def Step(self, u: ngs.GridFunction, dt: Optional[float] = None,
46 newton_args: Optional[dict] = None):

Callers

nothing calls this directly

Calls 3

StepMethod · 0.95
SetMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected