Accessing Tape
I am trying to access the tape so that I can create error indicators. However I am having trouble, because in the tape there are iterations and timesteps. How can I access just the last iteration of a timestep? In the following code snippet I compute the adjoint and then look for the corresponding adjoint solution. Once I have the adjoint solution I try to use it and the tape value to create my error indicators, but as I stated some of the vars in compute_adjoint are for an iteration. This makes it difficult for me to just step through and assume what I have corresponds to a timestep rather than an iteration for a timestep.
i = int(math.ceil(T/k)) - 1 #last time step
adjoint = compute_
for (phi, var) in adjoint: #step through the adjoint solution
if var.name == 'w':
# Compute error indicators ei
LR1 = k*self.
i -= 1 #decrease the timestep
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- lvleph
- Solved:
- Last query:
- Last reply: