Skip to content

Commit e1c439d

Browse files
authored
Merge pull request #26 from yangbai90/devel
Devel
2 parents edc4bbb + 4ed33af commit e1c439d

8 files changed

Lines changed: 180 additions & 6 deletions

File tree

examples/tutorial/step3.i

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
[mesh]
2+
type=asfem
3+
dim=2
4+
xmax=5.0
5+
ymax=5.0
6+
nx=50
7+
ny=50
8+
meshtype=quad4
9+
[end]
10+
11+
[dofs]
12+
name=ux uy
13+
[end]
14+
15+
[elmts]
16+
[mysolid]
17+
type=mechanics
18+
dofs=ux uy
19+
mate=mymate
20+
[end]
21+
[end]
22+
23+
[mates]
24+
[mymate]
25+
type=linearelastic
26+
params=210.0 0.3
27+
[end]
28+
[end]
29+
30+
[bcs]
31+
[fixbottomX]
32+
type=dirichlet
33+
dof=ux
34+
value=0.0
35+
boundary=bottom
36+
[end]
37+
[fixbottomY]
38+
type=dirichlet
39+
dof=uy
40+
value=0.0
41+
boundary=bottom
42+
[end]
43+
[loadY]
44+
type=dirichlet
45+
dof=uy
46+
value=0.1
47+
boundary=top
48+
[end]
49+
[end]
50+
51+
[projection]
52+
name=vonMises stress_xx stress_yy stress_xy
53+
[end]
54+
55+
[job]
56+
type=static
57+
debug=dep
58+
[end]

examples/tutorial/step4.i

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
[mesh]
2+
type=asfem
3+
dim=3
4+
xmax=1.0
5+
ymax=1.0
6+
zmax=10.0
7+
nx=5
8+
ny=5
9+
nz=50
10+
meshtype=hex8
11+
[end]
12+
13+
[dofs]
14+
name=c
15+
[end]
16+
17+
[elmts]
18+
[mydiffusion]
19+
type=diffusion
20+
dofs=c
21+
mate=mymate
22+
[end]
23+
[end]
24+
25+
[mates]
26+
[mymate]
27+
type=constdiffusion
28+
params=1.0e1
29+
[end]
30+
[end]
31+
32+
[bcs]
33+
[flux]
34+
type=neumann
35+
dof=c
36+
value=-0.5
37+
boundary=front
38+
[end]
39+
[end]
40+
41+
[timestepping]
42+
type=be
43+
dt=1.0e-3
44+
time=1.0e0
45+
[end]
46+
47+
[job]
48+
type=transient
49+
debug=dep
50+
[end]

examples/tutorial/step5.i

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
[mesh]
2+
type=asfem
3+
dim=2
4+
xmax=4.0
5+
ymax=4.0
6+
nx=100
7+
ny=100
8+
meshtype=quad4
9+
[end]
10+
11+
[dofs]
12+
name=c mu
13+
[end]
14+
15+
[elmts]
16+
[mych]
17+
type=cahnhilliard
18+
dofs=c mu
19+
mate=myf
20+
[end]
21+
[end]
22+
23+
[mates]
24+
[myf]
25+
type=cahnhilliard
26+
params=1.0 2.5 0.005
27+
// D Chi Kappa
28+
[end]
29+
[end]
30+
31+
[timestepping]
32+
type=be
33+
dt=1.0e-5
34+
time=3.0e3
35+
adaptive=true
36+
optiters=3
37+
growthfactor=1.1
38+
cutfactor=0.85
39+
[end]
40+
41+
[nonlinearsolver]
42+
type=nr
43+
solver=superlu
44+
[end]
45+
46+
[ics]
47+
[ic1]
48+
type=random
49+
dof=c
50+
params=0.6 0.66
51+
[end]
52+
[end]
53+
54+
[job]
55+
type=transient
56+
debug=dep
57+
[end]

scripts/Clean.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
currentdir=os.getcwd()
1313
print('We are in folder:%s\n'%(currentdir))
1414

15-
ASFEM=0;cmakefolder=0;ideafolder=0;o=0;vtu=0
15+
ASFEM=0;cmakefolder=0;ideafolder=0;o=0;vtu=0;metafile=0
1616
cmake=0
1717
for subdir,dirs,files in os.walk(currentdir):
1818
if ('external/eigen' in subdir) or ('.git' in subdir):
@@ -49,6 +49,13 @@
4949
os.remove(removepath)
5050
except:
5151
print('%s is not here'%(file))
52+
elif ('.avi' in file) or ('.gif' in file):
53+
try:
54+
metafile+=1
55+
removepath=subdir+'/'+file
56+
os.remove(removepath)
57+
except:
58+
print('%s is not here'%(file))
5259
#>> clean folder
5360
for dir in dirs:
5461
if '.idea' in dir:
@@ -75,6 +82,7 @@
7582
print('Remove %4d ASFEM files!'%(ASFEM))
7683
print('Remove %4d vtu files!'%(vtu))
7784
print('Remove %4d .o files!'%(o))
85+
print('Remove %4d meta files!'%(metafile))
7886
print('Remove %4d .idea folder!'%(ideafolder))
7987
print('Remove %4d cmake file!'%(cmake))
8088
print('Remove %4d cmake folder!'%(cmakefolder))

src/InputSystem/ReadTimeSteppingBlock.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ bool InputSystem::ReadTimeSteppingBlock(ifstream &in,string str,int &linenum,Tim
6161
substr.length()==2){
6262
HasType=true;
6363
timesteppingBlock._TimeSteppingType=TimeSteppingType::CRANCKNICLSON;
64-
timesteppingBlock._TimeSteppingTypeName="crank–nicolson";
64+
timesteppingBlock._TimeSteppingTypeName="crank-nicolson";
6565
}
6666
else if((substr.find("gl")!=string::npos||substr.find("GL")!=string::npos)&&
6767
substr.length()==2){
@@ -277,12 +277,12 @@ bool InputSystem::ReadTimeSteppingBlock(ifstream &in,string str,int &linenum,Tim
277277
}
278278
else if(str.find("[]")!=string::npos){
279279
MessagePrinter::PrintErrorInLineNumber(linenum);
280-
MessagePrinter::PrintErrorTxt("the bracket pair is not complete in the [nonlinearsolver] block",false);
280+
MessagePrinter::PrintErrorTxt("the bracket pair is not complete in the [timestepping] block",false);
281281
MessagePrinter::AsFem_Exit();
282282
}
283283
else{
284284
MessagePrinter::PrintErrorInLineNumber(linenum);
285-
MessagePrinter::PrintErrorTxt("unknown option in [nonlinearsolver] block",false);
285+
MessagePrinter::PrintErrorTxt("unknown option in [timestepping] block",false);
286286
MessagePrinter::AsFem_Exit();
287287
}
288288
getline(in,str);linenum+=1;

src/NonlinearSolver/NonlinearSolver.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ void NonlinearSolver::Init(){
5555
SNESGetKSP(_snes,&_ksp);
5656
KSPGMRESSetRestart(_ksp,1400);
5757
KSPGetPC(_ksp,&_pc);
58+
PCFactorSetMatSolverType(_pc,MATSOLVERPETSC);
5859

5960
if(_LinearSolverName=="mumps"){
6061
PCSetType(_pc,PCLU);

src/TimeStepping/TimeSteppingInit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void TimeStepping::Init(){
5858
SNESGetKSP(_snes,&_ksp);
5959
KSPGMRESSetRestart(_ksp,1400);
6060
KSPGetPC(_ksp,&_pc);
61-
PCSetType(_pc,PCLU);
61+
PCFactorSetMatSolverType(_pc,MATSOLVERPETSC);
6262

6363
if(_LinearSolverName=="mumps"){
6464
PCSetType(_pc,PCLU);

tests/transient/cahnhilliard2d.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ name=c mu
5151
maxiters=50
5252
r_rel_tol=1.0e-8
5353
r_abs_tol=1.0e-7
54-
solver=superlu
54+
solver=ksp
5555
[end]
5656

5757
[projection]

0 commit comments

Comments
 (0)