跳转至

BoxLayer

user_BoxLayer1.m
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
%build the geometrical model
clear;
fs.randSeed(1);%build random model
B=obj_Box;%build a box object
B.name='BoxLayer';
B.GPUstatus='auto';
width=0.1;length=0;height=0.1;ballR=0.001;%width, length, height, radius
distriRate=0.2;%define distribution of ball radius, 
isClump=0;
%--------------initial model------------
B.ballR=ballR;
B.isClump=isClump;
B.distriRate=distriRate;
B.sampleW=width;
B.sampleL=length;
B.sampleH=height;
%B.BexpandRate=4;%expand boundaries
%B.PexpandRate=4;%expand platens
%B.type='GeneralSlope';
B.type='TriaxialCompression';
B.setType();
B.buildInitialModel();%B.show();
B.setUIoutput();

%--------------end initial model------------
B.gravitySediment();
B.compactSample(2);%input is compaction time
d=B.d;
mfs.reduceGravity(d,5);
%------------return and save result--------------
d.status.dispEnergy();%display the energy of the model

d.clearData(1);%clear dependent data
d.recordCalHour('BoxLayer1Finish');
save(['TempModel/' B.name '1.mat'],'B','d');
save(['TempModel/' B.name '1R' num2str(B.ballR) '-distri' num2str(B.distriRate)  'aNum' num2str(d.aNum) '.mat']);
d.calculateData();
d.show('aR');
user_BoxLayer2.m
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
%set the material of the model
clear
load('TempModel/BoxLayer1.mat');
B.setUIoutput();
d=B.d;
d.calculateData();
d.mo.setGPU('off');
d.getModel();%get xyz from d.mo

matTxt=load('Mats\StrongRock.txt');
Mats{1,1}=material('StrongRock',matTxt,B.ballR);
Mats{1,1}.Id=1;
matTxt2=load('Mats\WeakRock.txt');
Mats{2,1}=material('WeakRock',matTxt2,B.ballR);
Mats{2,1}.Id=2;
matTxt3=load('Mats\Water.txt');
Mats{3,1}=material('Water',matTxt3,B.ballR);
Mats{3,1}.Id=3;
d.Mats=Mats;

dipD=90;dipA=20;strongT=0.01;weakT=0.01;
weakFilter=mfs.getWeakLayerFilter(d.mo.aX,d.mo.aY,d.mo.aZ,dipD,dipA,strongT,weakT);
strongFilter=~weakFilter;
sampleId=d.getGroupId('sample');
aWFilter=false(size(weakFilter));
aWFilter(sampleId)=true;
sampleWfilter=aWFilter&weakFilter;
d.addGroup('WeakLayer',find(sampleWfilter));
sX=d.mo.aX(sampleId);sY=d.mo.aY(sampleId);sZ=d.mo.aZ(sampleId);
Rrate=0.2;

r=(min(max(sX)-min(sX))/2)*Rrate;
centerFilter=mfs.getSphereFilter(sX,sY,sZ,r);
d.addGroup('Pore',find(centerFilter));
B.setPlatenFixId();
d.setGroupMat('WeakLayer','WeakRock');
d.setGroupMat('Pore','Water');
d.groupMat2Model({'WeakLayer','Pore'},1);
d.getModel();%d.setModel();%reset the initial status of the model
d.resetStatus();%initialize model status, which records running information

d.mo.bFilter(:)=0;
d.connectGroup('Pore');
fs.setPlatenStress(d,-1e6,-1e6,-1e6,B.ballR*5);
d.mo.zeroBalance();
d.deleteConnection('boundary');
StandardBalanceNum=2;
d.balance('Standard',StandardBalanceNum);
moveDis=mean(d.TAG.modelWHT)*0.1;
d.moveBoundary('right',moveDis,0,0);%declare moving right boundary
d.moveBoundary('back',0,moveDis,0);
d.moveBoundary('top',0,0,moveDis);

d.balance('Standard',StandardBalanceNum);
d.balanceBondedModel0();%balance the bonded model without friction
d.balanceBondedModel();%balance the bonded model with friction

d.showFilter('SlideY',0.5,1,'aMatId');
d.mo.setGPU('off');
d.clearData(1);
d.recordCalHour('BoxLayer2Finish');
save(['TempModel/' B.name '2.mat'],'B','d');
save(['TempModel/' B.name '2R' num2str(B.ballR) '-distri' num2str(B.distriRate)  'aNum' num2str(d.aNum) '.mat']);
d.calculateData();