File: ExtractDofsonBorder.idp

package info (click to toggle)
freefem%2B%2B 3.47%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 132,088 kB
  • ctags: 19,726
  • sloc: cpp: 138,951; ansic: 22,605; sh: 4,951; makefile: 2,935; fortran: 1,147; perl: 768; awk: 282; php: 182
file content (32 lines) | stat: -rw-r--r-- 1,151 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
22
23
24
25
26
27
28
29
30
31
32
// Usage:
/* 
  extract the list of degre of freedom of 2d finite elemnt
    on connect boundary given by a list of label or on label
   the list is sort in direction of the +/- tangent 
   the  orientation 1: direct or -1 clockwise
   The parameter are: 
   - labs : int[int] ou int  to defined the boundary (in)
   - Wh  the fespace                                 (in)
   - int[int]  doflabs  (resize array)               (out)  
   - int orient : orientation of the border direct (1) or in direct -1 (in)
*/
macro ExtractDofsonBorder(labs,Wh,doflabs,orient)
{
mesh Th=Wh.Th;
fespace VhExtractDofsonBorder(Th,P1);
VhExtractDofsonBorder abslabs,onlon,atest;
solve Pbabciss(abslabs,atest) 
= int2d(Th,qft=qf1pTlump)(abslabs*atest*1e-10)
  +  int1d(Th,labs,qfe=qf1pElump)([dx(abslabs),dy(abslabs)]'*[-N.y,+N.x]*atest)
  -  int1d(Th,labs,qfe=qf1pElump)(orient*atest);
  real abslabsmax = 2*abslabs[].max;
  varf vlabsneg(u,v) = on(labs,u=abslabs-abslabsmax);
  if(1)  plot(abslabs,wait=1);
  real[int] absc=vlabsneg(0,Wh);
  doflabs.resize(Wh.ndof);
  doflabs=0:Wh.ndof-1;
  sort(absc,doflabs);
  absc= absc? 1:0;
  doflabs.resize(absc.sum+0.5);
} 
//