User Manual: Code: Vertex.pm
From FLUX
(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.
| Field | Type | RW? | Description |
| line | Flux::Fluxon | ro | The fluxon that contains this vertex |
| prev | Flux::Vertex | ro | The previous vertex in the fluxon's list (or undef if this is the start) |
| next | Flux::Vertex | ro | The next vertex in the fluxon's list (or undef if this is the end) |
| x | 3-PDL | rw | The location of the vertex |
| neighbors | List ref | ro | A Perl list ref containing all the neighbors of this vertex according to current calculation |
| nearby | List ref | ro | A Perl list ref containing all the converse-neighbors of this vertex according to current calculation |
| scr | 3-PDL | rw | A scratchpad vector (used in hull calculation) |
| r | float | rw | A scratchpad radius (used in hull calculation) |
| a | float | rw | A scratchpad angle (used in hull calculation) |
| b_3-PDL | 3-PDL | rw | The calculated magnetic field at this location (if a magnetic field pseudoforce is in the WORLD's force list) |
| b_mag | float | rw | The calculated field strength at this location (if a magnetic field pseudoforce is in the WORLD's force list) |
| f_v | 3-PDL | rw | The calculated sum of vector-centered forces at this vertex |
| f_s | 3-PDL | rw | The calculated sum of segment-centered forces at the following segment (or 0 for end vertices) |
| f_t | 3-PDL | rw | The total force at this vertex (vertex force plus the average of following and prior segment forces) |
| f_s_tot | 3-PDL | rw | The sum-of-magnitudes of the component segment forces acting on the following segment |
| f_v_tot | float | rw | The sum-of-magnitudes of the component vertex forces acting on the vertex |
| r_v | float | rw | Relevant length scales for the vertex force components |
| r_s | float | rw | Relevant length scales for the segment force components |
| r_cl | float | rw | Stores the distance of closest approach of any neighbor |
| label | int | rw | The unique integer label for this vertex |
| links_sum | float | rw | Tree accumulator for the world vertex tree |
| links_n | int | rw | Count accumulator for the world vertex tree |
| links_up | Flux::Vertex | ro | UP link for the world vertex tree |
| links_left | Flux::Vertex | ro | LEFT link for the world vertex tree |
| links_right | Flux::Vertex | ro | RIGHT link for the world vertex tree |
| energy | float | rw | Calculated magnetic energy in the following segment (if an energy pseudoforce is in the WORLD's force list) |
| plan_step | 3-PDL | rw | Planned vector displacement at the next step (used for accelerated stepping) |
