// // time: Wed Apr 24 07:56:36 1996 // // version: 3.0.0 (format), 3.1.0 (DX) // // // Begin MDF // MODULE SurfaceFlux // CATEGORY Macros // DESCRIPTION caluculates the flux through a specified surface // INPUT surface; field or value or value list; (none); The surface through which to calculate flux // INPUT flux_field; scalar or vector or field; (none); the flux field (vector field) // INPUT reverse_flux; value list or field; 0; reverse the sign of the flux // OUTPUT flux; value or value list or field; the surface flux integral // End MDF // // comment: Given a surface and a vector flux field, this macro computes the integrated flux through the surface. The user has the option of reversing the sign of the flux through a third parameter (the default behavior is that positive flux flows through connection elements from "back" to "front" as defined by the orientation of the connection elements). // comment: // 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. // workspace: width = 624, height = 714 // layout: snap = 0, width = 50, height = 50, align = NN // macro SurfaceFlux( surface ,flux_field ,reverse_flux = 0 ) -> ( flux ) { // // node Input[1]: x = 143, y = 3, inputs = 0, label = Input // parameter: position = 1, name = 'surface', value = ' ', descriptive = 0, description = 'The surface through which to calculate flux', required = 1, visible = 1 // SurfaceFlux_Input_1_out_1 = surface; // // node Inquire[1]: x = 65, y = 451, inputs = 3, label = Inquire // input[2]: defaulting = 0, visible = 1, type = 32, value = "connection counts" // SurfaceFlux_Inquire_1_out_1 = Inquire( SurfaceFlux_Input_1_out_1, "connection counts", NULL ) [instance: 1, cache: 1]; // // node Input[4]: x = 484, y = 7, inputs = 0, label = Input // parameter: position = 3, name = 'reverse_flux', value = '0', descriptive = 0, description = 'reverse the sign of the flux', required = 0, visible = 1 // SurfaceFlux_Input_4_out_1 = reverse_flux; // // node Compute[5]: x = 498, y = 94, inputs = 2, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0+1" // expression: value = a+1 // name[2]: value = a // SurfaceFlux_Compute_5_out_1 = Compute( "$0+1", SurfaceFlux_Input_4_out_1 ) [instance: 5, cache: 1]; // // node Input[2]: x = 227, y = 6, inputs = 0, label = Input // parameter: position = 2, name = 'flux_field', value = ' ', descriptive = 0, description = 'the flux field (vector field)', required = 1, visible = 1 // SurfaceFlux_Input_2_out_1 = flux_field; // // node Map[1]: x = 160, y = 82, inputs = 4, label = Map // SurfaceFlux_Map_1_out_1 = Map( SurfaceFlux_Input_1_out_1, SurfaceFlux_Input_2_out_1, NULL, NULL ) [instance: 1, cache: 1]; // // node Post[1]: x = 238, y = 94, inputs = 2, label = Post // input[2]: defaulting = 0, visible = 1, type = 32, value = "connections" // SurfaceFlux_Post_1_out_1 = Post( SurfaceFlux_Map_1_out_1, "connections" ) [instance: 1, cache: 1]; // // node FaceNormals[1]: x = 302, y = 136, inputs = 1, label = FaceNormals // SurfaceFlux_FaceNormals_1_out_1 = FaceNormals( SurfaceFlux_Post_1_out_1 ) [instance: 1, cache: 1]; // // node Mark[1]: x = 415, y = 169, inputs = 2, label = Mark // input[2]: defaulting = 0, visible = 1, type = 32, value = "normals" // SurfaceFlux_Mark_1_out_1 = Mark( SurfaceFlux_FaceNormals_1_out_1, "normals" ) [instance: 1, cache: 1]; // // node Compute[6]: x = 554, y = 222, inputs = 2, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "-$0" // expression: value = -a // name[2]: value = a // SurfaceFlux_Compute_6_out_1 = Compute( "-$0", SurfaceFlux_Mark_1_out_1 ) [instance: 6, cache: 1]; // // node Switch[1]: x = 518, y = 327, inputs = 3, label = Switch // SurfaceFlux_Switch_1_out_1 = Switch( SurfaceFlux_Compute_5_out_1, SurfaceFlux_Mark_1_out_1, SurfaceFlux_Compute_6_out_1 ) [instance: 1, cache: 1]; // // node Measure[1]: x = 303, y = 368, inputs = 2, label = Measure // input[2]: defaulting = 0, visible = 1, type = 32, value = "element" // SurfaceFlux_Measure_1_out_1 = Measure( SurfaceFlux_Switch_1_out_1, "element" ) [instance: 1, cache: 1]; // // node Compute[1]: x = 393, y = 362, inputs = 3, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "dot($0, $1)" // expression: value = dot(normals, flux_field) // name[2]: value = normals // name[3]: value = flux_field // SurfaceFlux_Compute_1_out_1 = Compute( "dot($0, $1)", SurfaceFlux_Switch_1_out_1, SurfaceFlux_Post_1_out_1 ) [instance: 1, cache: 1]; // // node Compute[2]: x = 388, y = 449, inputs = 3, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0*$1" // expression: value = triangle_area*local_flux // name[2]: value = triangle_area // name[3]: value = local_flux // SurfaceFlux_Compute_2_out_1 = Compute( "$0*$1", SurfaceFlux_Measure_1_out_1, SurfaceFlux_Compute_1_out_1 ) [instance: 2, cache: 1]; // // node Statistics[1]: x = 367, y = 527, inputs = 1, label = Statistics // SurfaceFlux_Statistics_1_out_1, SurfaceFlux_Statistics_1_out_2, SurfaceFlux_Statistics_1_out_3, SurfaceFlux_Statistics_1_out_4, SurfaceFlux_Statistics_1_out_5 = Statistics( SurfaceFlux_Compute_2_out_1 ) [instance: 1, cache: 1]; // // node Compute[3]: x = 217, y = 569, inputs = 3, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0*$1" // expression: value = num_connections*avg_flux // name[2]: value = num_connections // name[3]: value = avg_flux // SurfaceFlux_Compute_3_out_1 = Compute( "$0*$1", SurfaceFlux_Inquire_1_out_1, SurfaceFlux_Statistics_1_out_1 ) [instance: 3, cache: 1]; // // node Output[1]: x = 234, y = 651, inputs = 1, label = Output // parameter: position = 1, name = 'flux', value = ' ', descriptive = 0, description = 'the surface flux integral', required = 0, visible = 1 // flux = SurfaceFlux_Compute_3_out_1; // network: end of macro body } SurfaceFlux_Input_1_out_1 = NULL; SurfaceFlux_Inquire_1_out_1 = NULL; SurfaceFlux_Input_4_out_1 = NULL; SurfaceFlux_Compute_5_out_1 = NULL; SurfaceFlux_Input_2_out_1 = NULL; SurfaceFlux_Map_1_out_1 = NULL; SurfaceFlux_Post_1_out_1 = NULL; SurfaceFlux_FaceNormals_1_out_1 = NULL; SurfaceFlux_Mark_1_out_1 = NULL; SurfaceFlux_Compute_6_out_1 = NULL; SurfaceFlux_Switch_1_out_1 = NULL; SurfaceFlux_Measure_1_out_1 = NULL; SurfaceFlux_Compute_1_out_1 = NULL; SurfaceFlux_Compute_2_out_1 = NULL; SurfaceFlux_Statistics_1_out_1 = NULL; SurfaceFlux_Compute_3_out_1 = NULL;