lattice = AccLattice("test_lattice")

elem1 = AccNode("el-1")
elem2 = AccNode("el-2")
elem3 = AccNode("el-3")

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()
예제 #2
0
lattice = AccLattice("test_lattice")

elem1 = AccNode("el-1")
elem2 = AccNode("el-2")
elem3 = AccNode("el-3")

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)
예제 #3
0
		for node in nodes:
			txt = printAccNodeStructure(node,txt,txt_shift + txt_shift_local*4)
	txt += txt_shift + txt_shift_local*2 + "==== BODY EXIT     n parts =" + str(accNode.getnParts())
	txt += txt_shift + txt_shift_local + "==== EXIT AccNode = " + accNode.getName()
	txt += " L=" + str(accNode.getLength())
	txt += os.linesep
	for node in accNode.getChildNodes(AccNode.EXIT):
		txt = printAccNodeStructure(node,txt,txt_shift + txt_shift_local*2)			
	txt += txt_shift + txt_shift_local + "==== END of AccNode = " + accNode.getName()	
	txt += os.linesep
	return txt

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)