addMatAxisFibreElementData_FEB

Below is a demonstration of the features of the addMatAxisFibreElementData_FEB function

Contents

clear; close all; clc;

Syntax

[domNode]=addMatAxisFibreElementData_FEB(domNode,FEB_struct);

Description

This function adds the local element matetrial axis or fiber direction information to the input XML data (domNode) based on the input febio structure (FEB_struct).

Examples

Example: Defining the local material axis for each element

n=5; %number of elements
E=round(20*rand(n,8)); %Simulates element matrix
V_fib=zeros(n,3); %Simulated fibre directions
V_fib(:,3)=1;

%Adding fibre direction, construct local orthonormal basis vectors
[a,d]=vectorOrthogonalPair(V_fib);

VF_E=zeros(size(V_fib,1),size(V_fib,2),2);
VF_E(:,:,1)=a; %a1 ~ e1 ~ X or first direction
VF_E(:,:,2)=d; %a2 ~ e2 ~ Y or second direction
%Vf_E %a3 ~ e3 ~ Z, third direction, e.g. fibre direction

FEB_struct.Geometry.Nodes=rand(25,3);
FEB_struct.Geometry.Elements={E}; %The element sets
FEB_struct.Geometry.ElementType={'hex8'}; %The element types
FEB_struct.Geometry.ElementMat={ones(size(E,1),1)};
FEB_struct.Geometry.ElementsPartName={'Block'};

FEB_struct.Geometry.ElementData.MatAxis.ElementIndices=1:1:size(V_fib,1);
FEB_struct.Geometry.ElementData.MatAxis.Basis=VF_E;

%Initialize docNode object
domNode = com.mathworks.xml.XMLUtils.createDocument('febio_spec');

%Add geometry information (NodeSet)
domNode=addGeometryLevel_FEB(domNode,FEB_struct);

%Add boundary condition information
domNode=addMatAxisFibreElementData_FEB(domNode,FEB_struct);
Adding Geometry level
----> Adding node field
----> Adding element field
----> Adding hex8 element entries....
----> Creating MatAxis entries
----> Creating MatAxis entries
View example XML string
XML_str = xmlwrite(domNode);
disp(XML_str);
<?xml version="1.0" encoding="utf-8"?>
<febio_spec>
   <Geometry>
      <Nodes>
         <node id="1">1.6899003e-01, 6.4431813e-01, 9.7974838e-01</node>
         <node id="2">6.4911547e-01, 3.7860938e-01, 4.3886997e-01</node>
         <node id="3">7.3172239e-01, 8.1158046e-01, 1.1111922e-01</node>
         <node id="4">6.4774596e-01, 5.3282559e-01, 2.5806470e-01</node>
         <node id="5">4.5092371e-01, 3.5072710e-01, 4.0871985e-01</node>
         <node id="6">5.4700889e-01, 9.3900156e-01, 5.9489607e-01</node>
         <node id="7">2.9632081e-01, 8.7594281e-01, 2.6221175e-01</node>
         <node id="8">7.4469281e-01, 5.5015634e-01, 6.0284309e-01</node>
         <node id="9">1.8895502e-01, 6.2247509e-01, 7.1121578e-01</node>
         <node id="10">6.8677543e-01, 5.8704470e-01, 2.2174673e-01</node>
         <node id="11">1.8351116e-01, 2.0774229e-01, 1.1741765e-01</node>
         <node id="12">3.6848460e-01, 3.0124633e-01, 2.9667587e-01</node>
         <node id="13">6.2561856e-01, 4.7092335e-01, 3.1877830e-01</node>
         <node id="14">7.8022744e-01, 2.3048816e-01, 4.2416676e-01</node>
         <node id="15">8.1125769e-02, 8.4430879e-01, 5.0785828e-01</node>
         <node id="16">9.2938597e-01, 1.9476429e-01, 8.5515797e-02</node>
         <node id="17">7.7571268e-01, 2.2592178e-01, 2.6248223e-01</node>
         <node id="18">4.8679163e-01, 1.7070805e-01, 8.0101462e-01</node>
         <node id="19">4.3585859e-01, 2.2766430e-01, 2.9220278e-02</node>
         <node id="20">4.4678375e-01, 4.3569868e-01, 9.2885414e-01</node>
         <node id="21">3.0634947e-01, 3.1110229e-01, 7.3033086e-01</node>
         <node id="22">5.0850866e-01, 9.2337964e-01, 4.8860897e-01</node>
         <node id="23">5.1077156e-01, 4.3020739e-01, 5.7852506e-01</node>
         <node id="24">8.1762771e-01, 1.8481632e-01, 2.3728358e-01</node>
         <node id="25">7.9483142e-01, 9.0488097e-01, 4.5884883e-01</node>
      </Nodes>
      <Elements mat="1" name="Block" type="hex8">
         <elem id="1">   3,   17,   2,   8,   10,   16,   3,   5</elem>
         <elem id="2">   17,   12,   5,   1,   7,   8,   19,   7</elem>
         <elem id="3">   12,   7,   2,   18,   18,   5,   19,   16</elem>
         <elem id="4">   11,   10,   4,   19,   7,   8,   12,   0</elem>
         <elem id="5">   3,   8,   5,   10,   2,   2,   1,   1</elem>
      </Elements>
      <ElementData>
         <element id="1">
            <mat_axis>
               <a>0.0000000e+00, 1.0000000e+00, -0.0000000e+00</a>
               <d>-1.0000000e+00, 0.0000000e+00, 0.0000000e+00</d>
            </mat_axis>
         </element>
         <element id="2">
            <mat_axis>
               <a>0.0000000e+00, 1.0000000e+00, -0.0000000e+00</a>
               <d>-1.0000000e+00, 0.0000000e+00, 0.0000000e+00</d>
            </mat_axis>
         </element>
         <element id="3">
            <mat_axis>
               <a>0.0000000e+00, 1.0000000e+00, -0.0000000e+00</a>
               <d>-1.0000000e+00, 0.0000000e+00, 0.0000000e+00</d>
            </mat_axis>
         </element>
         <element id="4">
            <mat_axis>
               <a>0.0000000e+00, 1.0000000e+00, -0.0000000e+00</a>
               <d>-1.0000000e+00, 0.0000000e+00, 0.0000000e+00</d>
            </mat_axis>
         </element>
         <element id="5">
            <mat_axis>
               <a>0.0000000e+00, 1.0000000e+00, -0.0000000e+00</a>
               <d>-1.0000000e+00, 0.0000000e+00, 0.0000000e+00</d>
            </mat_axis>
         </element>
      </ElementData>
   </Geometry>
</febio_spec>

GIBBON www.gibboncode.org

Kevin Mattheus Moerman, [email protected]