12#define DEFINE_INTFACEGLOBAL
13#define DEFINE_neBEMGLOBAL
14#define DEFINE_NRGLOBAL
43 printf(
"Using neBEM version %s and ISLES version %s\n",
neBEMVersion,
68 neBEMMessage(
"neBEMInitialize - neBEMGetInputFromFiles");
86 strcat(IslesFile,
"/Isles.log");
87 fIsles = fopen(IslesFile,
"w");
100 int RqstdThreads = 1;
120 int MaxProcessors = omp_get_num_procs();
121 if (RqstdThreads > 1) {
122 if (RqstdThreads < MaxProcessors) {
124 omp_set_num_threads(RqstdThreads);
126 printf(
"RqstdThreads: %d\n", RqstdThreads);
127 RqstdThreads = MaxProcessors - 1;
128 omp_set_num_threads(RqstdThreads);
129 printf(
"Adjusted RqstdThreads: %d\n", RqstdThreads);
134 omp_set_num_threads(RqstdThreads);
135 printf(
"RqstdThreads: %d => No Multi-threading ...\n", RqstdThreads);
140 printf(
"RqstdThreads: %d, MaxProcessors: %d\n", RqstdThreads, MaxProcessors);
141 printf(
"Maximum number of threads to be used for parallelization: %d\n",
142 omp_get_max_threads());
143 printf(
"Number of threads used for neBEMInitialize: %d\n",
144 omp_get_num_threads());
149 FILE *voxelInpFile = fopen(
"neBEMInp/neBEMVoxel.inp",
"r");
150 if (voxelInpFile == NULL) {
151 printf(
"neBEMVoxel.inp absent ... assuming OptVoxel = 0 ...\n");
155 fscanf(voxelInpFile,
"OptVoxel: %d\n", &
OptVoxel);
157 fscanf(voxelInpFile,
"Xmin: %le\n", &
Voxel.Xmin);
158 fscanf(voxelInpFile,
"Xmax: %le\n", &
Voxel.Xmax);
159 fscanf(voxelInpFile,
"Ymin: %le\n", &
Voxel.Ymin);
160 fscanf(voxelInpFile,
"Ymax: %le\n", &
Voxel.Ymax);
161 fscanf(voxelInpFile,
"Zmin: %le\n", &
Voxel.Zmin);
162 fscanf(voxelInpFile,
"Zmax: %le\n", &
Voxel.Zmax);
163 fscanf(voxelInpFile,
"XStagger: %le\n", &
Voxel.XStagger);
164 fscanf(voxelInpFile,
"YStagger: %le\n", &
Voxel.YStagger);
165 fscanf(voxelInpFile,
"ZStagger: %le\n", &
Voxel.ZStagger);
166 fscanf(voxelInpFile,
"NbOfXCells: %d\n", &
Voxel.NbXCells);
167 fscanf(voxelInpFile,
"NbOfYCells: %d\n", &
Voxel.NbYCells);
168 fscanf(voxelInpFile,
"NbOfZCells: %d\n", &
Voxel.NbZCells);
169 fclose(voxelInpFile);
174 FILE *mapInpFile = fopen(
"neBEMInp/neBEMMap.inp",
"r");
175 if (mapInpFile == NULL) {
176 printf(
"neBEMMap.inp absent ... assuming OptMap = 0 ...\n");
182 fscanf(mapInpFile,
"OptMap: %d\n", &
OptMap);
184 fscanf(mapInpFile,
"MapVersion: %9s\n",
MapVersion);
185 fscanf(mapInpFile,
"Xmin: %le\n", &
Map.Xmin);
186 fscanf(mapInpFile,
"Xmax: %le\n", &
Map.Xmax);
187 fscanf(mapInpFile,
"Ymin: %le\n", &
Map.Ymin);
188 fscanf(mapInpFile,
"Ymax: %le\n", &
Map.Ymax);
189 fscanf(mapInpFile,
"Zmin: %le\n", &
Map.Zmin);
190 fscanf(mapInpFile,
"Zmax: %le\n", &
Map.Zmax);
191 fscanf(mapInpFile,
"XStagger: %le\n", &
Map.XStagger);
192 fscanf(mapInpFile,
"YStagger: %le\n", &
Map.YStagger);
193 fscanf(mapInpFile,
"ZStagger: %le\n", &
Map.ZStagger);
194 fscanf(mapInpFile,
"NbOfXCells: %d\n", &
Map.NbXCells);
195 fscanf(mapInpFile,
"NbOfYCells: %d\n", &
Map.NbYCells);
196 fscanf(mapInpFile,
"NbOfZCells: %d\n", &
Map.NbZCells);
202 FILE *fastInpFile = fopen(
"neBEMInp/neBEMFastVol.inp",
"r");
203 if (fastInpFile == NULL) {
204 printf(
"neBEMFastVol.inp absent ... assuming OptFastVol = 0 ...\n");
213 fscanf(fastInpFile,
"OptFastVol: %d\n", &
OptFastVol);
217 fscanf(fastInpFile,
"NbPtSkip: %d\n", &
NbPtSkip);
218 fscanf(fastInpFile,
"NbStgPtSkip: %d\n", &
NbStgPtSkip);
219 fscanf(fastInpFile,
"LX: %le\n", &
FastVol.LX);
220 fscanf(fastInpFile,
"LY: %le\n", &
FastVol.LY);
221 fscanf(fastInpFile,
"LZ: %le\n", &
FastVol.LZ);
222 fscanf(fastInpFile,
"CornerX: %le\n", &
FastVol.CrnrX);
223 fscanf(fastInpFile,
"CornerY: %le\n", &
FastVol.CrnrY);
224 fscanf(fastInpFile,
"CornerZ: %le\n", &
FastVol.CrnrZ);
225 fscanf(fastInpFile,
"YStagger: %le\n", &
FastVol.YStagger);
228 fscanf(fastInpFile,
"NbOfBlocks: %d\n", &
FastVol.NbBlocks);
234 for (
int block = 1; block <=
FastVol.NbBlocks; ++block) {
235 fscanf(fastInpFile,
"NbOfXCells: %d\n", &
BlkNbXCells[block]);
236 fscanf(fastInpFile,
"NbOfYCells: %d\n", &
BlkNbYCells[block]);
237 fscanf(fastInpFile,
"NbOfZCells: %d\n", &
BlkNbZCells[block]);
238 fscanf(fastInpFile,
"LZ: %le\n", &
BlkLZ[block]);
239 fscanf(fastInpFile,
"CornerZ: %le\n", &
BlkCrnrZ[block]);
241 fscanf(fastInpFile,
"NbOfOmitVols: %d\n", &
FastVol.NbOmitVols);
249 for (
int omit = 1; omit <=
FastVol.NbOmitVols; ++omit) {
250 fscanf(fastInpFile,
"OmitVolLX: %le\n", &
OmitVolLX[omit]);
251 fscanf(fastInpFile,
"OmitVolLY: %le\n", &
OmitVolLY[omit]);
252 fscanf(fastInpFile,
"OmitVolLZ: %le\n", &
OmitVolLZ[omit]);
253 fscanf(fastInpFile,
"OmitVolCornerX: %le\n", &
OmitVolCrnrX[omit]);
254 fscanf(fastInpFile,
"OmitVolCornerY: %le\n", &
OmitVolCrnrY[omit]);
255 fscanf(fastInpFile,
"OmitVolCornerZ: %le\n", &
OmitVolCrnrZ[omit]);
258 fscanf(fastInpFile,
"NbOfIgnoreVols: %d\n", &
FastVol.NbIgnoreVols);
266 for (
int ignore = 1; ignore <=
FastVol.NbIgnoreVols; ++ignore) {
267 fscanf(fastInpFile,
"IgnoreVolLX: %le\n", &
IgnoreVolLX[ignore]);
268 fscanf(fastInpFile,
"IgnoreVolLY: %le\n", &
IgnoreVolLY[ignore]);
269 fscanf(fastInpFile,
"IgnoreVolLZ: %le\n", &
IgnoreVolLZ[ignore]);
270 fscanf(fastInpFile,
"IgnoreVolCornerX: %le\n",
272 fscanf(fastInpFile,
"IgnoreVolCornerY: %le\n",
274 fscanf(fastInpFile,
"IgnoreVolCornerZ: %le\n",
278 for (
int ignore = 1; ignore <=
FastVol.NbIgnoreVols; ++ignore) {
290 printf(
"neBEM initialized ...\n");
317 neBEMMessage(
"neBEMReadGeometry - problem reading stored Primitives.\n");
324 printf(
"geometry inputs ...\n");
326 printf(
"reading geometry possible only after initialization ...\n");
417 int nvertex, volref1, volref2, volmax = 0;
425 double xnorm, ynorm, znorm;
429 zvert.data(), &xnorm, &ynorm, &znorm, &volref1,
433 &xnorm, &ynorm, &znorm, &volref1, &volref2);
439 if (volmax < volref1) {
442 if (volmax < volref2) {
447 printf(
"Number of vertices for primitive %d exceeds %d!\n", prim,
449 printf(
"Returning to garfield ...\n");
455 for (
int vert = 0; vert <
NbVertices[prim]; ++vert) {
456 XVertex[prim][vert] = xvert[vert];
457 YVertex[prim][vert] = yvert[vert];
458 ZVertex[prim][vert] = zvert[vert];
478 printf(
"neBEM:\tprimitive %d between volumes %d, %d has %d vertices\n",
479 prim, volref1, volref2, nvertex);
480 for (
int ivertex = 0; ivertex < nvertex; ivertex++) {
481 printf(
"\tnode %d (%g,%g,%g)\n", ivertex, xvert[ivertex],
482 yvert[ivertex], zvert[ivertex]);
484 printf(
"\tnormal vector: (%g,%g,%g)\n", xnorm, ynorm, znorm);
495 int shape1, material1, boundarytype1;
496 double epsilon1, potential1, charge1;
503 &potential1, &charge1, &boundarytype1);
506 printf(
"\tvolref1: %d\n", volref1);
507 printf(
"\t\tboundarytype1: %d, shape1: %d, material1: %d\n",
508 boundarytype1, shape1, material1);
509 printf(
"\t\tepsilon1: %lg, potential1: %lg, charge1: %lg\n", epsilon1,
510 potential1, charge1);
513 int shape2, material2, boundarytype2;
514 double epsilon2, potential2, charge2;
524 &potential2, &charge2, &boundarytype2);
527 printf(
"\tvolref2: %d\n", volref2);
528 printf(
"\t\tboundarytype2: %d, shape2: %d, material2: %d\n",
529 boundarytype2, shape2, material2);
530 printf(
"\t\tepsilon2: %lg, potential2: %lg, charge2: %lg\n", epsilon2,
531 potential2, charge2);
571 switch (boundarytype1) {
573 if (boundarytype2 == 0 || boundarytype2 == 4) {
577 }
else if (boundarytype2 == 1) {
579 if (fabs(potential1 - potential2)
580 < 1e-6 * (1 + fabs(potential1) + fabs(potential2))) {
581 printf(
"neBEMReadGeometry: identical potentials; skipped.\n");
582 printf(
"Primitive skipped: #%d\n", prim);
586 printf(
"neBEMReadGeometry: different potentials; rejected.\n");
592 "neBEMReadGeometry: conductor at given potential; rejected.\n");
598 if ((boundarytype2 == 0) || (boundarytype2 == 4)) {
603 printf(
"neBEMReadGeometry: charged conductor; rejected.\n");
609 if ((boundarytype2 == 0) || (boundarytype2 == 4)) {
615 printf(
"neBEMReadGeometry: floating conductor; rejected.\n");
621 if (boundarytype2 == 0) {
626 Lambda[prim] = (epsilon1 - epsilon2) / (epsilon1 + epsilon2);
628 }
else if (boundarytype2 == 1) {
632 }
else if (boundarytype2 == 2) {
636 }
else if (boundarytype2 == 3) {
639 }
else if (boundarytype2 == 4) {
641 if (fabs(epsilon1 - epsilon2) <
642 1e-6 * (1 + fabs(epsilon1) + fabs(epsilon2))) {
645 "neBEMReadGeometry: between identical dielectrica; skipd.\n");
646 printf(
"Primitive skipped: #%d\n", prim);
653 Lambda[prim] = (epsilon1 - epsilon2) / (epsilon1 + epsilon2);
656 }
else if (boundarytype2 == 5) {
658 if (fabs(epsilon1 - epsilon2)
659 < 1e-6 * (1 + fabs(epsilon1) + fabs(epsilon2))) {
661 "neBEMReadGeometry: between identical dielectrica; skipped.\n");
662 printf(
"Primitive skipped: #%d\n", prim);
668 Lambda[prim] = (epsilon1 - epsilon2) / (epsilon1 + epsilon2);
672 printf(
"neBEMReadGeometry: unknown dielectric; rejected.\n");
678 if (boundarytype2 == 0) {
681 Lambda[prim] = (epsilon1 - epsilon2) / (epsilon1 + epsilon2);
683 }
else if (boundarytype2 == 4) {
684 if (fabs(epsilon1 - epsilon2) <
685 1e-6 * (1 + fabs(epsilon1) + fabs(epsilon2))) {
688 "neBEMReadGeometry: between identical dielectrica; skipd.\n");
689 printf(
"Primitive skipped: #%d\n", prim);
695 Lambda[prim] = (epsilon1 - epsilon2) / (epsilon1 + epsilon2);
701 "neBEMReadGeometry: charged dielectric adjacent to a conductor; "
708 if (boundarytype2 == 0) {
711 printf(
"neBEMReadGeometry: E-parallel symmetry; rejected.\n");
717 if (boundarytype2 == 0) {
720 printf(
"neBEMReadGeometry: E-perpendicular symmetry; rejected.\n");
726 printf(
"neBEMReadGeometry: Boundary type 1: %d\n", boundarytype1);
727 printf(
"neBEMReadGeometry: Boundary type 2: %d\n", boundarytype2);
728 printf(
"neBEMReadGeometry: out of range ... exiting.\n");
734 "\tType: %d, ApplPot: %lg, Epsilon1: %lg, Epsilon2: %lg, Lambda: "
735 "%lg, ApplCh: %lg\n",
755 neBEMMessage(
"neBEMReadGeometry - neBEMGetPeriodicities");
766 printf(
"For primitive: %d\n", prim);
767 printf(
"\tPeriodicTypeX: %d, PeriodicTypeY: %d, PeriodicTypeZ: %d\n",
769 printf(
"\tPeriodicInX: %d, PeriodicInY: %d, PeriodicInZ: %d\n", jx, jy,
771 printf(
"\tXPeriod: %lg, YPeriod: %lg, ZPeriod: %lg\n", sx, sy, sz);
809 neBEMGetMirror(prim, &ix, &jx, &sx, &iy, &jy, &sy, &iz, &jz, &sz);
822 printf(
"For primitive: %d\n", prim);
823 printf(
"\tMirrorTypeX: %d, MirrorTypeY: %d, MirrorTypeZ: %d\n", ix, iy,
825 printf(
"\tNOT USED ==> MirrorInX: %d, MirrorInY: %d, MirrorInZ: %d\n",
827 printf(
"\tMirrorDistX: %lg, MirrorDistY: %lg, MirrorDistZ: %lg\n", sx,
857 int ixmin, ixmax, iymin, iymax, izmin, izmax;
858 double cxmin, cxmax, cymin, cymax, czmin, czmax;
859 double vxmin, vxmax, vymin, vymax, vzmin, vzmax;
861 &ixmin, &cxmin, &vxmin, &ixmax, &cxmax, &vxmax, &iymin, &cymin, &vymin,
862 &iymax, &cymax, &vymax, &izmin, &czmin, &vzmin, &izmax, &czmax, &vzmax);
864 neBEMMessage(
"neBEMReadGeometry - neBEMGetBoundingPlanes");
925 for (
int volref = 0; volref <=
VolMax; ++volref) {
930 printf(
"volref: %d\n", volref);
931 printf(
"shape: %d, material: %d\n",
volShape[volref],
951 int NbSkipped = 0, effprim;
952 double DVertex[4], minDVertex = 0.0;
954 effprim = prim - NbSkipped;
957 for (
int vert = 0; vert <
NbVertices[prim] - 1; ++vert) {
966 minDVertex = DVertex[vert];
968 if (DVertex[vert] < minDVertex) minDVertex = DVertex[vert];
977 for (
int vert = 0; vert <
NbVertices[effprim]; ++vert) {
984 XNorm[effprim] = 0.0;
985 YNorm[effprim] = 0.0;
986 ZNorm[effprim] = 0.0;
1043 printf(
"Skipped primitive %d, InterfaceType: %d, minDVertex: %lg\n",
1049 printf(
"Number of primitives skipped: %d, Effective NbPrimitives: %d\n",
1055 FILE *rmprimFile = fopen(
"neBEMInp/neBEMRmPrim.inp",
"r");
1056 if (rmprimFile == NULL) {
1057 printf(
"neBEMRmPrim.inp absent ... assuming defaults ...\n");
1060 fscanf(rmprimFile,
"NbRmPrims: %d\n", &NbRmPrims);
1064 std::vector<double> rmXNorm(NbRmPrims + 1, 0.);
1065 std::vector<double> rmYNorm(NbRmPrims + 1, 0.);
1066 std::vector<double> rmZNorm(NbRmPrims + 1, 0.);
1067 std::vector<double> rmXVert(NbRmPrims + 1, 0.);
1068 std::vector<double> rmYVert(NbRmPrims + 1, 0.);
1069 std::vector<double> rmZVert(NbRmPrims + 1, 0.);
1071 double rmXNorm[NbRmPrims + 1], rmYNorm[NbRmPrims + 1];
1072 double rmZNorm[NbRmPrims + 1];
1073 double rmXVert[NbRmPrims + 1], rmYVert[NbRmPrims + 1];
1074 double rmZVert[NbRmPrims + 1];
1076 for (
int rmprim = 1; rmprim <= NbRmPrims; ++rmprim) {
1077 fscanf(rmprimFile,
"Prim: %d\n", &tint);
1078 fscanf(rmprimFile,
"rmXNorm: %le\n", &rmXNorm[rmprim]);
1079 fscanf(rmprimFile,
"rmYNorm: %le\n", &rmYNorm[rmprim]);
1080 fscanf(rmprimFile,
"rmZNorm: %le\n", &rmZNorm[rmprim]);
1081 fscanf(rmprimFile,
"rmXVert: %le\n", &rmXVert[rmprim]);
1082 fscanf(rmprimFile,
"rmYVert: %le\n", &rmYVert[rmprim]);
1083 fscanf(rmprimFile,
"rmZVert: %le\n", &rmZVert[rmprim]);
1085 "rmprim: %d, rmXNorm: %lg, rmYNorm: %lg, rmZNorm: %lg, "
1086 "rmXVert: %lg, rmYVert: %lg, rmZVert: %lg\n",
1087 rmprim, rmXNorm[rmprim], rmYNorm[rmprim], rmZNorm[rmprim],
1088 rmXVert[rmprim], rmYVert[rmprim], rmZVert[rmprim]);
1099 printf(
"\n\nprim: %d, XVertex: %lg, YVertex: %lg, ZVertex: %lg\n",
1102 printf(
"XNorm: %lg, YNorm: %lg, ZNorm: %lg\n",
XNorm[prim],
1106 for (
int rmprim = 1; rmprim <= NbRmPrims; ++rmprim) {
1109 "rmprim: %d, rmXVertex: %lg, rmYVertex: %lg, rmZVertex: "
1111 rmprim, rmXVert[rmprim], rmYVert[rmprim], rmZVert[rmprim]);
1112 printf(
"rmXNorm: %lg, rmYNorm: %lg, rmZNorm: %lg\n",
1113 rmXNorm[rmprim], rmYNorm[rmprim], rmZNorm[rmprim]);
1117 if ((fabs(fabs(
XNorm[prim]) - fabs(rmXNorm[rmprim])) <=
1119 (fabs(fabs(
YNorm[prim]) - fabs(rmYNorm[rmprim])) <=
1121 (fabs(fabs(
ZNorm[prim]) - fabs(rmZNorm[rmprim])) <=
1129 if (fabs(fabs(
XNorm[prim]) - 1.0) <= 1.0e-12) {
1135 if (fabs(fabs(
YNorm[prim]) - 1.0) <= 1.0e-12) {
1141 if (fabs(fabs(
ZNorm[prim]) - 1.0) <= 1.0e-12) {
1149 printf(
"prim: %d, rmprim: %d, remove: %d\n", prim, rmprim,
1152 if (remove[prim] == 1)
1159 char RmPrimFile[256];
1161 strcat(RmPrimFile,
"/RmPrims.info");
1162 FILE *fprrm = fopen(RmPrimFile,
"w");
1163 if (fprrm == NULL) {
1165 "error opening RmPrims.info file in write mode ... "
1181 orgnlNb = orgnlprim;
1186 if (remove[prim] == 1) {
1189 fprintf(fprrm,
"NbRemoved: %d, Removed primitive: %d\n",
1191 fprintf(fprrm,
"PrimType: %d\n",
PrimType[prim]);
1192 fprintf(fprrm,
"NbVertices: %d\n",
NbVertices[prim]);
1193 for (
int vert = 0; vert <
NbVertices[prim]; ++vert) {
1194 fprintf(fprrm,
"Vertx %d: %lg, %lg, %lg\n", vert,
1198 fprintf(fprrm,
"Normals: %lg, %lg, %lg\n",
XNorm[prim],
1203 int effprim = prim - NbRemoved;
1208 for (
int vert = 0; vert <
NbVertices[effprim]; ++vert) {
1215 XNorm[effprim] = 0.0;
1216 YNorm[effprim] = 0.0;
1217 ZNorm[effprim] = 0.0;
1275 "Number of primitives removed: %d, Effective NbPrimitives: %d\n",
1284 char IgnorePrimFile[256];
1286 strcat(IgnorePrimFile,
"/IgnorePrims.info");
1287 FILE *fignore = fopen(IgnorePrimFile,
"w");
1288 if (fignore == NULL) {
1290 "error opening IgnorePrims.info file in write mode ... returning\n");
1303 printf(
"ROM: switch to primitive representation after %d repetitions.\n",
1307 char NativeInFile[256];
1310 strcat(NativeInFile,
"/neBEMNative.inp");
1311 FILE *fNativeInFile = fopen(NativeInFile,
"w");
1312 fprintf(fNativeInFile,
"#====>Input directory\n");
1314 fprintf(fNativeInFile,
"#====>No. of primitives:\n");
1316 fprintf(fNativeInFile,
"#====>No. of volumes:\n");
1317 fprintf(fNativeInFile,
"%d\n",
VolMax);
1320 snprintf(strPrimNb, 11,
"%d", prim);
1321 char NativePrimFile[256];
1322 strcpy(NativePrimFile,
"Primitive");
1323 strcat(NativePrimFile, strPrimNb);
1324 strcat(NativePrimFile,
".inp");
1326 fprintf(fNativeInFile,
"#Input filename for primitive:\n");
1327 fprintf(fNativeInFile,
"%s\n", NativePrimFile);
1330 strcat(NativePrimFile,
"/Primitive");
1331 strcat(NativePrimFile, strPrimNb);
1332 strcat(NativePrimFile,
".inp");
1334 FILE *fNativePrim = fopen(NativePrimFile,
"w");
1336 fprintf(fNativePrim,
"#Number of vertices:\n");
1337 fprintf(fNativePrim,
"%d\n",
NbVertices[prim]);
1338 for (
int vertex = 0; vertex <
NbVertices[prim]; ++vertex) {
1339 fprintf(fNativePrim,
"#Vertex %d:\n", vertex);
1340 fprintf(fNativePrim,
"%lg %lg %lg\n",
XVertex[prim][vertex],
1343 fprintf(fNativePrim,
"#Outward normal:\n");
1344 fprintf(fNativePrim,
"%lg %lg %lg\n",
XNorm[prim],
YNorm[prim],
1346 fprintf(fNativePrim,
"#Volume references:\n");
1348 fprintf(fNativePrim,
"#Maximum number of segments:\n");
1349 fprintf(fNativePrim,
"%d %d\n", 0, 0);
1350 fprintf(fNativePrim,
"#Information on X periodicity:\n");
1353 fprintf(fNativePrim,
"#Information on Y periodicity:\n");
1356 fprintf(fNativePrim,
"#Information on Z periodicity:\n");
1360 fclose(fNativePrim);
1363 fprintf(fNativeInFile,
"#====>No. of boundary conditions per element:\n");
1364 fprintf(fNativeInFile,
"%d\n", 1);
1365 fprintf(fNativeInFile,
"#====>Device output directory name:\n");
1366 fprintf(fNativeInFile,
"NativeResults\n");
1367 fprintf(fNativeInFile,
"#====>Map input file:\n");
1368 fprintf(fNativeInFile,
"MapFile.inp\n");
1369 fclose(fNativeInFile);
1371 for (
int volume = 0; volume <=
VolMax; ++volume) {
1374 int shape, material, boundarytype;
1375 double epsilon, potential, charge;
1377 &charge, &boundarytype);
1380 snprintf(strVolNb, 11,
"%d", volume);
1381 char NativeVolFile[256];
1383 strcat(NativeVolFile,
"/Volume");
1384 strcat(NativeVolFile, strVolNb);
1385 strcat(NativeVolFile,
".inp");
1387 FILE *fNativeVol = fopen(NativeVolFile,
"w");
1389 fprintf(fNativeVol,
"#Shape of the volume:\n");
1390 fprintf(fNativeVol,
"%d\n", shape);
1391 fprintf(fNativeVol,
"#Material of the volume:\n");
1392 fprintf(fNativeVol,
"%d\n", material);
1393 fprintf(fNativeVol,
"#Relative permittivity:\n");
1394 fprintf(fNativeVol,
"%lg\n", epsilon);
1395 fprintf(fNativeVol,
"#Potential:\n");
1396 fprintf(fNativeVol,
"%lg\n", potential);
1397 fprintf(fNativeVol,
"#Charge:\n");
1398 fprintf(fNativeVol,
"%lg\n", charge);
1399 fprintf(fNativeVol,
"#Boundary type:\n");
1400 fprintf(fNativeVol,
"%d\n", boundarytype);
1407 char NativeMapFile[256];
1410 strcat(NativeMapFile,
"/MapFile.inp");
1412 FILE *fNativeMap = fopen(NativeMapFile,
"w");
1414 fprintf(fNativeMap,
"#Number of maps\n");
1415 fprintf(fNativeMap,
"%d\n", 0);
1416 fprintf(fNativeMap,
"#Number of lines\n");
1417 fprintf(fNativeMap,
"%d\n", 0);
1418 fprintf(fNativeMap,
"#Number of points\n");
1419 fprintf(fNativeMap,
"%d\n", 0);
1429 neBEMMessage(
"neBEMReadGeometry - problem writing Primtives.\n");
1436 "neBEMReadGeometry - unformatted write not inplemented yet.\n");
1441 printf(
"neBEMReadGeometry: Geometry read!\n");
1447 printf(
"to read geometry\n");
1466 neBEMMessage(
"neBEMDiscretize - problem reading stored Elements.\n");
1475 printf(
"discretization can continue only in State 3 ...\n");
1502 char MeshLogFile[256];
1505 strcat(MeshLogFile,
"/MeshLog.out");
1506 fMeshLog = fopen(MeshLogFile,
"w");
1507 fprintf(
fMeshLog,
"Details of primitive discretization\n");
1511 NbSurfSegX[prim] = NbElemsOnPrimitives[prim][1];
1512 NbSurfSegZ[prim] = NbElemsOnPrimitives[prim][2];
1522 NbSurfSegX[prim] = NbElemsOnPrimitives[prim][1];
1523 NbSurfSegZ[prim] = NbElemsOnPrimitives[prim][2];
1534 NbWireSeg[prim] = NbElemsOnPrimitives[prim][1];
1544 printf(
"Primitive %d to be discretized into %d elements.\n", prim,
1547 printf(
"Primitive %d to be discretized into %d X %d elements.\n", prim,
1552 printf(
"Memory allocated for maximum %d elements.\n",
NbElements);
1557 printf(
"neBEMDiscretize: NbElements = %d, sizeof(Element) = %zu\n",
1566 printf(
"neBEMDiscretize: Re-allocating EleArr failed.\n");
1569 printf(
"neBEMDiscretize: Re-allocated EleArr.\n");
1585 strcat(GnuFile,
"/GViewDir/gPrimView.gp");
1587 fprintf(
fgnuPrim,
"set title \"neBEM primitives in gnuplot VIEWER\"\n");
1590 fprintf(
fgnuPrim,
"#set style data pm3d\n");
1591 fprintf(
fgnuPrim,
"#set palette model CMY\n");
1592 fprintf(
fgnuPrim,
"set hidden3d\n");
1594 fprintf(
fgnuPrim,
"set xlabel \"X\"\n");
1595 fprintf(
fgnuPrim,
"set ylabel \"Y\"\n");
1596 fprintf(
fgnuPrim,
"set zlabel \"Z\"\n");
1597 fprintf(
fgnuPrim,
"set view 70, 335, 1, 1\n");
1601 strcat(GnuFile,
"/GViewDir/gElemView.gp");
1603 fprintf(
fgnuElem,
"set title \"neBEM elements in gnuplot VIEWER\"\n");
1606 fprintf(
fgnuElem,
"#set style data pm3d\n");
1607 fprintf(
fgnuElem,
"#set palette model CMY\n");
1608 fprintf(
fgnuElem,
"set hidden3d\n");
1610 fprintf(
fgnuElem,
"set xlabel \"X\"\n");
1611 fprintf(
fgnuElem,
"set ylabel \"Y\"\n");
1612 fprintf(
fgnuElem,
"set zlabel \"Z\"\n");
1613 fprintf(
fgnuElem,
"set view 70, 335, 1, 1\n");
1617 strcat(GnuFile,
"/GViewDir/gMeshView.gp");
1619 fprintf(
fgnuMesh,
"set title \"neBEM mesh in gnuplot VIEWER\"\n");
1622 fprintf(
fgnuMesh,
"#set style data pm3d\n");
1623 fprintf(
fgnuMesh,
"#set palette model CMY\n");
1624 fprintf(
fgnuMesh,
"set hidden3d\n");
1626 fprintf(
fgnuMesh,
"set xlabel \"X\"\n");
1627 fprintf(
fgnuMesh,
"set ylabel \"Y\"\n");
1628 fprintf(
fgnuMesh,
"set zlabel \"Z\"\n");
1629 fprintf(
fgnuMesh,
"set view 70, 335, 1, 1\n");
1662 printf(
"PrimType out of range in CreateElements ... exiting ...\n");
1678 neBEMMessage(
"neBEMDiscretize - EleCntr more than NbElements!");
1684 int startcntr = 1, cntr1, cntr2;
1687 for (cntr1 = startcntr; cntr1 <=
EleCntr; ++cntr1) {
1688 pt1.
X = (
EleArr + cntr1 - 1)->BC.CollPt.X;
1689 pt1.
Y = (
EleArr + cntr1 - 1)->BC.CollPt.Y;
1690 pt1.
Z = (
EleArr + cntr1 - 1)->BC.CollPt.Z;
1691 for (cntr2 = cntr1 + 1; cntr2 <=
EleCntr; ++cntr2) {
1692 pt2.
X = (
EleArr + cntr2 - 1)->BC.CollPt.X;
1693 pt2.
Y = (
EleArr + cntr2 - 1)->BC.CollPt.Y;
1694 pt2.
Z = (
EleArr + cntr2 - 1)->BC.CollPt.Z;
1707 int prim1 = (
EleArr + cntr1 - 1)->PrimitiveNb;
1709 int prim2 = (
EleArr + cntr2 - 1)->PrimitiveNb;
1712 neBEMMessage(
"neBEMDiscretize - Overlapping collocation points!");
1713 printf(
"Element %d, primitive %d, volume %d overlaps with\n", cntr1,
1715 printf(
"\telement %d, primitive %d, volume %d.\n", cntr2, prim2,
1717 printf(
"\tposition 1: (%g , %g , %g) micron,\n", 1e6 * pt1.
X,
1718 1e6 * pt1.
Y, 1e6 * pt1.
Z);
1719 printf(
"\tposition 2: (%g , %g , %g) micron.\n", 1e6 * pt2.
X,
1720 1e6 * pt2.
Y, 1e6 * pt2.
Z);
1721 printf(
"Please redo the geometry.\n");
1729 printf(
"Total final number of elements: %d\n",
NbElements);
1736 neBEMMessage(
"neBEMDiscretize - problem writing Elements.\n");
1743 "neBEMDiscretize - unformatted write not inplemented yet.\n");
1751 printf(
"to complete discretization\n");
1767 neBEMMessage(
"neBEMBondaryInitialConditions - BoundaryConditions");
1772 neBEMMessage(
"neBEMBondaryInitialConditions - InitialConditions");
1778 printf(
"Boundary & initial conditions can be set in states 4 / 7 ...\n");
1779 printf(
"returning ...\n");
1785 printf(
"to setup boundary and initial conditions.\n");
1814 clock_t startSolveClock = clock();
1817 neBEMMessage(
"neBEMSolve - TimeStep cannot be less than one!;\n");
1818 neBEMMessage(
" Please put TimeStep = 1 for static problems.\n");
1825 neBEMMessage(
"neBEMSolve - NewBC zero for neBEMState = 8!");
1849 neBEMMessage(
"neBEMSolve - Failure computing new solution");
1860 printf(
"neBEMSolve: Nothing to do ... returning ...\n");
1869 printf(
"neBEMSolve: neBEMSolve can be called only in state 5 / 8 ...\n");
1870 printf(
"returning ...\n");
1876 "neBEMSolve: Approximations were made while computing the influence "
1878 printf(
" Please check the \"%s/Isles.log\" file.\n",
PPOutDir);
1881 clock_t stopSolveClock = clock();
1883 printf(
"to complete solve\n");
1887 clock_t startVoxelClock = clock();
1891 neBEMMessage(
"neBEMSolve - Failure computing VoxelFPR");
1895 clock_t stopVoxelClock = clock();
1897 printf(
"to compute VoxelFPR\n");
1902 clock_t startMapClock = clock();
1910 clock_t stopMapClock = clock();
1912 printf(
"to compute MapFPR\n");
1930 clock_t startFastClock = clock();
1934 for (
int block = 1; block <=
FastVol.NbBlocks; ++block) {
1948 printf(
"NbPtSkip: %d\n",
NbPtSkip);
1952 printf(
"LX: %le\n",
FastVol.LX);
1953 printf(
"LY: %le\n",
FastVol.LY);
1954 printf(
"LZ: %le\n",
FastVol.LZ);
1955 printf(
"CornerX: %le\n",
FastVol.CrnrX);
1956 printf(
"CornerY: %le\n",
FastVol.CrnrY);
1957 printf(
"CornerZ: %le\n",
FastVol.CrnrZ);
1958 printf(
"YStagger: %le\n",
FastVol.YStagger);
1959 printf(
"NbOfBlocks: %d\n",
FastVol.NbBlocks);
1960 for (
int block = 1; block <=
FastVol.NbBlocks; ++block) {
1961 printf(
"NbOfXCells[%d]: %d\n", block,
BlkNbXCells[block]);
1962 printf(
"NbOfYCells[%d]: %d\n", block,
BlkNbYCells[block]);
1963 printf(
"NbOfZCells[%d]: %d\n", block,
BlkNbZCells[block]);
1964 printf(
"LZ[%d]: %le\n", block,
BlkLZ[block]);
1965 printf(
"CornerZ[%d]: %le\n", block,
BlkCrnrZ[block]);
1967 printf(
"NbOfOmitVols: %d\n",
FastVol.NbOmitVols);
1969 for (
int omit = 1; omit <=
FastVol.NbOmitVols; ++omit) {
1970 printf(
"OmitVolLX[%d]: %le\n", omit,
OmitVolLX[omit]);
1971 printf(
"OmitVolLY[%d]: %le\n", omit,
OmitVolLY[omit]);
1972 printf(
"OmitVolLZ[%d]: %le\n", omit,
OmitVolLZ[omit]);
1973 printf(
"OmitCrnrX[%d]: %le\n", omit,
OmitVolCrnrX[omit]);
1974 printf(
"OmitCrnrY[%d]: %le\n", omit,
OmitVolCrnrY[omit]);
1975 printf(
"OmitCrnrZ[%d]: %le\n", omit,
OmitVolCrnrZ[omit]);
1978 printf(
"MaxXCells, MaxYCells, MaxZCells: %d, %d, %d\n", MaxXCells,
1979 MaxYCells, MaxZCells);
2000 MaxYCells + 1, 1, MaxZCells + 1);
2002 MaxYCells + 1, 1, MaxZCells + 1);
2004 MaxYCells + 1, 1, MaxZCells + 1);
2006 MaxYCells + 1, 1, MaxZCells + 1);
2012 neBEMMessage(
"neBEMSolve - Failure computing FastVolPF");
2016 clock_t stopFastClock = clock();
2018 printf(
"to compute FastVolPF\n");
2022 int nbXCells, nbYCells, nbZCells;
2024 double xpt, ypt, zpt;
2026 char FastVolPFFile[256];
2028 strcat(FastVolPFFile,
"/FastVolPF.out");
2029 FILE *fFastVolPF = fopen(FastVolPFFile,
"r");
2030 if (fFastVolPF == NULL) {
2035 fscanf(fFastVolPF,
"#block\tX\tY\tZ\tPot\tFX\tFY\tFZ\n");
2037 for (
int block = 1; block <=
FastVol.NbBlocks; ++block) {
2042 for (
int i = 1; i <= nbXCells + 1; ++i) {
2043 for (
int j = 1; j <= nbYCells + 1; ++j) {
2044 for (
int k = 1; k <= nbZCells + 1; ++k) {
2045 fscanf(fFastVolPF,
"%d\t%le\t%le\t%le\t%le\t%le\t%le\t%le\n",
2046 &tmpblk, &xpt, &ypt, &zpt, &
FastPot[block][i][j][k],
2048 &
FastFZ[block][i][j][k]);
2056 char StgFastVolPFFile[256];
2057 strcpy(StgFastVolPFFile,
BCOutDir);
2058 strcat(StgFastVolPFFile,
"/StgFastVolPF.out");
2059 FILE *fStgFastVolPF = fopen(StgFastVolPFFile,
"r");
2060 if (fStgFastVolPF == NULL) {
2065 fscanf(fStgFastVolPF,
"#block\tX\tY\tZ\tPot\tFX\tFY\tFZ\n");
2067 for (
int block = 1; block <=
FastVol.NbBlocks; ++block) {
2072 for (
int i = 1; i <= nbXCells + 1; ++i) {
2073 for (
int j = 1; j <= nbYCells + 1; ++j) {
2074 for (
int k = 1; k <= nbZCells + 1; ++k) {
2075 fscanf(fStgFastVolPF,
"%d\t%le\t%le\t%le\t%le\t%le\t%le\t%le\n",
2076 &tmpblk, &xpt, &ypt, &zpt, &
StgFastPot[block][i][j][k],
2083 fclose(fStgFastVolPF);
2086 clock_t stopFastClock = clock();
2088 printf(
"to read FastVolPF\n");
2098 printf(
"neBEMPF cannot be called before reaching state 9.\n");
2114 fstatus =
PFAtPoint(point, &Pot, field);
2142 static int IdWtField = 0;
2149 "neBEMPrepareWeightingField: Weighting computations only meaningful "
2150 "beyond neBEMState 7 ...\n");
2155 const int MaxWtField =
2158 WtFieldChDen = (
double **)malloc(MaxWtField *
sizeof(
double *));
2160 AvWtChDen = (
double **)malloc(MaxWtField *
sizeof(
double *));
2163 if (IdWtField >= MaxWtField) {
2165 "neBEMPrepareWeightingField: reached MaxWtField (%d) weighting "
2170 printf(
"\nPreparing weighting field for %d-th set.\n", IdWtField);
2179 neBEMMessage(
"neBEMPrepareWeightingField - WeightingFieldSolution");
2182 printf(
"Computed weighting field solution\n");
2192 area += (
EleArr + ele - 1)->G.dA;
2199 printf(
"Computed primitive-averaged weighting field solutions\n");
2202 char strIdWtField[5];
2203 snprintf(strIdWtField, 5,
"%d", IdWtField);
2209 char fileWtField[256];
2210 strcpy(fileWtField,
"neBEMInp/neBEMFixedWtField_");
2211 strcat(fileWtField, strIdWtField);
2212 strcat(fileWtField,
".inp");
2213 FILE *fixedWtInpFile = fopen(fileWtField,
"r");
2214 if (fixedWtInpFile == NULL) {
2216 "neBEMFixedWtField.inp absent ... assuming OptFixedWtField = 0 "
2224 fscanf(fixedWtInpFile,
"OptFixedWtField: %d\n",
2226 fscanf(fixedWtInpFile,
"FixedWtPotential: %lg\n",
2228 fscanf(fixedWtInpFile,
"FixedWtFieldX: %lg\n", &
FixedWtFieldX[IdWtField]);
2229 fscanf(fixedWtInpFile,
"FixedWtFieldY: %lg\n", &
FixedWtFieldY[IdWtField]);
2230 fscanf(fixedWtInpFile,
"FixedWtFieldZ: %lg\n", &
FixedWtFieldZ[IdWtField]);
2231 fclose(fixedWtInpFile);
2242 char fileWtField[256];
2243 strcpy(fileWtField,
"neBEMInp/neBEMWtFldFastVol_");
2244 strcat(fileWtField, strIdWtField);
2245 strcat(fileWtField,
".inp");
2246 FILE *fastWtFldInpFile = fopen(fileWtField,
"r");
2248 if (fastWtFldInpFile == NULL) {
2250 "neBEMWtFldFastVol.inp absent ... assuming OptWtFldFastVol = 0 "
2260 fscanf(fastWtFldInpFile,
"OptFastVol: %d\n", &
OptWtFldFastVol[IdWtField]);
2261 fscanf(fastWtFldInpFile,
"OptStaggerFastVol: %d\n",
2263 fscanf(fastWtFldInpFile,
"OptCreateFastPF: %d\n",
2265 fscanf(fastWtFldInpFile,
"OptReadFastPF: %d\n",
2267 fscanf(fastWtFldInpFile,
"NbPtSkip: %d\n", &
WtFldNbPtSkip[IdWtField]);
2268 fscanf(fastWtFldInpFile,
"NbStgPtSkip: %d\n",
2270 fscanf(fastWtFldInpFile,
"LX: %le\n", &
WtFldFastVol[IdWtField].LX);
2271 fscanf(fastWtFldInpFile,
"LY: %le\n", &
WtFldFastVol[IdWtField].LY);
2272 fscanf(fastWtFldInpFile,
"LZ: %le\n", &
WtFldFastVol[IdWtField].LZ);
2273 fscanf(fastWtFldInpFile,
"CornerX: %le\n",
2275 fscanf(fastWtFldInpFile,
"CornerY: %le\n",
2277 fscanf(fastWtFldInpFile,
"CornerZ: %le\n",
2279 fscanf(fastWtFldInpFile,
"YStagger: %le\n",
2283 fscanf(fastWtFldInpFile,
"NbOfBlocks: %d\n",
2293 for (
int block = 1; block <=
WtFldFastVol[IdWtField].NbBlocks; ++block) {
2294 fscanf(fastWtFldInpFile,
"NbOfXCells: %d\n",
2296 fscanf(fastWtFldInpFile,
"NbOfYCells: %d\n",
2298 fscanf(fastWtFldInpFile,
"NbOfZCells: %d\n",
2300 fscanf(fastWtFldInpFile,
"LZ: %le\n", &
WtFldBlkLZ[IdWtField][block]);
2301 fscanf(fastWtFldInpFile,
"CornerZ: %le\n",
2304 fscanf(fastWtFldInpFile,
"NbOfOmitVols: %d\n",
2319 for (
int omit = 1; omit <=
WtFldFastVol[IdWtField].NbOmitVols; ++omit) {
2320 fscanf(fastWtFldInpFile,
"OmitVolLX: %le\n",
2322 fscanf(fastWtFldInpFile,
"OmitVolLY: %le\n",
2324 fscanf(fastWtFldInpFile,
"OmitVolLZ: %le\n",
2326 fscanf(fastWtFldInpFile,
"OmitVolCornerX: %le\n",
2328 fscanf(fastWtFldInpFile,
"OmitVolCornerY: %le\n",
2330 fscanf(fastWtFldInpFile,
"OmitVolCornerZ: %le\n",
2334 fscanf(fastWtFldInpFile,
"NbOfIgnoreVols: %d\n",
2349 for (
int ignore = 1; ignore <=
WtFldFastVol[IdWtField].NbIgnoreVols;
2351 fscanf(fastWtFldInpFile,
"IgnoreVolLX: %le\n",
2353 fscanf(fastWtFldInpFile,
"IgnoreVolLY: %le\n",
2355 fscanf(fastWtFldInpFile,
"IgnoreVolLZ: %le\n",
2357 fscanf(fastWtFldInpFile,
"IgnoreVolCornerX: %le\n",
2359 fscanf(fastWtFldInpFile,
"IgnoreVolCornerY: %le\n",
2361 fscanf(fastWtFldInpFile,
"IgnoreVolCornerZ: %le\n",
2366 for (
int ignore = 1; ignore <=
WtFldFastVol[IdWtField].NbIgnoreVols;
2368 printf(
"WtFldIgnoreVolLX: %le\n",
2370 printf(
"WtFldIgnoreVolLY: %le\n",
2372 printf(
"WtFldIgnoreVolLZ: %le\n",
2374 printf(
"WtFldIgnoreVolCornerX: %le\n",
2376 printf(
"WtFldIgnoreVolCornerY: %le\n",
2378 printf(
"WtFldIgnoreVolCornerZ: %le\n",
2382 fclose(fastWtFldInpFile);
2388 clock_t startFastClock = clock();
2392 for (
int block = 1; block <=
WtFldFastVol[IdWtField].NbBlocks; ++block) {
2417 printf(
"CornerX: %le\n",
WtFldFastVol[IdWtField].CrnrX);
2418 printf(
"CornerY: %le\n",
WtFldFastVol[IdWtField].CrnrY);
2419 printf(
"CornerZ: %le\n",
WtFldFastVol[IdWtField].CrnrZ);
2420 printf(
"YStagger: %le\n",
WtFldFastVol[IdWtField].YStagger);
2421 printf(
"NbOfBlocks: %d\n",
WtFldFastVol[IdWtField].NbBlocks);
2422 for (
int block = 1; block <=
WtFldFastVol[IdWtField].NbBlocks; ++block) {
2423 printf(
"NbOfXCells[%d]: %d\n", block,
2425 printf(
"NbOfYCells[%d]: %d\n", block,
2427 printf(
"NbOfZCells[%d]: %d\n", block,
2429 printf(
"LZ[%d]: %le\n", block,
WtFldBlkLZ[IdWtField][block]);
2430 printf(
"CornerZ[%d]: %le\n", block,
WtFldBlkCrnrZ[IdWtField][block]);
2432 printf(
"NbOfOmitVols: %d\n",
WtFldFastVol[IdWtField].NbOmitVols);
2434 for (
int omit = 1; omit <=
WtFldFastVol[IdWtField].NbOmitVols; ++omit) {
2435 printf(
"OmitVolLX[%d]: %le\n", omit,
WtFldOmitVolLX[IdWtField][omit]);
2436 printf(
"OmitVolLY[%d]: %le\n", omit,
WtFldOmitVolLY[IdWtField][omit]);
2437 printf(
"OmitVolLZ[%d]: %le\n", omit,
WtFldOmitVolLZ[IdWtField][omit]);
2438 printf(
"OmitCrnrX[%d]: %le\n", omit,
2440 printf(
"OmitCrnrY[%d]: %le\n", omit,
2442 printf(
"OmitCrnrZ[%d]: %le\n", omit,
2446 printf(
"MaxXCells, MaxYCells, MaxZCells: %d, %d, %d\n", MaxXCells,
2447 MaxYCells, MaxZCells);
2448 printf(
"NbOfIgnoreVols: %d\n",
WtFldFastVol[IdWtField].NbIgnoreVols);
2459 MaxYCells + 1, 1, MaxZCells + 1);
2462 MaxYCells + 1, 1, MaxZCells + 1);
2465 MaxYCells + 1, 1, MaxZCells + 1);
2468 MaxYCells + 1, 1, MaxZCells + 1);
2474 MaxYCells + 1, 1, MaxZCells + 1);
2477 MaxYCells + 1, 1, MaxZCells + 1);
2480 MaxYCells + 1, 1, MaxZCells + 1);
2483 MaxYCells + 1, 1, MaxZCells + 1);
2489 clock_t stopFastClock = clock();
2491 printf(
"to compute WtFldFastVolPF\n");
2498 int nbXCells, nbYCells, nbZCells;
2500 double xpt, ypt, zpt;
2503 char stringIdWtField[5];
2504 snprintf(stringIdWtField, 5,
"%d", IdWtField);
2505 char FastVolPFFile[256];
2507 strcat(FastVolPFFile,
"/WtFldFastVolPF_");
2508 strcat(FastVolPFFile, stringIdWtField);
2509 strcat(FastVolPFFile,
".out");
2510 FILE *fFastVolPF = fopen(FastVolPFFile,
"r");
2511 if (fFastVolPF == NULL) {
2516 fscanf(fFastVolPF,
"#block\tX\tY\tZ\tPot\tFX\tFY\tFZ\n");
2518 for (
int block = 1; block <=
WtFldFastVol[IdWtField].NbBlocks; ++block) {
2523 for (
int i = 1; i <= nbXCells + 1; ++i) {
2524 for (
int j = 1; j <= nbYCells + 1; ++j) {
2525 for (
int k = 1; k <= nbZCells + 1; ++k) {
2526 fscanf(fFastVolPF,
"%d\t%le\t%le\t%le\t%le\t%le\t%le\t%le\n",
2527 &tmpblk, &xpt, &ypt, &zpt,
2540 snprintf(stringIdWtField, 5,
"%d", IdWtField);
2541 char StgFastVolPFFile[256];
2542 strcpy(StgFastVolPFFile,
BCOutDir);
2544 strcat(StgFastVolPFFile,
"/StgWtFldFastVolPF_");
2545 strcat(StgFastVolPFFile, stringIdWtField);
2546 strcat(StgFastVolPFFile,
".out");
2547 FILE* fStgFastVolPF = fopen(StgFastVolPFFile,
"r");
2548 if (fStgFastVolPF == NULL) {
2553 fscanf(fStgFastVolPF,
"#block\tX\tY\tZ\tPot\tFX\tFY\tFZ\n");
2555 for (
int block = 1; block <=
WtFldFastVol[IdWtField].NbBlocks;
2561 for (
int i = 1; i <= nbXCells + 1; ++i) {
2562 for (
int j = 1; j <= nbYCells + 1; ++j) {
2563 for (
int k = 1; k <= nbZCells + 1; ++k) {
2564 fscanf(fStgFastVolPF,
"%d\t%le\t%le\t%le\t%le\t%le\t%le\t%le\n",
2565 &tmpblk, &xpt, &ypt, &zpt,
2574 fclose(fStgFastVolPF);
2577 clock_t stopFastClock = clock();
2579 printf(
"to read WtFldFastVolPF\n");
2595 for (
int id = 1;
id < MaxWtField; ++id) {
2609 printf(
"neBEMWeightingField cannot be called before reaching state 9.\n");
2625 neBEMMessage(
"neBEMWeightingField - WtFldFastPFAtPoint");
2629 int fstatus =
WtFldPFAtPoint(point, &potential, field, IdWtField);
2641 double sumcharge = 0.0;
2644 for (
int elem = 1; elem <=
NbElements; ++elem) {
2646 int prim = (
EleArr + elem - 1)->PrimitiveNb;
2652 if (volref + 1 != volume) {
2663 if ((xrpt == 0) && (yrpt == 0) && (zrpt == 0))
2686 "IslesCntr: %d, ExactCntr: %d, FailureCntr: %d, ApproxCntr: %d\n",
2690 printf(
"neBEM ends ... bye!\n");
2703 char strModelCntr[10], strMeshCntr[10], strBCCntr[10], strPPCntr[10];
2707 snprintf(strModelCntr, 10,
"/Model%d",
ModelCntr);
2708 snprintf(strMeshCntr, 10,
"/M%d",
MeshCntr);
2709 snprintf(strBCCntr, 10,
"/BC%d",
BCCntr);
2710 snprintf(strPPCntr, 10,
"/PP%d",
PPCntr);
2789 strcat(subdir,
"/Primitives/");
2796 strcat(subdir,
"/Elements/");
2803 strcat(subdir,
"/GViewDir/");
2817 if (stat(dirname, &st) == 0) {
2819 printf(
"Previous %s exists ... using the existing directory ... \n",
2822 snprintf(dirstr, 256,
"mkdir -p %s", dirname);
2825 printf(
"Cannot create dirname %s ... returning ...\n", dirname);
2838 if (stat(dirname, &st) == 0)
2840 printf(
"Previous %s exists ... please check inputs and counters ... \n",
2844 snprintf(dirstr, 256,
"mkdir -p %s", dirname);
2847 printf(
"Cannot create dirname %s ... returning ...\n", dirname);
2856 fprintf(stdout,
"neBEMMessage: %s\n", message);
2862 char PrimitiveFile[256];
2865 strcat(PrimitiveFile,
"/Primitives/StorePrims.out");
2867 FILE *fStrPrm = fopen(PrimitiveFile,
"w");
2868 if (fStrPrm == NULL) {
2869 neBEMMessage(
"WritePrimitives - Could not create file to store primitives");
2878 fprintf(fStrPrm,
"%d\n",
PrimType[prim]);
2882 for (
int vert = 0; vert <
NbVertices[prim]; ++vert) {
2883 fprintf(fStrPrm,
"%le %le %le\n",
XVertex[prim][vert],
2887 fprintf(fStrPrm,
"%le %le %le\n",
XNorm[prim],
YNorm[prim],
ZNorm[prim]);
2888 fprintf(fStrPrm,
"%le\n",
Radius[prim]);
2911 char ElementFile[256];
2914 strcat(ElementFile,
"/Elements/StoreElems.out");
2916 FILE *fStrEle = fopen(ElementFile,
"w");
2917 if (fStrEle == NULL) {
2918 neBEMMessage(
"WriteElements - Could not create file to store elements");
2926 fprintf(fStrEle,
"%d\n",
NbWireSeg[prim]);
2931 for (
int ele = 1; ele <=
NbElements; ++ele) {
2932 fprintf(fStrEle,
"%d %d %d %d %d\n", (
EleArr + ele - 1)->DeviceNb,
2933 (
EleArr + ele - 1)->ComponentNb, (
EleArr + ele - 1)->PrimitiveNb,
2934 (
EleArr + ele - 1)->InterfaceId, (
EleArr + ele - 1)->Id);
2935 fprintf(fStrEle,
"%d %le %le %le %le %le %le\n", (
EleArr + ele - 1)->G.Type,
2936 (
EleArr + ele - 1)->G.Origin.X, (
EleArr + ele - 1)->G.Origin.Y,
2937 (
EleArr + ele - 1)->G.Origin.Z, (
EleArr + ele - 1)->G.LX,
2939 fprintf(fStrEle,
"%le %le %le\n", (
EleArr + ele - 1)->G.DC.XUnit.X,
2940 (
EleArr + ele - 1)->G.DC.XUnit.Y, (
EleArr + ele - 1)->G.DC.XUnit.Z);
2941 fprintf(fStrEle,
"%le %le %le\n", (
EleArr + ele - 1)->G.DC.YUnit.X,
2942 (
EleArr + ele - 1)->G.DC.YUnit.Y, (
EleArr + ele - 1)->G.DC.YUnit.Z);
2943 fprintf(fStrEle,
"%le %le %le\n", (
EleArr + ele - 1)->G.DC.ZUnit.X,
2944 (
EleArr + ele - 1)->G.DC.ZUnit.Y, (
EleArr + ele - 1)->G.DC.ZUnit.Z);
2945 fprintf(fStrEle,
"%d %le\n", (
EleArr + ele - 1)->E.Type,
2946 (
EleArr + ele - 1)->E.Lambda);
2947 fprintf(fStrEle,
"%d %le %le %le %le\n", (
EleArr + ele - 1)->BC.NbOfBCs,
2948 (
EleArr + ele - 1)->BC.CollPt.X, (
EleArr + ele - 1)->BC.CollPt.Y,
2949 (
EleArr + ele - 1)->BC.CollPt.Z, (
EleArr + ele - 1)->BC.Value);
2951 (
EleArr + ele - 1)->Assigned);
2958 fprintf(fStrEle,
"%d %le\n", (
PointKnChArr + pt - 1)->Nb,
2960 fprintf(fStrEle,
"%le %le %le\n", (
PointKnChArr + pt - 1)->P.X,
2965 fprintf(fStrEle,
"%d %le %le\n", (
LineKnChArr + line - 1)->Nb,
2968 fprintf(fStrEle,
"%le %le %le\n", (
LineKnChArr + line - 1)->Start.X,
2971 fprintf(fStrEle,
"%le %le %le\n", (
LineKnChArr + line - 1)->Stop.X,
2976 fprintf(fStrEle,
"%d %d %le\n", (
AreaKnChArr + area - 1)->Nb,
2979 for (
int vert = 1; vert <= (
AreaKnChArr + area - 1)->NbVertices; ++vert) {
2980 fprintf(fStrEle,
"%le %le %le\n",
2988 fprintf(fStrEle,
"%d %d %le\n", (
VolumeKnChArr + vol - 1)->Nb,
2991 for (
int vert = 1; vert <= (
VolumeKnChArr + vol - 1)->NbVertices; ++vert) {
2992 fprintf(fStrEle,
"%le %le %le\n",
3007 char PrimitiveFile[256];
3010 strcat(PrimitiveFile,
"/Primitives/StorePrims.out");
3012 FILE *fStrPrm = fopen(PrimitiveFile,
"r");
3013 if (fStrPrm == NULL) {
3014 neBEMMessage(
"ReadPrimitives - Could not open file to read primitives");
3056 fscanf(fStrPrm,
"%d\n", &
PrimType[prim]);
3060 for (
int vert = 0; vert <
NbVertices[prim]; ++vert) {
3061 fscanf(fStrPrm,
"%le %le %le\n", &
XVertex[prim][vert],
3065 fscanf(fStrPrm,
"%le %le %le\n", &
XNorm[prim], &
YNorm[prim], &
ZNorm[prim]);
3066 fscanf(fStrPrm,
"%le\n", &
Radius[prim]);
3090 for (
int volref = 0; volref <=
VolMax; ++volref) {
3095 printf(
"volref: %d\n", volref);
3096 printf(
"shape: %d, material: %d\n",
volShape[volref],
3109 char ElementFile[256];
3111 strcat(ElementFile,
"/Elements/StoreElems.out");
3113 FILE *fStrEle = fopen(ElementFile,
"r");
3114 if (fStrEle == NULL) {
3115 neBEMMessage(
"ReadElements - Could not open file to read elements");
3123 fscanf(fStrEle,
"%d\n", &
NbWireSeg[prim]);
3136 printf(
"neBEMDiscretize: Re-allocating EleArr failed.\n");
3140 printf(
"neBEMDiscretize: Re-allocated EleArr.\n");
3150 neBEMMessage(
"neBEMDiscretize - EleArr malloc; neBEMState mismatch!");
3154 for (
int ele = 1; ele <=
NbElements; ++ele) {
3155 fscanf(fStrEle,
"%hd %d %d %d %d\n", &(
EleArr + ele - 1)->DeviceNb,
3156 &(
EleArr + ele - 1)->ComponentNb, &(
EleArr + ele - 1)->PrimitiveNb,
3157 &(
EleArr + ele - 1)->InterfaceId, &(
EleArr + ele - 1)->Id);
3158 fscanf(fStrEle,
"%hd %le %le %le %le %le %le\n",
3159 &(
EleArr + ele - 1)->G.Type, &(
EleArr + ele - 1)->G.Origin.X,
3160 &(
EleArr + ele - 1)->G.Origin.Y, &(
EleArr + ele - 1)->G.Origin.Z,
3162 &(
EleArr + ele - 1)->G.dA);
3163 fscanf(fStrEle,
"%le %le %le\n", &(
EleArr + ele - 1)->G.DC.XUnit.X,
3164 &(
EleArr + ele - 1)->G.DC.XUnit.Y,
3165 &(
EleArr + ele - 1)->G.DC.XUnit.Z);
3166 fscanf(fStrEle,
"%le %le %le\n", &(
EleArr + ele - 1)->G.DC.YUnit.X,
3167 &(
EleArr + ele - 1)->G.DC.YUnit.Y,
3168 &(
EleArr + ele - 1)->G.DC.YUnit.Z);
3169 fscanf(fStrEle,
"%le %le %le\n", &(
EleArr + ele - 1)->G.DC.ZUnit.X,
3170 &(
EleArr + ele - 1)->G.DC.ZUnit.Y,
3171 &(
EleArr + ele - 1)->G.DC.ZUnit.Z);
3172 fscanf(fStrEle,
"%hd %le\n", &(
EleArr + ele - 1)->E.Type,
3173 &(
EleArr + ele - 1)->E.Lambda);
3174 fscanf(fStrEle,
"%hd %le %le %le %le\n", &(
EleArr + ele - 1)->BC.NbOfBCs,
3175 &(
EleArr + ele - 1)->BC.CollPt.X, &(
EleArr + ele - 1)->BC.CollPt.Y,
3176 &(
EleArr + ele - 1)->BC.CollPt.Z, &(
EleArr + ele - 1)->BC.Value);
3178 &(
EleArr + ele - 1)->Assigned);
3185 fscanf(fStrEle,
"%d %le\n", &(
PointKnChArr + pt - 1)->Nb,
3187 fscanf(fStrEle,
"%le %le %le\n", &(
PointKnChArr + pt - 1)->P.X,
3192 fscanf(fStrEle,
"%d %le %le\n", &(
LineKnChArr + line - 1)->Nb,
3195 fscanf(fStrEle,
"%le %le %le\n", &(
LineKnChArr + line - 1)->Start.X,
3198 fscanf(fStrEle,
"%le %le %le\n", &(
LineKnChArr + line - 1)->Stop.X,
3204 fscanf(fStrEle,
"%d %d %le\n", &(
AreaKnChArr + area - 1)->Nb,
3207 for (
int vert = 1; vert <= (
AreaKnChArr + area - 1)->NbVertices; ++vert) {
3208 fscanf(fStrEle,
"%le %le %le\n",
3216 fscanf(fStrEle,
"%d %d %le\n", &(
VolumeKnChArr + vol - 1)->Nb,
3219 for (
int vert = 1; vert <= (
VolumeKnChArr + vol - 1)->NbVertices; ++vert) {
3220 fscanf(fStrEle,
"%le %le %le\n",
3234 double elapsedTime = ((double)(t1 - t0)) / CLOCKS_PER_SEC;
3235 printf(
"neBEMV%s TimeElapsed ===> %lg seconds ",
neBEMVersion, elapsedTime);
3237 return (elapsedTime);
3243 unsigned int number_of_lines = 0;
3245 FILE *infile = fopen(fname,
"r");
3248 while (EOF != (ch = getc(infile)))
3249 if (
'\n' == ch) ++number_of_lines;
3251 return number_of_lines;
3258 double anglesum = 0.0;
3265 for (
int i = 0; i < n; i++) {
3267 p1.
X = p[i].
X - q.
X;
3268 p1.
Y = p[i].
Y - q.
Y;
3269 p1.
Z = p[i].
Z - q.
Z;
3274 p2.
X = p[i + 1].
X - q.
X;
3275 p2.
Y = p[i + 1].
Y - q.
Y;
3276 p2.
Z = p[i + 1].
Z - q.
Z;
3278 p2.
X = p[0].
X - q.
X;
3279 p2.
Y = p[0].
Y - q.
Y;
3280 p2.
Z = p[0].
Z - q.
Z;
3287 if (m1 * m2 <= 1.0e-12) {
3291 double costheta = (p1.
X * p2.
X + p1.
Y * p2.
Y + p1.
Z * p2.
Z) / (m1 * m2);
3302 anglesum += acos(costheta);
int FastPFAtPoint(Point3D *globalP, double *Potential, Vector3D *globalF)
int WtFldPFAtPoint(Point3D *globalP, double *Potential, Vector3D *globalF, int IdWtField)
int CreateWtFldFastVolPF(int IdWtField)
int WtFldFastPFAtPoint(Point3D *globalP, double *Potential, Vector3D *globalF, int IdWtField)
int PFAtPoint(Point3D *globalP, double *Potential, Vector3D *globalF)
int CreateFastVolPF(void)
ISLESGLOBAL int ApproxCntr
ISLESGLOBAL int IslesCntr
ISLESGLOBAL FILE * fIsles
ISLESGLOBAL int FailureCntr
ISLESGLOBAL int ExactCntr
ISLESGLOBAL char ISLESVersion[10]
double GetDistancePoint3D(Point3D *a, Point3D *b)
int neBEMVolumeDescription(int vol, int *shape, int *material, double *epsilon, double *potential, double *charge, int *boundarytype)
Return information about a volume.
int neBEMGetInputsFromFiles(void)
Do-nothing function (no file inputs).
int neBEMSetDefaults(void)
Assign default values to some of the important global variables.
int neBEMGetMirror(int, int *ix, int *jx, double *sx, int *iy, int *jy, double *sy, int *iz, int *jz, double *sz)
int neBEMGetNbPrimitives()
Return the number of primitives.
int neBEMGetBoundingPlanes(int *ixmin, double *cxmin, double *vxmin, int *ixmax, double *cxmax, double *vxmax, int *iymin, double *cymin, double *vymin, int *iymax, double *cymax, double *vymax, int *izmin, double *czmin, double *vzmin, int *izmax, double *czmax, double *vzmax)
int neBEMGetPrimitive(int prim, int *nvertex, double xvert[], double yvert[], double zvert[], double *xnorm, double *ynorm, double *znorm, int *volref1, int *volref2)
Return one primitive at a time.
int neBEMGetPeriodicities(int, int *ix, int *jx, double *sx, int *iy, int *jy, double *sy, int *iz, int *jz, double *sz)
double neBEMVolumeCharge(int volume)
int neBEMMessage(const char *message)
int CreateOrUseDir(char dirname[])
int neBEMBoundaryInitialConditions(void)
int neBEMDiscretize(int **NbElemsOnPrimitives)
int WritePrimitives(void)
int neBEMPF(Point3D *point, double *potential, Vector3D *field)
int neBEMGetNbOfLines(const char fname[])
int neBEMReadGeometry(void)
double neBEMChkInPoly(int n, Point3D *p, Point3D q)
double neBEMTimeElapsed(clock_t t0, clock_t t1)
int neBEMInitialize(void)
int CreateDirOrQuit(char dirname[])
void neBEMDeleteAllWeightingFields(void)
void neBEMDeleteWeightingField(int IdWtField)
int neBEMPrepareWeightingField(int nprim, int primlist[])
double neBEMWeightingField(Point3D *point, Vector3D *field, int IdWtField)
INTFACEGLOBAL clock_t stopClock
INTFACEGLOBAL FILE * fgnuPrim
INTFACEGLOBAL int NbThreads
INTFACEGLOBAL FILE * fgnuElem
INTFACEGLOBAL int neBEMState
INTFACEGLOBAL int OptPrintVolumeDetails
INTFACEGLOBAL FILE * fgnuMesh
INTFACEGLOBAL char DeviceInputFile[256]
INTFACEGLOBAL int OptDeviceFile
INTFACEGLOBAL int OptPrintPrimaryDetails
INTFACEGLOBAL clock_t startClock
INTFACEGLOBAL int OptGnuplot
INTFACEGLOBAL int OptReuseDir
int ComputeSolution(void)
int WeightingFieldSolution(int NbPrimsWtField, int PrimListWtField[], double solnarray[])
neBEMGLOBAL Element * EleArr
neBEMGLOBAL double * ApplPot
neBEMGLOBAL double **** FastFY
neBEMGLOBAL int DebugLevel
neBEMGLOBAL int NbVolumes
neBEMGLOBAL int WtFldNbPtSkip[MAXWtFld]
neBEMGLOBAL int * PeriodicInY
neBEMGLOBAL int * volMaterial
neBEMGLOBAL int OptStaggerFastVol
neBEMGLOBAL double **** FastFZ
neBEMGLOBAL int BoundaryConditions(void)
neBEMGLOBAL int * NbElmntsOnPrim
neBEMGLOBAL int OptRmPrim
neBEMGLOBAL double * ZNorm
neBEMGLOBAL int OptStaggerWtFldFastVol[MAXWtFld]
neBEMGLOBAL char MeshOutDir[256]
neBEMGLOBAL double **** StgWtFldFastPot[MAXWtFld]
neBEMGLOBAL int * MirrorTypeZ
neBEMGLOBAL double * OmitVolCrnrZ
neBEMGLOBAL double * MirrorDistYFromOrigin
neBEMGLOBAL double FixedWtFieldZ[MAXWtFld]
neBEMGLOBAL int OptStorePrimitives
neBEMGLOBAL int MaxNbVertices
neBEMGLOBAL int * BndPlaneInYMax
neBEMGLOBAL int * WtFldBlkNbZCells[MAXWtFld]
neBEMGLOBAL double * WtFldBlkLZ[MAXWtFld]
neBEMGLOBAL double * WtFldOmitVolCrnrY[MAXWtFld]
neBEMGLOBAL double * XBndPlaneInXMax
neBEMGLOBAL double **** WtFldFastFY[MAXWtFld]
neBEMGLOBAL double ** ZVertex
neBEMGLOBAL int * NbWireSeg
neBEMGLOBAL double * YBndPlaneInYMin
neBEMGLOBAL int * NbSurfSegX
neBEMGLOBAL int ** OrgnlToEffPrim
neBEMGLOBAL double * ZPeriod
neBEMGLOBAL PointKnCh * PointKnChArr
neBEMGLOBAL double * OmitVolLX
neBEMGLOBAL char PPOutDir[256]
neBEMGLOBAL VolumeKnCh * VolumeKnChArr
neBEMGLOBAL int OptStaggerMap
neBEMGLOBAL char neBEMVersion[10]
neBEMGLOBAL double **** StgFastFY
neBEMGLOBAL int OptFormattedFile
neBEMGLOBAL double * WtFldOmitVolLX[MAXWtFld]
neBEMGLOBAL double * VBndPlaneInZMin
neBEMGLOBAL int * BndPlaneInXMax
neBEMGLOBAL int OptWtFldFastVol[MAXWtFld]
neBEMGLOBAL int * WtFldBlkNbYCells[MAXWtFld]
neBEMGLOBAL double * XNorm
neBEMGLOBAL double **** StgFastFZ
neBEMGLOBAL double * YBndPlaneInYMax
neBEMGLOBAL double * PrimOriginZ
neBEMGLOBAL double * WtFldIgnoreVolCrnrZ[MAXWtFld]
neBEMGLOBAL double * BlkCrnrZ
neBEMGLOBAL int NbPrimitives
neBEMGLOBAL int * NbVertices
neBEMGLOBAL int WireElements(int prim, int nvertex, double xvert[], double yvert[], double zvert[], double radius, int volref1, int volref2, int inttype, double potential, double charge, double lambda, int NbWireSeg)
neBEMGLOBAL double FixedWtFieldY[MAXWtFld]
neBEMGLOBAL int AnalyzePrimitive(int, int *, int *)
neBEMGLOBAL int * PeriodicTypeX
neBEMGLOBAL int OptCreateFastPF
neBEMGLOBAL int NbElements
neBEMGLOBAL int StgWtFldNbPtSkip[MAXWtFld]
neBEMGLOBAL int OptFixedWtField[MAXWtFld]
neBEMGLOBAL double * VBndPlaneInYMax
neBEMGLOBAL double * WtFldOmitVolCrnrX[MAXWtFld]
neBEMGLOBAL double * Lambda
neBEMGLOBAL double * WtFldIgnoreVolCrnrY[MAXWtFld]
neBEMGLOBAL double * ZBndPlaneInZMax
neBEMGLOBAL int * PeriodicTypeY
neBEMGLOBAL int NbPointsKnCh
neBEMGLOBAL double * WtFldBlkCrnrZ[MAXWtFld]
neBEMGLOBAL double * Epsilon1
neBEMGLOBAL FastAlgoVol FastVol
neBEMGLOBAL double ** YVertex
neBEMGLOBAL int InitialConditions(void)
neBEMGLOBAL int * NbSurfSegZ
neBEMGLOBAL double * PrimOriginY
neBEMGLOBAL double * MirrorDistZFromOrigin
neBEMGLOBAL AreaKnCh * AreaKnChArr
neBEMGLOBAL DirnCosn3D * PrimDC
neBEMGLOBAL int * BndPlaneInZMin
neBEMGLOBAL int PrimAfter
neBEMGLOBAL double * VBndPlaneInXMin
neBEMGLOBAL double * BlkLZ
neBEMGLOBAL double * OmitVolCrnrX
neBEMGLOBAL int NbLinesKnCh
neBEMGLOBAL int NbFloatingConductors
neBEMGLOBAL double * OmitVolLZ
neBEMGLOBAL int NbStgPtSkip
neBEMGLOBAL int * VolRef1
neBEMGLOBAL double * XPeriod
neBEMGLOBAL double * volEpsilon
neBEMGLOBAL double * YNorm
neBEMGLOBAL double * WtFldIgnoreVolCrnrX[MAXWtFld]
neBEMGLOBAL char ModelOutDir[256]
neBEMGLOBAL int NbVolumesKnCh
neBEMGLOBAL double * volPotential
neBEMGLOBAL double ** XVertex
neBEMGLOBAL double * VBndPlaneInZMax
neBEMGLOBAL double * AvAsgndChDen
neBEMGLOBAL double * IgnoreVolCrnrY
neBEMGLOBAL double * XBndPlaneInXMin
neBEMGLOBAL int * VolRef2
neBEMGLOBAL char MapVersion[10]
neBEMGLOBAL double * OmitVolCrnrY
neBEMGLOBAL int * BndPlaneInXMin
neBEMGLOBAL char NativeOutDir[256]
neBEMGLOBAL double * WtFldIgnoreVolLY[MAXWtFld]
neBEMGLOBAL int OptCreateWtFldFastPF[MAXWtFld]
neBEMGLOBAL int * MirrorTypeY
neBEMGLOBAL double **** WtFldFastFZ[MAXWtFld]
neBEMGLOBAL double **** FastFX
neBEMGLOBAL int NbAreasKnCh
neBEMGLOBAL int * ElementEnd
neBEMGLOBAL double * AvChDen
neBEMGLOBAL double * WtFldOmitVolCrnrZ[MAXWtFld]
neBEMGLOBAL int OptFastVol
neBEMGLOBAL double * Radius
neBEMGLOBAL int * MirrorTypeX
neBEMGLOBAL double * WtFldOmitVolLZ[MAXWtFld]
neBEMGLOBAL int * BndPlaneInZMax
neBEMGLOBAL int * InterfaceType
neBEMGLOBAL double * OmitVolLY
neBEMGLOBAL int * BlkNbXCells
neBEMGLOBAL int * PrimType
neBEMGLOBAL int OptReadFastPF
neBEMGLOBAL int * BndPlaneInYMin
neBEMGLOBAL double * PrimLX
neBEMGLOBAL double **** StgWtFldFastFX[MAXWtFld]
neBEMGLOBAL int * BlkNbZCells
neBEMGLOBAL double * Solution
neBEMGLOBAL int * ElementBgn
neBEMGLOBAL double * PrimOriginX
neBEMGLOBAL double FixedWtPotential[MAXWtFld]
neBEMGLOBAL double ** AvWtChDen
neBEMGLOBAL double * IgnoreVolLY
neBEMGLOBAL double * IgnoreVolLX
neBEMGLOBAL int * PeriodicInZ
neBEMGLOBAL int * WtFldBlkNbXCells[MAXWtFld]
neBEMGLOBAL int * PeriodicInX
neBEMGLOBAL double * WtFldIgnoreVolLZ[MAXWtFld]
neBEMGLOBAL double **** WtFldFastFX[MAXWtFld]
neBEMGLOBAL double * WtFldIgnoreVolLX[MAXWtFld]
neBEMGLOBAL int OptUnformattedFile
neBEMGLOBAL double LengthScale
neBEMGLOBAL double * ZBndPlaneInZMin
neBEMGLOBAL FILE * fMeshLog
neBEMGLOBAL double * IgnoreVolLZ
neBEMGLOBAL double * VBndPlaneInYMin
neBEMGLOBAL int SurfaceElements(int prim, int nvertex, double xvert[], double yvert[], double zvert[], double xnorm, double ynorm, double znorm, int volref1, int volref2, int inttype, double potential, double charge, double lambda, int NbSegX, int NbSegZ)
neBEMGLOBAL double * volCharge
neBEMGLOBAL double **** WtFldFastPot[MAXWtFld]
neBEMGLOBAL VoxelVol Voxel
neBEMGLOBAL double ** WtFieldChDen
neBEMGLOBAL WtFldFastAlgoVol WtFldFastVol[MAXWtFld]
neBEMGLOBAL int OrgnlNbPrimitives
neBEMGLOBAL int * volBoundaryType
neBEMGLOBAL int ModelCntr
neBEMGLOBAL int * PeriodicTypeZ
neBEMGLOBAL double * WtFldOmitVolLY[MAXWtFld]
neBEMGLOBAL char NativePrimDir[256]
neBEMGLOBAL LineKnCh * LineKnChArr
neBEMGLOBAL double **** FastPot
neBEMGLOBAL double **** StgWtFldFastFY[MAXWtFld]
neBEMGLOBAL char DeviceOutDir[256]
neBEMGLOBAL double **** StgFastFX
neBEMGLOBAL int OptStoreElements
neBEMGLOBAL double * IgnoreVolCrnrX
neBEMGLOBAL char BCOutDir[256]
neBEMGLOBAL double * YPeriod
neBEMGLOBAL double * PrimLZ
neBEMGLOBAL int * volShape
neBEMGLOBAL double * MirrorDistXFromOrigin
neBEMGLOBAL double FixedWtFieldX[MAXWtFld]
neBEMGLOBAL double * VBndPlaneInXMax
neBEMGLOBAL double * Epsilon2
neBEMGLOBAL int OptReadWtFldFastPF[MAXWtFld]
neBEMGLOBAL double * ApplCh
neBEMGLOBAL double **** StgFastPot
neBEMGLOBAL double * IgnoreVolCrnrZ
neBEMGLOBAL int * BlkNbYCells
neBEMGLOBAL double **** StgWtFldFastFZ[MAXWtFld]
neBEMGLOBAL int OptStaggerVoxel
double **** d4tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh, long nwl, long nwh)
int * ivector(long nl, long nh)
double ** dmatrix(long nrl, long nrh, long ncl, long nch)
int ** imatrix(long nrl, long nrh, long ncl, long nch)
double * dvector(long nl, long nh)