flow 1.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
anderson_oracle.AndersonOracle Class Reference

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:

Detailed Description

§4 AndersonCore + the flow adapter, on host NumPy views of the solver's padded buffers.

Definition at line 204 of file anderson_oracle.py.

Constructor & Destructor Documentation

◆ __init__()

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.

Member Function Documentation

◆ mk()

anderson_oracle.AndersonOracle.mk ( self)

Definition at line 301 of file anderson_oracle.py.

References order.

◆ read()

anderson_oracle.AndersonOracle.read ( self)

Definition at line 304 of file anderson_oracle.py.

References views.

Referenced by step().

◆ write()

anderson_oracle.AndersonOracle.write ( self,
a )

Definition at line 307 of file anderson_oracle.py.

References ns, and views.

Referenced by step().

◆ pmean()

anderson_oracle.AndersonOracle.pmean ( self,
a )

Definition at line 311 of file anderson_oracle.py.

References fluid, gauged, NF, and pf.

Referenced by step().

◆ wdot()

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().

◆ usq()

◆ reset()

anderson_oracle.AndersonOracle.reset ( self)
§4.2 reset(): clears history + counters, keeps havePrev.

Definition at line 330 of file anderson_oracle.py.

References decCount, engaged, order, pending, rhoMin, peclet::flow::GpRowCensus.rhoMin, rhoPrev, and ritzCount.

Referenced by step().

◆ disable()

anderson_oracle.AndersonOracle.disable ( self,
reason = "disabled by the caller" )

Definition at line 340 of file anderson_oracle.py.

References pending, reason, and status.

◆ step()

Member Data Documentation

◆ s

◆ m

anderson_oracle.AndersonOracle.m = window

Definition at line 217 of file anderson_oracle.py.

Referenced by step().

◆ beta

anderson_oracle.AndersonOracle.beta = mixing

Definition at line 218 of file anderson_oracle.py.

Referenced by step().

◆ cP

anderson_oracle.AndersonOracle.cP = float(c_p)

Definition at line 219 of file anderson_oracle.py.

Referenced by wdot().

◆ gauged

anderson_oracle.AndersonOracle.gauged = bool(gauged)

Definition at line 220 of file anderson_oracle.py.

Referenced by pmean().

◆ sig

anderson_oracle.AndersonOracle.sig = tuple(signature)

Definition at line 221 of file anderson_oracle.py.

Referenced by step().

◆ sig_source

anderson_oracle.AndersonOracle.sig_source = tuple(signature)

Definition at line 222 of file anderson_oracle.py.

Referenced by step().

◆ ritz_action

anderson_oracle.AndersonOracle.ritz_action = ritz_action

Definition at line 229 of file anderson_oracle.py.

◆ ritz_would_fire

list anderson_oracle.AndersonOracle.ritz_would_fire = []

Definition at line 230 of file anderson_oracle.py.

◆ metric

anderson_oracle.AndersonOracle.metric = metric

Definition at line 233 of file anderson_oracle.py.

◆ ritz_scope

str anderson_oracle.AndersonOracle.ritz_scope = ritz_scope

Definition at line 234 of file anderson_oracle.py.

◆ ritz_floor

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.

◆ roles

list anderson_oracle.AndersonOracle.roles = [VELOCITY, VELOCITY, VELOCITY, PRESSURE if metric == "W" else CARRIED]

Definition at line 238 of file anderson_oracle.py.

◆ views

list anderson_oracle.AndersonOracle.views = []

Definition at line 241 of file anderson_oracle.py.

Referenced by read(), and write().

◆ shape

anderson_oracle.AndersonOracle.shape = shape

Definition at line 248 of file anderson_oracle.py.

◆ inner

anderson_oracle.AndersonOracle.inner = np.flatnonzero(inner.reshape(-1, order="F"))

◆ fluid

anderson_oracle.AndersonOracle.fluid = self.inner[sdf[self.inner] > 0.0]

Definition at line 257 of file anderson_oracle.py.

Referenced by pmean(), and wdot().

◆ NF

int anderson_oracle.AndersonOracle.NF = int(self.fluid.size)

Definition at line 258 of file anderson_oracle.py.

Referenced by pmean().

◆ ns

anderson_oracle.AndersonOracle.ns = len(names)

Definition at line 259 of file anderson_oracle.py.

Referenced by step(), and write().

◆ npad

list anderson_oracle.AndersonOracle.npad = self.views[0].size

Definition at line 260 of file anderson_oracle.py.

◆ vel

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().

◆ pf

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.

Referenced by pmean(), and wdot().

◆ X

anderson_oracle.AndersonOracle.X

Definition at line 265 of file anderson_oracle.py.

Referenced by step().

◆ Rprev

anderson_oracle.AndersonOracle.Rprev

Definition at line 265 of file anderson_oracle.py.

Referenced by step().

◆ Gprev

anderson_oracle.AndersonOracle.Gprev = z(), z(), z()

Definition at line 265 of file anderson_oracle.py.

Referenced by step().

◆ dR

list anderson_oracle.AndersonOracle.dR = [z() for _ in range(self.m)]

Definition at line 266 of file anderson_oracle.py.

Referenced by step().

◆ dG

list anderson_oracle.AndersonOracle.dG = [z() for _ in range(self.m)]

Definition at line 267 of file anderson_oracle.py.

Referenced by step().

◆ RR

anderson_oracle.AndersonOracle.RR = np.zeros((self.m, self.m))

Definition at line 269 of file anderson_oracle.py.

Referenced by step().

◆ GG

anderson_oracle.AndersonOracle.GG = np.zeros((self.m, self.m))

Definition at line 270 of file anderson_oracle.py.

Referenced by step().

◆ GR

anderson_oracle.AndersonOracle.GR = np.zeros((self.m, self.m))

Definition at line 271 of file anderson_oracle.py.

Referenced by step().

◆ mR

anderson_oracle.AndersonOracle.mR = np.zeros(self.m)

Definition at line 272 of file anderson_oracle.py.

Referenced by step().

◆ mG

anderson_oracle.AndersonOracle.mG = np.zeros(self.m)

Definition at line 273 of file anderson_oracle.py.

Referenced by step().

◆ mixedCol

list anderson_oracle.AndersonOracle.mixedCol = [False] * self.m

Definition at line 274 of file anderson_oracle.py.

Referenced by step().

◆ order

anderson_oracle.AndersonOracle.order = []

Definition at line 275 of file anderson_oracle.py.

Referenced by mk(), reset(), and step().

◆ havePrev

bool anderson_oracle.AndersonOracle.havePrev = False

Definition at line 276 of file anderson_oracle.py.

Referenced by step().

◆ pending

bool anderson_oracle.AndersonOracle.pending = False

Definition at line 277 of file anderson_oracle.py.

Referenced by disable(), reset(), and step().

◆ gamma

anderson_oracle.AndersonOracle.gamma = np.zeros(0)

Definition at line 278 of file anderson_oracle.py.

Referenced by step().

◆ engaged

bool anderson_oracle.AndersonOracle.engaged = False

Definition at line 279 of file anderson_oracle.py.

Referenced by reset(), and step().

◆ decCount

int anderson_oracle.AndersonOracle.decCount = 0

Definition at line 280 of file anderson_oracle.py.

Referenced by reset(), and step().

◆ rhoPrev

anderson_oracle.AndersonOracle.rhoPrev = math.inf

Definition at line 281 of file anderson_oracle.py.

Referenced by reset(), and step().

◆ rhoMin

anderson_oracle.AndersonOracle.rhoMin = math.inf

Definition at line 282 of file anderson_oracle.py.

Referenced by reset(), and step().

◆ numRestarts

int anderson_oracle.AndersonOracle.numRestarts = 0

Definition at line 283 of file anderson_oracle.py.

Referenced by step().

◆ numResets

int anderson_oracle.AndersonOracle.numResets = 0

Definition at line 284 of file anderson_oracle.py.

Referenced by step().

◆ ritzCount

int anderson_oracle.AndersonOracle.ritzCount = 0

Definition at line 285 of file anderson_oracle.py.

Referenced by reset().

◆ status

str anderson_oracle.AndersonOracle.status = "active"

Definition at line 286 of file anderson_oracle.py.

Referenced by disable(), and step().

◆ reason

str anderson_oracle.AndersonOracle.reason = ""

Definition at line 287 of file anderson_oracle.py.

Referenced by disable(), and step().

◆ residual

anderson_oracle.AndersonOracle.residual = math.inf

Definition at line 288 of file anderson_oracle.py.

Referenced by step().

◆ ritzRadius

anderson_oracle.AndersonOracle.ritzRadius = math.nan

Definition at line 289 of file anderson_oracle.py.

Referenced by step().

◆ zero_diag_drops

int anderson_oracle.AndersonOracle.zero_diag_drops = 0

Definition at line 291 of file anderson_oracle.py.

Referenced by step().

◆ cond_drops

int anderson_oracle.AndersonOracle.cond_drops = 0

Definition at line 292 of file anderson_oracle.py.

◆ ritz_max

float anderson_oracle.AndersonOracle.ritz_max = 0.0

Definition at line 293 of file anderson_oracle.py.

◆ sum_abs_alpha_max

float anderson_oracle.AndersonOracle.sum_abs_alpha_max = 0.0

Definition at line 294 of file anderson_oracle.py.

◆ mixed_steps

int anderson_oracle.AndersonOracle.mixed_steps = 0

Definition at line 295 of file anderson_oracle.py.

Referenced by step().

◆ calls

anderson_oracle.AndersonOracle.calls = 0

Definition at line 296 of file anderson_oracle.py.

Referenced by step().

◆ ritz_debug

anderson_oracle.AndersonOracle.ritz_debug = None

Definition at line 297 of file anderson_oracle.py.

◆ mk

int anderson_oracle.AndersonOracle.mk = 0:

Definition at line 480 of file anderson_oracle.py.

Referenced by step().


The documentation for this class was generated from the following file: