跳转至

xJoint

user_X_Joint1.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
clear;
fs.randSeed(2);%build random model
B=obj_Box;%build a box object
B.name='X_Joint1';
B.GPUstatus='auto';
B.ballR=50;%单元平均半径
B.isClump=0;
B.distriRate=0.2;%颗粒直径分散系数,最大直径与最小直径比值为(1+rate)^2
B.sampleW=7e3;%模型箱子内部的宽
B.sampleL=0;%模型箱子内部的长
B.sampleH=10e3;%模型箱子内部的高
B.BexpandRate=10;%边界的延伸单元数
B.PexpandRate=10;%压力板的延伸单元数
B.type='TriaxialCompression';%根据模型类型(B.type)设置三轴压力板
B.setType();
B.buildInitialModel();%建立初始模型
B.show();
B.setUIoutput();
d=B.d;

d.mo.setGPU('auto');
%--------------end initial model------------
B.gravitySediment();%让单元随机运动,并在重力作用下堆积
B.compactSample(1);%input is compaction time%利用上压力板来压实样品
%------------return and save result--------------
d.status.dispEnergy();%display the energy of the model

d.clearData(1);%clear dependent data
d.recordCalHour('Box1Finish');
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_X_Joint2.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
65
66
67
68
69
70
clear
load('TempModel/X_Joint11.mat');
B.setUIoutput();%set output of message
d=B.d;
d.calculateData();
d.mo.setGPU('off');
d.getModel();%get xyz from d.mo
d.connectGroup();
%StressXX=5e6;
%StressZZ=5e6;
%B.setPlatenFixId()

%B.setPlatenStress(StressXX,0,0,B.ballR*5);
d.showB=2;
topPartId=[d.GROUP.topB;d.GROUP.topPlaten];%将上压力板与上边界组合
d.addGroup('topPart',topPartId);%构建组
d.show;
matTxt2=load('Mats\XRock.txt');%load a un-trained material file
Mats{1,1}=material('XRock',matTxt2,B.ballR);
Mats{1,1}.Id=1;
d.Mats=Mats;
d.groupMat2Model({'sample'},1);    %赋予材料属性

d.mo.mGZ(:)=0;%消除z方向体力,即消除重力
stressXX=5e6;
stressZZ=5e6;
d.mo.setShear('off');
B.setPlatenStress(-stressXX,0,-stressZZ,B.ballR*5);
d.mo.mGX(d.GROUP.lefPlaten)=-d.mo.mGX(d.GROUP.rigPlaten);%模型左拉右压

d.breakGroup();%断开所有单元的连接
d.mo.setGPU('auto');
d.balance('Standard',1);

d.connectGroup();%胶结所有连接
d.removePrestress();%将单元的抗拉力临时减小,断开胶结,消除单元间的张力(预应力
d.deleteConnection('boundary');%删除胶结
%消除内应力
%B.compactSample(1);
d.balance('Standard',1);

ddis=d.mo.aZ(d.GROUP.topPlaten);
dddis=d.mo.aZ(d.GROUP.topB);
d.moveGroup('topB',0,0,ddis-dddis+2*B.ballR);
d.moveGroup('lefB',-200,0,0);
d.moveGroup('rigB',200,0,0);
%C=Tool_Cut(d);%cut the model
%lSurf=load('slope/IntermittentX3.txt');%load the surface data
%C.addSurf(lSurf);%add the sur faces to the cut 导入离散点数据
%C.getSurfTri(1,1);
%C.getTriangle(1);
%C.setBondByTriangle('break');

%C=Tool_Cut(d);%cut the model
%lSurf=load('slope/IntermittentX4.txt');%load the surface data
%C.addSurf(lSurf);%add the sur faces to the cut
%C.getSurfTri(1,1);%获取离散元三角面信息
%C.getTriangle(1); %获取三角面顶点坐标
%C.setBondByTriangle('break');%使三角面破裂
%d.show('--');
d.show('aR')


%---------------5. save the data
d.mo.setGPU('off');
d.clearData(1);
d.recordCalHour('BoxModel2Finish');
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();
user_X_Joint3.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
clear;
load('TempModel/X_Joint12.mat');
d.calculateData();
d.mo.setGPU('off');
B.setUIoutput();
d=B.d;
d.mo.isCrack=1;

d.getModel();%d.setModel();%reset the initial status of the model
d.resetStatus();%initialize model status, which records running information
d.mo.isHeat=1;%calculate heat in the model

d.mo.setShear('on');
gpuStatus=d.mo.setGPU('auto');
totalCircle=50;
d.tic(totalCircle);
fName=['data\step\' B.name num2str(B.ballR) '-' num2str(B.distriRate) 'loopNum'];
save([fName '0.mat']);%return;
d.mo.aBF=d.mo.aBF;
d.mo.aMUp(d.GROUP.lefPlaten)=0;
d.mo.aMUp(d.GROUP.rigPlaten)=0;
%d.mo.aMUp=d.mo.aMUp*0;
d.balance('Standard',1);

dis=800;
stepNum=16000
recordNum=800;
dDis=dis/stepNum;
num=0;
for i=1:stepNum
    d.moveGroup('topPart',0,0,-dDis);
    d.balance(2,1);
    if mod(i,recordNum)==0
        num=num+1;
        save([fName num2str(num) '.mat']);
    end
end
d.show('Displacement');

d.mo.setGPU('off');
d.clearData(1);
d.recordCalHour('BoxCrush3Finish');
save(['TempModel/' B.name '3.mat'],'d');
save(['TempModel/' B.name '3R' num2str(B.ballR) '-' num2str(B.distriRate)  'aNum' num2str(d.aNum) '.mat']);
d.calculateData();
Was this page helpful?