Skip to content

Commit

Permalink
making all tests work
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorMallon committed Sep 27, 2021
1 parent 518cfad commit d21be90
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/Arrays/Autodiff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@ function autodiff_array_gradient(a,i_to_x,j_to_i)
T0=T
end
i_to_xdual = lazy_map(DualizeMap(ForwardDiff.gradient),T,i_to_x)
j_to_ydual = a(i_to_xdual,T0)
j_to_ydual = a(i_to_xdual)
j_to_cfg = lazy_map(ConfigMap(ForwardDiff.gradient),j_to_x)
j_to_result = lazy_map(AutoDiffMap(ForwardDiff.gradient),j_to_ydual,j_to_x,j_to_cfg)
j_to_result
end


function autodiff_array_jacobian(a,i_to_x,j_to_i)
i_to_xdual = lazy_map(DualizeMap(ForwardDiff.jacobian),i_to_x)
j_to_ydual = a(i_to_xdual)
Expand Down
4 changes: 2 additions & 2 deletions src/FESpaces/FEAutodiff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ end

function _change_argument(op,f,trian,uh::SingleFieldFEFunction)
U = get_fe_space(uh)
function g(cell_u,T)
function g(cell_u)
v = get_fe_basis(U)
cell_basis = get_data(v)
#T=typeof(cell_u)
T=typeof(cell_u)
cell_field = lazy_map(linear_combination,T,cell_u,cell_basis)
cf = GenericCellField(cell_field,get_triangulation(v),DomainStyle(v))
cell_grad = f(cf)
Expand Down
3 changes: 2 additions & 1 deletion src/MultiField/MultiFieldFEAutodiff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ end
function FESpaces._change_argument(
op::typeof(gradient),f,trian,uh::MultiFieldFEFunction)
U = get_fe_space(uh)
function g(cell_u,T)
function g(cell_u)
single_fields = GenericCellField[]
nfields = length(U.spaces)
for i in 1:nfields
T = eltype(eltype(cell_u))
cell_values_field = lazy_map(a->a.array[i],T,cell_u)
v = get_fe_basis(U.spaces[i])
cell_basis = get_data(v)
Expand Down

0 comments on commit d21be90

Please sign in to comment.