-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvt_tubeSegmentConnector.m
31 lines (28 loc) · 1.45 KB
/
vt_tubeSegmentConnector.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function [PV_N] = vt_tubeSegmentConnector(PV_N, prevGetRadius, currGetRadius, gridCellTypes, tubeX)
% Store simulation grid size
gridSize = size(PV_N);
% Move through the current grid planes and store the grid cells'
% property in currGridPlaneProp
[currGridPlaneProp, ~] = vt_findCellTypes(PV_N, gridCellTypes, tubeX);
% Move through the previous grid planes and store the grid cells'
% property in prevGridPlaneProp
[prevGridPlaneProp, gridCellTypeInplane] = vt_findCellTypes(PV_N, gridCellTypes, tubeX-1);
% Based on the adjacent grid planes condition connect them
if currGetRadius > prevGetRadius
for yCount = 1:gridSize(1)
for zCount = 1:gridSize(3)
if (currGridPlaneProp(yCount, zCount) == gridCellTypeInplane.inVTContour && prevGridPlaneProp(yCount, zCount) == gridCellTypeInplane.outVTContour)
PV_N(yCount, tubeX-1, zCount, 5) = gridCellTypes.cell_wall;
end
end
end
else
for yCount = 1:gridSize(1)
for zCount = 1:gridSize(3)
if (prevGridPlaneProp(yCount, zCount) == gridCellTypeInplane.inVTContour && currGridPlaneProp(yCount, zCount) == gridCellTypeInplane.outVTContour)
PV_N(yCount, tubeX, zCount, 5) = gridCellTypes.cell_wall;
end
end
end
end
end