function [domain] = domain2faces(fem) % determine what faces are associated with which domains % get the up/down info upDown=geominfo(fem.geom,'out','ud'); % domain(n) holds the faces associated with domain n-1 % domain 0 is the volume surrounding the model domain=cell(1,max(upDown(:))+1); % loop through the faces and add them to the appropriate domains for i=1:length(upDown) domain{upDown(1,i)+1}=[domain{upDown(1,i)+1},i]; domain{upDown(2,i)+1}=[domain{upDown(2,i)+1},i]; end return;