// // time: Wed Apr 24 07:55:35 1996 // // version: 3.0.0 (format), 3.1.0 (DX) // // // Begin MDF // MODULE StreamlineArrow // CATEGORY Realization // DESCRIPTION Creates streamlines with arrows showing direction // INPUT vector_field; field; (none); vector field // INPUT seeds[visible:0]; integer; 10; number of seed points for starting streamlines // INPUT time[visible:0]; scalar; (infinity); ending time for streamlines // INPUT arrows[visible:0]; integer; 4; number of arrows per streamline // INPUT stepscale[visible:0]; value; .1; step length as fraction of element size // INPUT scale[visible:0]; value list or field; 1.0; scale of arrows on lines // INPUT color[visible:0]; field or vector or string; (no default); color of streamlines and arrows // OUTPUT lines; group; the resulting streamline(s) // End MDF // // comment: Generates streamlines, optionally colored (e.g., fixed or pseudo-colored by magnitude), which show the direction of the vector field with small arrows. In some sense, this tool emulates the well-known and venerable STRMLN function of NCAR graphics. Currently this tool only operates correctly with 2d vector // comment: (C) COPYRIGHT International Business Machines Corp. 1996. // comment: All Rights Reserved. // comment: Licensed Materials - Property of IBM // comment: // comment: Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the software without specific prior written permission. // comment: // comment: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THE SOFTWARE, BOTH INDIVIDUALLY AND AS ONE OR MORE GROUPS, "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IBM DOES NOT WARRANT AGAINST THE INFRINGMENT OF PATENTS, COPYRIGHT OR ANY OTHER INTELLECTUAL PROPERTY RIGHTS OF OTHERS. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE, BOTH INDIVIDUALLY AND AS ONE OR MORE GROUPS, IS WITH YOU. fields. // workspace: width = 942, height = 781 // layout: snap = 0, width = 50, height = 50, align = UL // macro StreamlineArrow( vector_field ,seeds = 10 ,time ,arrows = 4 ,stepscale = .1 ,scale = 1.0 ,color ) -> ( lines ) { // // node Input[1]: x = 63, y = 0, inputs = 0, label = Input // parameter: position = 1, name = 'vector_field', value = ' ', descriptive = 0, description = 'vector field', required = 1, visible = 1 // StreamlineArrow_Input_1_out_1 = vector_field; // // node Transmitter[7]: x = 1, y = 70, inputs = 1, label = VectorField // VectorField = StreamlineArrow_Input_1_out_1; // // node Receiver[23]: x = 335, y = 0, inputs = 1, label = VectorField // StreamlineArrow_Receiver_23_out_1 = VectorField; // // node Compute[21]: x = 342, y = 112, inputs = 2, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "-$0" // expression: value = -a // name[2]: value = a // StreamlineArrow_Compute_21_out_1 = Compute( "-$0", StreamlineArrow_Receiver_23_out_1 ) [instance: 21, cache: 1]; // // node Input[2]: x = 545, y = 1, inputs = 0, label = Input // parameter: position = 2, name = 'seeds', value = '10', descriptive = 0, description = 'number of seed points for starting streamlines', required = 0, visible = 0 // StreamlineArrow_Input_2_out_1 = seeds; // // node Sample[5]: x = 496, y = 113, inputs = 2, label = Sample // StreamlineArrow_Sample_5_out_1 = Sample( StreamlineArrow_Receiver_23_out_1, StreamlineArrow_Input_2_out_1 ) [instance: 5, cache: 1]; // // node Input[3]: x = 461, y = 0, inputs = 0, label = Input // parameter: position = 3, name = 'time', value = '(infinity)', descriptive = 1, description = 'ending time for streamlines', required = 0, visible = 0 // StreamlineArrow_Input_3_out_1 = time; // // node Input[29]: x = 616, y = 21, inputs = 0, label = Input // parameter: position = 5, name = 'stepscale', value = '.1', descriptive = 0, description = 'step length as fraction of element size', required = 0, visible = 0 // StreamlineArrow_Input_29_out_1 = stepscale; // // node Streamline[2]: x = 374, y = 316, inputs = 7, label = Streamline // input[3]: visible = 0 // input[5]: visible = 0 // input[6]: visible = 0 // StreamlineArrow_Streamline_2_out_1 = Streamline( StreamlineArrow_Compute_21_out_1, StreamlineArrow_Sample_5_out_1, NULL, StreamlineArrow_Input_3_out_1, NULL, NULL, StreamlineArrow_Input_29_out_1 ) [instance: 2, cache: 1]; // // node Compute[22]: x = 373, y = 400, inputs = 2, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "-$0" // expression: value = -a // name[2]: value = a // StreamlineArrow_Compute_22_out_1 = Compute( "-$0", StreamlineArrow_Streamline_2_out_1 ) [instance: 22, cache: 1]; // // node Streamline[1]: x = 529, y = 374, inputs = 7, label = Streamline // input[3]: visible = 0 // input[5]: visible = 0 // input[6]: visible = 0 // StreamlineArrow_Streamline_1_out_1 = Streamline( StreamlineArrow_Receiver_23_out_1, StreamlineArrow_Sample_5_out_1, NULL, StreamlineArrow_Input_3_out_1, NULL, NULL, StreamlineArrow_Input_29_out_1 ) [instance: 1, cache: 1]; // // node Collect[4]: x = 499, y = 455, inputs = 3, label = Collect // input[3]: visible = 0 // StreamlineArrow_Collect_4_out_1 = Collect( StreamlineArrow_Compute_22_out_1, StreamlineArrow_Streamline_1_out_1, NULL ) [instance: 4, cache: 1]; // // node Input[31]: x = 719, y = 204, inputs = 0, label = Input // parameter: position = 7, name = 'color', value = '(no default)', descriptive = 1, description = 'color of streamlines and arrows', required = 0, visible = 0 // StreamlineArrow_Input_31_out_1 = color; // // node Color[14]: x = 552, y = 568, inputs = 5, label = Color // input[3]: visible = 0 // StreamlineArrow_Color_14_out_1 = Color( StreamlineArrow_Collect_4_out_1, StreamlineArrow_Input_31_out_1, NULL, NULL, NULL ) [instance: 14, cache: 1]; // // node Transmitter[6]: x = 432, y = 555, inputs = 1, label = streams // streams = StreamlineArrow_Collect_4_out_1; // // node Receiver[11]: x = 763, y = 0, inputs = 1, label = streams // StreamlineArrow_Receiver_11_out_1 = streams; // // node Input[4]: x = 841, y = 0, inputs = 0, label = Input // parameter: position = 4, name = 'arrows', value = '4', descriptive = 0, description = 'number of arrows per streamline', required = 0, visible = 0 // StreamlineArrow_Input_4_out_1 = arrows; // // node Sample[3]: x = 803, y = 99, inputs = 2, label = Sample // StreamlineArrow_Sample_3_out_1 = Sample( StreamlineArrow_Receiver_11_out_1, StreamlineArrow_Input_4_out_1 ) [instance: 3, cache: 1]; // // node Color[12]: x = 802, y = 290, inputs = 5, label = Color // input[3]: visible = 0 // StreamlineArrow_Color_12_out_1 = Color( StreamlineArrow_Sample_3_out_1, StreamlineArrow_Input_31_out_1, NULL, NULL, NULL ) [instance: 12, cache: 1]; // // node Compute[23]: x = 779, y = 416, inputs = 2, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "norm($0)" // expression: value = norm(a) // name[2]: value = a // StreamlineArrow_Compute_23_out_1 = Compute( "norm($0)", StreamlineArrow_Color_12_out_1 ) [instance: 23, cache: 1]; // // node Construct[5]: x = 865, y = 182, inputs = 4, label = Construct // input[1]: defaulting = 0, visible = 0, type = 16777224, value = {[-1,-.1],[0,0],[1,-.1]} // input[2]: visible = 0 // input[3]: defaulting = 0, visible = 0, type = 1, value = 3 // input[4]: visible = 0 // StreamlineArrow_Construct_5_out_1 = Construct( {[-1,-.1],[0,0],[1,-.1]}, NULL, 3, NULL ) [instance: 5, cache: 1]; // // node Connect[3]: x = 876, y = 269, inputs = 3, label = Connect // input[2]: visible = 0 // input[3]: visible = 0 // StreamlineArrow_Connect_3_out_1 = Connect( StreamlineArrow_Construct_5_out_1, NULL, NULL ) [instance: 3, cache: 1]; // // node Mark[1]: x = 108, y = 68, inputs = 2, label = Mark // input[2]: defaulting = 0, visible = 1, type = 32, value = "positions" // StreamlineArrow_Mark_1_out_1 = Mark( StreamlineArrow_Input_1_out_1, "positions" ) [instance: 1, cache: 1]; // // node Compute[17]: x = 14, y = 141, inputs = 2, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0.x" // expression: value = a.x // name[2]: value = a // StreamlineArrow_Compute_17_out_1 = Compute( "$0.x", StreamlineArrow_Mark_1_out_1 ) [instance: 17, cache: 1]; // // node Statistics[1]: x = 0, y = 243, inputs = 1, label = Statistics // output[1]: visible = 0 // output[2]: visible = 0 // output[3]: visible = 0 // StreamlineArrow_Statistics_1_out_1, StreamlineArrow_Statistics_1_out_2, StreamlineArrow_Statistics_1_out_3, StreamlineArrow_Statistics_1_out_4, StreamlineArrow_Statistics_1_out_5 = Statistics( StreamlineArrow_Compute_17_out_1 ) [instance: 1, cache: 1]; // // node Compute[18]: x = 105, y = 165, inputs = 2, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0.y" // expression: value = a.y // name[2]: value = a // StreamlineArrow_Compute_18_out_1 = Compute( "$0.y", StreamlineArrow_Mark_1_out_1 ) [instance: 18, cache: 1]; // // node Statistics[2]: x = 83, y = 249, inputs = 1, label = Statistics // output[1]: visible = 0 // output[2]: visible = 0 // output[3]: visible = 0 // StreamlineArrow_Statistics_2_out_1, StreamlineArrow_Statistics_2_out_2, StreamlineArrow_Statistics_2_out_3, StreamlineArrow_Statistics_2_out_4, StreamlineArrow_Statistics_2_out_5 = Statistics( StreamlineArrow_Compute_18_out_1 ) [instance: 2, cache: 1]; // // node Input[30]: x = 178, y = 268, inputs = 0, label = Input // parameter: position = 6, name = 'scale', value = '1.0', descriptive = 0, description = 'scale of arrows on lines', required = 0, visible = 0 // StreamlineArrow_Input_30_out_1 = scale; // // node Compute[15]: x = 29, y = 484, inputs = 6, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$4*[($1-$0)+($3-$2)]/16.0" // expression: value = e*[(x_max-x_min)+(y_max-y_min)]/16.0 // name[2]: value = x_min // name[3]: value = x_max // name[4]: value = y_min // name[5]: value = y_max // name[6]: value = e // StreamlineArrow_Compute_15_out_1 = Compute( "$4*[($1-$0)+($3-$2)]/16.0", StreamlineArrow_Statistics_1_out_4, StreamlineArrow_Statistics_1_out_5, StreamlineArrow_Statistics_2_out_4, StreamlineArrow_Statistics_2_out_5, StreamlineArrow_Input_30_out_1 ) [instance: 15, cache: 1]; // // node Transmitter[13]: x = 47, y = 595, inputs = 1, label = GlyphScale // GlyphScale = StreamlineArrow_Compute_15_out_1; // // node Receiver[22]: x = 863, y = 361, inputs = 1, label = GlyphScale // StreamlineArrow_Receiver_22_out_1 = GlyphScale; // // node Glyph[3]: x = 869, y = 452, inputs = 7, label = Glyph // input[3]: visible = 0 // input[5]: visible = 0 // StreamlineArrow_Glyph_3_out_1 = Glyph( StreamlineArrow_Compute_23_out_1, StreamlineArrow_Connect_3_out_1, NULL, StreamlineArrow_Receiver_22_out_1, NULL, NULL, NULL ) [instance: 3, cache: 1]; // // node Shade[2]: x = 838, y = 554, inputs = 7, label = Shade // input[2]: defaulting = 0, visible = 0, type = 3, value = 0 // input[3]: visible = 0 // StreamlineArrow_Shade_2_out_1 = Shade( StreamlineArrow_Glyph_3_out_1, 0, NULL, NULL, NULL, NULL, NULL ) [instance: 2, cache: 1]; // // node Collect[12]: x = 708, y = 622, inputs = 2, label = Collect // StreamlineArrow_Collect_12_out_1 = Collect( StreamlineArrow_Color_14_out_1, StreamlineArrow_Shade_2_out_1 ) [instance: 12, cache: 1]; // // node Output[1]: x = 712, y = 718, inputs = 1, label = Output // parameter: position = 1, name = 'lines', value = ' ', descriptive = 0, description = 'the resulting streamline(s)', required = 0, visible = 1 // lines = StreamlineArrow_Collect_12_out_1; // network: end of macro body } StreamlineArrow_Input_1_out_1 = NULL; StreamlineArrow_Transmitter_7_out_1 = NULL; StreamlineArrow_Receiver_23_out_1 = NULL; StreamlineArrow_Compute_21_out_1 = NULL; StreamlineArrow_Input_2_out_1 = NULL; StreamlineArrow_Sample_5_out_1 = NULL; StreamlineArrow_Input_3_out_1 = NULL; StreamlineArrow_Input_29_out_1 = NULL; StreamlineArrow_Streamline_2_out_1 = NULL; StreamlineArrow_Compute_22_out_1 = NULL; StreamlineArrow_Streamline_1_out_1 = NULL; StreamlineArrow_Collect_4_out_1 = NULL; StreamlineArrow_Input_31_out_1 = NULL; StreamlineArrow_Color_14_out_1 = NULL; StreamlineArrow_Transmitter_6_out_1 = NULL; StreamlineArrow_Receiver_11_out_1 = NULL; StreamlineArrow_Input_4_out_1 = NULL; StreamlineArrow_Sample_3_out_1 = NULL; StreamlineArrow_Color_12_out_1 = NULL; StreamlineArrow_Compute_23_out_1 = NULL; StreamlineArrow_Construct_5_out_1 = NULL; StreamlineArrow_Connect_3_out_1 = NULL; StreamlineArrow_Mark_1_out_1 = NULL; StreamlineArrow_Compute_17_out_1 = NULL; StreamlineArrow_Statistics_1_out_4 = NULL; StreamlineArrow_Statistics_1_out_5 = NULL; StreamlineArrow_Compute_18_out_1 = NULL; StreamlineArrow_Statistics_2_out_4 = NULL; StreamlineArrow_Statistics_2_out_5 = NULL; StreamlineArrow_Input_30_out_1 = NULL; StreamlineArrow_Compute_15_out_1 = NULL; StreamlineArrow_Transmitter_13_out_1 = NULL; StreamlineArrow_Receiver_22_out_1 = NULL; StreamlineArrow_Glyph_3_out_1 = NULL; StreamlineArrow_Shade_2_out_1 = NULL; StreamlineArrow_Collect_12_out_1 = NULL;