2784 {
2785 double **RawInf = NULL;
2787
2789
2790
2791 printf("\ncomputing solution for each element: ");
2792
2794 printf("%6d ...", i);
2796
2797 double sum = 0.0;
2798 int j;
2799#ifdef _OPENMP
2800#pragma omp parallel for private(j) reduction(+ : sum)
2801#endif
2804 }
2805
2807 printf("\b\b\b\b\b\b\b\b\b\b");
2808 }
2809 fflush(stdout);
2810
2811 printf("\nsolution over for all elements ...\n");
2812 fflush(stdout);
2813
2817 printf("\nsolution over for system charge zero constraint ...\n");
2818 fflush(stdout);
2819 }
2820
2823 printf(
2824 "\nsolution over for floating conductor charge zero constraint "
2825 "...\n");
2826 fflush(stdout);
2827 }
2828 }
2829
2830
2831 char SolnFile[256];
2833 strcat(SolnFile, "/Soln.out");
2834 FILE *fSoln = fopen(SolnFile, "w");
2835 if (fSoln == NULL) {
2837 return -1;
2838 }
2839 fprintf(fSoln, "#EleNb\tX\tY\tZ\tSolution\tAssigned\tTotal\n");
2840 for (
int ele = 1; ele <=
NbElements; ++ele) {
2842 fprintf(fSoln, "%d\t%lg\t%lg\t%lg\t%.16lg\t%.16lg\t%.16lg\n", ele,
2843 (
EleArr + ele - 1)->G.Origin.X, (
EleArr + ele - 1)->G.Origin.Y,
2844 (
EleArr + ele - 1)->G.Origin.Z, (
EleArr + ele - 1)->Solution,
2845 (
EleArr + ele - 1)->Assigned,
2846 ((
EleArr + ele - 1)->Solution + (
EleArr + ele - 1)->Assigned));
2847 }
2848
2851 fprintf(fSoln, "#NbSystemChargeZero\tVSystemChargeZero\n");
2853 }
2855 fprintf(fSoln, "#NbFloatCon\tVFloatCon\n");
2857 }
2858 }
2859
2860 fclose(fSoln);
2861
2862
2863 char PrimSolnFile[256];
2865 strcat(PrimSolnFile, "/PrimSoln.out");
2866 FILE *fPrimSoln = fopen(PrimSolnFile, "w");
2867 if (fPrimSoln == NULL) {
2869 return -1;
2870 }
2871 fprintf(fPrimSoln,
2872 "#PrimNb\tEleBgn\tEleEnd\tX\tY\tZ\tAvChDen\tAvAsgndChDen\n");
2873
2875 double area = 0.0;
2878
2880 area += (
EleArr + ele - 1)->G.dA;
2883 (
EleArr + ele - 1)->Assigned * (
EleArr + ele - 1)->G.dA;
2884 }
2885
2888
2889 fprintf(fPrimSoln, "%d\t%d\t%d\t%lg\t%lg\t%lg\t%.16lg\t%.16g\n", prim,
2893 }
2894
2895 fclose(fPrimSoln);
2896
2898
2899
2900
2901
2902
2903
2904
2907 printf("Computing solution at the collocation points for comparison.\n");
2908 fflush(stdout);
2909
2911 printf("Influence matrix in memory ...\n");
2912 }
2913
2914
2915
2916
2919
2920 printf("Influence matrix in memory ...\n");
2921 } else {
2922 printf("Influence matrix NOT in memory ...\n");
2923
2925 printf("repeating influence coefficient matrix computation ...\n");
2926
2928
2929 if (fstatus != 0) {
2931 return -1;
2932 }
2933 }
2934
2936 printf(
2937 "reading influence coefficient matrix from formatted file...\n");
2938
2939 char InflFile[256];
2941 strcat(InflFile, "/Infl.out");
2942 FILE *fInf = fopen(InflFile, "r");
2943
2944 if (fInf == NULL) {
2946 return 1;
2947 }
2948
2949 int chkNbEqns, chkNbUnknowns;
2950 fscanf(fInf, "%d %d\n", &chkNbEqns, &chkNbUnknowns);
2952 neBEMMessage(
"Solve - matrix dimension do not match!");
2953 fclose(fInf);
2954 return (-1);
2955 }
2956
2957 printf("Solve: Matrix dimensions: %d equations, %d unknowns\n",
2959
2961
2962 for (
int elefld = 1; elefld <=
NbEqns; ++elefld)
2963 for (
int elesrc = 1; elesrc <=
NbUnknowns; ++elesrc)
2964 fscanf(fInf,
"%le\n", &
Inf[elefld][elesrc]);
2965 fclose(fInf);
2966 }
2967
2970 "Solve - Binary read of Infl matrix not implemented yet.\n");
2971 return -1;
2972
2974
2975 printf(
2976 "reading influence coefficient matrix from unformatted file "
2977 "...\n");
2978
2979 char InflFile[256];
2981 strcat(InflFile, "/RawInfl.out");
2982 printf("\nread from file %s\n", InflFile);
2983 fflush(stdout);
2984 FILE *fInf = fopen(InflFile, "rb");
2985
2986 if (fInf == NULL) {
2988 return -1;
2989 }
2990 printf("\nfInf: %p\n", (void *)fInf);
2992 fclose(fInf);
2993 printf("\nNb of items successfully read from raw mode in %s is %d\n",
2994 InflFile, rfw);
2995 fflush(stdout);
2996
2997 for (
int unknown = 1; unknown <=
NbUnknowns; ++unknown)
2998 for (
int eqn = 1; eqn <=
NbEqns; ++eqn)
2999 printf(
3000 "Unknown:%d, Eqn:%d => diff Inf: %lg, RawInf: %lg is %lg\n",
3001 unknown, eqn,
Inf[unknown][eqn], RawInf[unknown][eqn],
3002 fabs(
Inf[unknown][eqn] - RawInf[unknown][eqn]));
3003 }
3004 }
3005 }
3006
3007
3008
3009 if (
Inf || RawInf) {
3010 double XChk;
3011 char Chkfile[256];
3013 strcat(Chkfile, "/XChk.out");
3014 FILE *fChk = fopen(Chkfile, "w");
3015 if (fChk == NULL) {
3017 return -1;
3018 }
3019 fprintf(fChk, "#Row\tGivenPot\tError\n");
3020
3021 int ElementOfMaxError = 1;
3022 double *Error, MaxError = 0.0;
3024 int elesrc;
3025#ifdef _OPENMP
3026#pragma omp parallel for private(elesrc)
3027#endif
3028 for (
int elefld = 1; elefld <=
NbEqns; elefld++) {
3029 XChk = 0.0;
3030 for (elesrc = 1; elesrc <=
NbUnknowns; elesrc++) {
3033 XChk += RawInf[elefld][elesrc] *
Solution[elesrc];
3034 else
3036 }
3037 Error[elefld] =
fabs(
RHS[elefld] - XChk);
3038
3039 if (Error[elefld] > MaxError) {
3040 MaxError = Error[elefld];
3041 ElementOfMaxError = elefld;
3042 }
3043 }
3044 for (
int elefld = 1; elefld <=
NbEqns; elefld++)
3045 fprintf(fChk,
"%d\t%lg\t%lg\n", elefld,
RHS[elefld], Error[elefld]);
3047
3048 printf("Computed values at the collocation points for comparison.\n");
3049 printf("Error maximum on element %d and its magnitude is %lg.\n",
3050 ElementOfMaxError, MaxError);
3051 fflush(stdout);
3052
3053 fprintf(fChk, "#Error maximum on element %d and its magnitude is %lg.\n",
3054 ElementOfMaxError, MaxError);
3055 fclose(fChk);
3056
3063 }
3064 else {
3067 "Solve - Infl matrix not available, re-computation forced.\n");
3068
3070 if (fstatus != 0) {
3071 neBEMMessage(
"Solve - LHMatrix in forced OptRepeatLHMatrix");
3072 return -1;
3073 }
3074
3075 double XChk;
3076 char Chkfile[256];
3077 FILE *fChk;
3079 strcat(Chkfile, "/XChk.out");
3080 fChk = fopen(Chkfile, "w");
3081 if (fChk == NULL) {
3082 neBEMMessage(
"Solve - ChkFile in forced recomputation");
3083 return -1;
3084 }
3085 fprintf(fChk, "#Row\tGivenPot\tComputedPot\tDiff\n");
3086
3087 int ElementOfMaxError = 1;
3088 double Error, MaxError = 0.0;
3089 for (
int elefld = 1; elefld <=
NbEqns; elefld++) {
3090 XChk = 0.0;
3091 for (
int elesrc = 1; elesrc <=
NbUnknowns; elesrc++) {
3093 }
3094 Error =
fabs(
RHS[elefld] - XChk);
3095 fprintf(fChk,
"%d\t%lg\t%lg\t%lg\n", elefld,
RHS[elefld], XChk,
3096 Error);
3097
3098 if (Error > MaxError) {
3099 MaxError = Error;
3100 ElementOfMaxError = elefld;
3101 }
3102 }
3103
3104 printf("Computed values at the collocation points for comparison.\n");
3105 printf("Error maximum on element %d and its magnitude is %lg.\n",
3106 ElementOfMaxError, MaxError);
3107 fflush(stdout);
3108
3109 fprintf(fChk,
3110 "#Error maximum on element %d and its magnitude is %lg.\n",
3111 ElementOfMaxError, MaxError);
3112 fclose(fChk);
3113
3115 } else {
3116 neBEMMessage(
"Solve - Infl matrix not available, no validation.\n");
3117 }
3118 }
3119 }
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3162 printf(
3163 "Properties at non-collocation points on element for estimating "
3164 "error.\n");
3165 fflush(stdout);
3166
3167 double Err;
3168 int PrimitiveOfMaxError = 1;
3169 int ElementOfMaxError = 1;
3170 double MaxError = 0.0;
3171 double xerrMax = 0.0, yerrMax = 0.0, zerrMax = 0.0;
3172
3173 char Errfile[256];
3175 strcat(Errfile, "/Errors.out");
3176 FILE *fErr = fopen(Errfile, "w");
3177 if (fErr == NULL) {
3179 return -1;
3180 }
3181 fprintf(fErr,
3182 "#Prim\tEle\tGType\tIType\txerr\tyerr\tzerr\tGivenBC\tComputVal\tDi"
3183 "ff\n");
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3200 double normdisp = 1.0e-8;
3201
3202 if ((prim == 91) && (ele == 337))
3203 {
3204
3206 } else
3207 {
3209 }
3210
3211
3212
3213 if ((
EleArr + ele - 1)->G.Type == 2)
continue;
3214
3215 if ((
EleArr + ele - 1)->G.Type == 3)
3216 {
3218 double Potential;
3220 double x0 = (
EleArr + ele - 1)->G.Vertex[0].
X;
3221 double y0 = (
EleArr + ele - 1)->G.Vertex[0].Y;
3222 double z0 = (
EleArr + ele - 1)->G.Vertex[0].Z;
3223 double x1 = (
EleArr + ele - 1)->G.Vertex[1].X;
3224 double y1 = (
EleArr + ele - 1)->G.Vertex[1].Y;
3225 double z1 = (
EleArr + ele - 1)->G.Vertex[1].Z;
3226 double x2 = (
EleArr + ele - 1)->G.Vertex[2].X;
3227 double y2 = (
EleArr + ele - 1)->G.Vertex[2].Y;
3228 double z2 = (
EleArr + ele - 1)->G.Vertex[2].Z;
3229 double xb = (x0 + x1 + x2) / 3.0;
3230 double yb = (y0 + y1 + y2) / 3.0;
3231 double zb = (z0 + z1 + z2) / 3.0;
3232
3233
3234 globalP.X = xb;
3235 globalP.Y = yb;
3236 globalP.Z = zb;
3238 PFAtPoint(&globalP, &Potential, &globalF);
3239 Err =
ApplPot[prim] - Potential;
3240 fprintf(fErr, "%d\t%d\t%d\t%d\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n",
3241 prim, ele, 3, 1, xb, yb, zb,
ApplPot[prim], Potential, Err);
3243 MaxError = Err;
3244 PrimitiveOfMaxError = prim;
3245 ElementOfMaxError = ele;
3246 xerrMax = xb;
3247 yerrMax = yb;
3248 zerrMax = zb;
3249 }
3250 }
3252 4) {
3253 double xplus = xb + (
EleArr + ele - 1)->G.DC.XUnit.X * normdisp;
3254 xplus += (
EleArr + ele - 1)->G.DC.YUnit.X * normdisp;
3255 xplus += (
EleArr + ele - 1)->G.DC.ZUnit.X * normdisp;
3256 double yplus = yb + (
EleArr + ele - 1)->G.DC.XUnit.Y * normdisp;
3257 yplus += (
EleArr + ele - 1)->G.DC.YUnit.Y * normdisp;
3258 yplus += (
EleArr + ele - 1)->G.DC.ZUnit.Y * normdisp;
3259 double zplus = zb + (
EleArr + ele - 1)->G.DC.XUnit.Z * normdisp;
3260 zplus += (
EleArr + ele - 1)->G.DC.YUnit.Z * normdisp;
3261 zplus += (
EleArr + ele - 1)->G.DC.ZUnit.Z * normdisp;
3262 globalP.X = xplus;
3263 globalP.Y = yplus;
3264 globalP.Z = zplus;
3265 PFAtPoint(&globalP, &Potential, &globalF);
3266 localF
3269 double value1 = -localF.Y;
3270 double xminus = xb - (
EleArr + ele - 1)->G.DC.XUnit.X * normdisp;
3271 xminus -= (
EleArr + ele - 1)->G.DC.YUnit.X * normdisp;
3272 xminus -= (
EleArr + ele - 1)->G.DC.ZUnit.X * normdisp;
3273 double yminus = yb - (
EleArr + ele - 1)->G.DC.XUnit.Y * normdisp;
3274 yminus -= (
EleArr + ele - 1)->G.DC.YUnit.Y * normdisp;
3275 yminus -= (
EleArr + ele - 1)->G.DC.ZUnit.Y * normdisp;
3276 double zminus = zb - (
EleArr + ele - 1)->G.DC.XUnit.Z * normdisp;
3277 zminus -= (
EleArr + ele - 1)->G.DC.YUnit.Z * normdisp;
3278 zminus -= (
EleArr + ele - 1)->G.DC.ZUnit.Z * normdisp;
3279 globalP.X = xminus;
3280 globalP.Y = yminus;
3281 globalP.Z = zminus;
3282 PFAtPoint(&globalP, &Potential, &globalF);
3283 localF
3286 double value2 = -localF.Y;
3288 Err = epsratio - (value1 / value2);
3289 fprintf(fErr, "%d\t%d\t%d\t%d\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n",
3290 prim, ele, 3, 4, xb, yb, zb, epsratio, (value1 / value2),
3291 Err);
3293 MaxError = Err;
3294 PrimitiveOfMaxError = prim;
3295 ElementOfMaxError = ele;
3296 xerrMax = xb;
3297 yerrMax = yb;
3298 zerrMax = zb;
3299 }
3300 }
3301
3302
3303 double xerr =
3304 0.25 * (x0 + 0.5 * (x0 + x1) + 0.5 * (x1 + x2) + 0.5 * (x0 + x2));
3305 double yerr =
3306 0.25 * (y0 + 0.5 * (y0 + y1) + 0.5 * (y1 + y2) + 0.5 * (y0 + y2));
3307 double zerr =
3308 0.25 * (z0 + 0.5 * (z0 + z1) + 0.5 * (z1 + z2) + 0.5 * (z0 + z2));
3309 globalP.X = xerr;
3310 globalP.Y = yerr;
3311 globalP.Z = zerr;
3312
3313
3314
3316 PFAtPoint(&globalP, &Potential, &globalF);
3317 Err =
ApplPot[prim] - Potential;
3318 fprintf(fErr, "%d\t%d\t%d\t%d\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n",
3319 prim, ele, 3, 1, xerr, yerr, zerr,
ApplPot[prim], Potential,
3320 Err);
3322 MaxError = Err;
3323 PrimitiveOfMaxError = prim;
3324 ElementOfMaxError = ele;
3325 xerrMax = xerr;
3326 yerrMax = yerr;
3327 zerrMax = zerr;
3328 }
3329 }
3331 4) {
3332 double xplus = xerr + (
EleArr + ele - 1)->G.DC.XUnit.X * normdisp;
3333 xplus += (
EleArr + ele - 1)->G.DC.YUnit.X * normdisp;
3334 xplus += (
EleArr + ele - 1)->G.DC.ZUnit.X * normdisp;
3335 double yplus = yerr + (
EleArr + ele - 1)->G.DC.XUnit.Y * normdisp;
3336 yplus += (
EleArr + ele - 1)->G.DC.YUnit.Y * normdisp;
3337 yplus += (
EleArr + ele - 1)->G.DC.ZUnit.Y * normdisp;
3338 double zplus = zerr + (
EleArr + ele - 1)->G.DC.XUnit.Z * normdisp;
3339 zplus += (
EleArr + ele - 1)->G.DC.YUnit.Z * normdisp;
3340 zplus += (
EleArr + ele - 1)->G.DC.ZUnit.Z * normdisp;
3341 globalP.X = xplus;
3342 globalP.Y = yplus;
3343 globalP.Z = zplus;
3344 PFAtPoint(&globalP, &Potential, &globalF);
3345 localF
3348 double value1 = -localF.Y;
3349 double xminus = xerr - (
EleArr + ele - 1)->G.DC.XUnit.X * normdisp;
3350 xminus -= (
EleArr + ele - 1)->G.DC.YUnit.X * normdisp;
3351 xminus -= (
EleArr + ele - 1)->G.DC.ZUnit.X * normdisp;
3352 double yminus = yerr - (
EleArr + ele - 1)->G.DC.XUnit.Y * normdisp;
3353 yminus -= (
EleArr + ele - 1)->G.DC.YUnit.Y * normdisp;
3354 yminus -= (
EleArr + ele - 1)->G.DC.ZUnit.Y * normdisp;
3355 double zminus = zerr - (
EleArr + ele - 1)->G.DC.XUnit.Z * normdisp;
3356 zminus -= (
EleArr + ele - 1)->G.DC.YUnit.Z * normdisp;
3357 zminus -= (
EleArr + ele - 1)->G.DC.ZUnit.Z * normdisp;
3358 globalP.X = xminus;
3359 globalP.Y = yminus;
3360 globalP.Z = zminus;
3361 PFAtPoint(&globalP, &Potential, &globalF);
3362 localF
3365 double value2 = -localF.Y;
3367 Err = epsratio - (value1 / value2);
3368 fprintf(fErr, "%d\t%d\t%d\t%d\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n",
3369 prim, ele, 3, 4, xerr, yerr, zerr, epsratio,
3370 (value1 / value2), Err);
3372 MaxError = Err;
3373 PrimitiveOfMaxError = prim;
3374 ElementOfMaxError = ele;
3375 xerrMax = xerr;
3376 yerrMax = yerr;
3377 zerrMax = zerr;
3378 }
3379 }
3380
3381
3382 xerr = (0.5 * (x0 + x1) + 0.5 * (x1 + x2) + x1) / 3.0;
3383 yerr = (0.5 * (y0 + y1) + 0.5 * (y1 + y2) + y1) / 3.0;
3384 zerr = (0.5 * (z0 + z1) + 0.5 * (z1 + z2) + z1) / 3.0;
3385 globalP.X = xerr;
3386 globalP.Y = yerr;
3387 globalP.Z = zerr;
3388
3389
3390
3392 PFAtPoint(&globalP, &Potential, &globalF);
3393 Err =
ApplPot[prim] - Potential;
3394 fprintf(fErr, "%d\t%d\t%d\t%d\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n",
3395 prim, ele, 3, 1, xerr, yerr, zerr,
ApplPot[prim], Potential,
3396 Err);
3398 MaxError = Err;
3399 PrimitiveOfMaxError = prim;
3400 ElementOfMaxError = ele;
3401 xerrMax = xerr;
3402 yerrMax = yerr;
3403 zerrMax = zerr;
3404 }
3405 }
3407 4) {
3408 double xplus = xerr + (
EleArr + ele - 1)->G.DC.XUnit.X * normdisp;
3409 xplus += (
EleArr + ele - 1)->G.DC.YUnit.X * normdisp;
3410 xplus += (
EleArr + ele - 1)->G.DC.ZUnit.X * normdisp;
3411 double yplus = yerr + (
EleArr + ele - 1)->G.DC.XUnit.Y * normdisp;
3412 yplus += (
EleArr + ele - 1)->G.DC.YUnit.Y * normdisp;
3413 yplus += (
EleArr + ele - 1)->G.DC.ZUnit.Y * normdisp;
3414 double zplus = zerr + (
EleArr + ele - 1)->G.DC.XUnit.Z * normdisp;
3415 zplus += (
EleArr + ele - 1)->G.DC.YUnit.Z * normdisp;
3416 zplus += (
EleArr + ele - 1)->G.DC.ZUnit.Z * normdisp;
3417 globalP.X = xplus;
3418 globalP.Y = yplus;
3419 globalP.Z = zplus;
3420 PFAtPoint(&globalP, &Potential, &globalF);
3421 localF
3424 double value1 = -localF.Y;
3425 double xminus = xerr - (
EleArr + ele - 1)->G.DC.XUnit.X * normdisp;
3426 xminus -= (
EleArr + ele - 1)->G.DC.YUnit.X * normdisp;
3427 xminus -= (
EleArr + ele - 1)->G.DC.ZUnit.X * normdisp;
3428 double yminus = yerr - (
EleArr + ele - 1)->G.DC.XUnit.Y * normdisp;
3429 yminus -= (
EleArr + ele - 1)->G.DC.YUnit.Y * normdisp;
3430 yminus -= (
EleArr + ele - 1)->G.DC.ZUnit.Y * normdisp;
3431 double zminus = zerr - (
EleArr + ele - 1)->G.DC.XUnit.Z * normdisp;
3432 zminus -= (
EleArr + ele - 1)->G.DC.YUnit.Z * normdisp;
3433 zminus -= (
EleArr + ele - 1)->G.DC.ZUnit.Z * normdisp;
3434 globalP.X = xminus;
3435 globalP.Y = yminus;
3436 globalP.Z = zminus;
3437 PFAtPoint(&globalP, &Potential, &globalF);
3438 localF
3441 double value2 = -localF.Y;
3443 Err = epsratio - (value1 / value2);
3444 fprintf(fErr, "%d\t%d\t%d\t%d\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n",
3445 prim, ele, 3, 4, xerr, yerr, zerr, epsratio,
3446 (value1 / value2), Err);
3448 MaxError = Err;
3449 PrimitiveOfMaxError = prim;
3450 ElementOfMaxError = ele;
3451 xerrMax = xerr;
3452 yerrMax = yerr;
3453 zerrMax = zerr;
3454 }
3455 }
3456
3457
3458 xerr = (0.5 * (x0 + x2) + 0.5 * (x1 + x2) + x2) / 3.0;
3459 yerr = (0.5 * (y0 + y2) + 0.5 * (y1 + y2) + y2) / 3.0;
3460 zerr = (0.5 * (z0 + z2) + 0.5 * (z1 + z2) + z2) / 3.0;
3461 globalP.X = xerr;
3462 globalP.Y = yerr;
3463 globalP.Z = zerr;
3464
3465
3466
3468 PFAtPoint(&globalP, &Potential, &globalF);
3469 Err =
ApplPot[prim] - Potential;
3470 fprintf(fErr, "%d\t%d\t%d\t%d\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n",
3471 prim, ele, 3, 1, xerr, yerr, zerr,
ApplPot[prim], Potential,
3472 Err);
3474 MaxError = Err;
3475 PrimitiveOfMaxError = prim;
3476 ElementOfMaxError = ele;
3477 xerrMax = xerr;
3478 yerrMax = yerr;
3479 zerrMax = zerr;
3480 }
3481 }
3483 4) {
3484 double xplus = xerr + (
EleArr + ele - 1)->G.DC.XUnit.X * normdisp;
3485 xplus += (
EleArr + ele - 1)->G.DC.YUnit.X * normdisp;
3486 xplus += (
EleArr + ele - 1)->G.DC.ZUnit.X * normdisp;
3487 double yplus = yerr + (
EleArr + ele - 1)->G.DC.XUnit.Y * normdisp;
3488 yplus += (
EleArr + ele - 1)->G.DC.YUnit.Y * normdisp;
3489 yplus += (
EleArr + ele - 1)->G.DC.ZUnit.Y * normdisp;
3490 double zplus = zerr + (
EleArr + ele - 1)->G.DC.XUnit.Z * normdisp;
3491 zplus += (
EleArr + ele - 1)->G.DC.YUnit.Z * normdisp;
3492 zplus += (
EleArr + ele - 1)->G.DC.ZUnit.Z * normdisp;
3493 globalP.X = xplus;
3494 globalP.Y = yplus;
3495 globalP.Z = zplus;
3496 PFAtPoint(&globalP, &Potential, &globalF);
3497 localF
3500 double value1 = -localF.Y;
3501 double xminus = xerr - (
EleArr + ele - 1)->G.DC.XUnit.X * normdisp;
3502 xminus -= (
EleArr + ele - 1)->G.DC.YUnit.X * normdisp;
3503 xminus -= (
EleArr + ele - 1)->G.DC.ZUnit.X * normdisp;
3504 double yminus = yerr - (
EleArr + ele - 1)->G.DC.XUnit.Y * normdisp;
3505 yminus -= (
EleArr + ele - 1)->G.DC.YUnit.Y * normdisp;
3506 yminus -= (
EleArr + ele - 1)->G.DC.ZUnit.Y * normdisp;
3507 double zminus = zerr - (
EleArr + ele - 1)->G.DC.XUnit.Z * normdisp;
3508 zminus -= (
EleArr + ele - 1)->G.DC.YUnit.Z * normdisp;
3509 zminus -= (
EleArr + ele - 1)->G.DC.ZUnit.Z * normdisp;
3510 globalP.X = xminus;
3511 globalP.Y = yminus;
3512 globalP.Z = zminus;
3513 PFAtPoint(&globalP, &Potential, &globalF);
3514 localF
3517 double value2 = -localF.Y;
3519 Err = epsratio - (value1 / value2);
3520 fprintf(fErr, "%d\t%d\t%d\t%d\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n",
3521 prim, ele, 4, 4, xerr, yerr, zerr, epsratio,
3522 (value1 / value2), Err);
3524 MaxError = Err;
3525 PrimitiveOfMaxError = prim;
3526 ElementOfMaxError = ele;
3527 xerrMax = xerr;
3528 yerrMax = yerr;
3529 zerrMax = zerr;
3530 }
3531 }
3532 }
3533
3534 if ((
EleArr + ele - 1)->G.Type == 4)
3535 {
3537 double Potential;
3539
3540 double x0 = (
EleArr + ele - 1)->G.Vertex[0].
X;
3541 double y0 = (
EleArr + ele - 1)->G.Vertex[0].Y;
3542 double z0 = (
EleArr + ele - 1)->G.Vertex[0].Z;
3543 double x1 = (
EleArr + ele - 1)->G.Vertex[1].X;
3544 double y1 = (
EleArr + ele - 1)->G.Vertex[1].Y;
3545 double z1 = (
EleArr + ele - 1)->G.Vertex[1].Z;
3546 double x2 = (
EleArr + ele - 1)->G.Vertex[2].X;
3547 double y2 = (
EleArr + ele - 1)->G.Vertex[2].Y;
3548 double z2 = (
EleArr + ele - 1)->G.Vertex[2].Z;
3549 double x3 = (
EleArr + ele - 1)->G.Vertex[3].X;
3550 double y3 = (
EleArr + ele - 1)->G.Vertex[3].Y;
3551 double z3 = (
EleArr + ele - 1)->G.Vertex[3].Z;
3552 double xo = 0.25 * (x0 + x1 + x2 + x3);
3553 double yo = 0.25 * (y0 + y1 + y2 + y3);
3554 double zo = 0.25 * (z0 + z1 + z2 + z3);
3555
3556
3557 globalP.X = xo;
3558 globalP.Y = yo;
3559 globalP.Z = zo;
3561 PFAtPoint(&globalP, &Potential, &globalF);
3562 Err =
ApplPot[prim] - Potential;
3563 fprintf(fErr, "%d\t%d\t%d\t%d\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n",
3564 prim, ele, 4, 1, xo, yo, zo,
ApplPot[prim], Potential, Err);
3566 MaxError = Err;
3567 PrimitiveOfMaxError = prim;
3568 ElementOfMaxError = ele;
3569 xerrMax = xo;
3570 yerrMax = yo;
3571 zerrMax = zo;
3572 }
3573 }
3575
3576 double xplus = xo + (
EleArr + ele - 1)->G.DC.XUnit.X * normdisp;
3577 xplus += (
EleArr + ele - 1)->G.DC.YUnit.X * normdisp;
3578 xplus += (
EleArr + ele - 1)->G.DC.ZUnit.X * normdisp;
3579 double yplus = yo + (
EleArr + ele - 1)->G.DC.XUnit.Y * normdisp;
3580 yplus += (
EleArr + ele - 1)->G.DC.YUnit.Y * normdisp;
3581 yplus += (
EleArr + ele - 1)->G.DC.ZUnit.Y * normdisp;
3582 double zplus = zo + (
EleArr + ele - 1)->G.DC.XUnit.Z * normdisp;
3583 zplus += (
EleArr + ele - 1)->G.DC.YUnit.Z * normdisp;
3584 zplus += (
EleArr + ele - 1)->G.DC.ZUnit.Z * normdisp;
3585 globalP.X = xplus;
3586 globalP.Y = yplus;
3587 globalP.Z = zplus;
3588 PFAtPoint(&globalP, &Potential, &globalF);
3589 localF
3592 double dispfld1 =
Epsilon1[prim] * localF.Y;
3593 double xminus = xo - (
EleArr + ele - 1)->G.DC.XUnit.X * normdisp;
3594 xminus -= (
EleArr + ele - 1)->G.DC.YUnit.X * normdisp;
3595 xminus -= (
EleArr + ele - 1)->G.DC.ZUnit.X * normdisp;
3596 double yminus = yo - (
EleArr + ele - 1)->G.DC.XUnit.Y * normdisp;
3597 yminus -= (
EleArr + ele - 1)->G.DC.YUnit.Y * normdisp;
3598 yminus -= (
EleArr + ele - 1)->G.DC.ZUnit.Y * normdisp;
3599 double zminus = zo - (
EleArr + ele - 1)->G.DC.XUnit.Z * normdisp;
3600 zminus -= (
EleArr + ele - 1)->G.DC.YUnit.Z * normdisp;
3601 zminus -= (
EleArr + ele - 1)->G.DC.ZUnit.Z * normdisp;
3602 globalP.X = xminus;
3603 globalP.Y = yminus;
3604 globalP.Z = zminus;
3605 PFAtPoint(&globalP, &Potential, &globalF);
3606 localF
3609 double dispfld2 =
Epsilon2[prim] * localF.Y;
3610 globalP.X = xo;
3611 globalP.Y = yo;
3612 globalP.Z = zo;
3613 PFAtPoint(&globalP, &Potential, &globalF);
3614 localF
3617 double dispfldo =
Epsilon1[prim] * localF.Y;
3618 Err = (dispfld2 - dispfld1) /
3619 dispfldo;
3620 fprintf(fErr, "%d\t%d\t%d\t%d\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n",
3621 prim, ele, 4, 4, xo, yo, zo, dispfld1, dispfld2, Err);
3622 if ((prim == 91) && (ele == 337)) {
3623
3624 double TotalInfl = 0.0;
3625 for (
int elesrc = 1; elesrc <=
NbElements; ++elesrc) {
3627 }
3628 printf("TotalInfl: %lg\n", TotalInfl);
3629 printf(
3630 "%d\t%d\t%d\t%d\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\t%"
3631 "lg\n",
3633 dispfld1, dispfld2, dispfldo, Err);
3634 }
3636 MaxError = Err;
3637 PrimitiveOfMaxError = prim;
3638 ElementOfMaxError = ele;
3639 xerrMax = xo;
3640 yerrMax = yo;
3641 zerrMax = zo;
3642 }
3643 }
3644
3645
3646 double xerr = 0.25 * (x0 + 0.5 * (x1 + x0) + xo + 0.5 * (x0 + x3));
3647 double yerr = 0.25 * (y0 + 0.5 * (y1 + y0) + yo + 0.5 * (y0 + y3));
3648 double zerr = 0.25 * (z0 + 0.5 * (z1 + z0) + zo + 0.5 * (z0 + z3));
3649 globalP.X = xerr;
3650 globalP.Y = yerr;
3651 globalP.Z = zerr;
3653 PFAtPoint(&globalP, &Potential, &globalF);
3654 Err =
ApplPot[prim] - Potential;
3655 fprintf(fErr, "%d\t%d\t%d\t%d\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n",
3656 prim, ele, 4, 1, xerr, yerr, zerr,
ApplPot[prim], Potential,
3657 Err);
3659 MaxError = Err;
3660 PrimitiveOfMaxError = prim;
3661 ElementOfMaxError = ele;
3662 xerrMax = xerr;
3663 yerrMax = yerr;
3664 zerrMax = zerr;
3665 }
3666 }
3668 4) {
3669 double xplus = xerr + (
EleArr + ele - 1)->G.DC.XUnit.X * normdisp;
3670 xplus += (
EleArr + ele - 1)->G.DC.YUnit.X * normdisp;
3671 xplus += (
EleArr + ele - 1)->G.DC.ZUnit.X * normdisp;
3672 double yplus = yerr + (
EleArr + ele - 1)->G.DC.XUnit.Y * normdisp;
3673 yplus += (
EleArr + ele - 1)->G.DC.YUnit.Y * normdisp;
3674 yplus += (
EleArr + ele - 1)->G.DC.ZUnit.Y * normdisp;
3675 double zplus = zerr + (
EleArr + ele - 1)->G.DC.XUnit.Z * normdisp;
3676 zplus += (
EleArr + ele - 1)->G.DC.YUnit.Z * normdisp;
3677 zplus += (
EleArr + ele - 1)->G.DC.ZUnit.Z * normdisp;
3678 globalP.X = xplus;
3679 globalP.Y = yplus;
3680 globalP.Z = zplus;
3681 PFAtPoint(&globalP, &Potential, &globalF);
3682 localF
3685 double value1 = -localF.Y;
3686 double xminus = xerr - (
EleArr + ele - 1)->G.DC.XUnit.X * normdisp;
3687 xminus -= (
EleArr + ele - 1)->G.DC.YUnit.X * normdisp;
3688 xminus -= (
EleArr + ele - 1)->G.DC.ZUnit.X * normdisp;
3689 double yminus = yerr - (
EleArr + ele - 1)->G.DC.XUnit.Y * normdisp;
3690 yminus -= (
EleArr + ele - 1)->G.DC.YUnit.Y * normdisp;
3691 yminus -= (
EleArr + ele - 1)->G.DC.ZUnit.Y * normdisp;
3692 double zminus = zerr - (
EleArr + ele - 1)->G.DC.XUnit.Z * normdisp;
3693 zminus -= (
EleArr + ele - 1)->G.DC.YUnit.Z * normdisp;
3694 zminus -= (
EleArr + ele - 1)->G.DC.ZUnit.Z * normdisp;
3695 globalP.X = xminus;
3696 globalP.Y = yminus;
3697 globalP.Z = zminus;
3698 PFAtPoint(&globalP, &Potential, &globalF);
3699 localF
3702 double value2 = -localF.Y;
3704 Err = epsratio - (value1 / value2);
3705 fprintf(fErr, "%d\t%d\t%d\t%d\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n",
3706 prim, ele, 4, 4, xerr, yerr, zerr, epsratio,
3707 (value1 / value2), Err);
3709 MaxError = Err;
3710 PrimitiveOfMaxError = prim;
3711 ElementOfMaxError = ele;
3712 xerrMax = xerr;
3713 yerrMax = yerr;
3714 zerrMax = zerr;
3715 }
3716 }
3717
3718
3719 xerr = 0.25 * (0.5 * (x1 + x0) + x1 + 0.5 * (x1 + x2) + xo);
3720 yerr = 0.25 * (0.5 * (y1 + y0) + y1 + 0.5 * (y1 + y2) + yo);
3721 zerr = 0.25 * (0.5 * (z1 + z0) + z1 + 0.5 * (z1 + z2) + zo);
3722 globalP.X = xerr;
3723 globalP.Y = yerr;
3724 globalP.Z = zerr;
3725
3726
3727
3729 PFAtPoint(&globalP, &Potential, &globalF);
3730 Err =
ApplPot[prim] - Potential;
3731 fprintf(fErr, "%d\t%d\t%d\t%d\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n",
3732 prim, ele, 4, 1, xerr, yerr, zerr,
ApplPot[prim], Potential,
3733 Err);
3735 MaxError = Err;
3736 PrimitiveOfMaxError = prim;
3737 ElementOfMaxError = ele;
3738 xerrMax = xerr;
3739 yerrMax = yerr;
3740 zerrMax = zerr;
3741 }
3742 }
3744 4) {
3745 double xplus = xerr + (
EleArr + ele - 1)->G.DC.XUnit.X * normdisp;
3746 xplus += (
EleArr + ele - 1)->G.DC.YUnit.X * normdisp;
3747 xplus += (
EleArr + ele - 1)->G.DC.ZUnit.X * normdisp;
3748 double yplus = yerr + (
EleArr + ele - 1)->G.DC.XUnit.Y * normdisp;
3749 yplus += (
EleArr + ele - 1)->G.DC.YUnit.Y * normdisp;
3750 yplus += (
EleArr + ele - 1)->G.DC.ZUnit.Y * normdisp;
3751 double zplus = zerr + (
EleArr + ele - 1)->G.DC.XUnit.Z * normdisp;
3752 zplus += (
EleArr + ele - 1)->G.DC.YUnit.Z * normdisp;
3753 zplus += (
EleArr + ele - 1)->G.DC.ZUnit.Z * normdisp;
3754 globalP.X = xplus;
3755 globalP.Y = yplus;
3756 globalP.Z = zplus;
3757 PFAtPoint(&globalP, &Potential, &globalF);
3758 localF
3761 double value1 = -localF.Y;
3762 double xminus = xerr - (
EleArr + ele - 1)->G.DC.XUnit.X * normdisp;
3763 xminus -= (
EleArr + ele - 1)->G.DC.YUnit.X * normdisp;
3764 xminus -= (
EleArr + ele - 1)->G.DC.ZUnit.X * normdisp;
3765 double yminus = yerr - (
EleArr + ele - 1)->G.DC.XUnit.Y * normdisp;
3766 yminus -= (
EleArr + ele - 1)->G.DC.YUnit.Y * normdisp;
3767 yminus -= (
EleArr + ele - 1)->G.DC.ZUnit.Y * normdisp;
3768 double zminus = zerr - (
EleArr + ele - 1)->G.DC.XUnit.Z * normdisp;
3769 zminus -= (
EleArr + ele - 1)->G.DC.YUnit.Z * normdisp;
3770 zminus -= (
EleArr + ele - 1)->G.DC.ZUnit.Z * normdisp;
3771 globalP.X = xminus;
3772 globalP.Y = yminus;
3773 globalP.Z = zminus;
3774 PFAtPoint(&globalP, &Potential, &globalF);
3775 localF
3778 double value2 = -localF.Y;
3780 Err = epsratio - (value1 / value2);
3781 fprintf(fErr, "%d\t%d\t%d\t%d\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n",
3782 prim, ele, 4, 4, xerr, yerr, zerr, epsratio,
3783 (value1 / value2), Err);
3785 MaxError = Err;
3786 PrimitiveOfMaxError = prim;
3787 ElementOfMaxError = ele;
3788 xerrMax = xerr;
3789 yerrMax = yerr;
3790 zerrMax = zerr;
3791 }
3792 }
3793
3794
3795 xerr = 0.25 * (xo + 0.5 * (x1 + x2) + x2 + 0.5 * (x3 + x2));
3796 yerr = 0.25 * (yo + 0.5 * (y1 + y2) + y2 + 0.5 * (y3 + y2));
3797 zerr = 0.25 * (zo + 0.5 * (z1 + z2) + z2 + 0.5 * (z3 + z2));
3798 globalP.X = xerr;
3799 globalP.Y = yerr;
3800 globalP.Z = zerr;
3801
3802
3803
3805 PFAtPoint(&globalP, &Potential, &globalF);
3806 Err =
ApplPot[prim] - Potential;
3807 fprintf(fErr, "%d\t%d\t%d\t%d\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n",
3808 prim, ele, 4, 1, xerr, yerr, zerr,
ApplPot[prim], Potential,
3809 Err);
3811 MaxError = Err;
3812 PrimitiveOfMaxError = prim;
3813 ElementOfMaxError = ele;
3814 xerrMax = xerr;
3815 yerrMax = yerr;
3816 zerrMax = zerr;
3817 }
3818 }
3820 4) {
3821 double xplus = xerr + (
EleArr + ele - 1)->G.DC.XUnit.X * normdisp;
3822 xplus += (
EleArr + ele - 1)->G.DC.YUnit.X * normdisp;
3823 xplus += (
EleArr + ele - 1)->G.DC.ZUnit.X * normdisp;
3824 double yplus = yerr + (
EleArr + ele - 1)->G.DC.XUnit.Y * normdisp;
3825 yplus += (
EleArr + ele - 1)->G.DC.YUnit.Y * normdisp;
3826 yplus += (
EleArr + ele - 1)->G.DC.ZUnit.Y * normdisp;
3827 double zplus = zerr + (
EleArr + ele - 1)->G.DC.XUnit.Z * normdisp;
3828 zplus += (
EleArr + ele - 1)->G.DC.YUnit.Z * normdisp;
3829 zplus += (
EleArr + ele - 1)->G.DC.ZUnit.Z * normdisp;
3830 globalP.X = xplus;
3831 globalP.Y = yplus;
3832 globalP.Z = zplus;
3833 PFAtPoint(&globalP, &Potential, &globalF);
3834 localF
3837 double value1 = -localF.Y;
3838 double xminus = xerr - (
EleArr + ele - 1)->G.DC.XUnit.X * normdisp;
3839 xminus -= (
EleArr + ele - 1)->G.DC.YUnit.X * normdisp;
3840 xminus -= (
EleArr + ele - 1)->G.DC.ZUnit.X * normdisp;
3841 double yminus = yerr - (
EleArr + ele - 1)->G.DC.XUnit.Y * normdisp;
3842 yminus -= (
EleArr + ele - 1)->G.DC.YUnit.Y * normdisp;
3843 yminus -= (
EleArr + ele - 1)->G.DC.ZUnit.Y * normdisp;
3844 double zminus = zerr - (
EleArr + ele - 1)->G.DC.XUnit.Z * normdisp;
3845 zminus -= (
EleArr + ele - 1)->G.DC.YUnit.Z * normdisp;
3846 zminus -= (
EleArr + ele - 1)->G.DC.ZUnit.Z * normdisp;
3847 globalP.X = xminus;
3848 globalP.Y = yminus;
3849 globalP.Z = zminus;
3850 PFAtPoint(&globalP, &Potential, &globalF);
3851 localF
3854 double value2 = -localF.Y;
3856 Err = epsratio - (value1 / value2);
3857 fprintf(fErr, "%d\t%d\t%d\t%d\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n",
3858 prim, ele, 4, 4, xerr, yerr, zerr, epsratio,
3859 (value1 / value2), Err);
3861 MaxError = Err;
3862 PrimitiveOfMaxError = prim;
3863 ElementOfMaxError = ele;
3864 xerrMax = xerr;
3865 yerrMax = yerr;
3866 zerrMax = zerr;
3867 }
3868 }
3869
3870
3871 xerr = 0.25 * (0.5 * (x0 + x3) + xo + 0.5 * (x3 + x2) + x3);
3872 yerr = 0.25 * (0.5 * (y0 + y3) + yo + 0.5 * (y3 + y2) + y3);
3873 zerr = 0.25 * (0.5 * (z0 + z3) + zo + 0.5 * (z3 + z2) + z3);
3874 globalP.X = xerr;
3875 globalP.Y = yerr;
3876 globalP.Z = zerr;
3877
3878
3879
3881 PFAtPoint(&globalP, &Potential, &globalF);
3882 Err =
ApplPot[prim] - Potential;
3883 fprintf(fErr, "%d\t%d\t%d\t%d\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n",
3884 prim, ele, 4, 1, xerr, yerr, zerr,
ApplPot[prim], Potential,
3885 Err);
3887 MaxError = Err;
3888 PrimitiveOfMaxError = prim;
3889 ElementOfMaxError = ele;
3890 xerrMax = xerr;
3891 yerrMax = yerr;
3892 zerrMax = zerr;
3893 }
3894 }
3896 4) {
3897 double xplus = xerr + (
EleArr + ele - 1)->G.DC.XUnit.X * normdisp;
3898 xplus += (
EleArr + ele - 1)->G.DC.YUnit.X * normdisp;
3899 xplus += (
EleArr + ele - 1)->G.DC.ZUnit.X * normdisp;
3900 double yplus = yerr + (
EleArr + ele - 1)->G.DC.XUnit.Y * normdisp;
3901 yplus += (
EleArr + ele - 1)->G.DC.YUnit.Y * normdisp;
3902 yplus += (
EleArr + ele - 1)->G.DC.ZUnit.Y * normdisp;
3903 double zplus = zerr + (
EleArr + ele - 1)->G.DC.XUnit.Z * normdisp;
3904 zplus += (
EleArr + ele - 1)->G.DC.YUnit.Z * normdisp;
3905 zplus += (
EleArr + ele - 1)->G.DC.ZUnit.Z * normdisp;
3906 globalP.X = xplus;
3907 globalP.Y = yplus;
3908 globalP.Z = zplus;
3909 PFAtPoint(&globalP, &Potential, &globalF);
3910 localF
3913 double value1 = -localF.Y;
3914 double xminus = xerr - (
EleArr + ele - 1)->G.DC.XUnit.X * normdisp;
3915 xminus -= (
EleArr + ele - 1)->G.DC.YUnit.X * normdisp;
3916 xminus -= (
EleArr + ele - 1)->G.DC.ZUnit.X * normdisp;
3917 double yminus = yerr - (
EleArr + ele - 1)->G.DC.XUnit.Y * normdisp;
3918 yminus -= (
EleArr + ele - 1)->G.DC.YUnit.Y * normdisp;
3919 yminus -= (
EleArr + ele - 1)->G.DC.ZUnit.Y * normdisp;
3920 double zminus = zerr - (
EleArr + ele - 1)->G.DC.XUnit.Z * normdisp;
3921 zminus -= (
EleArr + ele - 1)->G.DC.YUnit.Z * normdisp;
3922 zminus -= (
EleArr + ele - 1)->G.DC.ZUnit.Z * normdisp;
3923 globalP.X = xminus;
3924 globalP.Y = yminus;
3925 globalP.Z = zminus;
3926 PFAtPoint(&globalP, &Potential, &globalF);
3927 localF
3930 double value2 = -localF.Y;
3932 Err = epsratio - (value1 / value2);
3933 fprintf(fErr, "%d\t%d\t%d\t%d\t%lg\t%lg\t%lg\t%lg\t%lg\t%lg\n",
3934 prim, ele, 4, 4, xerr, yerr, zerr, epsratio,
3935 (value1 / value2), Err);
3937 MaxError = Err;
3938 PrimitiveOfMaxError = prim;
3939 ElementOfMaxError = ele;
3940 xerrMax = xerr;
3941 yerrMax = yerr;
3942 zerrMax = zerr;
3943 }
3944 }
3945 }
3946
3948 }
3949
3950 fprintf(fErr,
3951 "#Error maximum on element %d on primitive %d with x,y,z %lg, "
3952 "%lg, %lg and its magnitude is %lg.\n",
3953 ElementOfMaxError, PrimitiveOfMaxError, xerrMax, yerrMax, zerrMax,
3954 MaxError);
3955 fclose(fErr);
3956 }
3957
3958 return (0);
3959}
int PFAtPoint(Point3D *globalP, double *Potential, Vector3D *globalF)
neBEMGLOBAL double * ApplPot
neBEMGLOBAL int OptRepeatLHMatrix
neBEMGLOBAL double * PrimOriginZ
neBEMGLOBAL int OptEstimateError
neBEMGLOBAL double * Epsilon1
neBEMGLOBAL double * PrimOriginY
neBEMGLOBAL int * InterfaceType
neBEMGLOBAL double * PrimOriginX
neBEMGLOBAL int OptForceValidation
neBEMGLOBAL double * Epsilon2