1 function Mmerge = merge_alu3d_hexa(M1,M2);
2 %
function Mmerge = merge_alu3d_hexa(M1,M2);
4 %
function performing a merging of two alugrid3d hexa meshes. Assuming
5 % that they are non-overlapping, i.e. no domain-check is performed, but simple
8 % Bernard Haasdonk 13.3.2006
11 Mmerge.num_vertices = M1.num_vertices + M2.num_vertices;
12 Mmerge.vertices = [ M1.vertices, M2.vertices];
13 Mmerge.num_elements = M1.num_elements + M2.num_elements;
14 % perform index-shift in element-description
for second mesh:
15 Mmerge.elements = [ M1.elements, M2.elements + M1.num_vertices];
16 Mmerge.num_faces = M1.num_faces + M2.num_faces;
17 % perform index-shift in boundary vertex indices
for second mesh:
18 M2faces_shifted = M2.faces + ...
19 repmat([0 0 1 1 1 1]
'*M1.num_vertices,1,M2.num_faces);
20 Mmerge.faces = [ M1.faces, M2faces_shifted];
26 % TO BE ADJUSTED TO NEW SYNTAX