User Manual: Code: Vertex.pm

From FLUX

Jump to: navigation, search

(back to the User Manual or the code section)

Vertex.pm (and its associated XS file, Vertex.xs) implements the Flux::Vertex object. It consists mostly of methods that act specifically on one vertex.

Flux::Vertex objects are tied hash refs, so you can read and manipulate all of the data fields in the underlying VERTEX struct via hash keys in Perl.

All Flux::Vertex objects have a unique integer label each. Vertex labels between -9 and 0, inclusive, are reserved for internal use of FLUX. In particular, the vertices -1 and -2 are used for the image segment used by the photospheric boundary code.

Contents

Hash structure

In addition to the basics of location, label fluxon association and links along the fluxon, vertices contain fields describing the web of neighbor relations and many vectors relevant to the force and relaxation-step calculations. The hash elements follow closely the VERTEX data structure defined in the C library.

FieldTypeRW?Description
lineFlux::Fluxonro The fluxon that contains this vertex
prevFlux::Vertexro The previous vertex in the fluxon's list (or undef if this is the start)
nextFlux::Vertexro The next vertex in the fluxon's list (or undef if this is the end)
x3-PDLrw The location of the vertex
neighborsList refro A Perl list ref containing all the neighbors of this vertex according to current calculation
nearbyList refro A Perl list ref containing all the converse-neighbors of this vertex according to current calculation
scr3-PDLrw A scratchpad vector (used in hull calculation)
rfloatrw A scratchpad radius (used in hull calculation)
afloatrw A scratchpad angle (used in hull calculation)
b_3-PDL3-PDLrw The calculated magnetic field at this location (if a magnetic field pseudoforce is in the WORLD's force list)
b_magfloatrw The calculated field strength at this location (if a magnetic field pseudoforce is in the WORLD's force list)
f_v3-PDLrw The calculated sum of vector-centered forces at this vertex
f_s3-PDLrw The calculated sum of segment-centered forces at the following segment (or 0 for end vertices)
f_t3-PDLrw The total force at this vertex (vertex force plus the average of following and prior segment forces)
f_s_tot3-PDLrw The sum-of-magnitudes of the component segment forces acting on the following segment
f_v_totfloatrw The sum-of-magnitudes of the component vertex forces acting on the vertex
r_vfloatrw Relevant length scales for the vertex force components
r_sfloatrw Relevant length scales for the segment force components
r_clfloatrw Stores the distance of closest approach of any neighbor
labelintrw The unique integer label for this vertex
links_sumfloatrw Tree accumulator for the world vertex tree
links_nintrw Count accumulator for the world vertex tree
links_upFlux::Vertexro UP link for the world vertex tree
links_leftFlux::Vertexro LEFT link for the world vertex tree
links_rightFlux::Vertexro RIGHT link for the world vertex tree
energyfloatrw Calculated magnetic energy in the following segment (if an energy pseudoforce is in the WORLD's force list)
plan_step3-PDLrw Planned vector displacement at the next step (used for accelerated stepping)

Methods

Constructors & I/O

stringify

plot_neighbors

Access methods (deprecated)

id

fluxon

prev

next

neighbors

nearby

x

Calculations

hull

projmatrix

proj_neighbors

Manipulation

add_vertex_after

reconnect

Personal tools