mphgetadj
Return geometric entity indices that are adjacent to each other.
Syntax
n = mphgetadj(model,geomtag,returntype,adjtype,adjnumber)
[n,m] = mphgetadj(model,geomtag,returntype,adjtype,adjnumber)
Description
n = mphgetadj(model,geomtag,returntype,adjtype,adjnumber) returns the indices of the adjacent geometry entities.
[n,m] = mphgetadj(model,geomtag,returntype,adjtype,adjnumber) returns the indices of the adjacent geometry entities in n. m contains the indices of entities that connect the entities adjnumber the best.
returntype is the type of the geometry entities whose index are returned.
adjtype is the type of the input geometric entity.
The entity type can be one of 'point', 'edge', 'boundary', or 'domain' following the entity space dimension defined below:
'domain': maximum geometry space dimension
'boundary': maximum geometry space dimension 1
'edges': 1 (for 3D geometries only)
'point': 0
Example
Return the indices of the boundaries adjacent to point 2:
model = mphopen('model_tutorial_llmatlab');
bnd_idx = mphgetadj(model, 'geom1', 'boundary', 'point', 2);
Return the indices of the points adjacent to domain 2:
pt_idx = mphgetadj(model, 'geom1', 'point', 'domain', 2);
Return the indices of the adjacent edges to boundaries 1, 2 and 9 and the indices of the edges that connect the boundaries the best. Then show the results in a figure:
[idx1, idx2] = mphgetadj(model, 'geom1', 'edge',...
   'boundary', [1, 2, 9]);
mphviewselection(model,'geom1',[1,2,9],'entity','boundary',...
   'edgemode','off')
hold on
mphviewselection(model,'geom1',idx1,'entity','edge',...
   'edgemode','off','facemode','off','edgecolorselected','b')
mphviewselection(model,'geom1',idx2,'entity','edge',...
   'edgemode','off','facemode','off','edgecolorselected','g')
 
See also
mphgetcoords, mphselectbox, mphselectcoords