Skip to content
This repository was archived by the owner on Feb 28, 2022. It is now read-only.
This repository was archived by the owner on Feb 28, 2022. It is now read-only.

Discussion on time-dependent adjoints #28

@fverdugo

Description

@fverdugo
sol_lazy =solve(solver,op)

# We need a forward solution that can be iterated in reverse
sol = collect(sol_lazy) # Option 1
sol = CeckpointedSol(sol_lazy) # Option 2
sol_reversed = reverse(sol)

for (uh_n,t_n) in sol_reversed

end

#  Adjoint (from the sol that can be iterated in reverse)
adj_op = Adjoint(op,sol,j_u(sol))

# Lazy adjoint solution
adj_sol = solve(solve,adj_op)

# Iteration of the adjoint backwards in time
for (adj_uh_n, t_n) in adj_sol

end

# If needed, reverse iteration of forward and adjoint solutions
for ((adj_uh_n, t_n), (uh_n, t_n) )in zip(adj_sol,sol_reversed)

end

cc @santiagobadia @oriolcg

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions