123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
-
-
-
-
-
-
-
-
-
-
- _m = 1;
-
-
- e1 = 50. * _m;
- e2 = 5. * _m ;
-
- h1 = 15.5 * _m;
- h2 = 50 * _m;
- h5 = 2 * _m;
-
- h3 = -8 * _m;
- h4 = 2 * _m;
-
- he = 100*_m;
- sy = -he/2.;
-
- R1 = 1 * _m;
- R2 = 1. * _m;
-
-
- NE = 2;
- NN = 40;
- SE = -10;
- SN = -20;
- de = 1;
- dn = 1;
-
- Lc1 = 5.5 * _m;
- Lc2 = 5.5 * _m;
-
- Lc4 = 0.15*de * _m;
-
-
-
-
-
-
- ccos = (-h5*R1 + e2 * Hypot(h5, Hypot(e2, R1))) / (h5^2 + e2^2);
- ssin = Sqrt(1 - ccos^2);
-
- p1 = newp;
-
-
- Point(p1 ) = {-e1-e2, sy, 0 , Lc1};
- Point(p1+1) = {-e1-e2, sy, h1+h2, Lc1};
- Point(p1+2) = {e1+e2 , sy, h1+h2, Lc1};
- Point(p1+3) = { e1+e2, sy, h1 , Lc1};
-
-
- Point(p1+4)= { R1 / ssin, sy, h5+R1*ccos, Lc2};
- Point(p1+5)= {-R1 / ssin, sy, h5+R1*ccos, Lc2};
-
-
- Point(p1+6) = {-e2 , sy, 0.0, Lc2};
-
-
-
-
- L = newl;
- Line(L ) = {p1 , p1+6};
- Line(L+1) = {p1+6, p1+5};
- Line(L+2) = {p1+5, p1+4};
-
- Line(L+3) = {p1+4, p1+3};
- Line(L+4) = {p1+3, p1+2};
- Line(L+5) = {p1+2, p1+1};
- Line(L+6) = {p1+1, p1 };
-
-
-
- LL = newll;
-
- Line Loop(LL+1) = { L, L+1, L+2, L+3, L+4, L+5, L+6 };
- s1 = news;
-
- Plane Surface(s1) = {LL+1};
-
-
- out[] = Extrude {0,he,0} {
- Surface{s1};
- };
-
-
-
-
-
- Physical Surface(2) = {s1, out[0], out[6], out[7], out[8] };
-
-
- Physical Volume(1) = {out[1]};
-
- ep = newp;
- Printf("%YAML 1.2") > "electrodes.yaml";
- Printf("---") >> "electrodes.yaml";
- Printf("Electrodes:") >> "electrodes.yaml";
- ii = 0;
-
- For iie In {0:NE-1}
- For iin In {0:NN-1}
- yy = SE+de*iie;
- xx = SN+dn*iin;
- zz = 0;
- If (xx < -e2)
- Point(ep+ii) = {xx , yy, 0.0, Lc4};
- Point{ep+ii} In Surface{ out[2] };
- EndIf
- If ( xx>-e2 && xx < -R1 / ssin )
- zz = (xx+e2) * ( (h5+R1*ccos) / ((e2) - (R1/ssin)) );
- Point(ep+ii) = {xx, yy, zz, Lc4};
- Point{ep+ii} In Surface{ out[3] };
- EndIf
- If( xx> -R1 / ssin && xx< R1/ssin)
- zz = h5+R1*ccos;
- Point(ep+ii) = {xx , yy, zz, Lc4};
- Point{ep+ii} In Surface{ out[4] };
- EndIf
- If( xx>R1/ssin )
- zz = h5+R1*ccos + ( (xx-(R1/ssin)) * ( (h1-(h5+R1*ccos)) / ((e1+e2) - (R1/ssin)) ));
- Point(ep+ii) = {xx , yy, zz, Lc4};
- Point{ep+ii} In Surface{ out[5] };
- EndIf
-
- Printf(" L%g-%g: !<DCIPElectrode> &L%g-%g", iie, iin, iie, iin) >> "electrodes.yaml";
- Printf(" Node_ID: %g", 26+ii) >> "electrodes.yaml";
- Printf(" Location: !<Vector3r>") >> "electrodes.yaml";
- Printf(" -") >> "electrodes.yaml";
- Printf(" - %f", xx) >> "electrodes.yaml";
- Printf(" - %f", yy) >> "electrodes.yaml";
- Printf(" - %f", zz) >> "electrodes.yaml";
-
- ii += 1;
- EndFor
- EndFor
-
-
-
-
- Field[1] = Attractor;
- Field[1].NodesList = {ep:ep+NE*NN};
-
- Field[2] = Threshold;
- Field[2].IField = 1;
- Field[2].LcMin = Lc4;
- Field[2].LcMax = Lc1;
- Field[2].DistMin = .1;
- Field[2].DistMax = 20;
-
-
- Field[3] = Min;
- Field[3].FieldsList = {2};
- Background Field = 3;
|