@@ -401,6 +401,11 @@ function Five.assemble_stiffnessmatrix_and_forcevector!( dh::Ferrite.AbstractDof
401
401
_assemble_stiffnessmatrix_and_forcevector! (dh, igashell, state, IGASHELL_STIFFMAT)
402
402
end
403
403
404
+
405
+ function Five. assemble_massmatrix! (dh:: Ferrite.AbstractDofHandler , part:: IGAShell , state:: StateVariables )
406
+ return nothing
407
+ end
408
+
404
409
function _assemble_stiffnessmatrix_and_forcevector! ( dh:: Ferrite.AbstractDofHandler ,
405
410
igashell:: IGAShell{dim_p,dim_s,T} ,
406
411
state:: StateVariables ,
@@ -457,14 +462,15 @@ function _assemble_stiffnessmatrix_and_forcevector!( dh::Ferrite.AbstractDofHand
457
462
ke = zeros (T, ndofs_layer, ndofs_layer)
458
463
459
464
states = @view materialstates[:, ilay]
465
+ stress_state = igashell. integration_data. qpstresses[ic]
460
466
461
467
resize_cache2! (igashell. cache. cache2, ndofs_layer)
462
468
463
469
if assemtype == IGASHELL_STIFFMAT
464
470
@timeit " integrate shell" _get_layer_forcevector_and_stiffnessmatrix! (
465
471
cv,
466
472
ke, fe,
467
- getmaterial (layerdata (igashell)), states,
473
+ getmaterial (layerdata (igashell)), states, stress_state,
468
474
ue_layer, ilay, nlayers (igashell), active_dofs,
469
475
is_small_deformation_theory (layerdata (igashell)), IGASHELL_STIFFMAT, getwidth (layerdata (igashell)), igashell. cache. cache2)
470
476
@@ -475,7 +481,7 @@ function _assemble_stiffnessmatrix_and_forcevector!( dh::Ferrite.AbstractDofHand
475
481
@timeit " integrate shell" _get_layer_forcevector_and_stiffnessmatrix! (
476
482
cv,
477
483
ke, fe,
478
- getmaterial (layerdata (igashell)), ⁿstates,
484
+ getmaterial (layerdata (igashell)), ⁿstates, stress_state,
479
485
ue_layer, ilay, nlayers (igashell), active_dofs,
480
486
is_small_deformation_theory (layerdata (igashell)), IGASHELL_FSTAR, getwidth (layerdata (igashell)), igashell. cache. cache2)
481
487
@@ -538,7 +544,7 @@ function _assemble_stiffnessmatrix_and_forcevector!( dh::Ferrite.AbstractDofHand
538
544
539
545
states = @view interfacestates[:, iint]
540
546
541
- active_dofs = active_interface_dofs[iint] # 1:Ferrite.ndofs_per_cell(dh,ic)#
547
+ active_dofs = 1 : Ferrite. ndofs_per_cell (dh,ic)# active_interface_dofs[iint] #
542
548
ndofs_interface = length (active_dofs)
543
549
544
550
resize! (ue_interface, ndofs_interface)
@@ -599,10 +605,6 @@ function _assemble_stiffnessmatrix_and_forcevector!( dh::Ferrite.AbstractDofHand
599
605
600
606
end
601
607
602
- function Five. assemble_massmatrix! ( dh:: Ferrite.AbstractDofHandler , igashell:: IGAShell{dim_p,dim_s,T} , system_arrays:: StateVariables ) where {dim_p,dim_s,T}
603
-
604
- end
605
-
606
608
function Five. post_part! (dh, igashell:: IGAShell{dim_p,dim_s,T} , states) where {dim_s, dim_p, T}
607
609
# if dim_s == 2
608
610
# return
@@ -612,50 +614,88 @@ function Five.post_part!(dh, igashell::IGAShell{dim_p,dim_s,T}, states) where {d
612
614
613
615
cellstate = getcellstate (adapdata (igashell), ic)
614
616
615
- if ! is_lumped (cellstate) && ! is_layered (cellstate)
617
+ if is_mixed (cellstate) || is_fully_discontiniuos (cellstate)
616
618
continue
617
619
end
618
620
619
621
# Get cellvalues for cell
620
622
Ce = get_extraction_operator (intdata (igashell), ic)
621
-
622
- # Extract stresses from states
623
- σ_states = states. partstates[ic]. materialstates[:]
624
- σ_states = getproperty .(σ_states, :σ )
623
+
625
624
# Data for cell
626
625
_celldofs = celldofs (dh, cellid)
627
626
ue = states. d[_celldofs]
628
627
629
628
nnodes = Ferrite. nnodes_per_cell (igashell)
630
629
X = zeros (Vec{dim_s,T}, nnodes)
631
630
Ferrite. cellcoords! (X, dh, cellid)
632
- Xᵇ= IGA. compute_bezier_points (Ce, X)
633
- celldata = (celldofs = _celldofs,
634
- Xᵇ= Xᵇ, X= X, ue= ue,
635
- nlayers= nlayers (igashell), ninterfaces= ninterfaces (igashell),
636
- cellid= cellid, ic= ic)
631
+ Xᵇ = IGA. compute_bezier_points (Ce, X)
637
632
638
- # Build basis_values for cell
639
- cv = build_cellvalue! (igashell, cellstate)
640
- IGA. set_bezier_operator! (cv, Ce)
641
- reinit! (cv, Xᵇ)
633
+ if is_lumped (cellstate)
634
+ _post_lumped (igashell, Xᵇ, X, ue, Ce, cellstate, ic, cellid)
635
+ elseif is_layered (cellstate)
636
+ _post_layered (igashell, Xᵇ, X, ue, Ce, cellstate, ic, cellid)
637
+ else
638
+ continue
639
+ end
642
640
643
- # Build basis_values for stress_recovory
644
- cv_sr = intdata (igashell). cell_values_sr
645
- oop_values = _build_oop_basisvalue! (igashell, cellstate)
646
- set_oop_basefunctions! (cv_sr, oop_values)
647
- IGA. set_bezier_operator! (cv_sr, Ce)
648
- reinit! (cv_sr, Xᵇ)
641
+ end
649
642
650
- recover_cell_stresses (srdata (igashell), σ_states, celldata, cv_sr, cv)
643
+ end
644
+
645
+ function _post_layered (igashell, Xᵇ, X, ue, Ce, cellstate, ic:: Int , cellid:: Int )
646
+
647
+ # Shape values for evaluating stresses at center of cell
648
+ cv_mid_interface = igashell. integration_data. cell_value_mid_interfaces
649
+ set_bezier_operator! (cv_mid_interface, Ce)
650
+
651
+ # oop_values = _build_oop_basisvalue!(igashell, cellstate)
652
+ # set_oop_basefunctions!(cv_mid_interface, oop_values)
653
+
654
+ reinit! (cv_mid_interface, Xᵇ)
655
+ active_layer_dofs = build_active_layer_dofs (igashell, cellstate)
656
+
657
+ iqp = 0
658
+ for ilay in 1 : nlayers (igashell)- 1
659
+ iqp += 1
660
+ active_dofs = active_layer_dofs[ilay]
661
+ ue_layer = ue[active_dofs]
662
+
663
+ # Only one quad points per layer
664
+ σ, _, _ = _eval_stress_center (cv_mid_interface, igashell. layerdata. layer_materials[ilay], iqp, Xᵇ, ue_layer, active_dofs, is_small_deformation_theory (igashell. layerdata))
665
+
666
+ igashell. integration_data. interfacestresses[ilay, ic] = σ
651
667
end
668
+ end
669
+
670
+ function _post_lumped (igashell, Xᵇ, X, ue, Ce, cellstate, ic:: Int , cellid:: Int )
652
671
672
+ # Extract stresses from states
673
+ σ_states = igashell. integration_data. qpstresses[ic]
674
+
675
+ celldata = (Xᵇ= Xᵇ, X= X, ue= ue,
676
+ nlayers= nlayers (igashell), ninterfaces= ninterfaces (igashell),
677
+ cellid= cellid, ic= ic)
678
+
679
+ # Build basis_values for cell
680
+ cv = build_cellvalue! (igashell, cellstate)
681
+ IGA. set_bezier_operator! (cv, Ce)
682
+ reinit! (cv, Xᵇ)
683
+
684
+ # Build basis_values for stress_recovory
685
+ cv_sr = intdata (igashell). cell_values_sr
686
+ oop_values = _build_oop_basisvalue! (igashell, cellstate)
687
+ set_oop_basefunctions! (cv_sr, oop_values)
688
+ IGA. set_bezier_operator! (cv_sr, Ce)
689
+ reinit! (cv_sr, Xᵇ)
690
+
691
+ recover_cell_stresses (srdata (igashell), σ_states, celldata, cv_sr, cv)
692
+
653
693
end
654
694
655
695
function _get_layer_forcevector_and_stiffnessmatrix! (
656
696
cv:: IGAShellValues{dim_s,dim_p,T} ,
657
697
ke:: AbstractMatrix , fe:: AbstractVector ,
658
- material, materialstate,
698
+ material, materialstate, stress_state,
659
699
ue_layer:: AbstractVector{T} , ilay:: Int , nlayers:: Int , active_dofs:: Vector{Int} ,
660
700
is_small_deformation_theory:: Bool , calculate_what:: IGASHELL_ASSEMBLETYPE , width:: T , cache:: IGAShellCacheSolid{dim_s,T} ) where {dim_s,dim_p,T}
661
701
@@ -704,13 +744,13 @@ function _get_layer_forcevector_and_stiffnessmatrix!(
704
744
_calculate_linear_forces! (fe, ke, cv,
705
745
ilay, qpᴸ, qp, width,
706
746
F, R, δF, δɛ,
707
- material, materialstate,
747
+ material, materialstate, stress_state,
708
748
ndofs_layer)
709
749
else
710
750
_calculate_nonlinear_forces! (fe, ke, cv,
711
751
ilay, qpᴸ, qp, width,
712
752
F, R, δF, δɛ,
713
- material, materialstate,
753
+ material, materialstate, stress_state,
714
754
ndofs_layer)
715
755
end
716
756
elseif calculate_what === IGASHELL_FSTAR
@@ -727,7 +767,7 @@ function _get_layer_forcevector_and_stiffnessmatrix!(
727
767
728
768
end
729
769
730
- function _calculate_linear_forces! (fe, ke, cv, ilay, layer_qp, qp, width, F:: Tensor{2,dim_s} , R, δF, δɛ, material, materialstates, ndofs_layer) where {dim_s}
770
+ function _calculate_linear_forces! (fe, ke, cv, ilay, layer_qp, qp, width, F:: Tensor{2,dim_s} , R, δF, δɛ, material, materialstates, stress_state, ndofs_layer) where {dim_s}
731
771
ɛ = symmetric (F) - one (SymmetricTensor{2 ,dim_s})
732
772
733
773
δɛ .= symmetric .(δF)
@@ -740,8 +780,7 @@ function _calculate_linear_forces!(fe, ke, cv, ilay, layer_qp, qp, width, F::Ten
740
780
∂σ∂ɛ = otimesu (R,R) ⊡ ∂̂σ∂ɛ ⊡ otimesu (R' ,R' )
741
781
σ = R⋅ _̂σ⋅ R'
742
782
743
- # σ, ∂σ∂ɛ, new_matstate = constitutive_driver(material[ilay], ɛ, ⁿmaterialstates[layer_qp])
744
- # materialstates[layer_qp] = new_matstate
783
+ stress_state[qp] = _to3d (_̂σ)
745
784
746
785
for i in 1 : ndofs_layer
747
786
@@ -762,7 +801,7 @@ function _calculate_linear_forces!(fe, ke, cv, ilay, layer_qp, qp, width, F::Ten
762
801
763
802
end
764
803
765
- function _calculate_nonlinear_forces! (fe, ke, cv, ilay, layer_qp, qp, width, F, R, δF, δE, material, materialstates, ndofs_layer)
804
+ function _calculate_nonlinear_forces! (fe, ke, cv, ilay, layer_qp, qp, width, F, R, δF, δE, material, materialstates, stress_state, ndofs_layer)
766
805
dΩ = getdetJdV (cv,qp)* width
767
806
768
807
E = symmetric (1 / 2 * (F' ⋅ F - one (F)))
@@ -774,6 +813,10 @@ function _calculate_nonlinear_forces!(fe, ke, cv, ilay, layer_qp, qp, width, F,
774
813
∂S∂E = otimesu (R,R) ⊡ _∂S∂E ⊡ otimesu (R' ,R' )
775
814
S = R⋅ _S⋅ R'
776
815
816
+ σ = inv (det (F)) * symmetric (F ⋅ S ⋅ F' )
817
+ _̂σ = symmetric (R' ⋅ σ⋅ R)
818
+ stress_state[qp] = _to3d (_̂σ)
819
+
777
820
# σ = inv(det(F)) * F ⋅ S ⋅ F'
778
821
779
822
# Hoist computations of δE
0 commit comments