Skip to content

Commit

Permalink
Merge pull request #55 from M3Group/devel
Browse files Browse the repository at this point in the history
Release for v0.7
  • Loading branch information
yangbai90 authored Jan 30, 2022
2 parents e964887 + 53538de commit 9bbb257
Show file tree
Hide file tree
Showing 52 changed files with 101,187 additions and 77 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ set(src ${src} src/ElmtSystem/AllenCahnFractureElmt.cpp)
### For wave element
set(inc ${inc} include/ElmtSystem/WaveElmt.h)
set(src ${src} src/ElmtSystem/WaveElmt.cpp)
### for thermal element
set(inc ${inc} include/ElmtSystem/ThermalElmt.h)
set(src ${src} src/ElmtSystem/ThermalElmt.cpp)
### for UEL1
set(inc ${inc} include/ElmtSystem/User1Elmt.h)
set(src ${src} src/ElmtSystem/User1Elmt.cpp)
Expand Down Expand Up @@ -405,6 +408,9 @@ set(src ${src} src/MateSystem/LinearElasticCHMaterial.cpp)
### for wave material
set(inc ${inc} include/MateSystem/WaveMaterial.h)
set(src ${src} src/MateSystem/WaveMaterial.cpp)
### for thermal material
set(inc ${inc} include/MateSystem/ThermalMaterial.h)
set(src ${src} src/MateSystem/ThermalMaterial.cpp)
### For UMAT1
set(inc ${inc} include/MateSystem/User1Material.h)
set(src ${src} src/MateSystem/User1Material.cpp)
Expand Down Expand Up @@ -468,6 +474,9 @@ set(inc ${inc} include/BCSystem/DirichletBCBase.h)
### for dirichlet boundary condition
set(inc ${inc} include/BCSystem/DirichletBC.h)
set(src ${src} src/BCSystem/DirichletBC.cpp)
### for cyclic dirichlet bc
set(inc ${inc} include/BCSystem/CyclicDirichletBC.h)
set(src ${src} src/BCSystem/CyclicDirichletBC.cpp)
### for user1 dirichlet bc
set(inc ${inc} include/BCSystem/User1DirichletBC.h)
set(src ${src} src/BCSystem/User1DirichletBC.cpp)
Expand All @@ -491,6 +500,7 @@ set(src ${src} src/BCSystem/CheckAppliedBCNameIsValid.cpp)
set(src ${src} src/BCSystem/PrintBCSystemInfo.cpp)
set(src ${src} src/BCSystem/ApplyBC.cpp)
set(src ${src} src/BCSystem/ApplyDirichletBC.cpp)
set(src ${src} src/BCSystem/ApplyPresetBC.cpp)
set(src ${src} src/BCSystem/ApplyNodalDirichletBC.cpp)
set(src ${src} src/BCSystem/ApplyNodalNeumannBC.cpp)
set(src ${src} src/BCSystem/RunBCLibs.cpp)
Expand Down
64 changes: 64 additions & 0 deletions examples/mechanics/cyclictensile.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[mesh]
type=asfem
dim=2
xmax=2.0
ymax=2.0
nx=50
ny=50
meshtype=quad4
[end]

[dofs]
name=ux uy
[end]

[elmts]
[mysolids]
type=mechanics
dofs=ux uy
mate=mymate
[end]
[end]

[mates]
[mymate]
type=linearelastic
params=210.0 0.3
// E nu
[end]
[end]

[bcs]
[fix]
type=dirichlet
dofs=ux uy
value=0.0
boundary=bottom
[end]
[loading]
type=cyclicdirichlet
dofs=uy
params= 0.0 0.0 0.1 0.1 0.2 0.0 0.3 0.2
boundary=top
[end]
[end]

[timestepping]
type=be
dt=1.0e-5
dtmax=5.0e-2
time=3.5e-1
optiters=3
adaptive=true
[end]

[projection]
scalarmate=vonMises
rank2mate=stress
[end]

[job]
type=transient
debug=dep
[end]

82 changes: 82 additions & 0 deletions examples/mechanics/j2cycling.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
*** This is an input file for the compressive neohookean model

[mesh]
type=asfem
dim=2
xmax=5.0
ymax=5.0
nx=50
ny=50
meshtype=quad4
[end]



[dofs]
name=ux uy
[end]

[projection]
scalarmate=vonMises effective_plastic_strain
rank2mate=stress strain
[end]

[elmts]
[mechanics]
type=mechanics
dofs=ux uy
mate=myplastic
domain=alldomain
[end]
[end]

[mates]
[myplastic]
type=j2plasticity
params=210.0 0.3 0.5 1.2
// E nu yield stress hardening modulus
[end]
[end]



[bcs]
[FixUx]
type=dirichlet
dofs=ux
boundary=left right
value=0.0
[end]
[FixUy]
type=dirichlet
dofs=uy
boundary=bottom
value=0.0
[end]
[loadUy]
type=cyclicdirichlet
dofs=uy
params=0.0 0.0 0.2 0.2 0.3 0.0 0.4 0.4 0.5 -0.1 0.6 0.5
boundary=top
[end]
[end]

[output]
type=vtu
interval=2
[end]

[timestepping]
type=be
dt=2.0e-4
endtime=1.0e0
adaptive=true
optiters=3
dtmax=1.0e-1
//dtmin=1.0e-12
[end]

[job]
type=transient
debug=dep
[end]
82 changes: 82 additions & 0 deletions examples/mechanics/j2plasticity.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
*** This is an input file for the compressive neohookean model

[mesh]
type=asfem
dim=2
xmax=5.0
ymax=5.0
nx=50
ny=50
meshtype=quad4
[end]



[dofs]
name=ux uy
[end]

[projection]
scalarmate=vonMises effective_plastic_strain
rank2mate=stress strain
[end]

[elmts]
[mechanics]
type=mechanics
dofs=ux uy
mate=myplastic
domain=alldomain
[end]
[end]

[mates]
[myplastic]
type=j2plasticity
params=210.0 0.3 0.5 1.2
// E nu yield stress hardening modulus
[end]
[end]



[bcs]
[FixUx]
type=dirichlet
dofs=ux
boundary=left right
value=0.0
[end]
[FixUy]
type=dirichlet
dofs=uy
boundary=bottom
value=0.0
[end]
[loadUx]
type=dirichlet
dofs=uy
value=1.0*t
boundary=top
[end]
[end]

[output]
type=vtu
interval=5
[end]

[timestepping]
type=be
dt=2.0e-4
endtime=1.0e0
adaptive=true
optiters=3
dtmax=1.0e-1
//dtmin=1.0e-12
[end]

[job]
type=transient
debug=dep
[end]
66 changes: 66 additions & 0 deletions examples/pffracture/PolyGrainsE.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
'''
This script is used for the input file generation of
polycrystalline structe. It will ouput the [mates] and [elmts]
block for AsFem.
@author: Yang Bai
@Date : 2021.11.07
@Usage : PolyGrains.py -grains 5
'''
import numpy as np
import sys

LambdaVec=121.15;muVec=80.77




Gc=2.7e-3;L=0.012;viscosity=1.0e-6

nGrains=250
i=0
for name in sys.argv:
if '-grains' in name:
if i+1<len(sys.argv):
nGrains=int(sys.argv[i+1])
if nGrains<1:
nGrains=1
i+=1
###################################
### for random euler angles
###################################
#LambdaVec=np.random.rand(nGrains)*121.15
muVec=np.random.rand(nGrains)*80.77

LambdaVec=np.random.normal(121.15, 30, nGrains)
muVec =np.random.normal(80.77, 25, nGrains)
###################################
filename='polygrainsE.txt'
inp=open(filename,'w')

##########################
### for [elmts] block
##########################
inp.write('[elmts]\n')
for i in range(nGrains):
str =' [myelmt%d]\n'%(i+1)
str+=' type=miehefrac\n'
str+=' dofs=d ux uy uz\n'
str+=' mate=mymate%d\n'%(i+1)
str+=' domain=%d\n'%(i+1)
str+=' [end]\n'
inp.write(str)
inp.write('[end]\n\n\n')

#################################
### for [mates] block
#################################
inp.write('[mates]\n')
str=''
for i in range(nGrains):
k=LambdaVec[i];mu=muVec[i]
str+=' [mymate%d]\n'%(i+1)
str+=' type=miehefracmate\n'
str+=' params=%11.4e %11.4e %11.4e %11.4e %11.4e\n'%(k,mu,Gc,L,viscosity)
str+=' [end]\n'
str+='[end]\n'
inp.write(str)
Loading

0 comments on commit 9bbb257

Please sign in to comment.