mirror of
https://github.com/JuliaFEM/JuliaFEM.jl.git
synced 2026-09-28 20:46:58 +00:00
added variable la,mu parameters
This commit is contained in:
@@ -26,8 +26,8 @@ end
|
||||
@doc """
|
||||
Calculate local tangent stiffness matrix and residual force vector R = T - F
|
||||
""" ->
|
||||
function calc_local_matrices!(X, u, R, Kt, dNdξ, λ, μ, ipoints, iweights)
|
||||
dim, N = size(X)
|
||||
function calc_local_matrices!(X, u, R, Kt, N, dNdξ, λ_, μ_, ipoints, iweights)
|
||||
dim, nnodes = size(X)
|
||||
I = eye(dim)
|
||||
R[:,:] = 0.0
|
||||
Kt[:,:] = 0.0
|
||||
@@ -35,8 +35,11 @@ function calc_local_matrices!(X, u, R, Kt, dNdξ, λ, μ, ipoints, iweights)
|
||||
dF = zeros(dim, dim)
|
||||
|
||||
for m = 1:length(iweights)
|
||||
w = iweights[m]
|
||||
ξ = ipoints[m, :]
|
||||
w = iweights[m]
|
||||
ξ = ipoints[m, :]
|
||||
# interpolate material parameters from element node fields
|
||||
λ = (λ_*N(ξ))[1]
|
||||
μ = (μ_*N(ξ))[1]
|
||||
Jᵀ = X*dNdξ(ξ)
|
||||
detJ = det(Jᵀ)
|
||||
∇N = inv(Jᵀ)*dNdξ(ξ)'
|
||||
@@ -47,14 +50,14 @@ function calc_local_matrices!(X, u, R, Kt, dNdξ, λ, μ, ipoints, iweights)
|
||||
P = F*S # PK1 stress tensor
|
||||
R[:,:] += w*P*∇N*detJ
|
||||
|
||||
for p = 1:N
|
||||
for p = 1:nnodes
|
||||
for i = 1:dim
|
||||
dF[:,:] = 0.0
|
||||
dF[i,:] = ∇N[:,p]
|
||||
dE = 1/2*(F'*dF + dF'*F)
|
||||
dS = λ*trace(dE)*I + 2*μ*dE
|
||||
dP = dF*S + F*dS
|
||||
for q = 1:N
|
||||
for q = 1:nnodes
|
||||
for j = 1:dim
|
||||
Kt[dim*(p-1)+i,dim*(q-1)+j] += w*(dP[j,:]*∇N[:,q])[1]*detJ
|
||||
end
|
||||
@@ -70,9 +73,9 @@ end
|
||||
Solve one increment of elasticity problem
|
||||
""" ->
|
||||
function solve_elasticity_increment!(X, u, du, R, Kt, elmap, nodalloads,
|
||||
dirichletbc, λ, μ, dNdξ, ipoints,
|
||||
dirichletbc, λ, μ, N, dNdξ, ipoints,
|
||||
iweights)
|
||||
calc_local_matrices!(X, u, R, Kt, dNdξ, λ, μ, ipoints, iweights)
|
||||
calc_local_matrices!(X, u, R, Kt, N, dNdξ, λ, μ, ipoints, iweights)
|
||||
# FIXME: boundary conditions
|
||||
free_dofs = find(isnan(dirichletbc))
|
||||
R -= nodalloads
|
||||
|
||||
Reference in New Issue
Block a user