def addTeapotDiagnosticsNodeAsChild(lattice, AccNode, diagnostics_node): AccNode.addChildNode(diagnostics_node, AccNode.ENTRANCE,0,AccNode.BEFORE) lattice.initialize()
def addErrorNodeAsChild(lattice, AccNode, Error_Node): AccNode.addChildNode(Error_Node, AccNode.BODY, 0, AccNode.BEFORE) lattice.initialize()
elem1.setLength(1.1) elem2.setLength(2.1) elem3.setLength(3.1) lattice.addNode(elem1) lattice.addNode(elem2) lattice.addNode(elem3) elem1_1 = AccNode("el-1-1") elem1_1.setnParts(2) elem1_1_1 = AccNode("el-1-1-1") elem1_1_2 = AccNode("el-1-1-2") elem1_1_3 = AccNode("el-1-1-3") elem1_1_4 = AccNode("el-1-1-4") elem1.addChildNode(elem1_1,AccNode.ENTRANCE) elem1_1.addChildNode(elem1_1_1,AccNode.ENTRANCE) elem1_1.addChildNode(elem1_1_2,AccNode.BODY,0) elem1_1.addChildNode(elem1_1_3,AccNode.BODY,1) elem1_1.addChildNode(elem1_1_4,AccNode.EXIT) elem1_2 = AccNode("el-1-2") elem2.addChildNode(elem1_2,AccNode.EXIT) acts = AccActionsContainer() def Blanks(n): s = "" for i in xrange(n): s += " "
def addErrorNodeAsChild_I(lattice, AccNode, Error_Node): AccNode.addChildNode(Error_Node, AccNode.ENTRANCE) lattice.initialize()
def addErrorNodeAsChild_F(lattice, AccNode, Error_Node): AccNode.addChildNode(Error_Node, AccNode.EXIT) lattice.initialize()
def addImpedanceNodeAsChild(lattice, AccNode, Impedance_Node): AccNode.addChildNode(Impedance_Node,AccNode.BODY,0,AccNode.BEFORE) lattice.initialize()
elem1.setLength(1.1) elem2.setLength(2.1) elem3.setLength(3.1) lattice.addNode(elem1) lattice.addNode(elem2) lattice.addNode(elem3) elem1_1 = AccNode("el-1-1") elem1_1.setnParts(2) elem1_1_1 = AccNode("el-1-1-1") elem1_1_2 = AccNode("el-1-1-2") elem1_1_3 = AccNode("el-1-1-3") elem1_1_4 = AccNode("el-1-1-4") elem1.addChildNode(elem1_1, AccNode.ENTRANCE) elem1_1.addChildNode(elem1_1_1, AccNode.ENTRANCE) elem1_1.addChildNode(elem1_1_2, AccNode.BODY, 0) elem1_1.addChildNode(elem1_1_3, AccNode.BODY, 1) elem1_1.addChildNode(elem1_1_4, AccNode.EXIT) elem1_2 = AccNode("el-1-2") elem2.addChildNode(elem1_2, AccNode.EXIT) acts = AccActionsContainer() def Blanks(n): s = "" for i in xrange(n): s += " "
def addTeapotDiagnosticsNodeAsChild(lattice, AccNode, diagnostics_node): AccNode.addChildNode(diagnostics_node, AccNode.ENTRANCE, 0, AccNode.BEFORE) lattice.initialize()
def addImpedanceNodeAsChild(lattice, AccNode, Impedance_Node): AccNode.addChildNode(Impedance_Node, AccNode.BODY, 0, AccNode.BEFORE) lattice.initialize()
def addLongitudinalSpaceChargeNodeAsChild(lattice, AccNode, scNode): AccNode.addChildNode(scNode,AccNode.BODY,0,AccNode.BEFORE) lattice.initialize()
print "============== INITIAL NODE STRUCTURE =============" accNode = AccNode("test_node") accNode.setnParts(5) L = 0. nParts = accNode.getnParts() for ind in range(nParts): accNode.setLength(ind+1.0,ind) L += accNode.getLength(ind) accNode.setLength(L) for ind in range(nParts): accNode.setLength(ind+1.0,ind) L += accNode.getLength(ind) accNode.addChildNode(AccNode("chEntrn0"),AccNode.ENTRANCE) accNode.addChildNode(AccNode("chEntrn1"),AccNode.ENTRANCE) accNode.addChildNode(AccNode("chEntrn2"),AccNode.ENTRANCE) accNode.addChildNode(AccNode("chExit0"),AccNode.EXIT) accNode.addChildNode(AccNode("chExit1"),AccNode.EXIT) accNode.addChildNode(AccNode("chExit2"),AccNode.EXIT) accNode.initialize() txt = printAccNodeStructure(accNode) print txt sys.exit() print "============== REVERSED NODE STRUCTURE =============" accNode.reverseOrder()