Skip to content

Commit

Permalink
Update tangent pointers in collage
Browse files Browse the repository at this point in the history
  • Loading branch information
lukem12345 committed Oct 12, 2023
1 parent 7ef1c77 commit 3fe8ca4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/collages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,18 @@ function collate(equations, boundaries, uwd, symbols)
en_key = uwd[junction(uwd, ev), :variable]
bn_key = uwd[junction(uwd, bv), :variable]
en = symbols[en_key]
bn = symbols[bn_key] # This will be used when we do error-checking on types.
println(en_key, en)
bn = symbols[bn_key]
var = only(incident(f, en, :name))
b_var = add_part!(f, :Var, type=f[var, :type], name=f[var, :name])
f[var, :name] = Symbol("r_" * string(f[var, :name]))
#add_part!(f, :Op1, src=b_var, tgt=var, op1=uwd[b, :name])
s_var = add_part!(f, :Var, type=f[var, :type], name=bn)
f[var, :name] = Symbol("r$(b)_" * string(f[var, :name]))
s_var = add_part!(f, :Var, type=boundaries[only(incident(boundaries, bn, :name)), :type], name=bn)
add_part!(f, :Op2, proj1=b_var, proj2=s_var, res=var, op2=uwd[b, :name])

Check warning on line 31 in src/collages.jl

View check run for this annotation

Codecov / codecov/patch

src/collages.jl#L19-L31

Added lines #L19 - L31 were not covered by tests

# Update tangent variable pointers, if any.
tangent_op1s = filter(x -> f[x, :op1]==:∂ₜ, incident(f, var, :src))
println(en_key, tangent_op1s)
isempty(tangent_op1s) && continue
f[only(tangent_op1s), :src] = b_var
end

Check warning on line 38 in src/collages.jl

View check run for this annotation

Codecov / codecov/patch

src/collages.jl#L34-L38

Added lines #L34 - L38 were not covered by tests

f

Check warning on line 40 in src/collages.jl

View check run for this annotation

Codecov / codecov/patch

src/collages.jl#L40

Added line #L40 was not covered by tests
Expand Down

0 comments on commit 3fe8ca4

Please sign in to comment.