|
flow 1.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
|
Public Member Functions | |
| __init__ (self, solver, *, window=5, mixing=1.0, signature, c_p, gauged, collocated_advection, cells, metric="V", ritz_scope="mixed", inner_tolerance=0.0, ritz_action="stop") | |
| mk (self) | |
| read (self) | |
| write (self, a) | |
| pmean (self, a) | |
| wdot (self, a, b, ma, mb) | |
| usq (self, g) | |
| reset (self) | |
| disable (self, reason="disabled by the caller") | |
| step (self, accelerate) | |
Public Attributes | |
| s = solver | |
| m = window | |
| beta = mixing | |
| cP = float(c_p) | |
| gauged = bool(gauged) | |
| sig = tuple(signature) | |
| sig_source = tuple(signature) | |
| ritz_action = ritz_action | |
| list | ritz_would_fire = [] |
| metric = metric | |
| str | ritz_scope = ritz_scope |
| ritz_floor = max(K_NOISE_FLOOR, K_RITZ_FLOOR_FACTOR * float(inner_tolerance)) | |
| list | roles = [VELOCITY, VELOCITY, VELOCITY, PRESSURE if metric == "W" else CARRIED] |
| list | views = [] |
| shape = shape | |
| inner = np.flatnonzero(inner.reshape(-1, order="F")) | |
| fluid = self.inner[sdf[self.inner] > 0.0] | |
| int | NF = int(self.fluid.size) |
| ns = len(names) | |
| list | npad = self.views[0].size |
| list | vel = [f for f in range(self.ns) if self.roles[f] == VELOCITY] |
| list | pf = [f for f in range(self.ns) if self.roles[f] == PRESSURE] |
| X | |
| Rprev | |
| Gprev = z(), z(), z() | |
| list | dR = [z() for _ in range(self.m)] |
| list | dG = [z() for _ in range(self.m)] |
| RR = np.zeros((self.m, self.m)) | |
| GG = np.zeros((self.m, self.m)) | |
| GR = np.zeros((self.m, self.m)) | |
| mR = np.zeros(self.m) | |
| mG = np.zeros(self.m) | |
| list | mixedCol = [False] * self.m |
| list | order = [] |
| bool | havePrev = False |
| bool | pending = False |
| gamma = np.zeros(0) | |
| bool | engaged = False |
| int | decCount = 0 |
| rhoPrev = math.inf | |
| rhoMin = math.inf | |
| int | numRestarts = 0 |
| int | numResets = 0 |
| int | ritzCount = 0 |
| str | status = "active" |
| str | reason = "" |
| residual = math.inf | |
| ritzRadius = math.nan | |
| int | zero_diag_drops = 0 |
| int | cond_drops = 0 |
| float | ritz_max = 0.0 |
| float | sum_abs_alpha_max = 0.0 |
| int | mixed_steps = 0 |
| int | calls = 0 |
| ritz_debug = None | |
| int | mk = 0: |
§4 AndersonCore + the flow adapter, on host NumPy views of the solver's padded buffers.
Definition at line 204 of file anderson_oracle.py.
| anderson_oracle.AndersonOracle.__init__ | ( | self, | |
| solver, | |||
| * | , | ||
| window = 5, | |||
| mixing = 1.0, | |||
| signature, | |||
| c_p, | |||
| gauged, | |||
| collocated_advection, | |||
| cells, | |||
| metric = "V", | |||
| ritz_scope = "mixed", | |||
| inner_tolerance = 0.0, | |||
| ritz_action = "stop" ) |
Definition at line 207 of file anderson_oracle.py.
| anderson_oracle.AndersonOracle.mk | ( | self | ) |
Definition at line 301 of file anderson_oracle.py.
References order.
| anderson_oracle.AndersonOracle.read | ( | self | ) |
| anderson_oracle.AndersonOracle.write | ( | self, | |
| a ) |
| anderson_oracle.AndersonOracle.pmean | ( | self, | |
| a ) |
| anderson_oracle.AndersonOracle.wdot | ( | self, | |
| a, | |||
| b, | |||
| ma, | |||
| mb ) |
§3.2 <a,b>_W: velocity at unit weight over inner entries + c_P^2 x the centred fluid-cell pressure product.
Definition at line 316 of file anderson_oracle.py.
References cP, fluid, inner, Level.inner, peclet::flow::BottomLabelKernel.inner, peclet::flow::BottomLevel.inner, peclet::flow::CutcellMG::Level.inner, peclet::flow::ScalarMG::Level.inner, peclet::flow::VelocityMG::Level.inner, pf, vel, and peclet::flow::Solver< Grid >::ScalarFaceFlux.vel.
Referenced by step().
| anderson_oracle.AndersonOracle.usq | ( | self, | |
| g ) |
Definition at line 327 of file anderson_oracle.py.
References inner, Level.inner, peclet::flow::BottomLabelKernel.inner, peclet::flow::BottomLevel.inner, peclet::flow::CutcellMG::Level.inner, peclet::flow::ScalarMG::Level.inner, peclet::flow::VelocityMG::Level.inner, vel, and peclet::flow::Solver< Grid >::ScalarFaceFlux.vel.
Referenced by step().
| anderson_oracle.AndersonOracle.reset | ( | self | ) |
| anderson_oracle.AndersonOracle.disable | ( | self, | |
| reason = "disabled by the caller" ) |
Definition at line 340 of file anderson_oracle.py.
| anderson_oracle.AndersonOracle.step | ( | self, | |
| accelerate ) |
Definition at line 346 of file anderson_oracle.py.
References beta, calls, peclet::flow::Solver< Grid >::PhaseChangeBudget.calls, peclet::flow::vof::VofCurvature::Timing.calls, decCount, dG, dR, engaged, gamma, GG, Gprev, GR, havePrev, inner, Level.inner, peclet::flow::BottomLabelKernel.inner, peclet::flow::BottomLevel.inner, peclet::flow::CutcellMG::Level.inner, peclet::flow::ScalarMG::Level.inner, peclet::flow::VelocityMG::Level.inner, m, HostGeo::Member.m, Plane.m, mG, mixed_steps, mixedCol, mk, mR, ns, numResets, numRestarts, order, pending, pmean(), read(), reason, reset(), peclet::flow::AndersonAccelerator< Grid >.reset(), residual, peclet::flow::ScalarCutState.residual, rhoMin, peclet::flow::GpRowCensus.rhoMin, rhoPrev, ritzRadius, Rprev, RR, anderson_oracle.run_map(), s, HostBottom.s, peclet::flow::BcVelFace.s, peclet::flow::bindings::Diagnostics< Grid >.s, peclet::flow::BottomDirect< FacReal >.s, peclet::flow::BottomPlanes.s, peclet::flow::LineRowFp32.s, peclet::flow::LineRowFp64< OpV >.s, peclet::flow::ScalarVec.s, peclet::flow::vof::VofMoveJob.s, Rng.s, sig, sig_source, status, usq(), wdot(), write(), X, and zero_diag_drops.
| anderson_oracle.AndersonOracle.s = solver |
Definition at line 216 of file anderson_oracle.py.
Referenced by gsv1.StepMap.__call__(), vof_profile.Scale.bodyforce(), vof_surface_tension.Scale.bodyforce(), anderson_synthetic_maps._Diag.field_view(), vof_surface_tension.Scale.len_to_cells(), vof_profile.Scale.mu(), vof_surface_tension.Scale.mu(), mac2d.Case.phi(), vof_profile.Scale.sigma(), vof_surface_tension.Scale.sigma(), step(), vof_surface_tension.Scale.vel_to_phys(), and gsv1.Case.xi().
| anderson_oracle.AndersonOracle.m = window |
Definition at line 217 of file anderson_oracle.py.
Referenced by step().
| anderson_oracle.AndersonOracle.beta = mixing |
Definition at line 218 of file anderson_oracle.py.
Referenced by step().
| anderson_oracle.AndersonOracle.cP = float(c_p) |
Definition at line 219 of file anderson_oracle.py.
Referenced by wdot().
| anderson_oracle.AndersonOracle.gauged = bool(gauged) |
Definition at line 220 of file anderson_oracle.py.
Referenced by pmean().
| anderson_oracle.AndersonOracle.sig = tuple(signature) |
Definition at line 221 of file anderson_oracle.py.
Referenced by step().
| anderson_oracle.AndersonOracle.sig_source = tuple(signature) |
Definition at line 222 of file anderson_oracle.py.
Referenced by step().
| anderson_oracle.AndersonOracle.ritz_action = ritz_action |
Definition at line 229 of file anderson_oracle.py.
| list anderson_oracle.AndersonOracle.ritz_would_fire = [] |
Definition at line 230 of file anderson_oracle.py.
| anderson_oracle.AndersonOracle.metric = metric |
Definition at line 233 of file anderson_oracle.py.
| str anderson_oracle.AndersonOracle.ritz_scope = ritz_scope |
Definition at line 234 of file anderson_oracle.py.
| anderson_oracle.AndersonOracle.ritz_floor = max(K_NOISE_FLOOR, K_RITZ_FLOOR_FACTOR * float(inner_tolerance)) |
Definition at line 236 of file anderson_oracle.py.
| list anderson_oracle.AndersonOracle.roles = [VELOCITY, VELOCITY, VELOCITY, PRESSURE if metric == "W" else CARRIED] |
Definition at line 238 of file anderson_oracle.py.
| list anderson_oracle.AndersonOracle.views = [] |
Definition at line 241 of file anderson_oracle.py.
| anderson_oracle.AndersonOracle.shape = shape |
Definition at line 248 of file anderson_oracle.py.
| anderson_oracle.AndersonOracle.inner = np.flatnonzero(inner.reshape(-1, order="F")) |
Definition at line 255 of file anderson_oracle.py.
Referenced by anderson_synthetic_maps.LinearMapSolver.monitor(), anderson_synthetic_maps.LinearMapSolver.monitor_exact(), step(), anderson_synthetic_maps.LinearMapSolver.step(), usq(), and wdot().
| anderson_oracle.AndersonOracle.fluid = self.inner[sdf[self.inner] > 0.0] |
Definition at line 257 of file anderson_oracle.py.
| int anderson_oracle.AndersonOracle.NF = int(self.fluid.size) |
Definition at line 258 of file anderson_oracle.py.
Referenced by pmean().
| anderson_oracle.AndersonOracle.ns = len(names) |
Definition at line 259 of file anderson_oracle.py.
| list anderson_oracle.AndersonOracle.npad = self.views[0].size |
Definition at line 260 of file anderson_oracle.py.
| anderson_oracle.AndersonOracle.vel = [f for f in range(self.ns) if self.roles[f] == VELOCITY] |
Definition at line 261 of file anderson_oracle.py.
Referenced by mac2d.Case.face_avg(), mac2dc.CircleCase.face_avg(), usq(), and wdot().
| anderson_oracle.AndersonOracle.pf = [f for f in range(self.ns) if self.roles[f] == PRESSURE] |
Definition at line 262 of file anderson_oracle.py.
| anderson_oracle.AndersonOracle.X |
Definition at line 265 of file anderson_oracle.py.
Referenced by step().
| anderson_oracle.AndersonOracle.Rprev |
Definition at line 265 of file anderson_oracle.py.
Referenced by step().
| anderson_oracle.AndersonOracle.Gprev = z(), z(), z() |
Definition at line 265 of file anderson_oracle.py.
Referenced by step().
| list anderson_oracle.AndersonOracle.dR = [z() for _ in range(self.m)] |
Definition at line 266 of file anderson_oracle.py.
Referenced by step().
| list anderson_oracle.AndersonOracle.dG = [z() for _ in range(self.m)] |
Definition at line 267 of file anderson_oracle.py.
Referenced by step().
| anderson_oracle.AndersonOracle.RR = np.zeros((self.m, self.m)) |
Definition at line 269 of file anderson_oracle.py.
Referenced by step().
| anderson_oracle.AndersonOracle.GG = np.zeros((self.m, self.m)) |
Definition at line 270 of file anderson_oracle.py.
Referenced by step().
| anderson_oracle.AndersonOracle.GR = np.zeros((self.m, self.m)) |
Definition at line 271 of file anderson_oracle.py.
Referenced by step().
| anderson_oracle.AndersonOracle.mR = np.zeros(self.m) |
Definition at line 272 of file anderson_oracle.py.
Referenced by step().
| anderson_oracle.AndersonOracle.mG = np.zeros(self.m) |
Definition at line 273 of file anderson_oracle.py.
Referenced by step().
| list anderson_oracle.AndersonOracle.mixedCol = [False] * self.m |
Definition at line 274 of file anderson_oracle.py.
Referenced by step().
| anderson_oracle.AndersonOracle.order = [] |
Definition at line 275 of file anderson_oracle.py.
| bool anderson_oracle.AndersonOracle.havePrev = False |
Definition at line 276 of file anderson_oracle.py.
Referenced by step().
| bool anderson_oracle.AndersonOracle.pending = False |
Definition at line 277 of file anderson_oracle.py.
| anderson_oracle.AndersonOracle.gamma = np.zeros(0) |
Definition at line 278 of file anderson_oracle.py.
Referenced by step().
| bool anderson_oracle.AndersonOracle.engaged = False |
Definition at line 279 of file anderson_oracle.py.
| int anderson_oracle.AndersonOracle.decCount = 0 |
Definition at line 280 of file anderson_oracle.py.
| anderson_oracle.AndersonOracle.rhoPrev = math.inf |
Definition at line 281 of file anderson_oracle.py.
| anderson_oracle.AndersonOracle.rhoMin = math.inf |
Definition at line 282 of file anderson_oracle.py.
| int anderson_oracle.AndersonOracle.numRestarts = 0 |
Definition at line 283 of file anderson_oracle.py.
Referenced by step().
| int anderson_oracle.AndersonOracle.numResets = 0 |
Definition at line 284 of file anderson_oracle.py.
Referenced by step().
| int anderson_oracle.AndersonOracle.ritzCount = 0 |
Definition at line 285 of file anderson_oracle.py.
Referenced by reset().
| str anderson_oracle.AndersonOracle.status = "active" |
Definition at line 286 of file anderson_oracle.py.
| str anderson_oracle.AndersonOracle.reason = "" |
Definition at line 287 of file anderson_oracle.py.
| anderson_oracle.AndersonOracle.residual = math.inf |
Definition at line 288 of file anderson_oracle.py.
Referenced by step().
| anderson_oracle.AndersonOracle.ritzRadius = math.nan |
Definition at line 289 of file anderson_oracle.py.
Referenced by step().
| int anderson_oracle.AndersonOracle.zero_diag_drops = 0 |
Definition at line 291 of file anderson_oracle.py.
Referenced by step().
| int anderson_oracle.AndersonOracle.cond_drops = 0 |
Definition at line 292 of file anderson_oracle.py.
| float anderson_oracle.AndersonOracle.ritz_max = 0.0 |
Definition at line 293 of file anderson_oracle.py.
| float anderson_oracle.AndersonOracle.sum_abs_alpha_max = 0.0 |
Definition at line 294 of file anderson_oracle.py.
| int anderson_oracle.AndersonOracle.mixed_steps = 0 |
Definition at line 295 of file anderson_oracle.py.
Referenced by step().
| anderson_oracle.AndersonOracle.calls = 0 |
Definition at line 296 of file anderson_oracle.py.
Referenced by step().
| anderson_oracle.AndersonOracle.ritz_debug = None |
Definition at line 297 of file anderson_oracle.py.
| int anderson_oracle.AndersonOracle.mk = 0: |
Definition at line 480 of file anderson_oracle.py.
Referenced by step().