I've applied all properties in Cubit and the code but I get 0 when trying to generate max von Mises stress.
-->Cubit Journal:
>create surface rectangle width 1000 height 100 zplane
Journaled Command: create surface rectangle width 1000 height 100 zplane
>set duplicate block elements off
Setting duplicate block elements to OFF.
Journaled Command: set duplicate block elements off
>undo group begin
Journaled Command: undo group begin
>block 1 add surface 1
Added Surface 1 to block 1
Journaled Command: block 1 add surface 1
>undo group end
Journaled Command: undo group end
>set duplicate block elements off
Setting duplicate block elements to OFF.
Journaled Command: set duplicate block elements off
(Non-Commercial License) Cubit>undo group begin
Journaled Command: undo group begin
>block 2 add curve 2
Added Curve 2 to block 2
Journaled Command: block 2 add curve 2
>block 2 name "REACTION"
Journaled Command: block 2 name "REACTION"
>undo group end
Journaled Command: undo group end
>create displacement on curve 2 dof 1 dof 2 dof 6 fix
WARNING: Missing fixed displacement amount. DOFs will be fixed to 0.0
Created Displacement 1.
Journaled Command: create displacement on curve 2 dof 1 dof 2 dof 6 fix
>create force on curve 4 vector 0 -30 0 0 0 0
Created Force 1.
Journaled Command: create force on curve 4 vector 0 -30 0 0 0 0
>surface 1 scheme trimesh geometry approximation angle 15
Journaled Command: surface 1 scheme trimesh geometry approximation angle 15
>trimesher surface gradation 1.3
Journaled Command: trimesher surface gradation 1.3
>trimesher geometry sizing on
Journaled Command: trimesher geometry sizing on
>mesh surface 1
Matching intervals successful.
Mesh created for surfaces 1
Surface 1 meshing completed using scheme: trimesh
Journaled Command: mesh surface 1
>block 1 attribute count 2
Number of attributes on block 1 changed from default to 2
Journaled Command: block 1 attribute count 2
>block 1 attribute index 1 210000 name 'Attribute 1'
Journaled Command: block 1 attribute index 1 210000 name "Attribute 1"
>block 1 attribute index 2 0.3 name 'Attribute 2'
Journaled Command: block 1 attribute index 2 0.3 name "Attribute 2"
-->Code and result:
mesh_file='beam_model.cub'
#mesh_file='plate_with_hole_force_control.h5m'
!mofem_part -file_name {mesh_file} -my_nparts 1 -dim 2 -output_file one.h5m
[0] <inform> MoFEM version 0.12.1 (MOAB 5.2.1 Petsc Release Version 3.11.4, Sep, 28, 2019 )
[0] <inform> git commit id 2c75b451207e2bc357f65bbed286fb6664fc69b6
[0] <inform> Local time: 2021-12-15 13:58:32
[0] <inform> UTC time: 2021-12-15 13:58:32
[0] <inform> [MeshsetMng] meshset 12682136550675316746 type BLOCKSET msId 1 block header: blockCol = 4294967295 blockMat = 0 blockDimension = 2
[0] <inform> [MeshsetMng] meshset 12682136550675316747 type BLOCKSET UNKNOWNNAME msId 2 name REACTION block header: blockCol = 4294967295 blockMat = 0 blockDimension = 1
[0] <inform> [MeshsetMng] meshset 12682136550675316748 type NODESET DISPLACEMENTSET msId 1
[0] <inform> [MeshsetMng] meshset 12682136550675316749 type NODESET FORCESET msId 2
[0] <inform> [mofem_part] meshset 12682136550675316746 type BLOCKSET msId 1 block header: blockCol = 4294967295 blockMat = 0 blockDimension = 2
[0] <inform> [mofem_part] meshset 12682136550675316747 type BLOCKSET UNKNOWNNAME msId 2 name REACTION block header: blockCol = 4294967295 blockMat = 0 blockDimension = 1
[0] <inform> [mofem_part] meshset 12682136550675316748 type NODESET DISPLACEMENTSET msId 1
[0] <inform> [mofem_part] meshset 12682136550675316749 type NODESET FORCESET msId 2
[0] <inform> [ProblemsManager] Finite elements in problem: row lower 0 row upper 266 nb. elems 266 ( 266 )
# Material parameters
young_modulus=210000
poisson_ratio=0.3
hardening=0
yield_stress=240
number_of_steps=200
nb_elastic_steps=30
max_von_misses_fisrt_elastic_step = 0
# Load step and tolarence
elastic_step=True
if elastic_step:
load_step=1
final_load=1*load_step
yield_stress=1e32 # Make yield stress very big to have elastic step
else:
load_step=(yield_stress/max_von_misses_fisrt_elastic_step)/nb_elastic_steps
final_load=number_of_steps*load_step
#load_step=0.04
#final_load=25
realative_tolerance=1e-12
absolute_tolerance=1e-12
!rm -f out_*
!./plastic_2d \
-file_name one.h5m \
-ts_dt {load_step} \
-ts_max_time {final_load} \
-snes_atol {absolute_tolerance} \
-snes_rtol {realative_tolerance} \
-large_strains 0 \
-scale 1 \
-order 2 \
-young_modulus {young_modulus} \
-poisson_ratio {poisson_ratio} \
-hardening {hardening} \
-hardening_viscous 0 \
-Qinf 0 \
-yield_stress {yield_stress} \
-log_quiet 2>&1 | tee log
# Plot convergence
!grep SNES {log_file} > snes
newton_data=pd.read_fwf('snes', header=None)
newton_data=newton_data.rename(columns={0: "it", 4: "res", 6: "equlibrium", 8: 'constrain', 10: 'flow'})
newton_data=newton_data.drop([1, 2, 3, 5, 7, 9, 11], axis=1)
newton_data
plt.plot(newton_data['res'].to_numpy(),'r^-')
plt.title('Neton method convergence')
plt.ylabel('absolute residial')
plt.xlabel('accumulated iterations')
plt.yscale('log')
plt.grid(True)
plt.show()
MoFEM version 0.12.1 (MOAB 5.2.1 Petsc Release Version 3.11.4, Sep, 28, 2019 )
git commit id 2c75b451207e2bc357f65bbed286fb6664fc69b6
Local time: 2021-12-15 13:58:32
UTC time: 2021-12-15 13:58:32
meshset 12682136550675316746 type BLOCKSET msId 1 block header: blockCol = 4294967295 blockMat = 0 blockDimension = 2
meshset 12682136550675316747 type BLOCKSET UNKNOWNNAME msId 2 name REACTION block header: blockCol = 4294967295 blockMat = 0 blockDimension = 1
meshset 12682136550675316748 type NODESET DISPLACEMENTSET msId 1
meshset 12682136550675316749 type NODESET FORCESET msId 2
Add field U field_id 1 space H1 approximation base AINSWORTH_LEGENDRE_BASE rank 2 meshset 12682136550675316751
Add field TAU field_id 2 space L2 approximation base AINSWORTH_LEGENDRE_BASE rank 1 meshset 12682136550675316752
Add field EP field_id 4 space L2 approximation base AINSWORTH_LEGENDRE_BASE rank 3 meshset 12682136550675316753
Add finite element dFE
Add finite element bFE
Add problem SimpleProblem
Number of dofs 4402
Finite element dFE added. Nb. of elements added 266
Finite element bFE added. Nb. of elements added 72
Number of adjacencies 2344
SimpleProblem Nb. local dof 4402 by 4402 nb global dofs 4402 by 4402
FEs ghost dofs on problem SimpleProblem Nb. ghost dof 0 by 0 Nb. local dof 4402 by 4402
Young modulus 210000
Poisson ratio 0.3
Yield stress 1e+32
Hardening 0
Viscous hardening 0
Saturation yield stress 0
Saturation exponent 16.93
cn 1
Scaled Young modulus 1
Scaled Poisson ratio 0.3
Scaled Yield stress 4.7619e+26
Scaled Hardening 0
Scaled Viscous hardening 0
Scaled Saturation yield stress 0
Field split block size 0
reaction time 0.0000e+00 0.0000e+00
Ux time 0.0000e+00 min 0.0000e+00 max 0.0000e+00
Uy time 0.0000e+00 min 0.0000e+00 max 0.0000e+00
0 TS dt 1. time 0.
0 SNES Function norm 0.000000000000e+00 [ 0.000000000000e+00 , 0.000000000000e+00 , 0.000000000000e+00 ]
TSAdapt none beuler 0: step 0 accepted t=0 + 1.000e+00 dt=1.000e+00
reaction time 1.0000e+00 0.0000e+00
Ux time 1.0000e+00 min 0.0000e+00 max 0.0000e+00
Uy time 1.0000e+00 min 0.0000e+00 max 0.0000e+00
1 TS dt 1. time 1.