Skip to content

Commit dbe1946

Browse files
Updated FEB XML file handling, fixed minor bugs after running test and publish on all documentation
1 parent 16a3138 commit dbe1946

File tree

999 files changed

+8610
-4492
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

999 files changed

+8610
-4492
lines changed

docs/Contents.m

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,26 @@
2121

2222
dY=ifft(fft_dY,[],dimDir,'symmetric');
2323

24-
%% <-- GIBBON footer text -->
24+
%%
25+
% _*GIBBON footer text*_
2526
%
26-
% GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for
27-
% image segmentation, image-based modeling, meshing, and finite element
28-
% analysis.
27+
% License: <https://github.com/gibbonCode/GIBBON/blob/master/LICENSE>
2928
%
30-
% Copyright (C) 2017 Kevin Mattheus Moerman
29+
% GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for
30+
% image segmentation, image-based modeling, meshing, and finite element
31+
% analysis.
3132
%
32-
% This program is free software: you can redistribute it and/or modify
33-
% it under the terms of the GNU General Public License as published by
34-
% the Free Software Foundation, either version 3 of the License, or
35-
% (at your option) any later version.
33+
% Copyright (C) 2017 Kevin Mattheus Moerman
3634
%
37-
% This program is distributed in the hope that it will be useful,
38-
% but WITHOUT ANY WARRANTY; without even the implied warranty of
39-
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40-
% GNU General Public License for more details.
35+
% This program is free software: you can redistribute it and/or modify
36+
% it under the terms of the GNU General Public License as published by
37+
% the Free Software Foundation, either version 3 of the License, or
38+
% (at your option) any later version.
4139
%
42-
% You should have received a copy of the GNU General Public License
43-
% along with this program. If not, see <http://www.gnu.org/licenses/>.
40+
% This program is distributed in the hope that it will be useful,
41+
% but WITHOUT ANY WARRANTY; without even the implied warranty of
42+
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43+
% GNU General Public License for more details.
44+
%
45+
% You should have received a copy of the GNU General Public License
46+
% along with this program. If not, see <http://www.gnu.org/licenses/>.

docs/DEMO_AnyBody_force_analysys.m

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -448,23 +448,26 @@
448448
%
449449
% _Kevin Mattheus Moerman_, <gibbon.toolbox@gmail.com>
450450

451-
%% <-- GIBBON footer text -->
451+
%%
452+
% _*GIBBON footer text*_
453+
%
454+
% License: <https://github.com/gibbonCode/GIBBON/blob/master/LICENSE>
452455
%
453-
% GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for
454-
% image segmentation, image-based modeling, meshing, and finite element
455-
% analysis.
456+
% GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for
457+
% image segmentation, image-based modeling, meshing, and finite element
458+
% analysis.
456459
%
457-
% Copyright (C) 2017 Kevin Mattheus Moerman
460+
% Copyright (C) 2017 Kevin Mattheus Moerman
458461
%
459-
% This program is free software: you can redistribute it and/or modify
460-
% it under the terms of the GNU General Public License as published by
461-
% the Free Software Foundation, either version 3 of the License, or
462-
% (at your option) any later version.
462+
% This program is free software: you can redistribute it and/or modify
463+
% it under the terms of the GNU General Public License as published by
464+
% the Free Software Foundation, either version 3 of the License, or
465+
% (at your option) any later version.
463466
%
464-
% This program is distributed in the hope that it will be useful,
465-
% but WITHOUT ANY WARRANTY; without even the implied warranty of
466-
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
467-
% GNU General Public License for more details.
467+
% This program is distributed in the hope that it will be useful,
468+
% but WITHOUT ANY WARRANTY; without even the implied warranty of
469+
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
470+
% GNU General Public License for more details.
468471
%
469-
% You should have received a copy of the GNU General Public License
470-
% along with this program. If not, see <http://www.gnu.org/licenses/>.
472+
% You should have received a copy of the GNU General Public License
473+
% along with this program. If not, see <http://www.gnu.org/licenses/>.
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
%% DEMO_FEBio_XML_replacing_node_field
2+
% Below is a demonstration for:
3+
% 1) Creating basic XML data for a .feb file
4+
% 2) Replacing field in the created XML data by first removing and
5+
% recreating the field.
6+
7+
%%
8+
clear; close all; clc;
9+
10+
%% Creating a feb structure with a geometry section and nodes
11+
12+
%Geometry section
13+
FEB_struct.Geometry.Nodes=rand(8,3); %A set of 8 nodes
14+
15+
%% Using XML coding to build the FEB file
16+
17+
%Initialize docNode object
18+
domNode = com.mathworks.xml.XMLUtils.createDocument('febio_spec');
19+
20+
%Add geometry level to XML file
21+
domNode=addGeometryLevel_FEB(domNode,FEB_struct);
22+
23+
%View the XML data
24+
% xmlView(domNode);
25+
XML_str = gxmlwrite(domNode);
26+
disp(XML_str);
27+
28+
%% Replacing the node field
29+
% Remove the old node field
30+
geometryNode = domNode.getElementsByTagName('Geometry').item(0); %Get parent node
31+
nodesNode = geometryNode.getElementsByTagName('Nodes').item(0); %Get child node
32+
geometryNode.removeChild(nodesNode); %Remove child node
33+
34+
%%
35+
% Create some new nodes in the struct
36+
FEB_struct.Geometry.Nodes=rand(12,3);
37+
38+
%%
39+
% Add the new nodes to the XML description, see also |febStruct2febFile|
40+
41+
%Create new Nodes child
42+
geometryNode = domNode.getElementsByTagName('Geometry').item(0); %Get parent node
43+
parent_node = domNode.createElement('Nodes'); %Create node node
44+
parent_node = geometryNode.appendChild(parent_node);
45+
46+
n_steps=size(FEB_struct.Geometry.Nodes,1);
47+
for q_n=1:1:n_steps
48+
node_node = domNode.createElement('node'); %create node entry
49+
node_node = parent_node.appendChild(node_node); %add node entry
50+
attr = domNode.createAttribute('id'); %Create id attribute
51+
attr.setNodeValue(sprintf('%u',q_n)); %Set id text
52+
node_node.setAttributeNode(attr); %Add id attribute
53+
node_node.appendChild(domNode.createTextNode(sprintf('%6.7e, %6.7e, %6.7e',FEB_struct.Geometry.Nodes(q_n,:)))); %append data text child
54+
end
55+
56+
%%
57+
%View the new XML data
58+
% xmlView(domNode);
59+
XML_str = gxmlwrite(domNode);
60+
disp(XML_str);
61+
62+
%% Writing the XML data to a .feb file
63+
% Exporting the XML data to a .feb file can be done using |write_XML_no_extra_lines|
64+
65+
%%
66+
%
67+
% <<gibbVerySmall.gif>>
68+
%
69+
% _*GIBBON*_
70+
% <www.gibboncode.org>
71+
%
72+
% _Kevin Mattheus Moerman_, <gibbon.toolbox@gmail.com>
73+
74+
%%
75+
% _*GIBBON footer text*_
76+
%
77+
% License: <https://github.com/gibbonCode/GIBBON/blob/master/LICENSE>
78+
%
79+
% GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for
80+
% image segmentation, image-based modeling, meshing, and finite element
81+
% analysis.
82+
%
83+
% Copyright (C) 2017 Kevin Mattheus Moerman
84+
%
85+
% This program is free software: you can redistribute it and/or modify
86+
% it under the terms of the GNU General Public License as published by
87+
% the Free Software Foundation, either version 3 of the License, or
88+
% (at your option) any later version.
89+
%
90+
% This program is distributed in the hope that it will be useful,
91+
% but WITHOUT ANY WARRANTY; without even the implied warranty of
92+
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
93+
% GNU General Public License for more details.
94+
%
95+
% You should have received a copy of the GNU General Public License
96+
% along with this program. If not, see <http://www.gnu.org/licenses/>.

docs/DEMO_FEBio_active_contraction_01.m

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -301,23 +301,26 @@
301301
%
302302
% _Kevin Mattheus Moerman_, <gibbon.toolbox@gmail.com>
303303

304-
%% <-- GIBBON footer text -->
304+
%%
305+
% _*GIBBON footer text*_
306+
%
307+
% License: <https://github.com/gibbonCode/GIBBON/blob/master/LICENSE>
305308
%
306-
% GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for
307-
% image segmentation, image-based modeling, meshing, and finite element
308-
% analysis.
309+
% GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for
310+
% image segmentation, image-based modeling, meshing, and finite element
311+
% analysis.
309312
%
310-
% Copyright (C) 2017 Kevin Mattheus Moerman
313+
% Copyright (C) 2017 Kevin Mattheus Moerman
311314
%
312-
% This program is free software: you can redistribute it and/or modify
313-
% it under the terms of the GNU General Public License as published by
314-
% the Free Software Foundation, either version 3 of the License, or
315-
% (at your option) any later version.
315+
% This program is free software: you can redistribute it and/or modify
316+
% it under the terms of the GNU General Public License as published by
317+
% the Free Software Foundation, either version 3 of the License, or
318+
% (at your option) any later version.
316319
%
317-
% This program is distributed in the hope that it will be useful,
318-
% but WITHOUT ANY WARRANTY; without even the implied warranty of
319-
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
320-
% GNU General Public License for more details.
320+
% This program is distributed in the hope that it will be useful,
321+
% but WITHOUT ANY WARRANTY; without even the implied warranty of
322+
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
323+
% GNU General Public License for more details.
321324
%
322-
% You should have received a copy of the GNU General Public License
323-
% along with this program. If not, see <http://www.gnu.org/licenses/>.
325+
% You should have received a copy of the GNU General Public License
326+
% along with this program. If not, see <http://www.gnu.org/licenses/>.

docs/DEMO_FEBio_active_responsive_interface.m

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -598,23 +598,26 @@
598598
%
599599
% _Kevin Mattheus Moerman_, <gibbon.toolbox@gmail.com>
600600

601-
%% <-- GIBBON footer text -->
601+
%%
602+
% _*GIBBON footer text*_
603+
%
604+
% License: <https://github.com/gibbonCode/GIBBON/blob/master/LICENSE>
602605
%
603-
% GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for
604-
% image segmentation, image-based modeling, meshing, and finite element
605-
% analysis.
606+
% GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for
607+
% image segmentation, image-based modeling, meshing, and finite element
608+
% analysis.
606609
%
607-
% Copyright (C) 2017 Kevin Mattheus Moerman
610+
% Copyright (C) 2017 Kevin Mattheus Moerman
608611
%
609-
% This program is free software: you can redistribute it and/or modify
610-
% it under the terms of the GNU General Public License as published by
611-
% the Free Software Foundation, either version 3 of the License, or
612-
% (at your option) any later version.
612+
% This program is free software: you can redistribute it and/or modify
613+
% it under the terms of the GNU General Public License as published by
614+
% the Free Software Foundation, either version 3 of the License, or
615+
% (at your option) any later version.
613616
%
614-
% This program is distributed in the hope that it will be useful,
615-
% but WITHOUT ANY WARRANTY; without even the implied warranty of
616-
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
617-
% GNU General Public License for more details.
617+
% This program is distributed in the hope that it will be useful,
618+
% but WITHOUT ANY WARRANTY; without even the implied warranty of
619+
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
620+
% GNU General Public License for more details.
618621
%
619-
% You should have received a copy of the GNU General Public License
620-
% along with this program. If not, see <http://www.gnu.org/licenses/>.
622+
% You should have received a copy of the GNU General Public License
623+
% along with this program. If not, see <http://www.gnu.org/licenses/>.

docs/DEMO_FEBio_bar_force.m

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -268,23 +268,26 @@
268268
%
269269
% _Kevin Mattheus Moerman_, <gibbon.toolbox@gmail.com>
270270

271-
%% <-- GIBBON footer text -->
271+
%%
272+
% _*GIBBON footer text*_
273+
%
274+
% License: <https://github.com/gibbonCode/GIBBON/blob/master/LICENSE>
272275
%
273-
% GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for
274-
% image segmentation, image-based modeling, meshing, and finite element
275-
% analysis.
276+
% GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for
277+
% image segmentation, image-based modeling, meshing, and finite element
278+
% analysis.
276279
%
277-
% Copyright (C) 2017 Kevin Mattheus Moerman
280+
% Copyright (C) 2017 Kevin Mattheus Moerman
278281
%
279-
% This program is free software: you can redistribute it and/or modify
280-
% it under the terms of the GNU General Public License as published by
281-
% the Free Software Foundation, either version 3 of the License, or
282-
% (at your option) any later version.
282+
% This program is free software: you can redistribute it and/or modify
283+
% it under the terms of the GNU General Public License as published by
284+
% the Free Software Foundation, either version 3 of the License, or
285+
% (at your option) any later version.
283286
%
284-
% This program is distributed in the hope that it will be useful,
285-
% but WITHOUT ANY WARRANTY; without even the implied warranty of
286-
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
287-
% GNU General Public License for more details.
287+
% This program is distributed in the hope that it will be useful,
288+
% but WITHOUT ANY WARRANTY; without even the implied warranty of
289+
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
290+
% GNU General Public License for more details.
288291
%
289-
% You should have received a copy of the GNU General Public License
290-
% along with this program. If not, see <http://www.gnu.org/licenses/>.
292+
% You should have received a copy of the GNU General Public License
293+
% along with this program. If not, see <http://www.gnu.org/licenses/>.

docs/DEMO_FEBio_bar_soft_sphere_indentation.m

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -361,23 +361,26 @@
361361
%
362362
% _Kevin Mattheus Moerman_, <gibbon.toolbox@gmail.com>
363363

364-
%% <-- GIBBON footer text -->
364+
%%
365+
% _*GIBBON footer text*_
366+
%
367+
% License: <https://github.com/gibbonCode/GIBBON/blob/master/LICENSE>
365368
%
366-
% GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for
367-
% image segmentation, image-based modeling, meshing, and finite element
368-
% analysis.
369+
% GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for
370+
% image segmentation, image-based modeling, meshing, and finite element
371+
% analysis.
369372
%
370-
% Copyright (C) 2017 Kevin Mattheus Moerman
373+
% Copyright (C) 2017 Kevin Mattheus Moerman
371374
%
372-
% This program is free software: you can redistribute it and/or modify
373-
% it under the terms of the GNU General Public License as published by
374-
% the Free Software Foundation, either version 3 of the License, or
375-
% (at your option) any later version.
375+
% This program is free software: you can redistribute it and/or modify
376+
% it under the terms of the GNU General Public License as published by
377+
% the Free Software Foundation, either version 3 of the License, or
378+
% (at your option) any later version.
376379
%
377-
% This program is distributed in the hope that it will be useful,
378-
% but WITHOUT ANY WARRANTY; without even the implied warranty of
379-
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
380-
% GNU General Public License for more details.
380+
% This program is distributed in the hope that it will be useful,
381+
% but WITHOUT ANY WARRANTY; without even the implied warranty of
382+
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
383+
% GNU General Public License for more details.
381384
%
382-
% You should have received a copy of the GNU General Public License
383-
% along with this program. If not, see <http://www.gnu.org/licenses/>.
385+
% You should have received a copy of the GNU General Public License
386+
% along with this program. If not, see <http://www.gnu.org/licenses/>.

docs/DEMO_FEBio_bar_sphere_indentation.m

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -331,23 +331,26 @@
331331
%
332332
% _Kevin Mattheus Moerman_, <gibbon.toolbox@gmail.com>
333333

334-
%% <-- GIBBON footer text -->
334+
%%
335+
% _*GIBBON footer text*_
336+
%
337+
% License: <https://github.com/gibbonCode/GIBBON/blob/master/LICENSE>
335338
%
336-
% GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for
337-
% image segmentation, image-based modeling, meshing, and finite element
338-
% analysis.
339+
% GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for
340+
% image segmentation, image-based modeling, meshing, and finite element
341+
% analysis.
339342
%
340-
% Copyright (C) 2017 Kevin Mattheus Moerman
343+
% Copyright (C) 2017 Kevin Mattheus Moerman
341344
%
342-
% This program is free software: you can redistribute it and/or modify
343-
% it under the terms of the GNU General Public License as published by
344-
% the Free Software Foundation, either version 3 of the License, or
345-
% (at your option) any later version.
345+
% This program is free software: you can redistribute it and/or modify
346+
% it under the terms of the GNU General Public License as published by
347+
% the Free Software Foundation, either version 3 of the License, or
348+
% (at your option) any later version.
346349
%
347-
% This program is distributed in the hope that it will be useful,
348-
% but WITHOUT ANY WARRANTY; without even the implied warranty of
349-
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
350-
% GNU General Public License for more details.
350+
% This program is distributed in the hope that it will be useful,
351+
% but WITHOUT ANY WARRANTY; without even the implied warranty of
352+
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
353+
% GNU General Public License for more details.
351354
%
352-
% You should have received a copy of the GNU General Public License
353-
% along with this program. If not, see <http://www.gnu.org/licenses/>.
355+
% You should have received a copy of the GNU General Public License
356+
% along with this program. If not, see <http://www.gnu.org/licenses/>.

0 commit comments

Comments
 (0)