|
[Sponsors] |
January 24, 2024, 07:51 |
error LNK2019:
|
#1 |
New Member
amina
Join Date: Feb 2020
Posts: 9
Rep Power: 6 |
hi users,
I'm desperate to compile my udf but without success always the same error that appears: error LNK2019: external symbol not resolved locate reference in TABLE function. i've consulted all the messages on the forum concerning this error and i've tried all the suggestions but without success. this is my udf i hope that someone can help me!! #include "udf.h" #define N 2 #define Cmin 3e-5 #define Cmax 60 #define T0 555 double F, x, P; double Tg, Tb,Y; #define P 1 Thread* ct; cell_t c; void locate(double xx[], int n, double x, int jj); int i, ii, jj,j, k, l, m,n,P1; double F_table[N+1], Cabs[N+1], Cref[N+1], Fdata1[2], Fdata2[2], Ctab[71], C[71],PPP[10]; DEFINE_ON_DEMAND(crs) { for (i = 0; i < N + 1; i++) { ii = i; Cabs[i] = Cmin * pow((Cmax / Cmin), (ii / (N))); Cref[i] = Cabs[i]; } for (i = 0; i < 71; i++) { ii = i; Ctab[i] = Cmin * pow((Cmax / Cmin), (ii / (70))); C[i] = Ctab[i]; } } double TABLE(cell_t c, Thread* t, double Cabs, double Tg, double Tb,double Y, int P1,double Ctab[], double Fdata1[], double Fdata2[]) { double T[28], Fint[16], YY[9], PP[10], PPP[10]; Tb = C_T(c,t); Tg = 555;//////////////////////////////////////////////////////////////////////////////////////////////a verifier Y = C_YI(c, t, 1); // Put values in range if they are out of bounds if (Cabs< C[0]) Cabs= C[0]; if (Cabs> C[70]) Cabs = C[70]; if (Tg < 300) Tg = 300; if (Tg > 3000) Tg = 3000; if (Tb < 300) Tb = 300; if (Tb > 3000) Tb = 3000; // Set temperature values T[0] = 300; for (i = 1; i < 28; i++) { T[i] = T[i - 1] + 100; } // Set pressure values PPP[0] = 0.1; PPP[1] = 0.25; PPP[2] = 0.5; PPP[3] = 1; PPP[4] = 2; PPP[5] = 4; PPP[6] = 8; PPP[7] = 15; PPP[8] = 30; PPP[9] = 50; PP[0] = 0.1; PP[1] = 0.25; PP[2] = 0.5; PP[3] = 1; PP[4] = 2; PP[5] = 4; PP[6] = 8; PP[7] = 15; PP[8] = 30; PP[9] = 50; YY[0] = 0; YY[1] = 0.05; YY[2] = 0.1; YY[3] = 0.2; YY[4] = 0.3; YY[5] = 0.4; YY[6] = 0.6; YY[7] = 0.8; YY[8] = 1; // Find location of Tg, Tb, and C locate (PPP, 9, P, P1); locate(T, 27, Tg, m); locate(T, 27, Tb, l); locate(Ctab, 70, Cabs,k); locate(YY, 8, Y, j); i = j * 55664 + m * 1988 + l * 71 + k; { // Interpolate in P Fint[0] = Fdata1[i] + (Fdata2[i] - Fdata1[i]) * (P - PP[P1]) / (PP[P1 + 1] - PP[P1]); Fint[1] = Fdata1[i + 55664] + (Fdata2[i + 55664] - Fdata1[i + 55664]) * (P - PP[P1]) / (PP[P1 + 1] - PP[P1]); Fint[2] = Fdata1[i + 1] + (Fdata2[i + 1] - Fdata1[i + 1]) * (P - PP[P1]) / (PP[P1 + 1] - PP[P1]); Fint[3] = Fdata1[i + 55665] + (Fdata2[i + 55665] - Fdata1[i + 55665]) * (P - PP[P1]) / (PP[P1 + 1] - PP[P1]); Fint[4] = Fdata1[i + 71] + (Fdata2[i + 71] - Fdata1[i + 71]) * (P - PP[P1]) / (PP[P1 + 1] - PP[P1]); Fint[5] = Fdata1[i + 55735] + (Fdata2[i + 55735] - Fdata1[i + 55735]) * (P - PP[P1]) / (PP[P1 + 1] - PP[P1]); Fint[6] = Fdata1[i + 72] + (Fdata2[i + 72] - Fdata1[i + 72]) * (P - PP[P1]) / (PP[P1 + 1] - PP[P1]); Fint[7] = Fdata1[i + 55736] + (Fdata2[i + 55736] - Fdata1[i + 55736]) * (P - PP[P1]) / (PP[P1 + 1] - PP[P1]); Fint[8] = Fdata1[i + 1988] + (Fdata2[i + 1988] - Fdata1[i + 1988]) * (P - PP[P1]) / (PP[P1 + 1] - PP[P1]); Fint[9] = Fdata1[i + 57652] + (Fdata2[i + 57652] - Fdata1[i + 57652]) * (P - PP[P1]) / (PP[P1 + 1] - PP[P1]); Fint[10] = Fdata1[i + 1989] + (Fdata2[i + 1989] - Fdata1[i + 1989]) * (P - PP[P1]) / (PP[P1 + 1] - PP[P1]); Fint[11] = Fdata1[i + 57653] + (Fdata2[i + 57653] - Fdata1[i + 57653]) * (P - PP[P1]) / (PP[P1 + 1] - PP[P1]); Fint[12] = Fdata1[i + 2059] + (Fdata2[i + 2059] - Fdata1[i + 2059]) * (P - PP[P1]) / (PP[P1 + 1] - PP[P1]); Fint[13] = Fdata1[i + 57723] + (Fdata2[i + 57723] - Fdata1[i + 57723]) * (P - PP[P1]) / (PP[P1 + 1] - PP[P1]); Fint[14] = Fdata1[i + 2060] + (Fdata2[i + 2060] - Fdata1[i + 2060]) * (P - PP[P1]) / (PP[P1 + 1] - PP[P1]); Fint[15] = Fdata1[i + 57724] + (Fdata2[i + 57724] - Fdata1[i + 57724]) * (P - PP[P1]) / (PP[P1 + 1] - PP[P1]); // Interpolate in Y Fint[0] = Fint[0] + (Fint[1] - Fint[0]) * (Y - YY[j]) / (YY[j + 1] - YY[j]); Fint[1] = Fint[2] + (Fint[3] - Fint[2]) * (Y - YY[j]) / (YY[j + 1] - YY[j]); Fint[2] = Fint[4] + (Fint[5] - Fint[4]) * (Y - YY[j]) / (YY[j + 1] - YY[j]); Fint[3] = Fint[6] + (Fint[7] - Fint[6]) * (Y - YY[j]) / (YY[j + 1] - YY[j]); Fint[4] = Fint[8] + (Fint[9] - Fint[8]) * (Y - YY[j]) / (YY[j + 1] - YY[j]); Fint[5] = Fint[10] + (Fint[11] - Fint[10]) * (Y - YY[j]) / (YY[j + 1] - YY[j]); Fint[6] = Fint[12] + (Fint[13] - Fint[12]) * (Y - YY[j]) / (YY[j + 1] - YY[j]); Fint[7] = Fint[14] + (Fint[15] - Fint[14]) * (Y - YY[j]) / (YY[j + 1] - YY[j]); // Interpolate in C Fint[0] = Fint[0] + (Fint[1] - Fint[0]) * (Cabs - Ctab[k]) / (Ctab[k + 1] - Ctab[k]); Fint[1] = Fint[2] + (Fint[3] - Fint[2]) * (Cabs- Ctab[k]) / (Ctab[k + 1] - Ctab[k]); Fint[2] = Fint[4] + (Fint[5] - Fint[4]) * (Cabs- Ctab[k]) / (Ctab[k + 1] - Ctab[k]); Fint[3] = Fint[6] + (Fint[7] - Fint[6]) * (Cabs- Ctab[k]) / (Ctab[k + 1] - Ctab[k]); // Interpolate in Tb Fint[0] = Fint[0] + (Fint[1] - Fint[0]) * (Tb - T[l]) / (T[l + 1] - T[l]); Fint[1] = Fint[2] + (Fint[3] - Fint[2]) * (Tb - T[l]) / (T[l + 1] - T[l]); // Interpolate in Tg F = Fint[0] + (Fint[1] - Fint[0]) * (Tg - T[m]) / (T[m + 1] - T[m]); return F; } } |
|
|
|