xhorizon.shell_junction.active_slice_class module
This module defines a class used for evaluating coordinate transformations at null shell junctions.
- class xhorizon.shell_junction.active_slice_class.active_slice(reg, ublocks=[], vblocks=[], r0=nan, u0=nan, v0=nan, U0=None, V0=None, mu=0.0, r_refs=[])
Bases:
objectClass for handling shell and corner slicing of SSS regions. Given the region and the slice parameters, reference arrays are created for all desired transformations, which are then defined by interpolation and extrapolation of the reference arrays.
Unlike passive_slice, this will actively obtain new functions U(udl),V(vdl) based on the inputs U0,V0, rather than just reading the existing ones.
Designed to simultaneously incorporate both shell and corner junctions. Input determines which behavior will take effect. Offers protection from bad inputs in most cases. The exception is that the correct ublocks and vblocks have to be given or everything will come out whacky.
- Slice Location:
The location of the slice is determined by the values r0,u0,v0. These describe a point with coordinates (u0,v0) in some block, and with radius r0. The values are forced to be self-consistent by the algorithm. In corner junction mode, this is the corner point. Otherwise, it just describes a point on the shell. In shell mode, r0 and (u0 xor v0) can be nan, in which case the parameters just specify the shell. To fully specify the point we need to know what block it’s in. So correct ublock and vblock args are needed.
- Slice Location Input Requirements:
u0==finite xor v0==finite # avoids overspecifying a nonphysical point (optional in shell mode) r0==finite # if finite, used to determine the other one of u0,v0
- Corner Junction Mode Input Requirements:
r0==finite # corner junction point radius u0==finite xor v0==finite # corner junction coordinate value U0 not None # function U0(r) at v=v0 V0 not None # function V0(r) at u=u0 ublocks==[correct] # the correct list of block indices must be provided vblocks==[correct] # the correct list of block indices must be provided
- Shell Junction Mode Input Requirements:
- For example, suppose we want a shell junction at v=v0.
(v0==finite) xor (r0==finite and u0==finite) # either of these uniquely determines the value v=v0 for the shell U0 not None # function U0(r) at v=v0 shell vblocks==[correct] # the correct list of block indices must be provided
For shell at u=u0, just switch u’s and v’s.
- Inputs:
reg = The region being sliced. ublocks = List of indices (corresponding to reg.blocks) for the blocks containing the u=u0 slice. vblocks = List of indices (corresponding to reg.blocks) for the blocks containing the v=v0 slice. r0 = Radius of the junction corner point. Or, radius of the specified point on the shell in shell mode. See above. u0 = Slice location coordinate. See above. v0 = Slice location coordinate. See above. U0 = Function U0(r) at v=v0, or None. When None, U(udl) = udl. V0 = Function V0(r) at u=u0, or None. When None, V(vdl) = vdl. mu = Extrapolation parameter. When mu=0, extrapolation is just translation. When mu->inf, extrapolation is smooth linear.
(See interpolators module).
- Methods:
Provides various coordinate transformation methods, which can be used by a region.
- Attributes:
Input parameters as well as various reference arrays.
- U_of_udl_at_v0(udl)
Evaluate the function U(udl) = U(r(udl,vdl0)) by interpolating from stored reference values. Smooth interpolation and extrapolation handled by interpolators module.
- V_of_vdl_at_u0(vdl)
Evaluate the function V(vdl) = V(r(udl0,vdl)) by interpolating from stored reference values. Smooth interpolation and extrapolation handled by interpolators module.
- UV_of_uvdl(uvdl)
Combine U(udl) and V(vdl) into UV(uvdl).
- U_of_r_at_v0(r)
Evaluate the function U(r) at v0 by interpolating from stored reference values. Smooth interpolation and extrapolation handled by interpolators module. Setting mu to nan because this should not be extrapolated.
- V_of_r_at_u0(r)
Evaluate the function V(r) at u0 by interpolating from stored reference values. Smooth interpolation and extrapolation handled by interpolators module. Setting mu to nan because this should not be extrapolated.