














































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!















































int ccw(pointT p0,pointT p1,pointT p2) {
dx1=p1.x-p0.x; dy1=p1.y-p0.y; dx2=p2.x-p0.x; dy2=p2.y-p0.y; if( dx1dy2 > dy1dx2 ) return +1; if( dx1dy2 < dy1dx2 ) return -1; if( (dx1dx2<0) || (dy1dy2<0) ) return -1; if( (dx1dx1+dy1dy1)<(dx2dx2+dy2dy2)) return +1; return 0;
} int intersect(segT s1,segT s2) {
return ((ccw(s1.p1,s1.p2,s2.p1)
*ccw(s1.p1,s1,ps,s2.p2)) <=0 )
&& ((ccw(s2.p1,s2.p2,s1.p1)
*ccw(s2.p1,s2,ps,s1.p2)) <=0 );
}
ip
e
1
e
2
e
3
e
4
e
5
ip
e
1
e
2
e
3
e
4
esup1 esup
point
point
point
for(i=0;
i<npoin;
i++)
loop
over
points
(i)
nel=esup1[i+1]-esup1[i];
num
elem
surr
i
lel=&esup2[esup1[i]];
list
elem
surr
i
for(j=0;
j<np;
j++)
loop
over
surr
elem
iel=lel[j];
get
next
elem
surr
do_work...
psup1 psup
point
point
point
ip
p
1
p
2
p
3
p
4
p
4
ip
p
1
p
2
p
3
p
4
p
5
p
6
p
7
p
8
Do
ipoin=1,npoin
loop
over
points
jp1=psup1(ipoin)+
first
point
surr
ipoin
jp2=psup1(ipoin+1)
last
point
surr
ipoin
do
jp=jp1,jp
loop
over
pts
surr
ipoin
jpoin=psup2(jp)
gather
point
do_work...
enddo
enddo
int
esuel[nnode*nelem];
init
esuel[1:nnode*nelem]=-
loop
over
elements
(ie)
loop
over
nodes
of
ie
(a)
get
b=next
node
of
ie
get
c=next
node
of
ie
loop
over
elements
surrounding
b
(je
ie)
if(je
and
ie
have
nodes
in
common)
then
store
je
as
neighbor
opposite
to
a
endif endloop endloop endloop
a
c
b
A
B
C
D
E