27 #if defined(HAVE_CONFIG_H)
30 #if defined(HAVE_GL_GL_H)
32 #elif defined(HAVE_OPENGL_GL_H)
33 #include <OpenGL/gl.h>
61 for (ib = 0; ib <
nb; ++ib) {
62 for (i0 = 0; i0 <
ntri[ib]; ++i0) {
63 for (i1 = 0; i1 < 3; ++i1) {
64 for (i2 = 0; i2 < 2; ++i2)
65 delete[]
arw[ib][i0][i1][i2];
66 delete[]
nmlp[ib][i0][i1];
67 delete[]
matp[ib][i0][i1];
68 delete[]
kvp[ib][i0][i1];
69 delete[]
arw[ib][i0][i1];
71 delete[]
nmlp[ib][i0];
72 delete[]
matp[ib][i0];
90 for (ib = 0; ib <
nb; ++ib) {
91 for (i0 = 0; i0 <
nnl[ib]; ++i0) {
92 for (i1 = 0; i1 < 2; ++i1) {
93 delete[]
kvnl[ib][i0][i1];
95 delete[]
kvnl[ib][i0];
105 for (ib = 0; ib <
nb; ++ib) {
114 for (ib = 0; ib <
nb; ++ib) {
115 for (i0 = 0; i0 <
nequator[ib]; ++i0) {
116 for (i1 = 0; i1 < 2; ++i1) {
117 delete[]
kveq[ib][i0][i1];
119 delete[]
kveq[ib][i0];
135 GLfloat *max_th, *min_th;
141 if (
color_scale == 1) *
terminal << wxT(
" ## Color Scale as Input Quantity (Real) #############\n");
142 else if (
color_scale == 2) *
terminal << wxT(
" ## Color Scale as Input Quantity (Complex) #############\n");
143 else if (
color_scale == 3) *
terminal << wxT(
" ## Color Scale as Fermi Velocity #############\n");
144 else if (
color_scale == 4) *
terminal << wxT(
" ## Color Scale as Band Index #############\n");
145 else if (
color_scale == 5) *
terminal << wxT(
" ## Gray Scale as Input Quantity (Real) #############\n");
146 else if (
color_scale == 6) *
terminal << wxT(
" ## Gray Scale as Fermi Velocity #############\n");
152 #pragma omp parallel default(none) \
153 shared(nb,ntri,matp,max_th,min_th) private(itri,ithread)
158 max_th[ithread] = -1.0e10f;
159 min_th[ithread] = 1.0e10f;
161 for (ib = 0; ib <
nb; ib++) {
163 for (itri = 0; itri <
ntri[ib]; ++itri) {
164 for (i = 0; i < 3; ++i) {
165 if (
matp[ib][itri][i][0] > max_th[ithread]) max_th[ithread] =
matp[ib][itri][i][0];
166 if (
matp[ib][itri][i][0] < min_th[ithread]) min_th[ithread] =
matp[ib][itri][i][0];
174 for (ithread = 1; ithread <
nthreads; ithread++) {
180 #pragma omp parallel default(none) \
181 shared(nb,ntri,matp,max_th,min_th) private(itri,ithread)
187 max_th[ithread] = -1.0e10f;
188 min_th[ithread] = 1.0e10f;
190 for (ib = 0; ib <
nb; ib++) {
192 for (itri = 0; itri <
ntri[ib]; ++itri) {
193 for (i = 0; i < 3; ++i) {
194 abs = sqrtf(
matp[ib][itri][i][0] *
matp[ib][itri][i][0]
195 +
matp[ib][itri][i][1] *
matp[ib][itri][i][1]);
196 if (abs > max_th[ithread]) max_th[ithread] = abs;
197 if (abs < min_th[ithread]) min_th[ithread] = abs;
205 for (ithread = 1; ithread <
nthreads; ithread++) {
211 #pragma omp parallel default(none) \
212 shared(nb,ntri,matp,min_th,max_th) private(itri,ithread)
218 min_th[ithread] = 1.0e10f;
219 max_th[ithread] = -1.0e10f;
221 for (ib = 0; ib <
nb; ib++) {
223 for (itri = 0; itri <
ntri[ib]; ++itri) {
224 for (i = 0; i < 3; ++i) {
225 abs = sqrtf(
matp[ib][itri][i][0] *
matp[ib][itri][i][0]
226 +
matp[ib][itri][i][1] *
matp[ib][itri][i][1]
227 +
matp[ib][itri][i][2] *
matp[ib][itri][i][2]);
228 if (abs > max_th[ithread]) max_th[ithread] = abs;
229 if (abs < min_th[ithread]) min_th[ithread] = abs;
237 for (ithread = 1; ithread <
nthreads; ithread++) {
243 #pragma omp parallel default(none) \
244 shared(nb,ntri,nmlp,max_th,min_th) private(itri,ithread)
250 max_th[ithread] = -1.0e10f;
251 min_th[ithread] = 1.0e10f;
253 for (ib = 0; ib <
nb; ib++) {
255 for (itri = 0; itri <
ntri[ib]; ++itri) {
256 for (i = 0; i < 3; ++i) {
258 for (j = 0; j < 3; ++j) norm +=
nmlp[ib][itri][i][j]*
nmlp[ib][itri][i][j];
261 if (norm > max_th[ithread]) max_th[ithread] = norm;
262 if (norm < min_th[ithread]) min_th[ithread] = norm;
270 for (ithread = 1; ithread <
nthreads; ithread++) {
294 #pragma omp parallel default(none) \
295 shared(nb,ntri,matp,clr,BarColor,patch_max,patch_min) \
301 for (ib = 0; ib <
nb; ib++) {
302 #pragma omp for nowait
303 for (itri = 0; itri <
ntri[ib]; ++itri) {
304 for (i = 0; i < 3; ++i) {
310 for (j = 0; j < 4; ++j)
clr[ib][j + 4 * i + 12 * itri]
313 else if (mat2 <= 2.0) {
315 for (j = 0; j < 4; ++j)
clr[ib][j + 4 * i + 12 * itri]
318 else if (mat2 <= 3.0) {
320 for (j = 0; j < 4; ++j)
clr[ib][j + 4 * i + 12 * itri]
325 for (j = 0; j < 4; ++j)
clr[ib][j + 4 * i + 12 * itri]
337 #pragma omp parallel default(none) \
338 shared(nb,ntri,matp,clr,cyan,blue,green,yellow,red,magenta,bgray,wgray,patch_max,origin) \
342 GLfloat theta, abs, theta2;
344 for (ib = 0; ib <
nb; ib++) {
345 for (itri = 0; itri <
ntri[ib]; ++itri) {
346 for (i = 0; i < 3; ++i) {
348 abs = sqrtf(
matp[ib][itri][i][0] *
matp[ib][itri][i][0]
349 +
matp[ib][itri][i][1] *
matp[ib][itri][i][1]);
350 if (abs /
patch_max < 0.00001) theta = 0.0f;
351 else if (
matp[ib][itri][i][1] > 0.0) theta = acosf(
matp[ib][itri][i][0] / abs);
352 else theta = -acosf(
matp[ib][itri][i][0] / abs);
354 theta = 3.0f * theta / acosf(-1.0f);
356 if (-3.0f <= theta && theta < -2.0f) {
357 theta2 = theta + 3.0f;
358 for (j = 0; j < 4; ++j)
359 clr[ib][j + 4 * i + 12 * itri] =
blue[j] * theta2 +
cyan[j] * (1.0f - theta2);
361 else if (-2.0f <= theta && theta < -1.0f) {
362 theta2 = theta + 2.0f;
363 for (j = 0; j < 4; ++j)
364 clr[ib][j + 4 * i + 12 * itri] =
magenta[j] * theta2 +
blue[j] * (1.0f - theta2);
366 else if (-1.0f <= theta && theta < 0.0f) {
367 theta2 = theta + 1.0f;
368 for (j = 0; j < 4; ++j)
369 clr[ib][j + 4 * i + 12 * itri] =
red[j] * theta2 +
magenta[j] * (1.0f - theta2);
371 else if (0.0f <= theta && theta < 1.0f) {
373 for (j = 0; j < 4; ++j)
374 clr[ib][j + 4 * i + 12 * itri] =
yellow[j] * theta2 +
red[j] * (1.0f - theta2);
376 else if (1.0f <= theta && theta < 2.0f) {
377 theta2 = theta - 1.0f;
378 for (j = 0; j < 4; ++j)
379 clr[ib][j + 4 * i + 12 * itri] =
green[j] * theta2 +
yellow[j] * (1.0f - theta2);
382 theta2 = theta - 2.0f;
383 for (j = 0; j < 4; ++j)
384 clr[ib][j + 4 * i + 12 * itri] =
cyan[j] * theta2 +
green[j] * (1.0f - theta2);
386 clr[ib][j + 4 * i + 12 * itri] =
clr[ib][j + 4 * i + 12 * itri] * abs + origin[j] * (1.0f - abs);
394 #pragma omp parallel default(none) \
395 shared(nb,ntri,nmlp,clr,BarColor,patch_max,patch_min) \
401 for (ib = 0; ib <
nb; ib++) {
402 #pragma omp for nowait
403 for (itri = 0; itri <
ntri[ib]; ++itri) {
404 for (i = 0; i < 3; ++i) {
407 for (j = 0; j < 3; ++j) mat2 +=
nmlp[ib][itri][i][j] *
nmlp[ib][itri][i][j];
413 for (j = 0; j < 4; ++j)
clr[ib][j + 4 * i + 12 * itri]
416 else if (mat2 <= 2.0) {
418 for (j = 0; j < 4; ++j)
clr[ib][j + 4 * i + 12 * itri]
421 else if (mat2 <= 3.0) {
423 for (j = 0; j < 4; ++j)
clr[ib][j + 4 * i + 12 * itri]
428 for (j = 0; j < 4; ++j)
clr[ib][j + 4 * i + 12 * itri]
437 #pragma omp parallel default(none) \
438 shared(nb,ntri,matp,clr,BarColor,color_scale,kvp,arw,patch_max,rgb_band) \
443 for (ib = 0; ib <
nb; ib++) {
445 #pragma omp for nowait
446 for (itri = 0; itri <
ntri[ib]; ++itri) {
447 for (i = 0; i < 3; ++i) {
448 for (j = 0; j < 4; ++j)
clr[ib][j + 4 * i + 12 * itri] =
rgb_band[ib][j];
454 for (ib = 0; ib <
nb; ib++) {
455 #pragma omp for nowait
456 for (itri = 0; itri <
ntri[ib]; ++itri) {
457 for (i = 0; i < 3; ++i) {
458 for (j = 0; j < 3; ++j) {
459 arw[ib][itri][i][0][j] =
kvp[ib][itri][i][j]
461 arw[ib][itri][i][1][j] =
kvp[ib][itri][i][j]
471 #pragma omp parallel default(none) \
472 shared(nb,ntri,matp,clr,bgray,wgray,patch_max,patch_min) \
478 for (ib = 0; ib <
nb; ib++) {
479 #pragma omp for nowait
480 for (itri = 0; itri <
ntri[ib]; ++itri) {
481 for (i = 0; i < 3; ++i) {
485 for (j = 0; j < 4; ++j)
clr[ib][j + 4 * i + 12 * itri] =
wgray[j] * mat2 +
bgray[j] * (1.0f - mat2);
492 #pragma omp parallel default(none) \
493 shared(nb,ntri,nmlp,clr,bgray,wgray,patch_max,patch_min) \
499 for (ib = 0; ib <
nb; ib++) {
500 #pragma omp for nowait
501 for (itri = 0; itri <
ntri[ib]; ++itri) {
502 for (i = 0; i < 3; ++i) {
505 for (j = 0; j < 3; ++j) mat2 +=
nmlp[ib][itri][i][j] *
nmlp[ib][itri][i][j];
509 for (j = 0; j < 4; ++j)
clr[ib][j + 4 * i + 12 * itri] =
wgray[j] * mat2 +
bgray[j] * (1.0f - mat2);