This file is indexed.

/usr/share/doc/getdp/demos/magnet.pro is in getdp 2.7.0-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
   To solve the problem
   with scalar potential, type 'getdp test -solve MagSta_phi -pos phi'
   with vector potential, type 'getdp test -solve MagSta_a -pos a'
*/

Include "magnet_data.pro";
Include "BH.pro";

Group {
  // AIR, AIR_INF, etc. are variables defined in core.txt, and correspond to the
  // tags of physical regions in the mesh
  Air     = Region[ AIR ];
  AirInf  = Region[ AIR_INF ];
  Core    = Region[ CORE ];
  AirGap  = Region[ AIR_GAP ];
  Magnet  = Region[ MAGNET ];

  // These are the generic group names that are used in "Magnetostatics.pro"
  Domain_S = Region[ {} ] ;
  Domain_Inf = Region[ AirInf ] ;
  Domain_M   = Region[ Magnet ] ;

  // This defines a constant ('Flag_NL') with a default value (0), and a way to
  // change it from outside getdp with ONELAB, using the given parameter name
  // and possible binary values 0 or 1.
  DefineConstant[
    Flag_NL = { 0, Choices{0,1}, Name "Parameters/Materials/1Nonlinear BH-curve"}
  ];

  Domain_NL = Region[ {} ] ;
  If(Flag_NL)
    Domain_NL += Region[ {Core} ] ;
  EndIf

  Domain_Mag = Region[ {Air, AirInf, Core, AirGap} ] ;
  Dirichlet_a_0   = Region[ LINE_INF ] ;
  Dirichlet_phi_0 = Region[ {LINE_X, LINE_INF} ] ;
}

Function {
  mu0 = 4.e-7 * Pi ;

  // Another parameter that can be changed interactively; but is only visible
  // when it makes sense (if we don't perform a nonlinear analysis)
  DefineConstant[ murCore = {200., Min 1, Max 1000, Step 10, Visible !Flag_NL,
      Name "Parameters/Materials/Core relative permeability"} ];

  nu [ Region[{Air, AirInf, AirGap, Magnet}] ] = 1. / mu0 ;

  If(!Flag_NL)
    nu [ Core ]  = 1. / (murCore * mu0) ;
    mu [ Core ]  = murCore * mu0;
  EndIf
  If(Flag_NL)
    nu [ Core ] = nu_1[$1] ;
    dhdb_NL [ Core ] = dhdb_1_NL[$1];
    mu [ Core ] = mu_1[$1] ;
    dbdh_NL [ Core ] = dbdh_1_NL[$1];
  EndIf

  mu [ Region[{Air, AirInf, AirGap, Magnet}] ] = mu0 ;

  DefineConstant[ Hc = {920000,
      Name "Parameters/Materials/hc", Label "Magnet coercive field (A/m)"} ];
  hc [ Magnet ] = Rotate[ Vector[Hc, 0, 0.], 0, 0, Pi/2] ;
}

Include "Magnetostatics.pro"

eps = 1.e-5;

PostOperation {
  { Name phi ; NameOfPostProcessing MagSta_phi;
    Operation {
      Print[ phi, OnElementsOf Domain, File "phi.pos" ] ;
      Print[ hc, OnElementsOf Domain, File "hc.pos" ] ;
      Print[ b, OnElementsOf Domain, File "b_phi.pos" ] ;
      Print[ b, OnLine {{-0.07,eps,0}{0.09,eps,0}} {500}, File "b_phi.txt", Format Table ] ;
    }
  }
  { Name a ; NameOfPostProcessing MagSta_a;
    Operation {
      Print[ az, OnElementsOf Domain, File "az.pos"] ;
      Print[ b, OnElementsOf Domain, File "b_a.pos" ] ;
      Print[ h, OnElementsOf Domain, File "h_a.pos" ] ;
      Print[ b, OnLine {{-0.07,eps,0}{0.09,eps,0}} {500}, File "b_a.txt" , Format Table ] ;
    }
  }
}