File: removedupelem.m

package info (click to toggle)
octave-iso2mesh 1.9.8%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 11,128 kB
  • sloc: cpp: 11,982; ansic: 10,158; sh: 365; makefile: 59
file content (21 lines) | stat: -rw-r--r-- 521 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function elem = removedupelem(elem)
%
% elem=removedupelem(elem)
%
% remove doubly duplicated (folded) elements
%
% author: Qianqian Fang, <q.fang at neu.edu>
%
% input:
%    elem: list of elements (node indices)
%
% output:
%    elem: element list after removing the duplicated elements
%
% -- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net)
%

[el, count1, count2] = unique(sort(elem')', 'rows');
bins = hist(count2, 1:size(elem, 1));
cc = bins(count2);
elem(find(cc > 0 & mod(cc, 2) == 0), :) = [];