9.2
general documentation
cs_quadrature.h
Go to the documentation of this file.
1#ifndef CS_QUADRATURE_H
2#define CS_QUADRATURE_H
3
4/*============================================================================
5 * Functions to handle quadrature rules
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2026 EDF S.A.
12
13 This program is free software; you can redistribute it and/or modify it under
14 the terms of the GNU General Public License as published by the Free Software
15 Foundation; either version 2 of the License, or (at your option) any later
16 version.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 details.
22
23 You should have received a copy of the GNU General Public License along with
24 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25 Street, Fifth Floor, Boston, MA 02110-1301, USA.
26*/
27
28/*----------------------------------------------------------------------------
29 * Local headers
30 *----------------------------------------------------------------------------*/
31
32#include "base/cs_base.h"
33#include "base/cs_defs.h"
34#include "base/cs_math.h"
35#include "base/cs_param_types.h"
36#include "bft/bft_error.h"
37#include "cdo/cs_flag.h"
38
39/*============================================================================
40 * Macro definitions
41 *============================================================================*/
42
43/*============================================================================
44 * Type definitions
45 *============================================================================*/
46
79typedef enum {
80
82 CS_QUADRATURE_BARY, /* Value at the barycenter * meas */
83 CS_QUADRATURE_BARY_SUBDIV, /* Value at the barycenter * meas on a sub-mesh */
84 CS_QUADRATURE_HIGHER, /* Unique weight but several Gauss points */
85 CS_QUADRATURE_HIGHEST, /* Specific weight for each Gauss points */
87
89
90/*----------------------------------------------------------------------------*/
101/*----------------------------------------------------------------------------*/
102
103typedef void
105 const cs_real_3_t v2,
106 double len,
107 cs_real_3_t gpts[],
108 double *weights);
109
110/*----------------------------------------------------------------------------*/
122/*----------------------------------------------------------------------------*/
123
124typedef void
126 const cs_real_3_t v2,
127 const cs_real_3_t v3,
128 double area,
129 cs_real_3_t gpts[],
130 double *weights);
131
132/*----------------------------------------------------------------------------*/
144/*----------------------------------------------------------------------------*/
145
146typedef void
148 const cs_real_3_t v2,
149 const cs_real_3_t v3,
150 const cs_real_3_t v4,
151 double vol,
152 cs_real_3_t gpts[],
153 double weights[]);
154
155/*----------------------------------------------------------------------------*/
168/*----------------------------------------------------------------------------*/
169
170typedef void
172 const cs_real_3_t v1,
173 const cs_real_3_t v2,
174 double len,
176 void *input,
177 double results[]);
178
179/*----------------------------------------------------------------------------*/
193/*----------------------------------------------------------------------------*/
194
195typedef void
197 const cs_real_3_t v1,
198 const cs_real_3_t v2,
199 const cs_real_3_t v3,
200 double area,
202 void *input,
203 double results[]);
204
205/*----------------------------------------------------------------------------*/
220/*----------------------------------------------------------------------------*/
221
222typedef void
224 const cs_real_3_t v1,
225 const cs_real_3_t v2,
226 const cs_real_3_t v3,
227 const cs_real_3_t v4,
228 double vol,
230 void *input,
231 double results[]);
232
233/*----------------------------------------------------------------------------*/
247/*----------------------------------------------------------------------------*/
248
249typedef void(cs_quadrature_hexa_integral_t)(double tcur,
250 const cs_real_3_t vb,
251 const double hx,
252 const double hy,
253 const double hz,
255 void *input,
256 double results[]);
257
258/*============================================================================
259 * Public function prototypes
260 *============================================================================*/
261
262/*----------------------------------------------------------------------------*/
266/*----------------------------------------------------------------------------*/
267
268void
270
271/*----------------------------------------------------------------------------*/
279/*----------------------------------------------------------------------------*/
280
281const char *
283
284/*----------------------------------------------------------------------------*/
295/*----------------------------------------------------------------------------*/
296
297static inline void
299 const cs_real_3_t v2,
300 double len,
301 cs_real_3_t gpts[],
302 double *w)
303{
304 gpts[0][0] = 0.5*(v1[0] + v2[0]);
305 gpts[0][1] = 0.5*(v1[1] + v2[1]);
306 gpts[0][2] = 0.5*(v1[2] + v2[2]);
307 w[0] = len;
308}
309
310/*----------------------------------------------------------------------------*/
321/*----------------------------------------------------------------------------*/
322
323void
325 const cs_real_3_t v2,
326 double len,
327 cs_real_3_t gpts[],
328 double *w);
329
330/*----------------------------------------------------------------------------*/
341/*----------------------------------------------------------------------------*/
342
343void
345 const cs_real_3_t v2,
346 double len,
347 cs_real_3_t gpts[],
348 double w[]);
349
350/*----------------------------------------------------------------------------*/
362/*----------------------------------------------------------------------------*/
363
364static inline void
366 const double hx,
367 const double hy,
368 const double hz,
369 cs_real_3_t gpts[],
370 double *w)
371{
372 gpts[0][0] = vb[0];
373 gpts[0][1] = vb[1];
374 gpts[0][2] = vb[2];
375 w[0] = hx * hy * hz;
376}
377
378/*----------------------------------------------------------------------------*/
390/*----------------------------------------------------------------------------*/
391
393 const double hx,
394 const double hy,
395 const double hz,
396 cs_real_3_t gpts[],
397 double *w);
398
399/*----------------------------------------------------------------------------*/
411/*----------------------------------------------------------------------------*/
412
414 const double hx,
415 const double hy,
416 const double hz,
417 cs_real_3_t gpts[],
418 double w[]);
419
420/*----------------------------------------------------------------------------*/
432/*----------------------------------------------------------------------------*/
433
434static inline void
436 const cs_real_3_t v2,
437 const cs_real_3_t v3,
438 double area,
439 cs_real_3_t gpts[],
440 double *w)
441{
442 constexpr cs_real_t c_1ov3 = 1./3.;
443
444 gpts[0][0] = c_1ov3 * (v1[0] + v2[0] + v3[0]);
445 gpts[0][1] = c_1ov3 * (v1[1] + v2[1] + v3[1]);
446 gpts[0][2] = c_1ov3 * (v1[2] + v2[2] + v3[2]);
447 w[0] = area;
448}
449
450/*----------------------------------------------------------------------------*/
462/*----------------------------------------------------------------------------*/
463
464void
466 const cs_real_3_t v2,
467 const cs_real_3_t v3,
468 double area,
469 cs_real_3_t gpts[],
470 double *w);
471
472/*----------------------------------------------------------------------------*/
484/*----------------------------------------------------------------------------*/
485
486void
488 const cs_real_3_t v2,
489 const cs_real_3_t v3,
490 double area,
491 cs_real_3_t gpts[],
492 double w[]);
493
494/*----------------------------------------------------------------------------*/
506/*----------------------------------------------------------------------------*/
507
508void
510 const cs_real_3_t v2,
511 const cs_real_3_t v3,
512 double area,
513 cs_real_3_t gpts[],
514 double w[]);
515
516/*----------------------------------------------------------------------------*/
529/*----------------------------------------------------------------------------*/
530
531static inline void
533 const cs_real_3_t v2,
534 const cs_real_3_t v3,
535 const cs_real_3_t v4,
536 double vol,
537 cs_real_3_t gpts[],
538 double weight[])
539{
540 gpts[0][0] = 0.25 * (v1[0] + v2[0] + v3[0] + v4[0]);
541 gpts[0][1] = 0.25 * (v1[1] + v2[1] + v3[1] + v4[1]);
542 gpts[0][2] = 0.25 * (v1[2] + v2[2] + v3[2] + v4[2]);
543 weight[0] = vol;
544}
545
546/*----------------------------------------------------------------------------*/
559/*----------------------------------------------------------------------------*/
560
561void
563 const cs_real_3_t v2,
564 const cs_real_3_t v3,
565 const cs_real_3_t v4,
566 double vol,
567 cs_real_3_t gpts[],
568 double weights[]);
569
570/*----------------------------------------------------------------------------*/
583/*----------------------------------------------------------------------------*/
584
585void
587 const cs_real_3_t v2,
588 const cs_real_3_t v3,
589 const cs_real_3_t v4,
590 double vol,
591 cs_real_3_t gpts[],
592 double weights[]);
593
594/*----------------------------------------------------------------------------*/
607/*----------------------------------------------------------------------------*/
608
609void
611 const cs_real_3_t v2,
612 const cs_real_3_t v3,
613 const cs_real_3_t v4,
614 double vol,
615 cs_real_3_t gpts[],
616 double weights[]);
617
618/*----------------------------------------------------------------------------*/
632/*----------------------------------------------------------------------------*/
633
634static inline void
636 const cs_real_3_t v1,
637 const cs_real_3_t v2,
638 double len,
640 void *input,
641 double results[])
642{
643 cs_real_3_t xg;
644 double feval;
645
646 /* Copied from cs_quadrature_1pt */
647 xg[0] = .5 * (v1[0] + v2[0]);
648 xg[1] = .5 * (v1[1] + v2[1]);
649 xg[2] = .5 * (v1[2] + v2[2]);
650
651 /* Evaluate the function at the Gauss points */
652 ana(tcur, 1, NULL, xg, false, input, &feval);
653
654 /* Update the result with the quadrature rule */
655 *results += len * feval;
656}
657
658/*----------------------------------------------------------------------------*/
672/*----------------------------------------------------------------------------*/
673
674static inline void
676 const cs_real_3_t v1,
677 const cs_real_3_t v2,
678 double len,
680 void *input,
681 double results[])
682{
683 cs_real_3_t gauss_pts[2];
684 double feval[2], weights[2];
685
686 /* Compute Gauss points and its unique weight */
687 cs_quadrature_edge_2pts(v1, v2, len, gauss_pts, weights);
688
689 /* Evaluate the function at the Gauss points */
690 ana(tcur, 2, NULL, (const cs_real_t *)gauss_pts, false, input, feval);
691
692 /* Update the result with the quadrature rule */
693 *results += weights[0] * feval[0] + weights[1] * feval[1];
694}
695
696/*----------------------------------------------------------------------------*/
710/*----------------------------------------------------------------------------*/
711
712static inline void
714 const cs_real_3_t v1,
715 const cs_real_3_t v2,
716 double len,
718 void *input,
719 double results[])
720{
721 cs_real_3_t gauss_pts[3];
722 double feval[3], weights[3];
723
724 /* Compute Gauss points and its weights */
725 cs_quadrature_edge_3pts(v1, v2, len, gauss_pts, weights);
726
727 /* Evaluate the function at the Gauss points */
728 ana(tcur, 3, NULL, (const cs_real_t *)gauss_pts, false, input, feval);
729
730 /* Update the result with the quadrature rule */
731 *results += weights[0]*feval[0] + weights[1]*feval[1] + weights[2]*feval[2];
732}
733
734/*----------------------------------------------------------------------------*/
748/*----------------------------------------------------------------------------*/
749
750static inline void
752 const cs_real_3_t v1,
753 const cs_real_3_t v2,
754 double len,
756 void *input,
757 double results[])
758{
759 cs_real_3_t xg;
760 double feval[3];
761
762 /* Copied from cs_quadrature_1pt */
763 xg[0] = .5 * (v1[0] + v2[0]);
764 xg[1] = .5 * (v1[1] + v2[1]);
765 xg[2] = .5 * (v1[2] + v2[2]);
766
767 /* Evaluate the function at the Gauss points */
768 ana(tcur, 1, NULL, xg, false, input, feval);
769
770 /* Update the result with the quadrature rule */
771 results[0] += len * feval[0];
772 results[1] += len * feval[1];
773 results[2] += len * feval[2];
774}
775
776/*----------------------------------------------------------------------------*/
790/*----------------------------------------------------------------------------*/
791
792static inline void
794 const cs_real_3_t v1,
795 const cs_real_3_t v2,
796 double len,
798 void *input,
799 double results[])
800{
801 cs_real_3_t gauss_pts[2];
802 double feval[6], weights[2];
803
804 /* Compute Gauss points and its unique weight */
805 cs_quadrature_edge_2pts(v1, v2, len, gauss_pts, weights);
806
807 /* Evaluate the function at the Gauss points */
808 ana(tcur, 2, NULL, (const cs_real_t *)gauss_pts, false, input, feval);
809
810 /* Update the result with the quadrature rule */
811 results[0] += weights[0] * feval[0] + weights[1] * feval[3];
812 results[1] += weights[0] * feval[1] + weights[1] * feval[4];
813 results[2] += weights[0] * feval[2] + weights[1] * feval[5];
814}
815
816/*----------------------------------------------------------------------------*/
830/*----------------------------------------------------------------------------*/
831
832static inline void
834 const cs_real_3_t v1,
835 const cs_real_3_t v2,
836 double len,
838 void *input,
839 double results[])
840{
841 cs_real_3_t gauss_pts[3];
842 double feval[9], weights[3];
843
844 /* Compute Gauss points and its weights */
845 cs_quadrature_edge_3pts(v1, v2, len, gauss_pts, weights);
846
847 /* Evaluate the function at the Gauss points */
848 ana(tcur, 3, NULL, (const cs_real_t *)gauss_pts, false, input, feval);
849
850 /* Update the result with the quadrature rule */
851 for (int p = 0; p < 3; p++) {
852 results[0] += weights[p] * feval[3*p ];
853 results[1] += weights[p] * feval[3*p+1];
854 results[2] += weights[p] * feval[3*p+2];
855 }
856}
857
858/*----------------------------------------------------------------------------*/
873/*----------------------------------------------------------------------------*/
874
875static inline void
877 const cs_real_3_t v1,
878 const cs_real_3_t v2,
879 const cs_real_3_t v3,
880 double area,
882 void *input,
883 double results[])
884{
885 cs_real_3_t xg;
886 double evaluation;
887
888 /* Copied from cs_quadrature_1pt */
889 constexpr cs_real_t c_1ov3 = 1./3.;
890
891 xg[0] = c_1ov3 * (v1[0] + v2[0] + v3[0]);
892 xg[1] = c_1ov3 * (v1[1] + v2[1] + v3[1]);
893 xg[2] = c_1ov3 * (v1[2] + v2[2] + v3[2]);
894
895 ana(tcur, 1, NULL, xg, false, input, &evaluation);
896
897 *results += area * evaluation;
898}
899
900/*----------------------------------------------------------------------------*/
915/*----------------------------------------------------------------------------*/
916
917static inline void
919 const cs_real_3_t v1,
920 const cs_real_3_t v2,
921 const cs_real_3_t v3,
922 double area,
924 void *input,
925 double results[])
926{
927 cs_real_3_t gauss_pts[3];
928 double evaluation[3], weights[3];
929
930 /* Compute Gauss points and its unique weight */
931 cs_quadrature_tria_3pts(v1, v2, v3, area, gauss_pts, weights);
932
933 ana(tcur, 3, NULL, (const cs_real_t *)gauss_pts, false, input, evaluation);
934
935 /* Return results */
936 *results += weights[0] * evaluation[0] + weights[1] * evaluation[1] +
937 weights[2] * evaluation[2];
938}
939
940/*----------------------------------------------------------------------------*/
955/*----------------------------------------------------------------------------*/
956
957static inline void
959 const cs_real_3_t v1,
960 const cs_real_3_t v2,
961 const cs_real_3_t v3,
962 double area,
964 void *input,
965 double results[])
966{
967 cs_real_3_t gauss_pts[4];
968 double evaluation[4], weights[4];
969
970 /* Compute Gauss points and its weights */
971 cs_quadrature_tria_4pts(v1, v2, v3, area, gauss_pts, weights);
972
973 ana(tcur, 4, NULL, (const cs_real_t *)gauss_pts, false, input, evaluation);
974
975 *results += weights[0] * evaluation[0] + weights[1] * evaluation[1] +
976 weights[2] * evaluation[2] + weights[3] * evaluation[3];
977}
978
979/*----------------------------------------------------------------------------*/
994/*----------------------------------------------------------------------------*/
995
996static inline void
998 const cs_real_3_t v1,
999 const cs_real_3_t v2,
1000 const cs_real_3_t v3,
1001 double area,
1002 cs_analytic_func_t *ana,
1003 void *input,
1004 double results[])
1005{
1006 cs_real_3_t gauss_pts[7];
1007 double evaluation[7], weights[7];
1008
1009 /* Compute Gauss points and its weights */
1010 cs_quadrature_tria_7pts(v1, v2, v3, area, gauss_pts, weights);
1011
1012 ana(tcur, 7, NULL, (const cs_real_t *)gauss_pts, false, input, evaluation);
1013
1014 *results += weights[0] * evaluation[0] + weights[1] * evaluation[1] +
1015 weights[2] * evaluation[2] + weights[3] * evaluation[3] +
1016 weights[4] * evaluation[4] + weights[5] * evaluation[5] +
1017 weights[6] * evaluation[6] ;
1018}
1019
1020/*----------------------------------------------------------------------------*/
1035/*----------------------------------------------------------------------------*/
1036
1037static inline void
1039 const cs_real_3_t v1,
1040 const cs_real_3_t v2,
1041 const cs_real_3_t v3,
1042 double area,
1043 cs_analytic_func_t *ana,
1044 void *input,
1045 double results[])
1046{
1047 cs_real_3_t xg;
1048 double evaluation[3];
1049
1050 /* Copied from cs_quadrature_1pt */
1051 constexpr cs_real_t c_1ov3 = 1./3.;
1052
1053 xg[0] = c_1ov3 * (v1[0] + v2[0] + v3[0]);
1054 xg[1] = c_1ov3 * (v1[1] + v2[1] + v3[1]);
1055 xg[2] = c_1ov3 * (v1[2] + v2[2] + v3[2]);
1056
1057 ana(tcur, 1, NULL, xg, false, input, evaluation);
1058
1059 results[0] += area * evaluation[0];
1060 results[1] += area * evaluation[1];
1061 results[2] += area * evaluation[2];
1062}
1063
1064/*----------------------------------------------------------------------------*/
1079/*----------------------------------------------------------------------------*/
1080
1081static inline void
1083 const cs_real_3_t v1,
1084 const cs_real_3_t v2,
1085 const cs_real_3_t v3,
1086 double area,
1087 cs_analytic_func_t *ana,
1088 void *input,
1089 double results[])
1090{
1091 cs_real_3_t gauss_pts[3];
1092 double evaluation[3*3], weights[3];
1093
1094 /* Compute Gauss points and its unique weight */
1095 cs_quadrature_tria_3pts(v1, v2, v3, area, gauss_pts, weights);
1096
1097 ana(tcur, 3, NULL, (const cs_real_t *)gauss_pts, false, input, evaluation);
1098
1099 for (int p = 0; p < 3; p++) {
1100 results[0] += weights[p] * evaluation[3*p ];
1101 results[1] += weights[p] * evaluation[3*p+1];
1102 results[2] += weights[p] * evaluation[3*p+2];
1103 }
1104}
1105
1106/*----------------------------------------------------------------------------*/
1121/*----------------------------------------------------------------------------*/
1122
1123static inline void
1125 const cs_real_3_t v1,
1126 const cs_real_3_t v2,
1127 const cs_real_3_t v3,
1128 double area,
1129 cs_analytic_func_t *ana,
1130 void *input,
1131 double results[])
1132{
1133 cs_real_3_t gauss_pts[4];
1134 double evaluation[3*4], weights[4];
1135
1136 /* Compute Gauss points and its weights */
1137 cs_quadrature_tria_4pts(v1, v2, v3, area, gauss_pts, weights);
1138
1139 ana(tcur, 4, NULL, (const cs_real_t *)gauss_pts, false, input, evaluation);
1140
1141 for (int p = 0; p < 4; p++) {
1142 results[0] += weights[p] * evaluation[3*p ];
1143 results[1] += weights[p] * evaluation[3*p+1];
1144 results[2] += weights[p] * evaluation[3*p+2];
1145 }
1146}
1147
1148/*----------------------------------------------------------------------------*/
1163/*----------------------------------------------------------------------------*/
1164
1165static inline void
1167 const cs_real_3_t v1,
1168 const cs_real_3_t v2,
1169 const cs_real_3_t v3,
1170 double area,
1171 cs_analytic_func_t *ana,
1172 void *input,
1173 double results[])
1174{
1175 cs_real_3_t gauss_pts[7];
1176 double evaluation[3*7], weights[7];
1177
1178 /* Compute Gauss points and its weights */
1179 cs_quadrature_tria_7pts(v1, v2, v3, area, gauss_pts, weights);
1180
1181 ana(tcur, 7, NULL, (const cs_real_t *)gauss_pts, false, input, evaluation);
1182
1183 for (int p = 0; p < 7; p++) {
1184 results[0] += weights[p] * evaluation[3*p ];
1185 results[1] += weights[p] * evaluation[3*p+1];
1186 results[2] += weights[p] * evaluation[3*p+2];
1187 }
1188}
1189
1190/*----------------------------------------------------------------------------*/
1205/*----------------------------------------------------------------------------*/
1206
1207static inline void
1209 const cs_real_3_t v1,
1210 const cs_real_3_t v2,
1211 const cs_real_3_t v3,
1212 double area,
1213 cs_analytic_func_t *ana,
1214 void *input,
1215 double results[])
1216{
1217 cs_real_3_t xg;
1218 double evaluation[9];
1219
1220 /* Copied from cs_quadrature_1pt */
1221 constexpr cs_real_t c_1ov3 = 1./3.;
1222
1223 xg[0] = c_1ov3 * (v1[0] + v2[0] + v3[0]);
1224 xg[1] = c_1ov3 * (v1[1] + v2[1] + v3[1]);
1225 xg[2] = c_1ov3 * (v1[2] + v2[2] + v3[2]);
1226
1227 ana(tcur, 1, NULL, xg, false, input, evaluation);
1228
1229 for (short int ij = 0; ij < 9; ij++)
1230 results[ij] += area * evaluation[ij];
1231}
1232
1233/*----------------------------------------------------------------------------*/
1248/*----------------------------------------------------------------------------*/
1249
1250static inline void
1252 const cs_real_3_t v1,
1253 const cs_real_3_t v2,
1254 const cs_real_3_t v3,
1255 double area,
1256 cs_analytic_func_t *ana,
1257 void *input,
1258 double results[])
1259{
1260 cs_real_3_t gauss_pts[3];
1261 double evaluation[9*3], weights[3];
1262
1263 /* Compute Gauss points and its unique weight */
1264 cs_quadrature_tria_3pts(v1, v2, v3, area, gauss_pts, weights);
1265
1266 ana(tcur, 3, NULL, (const cs_real_t *)gauss_pts, false, input, evaluation);
1267
1268 for (int p = 0; p < 3; p++) {
1269 const double wp = weights[p];
1270 double *eval_p = evaluation + 9*p;
1271 for (short int ij = 0; ij < 9; ij++)
1272 results[ij] += wp * eval_p[ij];
1273 }
1274}
1275
1276/*----------------------------------------------------------------------------*/
1291/*----------------------------------------------------------------------------*/
1292
1293static inline void
1295 const cs_real_3_t v1,
1296 const cs_real_3_t v2,
1297 const cs_real_3_t v3,
1298 double area,
1299 cs_analytic_func_t *ana,
1300 void *input,
1301 double results[])
1302{
1303 cs_real_3_t gauss_pts[4];
1304 double evaluation[9*4], weights[4];
1305
1306 /* Compute Gauss points and its weights */
1307 cs_quadrature_tria_4pts(v1, v2, v3, area, gauss_pts, weights);
1308
1309 ana(tcur, 4, NULL, (const cs_real_t *)gauss_pts, false, input, evaluation);
1310
1311 for (int p = 0; p < 4; p++) {
1312 const double wp = weights[p];
1313 double *eval_p = evaluation + 9*p;
1314 for (short int ij = 0; ij < 9; ij++)
1315 results[ij] += wp * eval_p[ij];
1316 }
1317}
1318
1319/*----------------------------------------------------------------------------*/
1334/*----------------------------------------------------------------------------*/
1335
1336static inline void
1338 const cs_real_3_t v1,
1339 const cs_real_3_t v2,
1340 const cs_real_3_t v3,
1341 double area,
1342 cs_analytic_func_t *ana,
1343 void *input,
1344 double results[])
1345{
1346 cs_real_3_t gauss_pts[7];
1347 double evaluation[9*7], weights[7];
1348
1349 /* Compute Gauss points and its weights */
1350 cs_quadrature_tria_7pts(v1, v2, v3, area, gauss_pts, weights);
1351
1352 ana(tcur, 7, NULL, (const cs_real_t *)gauss_pts, false, input, evaluation);
1353
1354 for (int p = 0; p < 7; p++) {
1355 const double wp = weights[p];
1356 double *eval_p = evaluation + 9*p;
1357 for (short int ij = 0; ij < 9; ij++)
1358 results[ij] += wp * eval_p[ij];
1359 }
1360}
1361
1362/*----------------------------------------------------------------------------*/
1378/*----------------------------------------------------------------------------*/
1379
1380static inline void
1382 const cs_real_3_t v1,
1383 const cs_real_3_t v2,
1384 const cs_real_3_t v3,
1385 const cs_real_3_t v4,
1386 double vol,
1387 cs_analytic_func_t *ana,
1388 void *input,
1389 double results[])
1390{
1391 cs_real_3_t xg;
1392 double evaluation;
1393
1394 /* Copied from cs_quadrature_tet_1pt */
1395 xg[0] = 0.25 * (v1[0] + v2[0] + v3[0] + v4[0]);
1396 xg[1] = 0.25 * (v1[1] + v2[1] + v3[1] + v4[1]);
1397 xg[2] = 0.25 * (v1[2] + v2[2] + v3[2] + v4[2]);
1398
1399 ana(tcur, 1, NULL, xg, false, input, &evaluation);
1400
1401 *results += vol * evaluation;
1402}
1403
1404/*----------------------------------------------------------------------------*/
1420/*----------------------------------------------------------------------------*/
1421
1422static inline void
1424 const cs_real_3_t v1,
1425 const cs_real_3_t v2,
1426 const cs_real_3_t v3,
1427 const cs_real_3_t v4,
1428 double vol,
1429 cs_analytic_func_t *ana,
1430 void *input,
1431 double results[])
1432{
1433 cs_real_3_t gauss_pts[4];
1434 double evaluation[4], weights[4];
1435
1436 /* Compute Gauss points and its unique weight */
1437 cs_quadrature_tet_4pts(v1, v2, v3, v4, vol, gauss_pts, weights);
1438
1439 ana(tcur, 4, NULL, (const cs_real_t *)gauss_pts, false, input, evaluation);
1440
1441 /* Return results */
1442 *results += weights[0] * evaluation[0] + weights[1] * evaluation[1] +
1443 weights[2] * evaluation[2] + weights[3] * evaluation[3];
1444}
1445
1446/*----------------------------------------------------------------------------*/
1462/*----------------------------------------------------------------------------*/
1463
1464static inline void
1466 const cs_real_3_t v1,
1467 const cs_real_3_t v2,
1468 const cs_real_3_t v3,
1469 const cs_real_3_t v4,
1470 double vol,
1471 cs_analytic_func_t *ana,
1472 void *input,
1473 double results[])
1474{
1475 cs_real_3_t gauss_pts[5];
1476 double evaluation[5], weights[5];
1477
1478 /* Compute Gauss points and its weights */
1479 cs_quadrature_tet_5pts(v1, v2, v3, v4, vol, gauss_pts, weights);
1480
1481 ana(tcur, 5, NULL, (const cs_real_t *)gauss_pts, false, input, evaluation);
1482
1483 *results += weights[0] * evaluation[0] + weights[1] * evaluation[1] +
1484 weights[2] * evaluation[2] + weights[3] * evaluation[3] +
1485 weights[4] * evaluation[4];
1486}
1487
1488/*----------------------------------------------------------------------------*/
1504/*----------------------------------------------------------------------------*/
1505
1506static inline void
1508 const cs_real_3_t v1,
1509 const cs_real_3_t v2,
1510 const cs_real_3_t v3,
1511 const cs_real_3_t v4,
1512 double vol,
1513 cs_analytic_func_t *ana,
1514 void *input,
1515 double results[])
1516{
1517 cs_real_3_t xg;
1518 double evaluation[3];
1519
1520 /* Copied from cs_quadrature_tet_1pt */
1521 xg[0] = 0.25 * (v1[0] + v2[0] + v3[0] + v4[0]);
1522 xg[1] = 0.25 * (v1[1] + v2[1] + v3[1] + v4[1]);
1523 xg[2] = 0.25 * (v1[2] + v2[2] + v3[2] + v4[2]);
1524
1525 ana(tcur, 1, NULL, xg, false, input, evaluation);
1526
1527 results[0] += vol * evaluation[0];
1528 results[1] += vol * evaluation[1];
1529 results[2] += vol * evaluation[2];
1530}
1531
1532/*----------------------------------------------------------------------------*/
1548/*----------------------------------------------------------------------------*/
1549
1550static inline void
1552 const cs_real_3_t v1,
1553 const cs_real_3_t v2,
1554 const cs_real_3_t v3,
1555 const cs_real_3_t v4,
1556 double vol,
1557 cs_analytic_func_t *ana,
1558 void *input,
1559 double results[])
1560{
1561 cs_real_3_t gauss_pts[4];
1562 double evaluation[3*4], weights[4];
1563
1564 /* Compute Gauss points and its unique weight */
1565 cs_quadrature_tet_4pts(v1, v2, v3, v4, vol, gauss_pts, weights);
1566
1567 ana(tcur, 4, NULL, (const cs_real_t *)gauss_pts, false, input, evaluation);
1568
1569 for (int p = 0; p < 4; p++) {
1570 results[0] += weights[p] * evaluation[3*p ];
1571 results[1] += weights[p] * evaluation[3*p+1];
1572 results[2] += weights[p] * evaluation[3*p+2];
1573 }
1574}
1575
1576/*----------------------------------------------------------------------------*/
1592/*----------------------------------------------------------------------------*/
1593
1594static inline void
1596 const cs_real_3_t v1,
1597 const cs_real_3_t v2,
1598 const cs_real_3_t v3,
1599 const cs_real_3_t v4,
1600 double vol,
1601 cs_analytic_func_t *ana,
1602 void *input,
1603 double results[])
1604{
1605 cs_real_3_t gauss_pts[5];
1606 double evaluation[3*5], weights[5];
1607
1608 /* Compute Gauss points and its weights */
1609 cs_quadrature_tet_5pts(v1, v2, v3, v4, vol, gauss_pts, weights);
1610
1611 ana(tcur, 5, NULL, (const cs_real_t *)gauss_pts, false, input, evaluation);
1612
1613 for (int p = 0; p < 5; p++) {
1614 results[0] += weights[p] * evaluation[3*p ];
1615 results[1] += weights[p] * evaluation[3*p+1];
1616 results[2] += weights[p] * evaluation[3*p+2];
1617 }
1618}
1619
1620/*----------------------------------------------------------------------------*/
1636/*----------------------------------------------------------------------------*/
1637
1638static inline void
1640 const cs_real_3_t v1,
1641 const cs_real_3_t v2,
1642 const cs_real_3_t v3,
1643 const cs_real_3_t v4,
1644 double vol,
1645 cs_analytic_func_t *ana,
1646 void *input,
1647 double results[])
1648{
1649 cs_real_3_t xg;
1650 double evaluation[9];
1651
1652 /* Copied from cs_quadrature_tet_1pt */
1653 xg[0] = 0.25 * (v1[0] + v2[0] + v3[0] + v4[0]);
1654 xg[1] = 0.25 * (v1[1] + v2[1] + v3[1] + v4[1]);
1655 xg[2] = 0.25 * (v1[2] + v2[2] + v3[2] + v4[2]);
1656
1657 ana(tcur, 1, NULL, xg, false, input, evaluation);
1658
1659 for (short int ij = 0; ij < 9; ij++)
1660 results[ij] += vol * evaluation[ij];
1661}
1662
1663/*----------------------------------------------------------------------------*/
1679/*----------------------------------------------------------------------------*/
1680
1681static inline void
1683 const cs_real_3_t v1,
1684 const cs_real_3_t v2,
1685 const cs_real_3_t v3,
1686 const cs_real_3_t v4,
1687 double vol,
1688 cs_analytic_func_t *ana,
1689 void *input,
1690 double results[])
1691{
1692 cs_real_3_t gauss_pts[4];
1693 double evaluation[9*4], weights[4];
1694
1695 /* Compute Gauss points and its unique weight */
1696 cs_quadrature_tet_4pts(v1, v2, v3, v4, vol, gauss_pts, weights);
1697
1698 ana(tcur, 4, NULL, (const cs_real_t *)gauss_pts, false, input, evaluation);
1699
1700 for (int p = 0; p < 4; p++) {
1701 const double wp = weights[p];
1702 double *eval_p = evaluation + 9*p;
1703 for (short int ij = 0; ij < 9; ij++)
1704 results[ij] += wp * eval_p[ij];
1705 }
1706}
1707
1708/*----------------------------------------------------------------------------*/
1724/*----------------------------------------------------------------------------*/
1725
1726static inline void
1728 const cs_real_3_t v1,
1729 const cs_real_3_t v2,
1730 const cs_real_3_t v3,
1731 const cs_real_3_t v4,
1732 double vol,
1733 cs_analytic_func_t *ana,
1734 void *input,
1735 double results[])
1736{
1737 cs_real_3_t gauss_pts[5];
1738 double evaluation[9*5], weights[5];
1739
1740 /* Compute Gauss points and its weights */
1741 cs_quadrature_tet_5pts(v1, v2, v3, v4, vol, gauss_pts, weights);
1742
1743 ana(tcur, 5, NULL, (const cs_real_t *)gauss_pts, false, input, evaluation);
1744
1745 for (int p = 0; p < 5; p++) {
1746 const double wp = weights[p];
1747 double *eval_p = evaluation + 9*p;
1748 for (short int ij = 0; ij < 9; ij++)
1749 results[ij] += wp * eval_p[ij];
1750 }
1751}
1752
1753/*----------------------------------------------------------------------------*/
1768/*----------------------------------------------------------------------------*/
1769
1770static inline void
1772 const cs_real_3_t vb,
1773 const double hx,
1774 const double hy,
1775 const double hz,
1776 cs_analytic_func_t *ana,
1777 void *input,
1778 double results[])
1779{
1780 cs_real_3_t xg[1];
1781 double weight[1], evaluation[3];
1782
1783 /* Copied from cs_quadrature_hew_1pt */
1784 cs_quadrature_hex_1pt(vb, hx, hy, hz, xg, weight);
1785
1786 ana(tcur, 1, NULL, (const cs_real_t *)xg, false, input, evaluation);
1787
1788 results[0] += weight[0] * evaluation[0];
1789 results[1] += weight[0] * evaluation[1];
1790 results[2] += weight[0] * evaluation[2];
1791}
1792
1793/*----------------------------------------------------------------------------*/
1808/*----------------------------------------------------------------------------*/
1809
1810static inline void
1812 const cs_real_3_t vb,
1813 const double hx,
1814 const double hy,
1815 const double hz,
1816 cs_analytic_func_t *ana,
1817 void *input,
1818 double results[])
1819{
1820 cs_real_3_t gauss_pts[8];
1821 double evaluation[3 * 8], weights[8];
1822
1823 /* Compute Gauss points and its unique weight */
1824 cs_quadrature_hex_8pts(vb, hx, hy, hz, gauss_pts, weights);
1825
1826 ana(tcur, 8, NULL, (const cs_real_t *)gauss_pts, false, input, evaluation);
1827
1828 for (int p = 0; p < 8; p++) {
1829 results[0] += weights[p] * evaluation[3 * p];
1830 results[1] += weights[p] * evaluation[3 * p + 1];
1831 results[2] += weights[p] * evaluation[3 * p + 2];
1832 }
1833}
1834
1835/*----------------------------------------------------------------------------*/
1850/*----------------------------------------------------------------------------*/
1851
1852static inline void
1854 const cs_real_3_t vb,
1855 const double hx,
1856 const double hy,
1857 const double hz,
1858 cs_analytic_func_t *ana,
1859 void *input,
1860 double results[])
1861{
1862 cs_real_3_t gauss_pts[27];
1863 double evaluation[3 * 27], weights[27];
1864
1865 /* Compute Gauss points and its weights */
1866 cs_quadrature_hex_27pts(vb, hx, hy, hz, gauss_pts, weights);
1867
1868 ana(tcur, 27, NULL, (const cs_real_t *)gauss_pts, false, input, evaluation);
1869
1870 for (int p = 0; p < 27; p++) {
1871 results[0] += weights[p] * evaluation[3 * p];
1872 results[1] += weights[p] * evaluation[3 * p + 1];
1873 results[2] += weights[p] * evaluation[3 * p + 2];
1874 }
1875}
1876
1877/*----------------------------------------------------------------------------*/
1888/*----------------------------------------------------------------------------*/
1889
1890static inline cs_quadrature_edge_integral_t *
1893{
1894 switch (dim) {
1895
1896 case 1: /* Scalar-valued integral */
1897
1898 switch (qtype) {
1899
1900 case CS_QUADRATURE_BARY:
1907
1908 default:
1909 bft_error(__FILE__, __LINE__, 0,
1910 " %s: Invalid quadrature type\n", __func__);
1911 }
1912 break;
1913
1914 case 3: /* Vector-valued case */
1915
1916 switch (qtype) {
1917
1918 case CS_QUADRATURE_BARY:
1925
1926 default:
1927 bft_error(__FILE__, __LINE__, 0,
1928 " %s: Invalid quadrature type\n", __func__);
1929 }
1930 break;
1931
1932 default:
1933 bft_error(__FILE__, __LINE__, 0,
1934 " %s: Invalid dimension value %d. Only 1 and 3 are valid.\n",
1935 __func__, dim);
1936
1937 } /* switch on dim */
1938
1939 return NULL; /* Should not go to this stage */
1940}
1941
1942/*----------------------------------------------------------------------------*/
1952/*----------------------------------------------------------------------------*/
1953
1954static inline cs_quadrature_tria_integral_t *
1957{
1958 switch (dim) {
1959
1960 case 1: /* Scalar-valued integral */
1961
1962 switch (qtype) {
1963
1964 case CS_QUADRATURE_BARY:
1971
1972 default:
1973 bft_error(__FILE__, __LINE__, 0,
1974 " %s: Invalid quadrature type\n", __func__);
1975 }
1976 break;
1977
1978 case 3: /* Vector-valued case */
1979
1980 switch (qtype) {
1981
1982 case CS_QUADRATURE_BARY:
1989
1990 default:
1991 bft_error(__FILE__, __LINE__, 0,
1992 " %s: Invalid quadrature type\n", __func__);
1993 }
1994 break;
1995
1996 case 9: /* Tensor-valued case */
1997
1998 switch (qtype) {
1999
2000 case CS_QUADRATURE_BARY:
2007
2008 default:
2009 bft_error(__FILE__, __LINE__, 0,
2010 " %s: Invalid quadrature type\n", __func__);
2011 }
2012 break;
2013
2014 default:
2015 bft_error(__FILE__, __LINE__, 0,
2016 " %s: Invalid dimension value %d. Only 1, 3 and 9 are valid.\n",
2017 __func__, dim);
2018
2019 } /* switch on dim */
2020
2021 return NULL; /* Should not go to this stage */
2022}
2023
2024/*----------------------------------------------------------------------------*/
2034/*----------------------------------------------------------------------------*/
2035
2036static inline cs_quadrature_tetra_integral_t *
2039{
2040 switch (dim) {
2041
2042 case 1: /* Scalar-valued case */
2043
2044 switch (qtype) {
2045
2046 case CS_QUADRATURE_BARY:
2053
2054 default:
2055 bft_error(__FILE__, __LINE__, 0,
2056 " %s: Invalid quadrature type\n", __func__);
2057 }
2058 break;
2059
2060 case 3: /* Vector-valued case */
2061
2062 switch (qtype) {
2063
2064 case CS_QUADRATURE_BARY:
2071
2072 default:
2073 bft_error(__FILE__, __LINE__, 0,
2074 " %s: Invalid quadrature type\n", __func__);
2075 }
2076 break;
2077
2078 case 9: /* Tensor-valued case */
2079
2080 switch (qtype) {
2081
2082 case CS_QUADRATURE_BARY:
2089
2090 default:
2091 bft_error(__FILE__, __LINE__, 0,
2092 " %s: Invalid quadrature type\n", __func__);
2093 }
2094 break;
2095
2096 default:
2097 bft_error(__FILE__, __LINE__, 0,
2098 " %s: Invalid dimension value %d. Only 1, 3 and 9 are valid.\n",
2099 __func__, dim);
2100
2101 } /* Switch on dim */
2102
2103 /* Avoid no return warning */
2104 return NULL;
2105}
2106
2107/*----------------------------------------------------------------------------*/
2117/*----------------------------------------------------------------------------*/
2118
2119static inline cs_quadrature_hexa_integral_t *
2121{
2122 switch (dim) {
2123
2124 case 3: /* Vector-valued case */
2125
2126 switch (qtype) {
2127
2128 case CS_QUADRATURE_BARY:
2135
2136 default:
2137 bft_error(
2138 __FILE__, __LINE__, 0, " %s: Invalid quadrature type\n", __func__);
2139 }
2140 break;
2141
2142 default:
2143 bft_error(__FILE__,
2144 __LINE__,
2145 0,
2146 " %s: Invalid dimension value %d. Only 3 is valid.\n",
2147 __func__,
2148 dim);
2149
2150 } /* Switch on dim */
2151
2152 /* Avoid no return warning */
2153 return NULL;
2154}
2155
2156/*----------------------------------------------------------------------------*/
2168/*----------------------------------------------------------------------------*/
2169
2172 const cs_flag_t loc);
2173
2174#endif /* CS_QUADRATURE_H */
void bft_error(const char *const file_name, const int line_num, const int sys_error_code, const char *const format,...)
Calls the error handler (set by bft_error_handler_set() or default).
Definition: bft_error.cpp:187
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:349
unsigned short int cs_flag_t
Definition: cs_defs.h:334
@ p
Definition: cs_field_pointer.h:63
unsigned int cs_eflag_t
Definition: cs_flag.h:190
void() cs_analytic_func_t(cs_real_t time, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, const cs_real_t *coords, bool dense_output, void *input, cs_real_t *retval)
Generic function pointer for an evaluation relying on an analytic function.
Definition: cs_param_types.h:127
void cs_quadrature_tet_5pts(const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, const cs_real_3_t v4, double vol, cs_real_3_t gpts[], double weights[])
Compute the quadrature in a tetrehedra. Exact for 3rd order polynomials (order 4).
Definition: cs_quadrature.cpp:502
static void cs_quadrature_edge_1pt_scal(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, double len, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over an edge with the mid-point rule and add it to results Case of a scalar-valu...
Definition: cs_quadrature.h:635
void() cs_quadrature_hexa_integral_t(double tcur, const cs_real_3_t vb, const double hx, const double hy, const double hz, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over an orthogonal hexahedron based on a specified quadrature rule and add it to...
Definition: cs_quadrature.h:249
static void cs_quadrature_tet_4pts_vect(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, const cs_real_3_t v4, double vol, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a tetrahedron with a quadrature rule using 4 Gauss points and a unique weig...
Definition: cs_quadrature.h:1551
static void cs_quadrature_tet_1pt(const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, const cs_real_3_t v4, double vol, cs_real_3_t gpts[], double weight[])
Compute the quadrature in a tetrehedra. Exact for 1st order polynomials (order 2).
Definition: cs_quadrature.h:532
static void cs_quadrature_tet_5pts_scal(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, const cs_real_3_t v4, double vol, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a tetrahedron with a quadrature rule using 5 Gauss points and 5 weights and...
Definition: cs_quadrature.h:1465
static void cs_quadrature_edge_3pts_scal(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, double len, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over an edge with a quadrature rule using 3 Gauss points and weights and add it ...
Definition: cs_quadrature.h:713
static void cs_quadrature_tet_5pts_tens(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, const cs_real_3_t v4, double vol, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a tetrahedron with a quadrature rule using 5 Gauss points and 5 weights and...
Definition: cs_quadrature.h:1727
static void cs_quadrature_tria_4pts_scal(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a triangle with a quadrature rule using 4 Gauss points and 4 weights and ad...
Definition: cs_quadrature.h:958
static void cs_quadrature_tria_7pts_scal(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a triangle with a quadrature rule using 7 Gauss points and 7 weights and ad...
Definition: cs_quadrature.h:997
void cs_quadrature_tria_7pts(const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_real_3_t gpts[], double w[])
Compute quadrature points for a triangle (7 points) Exact for polynomial function up to order 5.
Definition: cs_quadrature.cpp:418
static cs_quadrature_edge_integral_t * cs_quadrature_get_edge_integral(int dim, cs_quadrature_type_t qtype)
Retrieve the integral function according to the quadrature type and the stride provided Case of integ...
Definition: cs_quadrature.h:1891
static void cs_quadrature_hex_1pt(const cs_real_3_t vb, const double hx, const double hy, const double hz, cs_real_3_t gpts[], double *w)
Compute quadrature points for an orthogonal hexahedron Exact for polynomial function up to order 1.
Definition: cs_quadrature.h:365
cs_quadrature_type_t
Type of quadrature to use when computing an integral quantity. This rationale is used for integrals a...
Definition: cs_quadrature.h:79
@ CS_QUADRATURE_HIGHEST
Definition: cs_quadrature.h:85
@ CS_QUADRATURE_NONE
Definition: cs_quadrature.h:81
@ CS_QUADRATURE_BARY_SUBDIV
Definition: cs_quadrature.h:83
@ CS_QUADRATURE_N_TYPES
Definition: cs_quadrature.h:86
@ CS_QUADRATURE_HIGHER
Definition: cs_quadrature.h:84
@ CS_QUADRATURE_BARY
Definition: cs_quadrature.h:82
void() cs_quadrature_tria_integral_t(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a triangle based on a specified quadrature rule and add it to results.
Definition: cs_quadrature.h:196
static void cs_quadrature_tet_1pt_tens(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, const cs_real_3_t v4, double vol, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a tetrahedron using a barycentric quadrature rule and add it to results....
Definition: cs_quadrature.h:1639
static void cs_quadrature_edge_2pts_vect(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, double len, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over an edge with a quadrature rule using 2 Gauss points and a unique weight and...
Definition: cs_quadrature.h:793
static void cs_quadrature_tria_4pts_tens(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a triangle with a quadrature rule using 4 Gauss points and 4 weights and ad...
Definition: cs_quadrature.h:1294
void() cs_quadrature_tria_t(const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_real_3_t gpts[], double *weights)
Generic functoin pointer to compute the quadrature points for a triangle.
Definition: cs_quadrature.h:125
static void cs_quadrature_edge_1pt(const cs_real_3_t v1, const cs_real_3_t v2, double len, cs_real_3_t gpts[], double *w)
Compute quadrature points for an edge from v1 -> v2 (2 points) Exact for polynomial function up to or...
Definition: cs_quadrature.h:298
static void cs_quadrature_tria_4pts_vect(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a triangle with a quadrature rule using 4 Gauss points and 4 weights and ad...
Definition: cs_quadrature.h:1124
static void cs_quadrature_tet_1pt_vect(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, const cs_real_3_t v4, double vol, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a tetrahedron using a barycentric quadrature rule and add it to results....
Definition: cs_quadrature.h:1507
static void cs_quadrature_tet_5pts_vect(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, const cs_real_3_t v4, double vol, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a tetrahedron with a quadrature rule using 5 Gauss points and 5 weights and...
Definition: cs_quadrature.h:1595
void cs_quadrature_edge_3pts(const cs_real_3_t v1, const cs_real_3_t v2, double len, cs_real_3_t gpts[], double w[])
Compute quadrature points for an edge from v1 -> v2 (3 points) Exact for polynomial function up to or...
Definition: cs_quadrature.cpp:201
void cs_quadrature_setup(void)
Compute constant weights for all quadratures used.
Definition: cs_quadrature.cpp:103
static void cs_quadrature_tria_7pts_vect(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a triangle with a quadrature rule using 7 Gauss points and 7 weights and ad...
Definition: cs_quadrature.h:1166
void cs_quadrature_edge_2pts(const cs_real_3_t v1, const cs_real_3_t v2, double len, cs_real_3_t gpts[], double *w)
Compute quadrature points for an edge from v1 -> v2 (2 points) Exact for polynomial function up to or...
void cs_quadrature_hex_8pts(const cs_real_3_t vb, const double hx, const double hy, const double hz, cs_real_3_t gpts[], double *w)
Compute quadrature points for an orthogonal hexahedron Exact for polynomial function up to order 3.
Definition: cs_quadrature.cpp:237
static void cs_quadrature_edge_2pts_scal(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, double len, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over an edge with a quadrature rule using 2 Gauss points and a unique weight and...
Definition: cs_quadrature.h:675
static void cs_quadrature_tet_1pt_scal(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, const cs_real_3_t v4, double vol, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a tetrahedron using a barycentric quadrature rule and add it to results....
Definition: cs_quadrature.h:1381
static cs_quadrature_tetra_integral_t * cs_quadrature_get_tetra_integral(int dim, cs_quadrature_type_t qtype)
Retrieve the integral function according to the quadrature type and the stride provided.
Definition: cs_quadrature.h:2037
static void cs_quadrature_tria_3pts_vect(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a triangle with a quadrature rule using 3 Gauss points and a unique weight ...
Definition: cs_quadrature.h:1082
static void cs_quadrature_tria_1pt_scal(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a triangle using a barycentric quadrature rule and add it to results Case o...
Definition: cs_quadrature.h:876
static void cs_quadrature_tet_4pts_scal(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, const cs_real_3_t v4, double vol, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a tetrahedron with a quadrature rule using 4 Gauss points and a unique weig...
Definition: cs_quadrature.h:1423
void cs_quadrature_hex_27pts(const cs_real_3_t vb, const double hx, const double hy, const double hz, cs_real_3_t gpts[], double w[])
Compute quadrature points for an orthogonal hexahedron Exact for polynomial function up to order 5.
Definition: cs_quadrature.cpp:290
static void cs_quadrature_tria_1pt(const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_real_3_t gpts[], double *w)
Compute quadrature points for a triangle (1 point) Exact for polynomial function up to order 1 (baryc...
Definition: cs_quadrature.h:435
void cs_quadrature_tria_4pts(const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_real_3_t gpts[], double w[])
Compute quadrature points for a triangle (4 points) Exact for polynomial function up to order 3.
Definition: cs_quadrature.cpp:381
void() cs_quadrature_tetra_integral_t(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, const cs_real_3_t v4, double vol, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a tetrahedron based on a specified quadrature rule and add it to results.
Definition: cs_quadrature.h:223
void cs_quadrature_tria_3pts(const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_real_3_t gpts[], double *w)
Compute quadrature points for a triangle (3 points) Exact for polynomial function up to order 2.
void cs_quadrature_tet_15pts(const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, const cs_real_3_t v4, double vol, cs_real_3_t gpts[], double weights[])
Compute the quadrature in a tetrehedra. Exact for 5th order polynomials (order 6).
Definition: cs_quadrature.cpp:548
static void cs_quadrature_tria_1pt_vect(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a triangle using a barycentric quadrature rule and add it to results Case o...
Definition: cs_quadrature.h:1038
static void cs_quadrature_hex_1pt_vect(double tcur, const cs_real_3_t vb, const double hx, const double hy, const double hz, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a orthoganal hexahedron using a barycentric quadrature rule and add it to r...
Definition: cs_quadrature.h:1771
const char * cs_quadrature_get_type_name(const cs_quadrature_type_t type)
Return th name associated to a type of quadrature.
Definition: cs_quadrature.cpp:150
static void cs_quadrature_tria_3pts_scal(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a triangle with a quadrature rule using 3 Gauss points and a unique weight ...
Definition: cs_quadrature.h:918
void() cs_quadrature_edge_t(const cs_real_3_t v1, const cs_real_3_t v2, double len, cs_real_3_t gpts[], double *weights)
Generic function pointer to compute the quadrature points for an edge from v1 -> v2.
Definition: cs_quadrature.h:104
static void cs_quadrature_edge_1pt_vect(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, double len, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over an edge using a barycentric quadrature rule and add it to results Case of a...
Definition: cs_quadrature.h:751
static void cs_quadrature_hex_27pts_vect(double tcur, const cs_real_3_t vb, const double hx, const double hy, const double hz, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over an orthogonal hexahedron with a quadrature rule using 27 Gauss points add i...
Definition: cs_quadrature.h:1853
void() cs_quadrature_tet_t(const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, const cs_real_3_t v4, double vol, cs_real_3_t gpts[], double weights[])
Generic function to compute the quadrature points in a tetrehedra.
Definition: cs_quadrature.h:147
void() cs_quadrature_edge_integral_t(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, double len, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over an edge based on a specified quadrature rule and add it to results.
Definition: cs_quadrature.h:171
static void cs_quadrature_tria_3pts_tens(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a triangle with a quadrature rule using 3 Gauss points and a unique weight ...
Definition: cs_quadrature.h:1251
static void cs_quadrature_tria_7pts_tens(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a triangle with a quadrature rule using 7 Gauss points and 7 weights and ad...
Definition: cs_quadrature.h:1337
void cs_quadrature_tet_4pts(const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, const cs_real_3_t v4, double vol, cs_real_3_t gpts[], double weights[])
Compute the quadrature in a tetrehedra. Exact for 2nd order polynomials (order 3).
Definition: cs_quadrature.cpp:460
cs_eflag_t cs_quadrature_get_flag(const cs_quadrature_type_t qtype, const cs_flag_t loc)
Get the flags adapted to the given quadrature type qtype and the location on which the quadrature sho...
Definition: cs_quadrature.cpp:611
static void cs_quadrature_edge_3pts_vect(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, double len, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over an edge with a quadrature rule using 3 Gauss points and weights and add it ...
Definition: cs_quadrature.h:833
static void cs_quadrature_tria_1pt_tens(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a triangle using a barycentric quadrature rule and add it to results....
Definition: cs_quadrature.h:1208
static cs_quadrature_hexa_integral_t * cs_quadrature_get_hexa_integral(int dim, cs_quadrature_type_t qtype)
Retrieve the integral function according to the quadrature type and the stride provided for an hexahe...
Definition: cs_quadrature.h:2120
static cs_quadrature_tria_integral_t * cs_quadrature_get_tria_integral(int dim, cs_quadrature_type_t qtype)
Retrieve the integral function according to the quadrature type and the stride provided.
Definition: cs_quadrature.h:1955
static void cs_quadrature_hex_8pts_vect(double tcur, const cs_real_3_t vb, const double hx, const double hy, const double hz, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over an orthoganal hexahedron with a quadrature rule using 8 Gauss points and a ...
Definition: cs_quadrature.h:1811
static void cs_quadrature_tet_4pts_tens(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, const cs_real_3_t v4, double vol, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a tetrahedron with a quadrature rule using 4 Gauss points and a unique weig...
Definition: cs_quadrature.h:1682