Skip to content

particula.gpu.kernels.parcel_ros3

Linearly implicit ROS3(2) for the closed warm parcel.

In normalized coordinates each row depends on local water, pressure and the weighted sum of class water. Eliminating pressure and solving for that sum gives an O(classes) solve for each of the three Rosenbrock increments. Warp differentiates the factorization as well as the stages on accepted-step replay.

Classes

NameDescription
_ROS3StagesNo description.
_ROS3StepperThree solves with one parcel linearization per trial or replay.
_ROS3TrialsNo description.

Functions

NameDescription
_back_substituteNo description.
_errorNo description.
_finishNo description.
_linearizeForm the local, pressure, shared-water and explicit time derivatives.
_reservoir_normNo description.
_water_incrementNo description.

_ROS3Stagesclassdataclass#

class _ROS3Stages(inverse: FloatVector, dp: FloatVector, dl: FloatVector, ft: FloatVector, base_rate: FloatVector, stage_rate: FloatVector, stage: FloatVector, old_liquid: FloatVector, stage_liquid: FloatVector, rhs: list, water: list, increments: list)

base_rateattributeinstance attribute#

base_rate: FloatVector

dlattributeinstance attribute#

dl: FloatVector

dpattributeinstance attribute#

dp: FloatVector

ftattributeinstance attribute#

ft: FloatVector

incrementsattributeinstance attribute#

increments: list

inverseattributeinstance attribute#

inverse: FloatVector

old_liquidattributeinstance attribute#

old_liquid: FloatVector

rhsattributeinstance attribute#

rhs: list

stageattributeinstance attribute#

stage: FloatVector

stage_liquidattributeinstance attribute#

stage_liquid: FloatVector

stage_rateattributeinstance attribute#

stage_rate: FloatVector

waterattributeinstance attribute#

water: list

__init__method#

def __init__(inverse: FloatVector, dp: FloatVector, dl: FloatVector, ft: FloatVector, base_rate: FloatVector, stage_rate: FloatVector, stage: FloatVector, old_liquid: FloatVector, stage_liquid: FloatVector, rhs: list, water: list, increments: list) -> None

_ROS3Stepperclass#

class _ROS3Stepper(_ParcelStepper)

Bases: _ParcelStepper

Three solves with one parcel linearization per trial or replay.

advancemethod#

def advance(state, t, h, out, work)

scratchmethod#

def scratch(grad=False)
Inherited from particula.gpu.kernels.parcel_rk23._ParcelStepper

deviceattributeinstance attribute#

device = device

dryattributeinstance attribute#

dry = self.array(initial.dry_radius)

initial_stateattributeinstance attribute#

initial_state = self.array(np.r_[1.0, water])

parcelattributeinstance attribute#

parcel = _Parcel()

seedattributeinstance attribute#

seed = self.array(np.r_[0.0, weights]) if gradient else None

speedattributeinstance attribute#

speed = self.array([speed], grad=gradient)

weightsattributeinstance attribute#

weights = self.array(weights)

widthattributeinstance attribute#

width = len(wet) + 1

__init__method#

def __init__(initial, wet, speed, device, gradient, exchange)

arraymethod#

def array(values, grad=False)

emptymethod#

def empty(shape, grad=False)

launchmethod#

def launch(kernel, dim, args, out)

ratemethod#

def rate(state, t, derivative, liquid)

record_stepmethodstaticmethod#

def record_step(checkpoints, accepted, start, t, h)

Keep one device checkpoint for each block of accepted intervals.

reversemethod#

def reverse(checkpoints)

Bound tape storage by replaying at most 32 accepted steps at once.

_ROS3Trialsclass#

class _ROS3Trials(solver, tolerance)

Bases: _TrialBatch

embeddedattributeinstance attribute#

embedded = solver.empty(solver.width)

error_waterattributeinstance attribute#

error_water = solver.empty(1)

new_waterattributeinstance attribute#

new_water = solver.empty(1)

workattributeinstance attribute#

work = solver.scratch()

__init__method#

def __init__(solver, tolerance)

trialmethod#

def trial(state, t, h, out, error)
Inherited from particula.gpu.kernels.parcel_rk23._TrialBatch

capacityattributeinstance attribute#

capacity = _BATCH_CAPACITY

errorsattributeinstance attribute#

errors = solver.empty((self.capacity, 1))

solverattributeinstance attribute#

solver = solver

statesattributeinstance attribute#

states = [solver.empty(solver.width) for _ in range(self.capacity)]

toleranceattributeinstance attribute#

tolerance = tolerance

evaluatemethod#

def evaluate(initial, start, target, proposed, count)

reuse_endpointmethod#

def reuse_endpoint()

Carry endpoint derivatives into the next candidate if available.

startmethod#

def start(state, t)

Prepare any reusable first-stage derivative.

_back_substitutefunction#

def _back_substitute(rhs: FloatVector, inv: FloatVector, dp: FloatVector, dl: FloatVector, liquid: FloatVector, result: FloatVector)

_errorfunction#

def _error(state: FloatVector, candidate: FloatVector, first: FloatVector, second: FloatVector, third: FloatVector, rtol: F, embedded: FloatVector, norm: FloatVector)

_finishfunction#

def _finish(state: FloatVector, first: FloatVector, second: FloatVector, third: FloatVector, out: FloatVector)

_linearizefunction#

def _linearize(state: FloatVector, liquid: FloatVector, rate: FloatVector, dry: FloatVector, speed: FloatVector, parcel: _Parcel, time: F, h: F, inverse_diagonal: FloatVector, pressure_column: FloatVector, liquid_column: FloatVector, partial_time: FloatVector)

Form the local, pressure, shared-water and explicit time derivatives.

_reservoir_normfunction#

def _reservoir_norm(old: FloatVector, new_liquid: FloatVector, error: FloatVector, speed: FloatVector, parcel: _Parcel, t: F, h: F, rtol: F, norm: FloatVector)

_water_incrementfunction#

def _water_increment(rhs: FloatVector, inv: FloatVector, dp: FloatVector, dl: FloatVector, weights: FloatVector, result: FloatVector)