# tesBoundary

Below is a demonstration of the features of the `tesBoundary` function

## Contents

```
clear; close all; clc;
```

## Syntax

`[indBoundary]=tesBoundary(F);`

## Description

This function obtains the indices of the boundary faces based on the input faces F. Boundary faces are those that occur only once (in terms of nodes involved, e.g. [1 2 3 4] is deemed the same face as [2 3 4 1].

## Examples

Plot settings

fontSize=20; faceAlpha1=0.5;

## Example 1: Get hex mesh boundary faces

Example geometry

boxDim=[6 4 4]; boxEl=[5 3 3]; [meshStruct]=hexMeshBox(boxDim,boxEl,2); E=meshStruct.elements; %Elements V=meshStruct.nodes; %Nodes F=meshStruct.faces; %Mesh faces %The hexMeshBox function provides boundary faces already but tesboundary is used in this example % Fb=meshStruct.facesBoundary; %Boundary faces

Get boundary faces

indBoundary=tesBoundary(F); Fb=F(indBoundary,:);

Plotting model

cFigure; subplot(1,2,1); hold on; title('All faces','FontSize',fontSize); gpatch(F,V,'w','k',faceAlpha1,3); axisGeom(gca,fontSize); camlight headlight; subplot(1,2,2); hold on; title('Boundaries faces','FontSize',fontSize); gpatch(Fb,V,'w','k',faceAlpha1,3); axisGeom(gca,fontSize); camlight headlight; drawnow;

## Example 1: Get tet mesh boundary faces

Example geometry

boxDim=[6 4 4]; pointSpacing=2; [meshStruct]=tetMeshBox(boxDim,pointSpacing); E=meshStruct.elements; %Elements V=meshStruct.nodes; %Nodes F=meshStruct.faces; %Mesh faces %The tetMeshBox function provides boundary faces already but tesboundary is used in this example % Fb=meshStruct.facesBoundary; %Boundary faces

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --- TETGEN Tetrahedral meshing --- 08-Oct-2021 15:05:24 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --- Writing SMESH file --- 08-Oct-2021 15:05:25 ----> Adding node field ----> Adding facet field ----> Adding holes specification ----> Adding region specification --- Done --- 08-Oct-2021 15:05:25 --- Running TetGen to mesh input boundary--- 08-Oct-2021 15:05:25 Opening /mnt/data/MATLAB/GIBBON/data/temp/temp.smesh. --- Done --- 08-Oct-2021 15:05:25 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --- Importing TetGen files --- 08-Oct-2021 15:05:25 --- Done --- 08-Oct-2021 15:05:25

Get boundary faces

indBoundary=tesBoundary(F); Fb=F(indBoundary,:);

Plotting model

cFigure; subplot(1,2,1); hold on; title('All faces','FontSize',fontSize); gpatch(F,V,'w','k',faceAlpha1,3); axisGeom(gca,fontSize); camlight headlight; subplot(1,2,2); hold on; title('Boundaries faces','FontSize',fontSize); gpatch(Fb,V,'w','k',faceAlpha1,3); axisGeom(gca,fontSize); camlight headlight; drawnow;

* GIBBON* www.gibboncode.org

*Kevin Mattheus Moerman*, gibbon.toolbox@gmail.com

**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-2021 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/.