8 #include PROTEUS_LAPACK_H
21 int nElementBoundaryQuadraturePoints_elementBoundary,
23 int nExteriorElementBoundaries_global,
24 int nInteriorElementBoundaries_global,
25 int* elementBoundaryElementsArray,
26 int* elementBoundaryLocalElementBoundariesArray,
27 int* exteriorElementBoundariesArray,
28 int* interiorElementBoundariesArray,
34 int ebNE,ebNI,ebN,k,left_eN_global,left_ebN_element,right_eN_global,right_ebN_element,I;
35 for (ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
37 ebN = exteriorElementBoundariesArray[ebNE];
38 left_eN_global = elementBoundaryElementsArray[ebN*2+0];
39 left_ebN_element = elementBoundaryLocalElementBoundariesArray[ebN*2+0];
40 for (k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
41 for (I=0;I<nSpace_global;I++)
43 xg[ebN*nElementBoundaryQuadraturePoints_elementBoundary*3+
46 x[left_eN_global*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
47 left_ebN_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
50 ng[ebN*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
53 n[left_eN_global*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
54 left_ebN_element*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
59 for (ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
61 ebN = interiorElementBoundariesArray[ebNI];
62 left_eN_global = elementBoundaryElementsArray[ebN*2+0];
63 left_ebN_element = elementBoundaryLocalElementBoundariesArray[ebN*2+0];
64 right_eN_global = elementBoundaryElementsArray[ebN*2+1];
65 right_ebN_element = elementBoundaryLocalElementBoundariesArray[ebN*2+1];
66 for (k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
67 for (I=0;I<nSpace_global;I++)
69 xg[ebN*nElementBoundaryQuadraturePoints_elementBoundary*3+
72 x[left_eN_global*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
73 left_ebN_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
76 ng[ebN*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
79 n[left_eN_global*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
80 left_ebN_element*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
83 x[right_eN_global*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
84 right_ebN_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
87 x[left_eN_global*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
88 left_ebN_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
91 n[right_eN_global*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
92 right_ebN_element*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
95 -
n[left_eN_global*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
96 left_ebN_element*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
104 int nElementBoundaryQuadraturePoints_elementBoundary,
106 int nExteriorElementBoundaries_global,
107 int nInteriorElementBoundaries_global,
108 int* elementBoundaryElementsArray,
109 int* elementBoundaryLocalElementBoundariesArray,
110 int* exteriorElementBoundariesArray,
111 int* interiorElementBoundariesArray,
119 int ebNE,ebNI,ebN,k,left_eN_global,left_ebN_element,right_eN_global,right_ebN_element,I,J;
121 for (ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
123 ebN = exteriorElementBoundariesArray[ebNE];
124 left_eN_global = elementBoundaryElementsArray[ebN*2+0];
125 left_ebN_element = elementBoundaryLocalElementBoundariesArray[ebN*2+0];
126 for (k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
129 for (J=0;J<nSpace_global;J++)
130 dot+= ebqe_n[ebNE*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
133 ng[ebN*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
141 for (I=0;I<nSpace_global;I++)
143 x[left_eN_global*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
144 left_ebN_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
146 I] = xg[ebN*nElementBoundaryQuadraturePoints_elementBoundary*3+
149 n[left_eN_global*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
150 left_ebN_element*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
153 ng[ebN*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
156 ebqe_x[ebNE*nElementBoundaryQuadraturePoints_elementBoundary*3+
158 I] = xg[ebN*nElementBoundaryQuadraturePoints_elementBoundary*3+
161 ebqe_n[ebNE*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
164 sign*ng[ebN*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
170 for (ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
172 ebN = interiorElementBoundariesArray[ebNI];
173 left_eN_global = elementBoundaryElementsArray[ebN*2+0];
174 left_ebN_element = elementBoundaryLocalElementBoundariesArray[ebN*2+0];
175 right_eN_global = elementBoundaryElementsArray[ebN*2+1];
176 right_ebN_element = elementBoundaryLocalElementBoundariesArray[ebN*2+1];
177 for (k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
178 for (I=0;I<nSpace_global;I++)
180 x[left_eN_global*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
181 left_ebN_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
183 I] = xg[ebN*nElementBoundaryQuadraturePoints_elementBoundary*3+
186 n[left_eN_global*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
187 left_ebN_element*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
189 I] = ng[ebN*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
192 x[right_eN_global*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
193 right_ebN_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
195 I] = xg[ebN*nElementBoundaryQuadraturePoints_elementBoundary*3+
198 n[right_eN_global*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
199 right_ebN_element*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
201 I] = -ng[ebN*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global+
209 int nElementBoundaryQuadraturePoints_elementBoundary,
210 int nExteriorElementBoundaries_global,
211 int nInteriorElementBoundaries_global,
212 int* elementBoundaryElementsArray,
213 int* elementBoundaryLocalElementBoundariesArray,
214 int* exteriorElementBoundariesArray,
215 int* interiorElementBoundariesArray,
218 int ebNI,ebN,k,left_eN_global,left_ebN_element,right_eN_global,right_ebN_element,I;
219 for (ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
221 ebN = interiorElementBoundariesArray[ebNI];
222 left_eN_global = elementBoundaryElementsArray[ebN*2+0];
223 left_ebN_element = elementBoundaryLocalElementBoundariesArray[ebN*2+0];
224 right_eN_global = elementBoundaryElementsArray[ebN*2+1];
225 right_ebN_element = elementBoundaryLocalElementBoundariesArray[ebN*2+1];
226 for (k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
229 xt[right_eN_global*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
230 right_ebN_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
233 xt[left_eN_global*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
234 left_ebN_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
242 int nQuadraturePoints_element,
248 for(eN=0;eN<nElements_global;eN++)
249 for(k=0;k<nQuadraturePoints_element;k++)
250 for(j=0;j<nDOF_element;j++)
251 vArray[eN*nQuadraturePoints_element*nDOF_element+
260 int nElementBoundaries_element,
261 int nElementBoundaryQuadraturePoints_elementBoundary,
268 for(eN=0;eN<nElements_global;eN++)
269 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
270 for(k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
271 for(j=0;j<nDOF_element;j++)
272 vArray[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
273 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
277 psi[permutations[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary+
278 ebN*nElementBoundaryQuadraturePoints_elementBoundary+
284 int nElementBoundaryQuadraturePoints_elementBoundary,
286 int nExteriorElementBoundaries_global,
287 const int* exteriorElementBoundariesArray,
288 const int* elementBoundaryElementsArray,
289 const int* elementBoundaryLocalElementBoundariesArray,
293 int eN,ebN,ebNE,ebN_local,k,j;
294 for (ebNE = 0; ebNE < nExteriorElementBoundaries_global; ebNE++)
296 ebN = exteriorElementBoundariesArray[ebNE];
297 eN = elementBoundaryElementsArray[ebN*2+0];
298 ebN_local = elementBoundaryLocalElementBoundariesArray[ebN*2+0];
299 for(k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
300 for(j=0;j<nDOF_element;j++)
301 vArray[ebNE*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
305 psi[ebN_local*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element +
312 int nQuadraturePoints_element,
316 double* inverseJacobianArray,
319 int eN,k,j,I,J,nSpace_global2 = nSpace_global*nSpace_global;
320 for(eN=0;eN<nElements_global;eN++)
321 for(k=0;k<nQuadraturePoints_element;k++)
322 for(j=0;j<nDOF_element;j++)
323 for (I=0;I<nSpace_global;I++)
324 for (J=0;J<nSpace_global;J++)
325 grad_vArray[eN*nQuadraturePoints_element*nDOF_element*nSpace_global+
326 k*nDOF_element*nSpace_global+
330 grad_psi[k*nDOF_element*nSpace_global+
334 inverseJacobianArray[eN*nQuadraturePoints_element*nSpace_global2+
341 int nQuadraturePoints_element,
345 double* inverseJacobianArray,
346 double* Hessian_vArray)
348 int eN,k,j,I,J,K,
L,nSpace_global2 = nSpace_global*nSpace_global;
349 for(eN=0;eN<nElements_global;eN++)
350 for(k=0;k<nQuadraturePoints_element;k++)
351 for(j=0;j<nDOF_element;j++)
352 for (I=0;I<nSpace_global;I++)
353 for (J=0;J<nSpace_global;J++)
354 for (K=0;K<nSpace_global;K++)
355 for (
L=0;
L<nSpace_global;
L++)
356 Hessian_vArray[eN*nQuadraturePoints_element*nDOF_element*nSpace_global2+
357 k*nDOF_element*nSpace_global2+
362 Hessian_psi[k*nDOF_element*nSpace_global2+
367 inverseJacobianArray[eN*nQuadraturePoints_element*nSpace_global2+
372 inverseJacobianArray[eN*nQuadraturePoints_element*nSpace_global2+
379 int nElementBoundaries_element,
380 int nElementBoundaryQuadraturePoints_elementBoundary,
385 double* inverseJacobianArray,
388 int eN,ebN,k,j,I,J,nSpace_global2 = nSpace_global*nSpace_global;
389 for(eN=0;eN<nElements_global;eN++)
390 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
391 for(k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
392 for(j=0;j<nDOF_element;j++)
393 for (I=0;I<nSpace_global;I++)
394 for (J=0;J<nSpace_global;J++)
395 grad_vArray[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element*nSpace_global+
396 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element*nSpace_global+
397 k*nDOF_element*nSpace_global+
401 grad_psi[permutations[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary+
402 ebN*nElementBoundaryQuadraturePoints_elementBoundary+
403 k]*nDOF_element*nSpace_global+
407 inverseJacobianArray[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global2+
408 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global2+
415 int nElementBoundaryQuadraturePoints_elementBoundary,
418 int nExteriorElementBoundaries_global,
419 const int *exteriorElementBoundariesArray,
420 const int *elementBoundaryElementsArray,
421 const int *elementBoundaryLocalElementBoundariesArray,
423 double* inverseJacobianArray,
426 int ebN,ebNE,ebN_local,eN,k,j,I,J,nSpace_global2 = nSpace_global*nSpace_global;
427 for (ebNE = 0; ebNE < nExteriorElementBoundaries_global; ebNE++)
429 ebN = exteriorElementBoundariesArray[ebNE];
430 eN = elementBoundaryElementsArray[ebN*2+0];
431 ebN_local = elementBoundaryLocalElementBoundariesArray[ebN*2+0];
432 for(k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
433 for(j=0;j<nDOF_element;j++)
434 for (I=0;I<nSpace_global;I++)
435 for (J=0;J<nSpace_global;J++)
436 grad_vArray[ebNE*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element*nSpace_global+
437 k*nDOF_element*nSpace_global+
441 grad_psi[ebN_local*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element*nSpace_global+
442 k*nDOF_element*nSpace_global+
446 inverseJacobianArray[ebNE*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global2+
454 int nElementBoundaries_element,
455 int nElementBoundaryQuadraturePoints_elementBoundary,
460 const int kTot=(nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary);
462 register double errorNorm,errorNormMin;
464 for (k0=0;k0<kTot;k0++)
467 for (eN=1;eN<nElements_global;eN++)
469 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
470 for (k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
473 for (k0=0;k0<kTot;k0++)
476 for (I=0;I<nSpace_global;I++)
478 errorNorm += fabs(xiArray[k0*3+I]
480 xiArray[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
481 ebN*nElementBoundaryQuadraturePoints_elementBoundary*3+
485 if (errorNorm < errorNormMin)
487 permutations[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary+
488 ebN*nElementBoundaryQuadraturePoints_elementBoundary+
490 errorNormMin = errorNorm;
498 int nExteriorElementBoundaries_global,
499 const int * exteriorElementBoundariesArray,
500 const int * elementBoundaryElementsArray,
501 const int * elementBoundaryLocalElementBoundariesArray,
505 const int kTot=nElementBoundaryQuadraturePoints_elementBoundary;
506 int eN,ebN,ebNE,ebN_local,k,k0,I;
507 register double errorNorm,errorNormMin;
509 for (k0=0;k0<kTot;k0++)
512 for (ebNE = 1; ebNE < nExteriorElementBoundaries_global; ebNE++)
514 ebN = exteriorElementBoundariesArray[ebNE];
515 eN = elementBoundaryElementsArray[ebN*2+0];
516 ebN_local = elementBoundaryLocalElementBoundariesArray[ebN*2+0];
517 for (k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
520 for (k0=0;k0<kTot;k0++)
523 for (I=0;I<nSpace_global;I++)
525 errorNorm += fabs(xiArray[k0*3+I]
527 xiArray[ebNE*nElementBoundaryQuadraturePoints_elementBoundary*3+
531 if (errorNorm < errorNormMin)
533 permutations[ebNE*nElementBoundaryQuadraturePoints_elementBoundary+
535 errorNormMin = errorNorm;
543 int nElementBoundaryQuadraturePoints_elementBoundary,
549 register double errorNorm,errorNormMin;
551 for (ebN=0;ebN<nElementBoundaries_global;ebN++)
553 for (k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
556 for (k0=0;k0<nElementBoundaryQuadraturePoints_elementBoundary;k0++)
561 errorNorm += fabs(xArrayNew[ebN*nElementBoundaryQuadraturePoints_elementBoundary*3+
565 xArray[ebN*nElementBoundaryQuadraturePoints_elementBoundary*3+
569 if (errorNorm < errorNormMin)
571 permutations[ebN*nElementBoundaryQuadraturePoints_elementBoundary+
573 errorNormMin = errorNorm;
581 int nQuadraturePoints_element,
589 memset(xArray,0,
sizeof(
double)*nElements_global*nQuadraturePoints_element*3);
590 int eN,k,j,j_global,I;
591 for(eN=0;eN<nElements_global;eN++)
592 for(k=0;k<nQuadraturePoints_element;k++)
593 for(j=0;j<nDOF_element;j++)
595 j_global = l2g[eN*nDOF_element+
597 for(I=0;I<nSpace_global;I++)
598 xArray[eN*nQuadraturePoints_element*3+
605 nodeArray[j_global*3+
611 int nElementBoundaries_element,
612 int nQuadraturePoints_element,
620 memset(xArray,0,
sizeof(
double)*nElements_global*nElementBoundaries_element*nQuadraturePoints_element*3);
621 int eN,ebN,k,j,j_global,I;
622 for(eN=0;eN<nElements_global;eN++)
623 for(ebN=0;ebN<nElementBoundaries_element;ebN++)
624 for(k=0;k<nQuadraturePoints_element;k++)
625 for(j=0;j<nDOF_element;j++)
627 j_global = l2g[eN*nDOF_element+
629 for(I=0;I<nSpace_global;I++)
630 xArray[eN*nElementBoundaries_element*nQuadraturePoints_element*3+
631 ebN*nQuadraturePoints_element*3+
635 psi[ebN*nQuadraturePoints_element*nDOF_element+
639 nodeArray[j_global*3+
647 int nExteriorElementBoundaries_global,
648 const int* exteriorElementBoundariesArray,
649 const int* elementBoundaryElementsArray,
650 const int* elementBoundaryLocalElementBoundariesArray,
656 memset(xArray,0,
sizeof(
double)*nExteriorElementBoundaries_global*nQuadraturePoints_elementBoundary*3);
657 int eN,ebN,ebNE,ebN_local,k,j,j_global,I;
658 for (ebNE = 0; ebNE < nExteriorElementBoundaries_global; ebNE++)
660 ebN = exteriorElementBoundariesArray[ebNE];
661 eN = elementBoundaryElementsArray[ebN*2 + 0];
662 ebN_local = elementBoundaryLocalElementBoundariesArray[ebN*2 + 0];
663 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
664 for(j=0;j<nDOF_element;j++)
666 j_global = l2g[eN*nDOF_element+
668 for(I=0;I<nSpace_global;I++)
669 xArray[ebNE*nQuadraturePoints_elementBoundary*3+
673 psi[ebN_local*nQuadraturePoints_elementBoundary*nDOF_element+
677 nodeArray[j_global*3+
684 int nQuadraturePoints_element,
687 double* inverseJacobian,
693 memset(xiArray,0,
sizeof(
double)*nElements_global*nQuadraturePoints_element*3);
694 int eN,k,node0,I,J,nSpace_global2=nSpace_global*nSpace_global;
695 double dx[nSpace_global];
696 for(eN=0;eN<nElements_global;eN++)
697 for(k=0;k<nQuadraturePoints_element;k++)
699 node0 = l2g[eN*nDOF_element];
700 for(I=0;I<nSpace_global;I++)
702 xArray[eN*nQuadraturePoints_element*3+
706 nodeArray[node0*3+I];
707 for(I=0;I<nSpace_global;I++)
708 for(J=0;J<nSpace_global;J++)
709 xiArray[eN*nQuadraturePoints_element*3+
713 inverseJacobian[eN*nQuadraturePoints_element*nSpace_global2+
723 int nElementBoundaries_element,
724 int nElementBoundaryQuadraturePoints_elementBoundary,
727 double* inverseJacobian,
733 memset(xiArray,0,
sizeof(
double)*nElements_global*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*3);
734 int eN,ebN,k,node0,I,J,nSpace_global2=nSpace_global*nSpace_global;
735 double dx[nSpace_global];
736 for(eN=0;eN<nElements_global;eN++)
737 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
738 for(k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
740 node0 = l2g[eN*nDOF_element];
741 for(I=0;I<nSpace_global;I++)
743 xArray[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
744 ebN*nElementBoundaryQuadraturePoints_elementBoundary*3+
748 nodeArray[node0*3+I];
749 for(I=0;I<nSpace_global;I++)
750 for(J=0;J<nSpace_global;J++)
751 xiArray[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*3+
752 ebN*nElementBoundaryQuadraturePoints_elementBoundary*3+
756 inverseJacobian[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global2+
757 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global2+
769 int nExteriorElementBoundaries_global,
770 const int* exteriorElementBoundariesArray,
771 const int* elementBoundaryElementsArray,
772 const int* elementBoundaryLocalElementBoundariesArray,
773 double* inverseJacobian,
779 memset(xiArray,0,
sizeof(
double)*nExteriorElementBoundaries_global*nElementBoundaryQuadraturePoints_elementBoundary*3);
780 int eN,ebN,ebNE,ebN_local,k,node0,I,J,nSpace_global2=nSpace_global*nSpace_global;
781 double dx[nSpace_global];
782 for (ebNE = 0; ebNE < nExteriorElementBoundaries_global; ebNE++)
784 ebN = exteriorElementBoundariesArray[ebNE];
785 eN = elementBoundaryElementsArray[ebN*2+0];
786 ebN_local = elementBoundaryLocalElementBoundariesArray[ebN*2+0];
788 for(k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
790 node0 = l2g[eN*nDOF_element];
791 for(I=0;I<nSpace_global;I++)
793 xArray[ebNE*nElementBoundaryQuadraturePoints_elementBoundary*3+
797 nodeArray[node0*3+I];
798 for(I=0;I<nSpace_global;I++)
799 for(J=0;J<nSpace_global;J++)
800 xiArray[ebNE*nElementBoundaryQuadraturePoints_elementBoundary*3+
804 inverseJacobian[ebNE*nElementBoundaryQuadraturePoints_elementBoundary*nSpace_global2+
815 int nQuadraturePoints_element,
820 double* jacobianArray,
821 double* jacobianDeterminantArray,
822 double* jacobianInverseArray)
825 const int X=0,
Y=1,Z=2,
829 double *jac=NULL,*jacDet=NULL,*jacInv=NULL,*grad=NULL,*node=NULL;
830 register double oneOverJacDet=0.0;
831 for(eN=0;eN<nElements_global;eN++)
832 for(k=0;k<nQuadraturePoints_element;k++)
834 jac = jacobianArray +
835 eN*nQuadraturePoints_element*9+
837 jacDet = jacobianDeterminantArray +
838 eN*nQuadraturePoints_element+
840 jacInv = jacobianInverseArray +
841 eN*nQuadraturePoints_element*9+
843 for(j=0;j<nDOF_element;j++)
845 j_global = l2g[eN*nDOF_element+
847 grad = grad_psi + k*nDOF_element*3 + j*3;
848 node = nodeArray + j_global*3;
849 jac[
XX] += node[X]*grad[X];
850 jac[
XY] += node[X]*grad[
Y];
851 jac[
XZ] += node[X]*grad[Z];
852 jac[
YX] += node[
Y]*grad[X];
853 jac[
YY] += node[
Y]*grad[
Y];
854 jac[
YZ] += node[
Y]*grad[Z];
855 jac[
ZX] += node[Z]*grad[X];
856 jac[
ZY] += node[Z]*grad[
Y];
857 jac[
ZZ] += node[Z]*grad[Z];
864 oneOverJacDet = 1.0/(*jacDet);
865 jacInv[
XX] = oneOverJacDet*(jac[
YY]*jac[
ZZ] - jac[
YZ]*jac[
ZY]);
866 jacInv[
YX] = oneOverJacDet*(jac[
YZ]*jac[
ZX] - jac[
YX]*jac[
ZZ]);
867 jacInv[
ZX] = oneOverJacDet*(jac[
YX]*jac[
ZY] - jac[
YY]*jac[
ZX]);
868 jacInv[
XY] = oneOverJacDet*(jac[
ZY]*jac[
XZ] - jac[
ZZ]*jac[
XY]);
869 jacInv[
YY] = oneOverJacDet*(jac[
ZZ]*jac[
XX] - jac[
ZX]*jac[
XZ]);
870 jacInv[
ZY] = oneOverJacDet*(jac[
ZX]*jac[
XY] - jac[
ZY]*jac[
XX]);
871 jacInv[
XZ] = oneOverJacDet*(jac[
XY]*jac[
YZ] - jac[
XZ]*jac[
YY]);
872 jacInv[
YZ] = oneOverJacDet*(jac[
XZ]*jac[
YX] - jac[
XX]*jac[
YZ]);
873 jacInv[
ZZ] = oneOverJacDet*(jac[
XX]*jac[
YY] - jac[
XY]*jac[
YX]);
878 int nQuadraturePoints_element,
883 double* jacobianArray,
884 double* jacobianDeterminantArray,
885 double* jacobianInverseArray)
891 double *jac=NULL,*jacDet=NULL,*jacInv=NULL,*grad=NULL,*node=NULL;
892 register double oneOverJacDet=0.0;
893 for(eN=0;eN<nElements_global;eN++)
894 for(k=0;k<nQuadraturePoints_element;k++)
896 jac = jacobianArray +
897 eN*nQuadraturePoints_element*4+
899 jacDet = jacobianDeterminantArray +
900 eN*nQuadraturePoints_element+
902 jacInv = jacobianInverseArray +
903 eN*nQuadraturePoints_element*4+
905 for(j=0;j<nDOF_element;j++)
907 j_global = l2g[eN*nDOF_element+
909 grad = grad_psi + k*nDOF_element*2 + j*2;
911 node = nodeArray + j_global*3;
912 jac[
XX] += node[X]*grad[X];
913 jac[
XY] += node[X]*grad[
Y];
914 jac[
YX] += node[
Y]*grad[X];
915 jac[
YY] += node[
Y]*grad[
Y];
920 oneOverJacDet = 1.0/(*jacDet);
921 jacInv[
XX] = oneOverJacDet*jac[
YY];
922 jacInv[
YX] = -oneOverJacDet*jac[
YX];
923 jacInv[
XY] = -oneOverJacDet*jac[
XY];
924 jacInv[
YY] = oneOverJacDet*jac[
XX];
929 int nQuadraturePoints_element,
934 double* jacobianArray,
935 double* jacobianDeterminantArray,
936 double* jacobianInverseArray)
941 double *jac=NULL,*jacDet=NULL,*jacInv=NULL,*grad=NULL,*node=NULL;
942 register double oneOverJacDet=0.0;
943 for(eN=0;eN<nElements_global;eN++)
944 for(k=0;k<nQuadraturePoints_element;k++)
946 jac = jacobianArray +
947 eN*nQuadraturePoints_element+
949 jacDet = jacobianDeterminantArray +
950 eN*nQuadraturePoints_element+
952 jacInv = jacobianInverseArray +
953 eN*nQuadraturePoints_element+
955 for(j=0;j<nDOF_element;j++)
957 j_global = l2g[eN*nDOF_element+
959 grad = grad_psi + k*nDOF_element + j;
961 node = nodeArray + j_global*3;
962 jac[
XX] += node[X]*grad[X];
967 oneOverJacDet = 1.0/(*jacDet);
968 jacInv[
XX] = oneOverJacDet;
973 int nElementBoundaries_element,
974 int nQuadraturePoints_element,
977 double* boundaryNormals,
978 double* boundaryJacobians,
981 double* jacobianInverseArray,
982 double* metricTensorArray,
983 double* metricTensorDeterminantSqrtArray,
984 double* unitNormalArray)
986 int eN,ebN,k,j,j_global;
997 double *jacInv=NULL,*mt=NULL,*mtDetSqrt=NULL,*
n=NULL,*grad=NULL,*node=NULL,*bn,*bj;
998 register double oneOverJacDet=0.0,oneOverNbn=0.0;
999 double emj[9],ebmj[6];
1000 for(eN=0;eN<nElements_global;eN++)
1001 for(ebN=0;ebN<nElementBoundaries_element;ebN++)
1002 for(k=0;k<nQuadraturePoints_element;k++)
1019 jacInv = jacobianInverseArray +
1020 eN*nElementBoundaries_element*nQuadraturePoints_element*9+
1021 ebN*nQuadraturePoints_element*9+
1023 mt = metricTensorArray +
1024 eN*nElementBoundaries_element*nQuadraturePoints_element*4+
1025 ebN*nQuadraturePoints_element*4+
1027 mtDetSqrt = metricTensorDeterminantSqrtArray +
1028 eN*nElementBoundaries_element*nQuadraturePoints_element+
1029 ebN*nQuadraturePoints_element+
1031 n = unitNormalArray+
1032 eN*nElementBoundaries_element*nQuadraturePoints_element*3+
1033 ebN*nQuadraturePoints_element*3+
1035 bn = boundaryNormals + ebN*3;
1036 bj = boundaryJacobians + ebN*6;
1037 for(j=0;j<nDOF_element;j++)
1039 j_global = l2g[eN*nDOF_element+
1041 grad = grad_psi + ebN*nQuadraturePoints_element*nDOF_element*3+k*nDOF_element*3 + j*3;
1043 node = nodeArray + j_global*3;
1044 emj[
XX] += node[X]*grad[X];
1045 emj[
XY] += node[X]*grad[
Y];
1046 emj[
XZ] += node[X]*grad[Z];
1047 emj[
YX] += node[
Y]*grad[X];
1048 emj[
YY] += node[
Y]*grad[
Y];
1049 emj[
YZ] += node[
Y]*grad[Z];
1050 emj[
ZX] += node[Z]*grad[X];
1051 emj[
ZY] += node[Z]*grad[
Y];
1052 emj[
ZZ] += node[Z]*grad[Z];
1054 oneOverJacDet = 1.0/(emj[
XX]*(emj[
YY]*emj[
ZZ] - emj[
YZ]*emj[
ZY]) -
1055 emj[
XY]*(emj[
YX]*emj[
ZZ] - emj[
YZ]*emj[
ZX]) +
1056 emj[
XZ]*(emj[
YX]*emj[
ZY] - emj[
YY]*emj[
ZX]));
1057 jacInv[
XX] = oneOverJacDet*(emj[
YY]*emj[
ZZ] - emj[
YZ]*emj[
ZY]);
1058 jacInv[
YX] = oneOverJacDet*(emj[
YZ]*emj[
ZX] - emj[
YX]*emj[
ZZ]);
1059 jacInv[
ZX] = oneOverJacDet*(emj[
YX]*emj[
ZY] - emj[
YY]*emj[
ZX]);
1060 jacInv[
XY] = oneOverJacDet*(emj[
ZY]*emj[
XZ] - emj[
ZZ]*emj[
XY]);
1061 jacInv[
YY] = oneOverJacDet*(emj[
ZZ]*emj[
XX] - emj[
ZX]*emj[
XZ]);
1062 jacInv[
ZY] = oneOverJacDet*(emj[
ZX]*emj[
XY] - emj[
ZY]*emj[
XX]);
1063 jacInv[
XZ] = oneOverJacDet*(emj[
XY]*emj[
YZ] - emj[
XZ]*emj[
YY]);
1064 jacInv[
YZ] = oneOverJacDet*(emj[
XZ]*emj[
YX] - emj[
XX]*emj[
YZ]);
1065 jacInv[
ZZ] = oneOverJacDet*(emj[
XX]*emj[
YY] - emj[
XY]*emj[
YX]);
1067 ebmj[XHX] = emj[
XX]*bj[XHX]+emj[
XY]*bj[YHX]+emj[
XZ]*bj[ZHX];
1068 ebmj[XHY] = emj[
XX]*bj[XHY]+emj[
XY]*bj[YHY]+emj[
XZ]*bj[ZHY];
1069 ebmj[YHX] = emj[
YX]*bj[XHX]+emj[
YY]*bj[YHX]+emj[
YZ]*bj[ZHX];
1070 ebmj[YHY] = emj[
YX]*bj[XHY]+emj[
YY]*bj[YHY]+emj[
YZ]*bj[ZHY];
1071 ebmj[ZHX] = emj[
ZX]*bj[XHX]+emj[
ZY]*bj[YHX]+emj[
ZZ]*bj[ZHX];
1072 ebmj[ZHY] = emj[
ZX]*bj[XHY]+emj[
ZY]*bj[YHY]+emj[
ZZ]*bj[ZHY];
1074 mt[HXHX] = ebmj[XHX]*ebmj[XHX]+ebmj[YHX]*ebmj[YHX]+ebmj[ZHX]*ebmj[ZHX];
1075 mt[HXHY] = ebmj[XHX]*ebmj[XHY]+ebmj[YHX]*ebmj[YHY]+ebmj[ZHX]*ebmj[ZHY];
1076 mt[HYHX] = ebmj[XHY]*ebmj[XHX]+ebmj[YHY]*ebmj[YHX]+ebmj[ZHY]*ebmj[ZHX];
1077 mt[HYHY] = ebmj[XHY]*ebmj[XHY]+ebmj[YHY]*ebmj[YHY]+ebmj[ZHY]*ebmj[ZHY];
1079 *mtDetSqrt=sqrt(mt[HXHX]*mt[HYHY]- mt[HXHY]*mt[HYHX]);
1082 n[X] = (jacInv[
XX]*bn[X]+jacInv[
YX]*bn[
Y]+jacInv[
ZX]*bn[Z]);
1083 n[
Y] = (jacInv[
XY]*bn[X]+jacInv[
YY]*bn[
Y]+jacInv[
ZY]*bn[Z]);
1084 n[Z] = (jacInv[
XZ]*bn[X]+jacInv[
YZ]*bn[
Y]+jacInv[
ZZ]*bn[Z]);
1086 oneOverNbn = 1.0/sqrt(
n[X]*
n[X]+
n[
Y]*
n[
Y]+
n[Z]*
n[Z]);
1096 int nElementBoundaries_element,
1097 int nQuadraturePoints_element,
1100 double* boundaryNormals,
1101 double* boundaryJacobians,
1104 double* jacobianInverseArray,
1105 double* metricTensorArray,
1106 double* metricTensorDeterminantSqrtArray,
1107 double* unitNormalArray)
1109 int eN,ebN,k,j,j_global;
1113 double *jacInv=NULL,*mt,*mtDetSqrt,*
n,*grad=NULL,*node=NULL,*bn,*bj;
1114 register double oneOverJacDet=0.0,oneOverNbn=0.0;
1115 double emj[4],ebmj[2];
1116 for(eN=0;eN<nElements_global;eN++)
1117 for(ebN=0;ebN<nElementBoundaries_element;ebN++)
1118 for(k=0;k<nQuadraturePoints_element;k++)
1126 jacInv = jacobianInverseArray +
1127 eN*nElementBoundaries_element*nQuadraturePoints_element*4+
1128 ebN*nQuadraturePoints_element*4+
1130 mt = metricTensorArray +
1131 eN*nElementBoundaries_element*nQuadraturePoints_element+
1132 ebN*nQuadraturePoints_element+
1134 mtDetSqrt = metricTensorDeterminantSqrtArray +
1135 eN*nElementBoundaries_element*nQuadraturePoints_element+
1136 ebN*nQuadraturePoints_element+
1138 n = unitNormalArray+
1139 eN*nElementBoundaries_element*nQuadraturePoints_element*2+
1140 ebN*nQuadraturePoints_element*2+
1142 bn = boundaryNormals + ebN*2;
1143 bj = boundaryJacobians + ebN*2;
1144 for(j=0;j<nDOF_element;j++)
1146 j_global = l2g[eN*nDOF_element+
1148 grad = grad_psi + ebN*nQuadraturePoints_element*nDOF_element*2+k*nDOF_element*2 + j*2;
1150 node = nodeArray + j_global*3;
1151 emj[
XX] += node[X]*grad[X];
1152 emj[
XY] += node[X]*grad[
Y];
1153 emj[
YX] += node[
Y]*grad[X];
1154 emj[
YY] += node[
Y]*grad[
Y];
1156 oneOverJacDet = 1.0/(emj[
XX]*emj[
YY]- emj[
XY]*emj[
YX]);
1157 jacInv[
XX] = oneOverJacDet*emj[
YY];
1158 jacInv[
YX] = -oneOverJacDet*emj[
YX];
1159 jacInv[
XY] = -oneOverJacDet*emj[
XY];
1160 jacInv[
YY] = oneOverJacDet*emj[
XX];
1161 ebmj[X] = emj[
XX]*bj[
XX]+emj[
XY]*bj[
Y];
1162 ebmj[
Y] = emj[
YX]*bj[X]+emj[
YY]*bj[
Y];
1163 mt[X] = ebmj[X]*ebmj[X]+ebmj[
Y]*ebmj[
Y];
1164 *mtDetSqrt=sqrt(mt[
XX]);
1165 n[X] = jacInv[
XX]*bn[X]+jacInv[
YX]*bn[
Y];
1166 n[
Y] = jacInv[
XY]*bn[X]+jacInv[
YY]*bn[
Y];
1167 oneOverNbn= 1.0/sqrt(
n[X]*
n[X]+
n[
Y]*
n[
Y]);
1174 int nElementBoundaries_element,
1175 int nQuadraturePoints_element,
1179 double* boundaryNormals,
1180 double* boundaryJacobians,
1183 double* jacobianInverseArray,
1184 double* metricTensorArray,
1185 double* metricTensorDeterminantSqrtArray,
1186 double* unitNormalArray)
1188 int eN,ebN,k,j,j_global;
1192 double *jacInv=NULL,*mt,*mtDetSqrt,*
n,*grad=NULL,*node=NULL,*bn,*bj,*
xt;
1193 register double oneOverJacDet=0.0,oneOverNbn=0.0,xt_dot_xt,xt_dot_n,xt_dot_bj;
1194 double emj[4],ebmj[2];
1195 for(eN=0;eN<nElements_global;eN++)
1196 for(ebN=0;ebN<nElementBoundaries_element;ebN++)
1197 for(k=0;k<nQuadraturePoints_element;k++)
1205 jacInv = jacobianInverseArray +
1206 eN*nElementBoundaries_element*nQuadraturePoints_element*4+
1207 ebN*nQuadraturePoints_element*4+
1209 mt = metricTensorArray +
1210 eN*nElementBoundaries_element*nQuadraturePoints_element+
1211 ebN*nQuadraturePoints_element+
1213 mtDetSqrt = metricTensorDeterminantSqrtArray +
1214 eN*nElementBoundaries_element*nQuadraturePoints_element+
1215 ebN*nQuadraturePoints_element+
1217 n = unitNormalArray+
1218 eN*nElementBoundaries_element*nQuadraturePoints_element*2+
1219 ebN*nQuadraturePoints_element*2+
1221 xt = xtArray + eN*nElementBoundaries_element*nQuadraturePoints_element*3+
1222 ebN*nQuadraturePoints_element*3+
1224 bn = boundaryNormals + ebN*2;
1225 bj = boundaryJacobians + ebN*2;
1226 for(j=0;j<nDOF_element;j++)
1228 j_global = l2g[eN*nDOF_element+
1230 grad = grad_psi + ebN*nQuadraturePoints_element*nDOF_element*2+k*nDOF_element*2 + j*2;
1232 node = nodeArray + j_global*3;
1233 emj[
XX] += node[X]*grad[X];
1234 emj[
XY] += node[X]*grad[
Y];
1235 emj[
YX] += node[
Y]*grad[X];
1236 emj[
YY] += node[
Y]*grad[
Y];
1238 oneOverJacDet = 1.0/(emj[
XX]*emj[
YY]- emj[
XY]*emj[
YX]);
1239 jacInv[
XX] = oneOverJacDet*emj[
YY];
1240 jacInv[
YX] = -oneOverJacDet*emj[
YX];
1241 jacInv[
XY] = -oneOverJacDet*emj[
XY];
1242 jacInv[
YY] = oneOverJacDet*emj[
XX];
1243 ebmj[X] = emj[
XX]*bj[X]+emj[
XY]*bj[
Y];
1244 ebmj[
Y] = emj[
YX]*bj[X]+emj[
YY]*bj[
Y];
1245 mt[X] = ebmj[X]*ebmj[X]+ebmj[
Y]*ebmj[
Y];
1246 n[X] = jacInv[
XX]*bn[X]+jacInv[
YX]*bn[
Y];
1247 n[
Y] = jacInv[
XY]*bn[X]+jacInv[
YY]*bn[
Y];
1248 oneOverNbn= 1.0/sqrt(
n[X]*
n[X]+
n[
Y]*
n[
Y]);
1252 xt_dot_bj =
xt[X]*ebmj[X]+
xt[
Y]*ebmj[
Y];
1256 *mtDetSqrt=sqrt(((1.0+xt_dot_xt)*mt[X] - xt_dot_bj*xt_dot_bj)/(1.0+xt_dot_n*xt_dot_n));
1261 int nElementBoundaries_element,
1262 int nQuadraturePoints_element,
1265 double* boundaryNormals,
1266 double* boundaryJacobians,
1269 double* jacobianInverseArray,
1270 double* metricTensorArray,
1271 double* metricTensorDeterminantSqrtArray,
1272 double* unitNormalArray)
1274 int eN,ebN,k,j,j_global;
1277 double *jacInv=NULL,*mt,*mtDetSqrt,*
n,*grad=NULL,*node=NULL;
1278 register double emj=0.0,ebmj=0.0;
1279 for(eN=0;eN<nElements_global;eN++)
1280 for(ebN=0;ebN<nElementBoundaries_element;ebN++)
1281 for(k=0;k<nQuadraturePoints_element;k++)
1285 jacInv = jacobianInverseArray +
1286 eN*nElementBoundaries_element*nQuadraturePoints_element+
1287 ebN*nQuadraturePoints_element+
1289 mt = metricTensorArray +
1290 eN*nElementBoundaries_element*nQuadraturePoints_element+
1291 ebN*nQuadraturePoints_element+
1293 mtDetSqrt = metricTensorDeterminantSqrtArray +
1294 eN*nElementBoundaries_element*nQuadraturePoints_element+
1295 ebN*nQuadraturePoints_element+
1297 n = unitNormalArray+
1298 eN*nElementBoundaries_element*nQuadraturePoints_element+
1299 ebN*nQuadraturePoints_element+
1301 for(j=0;j<nDOF_element;j++)
1303 j_global = l2g[eN*nDOF_element+
1305 grad = grad_psi + ebN*nQuadraturePoints_element*nDOF_element+k*nDOF_element + j;
1307 node = nodeArray + j_global*3;
1308 emj += node[X]*grad[X];
1310 jacInv[
XX] = 1.0/(emj);
1313 n[X] = boundaryNormals[ebN];
1319 int nExteriorElementBoundaries_global,
1320 const int * exteriorElementBoundariesArray,
1321 const int * elementBoundaryElementsArray,
1322 const int * elementBoundaryLocalElementBoundariesArray,
1324 double* boundaryNormals,
1325 double* boundaryJacobians,
1328 double* jacobianInverseArray,
1329 double* metricTensorArray,
1330 double* metricTensorDeterminantSqrtArray,
1331 double* unitNormalArray)
1333 int eN,ebN,ebNE,ebN_local,k,j,j_global;
1336 double *jacInv=NULL,*mt,*mtDetSqrt,*
n,*grad=NULL,*node=NULL;
1337 register double emj=0.0,ebmj=0.0;
1338 for(ebNE = 0; ebNE < nExteriorElementBoundaries_global; ebNE++)
1340 ebN = exteriorElementBoundariesArray[ebNE];
1341 eN = elementBoundaryElementsArray[ebN*2+0];
1342 ebN_local = elementBoundaryLocalElementBoundariesArray[ebN*2+0];
1343 for(k=0;k<nQuadraturePoints_element;k++)
1347 jacInv = jacobianInverseArray +
1348 ebNE*nQuadraturePoints_element+
1350 mt = metricTensorArray +
1351 ebNE*nQuadraturePoints_element+
1353 mtDetSqrt = metricTensorDeterminantSqrtArray +
1354 ebNE*nQuadraturePoints_element+
1356 n = unitNormalArray+
1357 ebNE*nQuadraturePoints_element+
1359 for(j=0;j<nDOF_element;j++)
1361 j_global = l2g[eN*nDOF_element+
1363 grad = grad_psi + ebN_local*nQuadraturePoints_element*nDOF_element+k*nDOF_element + j;
1365 node = nodeArray + j_global*3;
1366 emj += node[X]*grad[X];
1368 jacInv[
XX] = 1.0/(emj);
1371 n[X] = boundaryNormals[ebN_local];
1377 int nExteriorElementBoundaries_global,
1378 const int * exteriorElementBoundariesArray,
1379 const int * elementBoundaryElementsArray,
1380 const int * elementBoundaryLocalElementBoundariesArray,
1382 double* boundaryNormals,
1383 double* boundaryJacobians,
1386 double* jacobianInverseArray,
1387 double* metricTensorArray,
1388 double* metricTensorDeterminantSqrtArray,
1389 double* unitNormalArray)
1391 int eN,ebN,ebNE,ebN_local,k,j,j_global;
1395 double *jacInv=NULL,*mt,*mtDetSqrt,*
n,*grad=NULL,*node=NULL,*bn,*bj;
1396 register double oneOverJacDet=0.0,oneOverNbn=0.0;
1397 double emj[4],ebmj[2];
1398 for(ebNE = 0; ebNE < nExteriorElementBoundaries_global; ebNE++)
1400 ebN = exteriorElementBoundariesArray[ebNE];
1401 eN = elementBoundaryElementsArray[ebN*2+0];
1402 ebN_local = elementBoundaryLocalElementBoundariesArray[ebN*2+0];
1403 for(k=0;k<nQuadraturePoints_element;k++)
1411 jacInv = jacobianInverseArray +
1412 ebNE*nQuadraturePoints_element*4+
1414 mt = metricTensorArray +
1415 ebNE*nQuadraturePoints_element+
1417 mtDetSqrt = metricTensorDeterminantSqrtArray +
1418 ebNE*nQuadraturePoints_element+
1420 n = unitNormalArray+
1421 ebNE*nQuadraturePoints_element*2+
1423 bn = boundaryNormals + ebN_local*2;
1424 bj = boundaryJacobians + ebN_local*2;
1425 for(j=0;j<nDOF_element;j++)
1427 j_global = l2g[eN*nDOF_element+
1429 grad = grad_psi + ebN_local*nQuadraturePoints_element*nDOF_element*2+k*nDOF_element*2 + j*2;
1431 node = nodeArray + j_global*3;
1432 emj[
XX] += node[X]*grad[X];
1433 emj[
XY] += node[X]*grad[
Y];
1434 emj[
YX] += node[
Y]*grad[X];
1435 emj[
YY] += node[
Y]*grad[
Y];
1437 oneOverJacDet = 1.0/(emj[
XX]*emj[
YY]- emj[
XY]*emj[
YX]);
1438 jacInv[
XX] = oneOverJacDet*emj[
YY];
1439 jacInv[
YX] = -oneOverJacDet*emj[
YX];
1440 jacInv[
XY] = -oneOverJacDet*emj[
XY];
1441 jacInv[
YY] = oneOverJacDet*emj[
XX];
1442 ebmj[X] = emj[
XX]*bj[
XX]+emj[
XY]*bj[
Y];
1443 ebmj[
Y] = emj[
YX]*bj[X]+emj[
YY]*bj[
Y];
1444 mt[X] = ebmj[X]*ebmj[X]+ebmj[
Y]*ebmj[
Y];
1445 *mtDetSqrt=sqrt(mt[
XX]);
1446 n[X] = jacInv[
XX]*bn[X]+jacInv[
YX]*bn[
Y];
1447 n[
Y] = jacInv[
XY]*bn[X]+jacInv[
YY]*bn[
Y];
1448 oneOverNbn= 1.0/sqrt(
n[X]*
n[X]+
n[
Y]*
n[
Y]);
1457 int nExteriorElementBoundaries_global,
1458 const int * exteriorElementBoundariesArray,
1459 const int * elementBoundaryElementsArray,
1460 const int * elementBoundaryLocalElementBoundariesArray,
1463 double* boundaryNormals,
1464 double* boundaryJacobians,
1467 double* jacobianInverseArray,
1468 double* metricTensorArray,
1469 double* metricTensorDeterminantSqrtArray,
1470 double* unitNormalArray)
1472 int eN,ebN,ebNE,ebN_local,k,j,j_global;
1476 double *jacInv=NULL,*mt,*mtDetSqrt,*
n,*grad=NULL,*node=NULL,*bn,*bj,*
xt;
1477 register double oneOverJacDet=0.0,oneOverNbn=0.0,xt_dot_xt,xt_dot_n,xt_dot_bj;
1478 double emj[4],ebmj[2];
1479 for(ebNE = 0; ebNE < nExteriorElementBoundaries_global; ebNE++)
1481 ebN = exteriorElementBoundariesArray[ebNE];
1482 eN = elementBoundaryElementsArray[ebN*2+0];
1483 ebN_local = elementBoundaryLocalElementBoundariesArray[ebN*2+0];
1484 for(k=0;k<nQuadraturePoints_element;k++)
1492 jacInv = jacobianInverseArray +
1493 ebNE*nQuadraturePoints_element*4+
1495 mt = metricTensorArray +
1496 ebNE*nQuadraturePoints_element+
1498 mtDetSqrt = metricTensorDeterminantSqrtArray +
1499 ebNE*nQuadraturePoints_element+
1501 n = unitNormalArray+
1502 ebNE*nQuadraturePoints_element*2+
1505 ebNE*nQuadraturePoints_element*3+
1507 bn = boundaryNormals + ebN_local*2;
1508 bj = boundaryJacobians + ebN_local*2;
1509 for(j=0;j<nDOF_element;j++)
1511 j_global = l2g[eN*nDOF_element+
1513 grad = grad_psi + ebN_local*nQuadraturePoints_element*nDOF_element*2+k*nDOF_element*2 + j*2;
1515 node = nodeArray + j_global*3;
1516 emj[
XX] += node[X]*grad[X];
1517 emj[
XY] += node[X]*grad[
Y];
1518 emj[
YX] += node[
Y]*grad[X];
1519 emj[
YY] += node[
Y]*grad[
Y];
1521 oneOverJacDet = 1.0/(emj[
XX]*emj[
YY]- emj[
XY]*emj[
YX]);
1522 jacInv[
XX] = oneOverJacDet*emj[
YY];
1523 jacInv[
YX] = -oneOverJacDet*emj[
YX];
1524 jacInv[
XY] = -oneOverJacDet*emj[
XY];
1525 jacInv[
YY] = oneOverJacDet*emj[
XX];
1526 ebmj[X] = emj[
XX]*bj[
XX]+emj[
XY]*bj[
Y];
1527 ebmj[
Y] = emj[
YX]*bj[X]+emj[
YY]*bj[
Y];
1528 mt[X] = ebmj[X]*ebmj[X]+ebmj[
Y]*ebmj[
Y];
1529 n[X] = jacInv[
XX]*bn[X]+jacInv[
YX]*bn[
Y];
1530 n[
Y] = jacInv[
XY]*bn[X]+jacInv[
YY]*bn[
Y];
1531 oneOverNbn= 1.0/sqrt(
n[X]*
n[X]+
n[
Y]*
n[
Y]);
1535 xt_dot_bj =
xt[X]*ebmj[X]+
xt[
Y]*ebmj[
Y];
1538 *mtDetSqrt=sqrt(((1.0+xt_dot_xt)*mt[X] - xt_dot_bj*xt_dot_bj)/(1.0+xt_dot_n*xt_dot_n));
1544 int nExteriorElementBoundaries_global,
1545 const int * exteriorElementBoundariesArray,
1546 const int * elementBoundaryElementsArray,
1547 const int * elementBoundaryLocalElementBoundariesArray,
1549 double* boundaryNormals,
1550 double* boundaryJacobians,
1553 double* jacobianInverseArray,
1554 double* metricTensorArray,
1555 double* metricTensorDeterminantSqrtArray,
1556 double* unitNormalArray)
1558 int eN,ebN,ebNE,ebN_local,k,j,j_global;
1569 double *jacInv=NULL,*mt=NULL,*mtDetSqrt=NULL,*
n=NULL,*grad=NULL,*node=NULL,*bn,*bj;
1570 register double oneOverJacDet=0.0,oneOverNbn=0.0;
1571 double emj[9],ebmj[6];
1572 for(ebNE = 0; ebNE < nExteriorElementBoundaries_global; ebNE++)
1574 ebN = exteriorElementBoundariesArray[ebNE];
1575 eN = elementBoundaryElementsArray[ebN*2+0];
1576 ebN_local = elementBoundaryLocalElementBoundariesArray[ebN*2+0];
1577 for(k=0;k<nQuadraturePoints_element;k++)
1594 jacInv = jacobianInverseArray +
1595 ebNE*nQuadraturePoints_element*9+
1597 mt = metricTensorArray +
1598 ebNE*nQuadraturePoints_element*4+
1600 mtDetSqrt = metricTensorDeterminantSqrtArray +
1601 ebNE*nQuadraturePoints_element+
1603 n = unitNormalArray+
1604 ebNE*nQuadraturePoints_element*3+
1606 bn = boundaryNormals + ebN_local*3;
1607 bj = boundaryJacobians + ebN_local*6;
1608 for(j=0;j<nDOF_element;j++)
1610 j_global = l2g[eN*nDOF_element+
1612 grad = grad_psi + ebN_local*nQuadraturePoints_element*nDOF_element*3+k*nDOF_element*3 + j*3;
1614 node = nodeArray + j_global*3;
1615 emj[
XX] += node[X]*grad[X];
1616 emj[
XY] += node[X]*grad[
Y];
1617 emj[
XZ] += node[X]*grad[Z];
1618 emj[
YX] += node[
Y]*grad[X];
1619 emj[
YY] += node[
Y]*grad[
Y];
1620 emj[
YZ] += node[
Y]*grad[Z];
1621 emj[
ZX] += node[Z]*grad[X];
1622 emj[
ZY] += node[Z]*grad[
Y];
1623 emj[
ZZ] += node[Z]*grad[Z];
1625 oneOverJacDet = 1.0/(emj[
XX]*(emj[
YY]*emj[
ZZ] - emj[
YZ]*emj[
ZY]) -
1626 emj[
XY]*(emj[
YX]*emj[
ZZ] - emj[
YZ]*emj[
ZX]) +
1627 emj[
XZ]*(emj[
YX]*emj[
ZY] - emj[
YY]*emj[
ZX]));
1628 jacInv[
XX] = oneOverJacDet*(emj[
YY]*emj[
ZZ] - emj[
YZ]*emj[
ZY]);
1629 jacInv[
YX] = oneOverJacDet*(emj[
YZ]*emj[
ZX] - emj[
YX]*emj[
ZZ]);
1630 jacInv[
ZX] = oneOverJacDet*(emj[
YX]*emj[
ZY] - emj[
YY]*emj[
ZX]);
1631 jacInv[
XY] = oneOverJacDet*(emj[
ZY]*emj[
XZ] - emj[
ZZ]*emj[
XY]);
1632 jacInv[
YY] = oneOverJacDet*(emj[
ZZ]*emj[
XX] - emj[
ZX]*emj[
XZ]);
1633 jacInv[
ZY] = oneOverJacDet*(emj[
ZX]*emj[
XY] - emj[
ZY]*emj[
XX]);
1634 jacInv[
XZ] = oneOverJacDet*(emj[
XY]*emj[
YZ] - emj[
XZ]*emj[
YY]);
1635 jacInv[
YZ] = oneOverJacDet*(emj[
XZ]*emj[
YX] - emj[
XX]*emj[
YZ]);
1636 jacInv[
ZZ] = oneOverJacDet*(emj[
XX]*emj[
YY] - emj[
XY]*emj[
YX]);
1638 ebmj[XHX] = emj[
XX]*bj[XHX]+emj[
XY]*bj[YHX]+emj[
XZ]*bj[ZHX];
1639 ebmj[XHY] = emj[
XX]*bj[XHY]+emj[
XY]*bj[YHY]+emj[
XZ]*bj[ZHY];
1640 ebmj[YHX] = emj[
YX]*bj[XHX]+emj[
YY]*bj[YHX]+emj[
YZ]*bj[ZHX];
1641 ebmj[YHY] = emj[
YX]*bj[XHY]+emj[
YY]*bj[YHY]+emj[
YZ]*bj[ZHY];
1642 ebmj[ZHX] = emj[
ZX]*bj[XHX]+emj[
ZY]*bj[YHX]+emj[
ZZ]*bj[ZHX];
1643 ebmj[ZHY] = emj[
ZX]*bj[XHY]+emj[
ZY]*bj[YHY]+emj[
ZZ]*bj[ZHY];
1645 mt[HXHX] = ebmj[XHX]*ebmj[XHX]+ebmj[YHX]*ebmj[YHX]+ebmj[ZHX]*ebmj[ZHX];
1646 mt[HXHY] = ebmj[XHX]*ebmj[XHY]+ebmj[YHX]*ebmj[YHY]+ebmj[ZHX]*ebmj[ZHY];
1647 mt[HYHX] = ebmj[XHY]*ebmj[XHX]+ebmj[YHY]*ebmj[YHX]+ebmj[ZHY]*ebmj[ZHX];
1648 mt[HYHY] = ebmj[XHY]*ebmj[XHY]+ebmj[YHY]*ebmj[YHY]+ebmj[ZHY]*ebmj[ZHY];
1650 *mtDetSqrt=sqrt(mt[HXHX]*mt[HYHY]- mt[HXHY]*mt[HYHX]);
1653 n[X] = (jacInv[
XX]*bn[X]+jacInv[
YX]*bn[
Y]+jacInv[
ZX]*bn[Z]);
1654 n[
Y] = (jacInv[
XY]*bn[X]+jacInv[
YY]*bn[
Y]+jacInv[
ZY]*bn[Z]);
1655 n[Z] = (jacInv[
XZ]*bn[X]+jacInv[
YZ]*bn[
Y]+jacInv[
ZZ]*bn[Z]);
1657 oneOverNbn = 1.0/sqrt(
n[X]*
n[X]+
n[
Y]*
n[
Y]+
n[Z]*
n[Z]);
1699 int nQuadraturePoints_element,
1700 int nDOF_test_element,
1703 double* weak_residual)
1706 for(eN=0;eN<nElements_global;eN++)
1707 for (i=0;i<nDOF_test_element;i++)
1708 for (k=0;k<nQuadraturePoints_element;k++)
1709 weak_residual[eN*nDOF_test_element +
1712 mt[eN*nQuadraturePoints_element +
1715 w_dV[eN*nQuadraturePoints_element*nDOF_test_element +
1716 k*nDOF_test_element +
1760 int nQuadraturePoints_element,
1761 int nDOF_trial_element,
1762 int nDOF_test_element,
1765 double* jacobian_weak_residual)
1767 int eN,i,j,k,nDOF_test_X_trial_element=nDOF_trial_element*nDOF_test_element;
1768 for(eN=0;eN<nElements_global;eN++)
1769 for (i=0;i<nDOF_test_element;i++)
1770 for (k=0;k<nQuadraturePoints_element;k++)
1771 for (j=0;j<nDOF_trial_element;j++)
1772 jacobian_weak_residual[eN*nDOF_test_X_trial_element +
1773 i*nDOF_trial_element+
1776 dmt[eN*nQuadraturePoints_element +
1779 v_X_w_dV[eN*nQuadraturePoints_element*nDOF_test_X_trial_element +
1780 k*nDOF_test_X_trial_element +
1781 j*nDOF_test_element+
1786 int nQuadraturePoints_element,
1787 int nDOF_trial_element,
1788 int nDOF_test_element,
1792 double* jacobian_weak_residual)
1794 int eN,i,j,k,nDOF_test_X_trial_element=nDOF_trial_element*nDOF_test_element;
1795 for(eN=0;eN<nElements_global;eN++)
1796 for (i=0;i<nDOF_test_element;i++)
1797 for (k=0;k<nQuadraturePoints_element;k++)
1798 for (j=0;j<nDOF_trial_element;j++)
1799 jacobian_weak_residual[eN*nDOF_test_X_trial_element +
1800 i*nDOF_trial_element+
1803 dmt[eN*nQuadraturePoints_element +
1806 v[eN*nQuadraturePoints_element*nDOF_trial_element +
1807 k*nDOF_trial_element +
1810 w_dV[eN*nQuadraturePoints_element*nDOF_test_element +
1811 k*nDOF_test_element +
1835 int nQuadraturePoints_element,
1837 double* strong_residual)
1840 for(eN=0;eN<nElements_global;eN++)
1841 for (k=0;k<nQuadraturePoints_element;k++)
1842 strong_residual[eN*nQuadraturePoints_element+
1845 mt[eN*nQuadraturePoints_element+
1874 int nQuadraturePoints_element,
1875 int nDOF_trial_element,
1878 double* dstrong_residual)
1881 for(eN=0;eN<nElements_global;eN++)
1882 for(j=0;j<nDOF_trial_element;j++)
1883 for (k=0;k<nQuadraturePoints_element;k++)
1884 dstrong_residual[eN*nQuadraturePoints_element*nDOF_trial_element+
1885 k*nDOF_trial_element +
1888 dmt[eN*nQuadraturePoints_element+
1891 v[eN*nQuadraturePoints_element*nDOF_trial_element+
1892 k*nDOF_trial_element +
1922 int nQuadraturePoints_element,
1923 int nDOF_test_element,
1929 for(eN=0;eN<nElements_global;eN++)
1930 for (i=0;i<nDOF_test_element;i++)
1931 for (k=0;k<nQuadraturePoints_element;k++)
1932 Lstar_w_dV[eN*nQuadraturePoints_element*nDOF_test_element +
1933 k*nDOF_test_element +
1936 dmt[eN*nQuadraturePoints_element +
1939 w_dV[eN*nQuadraturePoints_element*nDOF_test_element +
1940 k*nDOF_test_element +
1986 int nQuadraturePoints_element,
1987 int nDOF_test_element,
1991 double* weak_residual)
1994 for(eN=0;eN<nElements_global;eN++)
1995 for (i=0;i<nDOF_test_element;i++)
1996 for (k=0;k<nQuadraturePoints_element;k++)
1997 for (I=0;I<nSpace;I++)
1998 weak_residual[eN*nDOF_test_element +
2001 f[eN*nQuadraturePoints_element*nSpace +
2005 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
2006 k*nDOF_test_element*nSpace +
2056 int nQuadraturePoints_element,
2057 int nDOF_trial_element,
2058 int nDOF_test_element,
2061 double* v_X_grad_w_dV,
2062 double* jacobian_weak_residual)
2064 int eN,i,j,k,I,nDOF_test_X_trial_element=nDOF_trial_element*nDOF_test_element;
2065 for(eN=0;eN<nElements_global;eN++)
2066 for (i=0;i<nDOF_test_element;i++)
2067 for (k=0;k<nQuadraturePoints_element;k++)
2068 for (j=0;j<nDOF_trial_element;j++)
2069 for (I=0;I<nSpace;I++)
2070 jacobian_weak_residual[eN*nDOF_test_X_trial_element +
2071 i*nDOF_trial_element+
2074 df[eN*nQuadraturePoints_element*nSpace +
2078 v_X_grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_X_trial_element*nSpace +
2079 k*nDOF_test_X_trial_element*nSpace +
2080 j*nDOF_test_element*nSpace +
2086 int nQuadraturePoints_element,
2087 int nDOF_trial_element,
2088 int nDOF_test_element,
2093 double* jacobian_weak_residual)
2095 int eN,i,j,k,I,nDOF_test_X_trial_element=nDOF_trial_element*nDOF_test_element;
2096 for(eN=0;eN<nElements_global;eN++)
2097 for (i=0;i<nDOF_test_element;i++)
2098 for (k=0;k<nQuadraturePoints_element;k++)
2099 for (j=0;j<nDOF_trial_element;j++)
2100 for (I=0;I<nSpace;I++)
2101 jacobian_weak_residual[eN*nDOF_test_X_trial_element +
2102 i*nDOF_trial_element+
2105 df[eN*nQuadraturePoints_element*nSpace +
2109 v[eN*nQuadraturePoints_element*nDOF_trial_element +
2110 k*nDOF_trial_element +
2113 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
2114 k*nDOF_test_element*nSpace +
2144 int nQuadraturePoints_element,
2148 double* strong_residual)
2151 for(eN=0;eN<nElements_global;eN++)
2152 for (k=0;k<nQuadraturePoints_element;k++)
2153 for(I=0;I<nSpace;I++)
2154 strong_residual[eN*nQuadraturePoints_element+
2157 df[eN*nQuadraturePoints_element*nSpace +
2161 grad_u[eN*nQuadraturePoints_element*nSpace +
2191 int nQuadraturePoints_element,
2192 int nDOF_trial_element,
2196 double* dstrong_residual)
2199 for(eN=0;eN<nElements_global;eN++)
2200 for(j=0;j<nDOF_trial_element;j++)
2201 for (k=0;k<nQuadraturePoints_element;k++)
2202 for (I=0;I<nSpace;I++)
2203 dstrong_residual[eN*nQuadraturePoints_element*nDOF_trial_element+
2204 k*nDOF_trial_element +
2207 df[eN*nQuadraturePoints_element*nSpace +
2211 grad_v[eN*nQuadraturePoints_element*nSpace*nDOF_trial_element +
2212 k*nSpace*nDOF_trial_element +
2248 int nQuadraturePoints_element,
2249 int nDOF_test_element,
2256 for(eN=0;eN<nElements_global;eN++)
2257 for (i=0;i<nDOF_test_element;i++)
2258 for (k=0;k<nQuadraturePoints_element;k++)
2259 for (I=0;I<nSpace;I++)
2260 Lstar_w_dV[eN*nQuadraturePoints_element*nDOF_test_element +
2261 k*nDOF_test_element +
2264 df[eN*nQuadraturePoints_element*nSpace +
2268 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
2269 k*nDOF_test_element*nSpace +
2307 int nQuadraturePoints_element,
2308 int nDOF_test_element,
2311 double* weak_residual)
2314 for(eN=0;eN<nElements_global;eN++)
2315 for (i=0;i<nDOF_test_element;i++)
2316 for (k=0;k<nQuadraturePoints_element;k++)
2317 weak_residual[eN*nDOF_test_element + i]
2319 H[eN*nQuadraturePoints_element +
2322 w_dV[eN*nQuadraturePoints_element*nDOF_test_element +
2323 k*nDOF_test_element +
2373 int nQuadraturePoints_element,
2374 int nDOF_trial_element,
2375 int nDOF_test_element,
2378 double* grad_v_X_w_dV,
2379 double* jacobian_weak_residual)
2381 int eN,i,j,k,I,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element;
2382 for(eN=0;eN<nElements_global;eN++)
2383 for (i=0;i<nDOF_test_element;i++)
2384 for (k=0;k<nQuadraturePoints_element;k++)
2385 for (j=0;j<nDOF_trial_element;j++)
2386 for (I=0;I<nSpace;I++)
2387 jacobian_weak_residual[eN*nDOF_test_X_trial_element +
2388 i*nDOF_trial_element +
2391 dH[eN*nQuadraturePoints_element*nSpace +
2395 grad_v_X_w_dV[eN*nQuadraturePoints_element*nDOF_test_X_trial_element*nSpace +
2396 k*nDOF_test_X_trial_element*nSpace +
2397 j*nDOF_test_element*nSpace +
2403 int nQuadraturePoints_element,
2404 int nDOF_trial_element,
2405 int nDOF_test_element,
2410 double* jacobian_weak_residual)
2412 int eN,i,j,k,I,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element;
2413 for(eN=0;eN<nElements_global;eN++)
2414 for (i=0;i<nDOF_test_element;i++)
2415 for (k=0;k<nQuadraturePoints_element;k++)
2416 for (j=0;j<nDOF_trial_element;j++)
2417 for (I=0;I<nSpace;I++)
2418 jacobian_weak_residual[eN*nDOF_test_X_trial_element +
2419 i*nDOF_trial_element +
2422 dH[eN*nQuadraturePoints_element*nSpace +
2426 grad_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace +
2427 k*nDOF_trial_element*nSpace +
2431 w_dV[eN*nQuadraturePoints_element*nDOF_test_element +
2432 k*nDOF_test_element +
2463 int nQuadraturePoints_element,
2467 double* strong_residual)
2470 for(eN=0;eN<nElements_global;eN++)
2471 for (k=0;k<nQuadraturePoints_element;k++)
2472 for (I=0;I<nSpace;I++)
2473 strong_residual[eN*nQuadraturePoints_element+k]
2475 dH[eN*nQuadraturePoints_element*nSpace+
2479 grad_u[eN*nQuadraturePoints_element*nSpace+
2509 int nQuadraturePoints_element,
2510 int nDOF_trial_element,
2514 double* dstrong_residual)
2517 for(eN=0;eN<nElements_global;eN++)
2518 for(j=0;j<nDOF_trial_element;j++)
2519 for (k=0;k<nQuadraturePoints_element;k++)
2520 for (I=0;I<nSpace;I++)
2521 dstrong_residual[eN*nQuadraturePoints_element*nDOF_trial_element+
2522 k*nDOF_trial_element +
2525 dH[eN*nQuadraturePoints_element*nSpace+
2529 grad_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace+
2530 k*nDOF_trial_element*nSpace +
2567 int nQuadraturePoints_element,
2568 int nDOF_test_element,
2575 for(eN=0;eN<nElements_global;eN++)
2576 for (i=0;i<nDOF_test_element;i++)
2577 for (k=0;k<nQuadraturePoints_element;k++)
2578 for (I=0;I<nSpace;I++)
2579 Lstar_w_dV[eN*nQuadraturePoints_element*nDOF_test_element +
2580 k*nDOF_test_element +
2583 dH[eN*nQuadraturePoints_element*nSpace +
2587 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
2588 k*nDOF_test_element*nSpace +
2635 int nQuadraturePoints_element,
2636 int nDOF_test_element,
2639 double* grad_phi_X_grad_w_dV,
2640 double* weak_residual)
2642 int eN,i,k,I,J,nSpace2=nSpace*nSpace;
2643 for(eN=0;eN<nElements_global;eN++)
2644 for (i=0;i<nDOF_test_element;i++)
2645 for (k=0;k<nQuadraturePoints_element;k++)
2646 for (I=0;I<nSpace;I++)
2647 for (J=0;J<nSpace;J++)
2648 weak_residual[eN*nDOF_test_element + i]
2650 a[eN*nQuadraturePoints_element*nSpace2 +
2655 grad_phi_X_grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace2 +
2656 k*nDOF_test_element*nSpace2 +
2663 int nQuadraturePoints_element,
2664 int nDOF_test_element,
2669 double* weak_residual)
2671 int eN,i,k,I,J,nSpace2=nSpace*nSpace;
2672 for(eN=0;eN<nElements_global;eN++)
2673 for (i=0;i<nDOF_test_element;i++)
2674 for (k=0;k<nQuadraturePoints_element;k++)
2675 #ifdef SCALAR_DIFFUSION
2676 for (I=0;I<nSpace;I++)
2679 weak_residual[eN*nDOF_test_element + i]
2681 a[eN*nQuadraturePoints_element*nSpace2 +
2684 grad_phi[eN*nQuadraturePoints_element*nSpace +
2688 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
2689 k*nDOF_test_element*nSpace +
2694 for (I=0;I<nSpace;I++)
2695 for (J=0;J<nSpace;J++)
2696 weak_residual[eN*nDOF_test_element + i]
2698 a[eN*nQuadraturePoints_element*nSpace2 +
2703 grad_phi[eN*nQuadraturePoints_element*nSpace +
2707 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
2708 k*nDOF_test_element*nSpace +
2715 int nQuadraturePoints_element,
2716 int nDOF_test_element,
2723 double* weak_residual)
2725 int eN,i,k,I,m,
nnz=rowptr[nSpace];
2726 for(eN=0;eN<nElements_global;eN++)
2727 for (i=0;i<nDOF_test_element;i++)
2728 for (k=0;k<nQuadraturePoints_element;k++)
2729 for (I=0;I<nSpace;I++)
2730 for (m=rowptr[I];m<rowptr[I+1];m++)
2731 weak_residual[eN*nDOF_test_element + i]
2733 a[eN*nQuadraturePoints_element*
nnz+
2737 grad_phi[eN*nQuadraturePoints_element*nSpace +
2741 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
2742 k*nDOF_test_element*nSpace +
2820 int nQuadraturePoints_element,
2821 int nDOF_trial_element,
2822 int nDOF_test_element,
2827 double* grad_phi_X_grad_w_dV,
2830 double* grad_v_X_grad_w_dV,
2831 double* jacobian_weak_residual)
2833 int eN,i,j,k,I,J,nSpace2=nSpace*nSpace,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element;
2834 double daProduct,dphiProduct;
2835 for(eN=0;eN<nElements_global;eN++)
2836 for (i=0;i<nDOF_test_element;i++)
2837 for (k=0;k<nQuadraturePoints_element;k++)
2840 for (I=0;I<nSpace;I++)
2841 for (J=0;J<nSpace;J++)
2844 da[eN*nQuadraturePoints_element*nSpace2 +
2849 grad_phi_X_grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace2 +
2850 k*nDOF_test_element*nSpace2 +
2854 for (j=0;j<nDOF_trial_element;j++)
2857 for (I=0;I<nSpace;I++)
2858 for (J=0;J<nSpace;J++)
2861 a[eN*nQuadraturePoints_element*nSpace2 +
2866 grad_v_X_grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_X_trial_element*nSpace2 +
2867 k*nDOF_test_X_trial_element*nSpace2 +
2868 j*nDOF_test_element*nSpace2 +
2872 jacobian_weak_residual[eN*nDOF_test_X_trial_element +
2873 i*nDOF_trial_element +
2878 v[eN*nQuadraturePoints_element*nDOF_trial_element+
2879 k*nDOF_trial_element+
2884 dphi[l2g[eN*nDOF_trial_element +
2891 int nQuadraturePoints_element,
2892 int nDOF_trial_element,
2893 int nDOF_test_element,
2903 double* jacobian_weak_residual)
2905 int eN,i,j,k,I,J,nSpace2=nSpace*nSpace,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element;
2906 double daProduct,dphiProduct;
2907 for(eN=0;eN<nElements_global;eN++)
2908 for (i=0;i<nDOF_test_element;i++)
2909 for (k=0;k<nQuadraturePoints_element;k++)
2912 #ifdef SCALAR_DIFFUSION
2913 for (I=0;I<nSpace;I++)
2918 da[eN*nQuadraturePoints_element*nSpace2 +
2921 grad_phi[eN*nQuadraturePoints_element*nSpace +
2925 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
2926 k*nDOF_test_element*nSpace +
2930 for (j=0;j<nDOF_trial_element;j++)
2933 for (I=0;I<nSpace;I++)
2938 a[eN*nQuadraturePoints_element*nSpace2 +
2941 grad_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace +
2942 k*nDOF_trial_element*nSpace +
2946 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
2947 k*nDOF_test_element*nSpace +
2951 jacobian_weak_residual[eN*nDOF_test_X_trial_element +
2952 i*nDOF_trial_element +
2957 v[eN*nQuadraturePoints_element*nDOF_trial_element+
2958 k*nDOF_trial_element+
2963 dphi[l2g[eN*nDOF_trial_element +
2967 for (I=0;I<nSpace;I++)
2968 for (J=0;J<nSpace;J++)
2971 da[eN*nQuadraturePoints_element*nSpace2 +
2976 grad_phi[eN*nQuadraturePoints_element*nSpace +
2980 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
2981 k*nDOF_test_element*nSpace +
2984 for (j=0;j<nDOF_trial_element;j++)
2987 for (I=0;I<nSpace;I++)
2988 for (J=0;J<nSpace;J++)
2991 a[eN*nQuadraturePoints_element*nSpace2 +
2996 grad_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace +
2997 k*nDOF_trial_element*nSpace +
3001 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
3002 k*nDOF_test_element*nSpace +
3005 jacobian_weak_residual[eN*nDOF_test_X_trial_element +
3006 i*nDOF_trial_element +
3011 v[eN*nQuadraturePoints_element*nDOF_trial_element+
3012 k*nDOF_trial_element+
3017 dphi[l2g[eN*nDOF_trial_element +
3024 int nQuadraturePoints_element,
3025 int nDOF_trial_element,
3026 int nDOF_test_element,
3038 double* jacobian_weak_residual)
3040 int eN,i,j,k,I,m,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element,
nnz=rowptr[nSpace];
3041 double daProduct,dphiProduct;
3042 for(eN=0;eN<nElements_global;eN++)
3043 for (i=0;i<nDOF_test_element;i++)
3044 for (k=0;k<nQuadraturePoints_element;k++)
3047 for (I=0;I<nSpace;I++)
3048 for (m=rowptr[I];m<rowptr[I+1];m++)
3051 da[eN*nQuadraturePoints_element*
nnz+
3055 grad_phi[eN*nQuadraturePoints_element*nSpace +
3059 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
3060 k*nDOF_test_element*nSpace +
3063 for (j=0;j<nDOF_trial_element;j++)
3066 for (I=0;I<nSpace;I++)
3067 for(m=rowptr[I];m<rowptr[I+1];m++)
3070 a[eN*nQuadraturePoints_element*
nnz +
3074 grad_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace +
3075 k*nDOF_trial_element*nSpace +
3079 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
3080 k*nDOF_test_element*nSpace +
3083 jacobian_weak_residual[eN*nDOF_test_X_trial_element +
3084 i*nDOF_trial_element +
3089 v[eN*nQuadraturePoints_element*nDOF_trial_element+
3090 k*nDOF_trial_element+
3095 dphi[l2g[eN*nDOF_trial_element +
3126 int nQuadraturePoints_element,
3131 double* strong_residual)
3133 int eN,k,I,J,nSpace2=nSpace*nSpace;
3134 for(eN=0;eN<nElements_global;eN++)
3135 for (k=0;k<nQuadraturePoints_element;k++)
3136 for(I=0;I<nSpace;I++)
3137 for (J=0;J<nSpace;J++)
3138 strong_residual[eN*nQuadraturePoints_element+
3141 da[eN*nQuadraturePoints_element*nSpace2 +
3146 grad_phi[eN*nQuadraturePoints_element*nSpace +
3149 *grad_u[eN*nQuadraturePoints_element*nSpace +
3154 int nQuadraturePoints_element,
3161 double* strong_residual)
3163 int eN,k,I,m,
nnz=rowptr[nSpace];
3164 for(eN=0;eN<nElements_global;eN++)
3165 for (k=0;k<nQuadraturePoints_element;k++)
3166 for(I=0;I<nSpace;I++)
3167 for(m=rowptr[I];m<rowptr[I+1];m++)
3168 strong_residual[eN*nQuadraturePoints_element+
3171 da[eN*nQuadraturePoints_element*
nnz +
3175 grad_phi[eN*nQuadraturePoints_element*nSpace +
3178 *grad_u[eN*nQuadraturePoints_element*nSpace +
3208 int nQuadraturePoints_element,
3209 int nDOF_trial_element,
3217 double* dstrong_residual)
3219 int eN,k,j,I,J,nSpace2=nSpace*nSpace;
3220 for(eN=0;eN<nElements_global;eN++)
3221 for (k=0;k<nQuadraturePoints_element;k++)
3222 for(j=0;j<nDOF_trial_element;j++)
3223 for(I=0;I<nSpace;I++)
3224 for(J=0;J<nSpace;J++)
3226 dstrong_residual[eN*nQuadraturePoints_element*nDOF_trial_element+
3227 k*nDOF_trial_element +
3230 da[eN*nQuadraturePoints_element*nSpace2 +
3236 grad_phi[eN*nQuadraturePoints_element*nSpace +
3240 grad_v[eN*nQuadraturePoints_element*nSpace*nDOF_trial_element +
3241 k*nSpace*nDOF_trial_element +
3245 dphi[l2g[eN*nDOF_trial_element +
3247 grad_v[eN*nQuadraturePoints_element*nSpace*nDOF_trial_element +
3248 k*nSpace*nDOF_trial_element +
3252 grad_u[eN*nQuadraturePoints_element*nSpace+
3259 int nQuadraturePoints_element,
3260 int nDOF_trial_element,
3270 double* dstrong_residual)
3272 int eN,k,j,I,m,
nnz=rowptr[nSpace];
3273 for(eN=0;eN<nElements_global;eN++)
3274 for (k=0;k<nQuadraturePoints_element;k++)
3275 for(j=0;j<nDOF_trial_element;j++)
3276 for(I=0;I<nSpace;I++)
3277 for(m=rowptr[I];m<rowptr[I+1];m++)
3279 dstrong_residual[eN*nQuadraturePoints_element*nDOF_trial_element+
3280 k*nDOF_trial_element +
3283 da[eN*nQuadraturePoints_element*
nnz +
3288 grad_phi[eN*nQuadraturePoints_element*nSpace +
3292 grad_v[eN*nQuadraturePoints_element*nSpace*nDOF_trial_element +
3293 k*nSpace*nDOF_trial_element +
3297 dphi[l2g[eN*nDOF_trial_element +
3299 grad_v[eN*nQuadraturePoints_element*nSpace*nDOF_trial_element +
3300 k*nSpace*nDOF_trial_element +
3304 grad_u[eN*nQuadraturePoints_element*nSpace+
3345 int nQuadraturePoints_element,
3346 int nDOF_test_element,
3353 int eN,i,k,I,J,nSpace2=nSpace*nSpace;
3354 for(eN=0;eN<nElements_global;eN++)
3355 for (i=0;i<nDOF_test_element;i++)
3356 for (k=0;k<nQuadraturePoints_element;k++)
3357 for (I=0;I<nSpace;I++)
3358 for(J=0;J<nSpace;J++)
3359 Lstar_w_dV[eN*nQuadraturePoints_element*nDOF_test_element +
3360 k*nDOF_test_element +
3363 da[eN*nQuadraturePoints_element*nSpace2 +
3368 grad_phi[eN*nQuadraturePoints_element*nSpace+
3372 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
3373 k*nDOF_test_element*nSpace +
3379 int nQuadraturePoints_element,
3380 int nDOF_test_element,
3389 int eN,i,k,I,m,
nnz=rowptr[nSpace];
3390 for(eN=0;eN<nElements_global;eN++)
3391 for (i=0;i<nDOF_test_element;i++)
3392 for (k=0;k<nQuadraturePoints_element;k++)
3393 for (I=0;I<nSpace;I++)
3394 for(m=rowptr[I];m<rowptr[I+1];m++)
3395 Lstar_w_dV[eN*nQuadraturePoints_element*nDOF_test_element +
3396 k*nDOF_test_element +
3399 da[eN*nQuadraturePoints_element*
nnz +
3403 grad_phi[eN*nQuadraturePoints_element*nSpace+
3407 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
3408 k*nDOF_test_element*nSpace +
3414 int nQuadraturePoints_element,
3418 double* strong_residual)
3420 int eN,k,I,J,nSpace2=nSpace*nSpace;
3421 for(eN=0;eN<nElements_global;eN++)
3422 for (k=0;k<nQuadraturePoints_element;k++)
3423 for(I=0;I<nSpace;I++)
3424 for (J=0;J<nSpace;J++)
3426 strong_residual[eN*nQuadraturePoints_element+
3429 a[eN*nQuadraturePoints_element*nSpace2 +
3434 Hess_phi[eN*nQuadraturePoints_element*nSpace2 +
3442 int nQuadraturePoints_element,
3448 double* strong_residual)
3450 int eN,k,I,m,nSpace2=nSpace*nSpace,
nnz=rowptr[nSpace];
3451 for(eN=0;eN<nElements_global;eN++)
3452 for (k=0;k<nQuadraturePoints_element;k++)
3453 for(I=0;I<nSpace;I++)
3454 for (m=rowptr[I];m<rowptr[I+1];m++)
3456 strong_residual[eN*nQuadraturePoints_element+
3459 a[eN*nQuadraturePoints_element*
nnz +
3463 Hess_phi[eN*nQuadraturePoints_element*nSpace2 +
3471 int nQuadraturePoints_element,
3472 int nDOF_trial_element,
3481 double* dstrong_residual)
3483 int eN,k,j,I,J,nSpace2=nSpace*nSpace;
3485 for(eN=0;eN<nElements_global;eN++)
3486 for (k=0;k<nQuadraturePoints_element;k++)
3487 for (j=0;j<nDOF_trial_element;j++)
3488 for(I=0;I<nSpace;I++)
3489 for (J=0;J<nSpace;J++)
3491 dstrong_residual[eN*nQuadraturePoints_element*nDOF_trial_element+
3492 k*nDOF_trial_element+
3495 (da[eN*nQuadraturePoints_element*nSpace2 +
3500 v[eN*nQuadraturePoints_element*nDOF_trial_element+
3501 k*nDOF_trial_element+
3504 Hess_phi[eN*nQuadraturePoints_element*nSpace2 +
3509 a[eN*nQuadraturePoints_element*nSpace2 +
3514 dphi[l2g[eN*nDOF_trial_element +
3517 Hess_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace2 +
3518 k*nDOF_trial_element*nSpace2 +
3526 int nQuadraturePoints_element,
3527 int nDOF_trial_element,
3538 double* dstrong_residual)
3540 int eN,k,j,I,m,nSpace2=nSpace*nSpace,
nnz=rowptr[nSpace];
3542 for(eN=0;eN<nElements_global;eN++)
3543 for (k=0;k<nQuadraturePoints_element;k++)
3544 for (j=0;j<nDOF_trial_element;j++)
3545 for(I=0;I<nSpace;I++)
3546 for (m=rowptr[I];m<rowptr[I+1];m++)
3548 dstrong_residual[eN*nQuadraturePoints_element*nDOF_trial_element+
3549 k*nDOF_trial_element+
3552 (da[eN*nQuadraturePoints_element*
nnz+
3556 v[eN*nQuadraturePoints_element*nDOF_trial_element+
3557 k*nDOF_trial_element+
3560 Hess_phi[eN*nQuadraturePoints_element*nSpace2 +
3565 a[eN*nQuadraturePoints_element*
nnz+
3569 dphi[l2g[eN*nDOF_trial_element +
3572 Hess_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace2 +
3573 k*nDOF_trial_element*nSpace2 +
3581 int nQuadraturePoints_element,
3582 int nDOF_test_element,
3588 int eN,i,k,I,J,nSpace2=nSpace*nSpace;
3589 for(eN=0;eN<nElements_global;eN++)
3590 for (i=0;i<nDOF_test_element;i++)
3591 for (k=0;k<nQuadraturePoints_element;k++)
3592 for (I=0;I<nSpace;I++)
3593 for(J=0;J<nSpace;J++)
3595 Lstar_w_dV[eN*nQuadraturePoints_element*nDOF_test_element +
3596 k*nDOF_test_element +
3599 a[eN*nQuadraturePoints_element*nSpace2 +
3604 Hess_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace2 +
3605 k*nDOF_test_element*nSpace2 +
3614 int nQuadraturePoints_element,
3615 int nDOF_test_element,
3623 int eN,i,k,I,m,nSpace2=nSpace*nSpace,
nnz=rowptr[nSpace];
3624 for(eN=0;eN<nElements_global;eN++)
3625 for (i=0;i<nDOF_test_element;i++)
3626 for (k=0;k<nQuadraturePoints_element;k++)
3627 for (I=0;I<nSpace;I++)
3628 for(m=rowptr[I];m<rowptr[I+1];m++)
3630 Lstar_w_dV[eN*nQuadraturePoints_element*nDOF_test_element +
3631 k*nDOF_test_element +
3634 a[eN*nQuadraturePoints_element*
nnz+
3638 Hess_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace2 +
3639 k*nDOF_test_element*nSpace2 +
3681 int nQuadraturePoints_element,
3682 int nDOF_test_element,
3685 double* weak_residual)
3687 updateMass_weak(nElements_global,nQuadraturePoints_element,nDOF_test_element,
r,w_dV,weak_residual);
3730 int nQuadraturePoints_element,
3731 int nDOF_trial_element,
3732 int nDOF_test_element,
3735 double* jacobian_weak_residual)
3737 updateMassJacobian_weak(nElements_global,nQuadraturePoints_element,nDOF_trial_element,nDOF_test_element,dr,v_X_w_dV,jacobian_weak_residual);
3741 int nQuadraturePoints_element,
3742 int nDOF_trial_element,
3743 int nDOF_test_element,
3747 double* jacobian_weak_residual)
3750 v,w_dV,jacobian_weak_residual);
3772 int nQuadraturePoints_element,
3774 double* strong_residual)
3777 for(eN=0;eN<nElements_global;eN++)
3778 for (k=0;k<nQuadraturePoints_element;k++)
3779 strong_residual[eN*nQuadraturePoints_element+
3782 r[eN*nQuadraturePoints_element+
3806 int nQuadraturePoints_element,
3807 int nDOF_trial_element,
3810 double* dstrong_residual)
3813 for(eN=0;eN<nElements_global;eN++)
3814 for(j=0;j<nDOF_trial_element;j++)
3815 for (k=0;k<nQuadraturePoints_element;k++)
3816 dstrong_residual[eN*nQuadraturePoints_element*nDOF_trial_element+
3817 k*nDOF_trial_element +
3820 dr[eN*nQuadraturePoints_element+
3823 v[eN*nQuadraturePoints_element*nDOF_trial_element+
3824 k*nDOF_trial_element +
3853 int nQuadraturePoints_element,
3854 int nDOF_test_element,
3860 for(eN=0;eN<nElements_global;eN++)
3861 for (i=0;i<nDOF_test_element;i++)
3862 for (k=0;k<nQuadraturePoints_element;k++)
3863 Lstar_w_dV[eN*nQuadraturePoints_element*nDOF_test_element +
3864 k*nDOF_test_element +
3867 dr[eN*nQuadraturePoints_element +
3870 w_dV[eN*nQuadraturePoints_element*nDOF_test_element +
3871 k*nDOF_test_element +
3910 int nQuadraturePoints_element,
3911 int nDOF_test_element,
3914 double* weak_residual)
3917 for(eN=0;eN<nElements_global;eN++)
3918 for (i=0;i<nDOF_test_element;i++)
3919 for (k=0;k<nQuadraturePoints_element;k++)
3920 weak_residual[eN*nDOF_test_element + i]
3922 error[eN*nQuadraturePoints_element +
3925 Lstar_w_dV[eN*nQuadraturePoints_element*nDOF_test_element +
3926 k*nDOF_test_element +
3970 int nQuadraturePoints_element,
3971 int nDOF_trial_element,
3972 int nDOF_test_element,
3975 double* jacobian_weak_residual)
3977 int eN,i,j,k,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element;
3978 for(eN=0;eN<nElements_global;eN++)
3979 for (i=0;i<nDOF_test_element;i++)
3980 for (k=0;k<nQuadraturePoints_element;k++)
3981 for (j=0;j<nDOF_trial_element;j++)
3982 jacobian_weak_residual[eN*nDOF_test_X_trial_element +
3983 i*nDOF_trial_element +
3986 derror[eN*nQuadraturePoints_element*nDOF_trial_element+
3987 k*nDOF_trial_element+
3990 Lstar_w_dV[eN*nQuadraturePoints_element*nDOF_test_element +
3991 k*nDOF_test_element +
4035 int nQuadraturePoints_element,
4036 int nDOF_test_element,
4039 double* grad_u_X_grad_w_dV,
4040 double* weak_residual)
4042 int eN,i,k,I,nSpace2=nSpace*nSpace;
4043 for(eN=0;eN<nElements_global;eN++)
4044 for (i=0;i<nDOF_test_element;i++)
4045 for (k=0;k<nQuadraturePoints_element;k++)
4046 for (I=0;I<nSpace;I++)
4047 weak_residual[eN*nDOF_test_element + i]
4049 numDiff[eN*nQuadraturePoints_element +
4052 grad_u_X_grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace2 +
4053 k*nDOF_test_element*nSpace2 +
4060 int nQuadraturePoints_element,
4061 int nDOF_test_element,
4066 double* weak_residual)
4069 for(eN=0;eN<nElements_global;eN++)
4070 for (i=0;i<nDOF_test_element;i++)
4071 for (k=0;k<nQuadraturePoints_element;k++)
4072 for (I=0;I<nSpace;I++)
4073 weak_residual[eN*nDOF_test_element + i]
4075 numDiff[eN*nQuadraturePoints_element +
4078 grad_u[eN*nQuadraturePoints_element*nSpace +
4082 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
4083 k*nDOF_test_element*nSpace +
4132 int nQuadraturePoints_element,
4133 int nDOF_trial_element,
4134 int nDOF_test_element,
4137 double* grad_v_X_grad_w_dV,
4138 double* jacobian_weak_residual)
4140 int eN,i,j,k,I,nSpace2=nSpace*nSpace,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element;
4141 for(eN=0;eN<nElements_global;eN++)
4142 for (i=0;i<nDOF_test_element;i++)
4143 for (k=0;k<nQuadraturePoints_element;k++)
4144 for (j=0;j<nDOF_trial_element;j++)
4145 for (I=0;I<nSpace;I++)
4146 jacobian_weak_residual[eN*nDOF_test_X_trial_element +
4147 i*nDOF_trial_element +
4150 numDiff[eN*nQuadraturePoints_element +
4153 grad_v_X_grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_X_trial_element*nSpace2 +
4154 k*nDOF_test_X_trial_element*nSpace2 +
4155 j*nDOF_test_element*nSpace2 +
4162 int nQuadraturePoints_element,
4163 int nDOF_trial_element,
4164 int nDOF_test_element,
4169 double* jacobian_weak_residual)
4171 int eN,i,j,k,I,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element;
4172 for(eN=0;eN<nElements_global;eN++)
4173 for (i=0;i<nDOF_test_element;i++)
4174 for (k=0;k<nQuadraturePoints_element;k++)
4175 for (j=0;j<nDOF_trial_element;j++)
4176 for (I=0;I<nSpace;I++)
4177 jacobian_weak_residual[eN*nDOF_test_X_trial_element +
4178 i*nDOF_trial_element +
4181 numDiff[eN*nQuadraturePoints_element +
4184 grad_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace +
4185 k*nDOF_trial_element*nSpace +
4189 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
4190 k*nDOF_test_element*nSpace +
4199 int nQuadraturePoints_element,
4205 for(eN=0;eN<nElements_global;eN++)
4206 for (k=0;k<nQuadraturePoints_element;k++)
4207 sResult[eN*nQuadraturePoints_element +
4210 s1[eN*nQuadraturePoints_element +
4213 s2[eN*nQuadraturePoints_element +
4221 int nQuadraturePoints_element,
4228 for(eN=0;eN<nElements_global;eN++)
4229 for (k=0;k<nQuadraturePoints_element;k++)
4230 for (I=0;I<nSpace;I++)
4231 vResult[eN*nQuadraturePoints_element*nSpace +
4235 v[eN*nQuadraturePoints_element*nSpace +
4239 s[eN*nQuadraturePoints_element +
4247 int nQuadraturePoints_element,
4253 int eN,k,I,J,nSpace2=nSpace*nSpace;
4254 for(eN=0;eN<nElements_global;eN++)
4255 for (k=0;k<nQuadraturePoints_element;k++)
4256 for (I=0;I<nSpace;I++)
4257 for (J=0;J<nSpace;J++)
4258 tResult[eN*nQuadraturePoints_element*nSpace2 +
4263 t[eN*nQuadraturePoints_element*nSpace2 +
4268 s[eN*nQuadraturePoints_element +
4281 int nElementBoundaries_element,
4282 int nQuadraturePoints_elementBoundary,
4283 int nDOF_test_element,
4284 int* interiorElementBoundaries,
4285 int* elementBoundaryElements,
4286 int* elementBoundaryLocalElementBoundaries,
4291 int ebNI,ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,i,k;
4292 for(ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
4294 ebN = interiorElementBoundaries[ebNI];
4295 left_eN_global = elementBoundaryElements[ebN*2+0];
4296 right_eN_global = elementBoundaryElements[ebN*2+1];
4297 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
4298 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
4299 for(i=0;i<nDOF_test_element;i++)
4300 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
4302 residual[left_eN_global*nDOF_test_element+
4305 flux[ebN*nQuadraturePoints_elementBoundary+
4307 w_dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
4308 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
4309 k*nDOF_test_element+
4311 residual[right_eN_global*nDOF_test_element+
4314 flux[ebN*nQuadraturePoints_elementBoundary+
4316 w_dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
4317 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
4318 k*nDOF_test_element+
4328 int nElementBoundaries_element,
4329 int nQuadraturePoints_elementBoundary,
4330 int nDOF_test_element,
4331 int* exteriorElementBoundaries,
4332 int* elementBoundaryElements,
4333 int* elementBoundaryLocalElementBoundaries,
4338 int ebNE,ebN,eN_global,ebN_element,i,k;
4339 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
4341 ebN = exteriorElementBoundaries[ebNE];
4342 eN_global = elementBoundaryElements[ebN*2+0];
4343 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
4344 for(i=0;i<nDOF_test_element;i++)
4345 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
4347 residual[eN_global*nDOF_test_element+
4350 flux[ebN*nQuadraturePoints_elementBoundary+
4353 w_dS[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
4354 ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
4355 k*nDOF_test_element+
4362 int nQuadraturePoints_elementBoundary,
4363 int nDOF_test_element,
4364 int* exteriorElementBoundaries,
4365 int* elementBoundaryElements,
4366 int* elementBoundaryLocalElementBoundaries,
4371 int ebNE,ebN,eN_global,ebN_element,i,k;
4372 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
4374 ebN = exteriorElementBoundaries[ebNE];
4375 eN_global = elementBoundaryElements[ebN*2+0];
4376 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
4377 for(i=0;i<nDOF_test_element;i++)
4378 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
4380 residual[eN_global*nDOF_test_element+
4383 flux[ebNE*nQuadraturePoints_elementBoundary+
4386 w_dS[ebNE*nQuadraturePoints_elementBoundary*nDOF_test_element+
4387 k*nDOF_test_element+
4393 int nQuadraturePoints_elementBoundary,
4394 int nDOF_test_element,
4395 int* exteriorElementBoundaries,
4396 int* elementBoundaryElements,
4397 int* elementBoundaryLocalElementBoundaries,
4402 int ebNE,ebN,eN_global,ebN_element,i,k,I;
4403 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
4405 ebN = exteriorElementBoundaries[ebNE];
4406 eN_global = elementBoundaryElements[ebN*2+0];
4407 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
4408 for(i=0;i<nDOF_test_element;i++)
4409 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
4410 residual[eN_global*nDOF_test_element+
4413 stressFlux[ebNE*nQuadraturePoints_elementBoundary+
4416 w_dS[ebNE*nQuadraturePoints_elementBoundary*nDOF_test_element+
4417 k*nDOF_test_element+
4425 int nElementBoundaries_element,
4426 int nQuadraturePoints_elementBoundary,
4427 int nDOF_test_element,
4428 int* interiorElementBoundaries,
4429 int* elementBoundaryElements,
4430 int* elementBoundaryLocalElementBoundaries,
4435 int ebNI,ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,i,k;
4436 for(ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
4438 ebN = interiorElementBoundaries[ebNI];
4439 left_eN_global = elementBoundaryElements[ebN*2+0];
4440 right_eN_global = elementBoundaryElements[ebN*2+1];
4441 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
4442 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
4443 for(i=0;i<nDOF_test_element;i++)
4444 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
4446 residual[left_eN_global*nDOF_test_element+
4449 flux[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
4450 left_ebN_element*nQuadraturePoints_elementBoundary+
4452 w_dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
4453 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
4454 k*nDOF_test_element+
4456 residual[right_eN_global*nDOF_test_element+
4459 flux[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
4460 right_ebN_element*nQuadraturePoints_elementBoundary+
4462 w_dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
4463 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
4464 k*nDOF_test_element+
4471 int nQuadraturePoints_elementBoundary,
4472 int* elementBoundaryMaterialTypes,
4473 int* exteriorElementBoundaries,
4474 int* elementBoundaryElements,
4475 int* elementBoundaryLocalElementBoundaries,
4477 double* mom_flux_vec_u,
4478 double* mom_flux_vec_v,
4479 double* mom_flux_vec_w,
4484 int ebNE,ebN,eN_global,ebN_element,k,I;
4485 double stress_x,stress_y,stress_z;
4486 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
4488 ebN = exteriorElementBoundaries[ebNE];
4489 eN_global = elementBoundaryElements[ebN*2+0];
4490 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
4491 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
4496 stress_x += p[ebNE*nQuadraturePoints_elementBoundary+
4499 n[ebNE*nQuadraturePoints_elementBoundary*3+
4502 stress_y += p[ebNE*nQuadraturePoints_elementBoundary+
4505 n[ebNE*nQuadraturePoints_elementBoundary*3+
4508 stress_z += p[ebNE*nQuadraturePoints_elementBoundary+
4511 n[ebNE*nQuadraturePoints_elementBoundary*3+
4516 stress_x += mom_flux_vec_u[ebNE*nQuadraturePoints_elementBoundary*3+
4520 n[ebNE*nQuadraturePoints_elementBoundary*3+
4523 stress_y += mom_flux_vec_v[ebNE*nQuadraturePoints_elementBoundary*3+
4527 n[ebNE*nQuadraturePoints_elementBoundary*3+
4530 stress_z += mom_flux_vec_w[ebNE*nQuadraturePoints_elementBoundary*3+
4534 n[ebNE*nQuadraturePoints_elementBoundary*3+
4538 F[elementBoundaryMaterialTypes[ebN]*3 + 0] += stress_x*
4539 dS[ebNE*nQuadraturePoints_elementBoundary+
4541 F[elementBoundaryMaterialTypes[ebN]*3 + 1] += stress_y*
4542 dS[ebNE*nQuadraturePoints_elementBoundary+
4544 F[elementBoundaryMaterialTypes[ebN]*3 + 2] += stress_z*
4545 dS[ebNE*nQuadraturePoints_elementBoundary+
4552 int nQuadraturePoints_elementBoundary,
4553 int* elementBoundaryMaterialTypes,
4554 int* exteriorElementBoundaries,
4555 int* elementBoundaryElements,
4556 int* elementBoundaryLocalElementBoundaries,
4558 double* mom_flux_vec_u,
4559 double* mom_flux_vec_v,
4564 int ebNE,ebN,eN_global,ebN_element,k,I;
4565 double stress_x,stress_y;
4566 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
4568 ebN = exteriorElementBoundaries[ebNE];
4569 eN_global = elementBoundaryElements[ebN*2+0];
4570 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
4571 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
4575 stress_x += p[ebNE*nQuadraturePoints_elementBoundary+
4578 n[ebNE*nQuadraturePoints_elementBoundary*2+
4581 stress_y += p[ebNE*nQuadraturePoints_elementBoundary+
4584 n[ebNE*nQuadraturePoints_elementBoundary*2+
4604 F[elementBoundaryMaterialTypes[ebN]*2 + 0] += stress_x*
4605 dS[ebNE*nQuadraturePoints_elementBoundary+
4607 F[elementBoundaryMaterialTypes[ebN]*2 + 1] += stress_y*
4608 dS[ebNE*nQuadraturePoints_elementBoundary+
4619 int nQuadraturePoints_elementBoundary,
4620 int* elementBoundaryMaterialTypes,
4621 int* exteriorElementBoundaries,
4625 double* boundaryMeasure)
4627 int ebNE,ebN,k,elementBoundaryFlag;
4629 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
4632 ebN = exteriorElementBoundaries[ebNE];
4634 elementBoundaryFlag = elementBoundaryMaterialTypes[ebN];
4636 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
4638 P[elementBoundaryFlag] += p[ebNE*nQuadraturePoints_elementBoundary+k]
4640 dS[ebNE*nQuadraturePoints_elementBoundary+k];
4641 boundaryMeasure[elementBoundaryFlag] +=
4642 dS[ebNE*nQuadraturePoints_elementBoundary+k];
4652 int nDOF_test_element,
4655 int* nFreeDOF_element_r,
4658 double* elementResidual,
4659 double* globalResidual)
4662 for (eN=0;eN<nElements_global;eN++)
4663 for (ii=0;ii<nFreeDOF_element_r[eN];ii++)
4664 globalResidual[offset_r +
4665 stride_r*freeGlobal_r[eN*nDOF_test_element+
4668 elementResidual[eN*nDOF_test_element +
4669 freeLocal_r[eN*nDOF_test_element+
4677 int nDOF_test_element,
4678 int nDOF_trial_element,
4683 int nFreeVDOF_global,
4684 int* nFreeDOF_element_r,
4687 int* nFreeDOF_element_u,
4690 double* elementJacobian,
4691 double* globalJacobian)
4693 int eN,ii,jj,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element,i,j,jacIndex,I,J;
4694 for (eN=0;eN<nElements_global;eN++)
4695 for (ii=0;ii<nFreeDOF_element_r[eN];ii++)
4697 i = freeLocal_r[eN*nDOF_test_element+
4699 I = offset_r + stride_r*freeGlobal_r[eN*nDOF_test_element+
4701 for (jj=0;jj<nFreeDOF_element_u[eN];jj++)
4703 j = freeLocal_u[eN*nDOF_trial_element+
4705 J = offset_u + stride_u*freeGlobal_u[eN*nDOF_trial_element+
4707 jacIndex = I + J*nFreeVDOF_global;
4708 globalJacobian[jacIndex]
4710 elementJacobian[eN*nDOF_test_X_trial_element +
4711 i*nDOF_trial_element+
4721 int nElements_global,
4722 int nElementBoundaries_element,
4723 int nDOF_test_element,
4724 int nDOF_trial_element,
4729 int nFreeVDOF_global,
4730 int* nFreeDOF_element_r,
4733 int* nFreeDOF_element_u,
4736 double* elementJacobian_eb,
4737 double* globalJacobian)
4739 int eN,ebN,eN_ebN,ii,jj,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element,i,j,jacIndex,I,J;
4740 for (eN=0;eN<nElements_global;eN++)
4741 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
4749 eN_ebN = elementNeighbors[eN*nElementBoundaries_element+ebN];
4751 for (ii=0;ii<nFreeDOF_element_r[eN];ii++)
4753 i = freeLocal_r[eN*nDOF_test_element+
4755 I = offset_r + stride_r*freeGlobal_r[eN*nDOF_test_element+
4757 for (jj=0;jj<nFreeDOF_element_u[eN_ebN];jj++)
4759 j = freeLocal_u[eN_ebN*nDOF_trial_element+
4761 J = offset_u + stride_u*freeGlobal_u[eN_ebN*nDOF_trial_element+
4763 jacIndex = I + J*nFreeVDOF_global;
4764 globalJacobian[jacIndex]
4766 elementJacobian_eb[eN*nElementBoundaries_element*nDOF_test_X_trial_element +
4767 ebN*nDOF_test_X_trial_element+
4768 i*nDOF_trial_element+
4779 int nElementBoundaries_element,
4780 int nQuadraturePoints_elementBoundary,
4781 int nDOF_test_element,
4782 int nDOF_trial_element,
4787 int nFreeVDOF_global,
4788 int* interiorElementBoundaries,
4789 int* elementBoundaryElements,
4790 int* elementBoundaryLocalElementBoundaries,
4791 int* nFreeDOF_element_r,
4794 int* nFreeDOF_element_u,
4797 double* elementBoundaryFluxJacobian,
4801 int ebNI,ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,ii,i,k,jj,j,jacIndex,I,J;
4802 for (ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
4804 ebN = interiorElementBoundaries[ebNI];
4805 left_eN_global = elementBoundaryElements[ebN*2+0];
4806 right_eN_global = elementBoundaryElements[ebN*2+1];
4807 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
4808 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
4809 for(ii=0;ii<nFreeDOF_element_r[left_eN_global];ii++)
4811 i = freeLocal_r[left_eN_global*nDOF_test_element+
4813 I = offset_r + stride_r*freeGlobal_r[left_eN_global*nDOF_test_element+
4815 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
4817 for(jj=0;jj<nFreeDOF_element_u[left_eN_global];jj++)
4819 j = freeLocal_u[left_eN_global*nDOF_trial_element+
4821 J = offset_u + stride_u*freeGlobal_u[left_eN_global*nDOF_trial_element+
4823 jacIndex = I+J*nFreeVDOF_global;
4826 elementBoundaryFluxJacobian[ebN*2*nQuadraturePoints_elementBoundary*nDOF_trial_element +
4827 0*nQuadraturePoints_elementBoundary*nDOF_trial_element+
4828 k*nDOF_trial_element+
4831 w_dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element +
4832 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
4833 k*nDOF_test_element+
4836 for(jj=0;jj<nFreeDOF_element_u[right_eN_global];jj++)
4838 j = freeLocal_u[right_eN_global*nDOF_trial_element+
4840 J = offset_u + stride_u*freeGlobal_u[right_eN_global*nDOF_trial_element+
4842 jacIndex = I+J*nFreeVDOF_global;
4845 elementBoundaryFluxJacobian[ebN*2*nQuadraturePoints_elementBoundary*nDOF_trial_element +
4846 1*nQuadraturePoints_elementBoundary*nDOF_trial_element+
4847 k*nDOF_trial_element+
4849 w_dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element +
4850 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
4851 k*nDOF_test_element+i];
4855 for(ii=0;ii<nFreeDOF_element_r[right_eN_global];ii++)
4857 i = freeLocal_r[right_eN_global*nDOF_test_element+
4859 I = offset_r + stride_r*freeGlobal_r[right_eN_global*nDOF_test_element+
4861 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
4863 for(jj=0;jj<nFreeDOF_element_u[left_eN_global];jj++)
4865 j = freeLocal_u[left_eN_global*nDOF_trial_element+
4867 J = offset_u + stride_u*freeGlobal_u[left_eN_global*nDOF_trial_element+
4869 jacIndex = I+J*nFreeVDOF_global;
4872 elementBoundaryFluxJacobian[ebN*2*nQuadraturePoints_elementBoundary*nDOF_trial_element+
4873 0*nQuadraturePoints_elementBoundary*nDOF_trial_element+
4874 k*nDOF_trial_element+
4877 w_dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
4878 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
4879 k*nDOF_test_element+
4882 for(jj=0;jj<nFreeDOF_element_u[right_eN_global];jj++)
4884 j = freeLocal_u[right_eN_global*nDOF_trial_element+
4886 J = offset_u + stride_u*freeGlobal_u[right_eN_global*nDOF_trial_element+
4888 jacIndex = I+J*nFreeVDOF_global;
4891 elementBoundaryFluxJacobian[ebN*2*nQuadraturePoints_elementBoundary*nDOF_trial_element+
4892 1*nQuadraturePoints_elementBoundary*nDOF_trial_element+
4893 k*nDOF_trial_element+
4895 w_dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
4896 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
4897 k*nDOF_test_element+
4909 int nElements_global,
4910 int nInteriorElementBoundaries_global,
4911 int nElementBoundaries_element,
4912 int nQuadraturePoints_elementBoundary,
4913 int nDOF_test_element,
4914 int nDOF_trial_element,
4919 int nFreeVDOF_global,
4920 int* interiorElementBoundaries,
4921 int* elementBoundaryElements,
4922 int* elementBoundaryLocalElementBoundaries,
4923 int* nFreeDOF_element_r,
4926 int* nFreeDOF_element_u,
4929 double* elementBoundaryFluxJacobian_eb,
4933 int ebNI,ebN,ebN_element,left_eN_ebN,right_eN_ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,ii,i,k,jj,j,jacIndex,I,J;
4934 for (ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
4936 ebN = interiorElementBoundaries[ebNI];
4937 left_eN_global = elementBoundaryElements[ebN*2+0];
4938 right_eN_global = elementBoundaryElements[ebN*2+1];
4939 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
4940 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
4941 for(ebN_element=0;ebN_element<nElementBoundaries_element;ebN_element++)
4952 left_eN_ebN = elementNeighbors[left_eN_global*nElementBoundaries_element+ebN_element];
4953 right_eN_ebN = elementNeighbors[right_eN_global*nElementBoundaries_element+ebN_element];
4954 for(ii=0;ii<nFreeDOF_element_r[left_eN_global];ii++)
4956 i = freeLocal_r[left_eN_global*nDOF_test_element+
4958 I = offset_r + stride_r*freeGlobal_r[left_eN_global*nDOF_test_element+
4960 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
4963 if(left_eN_ebN >= 0)
4964 for(jj=0;jj<nFreeDOF_element_u[left_eN_ebN];jj++)
4966 j = freeLocal_u[left_eN_ebN*nDOF_trial_element+
4968 J = offset_u + stride_u*freeGlobal_u[left_eN_ebN*nDOF_trial_element+
4970 jacIndex = I+J*nFreeVDOF_global;
4973 elementBoundaryFluxJacobian_eb[ebN*2*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element +
4974 0*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
4975 ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
4976 k*nDOF_trial_element+
4979 w_dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element +
4980 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
4981 k*nDOF_test_element+
4996 if(right_eN_ebN >= 0)
4997 for(jj=0;jj<nFreeDOF_element_u[right_eN_ebN];jj++)
4999 j = freeLocal_u[right_eN_ebN*nDOF_trial_element+
5001 J = offset_u + stride_u*freeGlobal_u[right_eN_ebN*nDOF_trial_element+
5003 jacIndex = I+J*nFreeVDOF_global;
5006 elementBoundaryFluxJacobian_eb[ebN*2*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element +
5007 1*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5008 ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5009 k*nDOF_trial_element+
5011 w_dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element +
5012 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5013 k*nDOF_test_element+i];
5028 for(ii=0;ii<nFreeDOF_element_r[right_eN_global];ii++)
5030 i = freeLocal_r[right_eN_global*nDOF_test_element+
5032 I = offset_r + stride_r*freeGlobal_r[right_eN_global*nDOF_test_element+
5034 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
5037 if(left_eN_ebN >= 0)
5038 for(jj=0;jj<nFreeDOF_element_u[left_eN_ebN];jj++)
5040 j = freeLocal_u[left_eN_ebN*nDOF_trial_element+
5042 J = offset_u + stride_u*freeGlobal_u[left_eN_ebN*nDOF_trial_element+
5044 jacIndex = I+J*nFreeVDOF_global;
5047 elementBoundaryFluxJacobian_eb[ebN*2*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5048 0*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5049 ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5050 k*nDOF_trial_element+
5053 w_dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5054 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5055 k*nDOF_test_element+
5070 if(right_eN_ebN >= 0)
5071 for(jj=0;jj<nFreeDOF_element_u[right_eN_ebN];jj++)
5073 j = freeLocal_u[right_eN_ebN*nDOF_trial_element+
5075 J = offset_u + stride_u*freeGlobal_u[right_eN_ebN*nDOF_trial_element+
5077 jacIndex = I+J*nFreeVDOF_global;
5080 elementBoundaryFluxJacobian_eb[ebN*2*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5081 1*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5082 ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5083 k*nDOF_trial_element+
5085 w_dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5086 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5087 k*nDOF_test_element+
5110 int nElementBoundaries_element,
5111 int nQuadraturePoints_elementBoundary,
5112 int nDOF_test_element,
5113 int nDOF_trial_element,
5118 int nFreeVDOF_global,
5119 int* interiorElementBoundaries,
5120 int* elementBoundaryElements,
5121 int* elementBoundaryLocalElementBoundaries,
5122 int* nFreeDOF_element_r,
5125 int* nFreeDOF_element_u,
5128 double* elementBoundaryFluxJacobian_2sided,
5132 int ebNI,ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,ii,i,k,jj,j,jacIndex,I,J;
5133 for (ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
5135 ebN = interiorElementBoundaries[ebNI];
5136 left_eN_global = elementBoundaryElements[ebN*2+0];
5137 right_eN_global = elementBoundaryElements[ebN*2+1];
5138 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
5139 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
5141 for(ii=0;ii<nFreeDOF_element_r[left_eN_global];ii++)
5143 i = freeLocal_r[left_eN_global*nDOF_test_element+
5145 I = offset_r + stride_r*freeGlobal_r[left_eN_global*nDOF_test_element+
5147 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
5149 for(jj=0;jj<nFreeDOF_element_u[left_eN_global];jj++)
5151 j = freeLocal_u[left_eN_global*nDOF_trial_element+
5153 J = offset_u + stride_u*freeGlobal_u[left_eN_global*nDOF_trial_element+
5155 jacIndex = I+J*nFreeVDOF_global;
5158 elementBoundaryFluxJacobian_2sided[ebN*2*2*nQuadraturePoints_elementBoundary*nDOF_trial_element +
5159 0*2*nQuadraturePoints_elementBoundary*nDOF_trial_element +
5160 0*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5161 k*nDOF_trial_element+
5164 w_dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element +
5165 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5166 k*nDOF_test_element+
5169 for(jj=0;jj<nFreeDOF_element_u[right_eN_global];jj++)
5171 j = freeLocal_u[right_eN_global*nDOF_trial_element+
5173 J = offset_u + stride_u*freeGlobal_u[right_eN_global*nDOF_trial_element+
5175 jacIndex = I+J*nFreeVDOF_global;
5178 elementBoundaryFluxJacobian_2sided[ebN*2*2*nQuadraturePoints_elementBoundary*nDOF_trial_element +
5179 0*2*nQuadraturePoints_elementBoundary*nDOF_trial_element +
5180 1*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5181 k*nDOF_trial_element+
5183 w_dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element +
5184 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5185 k*nDOF_test_element+i];
5190 for(ii=0;ii<nFreeDOF_element_r[right_eN_global];ii++)
5192 i = freeLocal_r[right_eN_global*nDOF_test_element+
5194 I = offset_r + stride_r*freeGlobal_r[right_eN_global*nDOF_test_element+
5196 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
5198 for(jj=0;jj<nFreeDOF_element_u[left_eN_global];jj++)
5200 j = freeLocal_u[left_eN_global*nDOF_trial_element+
5202 J = offset_u + stride_u*freeGlobal_u[left_eN_global*nDOF_trial_element+
5204 jacIndex = I+J*nFreeVDOF_global;
5207 elementBoundaryFluxJacobian_2sided[ebN*2*2*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5208 1*2*nQuadraturePoints_elementBoundary*nDOF_trial_element +
5209 0*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5210 k*nDOF_trial_element+
5213 w_dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5214 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5215 k*nDOF_test_element+
5218 for(jj=0;jj<nFreeDOF_element_u[right_eN_global];jj++)
5220 j = freeLocal_u[right_eN_global*nDOF_trial_element+
5222 J = offset_u + stride_u*freeGlobal_u[right_eN_global*nDOF_trial_element+
5224 jacIndex = I+J*nFreeVDOF_global;
5227 elementBoundaryFluxJacobian_2sided[ebN*2*2*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5228 1*2*nQuadraturePoints_elementBoundary*nDOF_trial_element +
5229 1*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5230 k*nDOF_trial_element+
5232 w_dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5233 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5234 k*nDOF_test_element+
5246 int nElementBoundaries_element,
5247 int nQuadraturePoints_elementBoundary,
5248 int nDOF_test_element,
5249 int nDOF_trial_element,
5254 int nFreeVDOF_global,
5255 int* exteriorElementBoundaries,
5256 int* elementBoundaryElements,
5257 int* elementBoundaryLocalElementBoundaries,
5258 int* nFreeDOF_element_r,
5261 int* nFreeDOF_element_u,
5264 double* elementBoundaryFluxJacobian,
5268 int ebNE,ebN,eN_global,ebN_element,ii,i,k,jj,j,I,J,jacIndex;
5269 for (ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
5271 ebN = exteriorElementBoundaries[ebNE];
5272 eN_global = elementBoundaryElements[ebN*2+0];
5273 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
5274 for(ii=0;ii<nFreeDOF_element_r[eN_global];ii++)
5276 i = freeLocal_r[eN_global*nDOF_test_element+
5278 I = offset_r + stride_r*freeGlobal_r[eN_global*nDOF_test_element+
5280 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
5282 for(jj=0;jj<nFreeDOF_element_u[eN_global];jj++)
5284 j = freeLocal_u[eN_global*nDOF_trial_element+
5286 J = offset_u + stride_u*freeGlobal_u[eN_global*nDOF_trial_element+
5288 jacIndex = I+J*nFreeVDOF_global;
5291 elementBoundaryFluxJacobian[ebN*2*nQuadraturePoints_elementBoundary*nDOF_trial_element +
5292 0*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5293 k*nDOF_trial_element+
5296 w_dS[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element +
5297 ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5298 k*nDOF_test_element+
5310 int nElements_global,
5311 int nExteriorElementBoundaries_global,
5312 int nElementBoundaries_element,
5313 int nQuadraturePoints_elementBoundary,
5314 int nDOF_test_element,
5315 int nDOF_trial_element,
5320 int nFreeVDOF_global,
5321 int* exteriorElementBoundaries,
5322 int* elementBoundaryElements,
5323 int* elementBoundaryLocalElementBoundaries,
5324 int* nFreeDOF_element_r,
5327 int* nFreeDOF_element_u,
5330 double* elementBoundaryFluxJacobian_eb,
5334 int ebNE,ebN,eN_global,ebN_element,ebN_eN,eN_ebN,ii,i,k,jj,j,I,J,jacIndex;
5335 for (ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
5337 ebN = exteriorElementBoundaries[ebNE];
5338 eN_global = elementBoundaryElements[ebN*2+0];
5339 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
5340 for (ebN_eN=0;ebN_eN<nElementBoundaries_element;ebN_eN++)
5347 eN_ebN = elementNeighbors[eN_global*nElementBoundaries_element+ebN_eN];
5348 for(ii=0;ii<nFreeDOF_element_r[eN_global];ii++)
5350 i = freeLocal_r[eN_global*nDOF_test_element+
5352 I = offset_r + stride_r*freeGlobal_r[eN_global*nDOF_test_element+
5354 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
5358 for(jj=0;jj<nFreeDOF_element_u[eN_ebN];jj++)
5360 j = freeLocal_u[eN_ebN*nDOF_trial_element+
5362 J = offset_u + stride_u*freeGlobal_u[eN_ebN*nDOF_trial_element+
5364 jacIndex = I+J*nFreeVDOF_global;
5367 elementBoundaryFluxJacobian_eb[ebN*2*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element +
5368 0*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5369 ebN_eN*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5370 k*nDOF_trial_element+
5373 w_dS[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element +
5374 ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5375 k*nDOF_test_element+
5400 int nElements_global,
5401 int nExteriorElementBoundaries_global,
5402 int nElementBoundaries_element,
5403 int nQuadraturePoints_elementBoundary,
5404 int nDOF_test_element,
5405 int nDOF_trial_element,
5410 int nFreeVDOF_global,
5411 int* exteriorElementBoundaries,
5412 int* elementBoundaryElements,
5413 int* elementBoundaryLocalElementBoundaries,
5414 int* nFreeDOF_element_r,
5417 int* nFreeDOF_element_u,
5420 double* elementBoundaryFluxJacobian_eb,
5424 int ebNE,ebN,eN_global,ebN_element,ebN_eN,eN_ebN,ii,i,k,jj,j,I,J,jacIndex;
5425 for (ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
5427 ebN = exteriorElementBoundaries[ebNE];
5428 eN_global = elementBoundaryElements[ebN*2+0];
5429 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
5430 for (ebN_eN=0;ebN_eN<nElementBoundaries_element;ebN_eN++)
5437 eN_ebN = elementNeighbors[eN_global*nElementBoundaries_element+ebN_eN];
5438 for(ii=0;ii<nFreeDOF_element_r[eN_global];ii++)
5440 i = freeLocal_r[eN_global*nDOF_test_element+
5442 I = offset_r + stride_r*freeGlobal_r[eN_global*nDOF_test_element+
5444 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
5448 for(jj=0;jj<nFreeDOF_element_u[eN_ebN];jj++)
5450 j = freeLocal_u[eN_ebN*nDOF_trial_element+
5452 J = offset_u + stride_u*freeGlobal_u[eN_ebN*nDOF_trial_element+
5454 jacIndex = I+J*nFreeVDOF_global;
5457 elementBoundaryFluxJacobian_eb[ebN*2*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element +
5458 0*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5459 ebN_eN*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5460 k*nDOF_trial_element+
5463 w_dS[ebNE*nQuadraturePoints_elementBoundary*nDOF_test_element+
5464 k*nDOF_test_element+
5487 int nQuadraturePoints_elementBoundary,
5488 int nDOF_test_element,
5489 int nDOF_trial_element,
5494 int nFreeVDOF_global,
5495 int* exteriorElementBoundaries,
5496 int* elementBoundaryElements,
5497 int* elementBoundaryLocalElementBoundaries,
5498 int* nFreeDOF_element_r,
5501 int* nFreeDOF_element_u,
5504 double* elementBoundaryFluxJacobian,
5508 int ebNE,ebN,eN_global,ebN_element,ii,i,k,jj,j,I,J,jacIndex;
5509 for (ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
5511 ebN = exteriorElementBoundaries[ebNE];
5512 eN_global = elementBoundaryElements[ebN*2+0];
5513 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
5514 for(ii=0;ii<nFreeDOF_element_r[eN_global];ii++)
5516 i = freeLocal_r[eN_global*nDOF_test_element+
5518 I = offset_r + stride_r*freeGlobal_r[eN_global*nDOF_test_element+
5520 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
5522 for(jj=0;jj<nFreeDOF_element_u[eN_global];jj++)
5524 j = freeLocal_u[eN_global*nDOF_trial_element+
5526 J = offset_u + stride_u*freeGlobal_u[eN_global*nDOF_trial_element+
5528 jacIndex = I+J*nFreeVDOF_global;
5531 elementBoundaryFluxJacobian[ebNE*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5532 k*nDOF_trial_element+
5535 w_dS[ebNE*nQuadraturePoints_elementBoundary*nDOF_test_element+
5536 k*nDOF_test_element+
5548 int nDOF_test_element,
5549 int nDOF_trial_element,
5550 int* nFreeDOF_element_r,
5552 int* nFreeDOF_element_u,
5554 int* csrRowIndeces_ru,
5555 int* csrColumnOffsets_ru,
5556 double* elementJacobian,
5557 double* globalJacobian)
5559 int eN,ii,jj,i,j,jacIndex,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element;
5560 for (eN=0;eN<nElements_global;eN++)
5561 for (ii=0;ii<nFreeDOF_element_r[eN];ii++)
5563 i = freeLocal_r[eN*nDOF_test_element+
5565 for (jj=0;jj<nFreeDOF_element_u[eN];jj++)
5567 j = freeLocal_u[eN*nDOF_trial_element+
5569 jacIndex = csrRowIndeces_ru[eN*nDOF_test_element+
5572 csrColumnOffsets_ru[eN*nDOF_test_X_trial_element+
5573 ii*nDOF_trial_element+
5575 globalJacobian[jacIndex]
5577 elementJacobian[eN*nDOF_test_X_trial_element +
5578 i*nDOF_trial_element +
5588 int nElements_global,
5589 int nElementBoundaries_element,
5590 int nDOF_test_element,
5591 int nDOF_trial_element,
5592 int* nFreeDOF_element_r,
5594 int* nFreeDOF_element_u,
5596 int* csrRowIndeces_ru,
5597 int* csrColumnOffsets_eb_ru,
5598 double* elementJacobian_eb,
5599 double* globalJacobian)
5601 int eN,ebN,eN_ebN,ii,jj,i,j,jacIndex,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element;
5602 for (eN=0;eN<nElements_global;eN++)
5603 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
5612 eN_ebN = elementNeighbors[eN*nElementBoundaries_element+ebN];
5614 for (ii=0;ii<nFreeDOF_element_r[eN];ii++)
5616 i = freeLocal_r[eN*nDOF_test_element+
5618 for (jj=0;jj<nFreeDOF_element_u[eN_ebN];jj++)
5620 j = freeLocal_u[eN_ebN*nDOF_trial_element+
5622 jacIndex = csrRowIndeces_ru[eN*nDOF_test_element+
5625 csrColumnOffsets_eb_ru[eN*nElementBoundaries_element*nDOF_test_X_trial_element+
5626 ebN*nDOF_test_X_trial_element+
5627 ii*nDOF_trial_element+
5629 globalJacobian[jacIndex]
5631 elementJacobian_eb[eN*nElementBoundaries_element*nDOF_test_X_trial_element +
5632 ebN*nDOF_test_X_trial_element+
5633 i*nDOF_trial_element +
5644 int nElementBoundaries_element,
5645 int nQuadraturePoints_elementBoundary,
5646 int nDOF_test_element,
5647 int nDOF_trial_element,
5648 int* interiorElementBoundaries,
5649 int* elementBoundaryElements,
5650 int* elementBoundaryLocalElementBoundaries,
5651 int* nFreeDOF_element_r,
5653 int* nFreeDOF_element_u,
5655 int* csrRowIndeces_ru,
5656 int* csrColumnOffsets_eb_ru,
5657 double* elementBoundaryFluxJacobian,
5661 int ebNI,ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,ii,i,k,jj,j,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element,jacIndex;
5662 for (ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
5664 ebN = interiorElementBoundaries[ebNI];
5665 left_eN_global = elementBoundaryElements[ebN*2+0];
5666 right_eN_global = elementBoundaryElements[ebN*2+1];
5667 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
5668 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
5669 for(ii=0;ii<nFreeDOF_element_r[left_eN_global];ii++)
5671 i = freeLocal_r[left_eN_global*nDOF_test_element+ii];
5672 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
5674 for(jj=0;jj<nFreeDOF_element_u[left_eN_global];jj++)
5676 j = freeLocal_u[left_eN_global*nDOF_trial_element+
5678 jacIndex = csrRowIndeces_ru[left_eN_global*nDOF_test_element+
5681 csrColumnOffsets_eb_ru[ebN*4*nDOF_test_X_trial_element +
5682 0*2*nDOF_test_X_trial_element +
5683 0*nDOF_test_X_trial_element +
5684 ii*nDOF_trial_element +
5688 elementBoundaryFluxJacobian[ebN*2*nQuadraturePoints_elementBoundary*nDOF_trial_element +
5689 0*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5690 k*nDOF_trial_element+
5693 w_dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element +
5694 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5695 k*nDOF_test_element+
5698 for(jj=0;jj<nFreeDOF_element_u[right_eN_global];jj++)
5700 j = freeLocal_u[right_eN_global*nDOF_trial_element+
5702 jacIndex = csrRowIndeces_ru[left_eN_global*nDOF_test_element+
5705 csrColumnOffsets_eb_ru[ebN*4*nDOF_test_X_trial_element+
5706 0*2*nDOF_test_X_trial_element+
5707 1*nDOF_test_X_trial_element+
5708 ii*nDOF_trial_element+
5712 elementBoundaryFluxJacobian[ebN*2*nQuadraturePoints_elementBoundary*nDOF_trial_element +
5713 1*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5714 k*nDOF_trial_element+
5717 w_dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element +
5718 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5719 k*nDOF_test_element+
5724 for(ii=0;ii<nFreeDOF_element_r[right_eN_global];ii++)
5726 i = freeLocal_r[right_eN_global*nDOF_test_element+
5728 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
5730 for(jj=0;jj<nFreeDOF_element_u[left_eN_global];jj++)
5732 j = freeLocal_u[left_eN_global*nDOF_trial_element+
5734 jacIndex = csrRowIndeces_ru[right_eN_global*nDOF_test_element+
5737 csrColumnOffsets_eb_ru[ebN*4*nDOF_test_X_trial_element+
5738 1*2*nDOF_test_X_trial_element+
5739 0*nDOF_test_X_trial_element+
5740 ii*nDOF_trial_element+
5744 elementBoundaryFluxJacobian[ebN*2*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5745 0*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5746 k*nDOF_trial_element+
5749 w_dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5750 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5751 k*nDOF_test_element+
5754 for(jj=0;jj<nFreeDOF_element_u[right_eN_global];jj++)
5756 j = freeLocal_u[right_eN_global*nDOF_trial_element+
5758 jacIndex = csrRowIndeces_ru[right_eN_global*nDOF_test_element+
5761 csrColumnOffsets_eb_ru[ebN*4*nDOF_test_X_trial_element+
5762 1*2*nDOF_test_X_trial_element+
5763 1*nDOF_test_X_trial_element+
5764 ii*nDOF_trial_element+
5768 elementBoundaryFluxJacobian[ebN*2*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5769 1*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5770 k*nDOF_trial_element+
5772 w_dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5773 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5774 k*nDOF_test_element+
5786 int nElementBoundaries_element,
5787 int nQuadraturePoints_elementBoundary,
5788 int nDOF_test_element,
5789 int nDOF_trial_element,
5790 int* exteriorElementBoundaries,
5791 int* elementBoundaryElements,
5792 int* elementBoundaryLocalElementBoundaries,
5793 int* nFreeDOF_element_r,
5795 int* nFreeDOF_element_u,
5797 int* csrRowIndeces_ru,
5798 int* csrColumnOffsets_eb_ru,
5799 double* elementBoundaryFluxJacobian,
5803 int ebNE,ebN,eN_global,ebN_element,ii,i,k,jj,j,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element,jacIndex;
5804 for (ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
5806 ebN = exteriorElementBoundaries[ebNE];
5807 eN_global = elementBoundaryElements[ebN*2+0];
5808 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
5809 for(ii=0;ii<nFreeDOF_element_r[eN_global];ii++)
5811 i = freeLocal_r[eN_global*nDOF_test_element+ii];
5812 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
5814 for(jj=0;jj<nFreeDOF_element_u[eN_global];jj++)
5816 j = freeLocal_u[eN_global*nDOF_trial_element+
5818 jacIndex = csrRowIndeces_ru[eN_global*nDOF_test_element+
5821 csrColumnOffsets_eb_ru[ebN*4*nDOF_test_X_trial_element +
5822 0*2*nDOF_test_X_trial_element +
5823 0*nDOF_test_X_trial_element +
5824 ii*nDOF_trial_element +
5828 elementBoundaryFluxJacobian[ebN*2*nQuadraturePoints_elementBoundary*nDOF_trial_element +
5829 0*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5830 k*nDOF_trial_element+
5833 w_dS[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element +
5834 ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5835 k*nDOF_test_element+
5846 int nQuadraturePoints_elementBoundary,
5847 int nDOF_test_element,
5848 int nDOF_trial_element,
5849 int* exteriorElementBoundaries,
5850 int* elementBoundaryElements,
5851 int* elementBoundaryLocalElementBoundaries,
5852 int* nFreeDOF_element_r,
5854 int* nFreeDOF_element_u,
5856 int* csrRowIndeces_ru,
5857 int* csrColumnOffsets_eb_ru,
5858 double* elementBoundaryFluxJacobian,
5862 int ebNE,ebN,eN_global,ii,i,k,jj,j,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element,jacIndex;
5863 for (ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
5865 ebN = exteriorElementBoundaries[ebNE];
5866 eN_global = elementBoundaryElements[ebN*2+0];
5867 for(ii=0;ii<nFreeDOF_element_r[eN_global];ii++)
5869 i = freeLocal_r[eN_global*nDOF_test_element+ii];
5870 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
5872 for(jj=0;jj<nFreeDOF_element_u[eN_global];jj++)
5874 j = freeLocal_u[eN_global*nDOF_trial_element+
5876 jacIndex = csrRowIndeces_ru[eN_global*nDOF_test_element+
5879 csrColumnOffsets_eb_ru[ebN*4*nDOF_test_X_trial_element +
5880 0*2*nDOF_test_X_trial_element +
5881 0*nDOF_test_X_trial_element +
5882 ii*nDOF_trial_element +
5886 elementBoundaryFluxJacobian[ebNE*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5887 k*nDOF_trial_element+
5890 w_dS[ebNE*nQuadraturePoints_elementBoundary*nDOF_test_element+
5891 k*nDOF_test_element+
5903 int nInteriorElementBoundaries_global,
5904 int nElementBoundaries_element,
5905 int nQuadraturePoints_elementBoundary,
5906 int nDOF_test_element,
5907 int nDOF_trial_element,
5908 int* interiorElementBoundaries,
5909 int* elementBoundaryElements,
5910 int* elementBoundaryLocalElementBoundaries,
5911 int* nFreeDOF_element_r,
5913 int* nFreeDOF_element_u,
5915 int* csrRowIndeces_ru,
5916 int* csrColumnOffsets_eb_eNebN_ru,
5917 double* elementBoundaryFluxJacobian_eb,
5921 int ebNI,ebN,ebN_element,left_eN_ebN,right_eN_ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,ii,i,k,jj,j,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element,jacIndex;
5922 for (ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
5924 ebN = interiorElementBoundaries[ebNI];
5925 left_eN_global = elementBoundaryElements[ebN*2+0];
5926 right_eN_global = elementBoundaryElements[ebN*2+1];
5927 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
5928 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
5929 for(ebN_element=0;ebN_element<nElementBoundaries_element;ebN_element++)
5931 left_eN_ebN = elementNeighbors[left_eN_global*nElementBoundaries_element+ebN_element];
5932 right_eN_ebN = elementNeighbors[right_eN_global*nElementBoundaries_element+ebN_element];
5933 for(ii=0;ii<nFreeDOF_element_r[left_eN_global];ii++)
5935 i = freeLocal_r[left_eN_global*nDOF_test_element+ii];
5936 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
5938 if(left_eN_ebN >= 0)
5939 for(jj=0;jj<nFreeDOF_element_u[left_eN_ebN];jj++)
5941 j = freeLocal_u[left_eN_ebN*nDOF_trial_element+
5943 jacIndex = csrRowIndeces_ru[left_eN_global*nDOF_test_element+
5946 csrColumnOffsets_eb_eNebN_ru[ebN*4*nElementBoundaries_element*nDOF_test_X_trial_element +
5947 0*2*nElementBoundaries_element*nDOF_test_X_trial_element +
5948 0*nElementBoundaries_element*nDOF_test_X_trial_element +
5949 ebN_element*nDOF_test_X_trial_element+
5950 ii*nDOF_trial_element +
5954 elementBoundaryFluxJacobian_eb[ebN*2*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element +
5955 0*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5956 ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5957 k*nDOF_trial_element+
5960 w_dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element +
5961 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
5962 k*nDOF_test_element+
5976 if(right_eN_ebN >= 0)
5977 for(jj=0;jj<nFreeDOF_element_u[right_eN_ebN];jj++)
5979 j = freeLocal_u[right_eN_ebN*nDOF_trial_element+
5981 jacIndex = csrRowIndeces_ru[left_eN_global*nDOF_test_element+
5984 csrColumnOffsets_eb_eNebN_ru[ebN*4*nElementBoundaries_element*nDOF_test_X_trial_element+
5985 0*2*nElementBoundaries_element*nDOF_test_X_trial_element+
5986 1*nElementBoundaries_element*nDOF_test_X_trial_element+
5987 ebN_element*nDOF_test_X_trial_element+
5988 ii*nDOF_trial_element+
5992 elementBoundaryFluxJacobian_eb[ebN*2*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element +
5993 1*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5994 ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
5995 k*nDOF_trial_element+
5998 w_dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element +
5999 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
6000 k*nDOF_test_element+
6016 for(ii=0;ii<nFreeDOF_element_r[right_eN_global];ii++)
6018 i = freeLocal_r[right_eN_global*nDOF_test_element+
6020 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
6022 if(left_eN_ebN >= 0)
6023 for(jj=0;jj<nFreeDOF_element_u[left_eN_ebN];jj++)
6025 j = freeLocal_u[left_eN_ebN*nDOF_trial_element+
6027 jacIndex = csrRowIndeces_ru[right_eN_global*nDOF_test_element+
6030 csrColumnOffsets_eb_eNebN_ru[ebN*4*nElementBoundaries_element*nDOF_test_X_trial_element+
6031 1*2*nElementBoundaries_element*nDOF_test_X_trial_element+
6032 0*nElementBoundaries_element*nDOF_test_X_trial_element+
6033 ebN_element*nDOF_test_X_trial_element+
6034 ii*nDOF_trial_element+
6038 elementBoundaryFluxJacobian_eb[ebN*2*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
6039 0*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
6040 ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
6041 k*nDOF_trial_element+
6044 w_dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
6045 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
6046 k*nDOF_test_element+
6060 if(right_eN_ebN >= 0)
6061 for(jj=0;jj<nFreeDOF_element_u[right_eN_ebN];jj++)
6063 j = freeLocal_u[right_eN_ebN*nDOF_trial_element+
6065 jacIndex = csrRowIndeces_ru[right_eN_global*nDOF_test_element+
6068 csrColumnOffsets_eb_eNebN_ru[ebN*4*nElementBoundaries_element*nDOF_test_X_trial_element+
6069 1*2*nElementBoundaries_element*nDOF_test_X_trial_element+
6070 1*nElementBoundaries_element*nDOF_test_X_trial_element+
6071 ebN_element*nDOF_test_X_trial_element+
6072 ii*nDOF_trial_element+
6076 elementBoundaryFluxJacobian_eb[ebN*2*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
6077 1*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
6078 ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
6079 k*nDOF_trial_element+
6081 w_dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
6082 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
6083 k*nDOF_test_element+
6107 int nExteriorElementBoundaries_global,
6108 int nElementBoundaries_element,
6109 int nQuadraturePoints_elementBoundary,
6110 int nDOF_test_element,
6111 int nDOF_trial_element,
6112 int* exteriorElementBoundaries,
6113 int* elementBoundaryElements,
6114 int* elementBoundaryLocalElementBoundaries,
6115 int* nFreeDOF_element_r,
6117 int* nFreeDOF_element_u,
6119 int* csrRowIndeces_ru,
6120 int* csrColumnOffsets_eb_eNebN_ru,
6121 double* elementBoundaryFluxJacobian_eb,
6125 int ebNE,ebN,ebN_eN,eN_ebN,eN_global,ebN_element,ii,i,k,jj,j,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element,jacIndex;
6126 for (ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
6128 ebN = exteriorElementBoundaries[ebNE];
6129 eN_global = elementBoundaryElements[ebN*2+0];
6130 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
6131 for(ebN_eN=0;ebN_eN<nElementBoundaries_element;ebN_eN++)
6133 eN_ebN = elementNeighbors[eN_global*nElementBoundaries_element+ebN_eN];
6134 for(ii=0;ii<nFreeDOF_element_r[eN_global];ii++)
6136 i = freeLocal_r[eN_global*nDOF_test_element+ii];
6137 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
6140 for(jj=0;jj<nFreeDOF_element_u[eN_ebN];jj++)
6142 j = freeLocal_u[eN_ebN*nDOF_trial_element+
6144 jacIndex = csrRowIndeces_ru[eN_global*nDOF_test_element+
6147 csrColumnOffsets_eb_eNebN_ru[ebN*4*nElementBoundaries_element*nDOF_test_X_trial_element +
6148 0*2*nElementBoundaries_element*nDOF_test_X_trial_element +
6149 0*nElementBoundaries_element*nDOF_test_X_trial_element +
6150 ebN_eN*nDOF_test_X_trial_element +
6151 ii*nDOF_trial_element +
6155 elementBoundaryFluxJacobian_eb[ebN*2*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element +
6156 0*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
6157 ebN_eN*nQuadraturePoints_elementBoundary*nDOF_trial_element+
6158 k*nDOF_trial_element+
6161 w_dS[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element +
6162 ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
6163 k*nDOF_test_element+
6188 int nExteriorElementBoundaries_global,
6189 int nElementBoundaries_element,
6190 int nQuadraturePoints_elementBoundary,
6191 int nDOF_test_element,
6192 int nDOF_trial_element,
6193 int* exteriorElementBoundaries,
6194 int* elementBoundaryElements,
6195 int* elementBoundaryLocalElementBoundaries,
6196 int* nFreeDOF_element_r,
6198 int* nFreeDOF_element_u,
6200 int* csrRowIndeces_ru,
6201 int* csrColumnOffsets_eb_eNebN_ru,
6202 double* elementBoundaryFluxJacobian_eb,
6206 int ebNE,ebN,ebN_eN,eN_ebN,eN_global,ebN_element,ii,i,k,jj,j,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element,jacIndex;
6207 for (ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
6209 ebN = exteriorElementBoundaries[ebNE];
6210 eN_global = elementBoundaryElements[ebN*2+0];
6211 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
6212 for(ebN_eN=0;ebN_eN<nElementBoundaries_element;ebN_eN++)
6214 eN_ebN = elementNeighbors[eN_global*nElementBoundaries_element+ebN_eN];
6215 for(ii=0;ii<nFreeDOF_element_r[eN_global];ii++)
6217 i = freeLocal_r[eN_global*nDOF_test_element+ii];
6218 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
6221 for(jj=0;jj<nFreeDOF_element_u[eN_ebN];jj++)
6223 j = freeLocal_u[eN_ebN*nDOF_trial_element+
6225 jacIndex = csrRowIndeces_ru[eN_global*nDOF_test_element+
6228 csrColumnOffsets_eb_eNebN_ru[ebN*4*nElementBoundaries_element*nDOF_test_X_trial_element +
6229 0*2*nElementBoundaries_element*nDOF_test_X_trial_element +
6230 0*nElementBoundaries_element*nDOF_test_X_trial_element +
6231 ebN_eN*nDOF_test_X_trial_element +
6232 ii*nDOF_trial_element +
6236 elementBoundaryFluxJacobian_eb[ebN*2*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element +
6237 0*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
6238 ebN_eN*nQuadraturePoints_elementBoundary*nDOF_trial_element+
6239 k*nDOF_trial_element+
6242 w_dS[ebNE*nQuadraturePoints_elementBoundary*nDOF_test_element+
6243 k*nDOF_test_element+
6266 int nElementBoundaries_element,
6267 int nQuadraturePoints_elementBoundary,
6268 int nDOF_test_element,
6269 int nDOF_trial_element,
6270 int* interiorElementBoundaries,
6271 int* elementBoundaryElements,
6272 int* elementBoundaryLocalElementBoundaries,
6273 int* nFreeDOF_element_r,
6275 int* nFreeDOF_element_u,
6277 int* csrRowIndeces_ru,
6278 int* csrColumnOffsets_eb_ru,
6279 double* elementBoundaryFluxJacobian_2sided,
6283 int ebNI,ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,ii,i,k,jj,j,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element,jacIndex;
6284 for (ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
6286 ebN = interiorElementBoundaries[ebNI];
6287 left_eN_global = elementBoundaryElements[ebN*2+0];
6288 right_eN_global = elementBoundaryElements[ebN*2+1];
6289 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
6290 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
6292 for(ii=0;ii<nFreeDOF_element_r[left_eN_global];ii++)
6294 i = freeLocal_r[left_eN_global*nDOF_test_element+ii];
6295 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
6297 for(jj=0;jj<nFreeDOF_element_u[left_eN_global];jj++)
6299 j = freeLocal_u[left_eN_global*nDOF_trial_element+
6301 jacIndex = csrRowIndeces_ru[left_eN_global*nDOF_test_element+
6304 csrColumnOffsets_eb_ru[ebN*4*nDOF_test_X_trial_element +
6305 0*2*nDOF_test_X_trial_element +
6306 0*nDOF_test_X_trial_element +
6307 ii*nDOF_trial_element +
6311 elementBoundaryFluxJacobian_2sided[ebN*2*2*nQuadraturePoints_elementBoundary*nDOF_trial_element +
6312 0*2*nQuadraturePoints_elementBoundary*nDOF_trial_element +
6313 0*nQuadraturePoints_elementBoundary*nDOF_trial_element+
6314 k*nDOF_trial_element+
6317 w_dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element +
6318 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
6319 k*nDOF_test_element+
6322 for(jj=0;jj<nFreeDOF_element_u[right_eN_global];jj++)
6324 j = freeLocal_u[right_eN_global*nDOF_trial_element+
6326 jacIndex = csrRowIndeces_ru[left_eN_global*nDOF_test_element+
6329 csrColumnOffsets_eb_ru[ebN*4*nDOF_test_X_trial_element+
6330 0*2*nDOF_test_X_trial_element+
6331 1*nDOF_test_X_trial_element+
6332 ii*nDOF_trial_element+
6336 elementBoundaryFluxJacobian_2sided[ebN*2*2*nQuadraturePoints_elementBoundary*nDOF_trial_element +
6337 0*2*nQuadraturePoints_elementBoundary*nDOF_trial_element +
6338 1*nQuadraturePoints_elementBoundary*nDOF_trial_element+
6339 k*nDOF_trial_element+
6342 w_dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element +
6343 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
6344 k*nDOF_test_element+
6350 for(ii=0;ii<nFreeDOF_element_r[right_eN_global];ii++)
6352 i = freeLocal_r[right_eN_global*nDOF_test_element+
6354 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
6356 for(jj=0;jj<nFreeDOF_element_u[left_eN_global];jj++)
6358 j = freeLocal_u[left_eN_global*nDOF_trial_element+
6360 jacIndex = csrRowIndeces_ru[right_eN_global*nDOF_test_element+
6363 csrColumnOffsets_eb_ru[ebN*4*nDOF_test_X_trial_element+
6364 1*2*nDOF_test_X_trial_element+
6365 0*nDOF_test_X_trial_element+
6366 ii*nDOF_trial_element+
6370 elementBoundaryFluxJacobian_2sided[ebN*2*2*nQuadraturePoints_elementBoundary*nDOF_trial_element+
6371 1*2*nQuadraturePoints_elementBoundary*nDOF_trial_element +
6372 0*nQuadraturePoints_elementBoundary*nDOF_trial_element+
6373 k*nDOF_trial_element+
6376 w_dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
6377 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
6378 k*nDOF_test_element+
6381 for(jj=0;jj<nFreeDOF_element_u[right_eN_global];jj++)
6383 j = freeLocal_u[right_eN_global*nDOF_trial_element+
6385 jacIndex = csrRowIndeces_ru[right_eN_global*nDOF_test_element+
6388 csrColumnOffsets_eb_ru[ebN*4*nDOF_test_X_trial_element+
6389 1*2*nDOF_test_X_trial_element+
6390 1*nDOF_test_X_trial_element+
6391 ii*nDOF_trial_element+
6395 elementBoundaryFluxJacobian_2sided[ebN*2*2*nQuadraturePoints_elementBoundary*nDOF_trial_element+
6396 1*2*nQuadraturePoints_elementBoundary*nDOF_trial_element +
6397 1*nQuadraturePoints_elementBoundary*nDOF_trial_element+
6398 k*nDOF_trial_element+
6400 w_dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
6401 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
6402 k*nDOF_test_element+
6414 int nQuadraturePoints_element,
6415 int nDOF_test_element,
6417 double* abs_det_jac,
6422 for (eN=0;eN<nElements_global;eN++)
6423 for (k=0;k<nQuadraturePoints_element;k++)
6424 for (i=0;i<nDOF_test_element;i++)
6425 w_dV[eN*nQuadraturePoints_element*nDOF_test_element+
6426 k*nDOF_test_element+
6429 w[eN*nQuadraturePoints_element*nDOF_test_element+
6430 k*nDOF_test_element+
6435 abs_det_jac[eN*nQuadraturePoints_element+
6443 int nQuadraturePoints_element,
6444 int nDOF_test_element,
6447 double* abs_det_jac,
6452 for (eN=0;eN<nElements_global;eN++)
6453 for (k=0;k<nQuadraturePoints_element;k++)
6454 for (i=0;i<nDOF_test_element;i++)
6455 for (I=0;I<nSpace;I++)
6456 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace+
6457 k*nDOF_test_element*nSpace+
6461 grad_w[eN*nQuadraturePoints_element*nDOF_test_element*nSpace+
6462 k*nDOF_test_element*nSpace+
6468 abs_det_jac[eN*nQuadraturePoints_element+
6474 int nQuadraturePoints_element,
6475 int nDOF_test_element,
6478 double* abs_det_jac,
6483 for (eN=0;eN<nElements_global;eN++)
6484 for (k=0;k<nQuadraturePoints_element;k++)
6485 for (i=0;i<nDOF_test_element;i++)
6486 for (I=0;I<nSpace;I++)
6487 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace+
6488 k*nDOF_test_element*nSpace+
6492 grad_w[eN*nQuadraturePoints_element*nDOF_test_element*nSpace+
6493 k*nDOF_test_element*nSpace+
6502 int nQuadraturePoints_element,
6503 int nDOF_test_element,
6506 double* abs_det_jac,
6510 int eN,i,k,I,J,nSpace2=nSpace*nSpace;
6511 for (eN=0;eN<nElements_global;eN++)
6512 for (k=0;k<nQuadraturePoints_element;k++)
6513 for (i=0;i<nDOF_test_element;i++)
6514 for (I=0;I<nSpace;I++)
6515 for (J=0;J<nSpace;J++)
6516 Hess_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace2+
6517 k*nDOF_test_element*nSpace2+
6522 Hess_w[eN*nQuadraturePoints_element*nDOF_test_element*nSpace2+
6523 k*nDOF_test_element*nSpace2+
6530 abs_det_jac[eN*nQuadraturePoints_element+
6538 int nQuadraturePoints_element,
6539 int nDOF_trial_element,
6540 int nDOF_test_element,
6545 int eN,k,i,j,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element;
6546 for (eN=0;eN<nElements_global;eN++)
6547 for (k=0;k<nQuadraturePoints_element;k++)
6548 for (i=0;i<nDOF_test_element;i++)
6549 for (j=0;j<nDOF_trial_element;j++)
6550 v_X_w_dV[eN*nQuadraturePoints_element*nDOF_test_X_trial_element +
6551 k*nDOF_test_X_trial_element+
6552 j*nDOF_test_element+
6555 v[eN*nQuadraturePoints_element*nDOF_trial_element +
6556 k*nDOF_trial_element+
6559 w_dV[eN*nQuadraturePoints_element*nDOF_test_element +
6560 k*nDOF_test_element+
6568 int nQuadraturePoints_element,
6569 int nDOF_trial_element,
6570 int nDOF_test_element,
6574 double* v_X_grad_w_dV)
6576 int eN,k,i,j,I,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element;
6577 for (eN=0;eN<nElements_global;eN++)
6578 for (k=0;k<nQuadraturePoints_element;k++)
6579 for (i=0;i<nDOF_test_element;i++)
6580 for (j=0;j<nDOF_trial_element;j++)
6581 for (I=0;I<nSpace;I++)
6582 v_X_grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_X_trial_element*nSpace +
6583 k*nDOF_test_X_trial_element*nSpace+
6584 j*nDOF_test_element*nSpace+
6588 v[eN*nQuadraturePoints_element*nDOF_trial_element +
6589 k*nDOF_trial_element+
6592 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
6593 k*nDOF_test_element*nSpace+
6602 int nQuadraturePoints_element,
6603 int nDOF_trial_element,
6604 int nDOF_test_element,
6608 double* grad_v_X_w_dV)
6610 int eN,k,i,j,I,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element;
6611 for (eN=0;eN<nElements_global;eN++)
6612 for (k=0;k<nQuadraturePoints_element;k++)
6613 for (i=0;i<nDOF_test_element;i++)
6614 for (j=0;j<nDOF_trial_element;j++)
6615 for (I=0;I<nSpace;I++)
6616 grad_v_X_w_dV[eN*nQuadraturePoints_element*nDOF_test_X_trial_element*nSpace +
6617 k*nDOF_test_X_trial_element*nSpace+
6618 j*nDOF_test_element*nSpace+
6622 grad_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace +
6623 k*nDOF_trial_element*nSpace+
6627 w_dV[eN*nQuadraturePoints_element*nDOF_test_element +
6628 k*nDOF_test_element+
6636 int nQuadraturePoints_element,
6637 int nDOF_trial_element,
6638 int nDOF_test_element,
6642 double* grad_v_X_grad_w_dV)
6644 int eN,k,i,j,I,J,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element,nSpace2=nSpace*nSpace;
6645 for (eN=0;eN<nElements_global;eN++)
6646 for (k=0;k<nQuadraturePoints_element;k++)
6647 for (i=0;i<nDOF_test_element;i++)
6648 for (j=0;j<nDOF_trial_element;j++)
6649 for (I=0;I<nSpace;I++)
6650 for (J=0;J<nSpace;J++)
6651 grad_v_X_grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_X_trial_element*nSpace2 +
6652 k*nDOF_test_X_trial_element*nSpace2+
6653 j*nDOF_test_element*nSpace2+
6658 grad_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace +
6659 k*nDOF_trial_element*nSpace+
6663 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
6664 k*nDOF_test_element*nSpace+
6673 int nElementBoundaries_element,
6674 int nElementBoundaryQuadraturePoints_elementBoundary,
6675 int nDOF_test_element,
6682 for (eN=0;eN<nElements_global;eN++)
6683 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
6684 for (k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
6685 for (i=0;i<nDOF_test_element;i++)
6687 w_dS[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_element+
6688 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_element +
6689 k*nDOF_test_element+
6692 w[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_element+
6693 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_element +
6694 k*nDOF_test_element+
6699 sqrt_det_g[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary+
6700 ebN*nElementBoundaryQuadraturePoints_elementBoundary+
6705 int nElementBoundaries_element,
6706 int nElementBoundaryQuadraturePoints_elementBoundary,
6707 int nDOF_test_element,
6714 for (eN=0;eN<nElements_global;eN++)
6715 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
6716 for (k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
6717 for (i=0;i<nDOF_test_element;i++)
6719 w_dS[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_element+
6720 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_element +
6721 k*nDOF_test_element+
6724 w[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_element+
6725 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_element +
6726 k*nDOF_test_element+
6731 sqrt_det_g[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary+
6732 ebN*nElementBoundaryQuadraturePoints_elementBoundary+
6741 int nElementBoundaries_element,
6742 int nElementBoundaryQuadraturePoints_elementBoundary,
6743 int nDOF_trial_element,
6744 int nDOF_test_element,
6749 int eN,ebN,k,i,j,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element;
6750 for (eN=0;eN<nElements_global;eN++)
6751 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
6752 for (k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
6753 for (i=0;i<nDOF_test_element;i++)
6754 for (j=0;j<nDOF_trial_element;j++)
6755 v_X_w_dS[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_X_trial_element +
6756 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_X_trial_element +
6757 k*nDOF_test_X_trial_element+
6758 j*nDOF_test_element+
6761 v[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_trial_element +
6762 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_trial_element +
6763 k*nDOF_trial_element+
6766 w_dS[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_element +
6767 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_element +
6768 k*nDOF_trial_element+
6776 int nElementBoundaries_element,
6777 int nElementBoundaryQuadraturePoints_elementBoundary,
6778 int nDOF_trial_element,
6779 int nDOF_test_element,
6783 double* grad_v_X_w_dS)
6785 int eN,ebN,k,i,j,I,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element;
6786 for (eN=0;eN<nElements_global;eN++)
6787 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
6788 for (k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
6789 for (i=0;i<nDOF_test_element;i++)
6790 for (j=0;j<nDOF_trial_element;j++)
6791 for (I=0;I<nSpace;I++)
6792 grad_v_X_w_dS[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_X_trial_element*nSpace +
6793 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_X_trial_element*nSpace +
6794 k*nDOF_test_X_trial_element*nSpace+
6795 j*nDOF_test_element*nSpace+
6799 grad_v[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace +
6800 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace +
6801 k*nDOF_trial_element*nSpace+
6805 w_dS[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_element +
6806 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_element +
6807 k*nDOF_test_element+
6815 int nDOF_test_element,
6816 int nExteriorElementBoundaries_global,
6817 const int* exteriorElementBoundariesArray,
6818 const int* elementBoundaryElementsArray,
6819 const int* elementBoundaryLocalElementBoundariesArray,
6826 for (ebNE = 0; ebNE < nExteriorElementBoundaries_global; ebNE++)
6828 for (k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
6829 for (i=0;i<nDOF_test_element;i++)
6831 w_dS[ebNE*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_element +
6832 k*nDOF_test_element+
6835 w[ebNE*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_element +
6836 k*nDOF_test_element+
6841 sqrt_det_g[ebNE*nElementBoundaryQuadraturePoints_elementBoundary+
6851 int nDOF_trial_element,
6852 int nDOF_test_element,
6853 int nExteriorElementBoundaries_global,
6854 const int* exteriorElementBoundariesArray,
6855 const int* elementBoundaryElementsArray,
6856 const int* elementBoundaryLocalElementBoundariesArray,
6861 int ebNE,k,i,j,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element;
6862 for (ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
6863 for (k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
6864 for (i=0;i<nDOF_test_element;i++)
6865 for (j=0;j<nDOF_trial_element;j++)
6866 v_X_w_dS[ebNE*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_X_trial_element +
6867 k*nDOF_test_X_trial_element+
6868 j*nDOF_test_element+
6871 v[ebNE*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_trial_element +
6872 k*nDOF_trial_element+
6875 w_dS[ebNE*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_element +
6876 k*nDOF_trial_element+
6884 int nDOF_trial_element,
6885 int nDOF_test_element,
6887 int nExteriorElementBoundaries_global,
6888 const int* exteriorElementBoundariesArray,
6889 const int* elementBoundaryElementsArray,
6890 const int* elementBoundaryLocalElementBoundariesArray,
6893 double* grad_v_X_w_dS)
6895 int ebNE,k,i,j,I,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element;
6896 for (ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
6897 for (k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
6898 for (i=0;i<nDOF_test_element;i++)
6899 for (j=0;j<nDOF_trial_element;j++)
6900 for (I=0;I<nSpace;I++)
6901 grad_v_X_w_dS[ebNE*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_X_trial_element*nSpace +
6902 k*nDOF_test_X_trial_element*nSpace+
6903 j*nDOF_test_element*nSpace+
6907 grad_v[ebNE*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace +
6908 k*nDOF_trial_element*nSpace+
6912 w_dS[ebNE*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_test_element +
6913 k*nDOF_test_element+
6922 int nQuadraturePoints_element,
6924 double* referenceWeights,
6928 for (eN=0;eN<nElements_global;eN++)
6929 for (k=0;k<nQuadraturePoints_element;k++)
6930 weights[eN*nQuadraturePoints_element+
6933 abs_det_J[eN*nQuadraturePoints_element+
6936 referenceWeights[k];
6940 int nElementBoundaries_element,
6941 int nQuadraturePoints_elementBoundary,
6943 double* referenceWeights,
6947 for (eN=0;eN<nElements_global;eN++)
6948 for (ebN=0; ebN < nElementBoundaries_element; ebN++)
6949 for (k=0;k<nQuadraturePoints_elementBoundary;k++)
6950 weights[eN*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
6951 ebN*nQuadraturePoints_elementBoundary +
6954 sqrt_det_g[eN*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
6955 ebN*nQuadraturePoints_elementBoundary +
6958 referenceWeights[k];
6962 int nExteriorElementBoundaries_global,
6964 double* referenceWeights,
6968 for (ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
6969 for (k=0;k<nQuadraturePoints_elementBoundary;k++)
6970 weights[ebNE*nQuadraturePoints_elementBoundary +
6973 sqrt_det_g[ebNE*nQuadraturePoints_elementBoundary +
6976 referenceWeights[k];
6983 int nQuadraturePoints_element,
6984 int nDOF_trial_element,
6992 memset(
u,0,
sizeof(
double)*nElements_global*nQuadraturePoints_element*nComponents);
6993 for (eN=0;eN<nElements_global;eN++)
6994 for (k=0;k<nQuadraturePoints_element;k++)
6995 for (j=0;j<nDOF_trial_element;j++)
6996 for (t=0;t<nComponents;t++)
6997 u[eN*nQuadraturePoints_element*nComponents+
7001 dof[l2g[eN*nDOF_trial_element+
7005 v[eN*nQuadraturePoints_element*nDOF_trial_element+
7006 k*nDOF_trial_element+
7014 int nQuadraturePoints_element,
7015 int nDOF_trial_element,
7024 memset(grad_u,0,
sizeof(
double)*nElements_global*nQuadraturePoints_element*nComponents*nSpace);
7025 for (eN=0;eN<nElements_global;eN++)
7026 for (k=0;k<nQuadraturePoints_element;k++)
7027 for (j=0;j<nDOF_trial_element;j++)
7028 for (t=0;t<nComponents;t++)
7029 for (I=0;I<nSpace;I++)
7030 grad_u[eN*nQuadraturePoints_element*nComponents*nSpace+
7031 k*nComponents*nSpace+
7035 dof[l2g[eN*nDOF_trial_element+
7039 grad_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace+
7040 k*nDOF_trial_element*nSpace+
7046 int nQuadraturePoints_element,
7047 int nDOF_trial_element,
7055 int eN,k,j,t,I,J,nSpace2=nSpace*nSpace;
7056 memset(Hessian_u,0,
sizeof(
double)*nElements_global*nQuadraturePoints_element*nComponents*nSpace2);
7057 for (eN=0;eN<nElements_global;eN++)
7058 for (k=0;k<nQuadraturePoints_element;k++)
7059 for (j=0;j<nDOF_trial_element;j++)
7060 for (t=0;t<nComponents;t++)
7061 for (I=0;I<nSpace;I++)
7062 for (J=0;J<nSpace;J++)
7063 Hessian_u[eN*nQuadraturePoints_element*nComponents*nSpace2+
7064 k*nComponents*nSpace2+
7069 dof[l2g[eN*nDOF_trial_element+
7073 Hessian_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace2+
7074 k*nDOF_trial_element*nSpace2+
7125 int nQuadraturePoints_element,
7126 int nDOF_trial_element,
7127 int nDOF_test_element,
7132 double* grad_v_X_grad_w_dV,
7133 double* grad_u_X_grad_w_dV)
7135 int eN,k,j,i,I,J,t,nSpace2=nSpace*nSpace;
7136 int nDOF_test_X_trial_element = nDOF_test_element*nDOF_trial_element;
7137 memset(grad_u_X_grad_w_dV,0,
sizeof(
double)*nElements_global*nQuadraturePoints_element*nDOF_test_element*nComponents*nSpace2);
7138 for(eN=0;eN<nElements_global;eN++)
7139 for(k=0;k<nQuadraturePoints_element;k++)
7140 for(j=0;j<nDOF_trial_element;j++)
7141 for(i=0;i<nDOF_test_element;i++)
7142 for (t=0;t<nComponents;t++)
7143 for(I=0;I<nSpace;I++)
7144 for(J=0;J<nSpace;J++)
7145 grad_u_X_grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nComponents*nSpace2+
7146 k*nDOF_test_element*nComponents*nSpace2 +
7147 i*nComponents*nSpace2 +
7152 dof[l2g[eN*nDOF_trial_element+
7156 grad_v_X_grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_X_trial_element*nSpace2 +
7157 k*nDOF_test_X_trial_element*nSpace2 +
7158 j*nDOF_test_element*nSpace2 +
7168 int nElementBoundaries_element,
7169 int nQuadraturePoints_elementBoundary,
7170 int nDOF_trial_element,
7178 memset(
u,0,
sizeof(
double)*nElements_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nComponents);
7179 for(eN=0;eN<nElements_global;eN++)
7180 for(ebN=0;ebN<nElementBoundaries_element;ebN++)
7181 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
7182 for(j=0;j<nDOF_trial_element;j++)
7183 for(t=0;t<nComponents;t++)
7184 u[eN*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nComponents+
7185 ebN*nQuadraturePoints_elementBoundary*nComponents+
7189 dof[l2g[eN*nDOF_trial_element+j]*nComponents+
7192 v[eN*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
7193 ebN*nQuadraturePoints_elementBoundary*nDOF_trial_element+
7194 k*nDOF_trial_element+
7203 int nElementBoundaries_element,
7204 int nQuadraturePoints_elementBoundary,
7205 int nDOF_trial_element,
7214 memset(grad_u,0,
sizeof(
double)*nElements_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nComponents*nSpace);
7215 for(eN=0;eN<nElements_global;eN++)
7216 for(ebN=0;ebN<nElementBoundaries_element;ebN++)
7217 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
7218 for(j=0;j<nDOF_trial_element;j++)
7219 for(t=0;t<nComponents;t++)
7220 for(I=0;I<nSpace;I++)
7221 grad_u[eN*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nComponents*nSpace+
7222 ebN*nQuadraturePoints_elementBoundary*nComponents*nSpace+
7223 k*nComponents*nSpace+
7227 dof[l2g[eN*nDOF_trial_element+j]*nComponents+
7230 grad_v[eN*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
7231 ebN*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
7232 k*nDOF_trial_element*nSpace+
7237 int nDOF_trial_element,
7239 int nExteriorElementBoundaries_global,
7240 const int * exteriorElementBoundariesArray,
7241 const int * elementBoundaryElementsArray,
7242 const int * elementBoundaryLocalElementBoundariesArray,
7248 int eN,ebN,ebNE,ebN_local,k,j,t;
7249 memset(
u,0,
sizeof(
double)*nExteriorElementBoundaries_global*nQuadraturePoints_elementBoundary*nComponents);
7250 for (ebNE = 0; ebNE < nExteriorElementBoundaries_global; ebNE++)
7252 ebN = exteriorElementBoundariesArray[ebNE];
7253 eN = elementBoundaryElementsArray[ebN*2+0];
7254 ebN_local = elementBoundaryLocalElementBoundariesArray[ebN*2+0];
7255 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
7256 for(j=0;j<nDOF_trial_element;j++)
7257 for(t=0;t<nComponents;t++)
7258 u[ebNE*nQuadraturePoints_elementBoundary*nComponents+
7262 dof[l2g[eN*nDOF_trial_element+j]*nComponents+
7265 v[ebNE*nQuadraturePoints_elementBoundary*nDOF_trial_element+
7266 k*nDOF_trial_element+
7272 int nDOF_trial_element,
7275 int nExteriorElementBoundaries_global,
7276 const int * exteriorElementBoundariesArray,
7277 const int * elementBoundaryElementsArray,
7278 const int * elementBoundaryLocalElementBoundariesArray,
7284 int eN,ebN,ebNE,ebN_local,k,j,t,I;
7285 memset(grad_u,0,
sizeof(
double)*nExteriorElementBoundaries_global*nQuadraturePoints_elementBoundary*nComponents*nSpace);
7286 for (ebNE = 0; ebNE < nExteriorElementBoundaries_global; ebNE++)
7288 ebN = exteriorElementBoundariesArray[ebNE];
7289 eN = elementBoundaryElementsArray[ebN*2+0];
7290 ebN_local = elementBoundaryLocalElementBoundariesArray[ebN*2+0];
7291 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
7292 for(j=0;j<nDOF_trial_element;j++)
7293 for(t=0;t<nComponents;t++)
7294 for(I=0;I<nSpace;I++)
7295 grad_u[ebNE*nQuadraturePoints_elementBoundary*nComponents*nSpace+
7296 k*nComponents*nSpace+
7300 dof[l2g[eN*nDOF_trial_element+j]*nComponents+
7303 grad_v[ebNE*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
7304 k*nDOF_trial_element*nSpace+
7315 int nQuadraturePoints_element,
7322 int eN,k,I,J,nSpace2=nSpace*nSpace;
7323 for (eN=0;eN<nElements_global;eN++)
7324 for (k=0;k<nQuadraturePoints_element;k++)
7325 for (I=0;I<nSpace;I++)
7327 v[eN*nQuadraturePoints_element*nSpace+
7331 f[eN*nQuadraturePoints_element*nSpace+
7334 for (J=0;J<nSpace;J++)
7335 v[eN*nQuadraturePoints_element*nSpace+
7339 a[eN*nQuadraturePoints_element*nSpace2+
7344 grad_phi[eN*nQuadraturePoints_element*nSpace+
7357 jac[jacIndex] += val;
7366 memset(jac,0,
sizeof(
double)*nNonzeros);
7370 int nElementBoundaries_element,
7371 int nQuadraturePoints_elementBoundary,
7373 int* interiorElementBoundaries,
7374 int* elementBoundaryElements,
7375 int* elementBoundaryLocalElementBoundaries,
7385 int ebNI,ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,k,I,J,nSpace2=nSpace*nSpace;
7386 register double vLeft,vRight,mLeft,mRight;
7387 for(ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
7389 ebN = interiorElementBoundaries[ebNI];
7390 left_eN_global = elementBoundaryElements[ebN*2+0];
7391 right_eN_global = elementBoundaryElements[ebN*2+1];
7392 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
7393 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
7394 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
7398 m[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
7399 left_ebN_element*nQuadraturePoints_elementBoundary+
7403 m[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
7404 right_ebN_element*nQuadraturePoints_elementBoundary+
7406 for (I=0;I<nSpace;I++)
7410 f[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
7411 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
7416 f[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
7417 right_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
7420 for (J=0;J<nSpace;J++)
7424 a[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace2+
7425 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace2+
7430 grad_phi[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
7431 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
7435 a[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace2+
7436 right_ebN_element*nQuadraturePoints_elementBoundary*nSpace2+
7441 grad_phi[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
7442 right_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
7446 vAverage[ebN*nQuadraturePoints_elementBoundary*nSpace+
7448 I] = 0.5*(vLeft + vRight);
7449 vJump[ebN*nQuadraturePoints_elementBoundary*nSpace+
7451 I] = (vLeft - vRight);
7453 mAverage[ebN*nQuadraturePoints_elementBoundary+
7454 k] = 0.5*(mLeft+mRight);
7455 mJump[ebN*nQuadraturePoints_elementBoundary+
7456 k] = mLeft - mRight;
7462 int nElementBoundaries_element,
7463 int nQuadraturePoints_elementBoundary,
7465 int* exteriorElementBoundaries,
7466 int* elementBoundaryElements,
7467 int* elementBoundaryLocalElementBoundaries,
7477 int ebNE,ebN,left_eN_global,left_ebN_element,k,I,J,nSpace2=nSpace*nSpace;
7478 register double vLeft,mLeft;
7479 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
7481 ebN = exteriorElementBoundaries[ebNE];
7482 left_eN_global = elementBoundaryElements[ebN*2+0];
7483 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
7484 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
7488 m[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
7489 left_ebN_element*nQuadraturePoints_elementBoundary+
7491 for (I=0;I<nSpace;I++)
7495 f[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
7496 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
7499 for (J=0;J<nSpace;J++)
7503 a[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace2+
7504 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace2+
7509 grad_phi[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
7510 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
7514 vAverage[ebN*nQuadraturePoints_elementBoundary*nSpace+
7517 vJump[ebN*nQuadraturePoints_elementBoundary*nSpace+
7521 mAverage[ebN*nQuadraturePoints_elementBoundary+
7523 mJump[ebN*nQuadraturePoints_elementBoundary+
7533 int nExteriorElementBoundaries_global,
7534 int nQuadraturePoints_elementBoundary,
7536 int* exteriorElementBoundaries,
7537 int* elementBoundaryElements,
7538 int* elementBoundaryLocalElementBoundaries,
7544 double multiple = 0.0;
7545 if (updateFluxValues > 0)
7548 printf(
"setExteriorGlobalElementBoundaryVelocityValues update= %d nExtElmBndr_global= %d nQuadElmBndr= %d nSpace=%d \n",
7549 updateFluxValues,nExteriorElementBoundaries_global,nQuadraturePoints_elementBoundary,nSpace);
7550 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
7552 ebN = exteriorElementBoundaries[ebNE];
7553 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
7554 for (I=0;I<nSpace;I++)
7556 v_out[ebN*nQuadraturePoints_elementBoundary*nSpace+
7559 multiple*v_out[ebN*nQuadraturePoints_elementBoundary*nSpace+
7563 n[ebN*nQuadraturePoints_elementBoundary*nSpace+
7567 vn_in[ebN*nQuadraturePoints_elementBoundary+
7571 printf(
"setExtGlobElmVel ebN=%d k=%d I=%d vn_in=%g v_out=%g \n",
7573 vn_in[ebN*nQuadraturePoints_elementBoundary+
7575 v_out[ebN*nQuadraturePoints_elementBoundary*nSpace+
7589 int nQuadraturePoints_element,
7591 int computeDiffusiveTimeStepLimit,
7592 double* elementDiameter,
7601 int eN,k,I,nSpace2=nSpace*nSpace;
7602 double h,Vlin,Alin,A_II,
num,den,cfl1,cfl2;
7603 for(eN=0;eN<nElements_global;eN++)
7605 h = elementDiameter[eN];
7606 for (k=0;k<nQuadraturePoints_element;k++)
7610 for(I=0;I<nSpace;I++)
7613 df[eN*nQuadraturePoints_element*nSpace +
7617 df[eN*nQuadraturePoints_element*nSpace +
7622 for(I=0;I<nSpace;I++)
7624 A_II = a[eN*nQuadraturePoints_element*nSpace2 +
7628 Alin = (A_II > Alin) ? A_II : Alin;
7630 Alin*=dphi[eN*nQuadraturePoints_element +
7634 if (computeDiffusiveTimeStepLimit)
7635 cfl[eN*nQuadraturePoints_element +
7638 cfl[eN*nQuadraturePoints_element +
7640 num = 0.5*Vlin*h + 1.0e-8;
7641 den = Alin +
num*1.0e-8;
7642 pe[eN*nQuadraturePoints_element + k] =
num/den;
7648 int nQuadraturePoints_element,
7650 int computeDiffusiveTimeStepLimit,
7653 double* elementDiameter,
7662 int eN,k,I,m,
nnz=rowptr[nSpace];
7663 double h,Vlin,Alin,A_II,
num,den,cfl1,cfl2;
7664 for(eN=0;eN<nElements_global;eN++)
7666 h = elementDiameter[eN];
7667 for (k=0;k<nQuadraturePoints_element;k++)
7671 for(I=0;I<nSpace;I++)
7675 df[eN*nQuadraturePoints_element*nSpace +
7679 df[eN*nQuadraturePoints_element*nSpace +
7685 for(I=0;I<nSpace;I++)
7687 for(m=rowptr[I];m<rowptr[I+1];m++)
7691 A_II = a[eN*nQuadraturePoints_element*
nnz+
7694 Alin = (A_II > Alin) ? A_II : Alin;
7698 Alin*=dphi[eN*nQuadraturePoints_element +
7702 if (computeDiffusiveTimeStepLimit)
7703 cfl[eN*nQuadraturePoints_element +
7706 cfl[eN*nQuadraturePoints_element +
7708 num = 0.5*Vlin*h + 1.0e-8;
7709 den = Alin +
num*1.0e-8;
7710 pe[eN*nQuadraturePoints_element + k] =
num/den;
7717 int nQuadraturePoints_element,
7719 double* elementDiameter,
7725 double h,Vlin,dmdu,cfl1;
7726 for(eN=0;eN<nElements_global;eN++)
7728 h = elementDiameter[eN];
7729 for (k=0;k<nQuadraturePoints_element;k++)
7731 dmdu = dm[eN*nQuadraturePoints_element + k];
7733 for(I=0;I<nSpace;I++)
7736 df[eN*nQuadraturePoints_element*nSpace +
7740 df[eN*nQuadraturePoints_element*nSpace +
7743 Vlin = sqrt(Vlin)/(dmdu+1.0e-10);
7745 cfl[eN*nQuadraturePoints_element +
7753 int nQuadraturePoints_element,
7755 double* elementDiameter,
7762 double h,Vlin,dmdu,cfl1;
7763 for(eN=0;eN<nElements_global;eN++)
7765 h = elementDiameter[eN];
7766 for (k=0;k<nQuadraturePoints_element;k++)
7768 dmdu = dm[eN*nQuadraturePoints_element + k];
7770 for(I=0;I<nSpace;I++)
7773 df1[eN*nQuadraturePoints_element*nSpace +
7777 df1[eN*nQuadraturePoints_element*nSpace +
7781 df2[eN*nQuadraturePoints_element*nSpace +
7785 df2[eN*nQuadraturePoints_element*nSpace +
7789 Vlin = sqrt(Vlin)/(dmdu+1.0e-10);
7791 cfl[eN*nQuadraturePoints_element +
7803 int nElementBoundaries_element,
7804 int nQuadraturePoints_elementBoundary,
7806 int* interiorElementBoundaries,
7807 int* elementBoundaryElements,
7808 int* elementBoundaryLocalElementBoundaries,
7813 int ebNI,ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,k,J,I,nSpace2=nSpace*nSpace;
7814 for(ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
7816 ebN = interiorElementBoundaries[ebNI];
7817 left_eN_global = elementBoundaryElements[ebN*2+0];
7818 right_eN_global = elementBoundaryElements[ebN*2+1];
7819 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
7820 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
7821 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
7822 for(I=0;I<nSpace;I++)
7823 for(J=0;J<nSpace;J++)
7825 velocity[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
7826 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
7829 a[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace2+
7830 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace2+
7835 grad_phi[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
7836 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
7838 velocity[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
7839 right_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
7842 a[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace2+
7843 right_ebN_element*nQuadraturePoints_elementBoundary*nSpace2+
7848 grad_phi[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
7849 right_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
7856 int nElementBoundaries_element,
7857 int nQuadraturePoints_elementBoundary,
7861 int* interiorElementBoundaries,
7862 int* elementBoundaryElements,
7863 int* elementBoundaryLocalElementBoundaries,
7868 int ebNI,ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,k,m,I,
nnz=rowptr[nSpace];
7869 for(ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
7871 ebN = interiorElementBoundaries[ebNI];
7872 left_eN_global = elementBoundaryElements[ebN*2+0];
7873 right_eN_global = elementBoundaryElements[ebN*2+1];
7874 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
7875 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
7876 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
7877 for(I=0;I<nSpace;I++)
7878 for(m=rowptr[I];m<rowptr[I+1];m++)
7880 velocity[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
7881 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
7884 a[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*
nnz+
7885 left_ebN_element*nQuadraturePoints_elementBoundary*
nnz+
7889 grad_phi[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
7890 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
7891 k*nSpace+colind[m]];
7892 velocity[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
7893 right_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
7896 a[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*
nnz+
7897 right_ebN_element*nQuadraturePoints_elementBoundary*
nnz+
7901 grad_phi[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
7902 right_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
7903 k*nSpace+colind[m]];
7912 int nElementBoundaries_element,
7913 int nQuadraturePoints_elementBoundary,
7915 int* exteriorElementBoundaries,
7916 int* elementBoundaryElements,
7917 int* elementBoundaryLocalElementBoundaries,
7922 int ebNE,ebN,eN_global,ebN_element,k,J,I,nSpace2=nSpace*nSpace;
7923 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
7925 ebN = exteriorElementBoundaries[ebNE];
7926 eN_global = elementBoundaryElements[ebN*2+0];
7927 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
7928 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
7929 for(I=0;I<nSpace;I++)
7931 for(J=0;J<nSpace;J++)
7933 velocity[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
7934 ebN_element*nQuadraturePoints_elementBoundary*nSpace+
7937 a[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace2+
7938 ebN_element*nQuadraturePoints_elementBoundary*nSpace2+
7943 grad_phi[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
7944 ebN_element*nQuadraturePoints_elementBoundary*nSpace+
7952 int nElementBoundaries_element,
7953 int nQuadraturePoints_elementBoundary,
7957 int* exteriorElementBoundaries,
7958 int* elementBoundaryElements,
7959 int* elementBoundaryLocalElementBoundaries,
7964 int ebNE,ebN,eN_global,ebN_element,k,m,I,
nnz=rowptr[nSpace];
7965 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
7967 ebN = exteriorElementBoundaries[ebNE];
7968 eN_global = elementBoundaryElements[ebN*2+0];
7969 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
7970 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
7971 for(I=0;I<nSpace;I++)
7973 for(m=rowptr[I];m<rowptr[I+1];m++)
7975 velocity[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
7976 ebN_element*nQuadraturePoints_elementBoundary*nSpace+
7979 a[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*
nnz+
7980 ebN_element*nQuadraturePoints_elementBoundary*
nnz+
7984 grad_phi[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
7985 ebN_element*nQuadraturePoints_elementBoundary*nSpace+
7986 k*nSpace+colind[m]];
7996 int nQuadraturePoints_elementBoundary,
7998 int* exteriorElementBoundaries,
7999 int* elementBoundaryElements,
8000 int* elementBoundaryLocalElementBoundaries,
8005 int ebNE,k,J,I,nSpace2=nSpace*nSpace;
8006 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
8008 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
8009 for(I=0;I<nSpace;I++)
8011 for(J=0;J<nSpace;J++)
8013 velocity[ebNE*nQuadraturePoints_elementBoundary*nSpace+
8016 a[ebNE*nQuadraturePoints_elementBoundary*nSpace2+
8021 grad_phi[ebNE*nQuadraturePoints_elementBoundary*nSpace+
8029 int nQuadraturePoints_elementBoundary,
8033 int* exteriorElementBoundaries,
8034 int* elementBoundaryElements,
8035 int* elementBoundaryLocalElementBoundaries,
8040 int ebNE,k,m,I,
nnz=rowptr[nSpace];
8041 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
8043 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
8044 for(I=0;I<nSpace;I++)
8046 for(m=rowptr[I];m<rowptr[I+1];m++)
8048 velocity[ebNE*nQuadraturePoints_elementBoundary*nSpace+
8051 a[ebNE*nQuadraturePoints_elementBoundary*
nnz+
8055 grad_phi[ebNE*nQuadraturePoints_elementBoundary*nSpace+
8056 k*nSpace+colind[m]];
8067 int nElementBoundaries_element,
8068 int nQuadraturePoints_elementBoundary,
8070 int* interiorElementBoundaries,
8071 int* elementBoundaryElements,
8072 int* elementBoundaryLocalElementBoundaries,
8076 int ebNI,ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,k,J;
8077 for(ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
8079 ebN = interiorElementBoundaries[ebNI];
8080 left_eN_global = elementBoundaryElements[ebN*2+0];
8081 right_eN_global = elementBoundaryElements[ebN*2+1];
8082 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
8083 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
8084 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
8085 for (J=0;J<nSpace;J++)
8087 velocity[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8088 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8092 f[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8093 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8096 velocity[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8097 right_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8101 f[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8102 right_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8114 int nElementBoundaries_element,
8115 int nQuadraturePoints_elementBoundary,
8117 int* exteriorElementBoundaries,
8118 int* elementBoundaryElements,
8119 int* elementBoundaryLocalElementBoundaries,
8123 int ebNE,ebN,eN_global,ebN_element,k,J;
8124 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
8126 ebN = exteriorElementBoundaries[ebNE];
8127 eN_global = elementBoundaryElements[ebN*2+0];
8128 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
8129 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
8130 for(J=0;J<nSpace;J++)
8132 velocity[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8133 ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8137 f[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8138 ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8148 int nQuadraturePoints_elementBoundary,
8150 int* exteriorElementBoundaries,
8151 int* elementBoundaryElements,
8152 int* elementBoundaryLocalElementBoundaries,
8157 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
8159 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
8160 for(J=0;J<nSpace;J++)
8162 velocity[ebNE*nQuadraturePoints_elementBoundary*nSpace+
8166 f[ebNE*nQuadraturePoints_elementBoundary*nSpace+
8177 int nElementBoundaries_element,
8178 int nQuadraturePoints_elementBoundary,
8179 int nQuadraturePoints_element,
8181 int* interiorElementBoundaries,
8182 int* elementBoundaryElements,
8183 int* elementBoundaryLocalElementBoundaries,
8188 int ebNI,ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,k,I;
8189 double numDiffAvg_left,numDiffAvg_right;
8190 for(ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
8192 ebN = interiorElementBoundaries[ebNI];
8193 left_eN_global = elementBoundaryElements[ebN*2+0];
8194 right_eN_global = elementBoundaryElements[ebN*2+1];
8195 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
8196 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
8198 numDiffAvg_left = numDiff[left_eN_global*nQuadraturePoints_element+0];
8199 numDiffAvg_right = numDiff[right_eN_global*nQuadraturePoints_element+0];
8200 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
8201 for(I=0;I<nSpace;I++)
8203 velocity[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8204 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8209 grad_u[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8210 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8212 velocity[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8213 right_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8218 grad_u[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8219 right_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8229 int nElementBoundaries_element,
8230 int nQuadraturePoints_elementBoundary,
8231 int nQuadraturePoints_element,
8233 int* exteriorElementBoundaries,
8234 int* elementBoundaryElements,
8235 int* elementBoundaryLocalElementBoundaries,
8240 int ebNE,ebN,eN_global,ebN_element,k,I;
8242 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
8244 ebN = exteriorElementBoundaries[ebNE];
8245 eN_global = elementBoundaryElements[ebN*2+0];
8246 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
8248 numDiffAvg = numDiff[eN_global*nQuadraturePoints_element+0];
8249 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
8250 for(I=0;I<nSpace;I++)
8252 velocity[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8253 ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8258 grad_u[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8259 ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8271 int nQuadraturePoints_elementBoundary,
8273 int* exteriorElementBoundaries,
8274 int* elementBoundaryElements,
8275 int* elementBoundaryLocalElementBoundaries,
8282 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
8284 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
8285 for(I=0;I<nSpace;I++)
8287 numDiffAvg = numDiff[ebNE*nQuadraturePoints_elementBoundary+k];
8288 velocity[ebNE*nQuadraturePoints_elementBoundary*nSpace+
8293 grad_u[ebNE*nQuadraturePoints_elementBoundary*nSpace+
8300 int nElementBoundaries_element,
8301 int nQuadraturePoints_elementBoundary,
8303 int* interiorElementBoundaries,
8304 int* elementBoundaryElements,
8305 int* elementBoundaryLocalElementBoundaries,
8309 int ebNI,ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,k,I;
8310 for(ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
8312 ebN = interiorElementBoundaries[ebNI];
8313 left_eN_global = elementBoundaryElements[ebN*2+0];
8314 right_eN_global = elementBoundaryElements[ebN*2+1];
8315 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
8316 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
8317 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
8318 for (I=0;I<nSpace;I++)
8319 vAverage[ebN*nQuadraturePoints_elementBoundary*nSpace+
8322 = 0.5*(
v[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8323 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8327 v[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8328 right_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8335 int nElementBoundaries_element,
8336 int nQuadraturePoints_elementBoundary,
8338 int* exteriorElementBoundaries,
8339 int* elementBoundaryElements,
8340 int* elementBoundaryLocalElementBoundaries,
8344 int ebNE,ebN,left_eN_global,left_ebN_element,k,I;
8345 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
8347 ebN = exteriorElementBoundaries[ebNE];
8348 left_eN_global = elementBoundaryElements[ebN*2+0];
8349 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
8350 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
8351 for (I=0;I<nSpace;I++)
8354 vAverage[ebN*nQuadraturePoints_elementBoundary*nSpace+
8357 =
v[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8358 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8377 int nDOF_test_element,
8378 double * elementResidual,
8379 double * conservationResidual)
8382 for (eN = 0; eN < nElements_global; eN++)
8384 conservationResidual[eN] = 0.0;
8385 for (i = 0; i < nDOF_test_element; i++)
8386 conservationResidual[eN] += elementResidual[eN*nDOF_test_element + i];
8398 int nDOF_test_element,
8399 int nElementBoundaries_element,
8400 int nQuadraturePoints_elementBoundary,
8404 double * elementResidual,
8406 double * conservationResidual)
8409 double boundaryFlux;
8410 for (eN = 0; eN < nElements_global; eN++)
8412 conservationResidual[eN] = 0.0;
8414 for (i = 0; i < nDOF_test_element; i++)
8415 conservationResidual[eN] += elementResidual[eN*nDOF_test_element + i];
8418 for (ebN = 0; ebN < nElementBoundaries_element; ebN++)
8420 for (k = 0; k < nQuadraturePoints_elementBoundary; k++)
8422 for (I = 0; I < nSpace; I++)
8425 n[eN*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace +
8426 ebN*nQuadraturePoints_elementBoundary*nSpace +
8430 velocity[eN*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace +
8431 ebN*nQuadraturePoints_elementBoundary*nSpace +
8435 dS_u[eN*nElementBoundaries_element*nQuadraturePoints_elementBoundary +
8436 ebN*nQuadraturePoints_elementBoundary +
8446 conservationResidual[eN] += boundaryFlux;
8543 int nInteriorElementBoundaries_global,
8544 int nExteriorElementBoundaries_global,
8545 int nElementBoundaries_global,
8546 int nElementBoundaries_element,
8547 int nQuadraturePoints_elementBoundary,
8549 int * interiorElementBoundaries,
8550 int * exteriorElementBoundaries,
8551 int * elementBoundaryElementsArray,
8552 int * elementBoundaryLocalElementBoundariesArray,
8553 double * velocityBoundary_global,
8554 double * velocityBoundary_element)
8556 int ebN,ebNE,ebNI,eN_left,eN_right,ebN_left_element,ebN_right_element,k,I;
8558 for (ebNI = 0; ebNI < nInteriorElementBoundaries_global; ebNI++)
8560 ebN = interiorElementBoundaries[ebNI];
8561 eN_left = elementBoundaryElementsArray[ebN*2 + 0];
8562 eN_right= elementBoundaryElementsArray[ebN*2 + 1];
8563 ebN_left_element = elementBoundaryLocalElementBoundariesArray[ebN*2 + 0];
8564 ebN_right_element= elementBoundaryLocalElementBoundariesArray[ebN*2 + 1];
8566 for (k = 0; k < nQuadraturePoints_elementBoundary; k++)
8567 for (I = 0; I < nSpace; I++)
8569 velocityBoundary_element[eN_left*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace +
8570 ebN_left_element*nQuadraturePoints_elementBoundary*nSpace +
8573 velocityBoundary_global[ebN*nQuadraturePoints_elementBoundary*nSpace +
8576 velocityBoundary_element[eN_right*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace +
8577 ebN_right_element*nQuadraturePoints_elementBoundary*nSpace +
8580 velocityBoundary_global[ebN*nQuadraturePoints_elementBoundary*nSpace +
8587 for (ebNE = 0; ebNE < nExteriorElementBoundaries_global; ebNE++)
8589 ebN = exteriorElementBoundaries[ebNE];
8590 eN_left = elementBoundaryElementsArray[ebN*2 + 0];
8591 ebN_left_element = elementBoundaryLocalElementBoundariesArray[ebN*2 + 0];
8593 for (k = 0; k < nQuadraturePoints_elementBoundary; k++)
8594 for (I = 0; I < nSpace; I++)
8596 velocityBoundary_element[eN_left*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace +
8597 ebN_left_element*nQuadraturePoints_elementBoundary*nSpace +
8600 velocityBoundary_global[ebN*nQuadraturePoints_elementBoundary*nSpace +
8607 int nQuadraturePoints_elementBoundary,
8609 int* exteriorElementBoundaries,
8610 int* fluxElementBoundaries,
8618 for (ebNE = 0; ebNE < nExteriorElementBoundaries_global; ebNE++)
8620 ebN = exteriorElementBoundaries[ebNE];
8621 if (fluxElementBoundaries[ebNE] > 0)
8623 for (k = 0; k < nQuadraturePoints_elementBoundary; k++)
8625 for (I=0; I < nSpace; I++)
8627 val = velocity[ebN*nQuadraturePoints_elementBoundary*nSpace +
8629 velocity[ebN*nQuadraturePoints_elementBoundary*nSpace +
8632 flux[ebN*nQuadraturePoints_elementBoundary +
8635 normal[ebN*nQuadraturePoints_elementBoundary*nSpace +
8652 #define TR_ALPHA 0.5
8653 #define TR_ALPHA_EXT 1.0
8659 int nElementBoundaries_element,
8660 int nQuadraturePoints_elementBoundary,
8661 int* interiorElementBoundaries,
8662 int* elementBoundaryElements,
8663 int* elementBoundaryLocalElementBoundaries,
8667 double* dphi_trace_left,
8668 double* dphi_trace_right)
8670 int ebNI,ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,k;
8671 for(ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
8673 ebN = interiorElementBoundaries[ebNI];
8674 left_eN_global = elementBoundaryElements[ebN*2+0];
8675 right_eN_global = elementBoundaryElements[ebN*2+1];
8676 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
8677 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
8678 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
8680 phi_trace[ebN*nQuadraturePoints_elementBoundary+
8682 = (1.0-
TR_ALPHA)*
phi[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
8683 left_ebN_element*nQuadraturePoints_elementBoundary+
8686 TR_ALPHA*
phi[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
8687 right_ebN_element*nQuadraturePoints_elementBoundary+
8689 dphi_trace_left[ebN*nQuadraturePoints_elementBoundary+
8692 dphi[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
8693 left_ebN_element*nQuadraturePoints_elementBoundary+
8695 dphi_trace_right[ebN*nQuadraturePoints_elementBoundary+
8697 =
TR_ALPHA*dphi[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
8698 right_ebN_element*nQuadraturePoints_elementBoundary+
8708 int nExteriorElementBoundaries_global,
8709 int nElementBoundaries_element,
8710 int nQuadraturePoints_elementBoundary,
8711 int* exteriorElementBoundaries,
8712 int* elementBoundaryElements,
8713 int* elementBoundaryLocalElementBoundaries,
8718 double* dphi_trace_left)
8720 int ebNE,ebN,eN_global,ebN_element,k;
8721 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
8723 ebN = exteriorElementBoundaries[ebNE];
8724 eN_global = elementBoundaryElements[ebN*2+0];
8725 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
8726 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
8728 phi_trace[ebN*nQuadraturePoints_elementBoundary+
8730 = (1.0-
TR_ALPHA_EXT)*
phi[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
8731 ebN_element*nQuadraturePoints_elementBoundary+
8734 TR_ALPHA_EXT*phi_bc[ebNE*nQuadraturePoints_elementBoundary+
8736 if(isDOFBoundary[ebNE*nQuadraturePoints_elementBoundary+k] == 1)
8737 dphi_trace_left[ebN*nQuadraturePoints_elementBoundary+
8739 = (1.0-
TR_ALPHA_EXT)*dphi[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
8740 ebN_element*nQuadraturePoints_elementBoundary+
8743 dphi_trace_left[ebN*nQuadraturePoints_elementBoundary+
8745 = dphi[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
8746 ebN_element*nQuadraturePoints_elementBoundary+
8755 int nElementBoundaries_element,
8756 int nQuadraturePoints_elementBoundary,
8757 int nDOF_test_element,
8759 int* interiorElementBoundaries,
8760 int* elementBoundaryElements,
8761 int* elementBoundaryLocalElementBoundaries,
8767 int ebNI,ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,i,k,I;
8768 for(ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
8770 ebN = interiorElementBoundaries[ebNI];
8771 left_eN_global = elementBoundaryElements[ebN*2+0];
8772 right_eN_global = elementBoundaryElements[ebN*2+1];
8773 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
8774 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
8775 for(i=0;i<nDOF_test_element;i++)
8776 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
8777 for(I=0;I<nSpace;I++)
8779 b[left_eN_global*nDOF_test_element*nSpace+
8780 I*nDOF_test_element+
8783 phi_trace[ebN*nQuadraturePoints_elementBoundary+
8786 n[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8787 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8791 w_dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8792 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8793 k*nDOF_test_element+
8795 b[right_eN_global*nDOF_test_element*nSpace+
8796 I*nDOF_test_element+
8799 phi_trace[ebN*nQuadraturePoints_elementBoundary+
8802 n[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8803 right_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8807 w_dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8808 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8809 k*nDOF_test_element+
8819 int nElementBoundaries_element,
8820 int nQuadraturePoints_elementBoundary,
8821 int nDOF_test_element,
8823 int* interiorElementBoundaries,
8824 int* elementBoundaryElements,
8825 int* elementBoundaryLocalElementBoundaries,
8827 double* dphi_trace_left,
8828 double* dphi_trace_right,
8834 int ebNI,ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,i,j,k,I,nDOF_test_element2=nDOF_test_element*nDOF_test_element;
8835 for(ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
8837 ebN = interiorElementBoundaries[ebNI];
8838 left_eN_global = elementBoundaryElements[ebN*2+0];
8839 right_eN_global = elementBoundaryElements[ebN*2+1];
8840 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
8841 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
8842 for(i=0;i<nDOF_test_element;i++)
8843 for(j=0;j<nDOF_test_element;j++)
8844 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
8845 for(I=0;I<nSpace;I++)
8847 db[left_eN_global*nDOF_test_element2*nSpace+
8848 I*nDOF_test_element2+
8849 i*nDOF_test_element+
8852 dphi_trace_left[ebN*nQuadraturePoints_elementBoundary+
8855 v[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8856 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8857 k*nDOF_test_element+
8860 n[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8861 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8865 w_dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8866 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8867 k*nDOF_test_element+
8869 db_eb[left_eN_global*nElementBoundaries_element*nDOF_test_element2*nSpace+
8870 left_ebN_element*nDOF_test_element2*nSpace+
8871 I*nDOF_test_element2+
8872 i*nDOF_test_element+
8875 dphi_trace_right[ebN*nQuadraturePoints_elementBoundary+
8878 v[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8879 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8880 k*nDOF_test_element+
8883 n[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8884 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8888 w_dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8889 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8890 k*nDOF_test_element+
8892 db_eb[right_eN_global*nElementBoundaries_element*nDOF_test_element2*nSpace+
8893 right_ebN_element*nDOF_test_element2*nSpace+
8894 I*nDOF_test_element2+
8895 i*nDOF_test_element+
8898 dphi_trace_left[ebN*nQuadraturePoints_elementBoundary+
8901 v[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8902 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8903 k*nDOF_test_element+
8906 n[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8907 right_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8911 w_dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8912 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8913 k*nDOF_test_element+
8915 db[right_eN_global*nDOF_test_element2*nSpace+
8916 I*nDOF_test_element2+
8917 i*nDOF_test_element+
8920 dphi_trace_right[ebN*nQuadraturePoints_elementBoundary+
8923 v[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8924 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8925 k*nDOF_test_element+
8928 n[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8929 right_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8933 w_dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8934 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8935 k*nDOF_test_element+
8945 int nElementBoundaries_element,
8946 int nQuadraturePoints_elementBoundary,
8947 int nDOF_test_element,
8949 int* exteriorElementBoundaries,
8950 int* elementBoundaryElements,
8951 int* elementBoundaryLocalElementBoundaries,
8957 int ebNE,ebN,eN_global,ebN_element,i,k,I;
8958 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
8960 ebN = exteriorElementBoundaries[ebNE];
8961 eN_global = elementBoundaryElements[ebN*2+0];
8962 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
8963 for(i=0;i<nDOF_test_element;i++)
8964 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
8965 for (I=0;I<nSpace;I++)
8966 b[eN_global*nDOF_test_element*nSpace+
8967 I*nDOF_test_element+
8970 phi_trace[ebN*nQuadraturePoints_elementBoundary+
8973 n[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
8974 ebN_element*nQuadraturePoints_elementBoundary*nSpace+
8978 w_dS[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8979 ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
8980 k*nDOF_test_element+
8989 int nElementBoundaries_element,
8990 int nQuadraturePoints_elementBoundary,
8991 int nDOF_test_element,
8993 int* exteriorElementBoundaries,
8994 int* elementBoundaryElements,
8995 int* elementBoundaryLocalElementBoundaries,
8997 double* dphi_trace_left,
9003 int ebNE,ebN,eN_global,ebN_element,i,j,k,I,nDOF_test_element2=nDOF_test_element*nDOF_test_element;
9004 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
9006 ebN = exteriorElementBoundaries[ebNE];
9007 eN_global = elementBoundaryElements[ebN*2+0];
9008 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
9009 for(i=0;i<nDOF_test_element;i++)
9010 for(j=0;j<nDOF_test_element;j++)
9011 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
9012 for(I=0;I<nSpace;I++)
9014 db[eN_global*nDOF_test_element2*nSpace+
9015 I*nDOF_test_element2+
9016 i*nDOF_test_element+
9019 dphi_trace_left[ebN*nQuadraturePoints_elementBoundary+
9022 v[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
9023 ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
9024 k*nDOF_test_element+
9027 n[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
9028 ebN_element*nQuadraturePoints_elementBoundary*nSpace+
9032 w_dS[eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
9033 ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element+
9034 k*nDOF_test_element+
9041 int nQuadraturePoints_element,
9042 int nDOF_test_element,
9049 for(eN=0;eN<nElements_global;eN++)
9050 for (I=0;I<nSpace;I++)
9051 for (i=0;i<nDOF_test_element;i++)
9052 for (k=0;k<nQuadraturePoints_element;k++)
9053 b[eN*nDOF_test_element*nSpace +
9054 I*nDOF_test_element+
9057 phi[eN*nQuadraturePoints_element+
9060 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
9061 k*nDOF_test_element*nSpace +
9067 int nQuadraturePoints_element,
9068 int nDOF_test_element,
9078 for(eN=0;eN<nElements_global;eN++)
9079 for (I=0;I<nSpace;I++)
9080 for (i=0;i<nDOF_test_element;i++)
9081 for (k=0;k<nQuadraturePoints_element;k++)
9083 b[eN*nDOF_test_element*nSpace +
9084 I*nDOF_test_element+i]
9086 phi[eN*nQuadraturePoints_element+
9089 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
9090 k*nDOF_test_element*nSpace +
9095 b[eN*nDOF_test_element*nSpace +
9096 I*nDOF_test_element+i]
9097 -= epsilon*mf[eN*nQuadraturePoints_element+
9098 k ]*w_dV[eN*nQuadraturePoints_element*nDOF_test_element+ k*nDOF_test_element + i ];
9104 int nQuadraturePoints_element,
9105 int nDOF_test_element,
9112 int eN,i,j,k,I,nDOF_test_element2=nDOF_test_element*nDOF_test_element;
9113 for(eN=0;eN<nElements_global;eN++)
9114 for (I=0;I<nSpace;I++)
9115 for (i=0;i<nDOF_test_element;i++)
9116 for (j=0;j<nDOF_test_element;j++)
9117 for (k=0;k<nQuadraturePoints_element;k++)
9118 db[eN*nDOF_test_element2*nSpace +
9119 I*nDOF_test_element2+
9120 i*nDOF_test_element+
9123 dphi[eN*nQuadraturePoints_element+
9126 v[eN*nQuadraturePoints_element*nDOF_test_element+
9127 k*nDOF_test_element+
9130 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
9131 k*nDOF_test_element*nSpace +
9137 int nElementBoundaries_element,
9138 int nElementBoundaryQuadraturePoints_elementBoundary,
9141 int nQuadraturePoints_element,
9149 int eN,ebN,k,i,j,I,nDOF_element2=nDOF_element*nDOF_element;
9150 double V_dof[nSpace][nDOF_element];
9151 memset(V,0,
sizeof(
double)*
9153 nElementBoundaries_element*
9154 nElementBoundaryQuadraturePoints_elementBoundary*
9156 memset(qV,0,
sizeof(
double)*
9158 nQuadraturePoints_element*
9160 for(eN=0;eN<nElements_global;eN++)
9163 for(I=0;I<nSpace;I++)
9164 for(i=0;i<nDOF_element;i++)
9167 for(j=0;j<nDOF_element;j++)
9170 A_inv[eN*nDOF_element2+
9174 b[eN*nSpace*nDOF_element+
9179 for(k=0;k<nQuadraturePoints_element;k++)
9180 for(j=0;j<nDOF_element;j++)
9181 for(I=0;I<nSpace;I++)
9182 qV[eN*nQuadraturePoints_element*nSpace+
9188 qv[eN*nQuadraturePoints_element*nDOF_element+
9192 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
9193 for(k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
9194 for(j=0;j<nDOF_element;j++)
9195 for(I=0;I<nSpace;I++)
9196 V[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nSpace+
9197 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nSpace+
9203 v[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
9204 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
9211 int nElementBoundaries_element,
9212 int nElementBoundaryQuadraturePoints_elementBoundary,
9215 int nQuadraturePoints_element,
9224 int eN,ebN,k,i,j,I,nDOF_element2=nDOF_element*nDOF_element,nSpace2=nSpace*nSpace;
9225 PROTEUS_LAPACK_INTEGER ipiv[nDOF_element],lwork=((PROTEUS_LAPACK_INTEGER)nDOF_element),dim=((PROTEUS_LAPACK_INTEGER)nDOF_element),info=0;
9226 double work[nDOF_element],A_inv[nDOF_element2];
9227 double V_dof[nSpace][nDOF_element];
9228 memset(V,0,
sizeof(
double)*
9230 nElementBoundaries_element*
9231 nElementBoundaryQuadraturePoints_elementBoundary*
9233 memset(qV,0,
sizeof(
double)*
9235 nQuadraturePoints_element*
9237 for(eN=0;eN<nElements_global;eN++)
9239 for(I=0;I<nSpace;I++)
9241 memset(A_inv,0,
sizeof(
double)*nDOF_element2);
9242 for(i=0;i<nDOF_element;i++)
9243 for(j=0;j<nDOF_element;j++)
9245 for(k=0;k<nQuadraturePoints_element;k++)
9248 A_inv[i*nDOF_element+j] += (1.0/qa[eN*nQuadraturePoints_element*nSpace2+
9252 *qv[eN*nQuadraturePoints_element*nDOF_element+
9256 qw_dV[eN*nQuadraturePoints_element*nDOF_element+
9262 dgetrf_(&dim,&dim,A_inv,&dim,ipiv,&info);
9263 dgetri_(&dim,A_inv,&dim,ipiv,work,&lwork,&info);
9266 for(i=0;i<nDOF_element;i++)
9269 for(j=0;j<nDOF_element;j++)
9272 A_inv[i*nDOF_element+
9275 b[eN*nSpace*nDOF_element+
9281 for(k=0;k<nQuadraturePoints_element;k++)
9282 for(j=0;j<nDOF_element;j++)
9283 for(I=0;I<nSpace;I++)
9284 qV[eN*nQuadraturePoints_element*nSpace+
9290 qv[eN*nQuadraturePoints_element*nDOF_element+
9294 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
9295 for(k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
9296 for(j=0;j<nDOF_element;j++)
9297 for(I=0;I<nSpace;I++)
9298 V[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nSpace+
9299 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nSpace+
9305 v[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
9306 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
9313 int nElementBoundaries_element,
9314 int nElementBoundaryQuadraturePoints_elementBoundary,
9317 int nQuadraturePoints_element,
9328 int eN,ebN,k,i,j,I,nDOF_element2=nDOF_element*nDOF_element,nSpace2=nSpace*nSpace;
9329 int m,
nnz=rowptr[nSpace];
9330 PROTEUS_LAPACK_INTEGER ipiv[nDOF_element],lwork=((PROTEUS_LAPACK_INTEGER)nDOF_element),dim=((PROTEUS_LAPACK_INTEGER)nDOF_element),info=0;
9331 double work[nDOF_element],A_inv[nDOF_element2];
9332 double V_dof[nSpace][nDOF_element];
9333 memset(V,0,
sizeof(
double)*
9335 nElementBoundaries_element*
9336 nElementBoundaryQuadraturePoints_elementBoundary*
9338 memset(qV,0,
sizeof(
double)*
9340 nQuadraturePoints_element*
9342 for(eN=0;eN<nElements_global;eN++)
9344 for(I=0;I<nSpace;I++)
9346 memset(A_inv,0,
sizeof(
double)*nDOF_element2);
9347 for(i=0;i<nDOF_element;i++)
9348 for(j=0;j<nDOF_element;j++)
9350 for(k=0;k<nQuadraturePoints_element;k++)
9353 for (m=rowptr[I]; m < rowptr[I+1];m++)
9361 A_inv[i*nDOF_element+j] += (1.0/qa[eN*nQuadraturePoints_element*
nnz+
9363 *qv[eN*nQuadraturePoints_element*nDOF_element+
9367 qw_dV[eN*nQuadraturePoints_element*nDOF_element+
9374 dgetrf_(&dim,&dim,A_inv,&dim,ipiv,&info);
9375 dgetri_(&dim,A_inv,&dim,ipiv,work,&lwork,&info);
9378 for(i=0;i<nDOF_element;i++)
9381 for(j=0;j<nDOF_element;j++)
9384 A_inv[i*nDOF_element+
9387 b[eN*nSpace*nDOF_element+
9393 for(k=0;k<nQuadraturePoints_element;k++)
9394 for(j=0;j<nDOF_element;j++)
9395 for(I=0;I<nSpace;I++)
9396 qV[eN*nQuadraturePoints_element*nSpace+
9402 qv[eN*nQuadraturePoints_element*nDOF_element+
9406 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
9407 for(k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
9408 for(j=0;j<nDOF_element;j++)
9409 for(I=0;I<nSpace;I++)
9410 V[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nSpace+
9411 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nSpace+
9417 v[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
9418 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
9427 int nElementBoundaries_element,
9428 int nElementBoundaryQuadraturePoints_elementBoundary,
9431 int nQuadraturePoints_element,
9443 int eN,ebN,k,i,j,I,nDOF_element2=nDOF_element*nDOF_element,nSpace2=nSpace*nSpace;
9444 int m,
nnz=rowptr[nSpace];
9445 PROTEUS_LAPACK_INTEGER ipiv[nDOF_element],lwork=((PROTEUS_LAPACK_INTEGER)nDOF_element),dim=((PROTEUS_LAPACK_INTEGER)nDOF_element),info=0;
9446 double work[nDOF_element],A_inv[nDOF_element2];
9447 double V_dof[nSpace][nDOF_element];
9448 double vel_dofs_temp[nElements_global][nSpace][nDOF_element];
9449 memset(V,0,
sizeof(
double)*
9451 nElementBoundaries_element*
9452 nElementBoundaryQuadraturePoints_elementBoundary*
9454 memset(qV,0,
sizeof(
double)*
9456 nQuadraturePoints_element*
9458 for(eN=0;eN<nElements_global;eN++)
9460 for(I=0;I<nSpace;I++)
9462 memset(A_inv,0,
sizeof(
double)*nDOF_element2);
9463 for(i=0;i<nDOF_element;i++)
9464 for(j=0;j<nDOF_element;j++)
9466 for(k=0;k<nQuadraturePoints_element;k++)
9469 for (m=rowptr[I]; m < rowptr[I+1];m++)
9477 A_inv[i*nDOF_element+j] += (1.0/qa[eN*nQuadraturePoints_element*
nnz+
9479 *qv[eN*nQuadraturePoints_element*nDOF_element+
9483 qw_dV[eN*nQuadraturePoints_element*nDOF_element+
9490 dgetrf_(&dim,&dim,A_inv,&dim,ipiv,&info);
9491 dgetri_(&dim,A_inv,&dim,ipiv,work,&lwork,&info);
9494 for(i=0;i<nDOF_element;i++)
9497 vel_dofs_temp[eN][I][i]=0.0;
9498 for(j=0;j<nDOF_element;j++)
9502 A_inv[i*nDOF_element+
9505 b[eN*nSpace*nDOF_element+
9508 vel_dofs_temp[eN][I][i]
9509 += A_inv[i*nDOF_element+
9512 b[eN*nSpace*nDOF_element+
9520 for(j=0;j<nDOF_element;j++)
9521 for(I=0;I<nSpace;I++)
9522 vel_dofs[eN*nDOF_element*nSpace+
9525 =vel_dofs_temp[eN][I][j];
9528 for(k=0;k<nQuadraturePoints_element;k++)
9529 for(j=0;j<nDOF_element;j++)
9530 for(I=0;I<nSpace;I++)
9531 qV[eN*nQuadraturePoints_element*nSpace+
9537 qv[eN*nQuadraturePoints_element*nDOF_element+
9543 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
9544 for(k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
9545 for(j=0;j<nDOF_element;j++)
9546 for(I=0;I<nSpace;I++)
9547 V[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nSpace+
9548 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nSpace+
9554 v[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
9555 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
9563 int nElementBoundaries_element,
9564 int nElementBoundaryQuadraturePoints_elementBoundary,
9567 int nQuadraturePoints_element,
9578 int eN,ebN,ebN_ebN,k,i,j,jj,I,nDOF_element2=nDOF_element*nDOF_element;
9579 double DV_dof[nSpace][nDOF_element][nDOF_element];
9580 memset(DV,0,
sizeof(
double)*
9582 nElementBoundaries_element*
9583 nElementBoundaryQuadraturePoints_elementBoundary*
9586 memset(DV_eb,0,
sizeof(
double)*
9588 nElementBoundaries_element*
9589 nElementBoundaries_element*
9590 nElementBoundaryQuadraturePoints_elementBoundary*
9593 memset(qDV,0,
sizeof(
double)*
9595 nQuadraturePoints_element*
9598 memset(qDV_eb,0,
sizeof(
double)*
9600 nElementBoundaries_element*
9601 nQuadraturePoints_element*
9604 for(eN=0;eN<nElements_global;eN++)
9607 for(I=0;I<nSpace;I++)
9608 for(jj=0;jj<nDOF_element;jj++)
9609 for(i=0;i<nDOF_element;i++)
9611 DV_dof[I][i][jj]=0.0;
9612 for(j=0;j<nDOF_element;j++)
9615 A_inv[eN*nDOF_element2+
9619 db[eN*nSpace*nDOF_element2+
9625 for(k=0;k<nQuadraturePoints_element;k++)
9626 for(j=0;j<nDOF_element;j++)
9627 for(jj=0;jj<nDOF_element;jj++)
9628 for(I=0;I<nSpace;I++)
9629 qDV[eN*nQuadraturePoints_element*nDOF_element*nSpace+
9630 k*nDOF_element*nSpace+
9636 qv[eN*nQuadraturePoints_element*nDOF_element+
9640 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
9641 for(k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
9642 for(j=0;j<nDOF_element;j++)
9643 for(jj=0;jj<nDOF_element;jj++)
9644 for(I=0;I<nSpace;I++)
9645 DV[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element*nSpace+
9646 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element*nSpace+
9647 k*nDOF_element*nSpace+
9653 v[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
9654 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
9658 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
9661 for(I=0;I<nSpace;I++)
9662 for(jj=0;jj<nDOF_element;jj++)
9663 for(i=0;i<nDOF_element;i++)
9665 DV_dof[I][i][jj] = 0.0;
9666 for(j=0;j<nDOF_element;j++)
9669 A_inv[eN*nDOF_element2+
9673 db_eb[eN*nElementBoundaries_element*nSpace*nDOF_element2+
9674 ebN*nSpace*nDOF_element2+
9680 for(k=0;k<nQuadraturePoints_element;k++)
9681 for(j=0;j<nDOF_element;j++)
9682 for(jj=0;jj<nDOF_element;jj++)
9683 for(I=0;I<nSpace;I++)
9685 qDV_eb[eN*nElementBoundaries_element*nQuadraturePoints_element*nDOF_element*nSpace+
9686 ebN*nQuadraturePoints_element*nDOF_element*nSpace+
9687 k*nDOF_element*nSpace+
9693 qv[eN*nQuadraturePoints_element*nDOF_element+
9697 for (ebN_ebN=0;ebN_ebN<nElementBoundaries_element;ebN_ebN++)
9700 for(k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
9701 for(j=0;j<nDOF_element;j++)
9702 for(jj=0;jj<nDOF_element;jj++)
9703 for(I=0;I<nSpace;I++)
9705 DV_eb[eN*nElementBoundaries_element*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element*nSpace+
9706 ebN_ebN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element*nSpace+
9707 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element*nSpace+
9708 k*nDOF_element*nSpace+
9714 v[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
9715 ebN_ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
9724 int nElementBoundaries_element,
9725 int nElementBoundaryQuadraturePoints_elementBoundary,
9728 int nQuadraturePoints_element,
9740 int eN,ebN,ebN_ebN,k,i,j,jj,I,nDOF_element2=nDOF_element*nDOF_element,nSpace2=nSpace*nSpace;
9741 PROTEUS_LAPACK_INTEGER ipiv[nDOF_element],lwork=((PROTEUS_LAPACK_INTEGER)nDOF_element),dim=((PROTEUS_LAPACK_INTEGER)nDOF_element),info=0;
9742 double work[nDOF_element],A_inv[nSpace][nDOF_element2];
9743 double DV_dof[nSpace][nDOF_element][nDOF_element];
9744 memset(DV,0,
sizeof(
double)*
9746 nElementBoundaries_element*
9747 nElementBoundaryQuadraturePoints_elementBoundary*
9750 memset(DV_eb,0,
sizeof(
double)*
9752 nElementBoundaries_element*
9753 nElementBoundaries_element*
9754 nElementBoundaryQuadraturePoints_elementBoundary*
9757 memset(qDV,0,
sizeof(
double)*
9759 nQuadraturePoints_element*
9762 memset(qDV_eb,0,
sizeof(
double)*
9764 nElementBoundaries_element*
9765 nQuadraturePoints_element*
9768 for(eN=0;eN<nElements_global;eN++)
9770 for(I=0;I<nSpace;I++)
9772 memset(A_inv[I],0,
sizeof(
double)*nDOF_element2);
9773 for(i=0;i<nDOF_element;i++)
9774 for(j=0;j<nDOF_element;j++)
9776 for(k=0;k<nQuadraturePoints_element;k++)
9779 A_inv[I][i*nDOF_element+j] += (1.0/qa[eN*nQuadraturePoints_element*nSpace2+
9783 *qv[eN*nQuadraturePoints_element*nDOF_element+
9787 qw_dV[eN*nQuadraturePoints_element*nDOF_element+
9793 dgetrf_(&dim,&dim,&A_inv[I],&dim,ipiv,&info);
9794 dgetri_(&dim,&A_inv[I],&dim,ipiv,work,&lwork,&info);
9796 for(jj=0;jj<nDOF_element;jj++)
9797 for(i=0;i<nDOF_element;i++)
9799 DV_dof[I][i][jj]=0.0;
9800 for(j=0;j<nDOF_element;j++)
9803 A_inv[I][i*nDOF_element+
9806 db[eN*nSpace*nDOF_element2+
9813 for(k=0;k<nQuadraturePoints_element;k++)
9814 for(j=0;j<nDOF_element;j++)
9815 for(jj=0;jj<nDOF_element;jj++)
9816 for(I=0;I<nSpace;I++)
9817 qDV[eN*nQuadraturePoints_element*nDOF_element*nSpace+
9818 k*nDOF_element*nSpace+
9824 qv[eN*nQuadraturePoints_element*nDOF_element+
9828 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
9829 for(k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
9830 for(j=0;j<nDOF_element;j++)
9831 for(jj=0;jj<nDOF_element;jj++)
9832 for(I=0;I<nSpace;I++)
9833 DV[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element*nSpace+
9834 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element*nSpace+
9835 k*nDOF_element*nSpace+
9841 v[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
9842 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
9846 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
9849 for(I=0;I<nSpace;I++)
9850 for(jj=0;jj<nDOF_element;jj++)
9851 for(i=0;i<nDOF_element;i++)
9853 DV_dof[I][i][jj] = 0.0;
9854 for(j=0;j<nDOF_element;j++)
9857 A_inv[I][i*nDOF_element+
9860 db_eb[eN*nElementBoundaries_element*nSpace*nDOF_element2+
9861 ebN*nSpace*nDOF_element2+
9867 for(k=0;k<nQuadraturePoints_element;k++)
9868 for(j=0;j<nDOF_element;j++)
9869 for(jj=0;jj<nDOF_element;jj++)
9870 for(I=0;I<nSpace;I++)
9872 qDV_eb[eN*nElementBoundaries_element*nQuadraturePoints_element*nDOF_element*nSpace+
9873 ebN*nQuadraturePoints_element*nDOF_element*nSpace+
9874 k*nDOF_element*nSpace+
9880 qv[eN*nQuadraturePoints_element*nDOF_element+
9884 for (ebN_ebN=0;ebN_ebN<nElementBoundaries_element;ebN_ebN++)
9887 for(k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
9888 for(j=0;j<nDOF_element;j++)
9889 for(jj=0;jj<nDOF_element;jj++)
9890 for(I=0;I<nSpace;I++)
9892 DV_eb[eN*nElementBoundaries_element*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element*nSpace+
9893 ebN_ebN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element*nSpace+
9894 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element*nSpace+
9895 k*nDOF_element*nSpace+
9901 v[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
9902 ebN_ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
9912 int nElementBoundaries_element,
9913 int nElementBoundaryQuadraturePoints_elementBoundary,
9916 int nQuadraturePoints_element,
9930 int eN,ebN,ebN_ebN,k,i,j,jj,I,nDOF_element2=nDOF_element*nDOF_element,nSpace2=nSpace*nSpace;
9931 int m,
nnz=rowptr[nSpace];
9932 PROTEUS_LAPACK_INTEGER ipiv[nDOF_element],lwork=((PROTEUS_LAPACK_INTEGER)nDOF_element),dim=((PROTEUS_LAPACK_INTEGER)nDOF_element),info=0;
9933 double work[nDOF_element],A_inv[nSpace][nDOF_element2];
9934 double DV_dof[nSpace][nDOF_element][nDOF_element];
9935 memset(DV,0,
sizeof(
double)*
9937 nElementBoundaries_element*
9938 nElementBoundaryQuadraturePoints_elementBoundary*
9941 memset(DV_eb,0,
sizeof(
double)*
9943 nElementBoundaries_element*
9944 nElementBoundaries_element*
9945 nElementBoundaryQuadraturePoints_elementBoundary*
9948 memset(qDV,0,
sizeof(
double)*
9950 nQuadraturePoints_element*
9953 memset(qDV_eb,0,
sizeof(
double)*
9955 nElementBoundaries_element*
9956 nQuadraturePoints_element*
9959 for(eN=0;eN<nElements_global;eN++)
9961 for(I=0;I<nSpace;I++)
9963 memset(A_inv[I],0,
sizeof(
double)*nDOF_element2);
9964 for(i=0;i<nDOF_element;i++)
9965 for(j=0;j<nDOF_element;j++)
9967 for(k=0;k<nQuadraturePoints_element;k++)
9970 for (m=rowptr[I]; m < rowptr[I+1]; m++)
9973 A_inv[I][i*nDOF_element+j] += (1.0/qa[eN*nQuadraturePoints_element*
nnz+
9975 *qv[eN*nQuadraturePoints_element*nDOF_element+
9979 qw_dV[eN*nQuadraturePoints_element*nDOF_element+
9986 dgetrf_(&dim,&dim,A_inv[I],&dim,ipiv,&info);
9987 dgetri_(&dim,A_inv[I],&dim,ipiv,work,&lwork,&info);
9989 for(jj=0;jj<nDOF_element;jj++)
9991 for(i=0;i<nDOF_element;i++)
9993 DV_dof[I][i][jj]=0.0;
9994 for(j=0;j<nDOF_element;j++)
9997 A_inv[I][i*nDOF_element+
10000 db[eN*nSpace*nDOF_element2+
10007 for(k=0;k<nQuadraturePoints_element;k++)
10008 for(j=0;j<nDOF_element;j++)
10009 for(jj=0;jj<nDOF_element;jj++)
10010 for(I=0;I<nSpace;I++)
10011 qDV[eN*nQuadraturePoints_element*nDOF_element*nSpace+
10012 k*nDOF_element*nSpace+
10018 qv[eN*nQuadraturePoints_element*nDOF_element+
10022 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
10023 for(k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
10024 for(j=0;j<nDOF_element;j++)
10025 for(jj=0;jj<nDOF_element;jj++)
10026 for(I=0;I<nSpace;I++)
10027 DV[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element*nSpace+
10028 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element*nSpace+
10029 k*nDOF_element*nSpace+
10035 v[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
10036 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
10040 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
10043 for(I=0;I<nSpace;I++)
10044 for(jj=0;jj<nDOF_element;jj++)
10046 for(i=0;i<nDOF_element;i++)
10048 DV_dof[I][i][jj] = 0.0;
10049 for(j=0;j<nDOF_element;j++)
10052 A_inv[I][i*nDOF_element+
10055 db_eb[eN*nElementBoundaries_element*nSpace*nDOF_element2+
10056 ebN*nSpace*nDOF_element2+
10063 for(k=0;k<nQuadraturePoints_element;k++)
10064 for(j=0;j<nDOF_element;j++)
10065 for(jj=0;jj<nDOF_element;jj++)
10066 for(I=0;I<nSpace;I++)
10068 qDV_eb[eN*nElementBoundaries_element*nQuadraturePoints_element*nDOF_element*nSpace+
10069 ebN*nQuadraturePoints_element*nDOF_element*nSpace+
10070 k*nDOF_element*nSpace+
10076 qv[eN*nQuadraturePoints_element*nDOF_element+
10080 for (ebN_ebN=0;ebN_ebN<nElementBoundaries_element;ebN_ebN++)
10083 for(k=0;k<nElementBoundaryQuadraturePoints_elementBoundary;k++)
10084 for(j=0;j<nDOF_element;j++)
10085 for(jj=0;jj<nDOF_element;jj++)
10086 for(I=0;I<nSpace;I++)
10088 DV_eb[eN*nElementBoundaries_element*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element*nSpace+
10089 ebN_ebN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element*nSpace+
10090 ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element*nSpace+
10091 k*nDOF_element*nSpace+
10097 v[eN*nElementBoundaries_element*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
10098 ebN_ebN*nElementBoundaryQuadraturePoints_elementBoundary*nDOF_element+
10110 int nQuadraturePoints_element,
10115 int eN,i,j,k,nDOF_element2=nDOF_element*nDOF_element;
10116 PROTEUS_LAPACK_INTEGER ipiv[nDOF_element],lwork=((PROTEUS_LAPACK_INTEGER)nDOF_element),dim=((PROTEUS_LAPACK_INTEGER)nDOF_element),info=0;
10117 double work[nDOF_element];
10118 memset(A_inv,0,
sizeof(
double)*nElements_global*nDOF_element2);
10119 for(eN=0;eN<nElements_global;eN++)
10121 for(i=0;i<nDOF_element;i++)
10122 for(j=0;j<nDOF_element;j++)
10124 for(k=0;k<nQuadraturePoints_element;k++)
10126 A_inv[eN*nDOF_element2+i*nDOF_element+j] += vXw_dV[eN*nQuadraturePoints_element*nDOF_element2+
10132 dgetrf_(&dim,&dim,&A_inv[eN*nDOF_element2],&dim,ipiv,&info);
10133 dgetri_(&dim,&A_inv[eN*nDOF_element2],&dim,ipiv,work,&lwork,&info);
10138 int nQuadraturePoints_element,
10139 int nDOF_test_element,
10144 double* weak_residual)
10146 int eN,i,k,I,J,nSpace2=nSpace*nSpace;
10147 for(eN=0;eN<nElements_global;eN++)
10148 for (i=0;i<nDOF_test_element;i++)
10149 for (k=0;k<nQuadraturePoints_element;k++)
10150 for (I=0;I<nSpace;I++)
10151 for (J=0;J<nSpace;J++)
10152 weak_residual[eN*nDOF_test_element + i]
10154 a[eN*nQuadraturePoints_element*nSpace2 +
10159 qV[eN*nQuadraturePoints_element*nSpace +
10163 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
10164 k*nDOF_test_element*nSpace +
10170 int nQuadraturePoints_element,
10171 int nDOF_test_element,
10180 double* weak_residual)
10182 int eN,i,k,I,m,
nnz=rowptr[nSpace];
10183 for(eN=0;eN<nElements_global;eN++)
10184 for (i=0;i<nDOF_test_element;i++)
10185 for (k=0;k<nQuadraturePoints_element;k++)
10186 for (I=0;I<nSpace;I++)
10187 for (m=rowptr[I];m<rowptr[I+1];m++)
10189 weak_residual[eN*nDOF_test_element + i]
10191 a[eN*nQuadraturePoints_element*
nnz+
10195 qV[eN*nQuadraturePoints_element*nSpace +
10199 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
10200 k*nDOF_test_element*nSpace +
10205 for(eN=0;eN<nElements_global;eN++)
10206 for (k=0;k<nQuadraturePoints_element;k++)
10207 for (I=0;I<nSpace;I++)
10210 for (m=rowptr[I];m<rowptr[I+1];m++)
10212 velocity[eN*nQuadraturePoints_element*nSpace +
10214 += a[eN*nQuadraturePoints_element*
nnz+
10217 qV[eN*nQuadraturePoints_element*nSpace +
10218 k*nSpace + colind[m]];
10221 else if (rho_split==1)
10223 velocity[eN*nQuadraturePoints_element*nSpace +
10226 qV[eN*nQuadraturePoints_element*nSpace +
10232 int nElementBoundaries_element,
10233 int nQuadraturePoints_element,
10234 int nDOF_trial_element,
10235 int nDOF_test_element,
10244 double* jacobian_weak_residual,
10245 double* jacobian_weak_residual_eb)
10247 int eN,ebN,i,j,k,I,J,nSpace2=nSpace*nSpace,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element;
10248 double daProduct,dphiProduct;
10249 for(eN=0;eN<nElements_global;eN++)
10251 for (i=0;i<nDOF_test_element;i++)
10252 for (k=0;k<nQuadraturePoints_element;k++)
10255 for (I=0;I<nSpace;I++)
10256 for (J=0;J<nSpace;J++)
10259 da[eN*nQuadraturePoints_element*nSpace2 +
10264 qV[eN*nQuadraturePoints_element*nSpace +
10268 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
10269 k*nDOF_test_element*nSpace +
10272 for (j=0;j<nDOF_trial_element;j++)
10275 for (I=0;I<nSpace;I++)
10276 for (J=0;J<nSpace;J++)
10279 a[eN*nQuadraturePoints_element*nSpace2 +
10284 qDV[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace +
10285 k*nDOF_trial_element*nSpace +
10289 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
10290 k*nDOF_test_element*nSpace +
10293 jacobian_weak_residual[eN*nDOF_test_X_trial_element +
10294 i*nDOF_trial_element +
10299 v[eN*nQuadraturePoints_element*nDOF_trial_element+
10300 k*nDOF_trial_element+
10306 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
10307 for (i=0;i<nDOF_test_element;i++)
10308 for (k=0;k<nQuadraturePoints_element;k++)
10310 for (j=0;j<nDOF_trial_element;j++)
10313 for (I=0;I<nSpace;I++)
10314 for (J=0;J<nSpace;J++)
10317 a[eN*nQuadraturePoints_element*nSpace2 +
10322 qDV_eb[eN*nElementBoundaries_element*nQuadraturePoints_element*nDOF_trial_element*nSpace +
10323 ebN*nQuadraturePoints_element*nDOF_trial_element*nSpace+
10324 k*nDOF_trial_element*nSpace +
10328 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
10329 k*nDOF_test_element*nSpace +
10332 jacobian_weak_residual_eb[eN*nElementBoundaries_element*nDOF_test_X_trial_element +
10333 ebN*nDOF_test_X_trial_element +
10334 i*nDOF_trial_element +
10344 int nElementBoundaries_element,
10345 int nQuadraturePoints_element,
10346 int nDOF_trial_element,
10347 int nDOF_test_element,
10358 double* jacobian_weak_residual,
10359 double* jacobian_weak_residual_eb)
10361 int eN,ebN,i,j,k,I,m,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element,
nnz=rowptr[nSpace];
10362 double daProduct,dphiProduct;
10363 for(eN=0;eN<nElements_global;eN++)
10365 for (i=0;i<nDOF_test_element;i++)
10366 for (k=0;k<nQuadraturePoints_element;k++)
10369 for (I=0;I<nSpace;I++)
10370 for (m=rowptr[I];m<rowptr[I+1];m++)
10373 da[eN*nQuadraturePoints_element*
nnz+
10377 qV[eN*nQuadraturePoints_element*nSpace +
10381 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
10382 k*nDOF_test_element*nSpace +
10385 for (j=0;j<nDOF_trial_element;j++)
10388 for (I=0;I<nSpace;I++)
10389 for(m=rowptr[I];m<rowptr[I+1];m++)
10392 a[eN*nQuadraturePoints_element*
nnz+
10396 qDV[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace +
10397 k*nDOF_trial_element*nSpace +
10401 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
10402 k*nDOF_test_element*nSpace +
10405 jacobian_weak_residual[eN*nDOF_test_X_trial_element +
10406 i*nDOF_trial_element +
10411 v[eN*nQuadraturePoints_element*nDOF_trial_element+
10412 k*nDOF_trial_element+
10418 for (ebN=0;ebN<nElementBoundaries_element;ebN++)
10419 for (i=0;i<nDOF_test_element;i++)
10420 for (k=0;k<nQuadraturePoints_element;k++)
10422 for (j=0;j<nDOF_trial_element;j++)
10425 for (I=0;I<nSpace;I++)
10426 for(m=rowptr[I];m<rowptr[I+1];m++)
10429 a[eN*nQuadraturePoints_element*
nnz+
10433 qDV_eb[eN*nElementBoundaries_element*nQuadraturePoints_element*nDOF_trial_element*nSpace +
10434 ebN*nQuadraturePoints_element*nDOF_trial_element*nSpace+
10435 k*nDOF_trial_element*nSpace +
10439 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
10440 k*nDOF_test_element*nSpace +
10443 jacobian_weak_residual_eb[eN*nElementBoundaries_element*nDOF_test_X_trial_element +
10444 ebN*nDOF_test_X_trial_element +
10445 i*nDOF_trial_element +
10455 int nQuadraturePoints_element,
10459 double* elementSpatialResidual,
10462 int eN,i,j,k,nDOF_element2=nDOF_element*nDOF_element;
10464 PROTEUS_LAPACK_INTEGER nrhs=1,dim=((PROTEUS_LAPACK_INTEGER)nDOF_element),info=0,ipiv[nDOF_element];
10465 double massMatrix[nDOF_element2],b[nDOF_element];
10468 memset(mt,0,
sizeof(
double)*nElements_global*nQuadraturePoints_element);
10469 for(eN=0;eN<nElements_global;eN++)
10471 memset(massMatrix,0,
sizeof(
double)*nDOF_element2);
10472 memset(ipiv,0,
sizeof(PROTEUS_LAPACK_INTEGER)*nDOF_element);
10473 for(i=0;i<nDOF_element;i++)
10474 for(j=0;j<nDOF_element;j++)
10476 for(k=0;k<nQuadraturePoints_element;k++)
10478 mt[eN*nQuadraturePoints_element+
10480 massMatrix[i*nDOF_element+j] += vXw_dV[eN*nQuadraturePoints_element*nDOF_element2+
10485 b[j] = -elementSpatialResidual[eN*nDOF_element+j];
10487 dgetrf_(&dim,&dim,massMatrix,&dim,ipiv,&info);
10488 dgetrs_(&trans,&dim,&nrhs,massMatrix,&dim,ipiv,b,&dim,&info);
10489 for (j=0;j<nDOF_element;j++)
10490 for(k=0;k<nQuadraturePoints_element;k++)
10491 mt[eN*nQuadraturePoints_element+
10492 k] += b[j]*
v[eN*nQuadraturePoints_element*nDOF_element+
10498 int nQuadraturePoints_element,
10502 double* elementSpatialResidual,
10505 int eN,i,j,k,nDOF_element2=nDOF_element*nDOF_element;
10507 PROTEUS_LAPACK_INTEGER nrhs=1,dim=((PROTEUS_LAPACK_INTEGER)nDOF_element),info=0,ipiv[nDOF_element];
10508 double massMatrix[nDOF_element2],b[nDOF_element];
10511 for(eN=0;eN<nElements_global;eN++)
10513 memset(massMatrix,0,
sizeof(
double)*nDOF_element2);
10514 memset(ipiv,0,
sizeof(PROTEUS_LAPACK_INTEGER)*nDOF_element);
10515 for(i=0;i<nDOF_element;i++)
10516 for(j=0;j<nDOF_element;j++)
10518 for(k=0;k<nQuadraturePoints_element;k++)
10520 mt[eN*nQuadraturePoints_element+
10522 massMatrix[i*nDOF_element+j] +=
10523 v[eN*nQuadraturePoints_element*nDOF_element+
10526 *w_dV[eN*nQuadraturePoints_element*nDOF_element+
10530 b[j] = -elementSpatialResidual[eN*nDOF_element+j];
10532 dgetrf_(&dim,&dim,massMatrix,&dim,ipiv,&info);
10533 dgetrs_(&trans,&dim,&nrhs,massMatrix,&dim,ipiv,b,&dim,&info);
10534 for (j=0;j<nDOF_element;j++)
10535 for(k=0;k<nQuadraturePoints_element;k++)
10536 mt[eN*nQuadraturePoints_element+
10537 k] += b[j]*
v[eN*nQuadraturePoints_element*nDOF_element+
10546 int nElements_global,
10547 int nElementBoundaries_element,
10548 int nQuadraturePoints_elementBoundary,
10549 int nValuesPerQuadraturePoint,
10550 const int * exteriorElementBoundaries,
10551 const int* elementBoundaryElements,
10552 const int * elementBoundaryLocalElementBoundaries,
10553 const double * ebq_val,
10556 int ebNE,ebN,eN,ebN_element,k,i;
10557 for (ebNE = 0; ebNE < nExteriorElementBoundaries_global; ebNE++)
10559 ebN = exteriorElementBoundaries[ebNE];
10560 eN = elementBoundaryElements[ebN*2+0];
10561 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
10562 for (k = 0; k < nQuadraturePoints_elementBoundary; k++)
10563 for (i=0; i < nValuesPerQuadraturePoint; i++)
10565 ebqe_val[ebNE*nQuadraturePoints_elementBoundary*nValuesPerQuadraturePoint +
10566 k*nValuesPerQuadraturePoint + i]
10568 ebq_val[eN*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nValuesPerQuadraturePoint+
10569 ebN_element*nQuadraturePoints_elementBoundary*nValuesPerQuadraturePoint+
10570 k*nValuesPerQuadraturePoint+
10579 int nElements_global,
10580 int nElementBoundaries_element,
10581 int nQuadraturePoints_elementBoundary,
10582 int nValuesPerQuadraturePoint,
10583 const int * exteriorElementBoundaries,
10584 const int* elementBoundaryElements,
10585 const int * elementBoundaryLocalElementBoundaries,
10586 const double * ebqe_val,
10589 int ebNE,ebN,eN,ebN_element,k,i;
10590 for (ebNE = 0; ebNE < nExteriorElementBoundaries_global; ebNE++)
10592 ebN = exteriorElementBoundaries[ebNE];
10593 eN = elementBoundaryElements[ebN*2+0];
10594 ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
10595 for (k = 0; k < nQuadraturePoints_elementBoundary; k++)
10596 for (i=0; i < nValuesPerQuadraturePoint; i++)
10598 ebq_val[eN*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nValuesPerQuadraturePoint+
10599 ebN_element*nQuadraturePoints_elementBoundary*nValuesPerQuadraturePoint+
10600 k*nValuesPerQuadraturePoint+
10603 ebqe_val[ebNE*nQuadraturePoints_elementBoundary*nValuesPerQuadraturePoint +
10604 k*nValuesPerQuadraturePoint + i];
10612 int nQuadraturePoints_elementBoundary,
10613 int nValuesPerQuadraturePoint,
10614 const int * exteriorElementBoundaries,
10615 const int* elementBoundaryElements,
10616 const int * elementBoundaryLocalElementBoundaries,
10617 const double * ebqe_val,
10618 double * ebq_global_val)
10620 int ebNE,ebN,eN,k,i;
10621 for (ebNE = 0; ebNE < nExteriorElementBoundaries_global; ebNE++)
10623 ebN = exteriorElementBoundaries[ebNE];
10624 eN = elementBoundaryElements[ebN*2+0];
10625 for (k = 0; k < nQuadraturePoints_elementBoundary; k++)
10626 for (i=0; i < nValuesPerQuadraturePoint; i++)
10628 ebq_global_val[ebN*nQuadraturePoints_elementBoundary*nValuesPerQuadraturePoint+
10629 k*nValuesPerQuadraturePoint+
10632 ebqe_val[ebNE*nQuadraturePoints_elementBoundary*nValuesPerQuadraturePoint +
10633 k*nValuesPerQuadraturePoint + i];
10642 int nQuadraturePoints_elementBoundary,
10643 int nValuesPerQuadraturePoint,
10644 const int * exteriorElementBoundaries,
10645 const int* elementBoundaryElements,
10646 const int * elementBoundaryLocalElementBoundaries,
10647 const double * ebq_global_val,
10650 int ebNE,ebN,eN,k,i;
10651 for (ebNE = 0; ebNE < nExteriorElementBoundaries_global; ebNE++)
10653 ebN = exteriorElementBoundaries[ebNE];
10654 eN = elementBoundaryElements[ebN*2+0];
10655 for (k = 0; k < nQuadraturePoints_elementBoundary; k++)
10656 for (i=0; i < nValuesPerQuadraturePoint; i++)
10658 ebqe_val[ebNE*nQuadraturePoints_elementBoundary*nValuesPerQuadraturePoint +
10659 k*nValuesPerQuadraturePoint + i]
10661 ebq_global_val[ebN*nQuadraturePoints_elementBoundary*nValuesPerQuadraturePoint+
10662 k*nValuesPerQuadraturePoint+
10669 int nQuadraturePoints_element,
10671 double* nValueArray)
10674 register double integral=0.0;
10675 for(eN=0;eN<nElements;eN++)
10676 for(k=0;k<nQuadraturePoints_element;k++)
10678 integral += nValueArray[eN*nQuadraturePoints_element + k]*
10679 dV[eN*nQuadraturePoints_element+k];
10685 int nQuadraturePoints_element,
10687 double* nValueArray)
10690 register double integral=0.0;
10691 for(eN=0;eN<nElements;eN++)
10692 for(k=0;k<nQuadraturePoints_element;k++)
10694 if(nValueArray[eN*nQuadraturePoints_element + k] > 0.0)
10695 integral += dV[eN*nQuadraturePoints_element+k];
10696 else if (nValueArray[eN*nQuadraturePoints_element + k] == 0.0)
10697 integral += 0.5*dV[eN*nQuadraturePoints_element+k];
10703 int nQuadraturePoints_element,
10705 double* elementDiameter,
10707 double* nValueArray)
10710 register double integral=0.0,eps,
H,
phi;
10711 for(eN=0;eN<nElements;eN++)
10713 eps = elementDiameter[eN]*epsFact;
10714 for(k=0;k<nQuadraturePoints_element;k++)
10716 phi = nValueArray[eN*nQuadraturePoints_element + k];
10719 else if (
phi < -eps)
10724 H = 0.5*(1.0 +
phi/eps + sin(M_PI*
phi/eps)/M_PI);
10725 integral +=
H*dV[eN*nQuadraturePoints_element+k];
10732 int nElementBoundaries_owned,
10733 int nQuadraturePoints_elementBoundary,
10735 int* exteriorElementBoundariesArray,
10737 double* nValueArray)
10740 register double integral=0.0;
10741 for(ebNE=0;ebNE<nExteriorElementBoundaries;ebNE++)
10743 ebN = exteriorElementBoundariesArray[ebNE];
10744 if (ebN < nElementBoundaries_owned && flag[ebN] > 0)
10746 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
10748 integral += nValueArray[ebNE*nQuadraturePoints_elementBoundary + k]*
10749 dS[ebNE*nQuadraturePoints_elementBoundary+k];
10757 int nElementBoundaries_owned,
10758 int nQuadraturePoints_elementBoundary,
10761 int* exteriorElementBoundaries,
10763 double* nValueArray,
10767 register double integral=0.0,flux=0.0;
10768 for(ebNE=0;ebNE<nExteriorElementBoundaries;ebNE++)
10770 ebN = exteriorElementBoundaries[ebNE];
10771 if (ebN < nElementBoundaries_owned && flag[ebN] > 0)
10773 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
10776 for (I=0;I<nSpace;I++)
10778 flux += nValueArray[ebNE*nQuadraturePoints_elementBoundary*nSpace + k*nSpace+I]*
10779 normal[ebNE*nQuadraturePoints_elementBoundary*nSpace + k*nSpace+I];
10781 integral += flux*dS[ebNE*nQuadraturePoints_elementBoundary+k];
10791 int nNodes_element,
10794 const int* elementNodesArray,
10795 const int* nodeElementOffsets,
10796 const int* nodeElementsArray,
10798 const double * dof,
10799 double* nodalAverage)
10803 memset(nodalAverage,0,
sizeof(
double)*nNodes_global*dim_dof);
10804 for (iv = 0; iv < dim_dof; iv++)
10806 for (eN = 0; eN < nElements_global; eN++)
10808 for (i = 0; i < nNodes_element; i++)
10810 nN = elementNodesArray[eN*nNodes_element + i];
10811 ig = l2g[eN*nDOF_element + i];
10812 nodalAverage[nN*dim_dof + iv] += dof[ig*dim_dof + iv];
10815 for (nN = 0; nN < nNodes_global; nN++)
10817 nElements_nN = nodeElementOffsets[nN+1] - nodeElementOffsets[nN];
10818 nodalAverage[nN*dim_dof + iv] /= nElements_nN;
10825 int nNodes_element,
10828 const int* elementNodesArray,
10829 const int* nodeElementOffsets,
10830 const int* nodeElementsArray,
10832 const double * dof,
10833 double* nodalAverage)
10837 memset(nodalAverage,0,
sizeof(
double)*nNodes_global*dim_dof);
10838 for (iv = 0; iv < dim_dof; iv++)
10840 for (eN = 0; eN < nElements_global; eN++)
10842 ig = l2g[eN*nDOF_element+0];
10843 for (i = 0; i < nNodes_element; i++)
10845 nN = elementNodesArray[eN*nNodes_element+i];
10846 nodalAverage[nN*dim_dof + iv] += dof[ig*dim_dof + iv];
10849 for (nN = 0; nN < nNodes_global; nN++)
10851 nElements_nN = nodeElementOffsets[nN+1] - nodeElementOffsets[nN];
10852 nodalAverage[nN*dim_dof + iv] /= nElements_nN;
10859 int nNodes_element,
10862 const int* elementNodesArray,
10863 const int* nodeElementOffsets,
10864 const int* nodeElementsArray,
10866 const double * dof,
10867 double* nodalAverage)
10869 int eN,nN,i,j,ig,jg,iv;
10872 memset(nodalAverage,0,
sizeof(
double)*nNodes_global*dim_dof);
10873 nd = nNodes_element - 1.0;
10874 for (iv = 0; iv < dim_dof; iv++)
10876 for (eN = 0; eN < nElements_global; eN++)
10883 for (i = 0; i < nNodes_element; i++)
10886 for (j=0; j < i; j++)
10888 jg = l2g[eN*nDOF_element+j];
10889 val += dof[jg*dim_dof + iv];
10891 for (j=i+1; j < nNodes_element; j++)
10893 jg = l2g[eN*nDOF_element+j];
10894 val += dof[jg*dim_dof + iv];
10896 ig = l2g[eN*nDOF_element+i];
10897 val += (1.0-nd)*dof[ig*dim_dof + iv];
10898 nN = elementNodesArray[eN*nNodes_element+i];
10899 nodalAverage[nN*dim_dof + iv] += val;
10902 for (nN = 0; nN < nNodes_global; nN++)
10904 nElements_nN = nodeElementOffsets[nN+1] - nodeElementOffsets[nN];
10905 nodalAverage[nN*dim_dof + iv] /= nElements_nN;
10914 int nExteriorElementBoundaries_global,
10915 int nQuadraturePoints_elementBoundary,
10916 int nValuesPerQuadraturePoint,
10918 const int * exteriorElementBoundariesArray,
10919 const int * elementBoundaryElementsArray,
10920 const int * elementBoundaryLocalElementBoundariesArray,
10921 const double * ebq_val,
10922 const double * ebqe_val,
10923 int* firstBadIndex)
10925 int eN,ebN,ebN_local,ebNE,k,i;
10928 *firstBadIndex = -1;
10930 for (ebNE = 0; ebNE < nExteriorElementBoundaries_global; ebNE++)
10932 ebN = exteriorElementBoundariesArray[ebNE];
10933 eN = elementBoundaryElementsArray[ebN*2+0];
10934 ebN_local = elementBoundaryLocalElementBoundariesArray[ebN*2+0];
10936 for (i=0; i < nValuesPerQuadraturePoint; i++)
10938 val1 = ebq_val[eN*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nValuesPerQuadraturePoint +
10939 ebN_local*nQuadraturePoints_elementBoundary*nValuesPerQuadraturePoint +
10940 k*nValuesPerQuadraturePoint +
10942 val2 = ebqe_val[ebNE*nQuadraturePoints_elementBoundary*nValuesPerQuadraturePoint +
10943 k*nValuesPerQuadraturePoint +
10945 if (fabs(val1-val2) > tolerance)
10948 *firstBadIndex = ebNE;
10960 int nQuadraturePoints_elementBoundary,
10961 int nValuesPerQuadraturePoint,
10963 const int * exteriorElementBoundariesArray,
10964 const int * elementBoundaryElementsArray,
10965 const int * elementBoundaryLocalElementBoundariesArray,
10966 const double * ebq_global_val,
10967 const double * ebqe_val,
10968 int* firstBadIndex)
10970 int eN,ebN,ebNE,k,i;
10973 *firstBadIndex = -1;
10975 for (ebNE = 0; ebNE < nExteriorElementBoundaries_global; ebNE++)
10977 ebN = exteriorElementBoundariesArray[ebNE];
10978 eN = elementBoundaryElementsArray[ebN*2+0];
10980 for (i=0; i < nValuesPerQuadraturePoint; i++)
10982 val1 = ebq_global_val[ebN*nQuadraturePoints_elementBoundary*nValuesPerQuadraturePoint +
10983 k*nValuesPerQuadraturePoint +
10985 val2 = ebqe_val[ebNE*nQuadraturePoints_elementBoundary*nValuesPerQuadraturePoint +
10986 k*nValuesPerQuadraturePoint +
10988 if (fabs(val1-val2) > tolerance)
10991 *firstBadIndex = ebNE;
11002 const int* globalDOFids,
11003 const int* freeDOFids,
11004 const double * free_u,
11007 int i,dofN,free_dofN;
11008 for (i = 0; i < nDOF2set; i++)
11010 dofN = globalDOFids[i]; free_dofN = freeDOFids[i];
11011 u[dofN] = free_u[offset + stride*free_dofN];
11019 const int* globalDOFids,
11020 const int* freeDOFids,
11024 int i,dofN,free_dofN;
11025 for (i = 0; i < nDOF2set; i++)
11027 dofN = globalDOFids[i]; free_dofN = freeDOFids[i];
11028 free_u[offset + stride*free_dofN] =
u[dofN];
11034 int nElementBoundaries_element,
11035 int nQuadraturePoints_elementBoundary,
11036 int nDOF_test_element,
11038 int* interiorElementBoundaries,
11039 int* elementBoundaryElements,
11040 int* elementBoundaryLocalElementBoundaries,
11049 int ebNI,ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,i,k,I,J,nSpace2=nSpace*nSpace;
11050 for(ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
11052 ebN = interiorElementBoundaries[ebNI];
11053 left_eN_global = elementBoundaryElements[ebN*2+0];
11054 right_eN_global = elementBoundaryElements[ebN*2+1];
11055 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
11056 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
11057 for(i=0;i<nDOF_test_element;i++)
11058 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
11060 for (I=0;I<nSpace;I++)
11061 for (J=0;J<nSpace;J++)
11063 residual[left_eN_global*nDOF_test_element+
11066 sigma*0.5*((
u[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11067 left_ebN_element*nQuadraturePoints_elementBoundary+
11069 -
u[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11070 right_ebN_element*nQuadraturePoints_elementBoundary+
11072 *
n[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
11073 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
11075 *a[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace2+
11076 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace2+
11080 *grad_w[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element*nSpace+
11081 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element*nSpace+
11082 k*nDOF_test_element*nSpace+
11085 *dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11086 left_ebN_element*nQuadraturePoints_elementBoundary+
11088 residual[right_eN_global*nDOF_test_element+
11091 sigma*0.5*((
u[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11092 left_ebN_element*nQuadraturePoints_elementBoundary+
11094 -
u[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11095 right_ebN_element*nQuadraturePoints_elementBoundary+
11097 *
n[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
11098 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
11100 *a[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace2+
11101 right_ebN_element*nQuadraturePoints_elementBoundary*nSpace2+
11105 *grad_w[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element*nSpace+
11106 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element*nSpace+
11107 k*nDOF_test_element*nSpace+
11110 *dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11111 right_ebN_element*nQuadraturePoints_elementBoundary+
11119 int nQuadraturePoints_elementBoundary,
11120 int nDOF_test_element,
11122 int* isDOFBoundary,
11123 int* exteriorElementBoundaries,
11124 int* elementBoundaryElements,
11125 int* elementBoundaryLocalElementBoundaries,
11135 int ebNE,ebN,eN_global,i,k,I,J,nSpace2=nSpace*nSpace;
11136 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
11138 ebN = exteriorElementBoundaries[ebNE];
11139 eN_global = elementBoundaryElements[ebN*2+0];
11140 for(i=0;i<nDOF_test_element;i++)
11141 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
11143 if (isDOFBoundary[ebNE*nQuadraturePoints_elementBoundary+k])
11145 for (I=0;I<nSpace;I++)
11146 for (J=0;J<nSpace;J++)
11148 residual[eN_global*nDOF_test_element+
11151 sigma*((
u[ebNE*nQuadraturePoints_elementBoundary+
11153 -ub[ebNE*nQuadraturePoints_elementBoundary+
11155 *
n[ebNE*nQuadraturePoints_elementBoundary*nSpace+
11158 *a[ebNE*nQuadraturePoints_elementBoundary*nSpace2+
11162 *grad_w[ebNE*nQuadraturePoints_elementBoundary*nDOF_test_element*nSpace+
11163 k*nDOF_test_element*nSpace+
11166 *dS[ebNE*nQuadraturePoints_elementBoundary+
11175 int nElementBoundaries_element,
11176 int nQuadraturePoints_elementBoundary,
11177 int nDOF_test_element,
11178 int nDOF_trial_element,
11184 int nFreeVDOF_global,
11185 int* interiorElementBoundaries,
11186 int* elementBoundaryElements,
11187 int* elementBoundaryLocalElementBoundaries,
11188 int* nFreeDOF_element_r,
11191 int* nFreeDOF_element_u,
11202 int ebNI,ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,ii,i,k,jj,j,jacIndex,I,J,II,JJ,nSpace2=nSpace*nSpace;
11203 for (ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
11205 ebN = interiorElementBoundaries[ebNI];
11206 left_eN_global = elementBoundaryElements[ebN*2+0];
11207 right_eN_global = elementBoundaryElements[ebN*2+1];
11208 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
11209 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
11211 for(ii=0;ii<nFreeDOF_element_r[left_eN_global];ii++)
11213 i = freeLocal_r[left_eN_global*nDOF_test_element+
11215 I = offset_r + stride_r*freeGlobal_r[left_eN_global*nDOF_test_element+
11217 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
11219 for(jj=0;jj<nFreeDOF_element_u[left_eN_global];jj++)
11221 j = freeLocal_u[left_eN_global*nDOF_trial_element+
11223 J = offset_u + stride_u*freeGlobal_u[left_eN_global*nDOF_trial_element+
11225 jacIndex = I+J*nFreeVDOF_global;
11226 for (II=0;II<nSpace;II++)
11227 for (JJ=0;JJ<nSpace;JJ++)
11229 -= sigma*0.5*(
v[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11230 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11231 k*nDOF_trial_element+
11233 *
n[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
11234 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
11237 *a[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace2+
11238 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace2+k*nSpace2+
11241 *grad_w[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11242 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11243 k*nDOF_trial_element*nSpace+
11246 *dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11247 left_ebN_element*nQuadraturePoints_elementBoundary+
11250 for(jj=0;jj<nFreeDOF_element_u[right_eN_global];jj++)
11252 j = freeLocal_u[right_eN_global*nDOF_trial_element+
11254 J = offset_u + stride_u*freeGlobal_u[right_eN_global*nDOF_trial_element+
11256 jacIndex = I+J*nFreeVDOF_global;
11257 for (II=0;II<nSpace;II++)
11258 for (JJ=0;JJ<nSpace;JJ++)
11259 jac[jacIndex] += sigma*0.5*(
v[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11260 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11261 k*nDOF_trial_element+
11263 *
n[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
11264 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
11267 *a[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace2+
11268 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace2+
11272 *grad_w[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11273 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11274 k*nDOF_trial_element*nSpace+
11277 *dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11278 left_ebN_element*nQuadraturePoints_elementBoundary+
11284 for(ii=0;ii<nFreeDOF_element_r[right_eN_global];ii++)
11286 i = freeLocal_r[right_eN_global*nDOF_test_element+
11288 I = offset_r + stride_r*freeGlobal_r[right_eN_global*nDOF_test_element+
11290 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
11292 for(jj=0;jj<nFreeDOF_element_u[left_eN_global];jj++)
11294 j = freeLocal_u[left_eN_global*nDOF_trial_element+
11296 J = offset_u + stride_u*freeGlobal_u[left_eN_global*nDOF_trial_element+
11298 jacIndex = I+J*nFreeVDOF_global;
11299 for (II=0;II<nSpace;II++)
11300 for (JJ=0;JJ<nSpace;JJ++)
11301 jac[jacIndex] -= sigma*0.5*(
v[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11302 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11303 k*nDOF_trial_element+
11305 *
n[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
11306 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
11309 *a[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace2+
11310 right_ebN_element*nQuadraturePoints_elementBoundary*nSpace2+
11314 *grad_w[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11315 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11316 k*nDOF_trial_element*nSpace+
11319 *dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11320 right_ebN_element*nQuadraturePoints_elementBoundary+
11323 for(jj=0;jj<nFreeDOF_element_u[right_eN_global];jj++)
11325 j = freeLocal_u[right_eN_global*nDOF_trial_element+
11327 J = offset_u + stride_u*freeGlobal_u[right_eN_global*nDOF_trial_element+
11329 jacIndex = I+J*nFreeVDOF_global;
11330 for (II=0;II<nSpace;II++)
11331 for (JJ=0;JJ<nSpace;JJ++)
11332 jac[jacIndex] += sigma*0.5*(
v[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11333 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11334 k*nDOF_trial_element+j]
11335 *
n[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
11336 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
11339 *a[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace2+
11340 right_ebN_element*nQuadraturePoints_elementBoundary*nSpace2+
11344 *grad_w[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11345 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11346 k*nDOF_trial_element*nSpace+
11349 *dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11350 right_ebN_element*nQuadraturePoints_elementBoundary+
11359 int nQuadraturePoints_elementBoundary,
11360 int nDOF_test_element,
11361 int nDOF_trial_element,
11367 int nFreeVDOF_global,
11368 int* exteriorElementBoundaries,
11369 int* elementBoundaryElements,
11370 int* elementBoundaryLocalElementBoundaries,
11371 int* nFreeDOF_element_r,
11374 int* nFreeDOF_element_u,
11377 int* isDOFBoundary,
11386 int ebNE,ebN,eN_global,ii,i,k,jj,j,jacIndex,I,J,II,JJ,nSpace2=nSpace*nSpace;
11387 for (ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
11389 ebN = exteriorElementBoundaries[ebNE];
11390 eN_global = elementBoundaryElements[ebN*2+0];
11391 for(ii=0;ii<nFreeDOF_element_r[eN_global];ii++)
11393 i = freeLocal_r[eN_global*nDOF_test_element+
11395 I = offset_r + stride_r*freeGlobal_r[eN_global*nDOF_test_element+
11397 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
11399 for(jj=0;jj<nFreeDOF_element_u[eN_global];jj++)
11401 j = freeLocal_u[eN_global*nDOF_trial_element+
11403 J = offset_u + stride_u*freeGlobal_u[eN_global*nDOF_trial_element+
11405 jacIndex = I+J*nFreeVDOF_global;
11406 if (isDOFBoundary[ebNE*nQuadraturePoints_elementBoundary+k])
11408 for (II=0;II<nSpace;II++)
11409 for (JJ=0;JJ<nSpace;JJ++)
11411 -= sigma*(
v[ebNE*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11412 k*nDOF_trial_element+
11414 *
n[ebNE*nQuadraturePoints_elementBoundary*nSpace+
11417 *a[ebNE*nQuadraturePoints_elementBoundary*nSpace2+
11420 *grad_w[ebNE*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11421 k*nDOF_trial_element*nSpace+
11424 *dS[ebNE*nQuadraturePoints_elementBoundary+
11434 int nElementBoundaries_element,
11435 int nQuadraturePoints_elementBoundary,
11436 int nDOF_test_element,
11440 int* interiorElementBoundaries,
11441 int* elementBoundaryElements,
11442 int* elementBoundaryLocalElementBoundaries,
11451 int ebNI,ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,i,k,I,m,
nnz=rowptr[nSpace];
11452 for(ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
11454 ebN = interiorElementBoundaries[ebNI];
11455 left_eN_global = elementBoundaryElements[ebN*2+0];
11456 right_eN_global = elementBoundaryElements[ebN*2+1];
11457 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
11458 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
11459 for(i=0;i<nDOF_test_element;i++)
11460 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
11462 for (I=0;I<nSpace;I++)
11463 for (m=rowptr[I];m<rowptr[I+1];m++)
11465 residual[left_eN_global*nDOF_test_element+
11468 sigma*0.5*((
u[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11469 left_ebN_element*nQuadraturePoints_elementBoundary+
11471 -
u[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11472 right_ebN_element*nQuadraturePoints_elementBoundary+
11474 *
n[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
11475 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
11478 *a[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*
nnz+
11479 left_ebN_element*nQuadraturePoints_elementBoundary*
nnz+
11482 *grad_w[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element*nSpace+
11483 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element*nSpace+
11484 k*nDOF_test_element*nSpace+
11487 *dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11488 left_ebN_element*nQuadraturePoints_elementBoundary+
11490 residual[right_eN_global*nDOF_test_element+
11493 sigma*0.5*((
u[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11494 left_ebN_element*nQuadraturePoints_elementBoundary+
11496 -
u[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11497 right_ebN_element*nQuadraturePoints_elementBoundary+
11499 *
n[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
11500 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
11503 *a[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*
nnz+
11504 right_ebN_element*nQuadraturePoints_elementBoundary*
nnz+
11507 *grad_w[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_test_element*nSpace+
11508 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_test_element*nSpace+
11509 k*nDOF_test_element*nSpace+
11512 *dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11513 right_ebN_element*nQuadraturePoints_elementBoundary+
11521 int nQuadraturePoints_elementBoundary,
11522 int nDOF_test_element,
11526 int* isDOFBoundary,
11527 int* exteriorElementBoundaries,
11528 int* elementBoundaryElements,
11529 int* elementBoundaryLocalElementBoundaries,
11539 int ebNE,ebN,eN_global,i,k,I,m,
nnz=rowptr[nSpace];
11540 for(ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
11542 ebN = exteriorElementBoundaries[ebNE];
11543 eN_global = elementBoundaryElements[ebN*2+0];
11544 for(i=0;i<nDOF_test_element;i++)
11545 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
11547 if (isDOFBoundary[ebNE*nQuadraturePoints_elementBoundary+k])
11549 for (I=0;I<nSpace;I++)
11550 for (m=rowptr[I];m<rowptr[I+1];m++)
11552 residual[eN_global*nDOF_test_element+
11555 sigma*((
u[ebNE*nQuadraturePoints_elementBoundary+
11557 -ub[ebNE*nQuadraturePoints_elementBoundary+
11559 *
n[ebNE*nQuadraturePoints_elementBoundary*nSpace+
11562 *a[ebNE*nQuadraturePoints_elementBoundary*
nnz+
11565 *grad_w[ebNE*nQuadraturePoints_elementBoundary*nDOF_test_element*nSpace+
11566 k*nDOF_test_element*nSpace+
11569 *dS[ebNE*nQuadraturePoints_elementBoundary+
11578 int nElementBoundaries_element,
11579 int nQuadraturePoints_elementBoundary,
11580 int nDOF_test_element,
11581 int nDOF_trial_element,
11589 int nFreeVDOF_global,
11590 int* interiorElementBoundaries,
11591 int* elementBoundaryElements,
11592 int* elementBoundaryLocalElementBoundaries,
11593 int* nFreeDOF_element_r,
11596 int* nFreeDOF_element_u,
11607 int ebNI,ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,ii,i,k,jj,j,jacIndex,I,J,II,m,
nnz=rowptr[nSpace];
11608 for (ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
11610 ebN = interiorElementBoundaries[ebNI];
11611 left_eN_global = elementBoundaryElements[ebN*2+0];
11612 right_eN_global = elementBoundaryElements[ebN*2+1];
11613 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
11614 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
11616 for(ii=0;ii<nFreeDOF_element_r[left_eN_global];ii++)
11618 i = freeLocal_r[left_eN_global*nDOF_test_element+
11620 I = offset_r + stride_r*freeGlobal_r[left_eN_global*nDOF_test_element+
11622 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
11624 for(jj=0;jj<nFreeDOF_element_u[left_eN_global];jj++)
11626 j = freeLocal_u[left_eN_global*nDOF_trial_element+
11628 J = offset_u + stride_u*freeGlobal_u[left_eN_global*nDOF_trial_element+
11630 jacIndex = I+J*nFreeVDOF_global;
11631 for (II=0;II<nSpace;II++)
11632 for(m=rowptr[II];m<rowptr[II+1];m++)
11635 -= sigma*0.5*(
v[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11636 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11637 k*nDOF_trial_element+
11639 *
n[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
11640 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
11643 *a[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*
nnz+
11644 left_ebN_element*nQuadraturePoints_elementBoundary*
nnz+
11647 *grad_w[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11648 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11649 k*nDOF_trial_element*nSpace+
11652 *dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11653 left_ebN_element*nQuadraturePoints_elementBoundary+
11657 for(jj=0;jj<nFreeDOF_element_u[right_eN_global];jj++)
11659 j = freeLocal_u[right_eN_global*nDOF_trial_element+
11661 J = offset_u + stride_u*freeGlobal_u[right_eN_global*nDOF_trial_element+
11663 jacIndex = I+J*nFreeVDOF_global;
11664 for (II=0;II<nSpace;II++)
11665 for (m=rowptr[II];m<rowptr[II+1];m++)
11667 jac[jacIndex] += sigma*0.5*(
v[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11668 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11669 k*nDOF_trial_element+
11671 *
n[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
11672 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
11675 *a[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*
nnz+
11676 left_ebN_element*nQuadraturePoints_elementBoundary*
nnz+
11679 *grad_w[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11680 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11681 k*nDOF_trial_element*nSpace+
11684 *dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11685 left_ebN_element*nQuadraturePoints_elementBoundary+
11692 for(ii=0;ii<nFreeDOF_element_r[right_eN_global];ii++)
11694 i = freeLocal_r[right_eN_global*nDOF_test_element+
11696 I = offset_r + stride_r*freeGlobal_r[right_eN_global*nDOF_test_element+
11698 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
11700 for(jj=0;jj<nFreeDOF_element_u[left_eN_global];jj++)
11702 j = freeLocal_u[left_eN_global*nDOF_trial_element+
11704 J = offset_u + stride_u*freeGlobal_u[left_eN_global*nDOF_trial_element+
11706 jacIndex = I+J*nFreeVDOF_global;
11707 for (II=0;II<nSpace;II++)
11708 for (m=rowptr[II];m<rowptr[II+1];m++)
11710 jac[jacIndex] -= sigma*0.5*(
v[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11711 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11712 k*nDOF_trial_element+
11714 *
n[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
11715 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
11718 *a[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*
nnz+
11719 right_ebN_element*nQuadraturePoints_elementBoundary*
nnz+
11722 *grad_w[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11723 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11724 k*nDOF_trial_element*nSpace+
11727 *dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11728 right_ebN_element*nQuadraturePoints_elementBoundary+
11732 for(jj=0;jj<nFreeDOF_element_u[right_eN_global];jj++)
11734 j = freeLocal_u[right_eN_global*nDOF_trial_element+
11736 J = offset_u + stride_u*freeGlobal_u[right_eN_global*nDOF_trial_element+
11738 jacIndex = I+J*nFreeVDOF_global;
11739 for (II=0;II<nSpace;II++)
11740 for (m=rowptr[II];m<rowptr[II+1];m++)
11742 jac[jacIndex] += sigma*0.5*(
v[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11743 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11744 k*nDOF_trial_element+j]
11745 *
n[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
11746 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
11749 *a[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*
nnz+
11750 right_ebN_element*nQuadraturePoints_elementBoundary*
nnz+
11753 *grad_w[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11754 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11755 k*nDOF_trial_element*nSpace+
11758 *dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11759 right_ebN_element*nQuadraturePoints_elementBoundary+
11769 int nQuadraturePoints_elementBoundary,
11770 int nDOF_test_element,
11771 int nDOF_trial_element,
11779 int nFreeVDOF_global,
11780 int* exteriorElementBoundaries,
11781 int* elementBoundaryElements,
11782 int* elementBoundaryLocalElementBoundaries,
11783 int* nFreeDOF_element_r,
11786 int* nFreeDOF_element_u,
11789 int* isDOFBoundary,
11798 int ebNE,ebN,eN_global,ii,i,k,jj,j,jacIndex,I,J,II,m,
nnz=rowptr[nSpace];
11799 for (ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
11801 ebN = exteriorElementBoundaries[ebNE];
11802 eN_global = elementBoundaryElements[ebN*2+0];
11803 for(ii=0;ii<nFreeDOF_element_r[eN_global];ii++)
11805 i = freeLocal_r[eN_global*nDOF_test_element+
11807 I = offset_r + stride_r*freeGlobal_r[eN_global*nDOF_test_element+
11809 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
11811 for(jj=0;jj<nFreeDOF_element_u[eN_global];jj++)
11813 j = freeLocal_u[eN_global*nDOF_trial_element+
11815 J = offset_u + stride_u*freeGlobal_u[eN_global*nDOF_trial_element+
11817 jacIndex = I+J*nFreeVDOF_global;
11818 if (isDOFBoundary[ebNE*nQuadraturePoints_elementBoundary+k])
11820 for (II=0;II<nSpace;II++)
11821 for (m=rowptr[II];m<rowptr[II+1];m++)
11823 -= sigma*(
v[ebNE*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11824 k*nDOF_trial_element+
11826 *
n[ebNE*nQuadraturePoints_elementBoundary*nSpace+
11829 *a[ebNE*nQuadraturePoints_elementBoundary*
nnz+
11832 *grad_w[ebNE*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11833 k*nDOF_trial_element*nSpace+
11836 *dS[ebNE*nQuadraturePoints_elementBoundary+
11845 int nElementBoundaries_element,
11846 int nQuadraturePoints_elementBoundary,
11847 int nDOF_test_element,
11848 int nDOF_trial_element,
11856 int nFreeVDOF_global,
11857 int* interiorElementBoundaries,
11858 int* elementBoundaryElements,
11859 int* elementBoundaryLocalElementBoundaries,
11860 int* nFreeDOF_element_r,
11863 int* nFreeDOF_element_u,
11866 int* csrRowIndeces_ru,
11867 int* csrColumnOffsets_eb_ru,
11876 int ebNI,ebN,left_eN_global,right_eN_global,left_ebN_element,right_ebN_element,ii,i,k,jj,j,jacIndex,II,m,
nnz=rowptr[nSpace],nDOF_test_X_trial_element=nDOF_trial_element*nDOF_test_element;
11877 for (ebNI=0;ebNI<nInteriorElementBoundaries_global;ebNI++)
11879 ebN = interiorElementBoundaries[ebNI];
11880 left_eN_global = elementBoundaryElements[ebN*2+0];
11881 right_eN_global = elementBoundaryElements[ebN*2+1];
11882 left_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+0];
11883 right_ebN_element = elementBoundaryLocalElementBoundaries[ebN*2+1];
11885 for(ii=0;ii<nFreeDOF_element_r[left_eN_global];ii++)
11887 i = freeLocal_r[left_eN_global*nDOF_test_element+
11889 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
11891 for(jj=0;jj<nFreeDOF_element_u[left_eN_global];jj++)
11893 j = freeLocal_u[left_eN_global*nDOF_trial_element+
11895 jacIndex = csrRowIndeces_ru[left_eN_global*nDOF_test_element+
11898 csrColumnOffsets_eb_ru[ebN*4*nDOF_test_X_trial_element +
11899 0*2*nDOF_test_X_trial_element +
11900 0*nDOF_test_X_trial_element +
11901 ii*nDOF_trial_element +
11903 for (II=0;II<nSpace;II++)
11904 for(m=rowptr[II];m<rowptr[II+1];m++)
11905 jac[jacIndex] -= sigma*0.5*(
v[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11906 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11907 k*nDOF_trial_element+
11909 *
n[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
11910 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
11913 *a[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*
nnz+
11914 left_ebN_element*nQuadraturePoints_elementBoundary*
nnz+
11917 *grad_w[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11918 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11919 k*nDOF_trial_element*nSpace+
11922 *dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11923 left_ebN_element*nQuadraturePoints_elementBoundary+
11926 for(jj=0;jj<nFreeDOF_element_u[right_eN_global];jj++)
11928 j = freeLocal_u[right_eN_global*nDOF_trial_element+
11930 jacIndex = csrRowIndeces_ru[left_eN_global*nDOF_test_element+
11933 csrColumnOffsets_eb_ru[ebN*4*nDOF_test_X_trial_element+
11934 0*2*nDOF_test_X_trial_element+
11935 1*nDOF_test_X_trial_element+
11936 ii*nDOF_trial_element+
11938 for (II=0;II<nSpace;II++)
11939 for (m=rowptr[II];m<rowptr[II+1];m++)
11940 jac[jacIndex] += sigma*0.5*(
v[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11941 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11942 k*nDOF_trial_element+
11944 *
n[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
11945 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
11948 *a[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*
nnz+
11949 left_ebN_element*nQuadraturePoints_elementBoundary*
nnz+
11952 *grad_w[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11953 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11954 k*nDOF_trial_element*nSpace+
11957 *dS[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
11958 left_ebN_element*nQuadraturePoints_elementBoundary+
11964 for(ii=0;ii<nFreeDOF_element_r[right_eN_global];ii++)
11966 i = freeLocal_r[right_eN_global*nDOF_test_element+
11968 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
11970 for(jj=0;jj<nFreeDOF_element_u[left_eN_global];jj++)
11972 j = freeLocal_u[left_eN_global*nDOF_trial_element+
11974 jacIndex = csrRowIndeces_ru[right_eN_global*nDOF_test_element+
11977 csrColumnOffsets_eb_ru[ebN*4*nDOF_test_X_trial_element+
11978 1*2*nDOF_test_X_trial_element+
11979 0*nDOF_test_X_trial_element+
11980 ii*nDOF_trial_element+
11982 for (II=0;II<nSpace;II++)
11983 for (m=rowptr[II];m<rowptr[II+1];m++)
11984 jac[jacIndex] -= sigma*0.5*(
v[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11985 left_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
11986 k*nDOF_trial_element+
11988 *
n[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
11989 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
11992 *a[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*
nnz+
11993 right_ebN_element*nQuadraturePoints_elementBoundary*
nnz+
11996 *grad_w[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11997 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
11998 k*nDOF_trial_element*nSpace+
12001 *dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
12002 right_ebN_element*nQuadraturePoints_elementBoundary+
12005 for(jj=0;jj<nFreeDOF_element_u[right_eN_global];jj++)
12007 j = freeLocal_u[right_eN_global*nDOF_trial_element+
12009 jacIndex = csrRowIndeces_ru[right_eN_global*nDOF_test_element+
12012 csrColumnOffsets_eb_ru[ebN*4*nDOF_test_X_trial_element+
12013 1*2*nDOF_test_X_trial_element+
12014 1*nDOF_test_X_trial_element+
12015 ii*nDOF_trial_element+
12017 for (II=0;II<nSpace;II++)
12018 for (m=rowptr[II];m<rowptr[II+1];m++)
12019 jac[jacIndex] += sigma*0.5*(
v[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
12020 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element+
12021 k*nDOF_trial_element+j]
12022 *
n[left_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace+
12023 left_ebN_element*nQuadraturePoints_elementBoundary*nSpace+
12026 *a[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*
nnz+
12027 right_ebN_element*nQuadraturePoints_elementBoundary*
nnz+
12030 *grad_w[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
12031 right_ebN_element*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
12032 k*nDOF_trial_element*nSpace+
12035 *dS[right_eN_global*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
12036 right_ebN_element*nQuadraturePoints_elementBoundary+
12045 int nQuadraturePoints_elementBoundary,
12046 int nDOF_test_element,
12047 int nDOF_trial_element,
12055 int nFreeVDOF_global,
12056 int* exteriorElementBoundaries,
12057 int* elementBoundaryElements,
12058 int* elementBoundaryLocalElementBoundaries,
12059 int* nFreeDOF_element_r,
12062 int* nFreeDOF_element_u,
12065 int* csrRowIndeces_ru,
12066 int* csrColumnOffsets_eb_ru,
12067 int* isDOFBoundary,
12076 int ebNE,ebN,eN_global,ii,i,k,jj,j,jacIndex,II,m,
nnz=rowptr[nSpace],nDOF_test_X_trial_element=nDOF_trial_element*nDOF_test_element;
12077 for (ebNE=0;ebNE<nExteriorElementBoundaries_global;ebNE++)
12079 ebN = exteriorElementBoundaries[ebNE];
12080 eN_global = elementBoundaryElements[ebN*2+0];
12081 for(ii=0;ii<nFreeDOF_element_r[eN_global];ii++)
12083 i = freeLocal_r[eN_global*nDOF_test_element+
12085 for(k=0;k<nQuadraturePoints_elementBoundary;k++)
12087 for(jj=0;jj<nFreeDOF_element_u[eN_global];jj++)
12089 j = freeLocal_u[eN_global*nDOF_trial_element+
12091 jacIndex = csrRowIndeces_ru[eN_global*nDOF_test_element+
12094 csrColumnOffsets_eb_ru[ebN*4*nDOF_test_X_trial_element +
12095 0*2*nDOF_test_X_trial_element +
12096 0*nDOF_test_X_trial_element +
12097 ii*nDOF_trial_element +
12099 if (isDOFBoundary[ebNE*nQuadraturePoints_elementBoundary+k])
12101 for (II=0;II<nSpace;II++)
12102 for (m=rowptr[II];m<rowptr[II+1];m++)
12104 -= sigma*(
v[ebNE*nQuadraturePoints_elementBoundary*nDOF_trial_element+
12105 k*nDOF_trial_element+
12107 *
n[ebNE*nQuadraturePoints_elementBoundary*nSpace+
12110 *a[ebNE*nQuadraturePoints_elementBoundary*
nnz+
12113 *grad_w[ebNE*nQuadraturePoints_elementBoundary*nDOF_trial_element*nSpace+
12114 k*nDOF_trial_element*nSpace+
12117 *dS[ebNE*nQuadraturePoints_elementBoundary+
12127 int nQuadraturePoints_element,
12134 for(eN=0;eN<nElements_global;eN++)
12135 for (k=0;k<nQuadraturePoints_element;k++)
12136 for (I=0;I<nSpace;I++)
12137 f[eN*nQuadraturePoints_element*nSpace +
12141 m[eN*nQuadraturePoints_element +
12144 xt[eN*nQuadraturePoints_element*3 +
12150 int nQuadraturePoints_element,
12156 for(eN=0;eN<nElements_global;eN++)
12157 for (k=0;k<nQuadraturePoints_element;k++)
12158 for (I=0;I<nSpace;I++)
12159 f[eN*nQuadraturePoints_element*nSpace +
12163 xt[eN*nQuadraturePoints_element*3 +
12169 int nElementBoundaries_element,
12170 int nQuadraturePoints_elementBoundary,
12177 for(eN=0;eN<nElements_global;eN++)
12178 for(ebN=0;ebN<nElementBoundaries_element;ebN++)
12179 for (k=0;k<nQuadraturePoints_elementBoundary;k++)
12180 for (I=0;I<nSpace;I++)
12181 f[eN*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace +
12182 ebN*nQuadraturePoints_elementBoundary*nSpace+
12186 m[eN*nElementBoundaries_element*nQuadraturePoints_elementBoundary+
12187 ebN*nQuadraturePoints_elementBoundary+
12190 xt[eN*nElementBoundaries_element*nQuadraturePoints_elementBoundary*3+
12191 ebN*nQuadraturePoints_elementBoundary*3+
12197 int nElementBoundaries_element,
12198 int nQuadraturePoints_elementBoundary,
12204 for(eN=0;eN<nElements_global;eN++)
12205 for(ebN=0;ebN<nElementBoundaries_element;ebN++)
12206 for (k=0;k<nQuadraturePoints_elementBoundary;k++)
12207 for (I=0;I<nSpace;I++)
12208 f[eN*nElementBoundaries_element*nQuadraturePoints_elementBoundary*nSpace +
12209 ebN*nQuadraturePoints_elementBoundary*nSpace+
12213 xt[eN*nElementBoundaries_element*nQuadraturePoints_elementBoundary*3+
12214 ebN*nQuadraturePoints_elementBoundary*3+
12220 int nQuadraturePoints_element,
12221 int nDOF_test_element,
12225 double* weak_residual_x,
12226 double* weak_residual_y,
12227 double* weak_residual_z)
12229 int eN,i,k,I,J,nSpace2=nSpace*nSpace;
12230 for(eN=0;eN<nElements_global;eN++)
12231 for (i=0;i<nDOF_test_element;i++)
12232 for (k=0;k<nQuadraturePoints_element;k++)
12233 for (J=0;J<nSpace;J++)
12236 weak_residual_x[eN*nDOF_test_element + i]
12238 sigma[eN*nQuadraturePoints_element*nSpace2+
12243 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
12244 k*nDOF_test_element*nSpace +
12248 weak_residual_y[eN*nDOF_test_element + i]
12250 sigma[eN*nQuadraturePoints_element*nSpace2+
12255 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
12256 k*nDOF_test_element*nSpace +
12260 weak_residual_z[eN*nDOF_test_element + i]
12262 sigma[eN*nQuadraturePoints_element*nSpace2+
12267 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
12268 k*nDOF_test_element*nSpace +
12275 int nQuadraturePoints_element,
12276 int nDOF_trial_element,
12277 int nDOF_test_element,
12290 double* jacobian_weak_residual_xx,
12291 double* jacobian_weak_residual_xy,
12292 double* jacobian_weak_residual_xz,
12293 double* jacobian_weak_residual_yx,
12294 double* jacobian_weak_residual_yy,
12295 double* jacobian_weak_residual_yz,
12296 double* jacobian_weak_residual_zx,
12297 double* jacobian_weak_residual_zy,
12298 double* jacobian_weak_residual_zz)
12300 int eN,i,j,k,I,J,nDOF_test_X_trial_element=nDOF_test_element*nDOF_trial_element,nSpace2=nSpace*nSpace;
12301 for(eN=0;eN<nElements_global;eN++)
12302 for (i=0;i<nDOF_test_element;i++)
12303 for (k=0;k<nQuadraturePoints_element;k++)
12304 for (j=0;j<nDOF_trial_element;j++)
12305 for (I=0;I<nSpace;I++)
12306 for(J=0;J<nSpace;J++)
12309 jacobian_weak_residual_xx[eN*nDOF_test_X_trial_element +
12310 i*nDOF_trial_element +
12313 dsigma_xx[eN*nQuadraturePoints_element*nSpace2 +
12318 grad_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace +
12319 k*nDOF_trial_element*nSpace +
12323 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
12324 k*nDOF_test_element*nSpace +
12327 jacobian_weak_residual_xy[eN*nDOF_test_X_trial_element +
12328 i*nDOF_trial_element +
12331 dsigma_xy[eN*nQuadraturePoints_element*nSpace2 +
12336 grad_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace +
12337 k*nDOF_trial_element*nSpace +
12341 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
12342 k*nDOF_test_element*nSpace +
12345 jacobian_weak_residual_xz[eN*nDOF_test_X_trial_element +
12346 i*nDOF_trial_element +
12349 dsigma_xz[eN*nQuadraturePoints_element*nSpace2 +
12354 grad_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace +
12355 k*nDOF_trial_element*nSpace +
12359 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
12360 k*nDOF_test_element*nSpace +
12364 jacobian_weak_residual_yx[eN*nDOF_test_X_trial_element +
12365 i*nDOF_trial_element +
12368 dsigma_yx[eN*nQuadraturePoints_element*nSpace2 +
12373 grad_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace +
12374 k*nDOF_trial_element*nSpace +
12378 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
12379 k*nDOF_test_element*nSpace +
12382 jacobian_weak_residual_yy[eN*nDOF_test_X_trial_element +
12383 i*nDOF_trial_element +
12386 dsigma_yy[eN*nQuadraturePoints_element*nSpace2 +
12391 grad_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace +
12392 k*nDOF_trial_element*nSpace +
12396 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
12397 k*nDOF_test_element*nSpace +
12400 jacobian_weak_residual_yz[eN*nDOF_test_X_trial_element +
12401 i*nDOF_trial_element +
12404 dsigma_yz[eN*nQuadraturePoints_element*nSpace2 +
12409 grad_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace +
12410 k*nDOF_trial_element*nSpace +
12414 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
12415 k*nDOF_test_element*nSpace +
12419 jacobian_weak_residual_zx[eN*nDOF_test_X_trial_element +
12420 i*nDOF_trial_element +
12423 dsigma_zx[eN*nQuadraturePoints_element*nSpace2 +
12428 grad_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace +
12429 k*nDOF_trial_element*nSpace +
12433 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
12434 k*nDOF_test_element*nSpace +
12437 jacobian_weak_residual_zy[eN*nDOF_test_X_trial_element +
12438 i*nDOF_trial_element +
12441 dsigma_zy[eN*nQuadraturePoints_element*nSpace2 +
12446 grad_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace +
12447 k*nDOF_trial_element*nSpace +
12451 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
12452 k*nDOF_test_element*nSpace +
12455 jacobian_weak_residual_zz[eN*nDOF_test_X_trial_element +
12456 i*nDOF_trial_element +
12459 dsigma_zz[eN*nQuadraturePoints_element*nSpace2 +
12464 grad_v[eN*nQuadraturePoints_element*nDOF_trial_element*nSpace +
12465 k*nDOF_trial_element*nSpace +
12469 grad_w_dV[eN*nQuadraturePoints_element*nDOF_test_element*nSpace +
12470 k*nDOF_test_element*nSpace +
12481 const int * functional_map_element,
12482 const double * interpolationValues,
12488 for (eN = 0; eN < nElements_global; eN++)
12490 for (i=0; i < nDOF_element; i++)
12492 k = functional_map_element[i];
12494 for (j=0; j < dim_dof; j++)
12499 dofs[l2g[eN*nDOF_element+i]*dim_dof + j] = interpolationValues[eN*nDOF_element*dim_dof + k*dim_dof + j];