zoomy_core.model.basefunction

zoomy_core.model.basefunction#

Module zoomy_core.model.basefunction.

Module Contents#

Classes#

Function

Function. (class).

KernelRef

A registered function used as a VALUE (e.g. handed to a solver block that maps it over cells or faces): printed as <owner>.<name>; the backend resolves the name to its compiled kernel.

KernelCall

An entry of a registrar’s call namespace; wraps one registered Function (looked up by name, so a refreshed registry is seen).

SymbolicRegistrar

SymbolicRegistrar. (class).

Functions#

listify

Listify.

placeholder_call

The opaque call full_name(*args) standing for a registered function: one element read per entry when the definition is an array. The printer emits it as a call, or splices the definition back in (resolve_opaque). No arguments -> the definition itself.

API#

zoomy_core.model.basefunction.listify(expr)#

Listify.

class zoomy_core.model.basefunction.Function(**params)#

Bases: param.Parameterized

Function. (class).

Initialization

Initialize the instance.

name#

‘String(…)’

args#

‘ClassSelector(…)’

definition#

‘Parameter(…)’

property is_empty#

True when there is no definition, an empty array, or every entry is identically zero (a zero kernel contributes nothing).

class zoomy_core.model.basefunction.KernelRef#

Bases: sympy.Symbol

A registered function used as a VALUE (e.g. handed to a solver block that maps it over cells or faces): printed as <owner>.<name>; the backend resolves the name to its compiled kernel.

property owner#
property slot#
zoomy_core.model.basefunction.placeholder_call(full_name, definition, *input_args)#

The opaque call full_name(*args) standing for a registered function: one element read per entry when the definition is an array. The printer emits it as a call, or splices the definition back in (resolve_opaque). No arguments -> the definition itself.

class zoomy_core.model.basefunction.KernelCall(owner, functions, name, call_name=None)#

An entry of a registrar’s call namespace; wraps one registered Function (looked up by name, so a refreshed registry is seen).

  • called with symbolic arguments -> the placeholder call;

  • used as a value in a sympy expression -> the printable reference KernelRef('<owner>.<name>') (sympy’s _sympy_ hook). This is how a solver template hands a kernel to a block.

Initialization

class zoomy_core.model.basefunction.SymbolicRegistrar#

SymbolicRegistrar. (class).

register_symbolic_function(name, method_ref, sig_struct)#

functions[name] holds the definition, call[name] the placeholder caller / kernel reference.