Hi,
I am solving a linear elasticity problem using affine and solve and the output of this function is single field function. I need the matrix form of the solution to do some calculation on it. can you tell me how can i do this? i write it tofind the answer in matrix format but it gives me zero which is not correct. even if you can modify the matrix code instead to get right answers i would appreciate your help.
the lines using affine are as below
function stepDisp(fem_params,pth)
uApp1(x) = VectorValue(0.0,0.0)
uApp2(x) = VectorValue(0.0,0.0)
uApp3(x) = VectorValue(0.0,-vAppMax)
U_Disp = TrialFESpace(V0_Disp ,[uApp1 ,uApp2 ,uApp3])
A_Disp(u,v,pth) = ((p->Em(p))∘pth) * (ε(v) ⊙ (σfun∘(ε(u))))
a_Disp(u,v) =∫(A_Disp(u,v,pth))fem_params.dΩ
b_Disp(v) = 0.0
op_Disp = AffineFEOperator(a_Disp ,b_Disp ,fem_params.U_Disp ,fem_params.V0_Disp)
uh_out = solve(op_Disp)
return uh_out
end
vApp = vAppMax
p0 = ones(fem_params.np)
pf_vec = Filter(p0;r, fem_params)
pfh = FEFunction(fem_params.Pf, pf_vec)
pth = (pf -> Threshold(pf; β, η)) ∘ pfh
A_mat = MatrixA(pth; fem_params)
u_vec = stepDisp(fem_params,pth)
and the matrix format is like below
vApp = vAppMax
p0 = ones(fem_params.np)
pf_vec = Filter(p0;r, fem_params)
pfh = FEFunction(fem_params.Pf, pf_vec)
pth = (pf -> Threshold(pf; β, η)) ∘ pfh
A_mat = MatrixA(pth; fem_params)
b_vec = assemble_vector(0.0, fem_params.V0_Disp)
u_vec = A_mat \ b_vec
and i want to calculate the lines below after solving finite element that i have provided.
function MatrixOf(fem_params)
return assemble_matrix(fem_params.U_Disp, fem_params.V0_Disp) do u, v
0.5*(∫((∇(u))' ⊙ (C_mat ⊙ ∇(v)))fem_params.dΩ)
end
end
O_mat = MatrixOf(fem_params)
u_vec' * O_mat * u_vec
and this gives me assertation error of number of arrays and triangulation.
thank you all