DEMO_febio_00014_cube_varying_material

Below is a demonstration for:

Contents

Keywords

clear; close all; clc;

Plot settings

fontSize=15;
faceAlpha1=0.8;
markerSize=40;
lineWidth=3;
cMap=spectral(250);

Control parameters

% Path names
defaultFolder = fileparts(fileparts(mfilename('fullpath')));
savePath=fullfile(defaultFolder,'data','temp');

% Defining file names
febioFebFileNamePart='tempModel';
febioFebFileName=fullfile(savePath,[febioFebFileNamePart,'.feb']); %FEB file name
febioLogFileName=[febioFebFileNamePart,'.txt']; %FEBio log file name
febioLogFileName_disp=[febioFebFileNamePart,'_disp_out.txt']; %Log file name for exporting force
febioLogFileName_sed=[febioFebFileNamePart,'_sed_out.txt']; %Log file name for exporting strain energy density

%Specifying dimensions and number of elements
pointSpacings=1*ones(1,3); %Desired point spacing between nodes
cubeSize=10;
sampleWidth=cubeSize; %Width
sampleThickness=cubeSize; %Thickness
sampleHeight=cubeSize; %Height
numElementsWidth=round(sampleWidth/pointSpacings(1)); %Number of elemens in dir 1
numElementsThickness=round(sampleThickness/pointSpacings(2)); %Number of elemens in dir 2
numElementsHeight=round(sampleHeight/pointSpacings(3)); %Number of elemens in dir 3

%Define applied displacement
appliedStrain=0.3; %Linear strain (Only used to compute applied stretch)
loadingOption='tension'; % or 'compression'
switch loadingOption
    case 'compression'
        stretchLoad=1-appliedStrain; %The applied stretch for uniaxial loading
    case 'tension'
        stretchLoad=1+appliedStrain; %The applied stretch for uniaxial loading
end
displacementMagnitude=(stretchLoad*sampleHeight)-sampleHeight; %The displacement magnitude

%Material parameter sets
testOpt=2; %1=Linear gradient of material, or 2=gyroid based material distribution
E_youngs_min=1e-3; %Lowest Youngs modulus
E_youngs_max=1; %Highest Youngs modulus
nu_min=0.3; %Lowest Poissons ratio
nu_max=0.45; %Lowest Poissons ratio

% FEA control settings
numTimeSteps=10; %Number of time steps desired
max_refs=25; %Max reforms
max_ups=0; %Set to zero to use full-Newton iterations
opt_iter=6; %Optimum number of iterations
max_retries=5; %Maximum number of retires
dtmin=(1/numTimeSteps)/100; %Minimum time step size
dtmax=1/numTimeSteps; %Maximum time step size
runMode='internal';

Creating model geometry and mesh

A box is created with tri-linear hexahedral (hex8) elements using the hexMeshBox function. The function offers the boundary faces with seperate labels for the top, bottom, left, right, front, and back sides. As such these can be used to define boundary conditions on the exterior.

% Create a box with hexahedral elements
cubeDimensions=[sampleWidth sampleThickness sampleHeight]; %Dimensions
cubeElementNumbers=[numElementsWidth numElementsThickness numElementsHeight]; %Number of elements
outputStructType=2; %A structure compatible with mesh view
[meshStruct]=hexMeshBox(cubeDimensions,cubeElementNumbers,outputStructType);

%Access elements, nodes, and faces from the structure
E=meshStruct.elements; %The elements
V=meshStruct.nodes; %The nodes (vertices)
Fb=meshStruct.facesBoundary; %The boundary faces
Cb=meshStruct.boundaryMarker; %The "colors" or labels for the boundary faces

Define spatially varying material distribution data

Here the element centre coordinates are used assign the material stiffness based on a particular function on these coordinates.

VE=patchCentre(E,V); %Element centres
switch testOpt
    case 1 %linear gradient in X direction
        S=VE(:,1);
    case 2 %gyroid
        %Scale coordinates for gyroid
        VE=VE-min(VE(:));
        VE=VE./max(VE(:));
        VE=(VE.*2*pi)-pi;

        %Evaluate gyroid
        S=triplyPeriodicMinimal(VE(:,1),VE(:,2),VE(:,3),'g');
end

%Normalize data
S=S-min(S(:)); %Subtract minimum -> range [0-...]
S=S./max(S(:)); %Devide by max -> range [0-1]

%Use scaling data S to generate element Youngs moduli
E_youngs_elem=S.*(E_youngs_max-E_youngs_min)+E_youngs_min;
nu_elem=S.*(nu_max-nu_min)+nu_min;

%Fix mesh struct for plotting
meshStruct.elements=E;
meshStruct.elementData=E_youngs_elem;

Plotting model boundary surfaces and a cut view

hFig=cFigure;

subplot(1,2,1); hold on;
title('Model boundary surfaces and labels','FontSize',fontSize);
gpatch(Fb,V,Cb,'k',faceAlpha1);
colormap(gca,gjet(6)); icolorbar;
axisGeom(gca,fontSize);

hs=subplot(1,2,2); hold on;
title('Cut view of solid mesh and materials','FontSize',fontSize);
optionStruct.hFig=[hFig hs];
meshView(meshStruct,optionStruct);
colormap(gca,cMap); colorbar; caxis([E_youngs_min E_youngs_max]);
axisGeom(gca,fontSize);

drawnow;

Defining the boundary conditions

The visualization of the model boundary shows colors for each side of the cube. These labels can be used to define boundary conditions.

%Define supported node sets
bcSupportList=unique(Fb(Cb==5,:)); %Node set part of selected face

%Prescribed displacement nodes
bcPrescribeList=unique(Fb(Cb==6,:)); %Node set part of selected face

Visualizing boundary conditions. Markers plotted on the semi-transparent model denote the nodes in the various boundary condition lists.

hf=cFigure;
title('Boundary conditions','FontSize',fontSize);
xlabel('X','FontSize',fontSize); ylabel('Y','FontSize',fontSize); zlabel('Z','FontSize',fontSize);
hold on;

gpatch(Fb,V,'kw','k',0.5);

hl(1)=plotV(V(bcSupportList,:),'k.','MarkerSize',markerSize);
hl(2)=plotV(V(bcPrescribeList,:),'r.','MarkerSize',markerSize);

legend(hl,{'BC full support','BC z prescribe'});

axisGeom(gca,fontSize);
camlight headlight;
drawnow;

Defining the FEBio input structure

See also febioStructTemplate and febioStruct2xml and the FEBio user manual.

%Get a template with default settings
[febio_spec]=febioStructTemplate;

%febio_spec version
febio_spec.ATTR.version='3.0';

%Module section
febio_spec.Module.ATTR.type='solid';

%Control section
febio_spec.Control.analysis='STATIC';
febio_spec.Control.time_steps=numTimeSteps;
febio_spec.Control.step_size=1/numTimeSteps;
febio_spec.Control.solver.max_refs=max_refs;
febio_spec.Control.solver.max_ups=max_ups;
febio_spec.Control.time_stepper.dtmin=dtmin;
febio_spec.Control.time_stepper.dtmax=dtmax;
febio_spec.Control.time_stepper.max_retries=max_retries;
febio_spec.Control.time_stepper.opt_iter=opt_iter;

%Material section
materialName1='Material1';
dataMapName1='MaterialParameterMap1';
dataMapName2='MaterialParameterMap2';
febio_spec.Material.material{1}.ATTR.name=materialName1;
febio_spec.Material.material{1}.ATTR.type='neo-Hookean';
febio_spec.Material.material{1}.ATTR.id=1;
febio_spec.Material.material{1}.E.ATTR.type='map'; %Calls for mapping of parameter
febio_spec.Material.material{1}.E.VAL=dataMapName1; %Calls for mapping of parameter
febio_spec.Material.material{1}.v.ATTR.type='map'; %Calls for mapping of parameter
febio_spec.Material.material{1}.v.VAL=dataMapName2; %Calls for mapping of parameter

% Mesh section
% -> Nodes
febio_spec.Mesh.Nodes{1}.ATTR.name='Object1'; %The node set name
febio_spec.Mesh.Nodes{1}.node.ATTR.id=(1:size(V,1))'; %The node id's
febio_spec.Mesh.Nodes{1}.node.VAL=V; %The nodel coordinates

% -> Elements
partName1='Part1';
febio_spec.Mesh.Elements{1}.ATTR.name=partName1; %Name of this part
febio_spec.Mesh.Elements{1}.ATTR.type='hex8'; %Element type
febio_spec.Mesh.Elements{1}.elem.ATTR.id=(1:1:size(E,1))'; %Element id's
febio_spec.Mesh.Elements{1}.elem.VAL=E; %The element matrix

% -> NodeSets
nodeSetName1='bcSupportList';
nodeSetName2='bcPrescribeList';

febio_spec.Mesh.NodeSet{1}.ATTR.name=nodeSetName1;
febio_spec.Mesh.NodeSet{1}.node.ATTR.id=bcSupportList(:);

febio_spec.Mesh.NodeSet{2}.ATTR.name=nodeSetName2;
febio_spec.Mesh.NodeSet{2}.node.ATTR.id=bcPrescribeList(:);

%MeshData secion
%-> Element data
febio_spec.MeshData.ElementData{1}.ATTR.name=dataMapName1;
febio_spec.MeshData.ElementData{1}.ATTR.elem_set=partName1;
febio_spec.MeshData.ElementData{1}.elem.ATTR.lid=(1:1:size(E,1))';
febio_spec.MeshData.ElementData{1}.elem.VAL=E_youngs_elem;

febio_spec.MeshData.ElementData{2}.ATTR.name=dataMapName2;
febio_spec.MeshData.ElementData{2}.ATTR.elem_set=partName1;
febio_spec.MeshData.ElementData{2}.elem.ATTR.lid=(1:1:size(E,1))';
febio_spec.MeshData.ElementData{2}.elem.VAL=nu_elem;

%MeshDomains section
febio_spec.MeshDomains.SolidDomain.ATTR.name=partName1;
febio_spec.MeshDomains.SolidDomain.ATTR.mat=materialName1;

%Boundary condition section
% -> Fix boundary conditions
febio_spec.Boundary.bc{1}.ATTR.type='fix';
febio_spec.Boundary.bc{1}.ATTR.node_set=nodeSetName1;
febio_spec.Boundary.bc{1}.dofs='x,y,z';

febio_spec.Boundary.bc{2}.ATTR.type='fix';
febio_spec.Boundary.bc{2}.ATTR.node_set=nodeSetName2;
febio_spec.Boundary.bc{2}.dofs='x,y';

febio_spec.Boundary.bc{3}.ATTR.type='prescribe';
febio_spec.Boundary.bc{3}.ATTR.node_set=nodeSetName2;
febio_spec.Boundary.bc{3}.dof='z';
febio_spec.Boundary.bc{3}.scale.ATTR.lc=1;
febio_spec.Boundary.bc{3}.scale.VAL=displacementMagnitude;
febio_spec.Boundary.bc{3}.relative=0;

%LoadData section
% -> load_controller
febio_spec.LoadData.load_controller{1}.ATTR.id=1;
febio_spec.LoadData.load_controller{1}.ATTR.type='loadcurve';
febio_spec.LoadData.load_controller{1}.interpolate='LINEAR';
febio_spec.LoadData.load_controller{1}.points.point.VAL=[0 0; 1 1];

%Output section
% -> log file
febio_spec.Output.logfile.ATTR.file=febioLogFileName;
febio_spec.Output.logfile.node_data{1}.ATTR.file=febioLogFileName_disp;
febio_spec.Output.logfile.node_data{1}.ATTR.data='ux;uy;uz';
febio_spec.Output.logfile.node_data{1}.ATTR.delim=',';
febio_spec.Output.logfile.node_data{1}.VAL=1:size(V,1);

febio_spec.Output.logfile.element_data{1}.ATTR.file=febioLogFileName_sed;
febio_spec.Output.logfile.element_data{1}.ATTR.data='sed';
febio_spec.Output.logfile.element_data{1}.ATTR.delim=',';
febio_spec.Output.logfile.element_data{1}.VAL=1:size(E,1);

Quick viewing of the FEBio input file structure

The febView function can be used to view the xml structure in a MATLAB figure window.

febView(febio_spec); %Viewing the febio file

Exporting the FEBio input file

Exporting the febio_spec structure to an FEBio input file is done using the febioStruct2xml function.

febioStruct2xml(febio_spec,febioFebFileName); %Exporting to file and domNode
% febView(febioFebFileName);

Running the FEBio analysis

To run the analysis defined by the created FEBio input file the runMonitorFEBio function is used. The input for this function is a structure defining job settings e.g. the FEBio input file name. The optional output runFlag informs the user if the analysis was run succesfully.

febioAnalysis.run_filename=febioFebFileName; %The input file name
febioAnalysis.run_logname=febioLogFileName; %The name for the log file
febioAnalysis.disp_on=1; %Display information on the command window
febioAnalysis.runMode=runMode;

[runFlag]=runMonitorFEBio(febioAnalysis);%START FEBio NOW!!!!!!!!
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-------->    RUNNING/MONITORING FEBIO JOB    <-------- 25-Feb-2022 14:48:43
FEBio path: /home/kevin/FEBioStudio/bin/febio3
# Attempt removal of existing log files                25-Feb-2022 14:48:43
 * Removal succesful                                   25-Feb-2022 14:48:43
# Attempt removal of existing .xplt files              25-Feb-2022 14:48:43
 * Removal succesful                                   25-Feb-2022 14:48:43
# Starting FEBio...                                    25-Feb-2022 14:48:43
  Max. total analysis time is: Inf s
===========================================================================
         ________    _________   _______       __     _________            
        |        |\ |        |\ |       \\    |  |\  /         \\          
        |    ____|| |    ____|| |    __  ||   |__|| |    ___    ||         
        |   |\___\| |   |\___\| |   |\_| ||    \_\| |   //  \   ||         
        |   ||__    |   ||__    |   ||_| ||   |  |\ |  ||    |  ||         
        |       |\  |       |\  |         \\  |  || |  ||    |  ||         
        |    ___||  |    ___||  |    ___   || |  || |  ||    |  ||         
        |   |\__\|  |   |\__\|  |   |\__|  || |  || |  ||    |  ||         
        |   ||      |   ||___   |   ||__|  || |  || |   \\__/   ||         
        |   ||      |        |\ |          || |  || |           ||         
        |___||      |________|| |_________//  |__||  \_________//          
                                                                           
      F I N I T E   E L E M E N T S   F O R   B I O M E C H A N I C S      
                                                                           
  version 3.5.1.30d08b23f
  FEBio is a registered trademark.                                         
  copyright (c) 2006-2021 - All rights reserved                            
                                                                           
===========================================================================

Default linear solver: pardiso
Success loading plugin libFEBioChem.so (version 1.0.0)
Success loading plugin libFEBioHeat.so (version 1.0.0)
Reading file /mnt/data/MATLAB/GIBBON/data/temp/tempModel.feb ...SUCCESS!

Setting parameter "scale" to : 0

 ]0;(0%) tempModel.feb - FEBio 3.5.1.30d08b23f  
===== beginning time step 1 : 0.1 =====

Setting parameter "scale" to : 0.1

Reforming stiffness matrix: reformation #1

===== reforming stiffness matrix:
	Nr of equations ........................... : 3388
	Nr of nonzeroes in stiffness matrix ....... : 113170
 1
 Nonlinear solution status: time= 0.1
	stiffness updates             = 0
	right hand side evaluations   = 2
	stiffness matrix reformations = 1
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.835210e+01    8.666006e-05    0.000000e+00 
	   energy              1.003119e+01    3.514740e-04    1.003119e-01 
	   displacement        3.386875e+01    3.386875e+01    3.386875e-05 
Reforming stiffness matrix: reformation #2

 2
 Nonlinear solution status: time= 0.1
	stiffness updates             = 0
	right hand side evaluations   = 3
	stiffness matrix reformations = 2
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.835210e+01    5.662439e-11    0.000000e+00 
	   energy              1.003119e+01    1.595470e-08    1.003119e-01 
	   displacement        3.386875e+01    1.588234e-03    3.376788e-05 
Reforming stiffness matrix: reformation #3

 3
 Nonlinear solution status: time= 0.1
	stiffness updates             = 0
	right hand side evaluations   = 4
	stiffness matrix reformations = 3
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.835210e+01    2.188490e-22    0.000000e+00 
	   energy              1.003119e+01    4.702909e-17    1.003119e-01 
	   displacement        3.386875e+01    1.097925e-09    3.376787e-05 

convergence summary
    number of iterations   : 3
    number of reformations : 3

------- converged at time : 0.1


Data Record #1
===========================================================================
Step = 1
Time = 0.1
Data = ux;uy;uz
File = /mnt/data/MATLAB/GIBBON/data/temp/tempModel_disp_out.txt

Data Record #2
===========================================================================
Step = 1
Time = 0.1
Data = sed
File = /mnt/data/MATLAB/GIBBON/data/temp/tempModel_sed_out.txt
 ]0;(10%) tempModel.feb - FEBio 3.5.1.30d08b23f  
===== beginning time step 2 : 0.2 =====

Setting parameter "scale" to : 0.2

Reforming stiffness matrix: reformation #1

 1
 Nonlinear solution status: time= 0.2
	stiffness updates             = 0
	right hand side evaluations   = 2
	stiffness matrix reformations = 1
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.734886e+01    8.356953e-05    0.000000e+00 
	   energy              9.720994e+00    7.854346e-05    9.720994e-02 
	   displacement        3.367132e+01    3.367132e+01    3.367132e-05 
Reforming stiffness matrix: reformation #2

 2
 Nonlinear solution status: time= 0.2
	stiffness updates             = 0
	right hand side evaluations   = 3
	stiffness matrix reformations = 2
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.734886e+01    3.588849e-11    0.000000e+00 
	   energy              9.720994e+00    8.568601e-09    9.720994e-02 
	   displacement        3.367132e+01    1.321307e-03    3.357985e-05 
Reforming stiffness matrix: reformation #3

 3
 Nonlinear solution status: time= 0.2
	stiffness updates             = 0
	right hand side evaluations   = 4
	stiffness matrix reformations = 3
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.734886e+01    1.617402e-22    0.000000e+00 
	   energy              9.720994e+00    2.849135e-17    9.720994e-02 
	   displacement        3.367132e+01    8.117979e-10    3.357984e-05 

convergence summary
    number of iterations   : 3
    number of reformations : 3

------- converged at time : 0.2


Data Record #1
===========================================================================
Step = 2
Time = 0.2
Data = ux;uy;uz
File = /mnt/data/MATLAB/GIBBON/data/temp/tempModel_disp_out.txt

Data Record #2
===========================================================================
Step = 2
Time = 0.2
Data = sed
File = /mnt/data/MATLAB/GIBBON/data/temp/tempModel_sed_out.txt
 ]0;(20%) tempModel.feb - FEBio 3.5.1.30d08b23f  
===== beginning time step 3 : 0.3 =====

Setting parameter "scale" to : 0.3

Reforming stiffness matrix: reformation #1

 1
 Nonlinear solution status: time= 0.3
	stiffness updates             = 0
	right hand side evaluations   = 2
	stiffness matrix reformations = 1
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.643425e+01    8.098857e-05    0.000000e+00 
	   energy              9.431651e+00    1.610111e-04    9.431651e-02 
	   displacement        3.349195e+01    3.349195e+01    3.349195e-05 
Reforming stiffness matrix: reformation #2

 2
 Nonlinear solution status: time= 0.3
	stiffness updates             = 0
	right hand side evaluations   = 3
	stiffness matrix reformations = 2
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.643425e+01    2.337284e-11    0.000000e+00 
	   energy              9.431651e+00    4.714276e-09    9.431651e-02 
	   displacement        3.349195e+01    1.105580e-03    3.340830e-05 
Reforming stiffness matrix: reformation #3

 3
 Nonlinear solution status: time= 0.3
	stiffness updates             = 0
	right hand side evaluations   = 4
	stiffness matrix reformations = 3
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.643425e+01    1.126869e-22    0.000000e+00 
	   energy              9.431651e+00    1.617869e-17    9.431651e-02 
	   displacement        3.349195e+01    6.117233e-10    3.340829e-05 

convergence summary
    number of iterations   : 3
    number of reformations : 3

------- converged at time : 0.3


Data Record #1
===========================================================================
Step = 3
Time = 0.3
Data = ux;uy;uz
File = /mnt/data/MATLAB/GIBBON/data/temp/tempModel_disp_out.txt

Data Record #2
===========================================================================
Step = 3
Time = 0.3
Data = sed
File = /mnt/data/MATLAB/GIBBON/data/temp/tempModel_sed_out.txt
 ]0;(30%) tempModel.feb - FEBio 3.5.1.30d08b23f  
===== beginning time step 4 : 0.4 =====

Setting parameter "scale" to : 0.4

Reforming stiffness matrix: reformation #1

 1
 Nonlinear solution status: time= 0.4
	stiffness updates             = 0
	right hand side evaluations   = 2
	stiffness matrix reformations = 1
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.559729e+01    7.862103e-05    0.000000e+00 
	   energy              9.160972e+00    3.680721e-04    9.160972e-02 
	   displacement        3.332765e+01    3.332765e+01    3.332765e-05 
Reforming stiffness matrix: reformation #2

 2
 Nonlinear solution status: time= 0.4
	stiffness updates             = 0
	right hand side evaluations   = 3
	stiffness matrix reformations = 2
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.559729e+01    1.574191e-11    0.000000e+00 
	   energy              9.160972e+00    2.846469e-09    9.160972e-02 
	   displacement        3.332765e+01    9.306424e-04    3.325058e-05 
Reforming stiffness matrix: reformation #3

 3
 Nonlinear solution status: time= 0.4
	stiffness updates             = 0
	right hand side evaluations   = 4
	stiffness matrix reformations = 3
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.559729e+01    7.503403e-23    0.000000e+00 
	   energy              9.160972e+00    8.486597e-18    9.160972e-02 
	   displacement        3.332765e+01    4.667838e-10    3.325058e-05 

convergence summary
    number of iterations   : 3
    number of reformations : 3

------- converged at time : 0.4


Data Record #1
===========================================================================
Step = 4
Time = 0.4
Data = ux;uy;uz
File = /mnt/data/MATLAB/GIBBON/data/temp/tempModel_disp_out.txt

Data Record #2
===========================================================================
Step = 4
Time = 0.4
Data = sed
File = /mnt/data/MATLAB/GIBBON/data/temp/tempModel_sed_out.txt
 ]0;(40%) tempModel.feb - FEBio 3.5.1.30d08b23f  
===== beginning time step 5 : 0.5 =====

Setting parameter "scale" to : 0.5

Reforming stiffness matrix: reformation #1

 1
 Nonlinear solution status: time= 0.5
	stiffness updates             = 0
	right hand side evaluations   = 2
	stiffness matrix reformations = 1
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.482867e+01    7.631106e-05    0.000000e+00 
	   energy              8.907055e+00    5.447852e-04    8.907055e-02 
	   displacement        3.317606e+01    3.317606e+01    3.317606e-05 
Reforming stiffness matrix: reformation #2

 2
 Nonlinear solution status: time= 0.5
	stiffness updates             = 0
	right hand side evaluations   = 3
	stiffness matrix reformations = 2
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.482867e+01    1.103378e-11    0.000000e+00 
	   energy              8.907055e+00    2.054398e-09    8.907055e-02 
	   displacement        3.317606e+01    7.882282e-04    3.310463e-05 
Reforming stiffness matrix: reformation #3

 3
 Nonlinear solution status: time= 0.5
	stiffness updates             = 0
	right hand side evaluations   = 4
	stiffness matrix reformations = 3
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.482867e+01    4.850162e-23    0.000000e+00 
	   energy              8.907055e+00    3.963262e-18    8.907055e-02 
	   displacement        3.317606e+01    3.592743e-10    3.310462e-05 

convergence summary
    number of iterations   : 3
    number of reformations : 3

------- converged at time : 0.5


Data Record #1
===========================================================================
Step = 5
Time = 0.5
Data = ux;uy;uz
File = /mnt/data/MATLAB/GIBBON/data/temp/tempModel_disp_out.txt

Data Record #2
===========================================================================
Step = 5
Time = 0.5
Data = sed
File = /mnt/data/MATLAB/GIBBON/data/temp/tempModel_sed_out.txt
 ]0;(50%) tempModel.feb - FEBio 3.5.1.30d08b23f  
===== beginning time step 6 : 0.6 =====

Setting parameter "scale" to : 0.6

Reforming stiffness matrix: reformation #1

 1
 Nonlinear solution status: time= 0.6
	stiffness updates             = 0
	right hand side evaluations   = 2
	stiffness matrix reformations = 1
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.412046e+01    7.398488e-05    0.000000e+00 
	   energy              8.668236e+00    6.939588e-04    8.668236e-02 
	   displacement        3.303538e+01    3.303538e+01    3.303538e-05 
Reforming stiffness matrix: reformation #2

 2
 Nonlinear solution status: time= 0.6
	stiffness updates             = 0
	right hand side evaluations   = 3
	stiffness matrix reformations = 2
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.412046e+01    8.087110e-12    0.000000e+00 
	   energy              8.668236e+00    1.814656e-09    8.668236e-02 
	   displacement        3.303538e+01    6.717673e-04    3.296883e-05 
Reforming stiffness matrix: reformation #3

 3
 Nonlinear solution status: time= 0.6
	stiffness updates             = 0
	right hand side evaluations   = 4
	stiffness matrix reformations = 3
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.412046e+01    3.064496e-23    0.000000e+00 
	   energy              8.668236e+00    1.456637e-18    8.668236e-02 
	   displacement        3.303538e+01    2.783260e-10    3.296883e-05 

convergence summary
    number of iterations   : 3
    number of reformations : 3

------- converged at time : 0.6


Data Record #1
===========================================================================
Step = 6
Time = 0.6
Data = ux;uy;uz
File = /mnt/data/MATLAB/GIBBON/data/temp/tempModel_disp_out.txt

Data Record #2
===========================================================================
Step = 6
Time = 0.6
Data = sed
File = /mnt/data/MATLAB/GIBBON/data/temp/tempModel_sed_out.txt
 ]0;(60%) tempModel.feb - FEBio 3.5.1.30d08b23f  
===== beginning time step 7 : 0.7 =====

Setting parameter "scale" to : 0.7

Reforming stiffness matrix: reformation #1

 1
 Nonlinear solution status: time= 0.7
	stiffness updates             = 0
	right hand side evaluations   = 2
	stiffness matrix reformations = 1
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.346588e+01    7.161556e-05    0.000000e+00 
	   energy              8.443063e+00    8.186519e-04    8.443063e-02 
	   displacement        3.290419e+01    3.290419e+01    3.290419e-05 
Reforming stiffness matrix: reformation #2

 2
 Nonlinear solution status: time= 0.7
	stiffness updates             = 0
	right hand side evaluations   = 3
	stiffness matrix reformations = 2
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.346588e+01    6.209447e-12    0.000000e+00 
	   energy              8.443063e+00    1.834112e-09    8.443063e-02 
	   displacement        3.290419e+01    5.760495e-04    3.284193e-05 
Reforming stiffness matrix: reformation #3

 3
 Nonlinear solution status: time= 0.7
	stiffness updates             = 0
	right hand side evaluations   = 4
	stiffness matrix reformations = 3
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.346588e+01    1.917807e-23    0.000000e+00 
	   energy              8.443063e+00    1.677445e-19    8.443063e-02 
	   displacement        3.290419e+01    2.167916e-10    3.284193e-05 

convergence summary
    number of iterations   : 3
    number of reformations : 3

------- converged at time : 0.7


Data Record #1
===========================================================================
Step = 7
Time = 0.7
Data = ux;uy;uz
File = /mnt/data/MATLAB/GIBBON/data/temp/tempModel_disp_out.txt

Data Record #2
===========================================================================
Step = 7
Time = 0.7
Data = sed
File = /mnt/data/MATLAB/GIBBON/data/temp/tempModel_sed_out.txt
 ]0;(70%) tempModel.feb - FEBio 3.5.1.30d08b23f  
===== beginning time step 8 : 0.8 =====

Setting parameter "scale" to : 0.8

Reforming stiffness matrix: reformation #1

 1
 Nonlinear solution status: time= 0.8
	stiffness updates             = 0
	right hand side evaluations   = 2
	stiffness matrix reformations = 1
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.285913e+01    6.920199e-05    0.000000e+00 
	   energy              8.230258e+00    9.219111e-04    8.230258e-02 
	   displacement        3.278135e+01    3.278135e+01    3.278135e-05 
Reforming stiffness matrix: reformation #2

 2
 Nonlinear solution status: time= 0.8
	stiffness updates             = 0
	right hand side evaluations   = 3
	stiffness matrix reformations = 2
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.285913e+01    4.984763e-12    0.000000e+00 
	   energy              8.230258e+00    1.953753e-09    8.230258e-02 
	   displacement        3.278135e+01    4.969529e-04    3.272292e-05 
Reforming stiffness matrix: reformation #3

 3
 Nonlinear solution status: time= 0.8
	stiffness updates             = 0
	right hand side evaluations   = 4
	stiffness matrix reformations = 3
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.285913e+01    1.188572e-23    0.000000e+00 
	   energy              8.230258e+00    4.259635e-19    8.230258e-02 
	   displacement        3.278135e+01    1.697060e-10    3.272292e-05 

convergence summary
    number of iterations   : 3
    number of reformations : 3

------- converged at time : 0.8


Data Record #1
===========================================================================
Step = 8
Time = 0.8
Data = ux;uy;uz
File = /mnt/data/MATLAB/GIBBON/data/temp/tempModel_disp_out.txt

Data Record #2
===========================================================================
Step = 8
Time = 0.8
Data = sed
File = /mnt/data/MATLAB/GIBBON/data/temp/tempModel_sed_out.txt
 ]0;(80%) tempModel.feb - FEBio 3.5.1.30d08b23f  
===== beginning time step 9 : 0.9 =====

Setting parameter "scale" to : 0.9

Reforming stiffness matrix: reformation #1

 1
 Nonlinear solution status: time= 0.9
	stiffness updates             = 0
	right hand side evaluations   = 2
	stiffness matrix reformations = 1
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.229519e+01    6.675622e-05    0.000000e+00 
	   energy              8.028701e+00    1.006614e-03    8.028701e-02 
	   displacement        3.266598e+01    3.266598e+01    3.266598e-05 
Reforming stiffness matrix: reformation #2

 2
 Nonlinear solution status: time= 0.9
	stiffness updates             = 0
	right hand side evaluations   = 3
	stiffness matrix reformations = 2
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.229519e+01    4.161278e-12    0.000000e+00 
	   energy              8.028701e+00    2.091331e-09    8.028701e-02 
	   displacement        3.266598e+01    4.312206e-04    3.261099e-05 
Reforming stiffness matrix: reformation #3

 3
 Nonlinear solution status: time= 0.9
	stiffness updates             = 0
	right hand side evaluations   = 4
	stiffness matrix reformations = 3
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.229519e+01    7.399737e-24    0.000000e+00 
	   energy              8.028701e+00    6.439673e-19    8.028701e-02 
	   displacement        3.266598e+01    1.334907e-10    3.261099e-05 

convergence summary
    number of iterations   : 3
    number of reformations : 3

------- converged at time : 0.9


Data Record #1
===========================================================================
Step = 9
Time = 0.9
Data = ux;uy;uz
File = /mnt/data/MATLAB/GIBBON/data/temp/tempModel_disp_out.txt

Data Record #2
===========================================================================
Step = 9
Time = 0.9
Data = sed
File = /mnt/data/MATLAB/GIBBON/data/temp/tempModel_sed_out.txt
 ]0;(90%) tempModel.feb - FEBio 3.5.1.30d08b23f  
===== beginning time step 10 : 1 =====

Setting parameter "scale" to : 1

Reforming stiffness matrix: reformation #1

 1
 Nonlinear solution status: time= 1
	stiffness updates             = 0
	right hand side evaluations   = 2
	stiffness matrix reformations = 1
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.176975e+01    6.429604e-05    0.000000e+00 
	   energy              7.837404e+00    1.075387e-03    7.837404e-02 
	   displacement        3.255735e+01    3.255735e+01    3.255735e-05 
Reforming stiffness matrix: reformation #2

 2
 Nonlinear solution status: time= 1
	stiffness updates             = 0
	right hand side evaluations   = 3
	stiffness matrix reformations = 2
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.176975e+01    3.585653e-12    0.000000e+00 
	   energy              7.837404e+00    2.207712e-09    7.837404e-02 
	   displacement        3.255735e+01    3.762789e-04    3.250550e-05 
Reforming stiffness matrix: reformation #3

 3
 Nonlinear solution status: time= 1
	stiffness updates             = 0
	right hand side evaluations   = 4
	stiffness matrix reformations = 3
	step from line search         = 1.000000
	convergence norms :     INITIAL         CURRENT         REQUIRED
	   residual            1.176975e+01    4.588535e-24    0.000000e+00 
	   energy              7.837404e+00    6.699486e-19    7.837404e-02 
	   displacement        3.255735e+01    1.055087e-10    3.250549e-05 

convergence summary
    number of iterations   : 3
    number of reformations : 3

------- converged at time : 1


Data Record #1
===========================================================================
Step = 10
Time = 1
Data = ux;uy;uz
File = /mnt/data/MATLAB/GIBBON/data/temp/tempModel_disp_out.txt

Data Record #2
===========================================================================
Step = 10
Time = 1
Data = sed
File = /mnt/data/MATLAB/GIBBON/data/temp/tempModel_sed_out.txt
 ]0;(100%) tempModel.feb - FEBio 3.5.1.30d08b23f  

 N O N L I N E A R   I T E R A T I O N   I N F O R M A T I O N

	Number of time steps completed .................... : 10

	Total number of equilibrium iterations ............ : 30

	Average number of equilibrium iterations .......... : 3

	Total number of right hand evaluations ............ : 40

	Total number of stiffness reformations ............ : 30


 L I N E A R   S O L V E R   S T A T S

	Total calls to linear solver ........ : 30

	Avg iterations per solve ............ : 1

	Time in linear solver: 0:00:01


 Elapsed time : 0:00:02


 N O R M A L   T E R M I N A T I O N

 ]0;(0%) tempModel.feb - FEBio 3.5.1.30d08b23f   * Log file found.                                     25-Feb-2022 14:48:45
# Parsing log file...                                  25-Feb-2022 14:48:45
    number of iterations   : 3                         25-Feb-2022 14:48:45
    number of reformations : 3                         25-Feb-2022 14:48:45
------- converged at time : 0.1                        25-Feb-2022 14:48:45
    number of iterations   : 3                         25-Feb-2022 14:48:45
    number of reformations : 3                         25-Feb-2022 14:48:45
------- converged at time : 0.2                        25-Feb-2022 14:48:45
    number of iterations   : 3                         25-Feb-2022 14:48:45
    number of reformations : 3                         25-Feb-2022 14:48:45
------- converged at time : 0.3                        25-Feb-2022 14:48:45
    number of iterations   : 3                         25-Feb-2022 14:48:45
    number of reformations : 3                         25-Feb-2022 14:48:45
------- converged at time : 0.4                        25-Feb-2022 14:48:45
    number of iterations   : 3                         25-Feb-2022 14:48:45
    number of reformations : 3                         25-Feb-2022 14:48:45
------- converged at time : 0.5                        25-Feb-2022 14:48:45
    number of iterations   : 3                         25-Feb-2022 14:48:45
    number of reformations : 3                         25-Feb-2022 14:48:45
------- converged at time : 0.6                        25-Feb-2022 14:48:45
    number of iterations   : 3                         25-Feb-2022 14:48:45
    number of reformations : 3                         25-Feb-2022 14:48:45
------- converged at time : 0.7                        25-Feb-2022 14:48:45
    number of iterations   : 3                         25-Feb-2022 14:48:45
    number of reformations : 3                         25-Feb-2022 14:48:45
------- converged at time : 0.8                        25-Feb-2022 14:48:45
    number of iterations   : 3                         25-Feb-2022 14:48:45
    number of reformations : 3                         25-Feb-2022 14:48:45
------- converged at time : 0.9                        25-Feb-2022 14:48:45
    number of iterations   : 3                         25-Feb-2022 14:48:45
    number of reformations : 3                         25-Feb-2022 14:48:45
------- converged at time : 1                          25-Feb-2022 14:48:45
 Elapsed time : 0:00:02                                25-Feb-2022 14:48:45
 N O R M A L   T E R M I N A T I O N
# Done                                                 25-Feb-2022 14:48:45
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Import FEBio results

if runFlag==1 %i.e. a succesful run

Importing nodal displacements from a log file

    dataStruct=importFEBio_logfile(fullfile(savePath,febioLogFileName_disp),1,1);

    %Access data
    N_disp_mat=dataStruct.data; %Displacement
    timeVec=dataStruct.time; %Time

    %Create deformed coordinate set
    V_DEF=N_disp_mat+repmat(V,[1 1 size(N_disp_mat,3)]);

Importing element stress from a log file

    dataStruct=importFEBio_logfile(fullfile(savePath,febioLogFileName_sed),1,1);

    %Access data
    E_sed_mat=dataStruct.data;

Plotting the simulated results using anim8 to visualize and animate deformations

    [CV]=faceToVertexMeasure(E,V,E_sed_mat(:,:,end));

    % Create basic view and store graphics handle to initiate animation
    hf=cFigure; %Open figure
    gtitle([febioFebFileNamePart,': Press play to animate']);
    title('$\Psi$ $[J/m^3]$','Interpreter','Latex')

    hp=gpatch(Fb,V_DEF(:,:,end),CV,'k',1); %Add graphics object to animate
    hp.FaceColor='interp';

    axisGeom(gca,fontSize);
    colormap(cMap); colorbar;
    caxis([min(E_sed_mat(:)) max(E_sed_mat(:))]/3);
    axis(axisLim(V_DEF)); %Set axis limits statically
    camlight headlight;

    % Set up animation features
    animStruct.Time=timeVec; %The time vector
    for qt=1:1:size(N_disp_mat,3) %Loop over time increments

        [CV]=faceToVertexMeasure(E,V,E_sed_mat(:,:,qt));

        %Set entries in animation structure
        animStruct.Handles{qt}=[hp hp]; %Handles of objects to animate
        animStruct.Props{qt}={'Vertices','CData'}; %Properties of objects to animate
        animStruct.Set{qt}={V_DEF(:,:,qt),CV}; %Property values for to set in order to animate
    end
    anim8(hf,animStruct); %Initiate animation feature
    drawnow;
end

GIBBON www.gibboncode.org

Kevin Mattheus Moerman, [email protected]

GIBBON footer text

License: https://github.com/gibbonCode/GIBBON/blob/master/LICENSE

GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for image segmentation, image-based modeling, meshing, and finite element analysis.

Copyright (C) 2006-2022 Kevin Mattheus Moerman and the GIBBON contributors

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.