# # Export 9 Nodes for each Quadrilateral Element # # Requires: Argus ONE Quadrilateral Module. # VirtualNodes PIE # # Compatible: Version ArgusNE 3.0t and later # # Purpose: When the VirtualNodes PIE is present this template # will export an additional node at the center of each # of the element side and one at the element center. # # This template initialize a 2D array of size N*NumElements() using the # VirtualNodes PIEs VN_Init() function. It then stores in the VN array # (using the VN_SetNodeNum()) the element numbers and node numbers # including the additional 5 nodes per element and numbers of the element # neighbours. # It then exports the all nodes per each element in the connectivity # list using the VN_GetNodeNum() # # This template was created by Shahar Dolev (Argus R&D Team) and # is posted for you to use free of charge. # Feb. 97 (email rnd@argusint.com) # Define Variable: LastNode [Integer] Define Variable: CurrNode [Integer] Define Variable: NumEdges [Integer] Define Variable: i [Integer] # Evaluate expression: VN_Init(NumElements()) Set Variable: LastNode:= 0 Loop for: Nodes If: LastNode < NodeNumber() Set Variable: LastNode:= NodeNumber() End if End loop # # Assign node numbers for the virtual nodes # taking into consideration that some virtual nodes # are common to 2 elements and some only to one. # Set Variable: CurrNode:= LastNode+1 Loop for: Elements Loop for: Variable i from: 1 to: 4 step: 1 If: NthNeighbourNum(i)=0 # No neighbour element on this side, # save node with negative number (-i) Evaluate expression: VN_SetNodeNum(ElementNumber(), -i, CurrNode) Set Variable: CurrNode:= CurrNode+1 Else If: NthNeighbourNum(i)>ElementNumber() # To make sure that extra node is created only once per side, add node ONLY # when the neighbour elem. number is higher than the current elem. number Evaluate expression: VN_SetNodeNum(ElementNumber(), NthNeighbourNum(i), CurrNode) Set Variable: CurrNode:= CurrNode+1 End if End if End loop # # 9'th node # Evaluate expression: VN_SetNodeNum(ElementNumber(), -5, CurrNode) Set Variable: CurrNode:= CurrNode+1 End loop # Set Variable: NumEdges:= CurrNode-LastNode-1 # Redirect output to: $BaseName$ Start a new line Export expression: NumElements(); [G8] # Calculate and write the total number of nodes (real+virtual) Export expression: NumNodes() + NumEdges; [G8] Export expression: NumElemParameters(); [G8] Export expression: NumNodeParameters() [G8] End line # # Export 'real' nodes # Loop for: Nodes Start a new line Export expression: "N"; [G0] Export expression: NodeNumber(); [G8] Export expression: PositionX(); [G8] Export expression: PositionY() [G8] Loop for: Parameters Export expression: ;$Parameter$ [G8] End loop End line End loop # Set Variable: CurrNode:= LastNode+1 # # Export 'virtual' nodes # Loop for: Elements Loop for: Variable i from: 1 to: 4 step: 1 If: NthNeighbourNum(i)=0 | NthNeighbourNum(i)>ElementNumber() Start a new line Export expression: "N"; [G0] Export expression: CurrNode; [G8] Export expression: NthSideCenterX(i); [G8] Export expression: NthSideCenterY(i) [G8] Loop for: Parameters Export expression: ;$Parameter$(NthSideCenterX(i), NthSideCenterY(i)) [G0] End loop End line Set Variable: CurrNode:= CurrNode+1 End if End loop # # 9'th node # Start a new line Export expression: "N"; [G0] Export expression: CurrNode; [G8] Export expression: GCenterX(i); [G8] Export expression: GCenterY(i) [G8] Loop for: Parameters Export expression: ;$Parameter$ [G0] End loop End line Set Variable: CurrNode:= CurrNode+1 End loop # Loop for: Elements Start a new line Export expression: "E"; [G0] Export expression: ElementNumber(); [G8] # Export node-number of 4 real nodes Export expression: NthNodeNum(1); [G8] Export expression: NthNodeNum(2); [G8] Export expression: NthNodeNum(3); [G8] Export expression: NthNodeNum(4) [G8] Loop for: Variable i from: 1 to: 4 step: 1 If: NthNeighbourNum(i)=0 # for boundary element, use negative index Export expression: ;VN_GetNodeNum(ElementNumber(), -i) [G8] Else # for neighbour element, use elem. number Export expression: ;VN_GetNodeNum(ElementNumber(), NthNeighbourNum(i)) [G8] End if End loop # # export 9'th node # Export expression: ;VN_GetNodeNum(ElementNumber(), -5) [G8] Loop for: Parameters Export expression: ;$Parameter$ [G8] End loop End line End loop End file