# This template was created by Dr. Allen Shapiro of the USGS and # is posted for you to use free of charge. # April 96 (Dr. Allen Shapiro's email address is ashapiro@usgs.gov) # # This template exports an FD Grid from a Grid layer to an ASCII file # as a Qudrilateral finite element mesh. # This file can be imported into an ANE Quad Mesh layer # for further manipulation and for linking it to Information layers. # # Instructions for testing the template are at the end of this file # # Mesh BandWidth can be minimized once the mesh is imported. # # In the next ANE version (current is 2.5) one will be able to copy a # grid into a Quad mesh layer directly in ANE. # Redirect output to: $BaseName$ Start a new line # Exports the Number of Blocks as Number of Elements Export expression: (NumRows())*(NumColumns()); [I8] # Exports the Number of Grid Lines (vertical*horizontal) as Number of Nodes Export expression: (NumRows()+1)*(NumColumns()+1) [I8] End line # Loop over columns and rows to export node number and node locations # both Columns and Rows start at 0 Loop for: Columns Loop for: Rows Start a new line Export expression: "N"; Export expression: $Column$*(NumRows()+1)+$Row$+1; [I5] Export expression: NthColumnPos($Column$); [E20.6] Export expression: NthRowPos($Row$) [E20.6] End line End loop End loop # Loop over columns and rows to element number # and element-node connectivity counter-clockwise Loop for: Columns If: $Column$