22 static constexpr double InvFourPiEps0 = 1. /
MyFACTOR;
36 switch ((
EleArr + ele - 1)->G.Type) {
38 value =
RecPot(ele, localP);
41 value =
TriPot(ele, localP);
47 printf(
"Geometrical type out of range! ... exiting ...\n");
58 printf(
"In RecPot ...\n");
63 double xpt = localP->
X;
64 double ypt = localP->
Y;
65 double zpt = localP->
Z;
67 double a = (
EleArr + ele - 1)->G.LX;
68 double b = (
EleArr + ele - 1)->G.LZ;
69 double diag = sqrt(a * a + b * b);
72 double dist = sqrt(xpt * xpt + ypt * ypt + zpt * zpt);
81 ExactRecSurf(xpt / a, ypt / a, zpt / a, -0.5, -(b / a) / 2.0,
82 0.5, (b / a) / 2.0, &Pot, &Field);
85 printf(
"problem in computing Potential of rectangular element ... \n");
86 printf(
"a: %lg, b: %lg, X: %lg, Y: %lg, Z: %lg\n", a, b, xpt, ypt, zpt);
94 return Pot * InvFourPiEps0;
103 printf(
"In TriPot ...\n");
108 double xpt = localP->
X;
109 double ypt = localP->
Y;
110 double zpt = localP->
Z;
113 double a = (
EleArr + ele - 1)->G.LX;
114 double b = (
EleArr + ele - 1)->G.LZ;
116 double diag = sqrt(a * a + b * b);
118 const double xm = xpt - a / 3.;
119 const double zm = zpt - b / 3.;
120 double dist = sqrt(xm * xm + ypt * ypt + zm * zm);
123 double dA = 0.5 * a * b;
126 int fstatus =
ExactTriSurf(b / a, xpt / a, ypt / a, zpt / a, &Pot, &Field);
128 printf(
"problem in computing Potential of triangular element ... \n");
129 printf(
"a: %lg, b: %lg, X: %lg, Y: %lg, Z: %lg\n", a, b, xpt, ypt, zpt);
137 return Pot * InvFourPiEps0;
147 printf(
"In WirePot ...\n");
151 double xpt = localP->
X;
152 double ypt = localP->
Y;
153 double zpt = localP->
Z;
155 double rW = (
EleArr + ele - 1)->G.LX;
156 double lW = (
EleArr + ele - 1)->G.LZ;
159 double dist = sqrt(xpt * xpt + ypt * ypt + zpt * zpt);
163 double dA = 2.0 *
ST_PI * rW * lW;
176 return Pot * InvFourPiEps0;
187 switch ((
EleArr + ele - 1)->G.Type) {
198 printf(
"Geometrical type out of range! ... exiting ...\n");
209 switch ((
EleArr + ele - 1)->G.Type) {
220 printf(
"Geometrical type out of range! ... exiting ...\n");
229 printf(
"In RecFlux ...\n");
232 double xpt = localP->
X;
233 double ypt = localP->
Y;
234 double zpt = localP->
Z;
236 double a = (
EleArr + ele - 1)->G.LX;
237 double b = (
EleArr + ele - 1)->G.LZ;
238 double diag = sqrt(a * a + b * b);
241 double dist = sqrt(xpt * xpt + ypt * ypt + zpt * zpt);
245 const double f = a * b / (dist * dist * dist);
252 ExactRecSurf(xpt / a, ypt / a, zpt / a, -0.5, -(b / a) / 2.0,
253 0.5, (b / a) / 2.0, &Pot, localF);
255 printf(
"problem in computing flux of rectangular element ... \n");
262 localF->
X *= InvFourPiEps0;
263 localF->
Y *= InvFourPiEps0;
264 localF->
Z *= InvFourPiEps0;
275 printf(
"In TriFlux ...\n");
278 double xpt = localP->
X;
279 double ypt = localP->
Y;
280 double zpt = localP->
Z;
282 double a = (
EleArr + ele - 1)->G.LX;
283 double b = (
EleArr + ele - 1)->G.LZ;
284 double diag = sqrt(a * a + b * b);
290 const double xm = xpt - a / 3.;
291 const double zm = zpt - b / 3.;
292 double dist = sqrt(xm * xm + ypt * ypt + zm * zm);
295 const double f = 0.5 * a * b / (dist * dist * dist);
301 int fstatus =
ExactTriSurf(b / a, xpt / a, ypt / a, zpt / a, &Pot, localF);
304 printf(
"problem in computing flux of triangular element ... \n");
311 localF->
X *= InvFourPiEps0;
312 localF->
Y *= InvFourPiEps0;
313 localF->
Z *= InvFourPiEps0;
327 printf(
"In WireFlux ...\n");
330 double xpt = localP->
X;
331 double ypt = localP->
Y;
332 double zpt = localP->
Z;
333 double rW = (
EleArr + ele - 1)->G.LX;
334 double lW = (
EleArr + ele - 1)->G.LZ;
337 double dist = sqrt(xpt * xpt + ypt * ypt + zpt * zpt);
340 const double f = 2.0 *
ST_PI * rW * lW / (dist * dist * dist);
346 localF->
X = localF->
Y = 0.0;
358 localF->
X *= InvFourPiEps0;
359 localF->
Y *= InvFourPiEps0;
360 localF->
Z *= InvFourPiEps0;
664 int fstatus =
ElePFAtPoint(globalP, &ElePot, &EleglobalF);
667 "Problem in ElePFAtPoint being called from PFAtPoint ... returning\n");
671 globalF->
X = EleglobalF.
X;
672 globalF->
Y = EleglobalF.
Y;
673 globalF->
Z = EleglobalF.
Z;
681 "Problem in KnChPFAtPoint being called from PFAtPoint ... "
685 *Potential += KnChPot;
686 globalF->
X += KnChglobalF.
X;
687 globalF->
Y += KnChglobalF.
Y;
688 globalF->
Z += KnChglobalF.
Z;
700 const double xfld = globalP->
X;
701 const double yfld = globalP->
Y;
702 const double zfld = globalP->
Z;
705 *Potential = globalF->
X = globalF->
Y = globalF->
Z = 0.0;
734 pPot[prim] = plFx[prim] = plFy[prim] = plFz[prim] = 0.0;
738 int tid = 0, nthreads = 1;
739 #pragma omp parallel private(tid, nthreads)
745 tid = omp_get_thread_num();
747 nthreads = omp_get_num_threads();
748 printf(
"PFAtPoint computation with %d threads\n", nthreads);
756 for (
int primsrc = 1; primsrc <=
NbPrimitives; ++primsrc) {
758 printf(
"Evaluating effect of primsrc %d using on %lg, %lg, %lg\n",
759 primsrc, xfld, yfld, zfld);
774 double TransformationMatrix[3][3];
801 double InitialVector[3] = {xfld - xpsrc, yfld - ypsrc, zfld - zpsrc};
802 double FinalVector[3] = {0., 0., 0.};
803 for (
int i = 0; i < 3; ++i) {
804 for (
int j = 0; j < 3; ++j) {
805 FinalVector[i] += TransformationMatrix[i][j] * InitialVector[j];
809 localPP.
X = FinalVector[0];
810 localPP.
Y = FinalVector[1];
811 localPP.
Z = FinalVector[2];
812 GetPrimPF(primsrc, &localPP, &tmpPot, &tmpF);
814 pPot[primsrc] += qpr * tmpPot;
820 printf(
"PFAtPoint base primitive =>\n");
821 printf(
"primsrc: %d, xlocal: %lg, ylocal: %lg, zlocal %lg\n",
822 primsrc, localPP.
X, localPP.
Y, localPP.
Z);
823 printf(
"primsrc: %d, Pot: %lg, Fx: %lg, Fx: %lg, Fz: %lg\n",
824 primsrc, tmpPot, tmpF.
X, tmpF.
Y, tmpF.
Z);
825 printf(
"primsrc: %d, pPot: %lg, lFx: %lg, lFy: %lg, lFz: %lg\n",
826 primsrc, pPot[primsrc], lFx, lFy, lFz);
841 for (
int ele = eleMin; ele <= eleMax; ++ele) {
842 const double xsrc = (
EleArr + ele - 1)->G.Origin.X;
843 const double ysrc = (
EleArr + ele - 1)->G.Origin.Y;
844 const double zsrc = (
EleArr + ele - 1)->G.Origin.Z;
846 double vG[3] = {xfld - xsrc, yfld - ysrc, zfld - zsrc};
847 double vL[3] = {0., 0., 0.};
848 for (
int i = 0; i < 3; ++i) {
849 for (
int j = 0; j < 3; ++j) {
850 vL[i] += TransformationMatrix[i][j] * vG[j];
854 const int type = (
EleArr + ele - 1)->G.Type;
855 const double a = (
EleArr + ele - 1)->G.LX;
856 const double b = (
EleArr + ele - 1)->G.LZ;
857 GetPF(type, a, b, vL[0], vL[1], vL[2], &tPot, &tF);
865 printf(
"PFAtPoint base primitive:%d\n", primsrc);
866 printf(
"ele: %d, xlocal: %lg, ylocal: %lg, zlocal %lg\n", ele,
867 vL[0], vL[1], vL[2]);
869 "ele: %d, tPot: %lg, tFx: %lg, tFy: %lg, tFz: %lg, Solution: "
871 ele, tPot, tF.
X, tF.
Y, tF.
Z, qel);
872 printf(
"ele: %d, ePot: %lg, eFx: %lg, eFy: %lg, eFz: %lg\n", ele,
873 ePot, eF.
X, eF.
Y, eF.
Z);
878 pPot[primsrc] += ePot;
884 "prim%d, ePot: %lg, eFx: %lg, eFy: %lg, eFz: %lg\n",
885 primsrc, ePot, eF.X, eF.Y, eF.Z);
886 printf(
"prim%d, pPot: %lg, lFx: %lg, lFy: %lg, lFz: %lg\n", primsrc,
887 pPot[primsrc], lFx, lFy, lFz);
894 printf(
"basic primitive\n");
895 printf(
"primsrc: %d, pPot: %lg, lFx: %lg, lFy: %lg, lFz: %lg\n",
896 primsrc, pPot[primsrc], lFx, lFy, lFz);
902 printf(
"Mirror may not be correctly implemented ...\n");
912 if (perx || pery || perz) {
913 for (
int xrpt = -perx; xrpt <= perx; ++xrpt) {
914 const double xShift =
XPeriod[primsrc] * (double)xrpt;
915 const double XPOfRpt = xpsrc + xShift;
916 for (
int yrpt = -pery; yrpt <= pery; ++yrpt) {
917 const double yShift =
YPeriod[primsrc] * (double)yrpt;
918 const double YPOfRpt = ypsrc + yShift;
919 for (
int zrpt = -perz; zrpt <= perz; ++zrpt) {
920 const double zShift =
ZPeriod[primsrc] * (double)zrpt;
921 const double ZPOfRpt = zpsrc + zShift;
923 if ((xrpt == 0) && (yrpt == 0) && (zrpt == 0))
continue;
938 double InitialVector[3] = {xfld - XPOfRpt, yfld - YPOfRpt, zfld - ZPOfRpt};
939 double FinalVector[3] = {0., 0., 0.};
940 for (
int i = 0; i < 3; ++i) {
941 for (
int j = 0; j < 3; ++j) {
943 TransformationMatrix[i][j] * InitialVector[j];
947 localPPR.
X = FinalVector[0];
948 localPPR.
Y = FinalVector[1];
949 localPPR.
Z = FinalVector[2];
954 GetPrimPF(primsrc, &localPPR, &tmpPot, &tmpF);
956 pPot[primsrc] += qpr * tmpPot;
963 "primsrc: %d, xlocal: %lg, ylocal: %lg, zlocal: "
965 primsrc, localPPR.
X, localPPR.
Y, localPPR.
Z);
967 "primsrc: %d, Pot: %lg, Fx: %lg, Fy: %lg, Fz: %lg\n",
968 primsrc, tmpPot * qpr, tmpF.
X * qpr, tmpF.
Y * qpr,
971 "primsrc: %d, pPot: %lg, lFx: %lg, lFy: %lg, lFz: "
973 primsrc, pPot[primsrc], lFx, lFy, lFz);
987 for (
int ele = eleMin; ele <= eleMax; ++ele) {
988 const double xrsrc = (
EleArr + ele - 1)->G.Origin.X;
989 const double yrsrc = (
EleArr + ele - 1)->G.Origin.Y;
990 const double zrsrc = (
EleArr + ele - 1)->G.Origin.Z;
992 const double XEOfRpt = xrsrc + xShift;
993 const double YEOfRpt = yrsrc + yShift;
994 const double ZEOfRpt = zrsrc + zShift;
996 double vG[3] = {xfld - XEOfRpt, yfld - YEOfRpt, zfld - ZEOfRpt};
997 double vL[3] = {0., 0., 0.};
998 for (
int i = 0; i < 3; ++i) {
999 for (
int j = 0; j < 3; ++j) {
1000 vL[i] += TransformationMatrix[i][j] * vG[j];
1006 const int type = (
EleArr + ele - 1)->G.Type;
1007 const double a = (
EleArr + ele - 1)->G.LX;
1008 const double b = (
EleArr + ele - 1)->G.LZ;
1009 GetPF(type, a, b, vL[0], vL[1], vL[2], &tPot, &tF);
1011 erPot += qel * tPot;
1012 erF.
X += qel * tF.
X;
1013 erF.
Y += qel * tF.
Y;
1014 erF.
Z += qel * tF.
Z;
1017 printf(
"PFAtPoint base primitive:%d\n", primsrc);
1018 printf(
"ele: %d, xlocal: %lg, ylocal: %lg, zlocal %lg\n",
1019 ele, vL[0], vL[1], vL[2]);
1021 "ele: %d, tPot: %lg, tFx: %lg, tFy: %lg, tFz: %lg, "
1023 ele, tPot, tF.
X, tF.
Y, tF.
Z, qel);
1025 "ele: %d, ePot: %lg, eFx: %lg, eFy: %lg, eFz: %lg\n",
1026 ele, erPot, erF.
X, erF.
Y, erF.
Z);
1032 pPot[primsrc] += erPot;
1040 printf(
"basic repeated xrpt: %d. yrpt: %d, zrpt: %d\n",
1043 "primsrc: %d, pPot: %lg, lFx: %lg, lFy: %lg, lFz: %lg\n",
1044 primsrc, pPot[primsrc], lFx, lFy, lFz);
1052 "Mirror not correctly implemented in this version of "
1078 'X', primsrc, srcptp, fldpt,
1089 pPot[primsrc] -= qpr * tmpPot;
1090 lFx -= qpr * tmpF.
X;
1091 lFy -= qpr * tmpF.
Y;
1092 lFz -= qpr * tmpF.
Z;
1095 pPot[primsrc] += qpr * tmpPot;
1096 lFx += qpr * tmpF.
X;
1097 lFy += qpr * tmpF.
Y;
1098 lFz += qpr * tmpF.
Z;
1106 for (
int ele = eleMin; ele <= eleMax; ++ele) {
1107 const double xsrc = (
EleArr + ele - 1)->G.Origin.X;
1108 const double ysrc = (
EleArr + ele - 1)->G.Origin.Y;
1109 const double zsrc = (
EleArr + ele - 1)->G.Origin.Z;
1111 const double XEOfRpt = xsrc + xShift;
1112 const double YEOfRpt = ysrc + yShift;
1113 const double ZEOfRpt = zsrc + zShift;
1120 'X', ele, srcpte, fldpt,
1122 const int type = (
EleArr + ele - 1)->G.Type;
1123 const double a = (
EleArr + ele - 1)->G.LX;
1124 const double b = (
EleArr + ele - 1)->G.LZ;
1125 GetPFGCS(type, a, b, &localPERM, &tmpPot, &tmpF, &DirCos);
1129 pPot[primsrc] -= qel * tmpPot;
1130 lFx -= qel * tmpF.
X;
1131 lFy -= qel * tmpF.
Y;
1132 lFz -= qel * tmpF.
Z;
1135 pPot[primsrc] += qel * tmpPot;
1136 lFx += qel * tmpF.
X;
1137 lFy += qel * tmpF.
Y;
1138 lFz += qel * tmpF.
Z;
1157 pPot[primsrc] -= qpr * tmpPot;
1158 lFx -= qpr * tmpF.
X;
1159 lFy -= qpr * tmpF.
Y;
1160 lFz -= qpr * tmpF.
Z;
1163 pPot[primsrc] += qpr * tmpPot;
1164 lFx += qpr * tmpF.
X;
1165 lFy += qpr * tmpF.
Y;
1166 lFz += qpr * tmpF.
Z;
1174 for (
int ele = eleMin; ele <= eleMax; ++ele) {
1175 const double xsrc = (
EleArr + ele - 1)->G.Origin.X;
1176 const double ysrc = (
EleArr + ele - 1)->G.Origin.Y;
1177 const double zsrc = (
EleArr + ele - 1)->G.Origin.Z;
1179 const double XEOfRpt = xsrc + xShift;
1180 const double YEOfRpt = ysrc + yShift;
1181 const double ZEOfRpt = zsrc + zShift;
1188 'Y', ele, srcpte, fldpt,
1190 const int type = (
EleArr + ele - 1)->G.Type;
1191 const double a = (
EleArr + ele - 1)->G.LX;
1192 const double b = (
EleArr + ele - 1)->G.LZ;
1193 GetPFGCS(type, a, b, &localPERM, &tmpPot, &tmpF, &DirCos);
1197 pPot[primsrc] -= qel * tmpPot;
1198 lFx -= qel * tmpF.
X;
1199 lFy -= qel * tmpF.
Y;
1200 lFz -= qel * tmpF.
Z;
1203 pPot[primsrc] += qel * tmpPot;
1204 lFx += qel * tmpF.
X;
1205 lFy += qel * tmpF.
Y;
1206 lFz += qel * tmpF.
Z;
1225 pPot[primsrc] -= qpr * tmpPot;
1226 lFx -= qpr * tmpF.
X;
1227 lFy -= qpr * tmpF.
Y;
1228 lFz -= qpr * tmpF.
Z;
1231 pPot[primsrc] += qpr * tmpPot;
1232 lFx += qpr * tmpF.
X;
1233 lFy += qpr * tmpF.
Y;
1234 lFz += qpr * tmpF.
Z;
1243 for (
int ele = eleMin; ele <= eleMax; ++ele) {
1244 const double xsrc = (
EleArr + ele - 1)->G.Origin.X;
1245 const double ysrc = (
EleArr + ele - 1)->G.Origin.Y;
1246 const double zsrc = (
EleArr + ele - 1)->G.Origin.Z;
1248 const double XEOfRpt = xsrc + xShift;
1249 const double YEOfRpt = ysrc + yShift;
1250 const double ZEOfRpt = zsrc + zShift;
1257 'Z', ele, srcpte, fldpt,
1259 const int type = (
EleArr + ele - 1)->G.Type;
1260 const double a = (
EleArr + ele - 1)->G.LX;
1261 const double b = (
EleArr + ele - 1)->G.LZ;
1262 GetPFGCS(type, a, b, &localPERM, &tmpPot, &tmpF, &DirCos);
1266 pPot[primsrc] -= qel * tmpPot;
1267 lFx -= qel * tmpF.
X;
1268 lFy -= qel * tmpF.
Y;
1269 lFz -= qel * tmpF.
Z;
1272 pPot[primsrc] += qel * tmpPot;
1273 lFx += qel * tmpF.
X;
1274 lFy += qel * tmpF.
Y;
1275 lFz += qel * tmpF.
Z;
1292 plFx[primsrc] = tmpF.
X;
1293 plFy[primsrc] = tmpF.
Y;
1294 plFz[primsrc] = tmpF.
Z;
1298 double totPot = 0.0;
1300 totF.
X = totF.
Y = totF.
Z = 0.0;
1302 totPot += pPot[prim];
1303 totF.
X += plFx[prim];
1304 totF.
Y += plFy[prim];
1305 totF.
Z += plFz[prim];
1310 *Potential = totPot * InvFourPiEps0;
1311 globalF->X = totF.
X * InvFourPiEps0;
1312 globalF->Y = totF.
Y * InvFourPiEps0;
1313 globalF->Z = totF.
Z * InvFourPiEps0;
1323 printf(
"Final values due to all primitives: ");
1326 printf(
"%lg\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n\n", xfld, yfld, zfld,
1327 (*Potential), globalF->X, globalF->Y, globalF->Z);
1348 tmpPt.
X = globalP->
X;
1349 tmpPt.
Y = globalP->
Y;
1350 tmpPt.
Z = globalP->
Z;
1373 ((
AreaKnChArr + area - 1)->Vertex), tmpPt, &tmpF);
1390 printf(
"Final values due to all known charges: ");
1393 printf(
"%lg\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n\n", tmpPt.
X, tmpPt.
Y, tmpPt.
Z,
1394 (*Potential), globalF->
X, globalF->
Y, globalF->
Z);
1416 printf(
"\nPotential and field computation for voxelized data export\n");
1418 char VoxelFile[256];
1421 strcat(VoxelFile,
"/VoxelFPR.out");
1422 fVoxel = fopen(VoxelFile,
"w");
1423 if (fVoxel == NULL) {
1429 "# X(cm)\tY(cm)\tZ(cm)\tFX(V/cm)\tFY(V/cm)\tFZ(V/cm)\tPot(V)\tRegion\n");
1432 printf(
"VoxelFPR.out created ...\n");
1447 double *VoxelFX, *VoxelFY, *VoxelFZ, *VoxelP;
1448 VoxelFX =
dvector(0, nbZCells + 1);
1449 VoxelFY =
dvector(0, nbZCells + 1);
1450 VoxelFZ =
dvector(0, nbZCells + 1);
1451 VoxelP =
dvector(0, nbZCells + 1);
1454 printf(
"nbXCells, nbYCells, nbZCells: %d, %d, %d\n", nbXCells, nbYCells,
1456 printf(
"startX, startY, startZ: %le, %le, %le\n", startX, startY, startZ);
1457 printf(
"delX, delY, delZ: %le, %le, %le\n", delX, delY, delZ);
1461 for (
int i = 1; i <= nbXCells + 1; ++i) {
1462 for (
int j = 1; j <= nbYCells + 1; ++j) {
1464 printf(
"VoxelFPR => i: %4d, j: %4d", i, j);
1470 int nthreads = 1, tid = 0;
1471 #pragma omp parallel private(nthreads, tid)
1476 tid = omp_get_thread_num();
1478 nthreads = omp_get_num_threads();
1479 printf(
"Starting voxel computation with %d threads\n", nthreads);
1487 #pragma omp for private(k, point, potential, field)
1489 for (k = 1; k <= nbZCells + 1; ++k) {
1491 field.
X = field.
Y = field.
Z = 0.0;
1493 point.
X = startX + (i - 1) * delX;
1494 point.
Y = startY + (j - 1) * delY;
1495 point.
Z = startZ + (k - 1) * delZ;
1498 printf(
"i, j, k: %d, %d, %d\n", i, j, k);
1499 printf(
"point X, Y, Z: %.8lg\t%.8lg\t%.8lg\n",
1505 fstatus =
PFAtPoint(&point, &potential, &field);
1507 neBEMMessage(
"wrong PFAtPoint return value in VoxelFPR\n");
1512 printf(
"%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\n",
1519 VoxelFX[k] = field.
X;
1520 VoxelFY[k] = field.
Y;
1521 VoxelFZ[k] = field.
Z;
1522 VoxelP[k] = potential;
1526 for (
int k = 1; k <= nbZCells + 1; ++k)
1528 point.
X = startX + (i - 1) * delX;
1529 point.
Y = startY + (j - 1) * delY;
1530 point.
Z = startZ + (k - 1) * delZ;
1549 "%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%4d\n",
1552 VoxelFY[k] / 100.0, VoxelFZ[k] / 100.0, VoxelP[k] /
LengthScale,
1578 printf(
"\nPotential and field computation for 3dMap data export\n");
1580 char MapInfoFile[256];
1582 strcat(MapInfoFile,
"/MapInfo.out");
1583 FILE *fMapInfo = fopen(MapInfoFile,
"w");
1584 if (fMapInfo == NULL) {
1589 printf(
"MapInfoFile.out created ...\n");
1598 fprintf(fMapInfo,
"%d\n",
OptMap);
1603 fprintf(fMapInfo,
"%le %le\n",
Map.
Xmin * 100.0,
Map.
Xmax * 100.0);
1604 fprintf(fMapInfo,
"%le %le\n",
Map.
Ymin * 100.0,
Map.
Ymax * 100.0);
1605 fprintf(fMapInfo,
"%le %le\n",
Map.
Zmin * 100.0,
Map.
Zmax * 100.0);
1609 fprintf(fMapInfo,
"MapFPR.out\n");
1615 strcat(MapFile,
"/MapFPR.out");
1616 FILE *fMap = fopen(MapFile,
"w");
1622 printf(
"MapFPR.out created ...\n");
1628 "# X(cm)\tY(cm)\tZ(cm)\tFX(V/cm)\tFY(V/cm)\tFZ(V/cm)\tPot(V)\tRegion\n");
1640 double *MapFX =
dvector(0, nbZCells + 1);
1641 double *MapFY =
dvector(0, nbZCells + 1);
1642 double *MapFZ =
dvector(0, nbZCells + 1);
1643 double *MapP =
dvector(0, nbZCells + 1);
1646 printf(
"nbXCells, nbYCells, nbZCells: %d, %d, %d\n", nbXCells, nbYCells,
1648 printf(
"startX, startY, startZ: %le, %le, %le\n", startX, startY, startZ);
1649 printf(
"delX, delY, delZ: %le, %le, %le\n", delX, delY, delZ);
1653 for (
int i = 1; i <= nbXCells + 1; ++i) {
1654 for (
int j = 1; j <= nbYCells + 1; ++j) {
1656 printf(
"MapFPR => i: %4d, j: %4d", i, j);
1662 int nthreads = 1, tid = 0;
1663 #pragma omp parallel private(nthreads, tid)
1668 tid = omp_get_thread_num();
1670 nthreads = omp_get_num_threads();
1671 printf(
"Starting voxel computation with %d threads\n", nthreads);
1679 #pragma omp for private(k, point, potential, field)
1681 for (k = 1; k <= nbZCells + 1; ++k) {
1682 point.
X = startX + (i - 1) * delX;
1683 point.
Y = startY + (j - 1) * delY;
1684 point.
Z = startZ + (k - 1) * delZ;
1687 printf(
"i, j, k: %d, %d, %d\n", i, j, k);
1688 printf(
"point X, Y, Z: %.8lg\t%.8lg\t%.8lg\n",
1697 neBEMMessage(
"wrong FastPFAtPoint return value in MapFPR\n");
1702 "Suggestion: Use of FastVol can expedite generation of Map.\n");
1703 int fstatus =
PFAtPoint(&point, &potential, &field);
1705 neBEMMessage(
"wrong PFAtPoint return value in MapFPR\n");
1711 printf(
"%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\n",
1721 MapP[k] = potential;
1725 for (
int k = 1; k <= nbZCells + 1; ++k) {
1727 point.
X = startX + (i - 1) * delX;
1728 point.
Y = startY + (j - 1) * delY;
1729 point.
Z = startZ + (k - 1) * delZ;
1746 fprintf(fMap,
"%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%4d\n",
1749 MapFY[k] / 100.0, MapFZ[k] / 100.0, MapP[k] /
LengthScale,
1765 char StgrMapFile[256];
1767 strcat(StgrMapFile,
"/StgrMapFPR.out");
1768 fMap = fopen(StgrMapFile,
"w");
1774 printf(
"StgrMapFPR.out created ...\n");
1781 "X(cm)\tY(cm)\tZ(cm)\tFX(V/cm)\tFY(V/cm)\tFZ(V/cm)\tPot(V)\tRegion\n");
1800 MapFX =
dvector(0, nbZCells + 1);
1801 MapFY =
dvector(0, nbZCells + 1);
1802 MapFZ =
dvector(0, nbZCells + 1);
1803 MapP =
dvector(0, nbZCells + 1);
1806 printf(
"nbXCells, nbYCells, nbZCells: %d, %d, %d\n", nbXCells, nbYCells,
1808 printf(
"startX, startY, startZ: %le, %le, %le\n", startX, startY, startZ);
1809 printf(
"delX, delY, delZ: %le, %le, %le\n", delX, delY, delZ);
1813 for (
int i = 1; i <= nbXCells + 1; ++i) {
1814 for (
int j = 1; j <= nbYCells + 1; ++j) {
1816 printf(
"StgrMapFPR => i: %4d, j: %4d", i, j);
1822 int nthreads = 1, tid = 0;
1823 #pragma omp parallel private(nthreads, tid)
1828 tid = omp_get_thread_num();
1830 nthreads = omp_get_num_threads();
1831 printf(
"Starting voxel computation with %d threads\n", nthreads);
1839 #pragma omp for private(k, point, potential, field)
1841 for (k = 1; k <= nbZCells + 1; ++k) {
1842 point.
X = startX + (i - 1) * delX;
1843 point.
Y = startY + (j - 1) * delY;
1844 point.
Z = startZ + (k - 1) * delZ;
1847 printf(
"i, j, k: %d, %d, %d\n", i, j, k);
1848 printf(
"point X, Y, Z: %.8lg\t%.8lg\t%.8lg\n",
1857 neBEMMessage(
"wrong FastPFAtPoint return value in MapFPR\n");
1862 "Suggestion: Use of FastVol can expedite generation of "
1864 int fstatus =
PFAtPoint(&point, &potential, &field);
1866 neBEMMessage(
"wrong PFAtPoint return value in MapFPR\n");
1872 printf(
"%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\n",
1882 MapP[k] = potential;
1886 for (
int k = 1; k <= nbZCells + 1; ++k) {
1888 point.
X = startX + (i - 1) * delX;
1889 point.
Y = startY + (j - 1) * delY;
1890 point.
Z = startZ + (k - 1) * delZ;
1908 fMap,
"%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%4d\n",
1910 100.0 * point.
Z /
LengthScale, MapFX[k] / 100.0, MapFY[k] / 100.0,
1911 MapFZ[k] / 100.0, MapP[k] /
LengthScale, ivol + 1);
1938 "Problem in FastVolElePF being called from FastVolPF ... returning\n");
1978 printf(
"\nPotential and field computation within basic fast volume\n");
1979 int bskip = 0, iskip = 0, jskip = 0, kskip = 0;
1983 int volptcnt = 0, endskip = 0;
1989 for (
int i = 1; i <= nbXCells + 1; ++i) {
1990 for (
int j = 1; j <= nbYCells + 1; ++j) {
1991 for (
int k = 1; k <= nbZCells + 1; ++k) {
2012 "Basic fast volume => bskip, iskip, jskip, kskip: %d, %d, %d, %d\n",
2013 bskip, iskip, jskip, kskip);
2017 char FastVolPFFile[256];
2020 strcat(FastVolPFFile,
"/FastVolPF.out");
2021 fFastVolPF = fopen(FastVolPFFile,
"w");
2022 if (fFastVolPF == NULL) {
2026 fprintf(fFastVolPF,
"#block\tX\tY\tZ\tPot\tFX\tFY\tFZ\n");
2029 printf(
"FastVolPF.out created ...\n");
2042 delZ =
BlkLZ[block] / nbZCells;
2044 "NbBlocks: %d, block: %d, nbXCells: %d, nbYCells: %d, nbZCells: %d\n",
2048 printf(
"block: %d\n", block);
2049 printf(
"nbXCells, nbYCells, nbZCells: %d, %d, %d\n", nbXCells, nbYCells,
2051 printf(
"startX, startY, startZ: %le, %le, %le\n", startX, startY, startZ);
2052 printf(
"delX, delY, delZ: %le, %le, %le\n", delX, delY, delZ);
2053 printf(
"bskip, iskip, jskip, kskip: %d, %d, %d, %d\n", bskip, iskip,
2059 for (
int i = 1 + iskip; i <= nbXCells + 1; ++i) {
2060 for (
int j = 1 + jskip; j <= nbYCells + 1; ++j) {
2061 printf(
"Fast volume => block: %3d, i: %4d, j: %4d", block, i, j);
2066 int nthreads = 1, tid = 0;
2067 #pragma omp parallel private(nthreads, tid)
2072 tid = omp_get_thread_num();
2074 nthreads = omp_get_num_threads();
2075 printf(
"Starting fast volume computation with %d threads\n",
2085 #pragma omp for private(k, point, omitFlag, potential, field)
2087 for (k = 1 + kskip; k <= nbZCells + 1; ++k) {
2089 field.
X = field.
Y = field.
Z = 0.0;
2091 point.
X = startX + (i - 1) * delX;
2092 point.
Y = startY + (j - 1) * delY;
2093 point.
Z = startZ + (k - 1) * delZ;
2111 printf(
"block, i, j, k: %d, %d, %d, %d\n", block, i, j, k);
2112 printf(
"point X, Y, Z: %.8lg\t%.8lg\t%.8lg\n",
2115 printf(
"omitFlag: %d\n", omitFlag);
2120 potential = field.
X = field.
Y = field.
Z = 0.0;
2127 "wrong ElePFAtPoint return value in FastVolElePF.\n");
2132 printf(
"%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\n",
2139 FastPot[block][i][j][k] = potential;
2140 FastFX[block][i][j][k] = field.
X;
2141 FastFY[block][i][j][k] = field.
Y;
2142 FastFZ[block][i][j][k] = field.
Z;
2146 for (
int k = 1 + kskip; k <= nbZCells + 1; ++k)
2148 point.
X = startX + (i - 1) * delX;
2149 point.
Y = startY + (j - 1) * delY;
2150 point.
Z = startZ + (k - 1) * delZ;
2153 "%4d\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\n",
2162 "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"
2163 "\b\b\b\b\b\b\b\b\b\b");
2171 printf(
"Potential and field computation within staggered fast volume\n");
2173 bskip = iskip = jskip = kskip = 0;
2177 int volptcnt = 0, endskip = 0;
2183 for (
int i = 1; i <= nbXCells + 1; ++i) {
2184 for (
int j = 1; j <= nbYCells + 1; ++j) {
2185 for (
int k = 1; k <= nbZCells + 1; ++k) {
2206 "Staggered volume => bskip, iskip, jskip, kskip: %d, %d, %d, %d\n",
2207 bskip, iskip, jskip, kskip);
2211 char FastStgVolPFFile[256];
2212 FILE *fFastStgVolPF;
2213 strcpy(FastStgVolPFFile,
BCOutDir);
2214 strcat(FastStgVolPFFile,
"/FastStgVolPF.out");
2215 fFastStgVolPF = fopen(FastStgVolPFFile,
"w");
2216 if (fFastStgVolPF == NULL) {
2220 fprintf(fFastStgVolPF,
"#block\tX\tY\tZ\tPot\tFX\tFY\tFZ\n");
2223 printf(
"FastStgVolPF.out created ...\n");
2236 delZ =
BlkLZ[block] / nbZCells;
2238 "NbBlocks: %d, block: %d, nbXCells: %d, nbYCells: %d, nbZCells: %d\n",
2242 printf(
"block: %d\n", block);
2243 printf(
"nbXCells, nbYCells, nbZCells: %d, %d, %d\n", nbXCells, nbYCells,
2245 printf(
"startX, startY, startZ: %le, %le, %le\n", startX, startY,
2247 printf(
"delX, delY, delZ: %le, %le, %le\n", delX, delY, delZ);
2248 printf(
"bskip, iskip, jskip, kskip: %d, %d, %d, %d\n", bskip, iskip,
2254 for (
int i = 1 + iskip; i <= nbXCells + 1; ++i) {
2255 for (
int j = 1 + jskip; j <= nbYCells + 1; ++j) {
2256 printf(
"Fast volume => block: %3d, i: %4d, j: %4d", block, i, j);
2261 int nthreads = 1, tid = 0;
2262 #pragma omp parallel private(nthreads, tid)
2267 tid = omp_get_thread_num();
2269 nthreads = omp_get_num_threads();
2271 "Starting staggered fast volume computation with %d "
2282 #pragma omp for private(k, point, omitFlag, potential, field)
2284 for (k = 1 + kskip; k <= nbZCells + 1; ++k) {
2286 field.
X = field.
Y = field.
Z = 0.0;
2288 point.
X = startX + (i - 1) * delX;
2289 point.
Y = startY + (j - 1) * delY;
2290 point.
Z = startZ + (k - 1) * delZ;
2310 printf(
"point X, Y, Z: %.8lg\t%.8lg\t%.8lg\n",
2313 printf(
"omitFlag: %d\n", omitFlag);
2318 potential = field.
X = field.
Y = field.
Z = 0.0;
2325 "wrong PFAtPoint return value in FastVolElePF.\n");
2330 printf(
"%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\n",
2344 for (
int k = 1 + kskip; k <= nbZCells + 1; ++k)
2346 point.
X = startX + (i - 1) * delX;
2347 point.
Y = startY + (j - 1) * delY;
2348 point.
Z = startZ + (k - 1) * delZ;
2350 fprintf(fFastStgVolPF,
2351 "%4d\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\t%.8lg\n",
2357 fflush(fFastStgVolPF);
2360 "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"
2361 "\b\b\b\b\b\b\b\b\b\b\b");
2366 fclose(fFastStgVolPF);
2823 double Xpt = globalP->
X;
2824 double Ypt = globalP->
Y;
2825 double Zpt = globalP->
Z;
2832 double TriLin(
double xd,
double yd,
double zd,
double c000,
double c100,
2833 double c010,
double c001,
double c110,
double c101,
double c011,
2848 neBEMMessage(
"In FastPFAtPoint: point in an ignored volume!\n");
2850 int fstatus =
PFAtPoint(globalP, Potential, globalF);
2852 neBEMMessage(
"wrong PFAtPoint return value in FastVolPF.\n");
2866 printf(
"\nin FastPFAtPoint\n");
2867 printf(
"x, y, z: %g, %g, %g\n", Xpt, Ypt, Zpt);
2868 printf(
"RptVolLX, RptVolLY, RptVolLZ: %g, %g, %g\n", RptVolLX, RptVolLY,
2870 printf(
"CornerX, CornerY, CornerZ: %g, %g, %g\n", CornerX, CornerY,
2877 printf(
"LZ: %le\n",
BlkLZ[block]);
2878 printf(
"CornerZ: %le\n",
BlkCrnrZ[block]);
2884 double dx = Xpt - CornerX;
2885 double dy = Ypt - CornerY;
2886 double dz = Zpt - CornerZ;
2888 printf(
"real dx, dy, dz from volume corner: %g, %g, %g\n", dx, dy, dz);
2890 int NbFastVolX = (int)(dx / RptVolLX);
2891 if (dx < 0.0) --NbFastVolX;
2892 int NbFastVolY = (int)(dy / RptVolLY);
2893 if (dy < 0.0) --NbFastVolY;
2894 int NbFastVolZ = (int)(dz / RptVolLZ);
2895 if (dz < 0.0) --NbFastVolZ;
2897 printf(
"Volumes in x, y, z: %d, %d, %d\n", NbFastVolX, NbFastVolY,
2901 dx -= NbFastVolX * RptVolLX;
2902 dy -= NbFastVolY * RptVolLY;
2903 dz -= NbFastVolZ * RptVolLZ;
2917 if (dx > RptVolLX) {
2921 if (dy > RptVolLY) {
2925 if (dz > RptVolLZ) {
2930 printf(
"equivalent dist from corner - dx, dy, dz: %g, %g, %g\n", dx, dy,
2937 if ((RptVolLX - dx) <
MINDIST)
2948 printf(
"equivalent dist adjusted - dx, dy, dz: %g, %g, %g\n", dx, dy, dz);
2972 if ((dx >= 0.0) && (dx <=
FastVol.
LX) && (dy >= 0.0) &&
3003 neBEMMessage(
"FastPFAtPoint: point in none of the sectors!\n");
3005 if (dbgFn) printf(
"stagger modified dx, dy, dz: %g, %g, %g\n", dx, dy, dz);
3012 if ((RptVolLX - dx) <
MINDIST)
3023 printf(
"equivalent dist adjusted for staggered: %g, %g, %g\n", dx, dy, dz);
3072 double blkBtmZ =
BlkCrnrZ[block] - CornerZ;
3073 double blkTopZ = blkBtmZ +
BlkLZ[block];
3075 printf(
"block, dz, blkBtmZ, blkTopZ: %d, %lg, %lg, %lg\n", block, dz,
3080 if ((dz <= blkBtmZ) && ((blkBtmZ - dz) <
MINDIST)) dz = blkBtmZ -
MINDIST;
3081 if ((dz >= blkBtmZ) && ((dz - blkBtmZ) <
MINDIST)) dz = blkBtmZ +
MINDIST;
3082 if ((dz <= blkTopZ) && ((blkTopZ - dz) <
MINDIST)) dz = blkTopZ -
MINDIST;
3083 if ((dz >= blkTopZ) && ((dz - blkTopZ) <
MINDIST)) dz = blkTopZ +
MINDIST;
3085 if ((dz >= blkBtmZ) && (dz <= blkTopZ)) {
3091 neBEMMessage(
"FastPFAtPoint: point in none of the blocks!\n");
3099 double delZ =
BlkLZ[thisBlock] / nbZCells;
3100 dz -= (
BlkCrnrZ[thisBlock] - CornerZ);
3103 printf(
"thisBlock: %d\n", thisBlock);
3104 printf(
"nbXCells, nbYCells, nbZCells: %d, %d, %d\n", nbXCells, nbYCells,
3106 printf(
"BlkCrnrZ: %lg\n",
BlkCrnrZ[thisBlock]);
3107 printf(
"delX, delY, delZ: %le, %le, %le\n", delX, delY, delZ);
3108 printf(
"dz: %lg\n", dz);
3113 int celli = (int)(dx / delX) + 1;
3119 if (celli > nbXCells) {
3124 int cellj = (int)(dy / delY) + 1;
3130 if (cellj > nbYCells) {
3135 int cellk = (int)(dz / delZ) + 1;
3141 if (cellk > nbZCells) {
3146 if (dbgFn) printf(
"Cells in x, y, z: %d, %d, %d\n", celli, cellj, cellk);
3155 double dxcellcrnr = dx - (double)(celli - 1) * delX;
3156 double dycellcrnr = dy - (double)(cellj - 1) * delY;
3157 double dzcellcrnr = dz - (double)(cellk - 1) * delZ;
3159 printf(
"cell crnr dx, dy, dz: %g, %g, %g\n", dxcellcrnr, dycellcrnr,
3163 double xd = dxcellcrnr / delX;
3164 double yd = dycellcrnr / delY;
3165 double zd = dzcellcrnr / delZ;
3166 if (xd <= 0.0) xd = 0.0;
3167 if (yd <= 0.0) yd = 0.0;
3168 if (zd <= 0.0) zd = 0.0;
3169 if (xd >= 1.0) xd = 1.0;
3170 if (yd >= 1.0) yd = 1.0;
3171 if (zd >= 1.0) zd = 1.0;
3174 double P000 =
FastPot[thisBlock][celli][cellj][cellk];
3175 double FX000 =
FastFX[thisBlock][celli][cellj][cellk];
3176 double FY000 =
FastFY[thisBlock][celli][cellj][cellk];
3177 double FZ000 =
FastFZ[thisBlock][celli][cellj][cellk];
3178 double P100 =
FastPot[thisBlock][celli + 1][cellj][cellk];
3179 double FX100 =
FastFX[thisBlock][celli + 1][cellj][cellk];
3180 double FY100 =
FastFY[thisBlock][celli + 1][cellj][cellk];
3181 double FZ100 =
FastFZ[thisBlock][celli + 1][cellj][cellk];
3182 double P010 =
FastPot[thisBlock][celli][cellj + 1][cellk];
3183 double FX010 =
FastFX[thisBlock][celli][cellj + 1][cellk];
3184 double FY010 =
FastFY[thisBlock][celli][cellj + 1][cellk];
3185 double FZ010 =
FastFZ[thisBlock][celli][cellj + 1][cellk];
3186 double P001 =
FastPot[thisBlock][celli][cellj][cellk + 1];
3187 double FX001 =
FastFX[thisBlock][celli][cellj][cellk + 1];
3188 double FY001 =
FastFY[thisBlock][celli][cellj][cellk + 1];
3189 double FZ001 =
FastFZ[thisBlock][celli][cellj][cellk + 1];
3190 double P110 =
FastPot[thisBlock][celli + 1][cellj + 1][cellk];
3191 double FX110 =
FastFX[thisBlock][celli + 1][cellj + 1][cellk];
3192 double FY110 =
FastFY[thisBlock][celli + 1][cellj + 1][cellk];
3193 double FZ110 =
FastFZ[thisBlock][celli + 1][cellj + 1][cellk];
3194 double P101 =
FastPot[thisBlock][celli + 1][cellj][cellk + 1];
3195 double FX101 =
FastFX[thisBlock][celli + 1][cellj][cellk + 1];
3196 double FY101 =
FastFY[thisBlock][celli + 1][cellj][cellk + 1];
3197 double FZ101 =
FastFZ[thisBlock][celli + 1][cellj][cellk + 1];
3198 double P011 =
FastPot[thisBlock][celli][cellj + 1][cellk + 1];
3199 double FX011 =
FastFX[thisBlock][celli][cellj + 1][cellk + 1];
3200 double FY011 =
FastFY[thisBlock][celli][cellj + 1][cellk + 1];
3201 double FZ011 =
FastFZ[thisBlock][celli][cellj + 1][cellk + 1];
3202 double P111 =
FastPot[thisBlock][celli + 1][cellj + 1][cellk + 1];
3203 double FX111 =
FastFX[thisBlock][celli + 1][cellj + 1][cellk + 1];
3204 double FY111 =
FastFY[thisBlock][celli + 1][cellj + 1][cellk + 1];
3205 double FZ111 =
FastFZ[thisBlock][celli + 1][cellj + 1][cellk + 1];
3212 P000 =
FastStgPot[thisBlock][celli][cellj][cellk];
3213 FX000 =
FastStgFX[thisBlock][celli][cellj][cellk];
3214 FY000 =
FastStgFY[thisBlock][celli][cellj][cellk];
3215 FZ000 =
FastStgFZ[thisBlock][celli][cellj][cellk];
3216 P100 =
FastStgPot[thisBlock][celli + 1][cellj][cellk];
3217 FX100 =
FastStgFX[thisBlock][celli + 1][cellj][cellk];
3218 FY100 =
FastStgFY[thisBlock][celli + 1][cellj][cellk];
3219 FZ100 =
FastStgFZ[thisBlock][celli + 1][cellj][cellk];
3220 P010 =
FastStgPot[thisBlock][celli][cellj + 1][cellk];
3221 FX010 =
FastStgFX[thisBlock][celli][cellj + 1][cellk];
3222 FY010 =
FastStgFY[thisBlock][celli][cellj + 1][cellk];
3223 FZ010 =
FastStgFZ[thisBlock][celli][cellj + 1][cellk];
3224 P001 =
FastStgPot[thisBlock][celli][cellj][cellk + 1];
3225 FX001 =
FastStgFX[thisBlock][celli][cellj][cellk + 1];
3226 FY001 =
FastStgFY[thisBlock][celli][cellj][cellk + 1];
3227 FZ001 =
FastStgFZ[thisBlock][celli][cellj][cellk + 1];
3228 P110 =
FastStgPot[thisBlock][celli + 1][cellj + 1][cellk];
3229 FX110 =
FastStgFX[thisBlock][celli + 1][cellj + 1][cellk];
3230 FY110 =
FastStgFY[thisBlock][celli + 1][cellj + 1][cellk];
3231 FZ110 =
FastStgFZ[thisBlock][celli + 1][cellj + 1][cellk];
3232 P101 =
FastStgPot[thisBlock][celli + 1][cellj][cellk + 1];
3233 FX101 =
FastStgFX[thisBlock][celli + 1][cellj][cellk + 1];
3234 FY101 =
FastStgFY[thisBlock][celli + 1][cellj][cellk + 1];
3235 FZ101 =
FastStgFZ[thisBlock][celli + 1][cellj][cellk + 1];
3236 P011 =
FastStgPot[thisBlock][celli][cellj + 1][cellk + 1];
3237 FX011 =
FastStgFX[thisBlock][celli][cellj + 1][cellk + 1];
3238 FY011 =
FastStgFY[thisBlock][celli][cellj + 1][cellk + 1];
3239 FZ011 =
FastStgFZ[thisBlock][celli][cellj + 1][cellk + 1];
3240 P111 =
FastStgPot[thisBlock][celli + 1][cellj + 1][cellk + 1];
3241 FX111 =
FastStgFX[thisBlock][celli + 1][cellj + 1][cellk + 1];
3242 FY111 =
FastStgFY[thisBlock][celli + 1][cellj + 1][cellk + 1];
3243 FZ111 =
FastStgFZ[thisBlock][celli + 1][cellj + 1][cellk + 1];
3246 P000 =
FastStgPot[thisBlock][celli][cellj][cellk];
3247 FX000 =
FastStgFX[thisBlock][celli][cellj][cellk];
3248 FY000 =
FastStgFY[thisBlock][celli][cellj][cellk];
3249 FZ000 =
FastStgFZ[thisBlock][celli][cellj][cellk];
3250 P100 =
FastStgPot[thisBlock][celli + 1][cellj][cellk];
3251 FX100 =
FastStgFX[thisBlock][celli + 1][cellj][cellk];
3252 FY100 =
FastStgFY[thisBlock][celli + 1][cellj][cellk];
3253 FZ100 =
FastStgFZ[thisBlock][celli + 1][cellj][cellk];
3254 P010 =
FastStgPot[thisBlock][celli][cellj + 1][cellk];
3255 FX010 =
FastStgFX[thisBlock][celli][cellj + 1][cellk];
3256 FY010 =
FastStgFY[thisBlock][celli][cellj + 1][cellk];
3257 FZ010 =
FastStgFZ[thisBlock][celli][cellj + 1][cellk];
3258 P001 =
FastStgPot[thisBlock][celli][cellj][cellk + 1];
3259 FX001 =
FastStgFX[thisBlock][celli][cellj][cellk + 1];
3260 FY001 =
FastStgFY[thisBlock][celli][cellj][cellk + 1];
3261 FZ001 =
FastStgFZ[thisBlock][celli][cellj][cellk + 1];
3262 P110 =
FastStgPot[thisBlock][celli + 1][cellj + 1][cellk];
3263 FX110 =
FastStgFX[thisBlock][celli + 1][cellj + 1][cellk];
3264 FY110 =
FastStgFY[thisBlock][celli + 1][cellj + 1][cellk];
3265 FZ110 =
FastStgFZ[thisBlock][celli + 1][cellj + 1][cellk];
3266 P101 =
FastStgPot[thisBlock][celli + 1][cellj][cellk + 1];
3267 FX101 =
FastStgFX[thisBlock][celli + 1][cellj][cellk + 1];
3268 FY101 =
FastStgFY[thisBlock][celli + 1][cellj][cellk + 1];
3269 FZ101 =
FastStgFZ[thisBlock][celli + 1][cellj][cellk + 1];
3270 P011 =
FastStgPot[thisBlock][celli][cellj + 1][cellk + 1];
3271 FX011 =
FastStgFX[thisBlock][celli][cellj + 1][cellk + 1];
3272 FY011 =
FastStgFY[thisBlock][celli][cellj + 1][cellk + 1];
3273 FZ011 =
FastStgFZ[thisBlock][celli][cellj + 1][cellk + 1];
3274 P111 =
FastStgPot[thisBlock][celli + 1][cellj + 1][cellk + 1];
3275 FX111 =
FastStgFX[thisBlock][celli + 1][cellj + 1][cellk + 1];
3276 FY111 =
FastStgFY[thisBlock][celli + 1][cellj + 1][cellk + 1];
3277 FZ111 =
FastStgFZ[thisBlock][celli + 1][cellj + 1][cellk + 1];
3282 TriLin(xd, yd, zd, P000, P100, P010, P001, P110, P101, P011, P111);
3283 double intFX =
TriLin(xd, yd, zd, FX000, FX100, FX010, FX001, FX110, FX101,
3285 double intFY =
TriLin(xd, yd, zd, FY000, FY100, FY010, FY001, FY110, FY101,
3287 double intFZ =
TriLin(xd, yd, zd, FZ000, FZ100, FZ010, FZ001, FZ110, FZ101,
3296 printf(
"Cell corner values:\n");
3297 printf(
"Potential: %g, %g, %g, %g\n", P000, P100, P010, P001);
3298 printf(
"Potential: %g, %g, %g, %g\n", P110, P101, P011, P111);
3299 printf(
"FastFX: %g, %g, %g, %g\n", FX000, FX100, FX010, FX001);
3300 printf(
"FastFX: %g, %g, %g, %g\n", FX110, FX101, FX011, FX111);
3301 printf(
"FastFY: %g, %g, %g, %g\n", FY000, FY100, FY010, FY001);
3302 printf(
"FastFY: %g, %g, %g, %g\n", FY110, FY101, FY011, FY111);
3303 printf(
"FastFZ: %g, %g, %g, %g\n", FZ000, FZ100, FZ010, FZ001);
3304 printf(
"FastFZ: %g, %g, %g, %g\n", FZ110, FZ101, FZ011, FZ111);
3305 printf(
"Pot, FX, FY, FZ: %g, %g, %g, %g\n", *Potential, globalF->
X,
3306 globalF->
Y, globalF->
Z);
3310 printf(
"out FastPFAtPoint\n");
3328 double Xpt = globalP->
X;
3329 double Ypt = globalP->
Y;
3330 double Zpt = globalP->
Z;
3337 double TriLin(
double xd,
double yd,
double zd,
double c000,
double c100,
3338 double c010,
double c001,
double c110,
double c101,
double c011,
3353 neBEMMessage(
"In FastKnChPFAtPoint: point in an ignored volume!\n");
3357 neBEMMessage(
"wrong KnChPFAtPoint return value in FastVolKnChPF.\n");
3371 printf(
"\nin FastKnChPFAtPoint\n");
3372 printf(
"x, y, z: %g, %g, %g\n", Xpt, Ypt, Zpt);
3373 printf(
"RptVolLX, RptVolLY, RptVolLZ: %g, %g, %g\n", RptVolLX, RptVolLY,
3375 printf(
"CornerX, CornerY, CornerZ: %g, %g, %g\n", CornerX, CornerY,
3382 printf(
"LZ: %le\n",
BlkLZ[block]);
3383 printf(
"CornerZ: %le\n",
BlkCrnrZ[block]);
3389 double dx = Xpt - CornerX;
3390 double dy = Ypt - CornerY;
3391 double dz = Zpt - CornerZ;
3393 printf(
"real dx, dy, dz from volume corner: %g, %g, %g\n", dx, dy, dz);
3395 int NbFastVolX = (int)(dx / RptVolLX);
3396 if (dx < 0.0) --NbFastVolX;
3397 int NbFastVolY = (int)(dy / RptVolLY);
3398 if (dy < 0.0) --NbFastVolY;
3399 int NbFastVolZ = (int)(dz / RptVolLZ);
3400 if (dz < 0.0) --NbFastVolZ;
3402 printf(
"Volumes in x, y, z: %d, %d, %d\n", NbFastVolX, NbFastVolY,
3406 dx -= NbFastVolX * RptVolLX;
3407 dy -= NbFastVolY * RptVolLY;
3408 dz -= NbFastVolZ * RptVolLZ;
3422 if (dx > RptVolLX) {
3426 if (dy > RptVolLY) {
3430 if (dz > RptVolLZ) {
3435 printf(
"equivalent dist from corner - dx, dy, dz: %g, %g, %g\n", dx, dy,
3442 if ((RptVolLX - dx) <
MINDIST)
3453 printf(
"equivalent dist adjusted - dx, dy, dz: %g, %g, %g\n", dx, dy, dz);
3477 if ((dx >= 0.0) && (dx <=
FastVol.
LX) && (dy >= 0.0) &&
3508 neBEMMessage(
"FastKnChPFAtPoint: point in none of the sectors!\n");
3510 if (dbgFn) printf(
"stagger modified dx, dy, dz: %g, %g, %g\n", dx, dy, dz);
3517 if ((RptVolLX - dx) <
MINDIST)
3528 printf(
"equivalent dist adjusted for staggered: %g, %g, %g\n", dx, dy, dz);
3575 double blkBtmZ =
BlkCrnrZ[block] - CornerZ;
3576 double blkTopZ = blkBtmZ +
BlkLZ[block];
3578 printf(
"block, dz, blkBtmZ, blkTopZ: %d, %lg, %lg, %lg\n", block, dz,
3583 if ((dz <= blkBtmZ) && ((blkBtmZ - dz) <
MINDIST)) dz = blkBtmZ -
MINDIST;
3584 if ((dz >= blkBtmZ) && ((dz - blkBtmZ) <
MINDIST)) dz = blkBtmZ +
MINDIST;
3585 if ((dz <= blkTopZ) && ((blkTopZ - dz) <
MINDIST)) dz = blkTopZ -
MINDIST;
3586 if ((dz >= blkTopZ) && ((dz - blkTopZ) <
MINDIST)) dz = blkTopZ +
MINDIST;
3588 if ((dz >= blkBtmZ) && (dz <= blkTopZ)) {
3594 neBEMMessage(
"FastKnChPFAtPoint: point in none of the blocks!\n");
3602 double delZ =
BlkLZ[thisBlock] / nbZCells;
3603 dz -= (
BlkCrnrZ[thisBlock] - CornerZ);
3606 printf(
"thisBlock: %d\n", thisBlock);
3607 printf(
"nbXCells, nbYCells, nbZCells: %d, %d, %d\n", nbXCells, nbYCells,
3609 printf(
"BlkCrnrZ: %lg\n",
BlkCrnrZ[thisBlock]);
3610 printf(
"delX, delY, delZ: %le, %le, %le\n", delX, delY, delZ);
3611 printf(
"dz: %lg\n", dz);
3616 int celli = (int)(dx / delX) + 1;
3622 if (celli > nbXCells) {
3625 neBEMMessage(
"FastKnChPFAtPoint - celli > nbXCells\n");
3627 int cellj = (int)(dy / delY) + 1;
3633 if (cellj > nbYCells) {
3636 neBEMMessage(
"FastKnChPFAtPoint - cellj > nbYCells\n");
3638 int cellk = (int)(dz / delZ) + 1;
3644 if (cellk > nbZCells) {
3647 neBEMMessage(
"FastKnChPFAtPoint - cellk > nbZCells\n");
3649 if (dbgFn) printf(
"Cells in x, y, z: %d, %d, %d\n", celli, cellj, cellk);
3658 double dxcellcrnr = dx - (double)(celli - 1) * delX;
3659 double dycellcrnr = dy - (double)(cellj - 1) * delY;
3660 double dzcellcrnr = dz - (double)(cellk - 1) * delZ;
3662 printf(
"cell crnr dx, dy, dz: %g, %g, %g\n", dxcellcrnr, dycellcrnr,
3666 double xd = dxcellcrnr / delX;
3667 double yd = dycellcrnr / delY;
3668 double zd = dzcellcrnr / delZ;
3669 if (xd <= 0.0) xd = 0.0;
3670 if (yd <= 0.0) yd = 0.0;
3671 if (zd <= 0.0) zd = 0.0;
3672 if (xd >= 1.0) xd = 1.0;
3673 if (yd >= 1.0) yd = 1.0;
3674 if (zd >= 1.0) zd = 1.0;
3677 double P000 =
FastPotKnCh[thisBlock][celli][cellj][cellk];
3678 double FX000 =
FastFXKnCh[thisBlock][celli][cellj][cellk];
3679 double FY000 =
FastFYKnCh[thisBlock][celli][cellj][cellk];
3680 double FZ000 =
FastFZKnCh[thisBlock][celli][cellj][cellk];
3681 double P100 =
FastPotKnCh[thisBlock][celli + 1][cellj][cellk];
3682 double FX100 =
FastFXKnCh[thisBlock][celli + 1][cellj][cellk];
3683 double FY100 =
FastFYKnCh[thisBlock][celli + 1][cellj][cellk];
3684 double FZ100 =
FastFZKnCh[thisBlock][celli + 1][cellj][cellk];
3685 double P010 =
FastPotKnCh[thisBlock][celli][cellj + 1][cellk];
3686 double FX010 =
FastFXKnCh[thisBlock][celli][cellj + 1][cellk];
3687 double FY010 =
FastFYKnCh[thisBlock][celli][cellj + 1][cellk];
3688 double FZ010 =
FastFZKnCh[thisBlock][celli][cellj + 1][cellk];
3689 double P001 =
FastPotKnCh[thisBlock][celli][cellj][cellk + 1];
3690 double FX001 =
FastFXKnCh[thisBlock][celli][cellj][cellk + 1];
3691 double FY001 =
FastFYKnCh[thisBlock][celli][cellj][cellk + 1];
3692 double FZ001 =
FastFZKnCh[thisBlock][celli][cellj][cellk + 1];
3693 double P110 =
FastPotKnCh[thisBlock][celli + 1][cellj + 1][cellk];
3694 double FX110 =
FastFXKnCh[thisBlock][celli + 1][cellj + 1][cellk];
3695 double FY110 =
FastFYKnCh[thisBlock][celli + 1][cellj + 1][cellk];
3696 double FZ110 =
FastFZKnCh[thisBlock][celli + 1][cellj + 1][cellk];
3697 double P101 =
FastPotKnCh[thisBlock][celli + 1][cellj][cellk + 1];
3698 double FX101 =
FastFXKnCh[thisBlock][celli + 1][cellj][cellk + 1];
3699 double FY101 =
FastFYKnCh[thisBlock][celli + 1][cellj][cellk + 1];
3700 double FZ101 =
FastFZKnCh[thisBlock][celli + 1][cellj][cellk + 1];
3701 double P011 =
FastPotKnCh[thisBlock][celli][cellj + 1][cellk + 1];
3702 double FX011 =
FastFXKnCh[thisBlock][celli][cellj + 1][cellk + 1];
3703 double FY011 =
FastFYKnCh[thisBlock][celli][cellj + 1][cellk + 1];
3704 double FZ011 =
FastFZKnCh[thisBlock][celli][cellj + 1][cellk + 1];
3705 double P111 =
FastPotKnCh[thisBlock][celli + 1][cellj + 1][cellk + 1];
3706 double FX111 =
FastFXKnCh[thisBlock][celli + 1][cellj + 1][cellk + 1];
3707 double FY111 =
FastFYKnCh[thisBlock][celli + 1][cellj + 1][cellk + 1];
3708 double FZ111 =
FastFZKnCh[thisBlock][celli + 1][cellj + 1][cellk + 1];
3732 FX110 =
FastStgFXKnCh[thisBlock][celli + 1][cellj + 1][cellk];
3733 FY110 =
FastStgFYKnCh[thisBlock][celli + 1][cellj + 1][cellk];
3734 FZ110 =
FastStgFZKnCh[thisBlock][celli + 1][cellj + 1][cellk];
3736 FX101 =
FastStgFXKnCh[thisBlock][celli + 1][cellj][cellk + 1];
3737 FY101 =
FastStgFYKnCh[thisBlock][celli + 1][cellj][cellk + 1];
3738 FZ101 =
FastStgFZKnCh[thisBlock][celli + 1][cellj][cellk + 1];
3740 FX011 =
FastStgFXKnCh[thisBlock][celli][cellj + 1][cellk + 1];
3741 FY011 =
FastStgFYKnCh[thisBlock][celli][cellj + 1][cellk + 1];
3742 FZ011 =
FastStgFZKnCh[thisBlock][celli][cellj + 1][cellk + 1];
3743 P111 =
FastStgPotKnCh[thisBlock][celli + 1][cellj + 1][cellk + 1];
3744 FX111 =
FastStgFXKnCh[thisBlock][celli + 1][cellj + 1][cellk + 1];
3745 FY111 =
FastStgFYKnCh[thisBlock][celli + 1][cellj + 1][cellk + 1];
3746 FZ111 =
FastStgFZKnCh[thisBlock][celli + 1][cellj + 1][cellk + 1];
3766 FX110 =
FastStgFXKnCh[thisBlock][celli + 1][cellj + 1][cellk];
3767 FY110 =
FastStgFYKnCh[thisBlock][celli + 1][cellj + 1][cellk];
3768 FZ110 =
FastStgFZKnCh[thisBlock][celli + 1][cellj + 1][cellk];
3770 FX101 =
FastStgFXKnCh[thisBlock][celli + 1][cellj][cellk + 1];
3771 FY101 =
FastStgFYKnCh[thisBlock][celli + 1][cellj][cellk + 1];
3772 FZ101 =
FastStgFZKnCh[thisBlock][celli + 1][cellj][cellk + 1];
3774 FX011 =
FastStgFXKnCh[thisBlock][celli][cellj + 1][cellk + 1];
3775 FY011 =
FastStgFYKnCh[thisBlock][celli][cellj + 1][cellk + 1];
3776 FZ011 =
FastStgFZKnCh[thisBlock][celli][cellj + 1][cellk + 1];
3777 P111 =
FastStgPotKnCh[thisBlock][celli + 1][cellj + 1][cellk + 1];
3778 FX111 =
FastStgFXKnCh[thisBlock][celli + 1][cellj + 1][cellk + 1];
3779 FY111 =
FastStgFYKnCh[thisBlock][celli + 1][cellj + 1][cellk + 1];
3780 FZ111 =
FastStgFZKnCh[thisBlock][celli + 1][cellj + 1][cellk + 1];
3785 TriLin(xd, yd, zd, P000, P100, P010, P001, P110, P101, P011, P111);
3786 double intFX =
TriLin(xd, yd, zd, FX000, FX100, FX010, FX001, FX110, FX101,
3788 double intFY =
TriLin(xd, yd, zd, FY000, FY100, FY010, FY001, FY110, FY101,
3790 double intFZ =
TriLin(xd, yd, zd, FZ000, FZ100, FZ010, FZ001, FZ110, FZ101,
3799 printf(
"Cell corner values:\n");
3800 printf(
"Potential: %g, %g, %g, %g\n", P000, P100, P010, P001);
3801 printf(
"Potential: %g, %g, %g, %g\n", P110, P101, P011, P111);
3802 printf(
"FastFX: %g, %g, %g, %g\n", FX000, FX100, FX010, FX001);
3803 printf(
"FastFX: %g, %g, %g, %g\n", FX110, FX101, FX011, FX111);
3804 printf(
"FastFY: %g, %g, %g, %g\n", FY000, FY100, FY010, FY001);
3805 printf(
"FastFY: %g, %g, %g, %g\n", FY110, FY101, FY011, FY111);
3806 printf(
"FastFZ: %g, %g, %g, %g\n", FZ000, FZ100, FZ010, FZ001);
3807 printf(
"FastFZ: %g, %g, %g, %g\n", FZ110, FZ101, FZ011, FZ111);
3808 printf(
"Pot, FX, FY, FZ: %g, %g, %g, %g\n", *Potential, globalF->
X,
3809 globalF->
Y, globalF->
Z);
3813 printf(
"out FastKnChPFAtPoint\n");
3828 double Xpt = globalP->
X;
3829 double Ypt = globalP->
Y;
3830 double Zpt = globalP->
Z;
3837 double TriLin(
double xd,
double yd,
double zd,
double c000,
double c100,
3838 double c010,
double c001,
double c110,
double c101,
double c011,
3853 neBEMMessage(
"In WtFldFastPFAtPoint: point in an ignored volume!\n");
3856 int fstatus =
ElePFAtPoint(globalP, Potential, globalF);
3858 neBEMMessage(
"wrong WtFldPFAtPoint return value in FastVolPF.\n");
3872 printf(
"\nin WtFldFastPFAtPoint\n");
3873 printf(
"x, y, z: %g, %g, %g\n", Xpt, Ypt, Zpt);
3874 printf(
"RptVolLX, RptVolLY, RptVolLZ: %g, %g, %g\n", RptVolLX, RptVolLY,
3876 printf(
"CornerX, CornerY, CornerZ: %g, %g, %g\n", CornerX, CornerY,
3890 double dx = Xpt - CornerX;
3891 double dy = Ypt - CornerY;
3892 double dz = Zpt - CornerZ;
3894 printf(
"real dx, dy, dz from volume corner: %g, %g, %g\n", dx, dy, dz);
3896 int NbFastVolX = (int)(dx / RptVolLX);
3897 if (dx < 0.0) --NbFastVolX;
3898 int NbFastVolY = (int)(dy / RptVolLY);
3899 if (dy < 0.0) --NbFastVolY;
3900 int NbFastVolZ = (int)(dz / RptVolLZ);
3901 if (dz < 0.0) --NbFastVolZ;
3903 printf(
"Volumes in x, y, z: %d, %d, %d\n", NbFastVolX, NbFastVolY,
3907 dx -= NbFastVolX * RptVolLX;
3908 dy -= NbFastVolY * RptVolLY;
3909 dz -= NbFastVolZ * RptVolLZ;
3923 if (dx > RptVolLX) {
3927 if (dy > RptVolLY) {
3931 if (dz > RptVolLZ) {
3936 printf(
"equivalent dist from corner - dx, dy, dz: %g, %g, %g\n", dx, dy,
3943 if ((RptVolLX - dx) <
MINDIST)
3953 printf(
"equivalent dist adjusted - dx, dy, dz: %g, %g, %g\n", dx, dy, dz);
4010 neBEMMessage(
"WtFldFastPFAtPoint: point in none of the sectors!\n");
4012 if (dbgFn) printf(
"stagger modified dx, dy, dz: %g, %g, %g\n", dx, dy, dz);
4019 if ((RptVolLX - dx) <
MINDIST)
4029 printf(
"equivalent dist adjusted for staggered: %g, %g, %g\n", dx, dy, dz);
4081 double blkTopZ = blkBtmZ +
WtFldBlkLZ[block];
4083 printf(
"block, dz, blkBtmZ, blkTopZ: %d, %lg, %lg, %lg\n", block, dz,
4088 if ((dz <= blkBtmZ) && ((blkBtmZ - dz) <
MINDIST)) dz = blkBtmZ -
MINDIST;
4089 if ((dz >= blkBtmZ) && ((dz - blkBtmZ) <
MINDIST)) dz = blkBtmZ +
MINDIST;
4090 if ((dz <= blkTopZ) && ((blkTopZ - dz) <
MINDIST)) dz = blkTopZ -
MINDIST;
4091 if ((dz >= blkTopZ) && ((dz - blkTopZ) <
MINDIST)) dz = blkTopZ +
MINDIST;
4093 if ((dz >= blkBtmZ) && (dz <= blkTopZ)) {
4099 neBEMMessage(
"WtFldFastPFAtPoint: point in none of the blocks!\n");
4107 double delZ =
WtFldBlkLZ[thisBlock] / nbZCells;
4111 printf(
"thisBlock: %d\n", thisBlock);
4112 printf(
"nbXCells, nbYCells, nbZCells: %d, %d, %d\n", nbXCells, nbYCells,
4115 printf(
"delX, delY, delZ: %le, %le, %le\n", delX, delY, delZ);
4116 printf(
"dz: %lg\n", dz);
4121 int celli = (int)(dx / delX) + 1;
4127 if (celli > nbXCells) {
4130 neBEMMessage(
"WtFldFastPFAtPoint - celli > nbXCells\n");
4132 int cellj = (int)(dy / delY) + 1;
4138 if (cellj > nbYCells) {
4141 neBEMMessage(
"WtFldFastPFAtPoint - cellj > nbYCells\n");
4143 int cellk = (int)(dz / delZ) + 1;
4149 if (cellk > nbZCells) {
4152 neBEMMessage(
"WtFldFastPFAtPoint - cellk > nbZCells\n");
4154 if (dbgFn) printf(
"Cells in x, y, z: %d, %d, %d\n", celli, cellj, cellk);
4163 double dxcellcrnr = dx - (double)(celli - 1) * delX;
4164 double dycellcrnr = dy - (double)(cellj - 1) * delY;
4165 double dzcellcrnr = dz - (double)(cellk - 1) * delZ;
4167 printf(
"cell crnr dx, dy, dz: %g, %g, %g\n", dxcellcrnr, dycellcrnr,
4171 double xd = dxcellcrnr / delX;
4172 double yd = dycellcrnr / delY;
4173 double zd = dzcellcrnr / delZ;
4174 if (xd <= 0.0) xd = 0.0;
4175 if (yd <= 0.0) yd = 0.0;
4176 if (zd <= 0.0) zd = 0.0;
4177 if (xd >= 1.0) xd = 1.0;
4178 if (yd >= 1.0) yd = 1.0;
4179 if (zd >= 1.0) zd = 1.0;
4182 double P000 =
WtFldFastPot[thisBlock][celli][cellj][cellk];
4183 double FX000 =
WtFldFastFX[thisBlock][celli][cellj][cellk];
4184 double FY000 =
WtFldFastFY[thisBlock][celli][cellj][cellk];
4185 double FZ000 =
WtFldFastFZ[thisBlock][celli][cellj][cellk];
4186 double P100 =
WtFldFastPot[thisBlock][celli + 1][cellj][cellk];
4187 double FX100 =
WtFldFastFX[thisBlock][celli + 1][cellj][cellk];
4188 double FY100 =
WtFldFastFY[thisBlock][celli + 1][cellj][cellk];
4189 double FZ100 =
WtFldFastFZ[thisBlock][celli + 1][cellj][cellk];
4190 double P010 =
WtFldFastPot[thisBlock][celli][cellj + 1][cellk];
4191 double FX010 =
WtFldFastFX[thisBlock][celli][cellj + 1][cellk];
4192 double FY010 =
WtFldFastFY[thisBlock][celli][cellj + 1][cellk];
4193 double FZ010 =
WtFldFastFZ[thisBlock][celli][cellj + 1][cellk];
4194 double P001 =
WtFldFastPot[thisBlock][celli][cellj][cellk + 1];
4195 double FX001 =
WtFldFastFX[thisBlock][celli][cellj][cellk + 1];
4196 double FY001 =
WtFldFastFY[thisBlock][celli][cellj][cellk + 1];
4197 double FZ001 =
WtFldFastFZ[thisBlock][celli][cellj][cellk + 1];
4198 double P110 =
WtFldFastPot[thisBlock][celli + 1][cellj + 1][cellk];
4199 double FX110 =
WtFldFastFX[thisBlock][celli + 1][cellj + 1][cellk];
4200 double FY110 =
WtFldFastFY[thisBlock][celli + 1][cellj + 1][cellk];
4201 double FZ110 =
WtFldFastFZ[thisBlock][celli + 1][cellj + 1][cellk];
4202 double P101 =
WtFldFastPot[thisBlock][celli + 1][cellj][cellk + 1];
4203 double FX101 =
WtFldFastFX[thisBlock][celli + 1][cellj][cellk + 1];
4204 double FY101 =
WtFldFastFY[thisBlock][celli + 1][cellj][cellk + 1];
4205 double FZ101 =
WtFldFastFZ[thisBlock][celli + 1][cellj][cellk + 1];
4206 double P011 =
WtFldFastPot[thisBlock][celli][cellj + 1][cellk + 1];
4207 double FX011 =
WtFldFastFX[thisBlock][celli][cellj + 1][cellk + 1];
4208 double FY011 =
WtFldFastFY[thisBlock][celli][cellj + 1][cellk + 1];
4209 double FZ011 =
WtFldFastFZ[thisBlock][celli][cellj + 1][cellk + 1];
4210 double P111 =
WtFldFastPot[thisBlock][celli + 1][cellj + 1][cellk + 1];
4211 double FX111 =
WtFldFastFX[thisBlock][celli + 1][cellj + 1][cellk + 1];
4212 double FY111 =
WtFldFastFY[thisBlock][celli + 1][cellj + 1][cellk + 1];
4213 double FZ111 =
WtFldFastFZ[thisBlock][celli + 1][cellj + 1][cellk + 1];
4249 FX111 =
WtFldFastStgFX[thisBlock][celli + 1][cellj + 1][cellk + 1];
4250 FY111 =
WtFldFastStgFY[thisBlock][celli + 1][cellj + 1][cellk + 1];
4251 FZ111 =
WtFldFastStgFZ[thisBlock][celli + 1][cellj + 1][cellk + 1];
4283 FX111 =
WtFldFastStgFX[thisBlock][celli + 1][cellj + 1][cellk + 1];
4284 FY111 =
WtFldFastStgFY[thisBlock][celli + 1][cellj + 1][cellk + 1];
4285 FZ111 =
WtFldFastStgFZ[thisBlock][celli + 1][cellj + 1][cellk + 1];
4290 TriLin(xd, yd, zd, P000, P100, P010, P001, P110, P101, P011, P111);
4291 double intFX =
TriLin(xd, yd, zd, FX000, FX100, FX010, FX001, FX110, FX101,
4293 double intFY =
TriLin(xd, yd, zd, FY000, FY100, FY010, FY001, FY110, FY101,
4295 double intFZ =
TriLin(xd, yd, zd, FZ000, FZ100, FZ010, FZ001, FZ110, FZ101,
4304 printf(
"WtFldCell corner values:\n");
4305 printf(
"Potential: %g, %g, %g, %g\n", P000, P100, P010, P001);
4306 printf(
"Potential: %g, %g, %g, %g\n", P110, P101, P011, P111);
4307 printf(
"FastFX: %g, %g, %g, %g\n", FX000, FX100, FX010, FX001);
4308 printf(
"FastFX: %g, %g, %g, %g\n", FX110, FX101, FX011, FX111);
4309 printf(
"FastFY: %g, %g, %g, %g\n", FY000, FY100, FY010, FY001);
4310 printf(
"FastFY: %g, %g, %g, %g\n", FY110, FY101, FY011, FY111);
4311 printf(
"FastFZ: %g, %g, %g, %g\n", FZ000, FZ100, FZ010, FZ001);
4312 printf(
"FastFZ: %g, %g, %g, %g\n", FZ110, FZ101, FZ011, FZ111);
4313 printf(
"Pot, FX, FY, FZ: %g, %g, %g, %g\n", *Potential, globalF->
X,
4314 globalF->
Y, globalF->
Z);
4318 printf(
"out WtFldFastPFAtPoint\n");
4331 const double x = localP->
X;
4332 const double y = localP->
Y;
4333 const double z = localP->
Z;
4336 RecPF(a, b, x, y, z, Potential, &localF);
4339 TriPF(a, b, x, y, z, Potential, &localF);
4342 WirePF(a, b, x, y, z, Potential, &localF);
4345 printf(
"Geometrical type out of range! ... exiting ...\n");
4355void GetPF(
int type,
double a,
double b,
double x,
double y,
double z,
4356 double *Potential,
Vector3D *localF) {
4359 RecPF(a, b, x, y, z, Potential, localF);
4362 TriPF(a, b, x, y, z, Potential, localF);
4365 WirePF(a, b, x, y, z, Potential, localF);
4368 printf(
"Geometrical type out of range! ... exiting ...\n");
4376void RecPF(
double a,
double b,
double x,
double y,
double z,
4377 double *Potential,
Vector3D *localF) {
4378 const double d2 = x * x + y * y + z * z;
4379 if (d2 >=
FarField2 * (a * a + b * b)) {
4380 (*Potential) = a * b / sqrt(d2);
4381 const double f = (*Potential) / d2;
4387 ExactRecSurf(x / a, y / a, z / a, -0.5, -(b / a) / 2.0,
4388 0.5, (b / a) / 2.0, Potential, localF);
4390 printf(
"problem in RecPF ... \n");
4400void TriPF(
double a,
double b,
double x,
double y,
double z,
4401 double *Potential,
Vector3D *localF) {
4403 const double xm = x - a / 3.;
4404 const double zm = z - b / 3.;
4405 const double d2 = xm * xm + y * y + zm * zm;
4407 if (d2 >=
FarField2 * (a * a + b * b)) {
4408 (*Potential) = 0.5 * a * b / sqrt(d2);
4409 const double f = (*Potential) / d2;
4414 int fstatus =
ExactTriSurf(b / a, x / a, y / a, z / a, Potential, localF);
4416 printf(
"problem in TriPF ... \n");
4426void WirePF(
double rW,
double lW,
double x,
double y,
double z,
4427 double *Potential,
Vector3D *localF) {
4428 const double d2 = x * x + y * y + z * z;
4430 double dA = 2.0 *
ST_PI * rW * lW;
4431 const double dist = sqrt(d2);
4432 (*Potential) = dA / dist;
4433 double f = dA / (dist * d2);
4444 localF->
X = localF->
Y = 0.0;
4461 RecPrimPF(prim, localP, Potential, &localF);
4464 TriPrimPF(prim, localP, Potential, &localF);
4467 WirePrimPF(prim, localP, Potential, &localF);
4470 printf(
"Geometrical type out of range! ... exiting ...\n");
4483 RecPrimPF(prim, localP, Potential, localF);
4486 TriPrimPF(prim, localP, Potential, localF);
4492 printf(
"Geometrical type out of range! ... exiting ...\n");
4500 double xpt = localP->
X;
4501 double ypt = localP->
Y;
4502 double zpt = localP->
Z;
4503 double dist = sqrt(xpt * xpt + ypt * ypt + zpt * zpt);
4507 double diag = sqrt(a * a + b * b);
4511 (*Potential) = dA / dist;
4512 const double f = dA / (dist * dist * dist);
4513 localF->
X = xpt * f;
4514 localF->
Y = ypt * f;
4515 localF->
Z = zpt * f;
4518 ExactRecSurf(xpt / a, ypt / a, zpt / a, -0.5, -(b / a) / 2.0,
4519 0.5, (b / a) / 2.0, Potential, localF);
4521 printf(
"problem in RecPrimPF ... \n");
4533 double xpt = localP->
X;
4534 double ypt = localP->
Y;
4535 double zpt = localP->
Z;
4539 double diag = sqrt(a * a + b * b);
4540 const double xm = xpt - a / 3.;
4541 const double zm = zpt - b / 3.;
4542 double dist = sqrt(xm * xm + ypt * ypt + zm * zm);
4545 double dA = 0.5 * a * b;
4546 (*Potential) = dA / dist;
4547 double f = dA / (dist * dist * dist);
4548 localF->
X = xpt * f;
4549 localF->
Y = ypt * f;
4550 localF->
Z = zpt * f;
4553 ExactTriSurf(b / a, xpt / a, ypt / a, zpt / a, Potential, localF);
4556 printf(
"problem in TriPrimPF ... \n");
4567 double xpt = localP->
X;
4568 double ypt = localP->
Y;
4569 double zpt = localP->
Z;
4570 double rW =
Radius[prim];
4571 double lW =
PrimLZ[prim];
4573 sqrt(xpt * xpt + ypt * ypt + zpt * zpt);
4577 double dA = 2.0 *
ST_PI * rW * lW;
4578 (*Potential) = dA / dist;
4579 double f = dA / (dist * dist * dist);
4580 localF->
X = xpt * f;
4581 localF->
Y = ypt * f;
4582 localF->
Z = zpt * f;
4590 localF->
X = localF->
Y = 0.0;
4614 const double xfld = globalP->
X;
4615 const double yfld = globalP->
Y;
4616 const double zfld = globalP->
Z;
4619 *Potential = globalF->
X = globalF->
Y = globalF->
Z = 0.0;
4647 pPot[prim] = plFx[prim] = plFy[prim] = plFz[prim] = 0.0;
4651 int tid = 0, nthreads = 1;
4652 #pragma omp parallel private(tid, nthreads)
4658 tid = omp_get_thread_num();
4660 nthreads = omp_get_num_threads();
4661 printf(
"PFAtPoint computation with %d threads\n", nthreads);
4669 for (
int primsrc = 1; primsrc <=
NbPrimitives; ++primsrc) {
4671 printf(
"Evaluating effect of primsrc %d using on %lg, %lg, %lg\n",
4672 primsrc, xfld, yfld, zfld);
4687 double TransformationMatrix[3][3];
4706 double InitialVector[3] = {xfld - xpsrc, yfld - ypsrc, zfld - zpsrc};
4707 double FinalVector[3] = {0., 0., 0.};
4708 for (
int i = 0; i < 3; ++i) {
4709 for (
int j = 0; j < 3; ++j) {
4710 FinalVector[i] += TransformationMatrix[i][j] * InitialVector[j];
4713 localPP.
X = FinalVector[0];
4714 localPP.
Y = FinalVector[1];
4715 localPP.
Z = FinalVector[2];
4726 GetPrimPF(primsrc, &localPP, &tmpPot, &tmpF);
4727 const double qpr =
AvWtChDen[IdWtField][primsrc];
4728 pPot[primsrc] += qpr * tmpPot;
4729 lFx += qpr * tmpF.
X;
4730 lFy += qpr * tmpF.
Y;
4731 lFz += qpr * tmpF.
Z;
4734 printf(
"PFAtPoint base primitive =>\n");
4735 printf(
"primsrc: %d, xlocal: %lg, ylocal: %lg, zlocal %lg\n",
4736 primsrc, localPP.
X, localPP.
Y, localPP.
Z);
4737 printf(
"primsrc: %d, Pot: %lg, Fx: %lg, Fx: %lg, Fz: %lg\n",
4738 primsrc, tmpPot, tmpF.
X, tmpF.
Y, tmpF.
Z);
4739 printf(
"primsrc: %d, pPot: %lg, lFx: %lg, lFy: %lg, lFz: %lg\n",
4740 primsrc, pPot[primsrc], lFx, lFy, lFz);
4756 for (
int ele = eleMin; ele <= eleMax; ++ele) {
4757 const double xsrc = (
EleArr + ele - 1)->G.Origin.X;
4758 const double ysrc = (
EleArr + ele - 1)->G.Origin.Y;
4759 const double zsrc = (
EleArr + ele - 1)->G.Origin.Z;
4762 double vG[3] = {xfld - xsrc, yfld - ysrc, zfld - zsrc};
4763 double vL[3] = {0., 0., 0.};
4764 for (
int i = 0; i < 3; ++i) {
4765 for (
int j = 0; j < 3; ++j) {
4766 vL[i] += TransformationMatrix[i][j] * vG[j];
4770 const int type = (
EleArr + ele - 1)->G.Type;
4771 const double a = (
EleArr + ele - 1)->G.LX;
4772 const double b = (
EleArr + ele - 1)->G.LZ;
4773 GetPF(type, a, b, vL[0], vL[1], vL[2], &tPot, &tF);
4781 printf(
"PFAtPoint base primitive:%d\n", primsrc);
4782 printf(
"ele: %d, xlocal: %lg, ylocal: %lg, zlocal %lg\n", ele,
4783 vL[0], vL[1], vL[2]);
4785 "ele: %d, tPot: %lg, tFx: %lg, tFy: %lg, tFz: %lg, Solution: "
4787 ele, tPot, tF.
X, tF.
Y, tF.
Z, qel);
4788 printf(
"ele: %d, ePot: %lg, eFx: %lg, eFy: %lg, eFz: %lg\n", ele,
4789 ePot, eF.
X, eF.
Y, eF.
Z);
4794 pPot[primsrc] += ePot;
4800 "prim%d, ePot: %lg, eFx: %lg, eFy: %lg, eFz: %lg\n",
4801 primsrc, ePot, eF.X, eF.Y, eF.Z);
4802 printf(
"prim%d, pPot: %lg, lFx: %lg, lFy: %lg, lFz: %lg\n", primsrc,
4803 pPot[primsrc], lFx, lFy, lFz);
4810 printf(
"basic primtive\n");
4811 printf(
"primsrc: %d, pPot: %lg, lFx: %lg, lFy: %lg, lFz: %lg\n",
4812 primsrc, pPot[primsrc], lFx, lFy, lFz);
4819 printf(
"Mirror may not be correctly implemented ...\n");
4829 if (perx || pery || perz) {
4830 for (
int xrpt = -perx; xrpt <= perx; ++xrpt) {
4831 const double xShift =
XPeriod[primsrc] * (double)xrpt;
4832 double XPOfRpt = xpsrc + xShift;
4833 for (
int yrpt = -pery; yrpt <= pery; ++yrpt) {
4834 const double yShift =
YPeriod[primsrc] * (double)yrpt;
4835 double YPOfRpt = ypsrc + yShift;
4836 for (
int zrpt = -perz; zrpt <= perz; ++zrpt) {
4837 const double zShift =
ZPeriod[primsrc] * (double)zrpt;
4838 double ZPOfRpt = zpsrc + zShift;
4840 if ((xrpt == 0) && (yrpt == 0) && (zrpt == 0))
continue;
4844 double InitialVector[3] = {xfld - XPOfRpt, yfld - YPOfRpt, zfld - ZPOfRpt};
4845 double FinalVector[3] = {0., 0., 0.};
4846 for (
int i = 0; i < 3; ++i) {
4847 for (
int j = 0; j < 3; ++j) {
4849 TransformationMatrix[i][j] * InitialVector[j];
4852 localPPR.
X = FinalVector[0];
4853 localPPR.
Y = FinalVector[1];
4854 localPPR.
Z = FinalVector[2];
4872 GetPrimPF(primsrc, &localPPR, &tmpPot, &tmpF);
4873 const double qpr =
AvWtChDen[IdWtField][primsrc];
4874 pPot[primsrc] += qpr * tmpPot;
4875 lFx += qpr * tmpF.
X;
4876 lFy += qpr * tmpF.
Y;
4877 lFz += qpr * tmpF.
Z;
4881 "primsrc: %d, xlocal: %lg, ylocal: %lg, zlocal: "
4883 primsrc, localPPR.
X, localPPR.
Y, localPPR.
Z);
4885 "primsrc: %d, Pot: %lg, Fx: %lg, Fy: %lg, Fz: %lg\n",
4886 primsrc, tmpPot * qpr, tmpF.
X * qpr, tmpF.
Y * qpr,
4889 "primsrc: %d, pPot: %lg, lFx: %lg, lFy: %lg, lFz: "
4891 primsrc, pPot[primsrc], lFx, lFy, lFz);
4906 for (
int ele = eleMin; ele <= eleMax; ++ele) {
4907 const double xrsrc = (
EleArr + ele - 1)->G.Origin.X;
4908 const double yrsrc = (
EleArr + ele - 1)->G.Origin.Y;
4909 const double zrsrc = (
EleArr + ele - 1)->G.Origin.Z;
4911 const double XEOfRpt = xrsrc + xShift;
4912 const double YEOfRpt = yrsrc + yShift;
4913 const double ZEOfRpt = zrsrc + zShift;
4916 double vG[3] = {xfld - XEOfRpt, yfld - YEOfRpt, zfld - ZEOfRpt};
4917 double vL[3] = {0., 0., 0.};
4918 for (
int i = 0; i < 3; ++i) {
4919 for (
int j = 0; j < 3; ++j) {
4920 vL[i] += TransformationMatrix[i][j] * vG[j];
4926 const int type = (
EleArr + ele - 1)->G.Type;
4927 const double a = (
EleArr + ele - 1)->G.LX;
4928 const double b = (
EleArr + ele - 1)->G.LZ;
4929 GetPF(type, a, b, vL[0], vL[1], vL[2], &tPot, &tF);
4931 erPot += qel * tPot;
4932 erF.
X += qel * tF.
X;
4933 erF.
Y += qel * tF.
Y;
4934 erF.
Z += qel * tF.
Z;
4937 printf(
"PFAtPoint base primitive:%d\n", primsrc);
4939 "ele: %d, xlocal: %lg, ylocal: %lg, zlocal %lg\n",
4940 ele, vL[0], vL[1], vL[2]);
4942 "ele: %d, tPot: %lg, tFx: %lg, tFy: %lg, tFz: %lg, "
4944 ele, tPot, tF.
X, tF.
Y, tF.
Z, qel);
4946 "ele: %d, ePot: %lg, eFx: %lg, eFy: %lg, eFz: "
4948 ele, erPot, erF.
X, erF.
Y, erF.
Z);
4954 pPot[primsrc] += erPot;
4962 printf(
"basic repeated xrpt: %d. yrpt: %d, zrpt: %d\n",
4965 "primsrc: %d, pPot: %lg, lFx: %lg, lFy: %lg, lFz: "
4967 primsrc, pPot[primsrc], lFx, lFy, lFz);
4976 "Mirror not correctly implemented in this version of "
4991 plFx[primsrc] = tmpF.
X;
4992 plFy[primsrc] = tmpF.
Y;
4993 plFz[primsrc] = tmpF.
Z;
4997 double totPot = 0.0;
4999 totF.
X = totF.
Y = totF.
Z = 0.0;
5001 totPot += pPot[prim];
5002 totF.
X += plFx[prim];
5003 totF.
Y += plFy[prim];
5004 totF.
Z += plFz[prim];
5009 *Potential = totPot * InvFourPiEps0;
5010 globalF->X = totF.
X * InvFourPiEps0;
5011 globalF->Y = totF.
Y * InvFourPiEps0;
5012 globalF->Z = totF.
Z * InvFourPiEps0;
5067 printf(
"Final values due to all primitives and other influences: ");
5070 printf(
"%lg\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n\n", xfld, yfld, zfld,
5071 (*Potential), globalF->X, globalF->Y, globalF->Z);
5083double TriLin(
double xd,
double yd,
double zd,
double c000,
double c100,
5084 double c010,
double c001,
double c110,
double c101,
double c011,
5086 double c00 = c000 * (1.0 - xd) + c100 * xd;
5087 double c10 = c010 * (1.0 - xd) + c110 * xd;
5088 double c01 = c001 * (1.0 - xd) + c101 * xd;
5089 double c11 = c011 * (1.0 - xd) + c111 * xd;
5090 double c0 = c00 * (1.0 - yd) + c10 * yd;
5091 double c1 = c01 * (1.0 - yd) + c11 * yd;
5092 return (c0 * (1.0 - zd) + c1 * zd);
int KnChPFAtPoint(Point3D *globalP, double *Potential, Vector3D *globalF)
void GetFlux(int ele, Point3D *localP, Vector3D *localF)
double GetPotential(int ele, Point3D *localP)
int FastPFAtPoint(Point3D *globalP, double *Potential, Vector3D *globalF)
void WirePrimPF(int prim, Point3D *localP, double *Potential, Vector3D *localF)
int FastKnChPFAtPoint(Point3D *globalP, double *Potential, Vector3D *globalF)
double TriPot(int ele, Point3D *localP)
void RecPrimPF(int prim, Point3D *localP, double *Potential, Vector3D *localF)
double WirePot(int ele, Point3D *localP)
void TriFlux(int ele, Point3D *localP, Vector3D *localF)
void RecFlux(int ele, Point3D *localP, Vector3D *localF)
void GetPrimPFGCS(int prim, Point3D *localP, double *Potential, Vector3D *globalF, DirnCosn3D *DirCos)
double RecPot(int ele, Point3D *localP)
int WtPFAtPoint(Point3D *globalP, double *Potential, Vector3D *globalF, int IdWtField)
void WireFlux(int ele, Point3D *localP, Vector3D *localF)
void RecPF(double a, double b, double x, double y, double z, double *Potential, Vector3D *localF)
int ElePFAtPoint(Point3D *globalP, double *Potential, Vector3D *globalF)
void TriPF(double a, double b, double x, double y, double z, double *Potential, Vector3D *localF)
void GetPFGCS(int type, double a, double b, Point3D *localP, double *Potential, Vector3D *globalF, DirnCosn3D *DirCos)
int PFAtPoint(Point3D *globalP, double *Potential, Vector3D *globalF)
int FastElePFAtPoint(Point3D *, double *, Vector3D *)
double TriLin(double xd, double yd, double zd, double c000, double c100, double c010, double c001, double c110, double c101, double c011, double c111)
void TriPrimPF(int prim, Point3D *localP, double *Potential, Vector3D *localF)
void WirePF(double rW, double lW, double x, double y, double z, double *Potential, Vector3D *localF)
void GetPrimPF(int prim, Point3D *localP, double *Potential, Vector3D *localF)
void GetPF(int type, double a, double b, double x, double y, double z, double *Potential, Vector3D *localF)
void GetFluxGCS(int ele, Point3D *localP, Vector3D *globalF)
int WtFldFastPFAtPoint(Point3D *globalP, double *Potential, Vector3D *globalF)
double ExactThinFX_W(double rW, double lW, double X, double Y, double Z)
double ExactCentroidalP_W(double rW, double lW)
double ExactThinFY_W(double rW, double lW, double X, double Y, double Z)
double ExactAxialP_W(double rW, double lW, double Z)
int ExactThinWire(double rW, double lW, double X, double Y, double Z, double *potential, Vector3D *Flux)
double ExactThinFZ_W(double rW, double lW, double X, double Y, double Z)
double LineKnChPF(Point3D LineStart, Point3D LineStop, double radius, Point3D FieldPt, Vector3D *globalF)
int ExactRecSurf(double X, double Y, double Z, double xlo, double zlo, double xhi, double zhi, double *Potential, Vector3D *Flux)
int ExactTriSurf(double zMax, double X, double Y, double Z, double *Potential, Vector3D *Flux)
double ExactThinP_W(double rW, double lW, double X, double Y, double Z)
double AreaKnChPF(int NbVertices, Point3D *Vertex, Point3D FieldPt, Vector3D *globalF)
double PointKnChPF(Point3D SourcePt, Point3D FieldPt, Vector3D *globalF)
double VolumeKnChPF(int, Point3D *, Point3D, Vector3D *globalF)
Vector3D RotateVector3D(Vector3D *A, DirnCosn3D *DC, int Sense)
int neBEMMessage(const char *message)
INTFACEGLOBAL int neBEMVolumePoint(double x, double y, double z)
Point3D ReflectPrimitiveOnMirror(char Axis, int primsrc, Point3D srcpt, Point3D fldpt, double distance, DirnCosn3D *MirroredDC)
Point3D ReflectOnMirror(char Axis, int elesrc, Point3D srcpt, Point3D fldpt, double distance, DirnCosn3D *MirroredDC)
neBEMGLOBAL Element * EleArr
neBEMGLOBAL double **** FastFY
neBEMGLOBAL int DebugLevel
neBEMGLOBAL int * PeriodicInY
neBEMGLOBAL int OptStaggerFastVol
neBEMGLOBAL double **** FastFZ
neBEMGLOBAL double **** WtFldFastStgFZ
neBEMGLOBAL double **** WtFldFastFZ
neBEMGLOBAL double **** FastStgFZ
neBEMGLOBAL int * MirrorTypeZ
neBEMGLOBAL double **** FastStgPot
neBEMGLOBAL double * OmitVolCrnrZ
neBEMGLOBAL double * MirrorDistYFromOrigin
neBEMGLOBAL double **** FastStgFXKnCh
neBEMGLOBAL int * WtFldBlkNbYCells
neBEMGLOBAL double **** WtFldFastFX
neBEMGLOBAL double * ZPeriod
neBEMGLOBAL PointKnCh * PointKnChArr
neBEMGLOBAL double * OmitVolLX
neBEMGLOBAL VolumeKnCh * VolumeKnChArr
neBEMGLOBAL int OptStaggerMap
neBEMGLOBAL double **** WtFldFastPot
neBEMGLOBAL double **** FastFYKnCh
neBEMGLOBAL double VSystemChargeZero
neBEMGLOBAL int * WtFldBlkNbXCells
neBEMGLOBAL double * WtFldIgnoreVolCrnrX
neBEMGLOBAL double * PrimOriginZ
neBEMGLOBAL double * BlkCrnrZ
neBEMGLOBAL int NbPrimitives
neBEMGLOBAL double **** FastStgFY
neBEMGLOBAL int * NbVertices
neBEMGLOBAL int * PeriodicTypeX
neBEMGLOBAL int * PeriodicTypeY
neBEMGLOBAL int NbPointsKnCh
neBEMGLOBAL int OptWtFldStaggerFastVol
neBEMGLOBAL FastAlgoVol FastVol
neBEMGLOBAL double * PrimOriginY
neBEMGLOBAL double * MirrorDistZFromOrigin
neBEMGLOBAL AreaKnCh * AreaKnChArr
neBEMGLOBAL double **** WtFldFastStgPot
neBEMGLOBAL DirnCosn3D * PrimDC
neBEMGLOBAL int PrimAfter
neBEMGLOBAL double * BlkLZ
neBEMGLOBAL double * OmitVolCrnrX
neBEMGLOBAL int NbLinesKnCh
neBEMGLOBAL double * OmitVolLZ
neBEMGLOBAL int NbStgPtSkip
neBEMGLOBAL double * XPeriod
neBEMGLOBAL int NbVolumesKnCh
neBEMGLOBAL double * AvAsgndChDen
neBEMGLOBAL double * IgnoreVolCrnrY
neBEMGLOBAL char MapVersion[10]
neBEMGLOBAL double * WtFldIgnoreVolLZ
neBEMGLOBAL WtFldFastAlgoVol WtFldFastVol
neBEMGLOBAL double * OmitVolCrnrY
neBEMGLOBAL int * MirrorTypeY
neBEMGLOBAL double **** FastFX
neBEMGLOBAL int NbAreasKnCh
neBEMGLOBAL int * ElementEnd
neBEMGLOBAL double **** WtFldFastFY
neBEMGLOBAL double * AvChDen
neBEMGLOBAL double * WtFldBlkLZ
neBEMGLOBAL double * WtFldBlkCrnrZ
neBEMGLOBAL double **** WtFldFastStgFY
neBEMGLOBAL double **** FastStgFX
neBEMGLOBAL double * Radius
neBEMGLOBAL int * MirrorTypeX
neBEMGLOBAL double * OmitVolLY
neBEMGLOBAL int * BlkNbXCells
neBEMGLOBAL int * PrimType
neBEMGLOBAL int OptReadFastPF
neBEMGLOBAL double * PrimLX
neBEMGLOBAL int * BlkNbZCells
neBEMGLOBAL int * WtFldBlkNbZCells
neBEMGLOBAL double * Solution
neBEMGLOBAL int * ElementBgn
neBEMGLOBAL double * PrimOriginX
neBEMGLOBAL double ** AvWtChDen
neBEMGLOBAL double * IgnoreVolLY
neBEMGLOBAL double * WtFldIgnoreVolCrnrY
neBEMGLOBAL double * IgnoreVolLX
neBEMGLOBAL int * PeriodicInZ
neBEMGLOBAL int * PeriodicInX
neBEMGLOBAL double * WtFldIgnoreVolCrnrZ
neBEMGLOBAL double * WtFldIgnoreVolLY
neBEMGLOBAL double **** FastFXKnCh
neBEMGLOBAL double LengthScale
neBEMGLOBAL double * IgnoreVolLZ
neBEMGLOBAL double **** FastFZKnCh
neBEMGLOBAL double **** WtFldFastStgFX
neBEMGLOBAL VoxelVol Voxel
neBEMGLOBAL double **** FastStgFYKnCh
neBEMGLOBAL double ** WtFieldChDen
neBEMGLOBAL double * WtFldIgnoreVolLX
neBEMGLOBAL int * PeriodicTypeZ
neBEMGLOBAL LineKnCh * LineKnChArr
neBEMGLOBAL double **** FastPot
neBEMGLOBAL double **** FastPotKnCh
neBEMGLOBAL double * IgnoreVolCrnrX
neBEMGLOBAL char BCOutDir[256]
neBEMGLOBAL double * YPeriod
neBEMGLOBAL double * PrimLZ
neBEMGLOBAL double * MirrorDistXFromOrigin
neBEMGLOBAL double **** FastStgPotKnCh
neBEMGLOBAL double **** FastStgFZKnCh
neBEMGLOBAL double * IgnoreVolCrnrZ
neBEMGLOBAL int * BlkNbYCells
void free_dvector(double *v, long nl, long)
double * dvector(long nl, long nh)