%build the geometrical modelclear;fs.randSeed(2);%build random modelB=obj_Box;%build a box objectB.name='BoxModel';B.GPUstatus='auto';B.ballR=1;B.isClump=0;B.distriRate=0.2;B.sampleW=100;B.sampleL=0;B.sampleH=80;%B.BexpandRate=4;%B.PexpandRate=4;B.type='topPlaten';%B.type='TriaxialCompression';B.setType();B.buildInitialModel();%B.show();B.setUIoutput();d=B.d;%d.breakGroup('sample');d.breakGroup('lefPlaten');%--------------end initial model------------B.gravitySediment();B.compactSample(1);%input is compaction time%------------return and save result--------------d.status.dispEnergy();%display the energy of the modeld.clearData(1);%clear dependent datad.recordCalHour('BoxModel1Finish');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');
%set the material of the modelclearload('TempModel/BoxModel1.mat');B.setUIoutput();%set output of messaged=B.d;d.calculateData();d.mo.setGPU('off');d.getModel();%get xyz from d.mo%---------cut the model to make slopeC=Tool_Cut(d);%cut the modellSurf=load('slope/layer surface.txt');%load the surface dataC.addSurf(lSurf);%add the surfaces to the cutC.setLayer({'sample'},[1,2,3,4]);%set layers according geometrical datagNames={'lefPlaten';'rigPlaten';'botPlaten';'layer1';'layer2';'layer3'};d.makeModelByGroups(gNames);%---------end cut the model to make slope%----------set material of modelmatTxt=load('Mats\Soil1.txt');Mats{1,1}=material('Soil1',matTxt,B.ballR);Mats{1,1}.Id=1;matTxt2=load('Mats\Soil2.txt');Mats{2,1}=material('Soil2',matTxt2,B.ballR);Mats{2,1}.Id=2;d.Mats=Mats;%----------end set material of model%---------assign material to layers and balance the modeld.setGroupMat('layer2','Soil2');d.groupMat2Model({'sample','layer2'});d.balanceBondedModel();%---------end assign material to layers and balance the model%---------save the datad.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();
clear;load('TempModel/BoxModel2.mat');B.setUIoutput();d=B.d;d.calculateData();d.mo.setGPU('off');d.getModel();%d.setModel();%reset the initial status of the modeld.status=modelStatus(d);%initialize model status, which records running informationd.mo.isHeat=1;%calculate heat in the modelvisRate=0.001;d.mo.mVis=d.mo.mVis*visRate;gpuStatus=d.mo.setGPU('auto');d.setStandarddT();%reset the step time to default valuetotalCircle=20;d.tic(totalCircle);fName=['data/step/'B.namenum2str(B.ballR)'-'num2str(B.distriRate)'loopNum'];save([fName'0.mat']);%return;fori=1:totalCircled.mo.setGPU(gpuStatus);d.balance('Standard',0.2);d.clearData(1);save([fNamenum2str(i)'.mat']);d.calculateData();d.toc();%show the note of timeendd.show('aR');d.mo.setGPU('off');d.clearData(1);d.recordCalHour('BoxModel3Finish');save(['TempModel/'B.name'3.mat'],'B','d');save(['TempModel/'B.name'3R'num2str(B.ballR)'-distri'num2str(B.distriRate)'aNum'num2str(d.aNum)'.mat']);d.calculateData();