function [] = FESolveX2D() % MATLAB based XFEM Solver % J. Grogan (2012) clear all % Import Abaqus Mesh from INP File AbaFile=fopen('AbInp.inp'); AbaContent=zeros(1,5); while AbaContent(1:5)~='*Node' AbaContent=fgets(AbaFile) AbaContent end [ndCrds,elemNodes]=rectangularMesh(Lx,Ly,numElemX,numElemY); xx=ndCrds(:,1); yy=ndCrds(:,2); drawingMesh(ndCrds,elemNodes,'Q4','k-'); numNodes=size(xx,1); ndCrds elemNodes indx=1:numElem; elemNodes(:,1)=indx; elemNodes(:,2)=indx+1; % dofs per node ndof=2; % Define Section Properties rho=1.; % initial interface position dpos=5.; % Initial temperatures Tnew=zeros(numNodes*2,1); %storage stored(1)=dpos; for e=1:numElem crdn1=ndCoords(elemNodes(e,1)); if crdn1<=dpos Tnew(2*elemNodes(e,1)-1)=1.; end end % Define Time Step dtime=0.05; tsteps=20; time=0.; % penalty term beta=40.; % Loop through time steps for ts=1:tsteps % Get interface velocity d(1)=dpos+charlen; d(2)=dpos+3*charlen/4; d(3)=dpos+charlen/4; d(4)=dpos; for e=1:numElem crdn1=ndCoords(elemNodes(e,1)); crdn2=ndCoords(elemNodes(e,2)); for j=1:4 if d(j)>=crdn1 & d(j)