Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shape derivative #882

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
orking differnet trians
  • Loading branch information
Connor committed Mar 23, 2022
commit ca873902cae9c77e0d5d7622fa0eed7897804647
27 changes: 22 additions & 5 deletions src/FESpaces/FEAutodiff.jl
Original file line number Diff line number Diff line change
@@ -97,19 +97,36 @@ function _hessian(f,uh,fuh::DomainContribution)
end

function _change_argument(op,f,trian,uh::SingleFieldFEFunction)

#U = get_fe_space(uh)

function g(cell_u)

#cf = CellField(U,cell_u)
#cell_grad = f(cf)
cell_grad = f(cell_u)
# get_contribution(cell_grad,trian)

#get_contribution(cell_grad,trian)
#@show cell_grad.dict[first(get_domains(cell_grad)) ]
cell_grad.dict[first(get_domains(cell_grad)) ]

#cell_grad.dict[first(get_domains(cell_grad)) ]

# because the trian has been perturned, it thinks its different ?
#trian_dual = find_equivalent_trian(trian)



for trian_cg in get_domains(cell_grad)
println("tryn..")
if get_cell_node_ids(trian_cg) == get_cell_node_ids(trian)
println("ispos")
return get_contribution(cell_grad,trian_cg)
end
println("no compat trian....")
end


#get_contribution(cell_grad,trian)
# get_contribution(cell_grad,trian)

end
g
end
end
4 changes: 2 additions & 2 deletions src/Polynomials/MonomialBases.jl
Original file line number Diff line number Diff line change
@@ -183,7 +183,7 @@ function return_cache(

xi = testitem(x)
T = gradient_type(V,xi)
TisbitsType = Val(isbits(T))
TisbitsType = Val(isbitstype(T))
_return_cache(fg,x,T,TisbitsType)
end

@@ -195,7 +195,7 @@ function _evaluate!(

f = fg.fa
r, v, c, g = cache
z = zero(Mutable(VectorValue{D,eltype(T)}))
z = zero(Mutable(eltype(x))) ##VectorValue{D,eltype(T)}))
np = length(x)
ndof = length(f.terms) * num_components(T)
n = 1 + _maximum(f.orders)