In following please find a tiny Python snippet addressing [b]doc.budgetFlowCreate()[/b]:
[color=blue]
def postTimeStep(doc):
abs_sim_time = doc.getAbsoluteSimulationTime()
print "Time-step: " + str(abs_sim_time)
budgetlist = doc.budgetFlowCreate()
fnBUDGET_out.write(str(abs_sim_time)+ "\t")
for index in Dirichlet:
fnBUDGET_out.write(str(doc.budgetQueryFlowAtNode(budgetlist, index))+ "\t")
fnBUDGET_out.write(str("\n"))
doc.budgetClose(budgetlist)
[/color]
Please note that [b]doc.budgetFlowCreate()[/b] builds up the matrix for for the budget calculation on each node even if you are not interested on every node. Accordingly, this function could be computationally too demanding if you are interested in a few nodes only. For a small number of nodes I suggest to use doc.budgetCompute().
The budget created by [b]doc.budgetFlowCreate()[/b] runs in legacy mode where Storage/Capture is not discriminated from the Imbalance. In future a new API function will be provided which distinguishes between Storage/Capture and Imbalance.