Commit ab090cea authored by matecellab's avatar matecellab
Browse files

added option to offset indenter further from skin

parent 2727f490
......@@ -45,7 +45,7 @@ function bas_buildFEM(basil,param)
% For plot parameters and defaults see bas_extractAbaPlot
% param.odbT = 5; (integer) period for output to the abaqus odb-file [s].
% For values <=0, the odb is updated each increment.
%
% param.indOff = 0; move indenter indOff further from skin
% See also, bas_prepFEM, bas_MRItoMat, bas_maskBG, bas_segmentMRI,
% bas_mapBone, bas_estCylPos, bas_estIndDisp, bas_extractAbaPlot
......@@ -81,6 +81,7 @@ if size(param.ogden,2) > 3
param.ogden(3) = bas_nu2D(param.ogden(1),param.ogden(4));
end
if ~isfield(param,'odbT'), param.odbT = 5; end % period for out to the abaqus odb-file
if ~isfield(param,'indOff'), param.indOff = 0; end % have abaqus execute the python script (1, default) or not (0)
for b = 1:numel(basil)
......@@ -116,6 +117,7 @@ for b = 1:numel(basil)
else
fprintf(fid,'param.odbT = 0;\n');
end
fprintf(fid,'param.indOff = %f;\n',param.indOff);
fclose(fid);
% load bone com (offset model to bone com = [0 0 0])
......@@ -302,6 +304,12 @@ for b = 1:numel(basil)
tipnr = load(fullfile(param.basilhome,num2str(basil(b)),'Indenter_tipNR.txt'));
[alpha, w] = rot2VecAngle(tipnr(2:end,:));
indSE = load(fullfile(param.basilhome,num2str(basil(b)),'Indenter_StartEnd.txt'));
if param.indOff ~= 0
% offset indenter extra from skin
rind = diff(indSE,1);
dind = sqrt(sum(rind.^2))+param.indOff;
indSE(1,:) = indSE(2,:) - rind/sqrt(sum(rind.^2))*dind;
end
fprintf(fid,'# position indenter\n');
fprintf(fid,'a1 = myModel.rootAssembly\n');
fprintf(fid,'# rotate indenter to align with z-axis (instead of y)\n');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment