1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650
|
<center><a href="https://gitlab.com/petsc/petsc/-/blob/966382dc56242773704ef5f5cee7aa2db3ebc577/include/petscdt.h">Actual source code: petscdt.h</a></center><br>
<html>
<head>
<title></title>
<meta name="generator" content="c2html 0.9.6">
<meta name="date" content="2025-04-30T18:14:50+00:00">
</head>
<body bgcolor="#FFFFFF">
<pre width=80>
<a name="line1"> 1: </a><font color="#B22222">/*</font>
<a name="line2"> 2: </a><font color="#B22222"> Common tools for constructing discretizations</font>
<a name="line3"> 3: </a><font color="#B22222">*/</font>
<a name="line4"> 4: </a><font color="#A020F0">#pragma once</font>
<a name="line6"> 6: </a>#include <A href="../include/petscsys.h.html"><petscsys.h></A>
<a name="line7"> 7: </a>#include <A href="../include/petscdmtypes.h.html"><petscdmtypes.h></A>
<a name="line8"> 8: </a>#include <A href="../include/petscistypes.h.html"><petscistypes.h></A>
<a name="line10"> 10: </a><font color="#B22222">/* MANSEC = <a href="../manualpages/DM/DM.html">DM</a> */</font>
<a name="line11"> 11: </a><font color="#B22222">/* SUBMANSEC = DT */</font>
<a name="line13"> 13: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscClassId.html">PetscClassId</a> PETSCQUADRATURE_CLASSID;
<a name="line15"> 15: </a><font color="#B22222">/*S</font>
<a name="line16"> 16: </a><font color="#B22222"> <a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a> - Quadrature rule for numerical integration.</font>
<a name="line18"> 18: </a><font color="#B22222"> Level: beginner</font>
<a name="line20"> 20: </a><font color="#B22222">.seealso: `<a href="../manualpages/DT/PetscQuadratureCreate.html">PetscQuadratureCreate</a>()`, `<a href="../manualpages/DT/PetscQuadratureDestroy.html">PetscQuadratureDestroy</a>()`</font>
<a name="line21"> 21: </a><font color="#B22222">S*/</font>
<a name="line22"> 22: </a><font color="#4169E1">typedef struct _p_PetscQuadrature *<a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>;</font>
<a name="line24"> 24: </a><font color="#B22222">/*E</font>
<a name="line25"> 25: </a><font color="#B22222"> <a href="../manualpages/DT/PetscGaussLobattoLegendreCreateType.html">PetscGaussLobattoLegendreCreateType</a> - algorithm used to compute the Gauss-Lobatto-Legendre nodes and weights</font>
<a name="line27"> 27: </a><font color="#B22222"> Values:</font>
<a name="line28"> 28: </a><font color="#B22222">+ `<a href="../manualpages/DT/PetscGaussLobattoLegendreCreateType.html">PETSCGAUSSLOBATTOLEGENDRE_VIA_LINEAR_ALGEBRA</a>` - compute the nodes via linear algebra</font>
<a name="line29"> 29: </a><font color="#B22222">- `<a href="../manualpages/DT/PetscGaussLobattoLegendreCreateType.html">PETSCGAUSSLOBATTOLEGENDRE_VIA_NEWTON</a>` - compute the nodes by solving a nonlinear equation with Newton's method</font>
<a name="line31"> 31: </a><font color="#B22222"> Level: intermediate</font>
<a name="line33"> 33: </a><font color="#B22222">.seealso: `<a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>`</font>
<a name="line34"> 34: </a><font color="#B22222">E*/</font>
<a name="line35"> 35: </a><font color="#4169E1">typedef</font> <font color="#4169E1">enum</font> {
<a name="line36"> 36: </a> <a href="../manualpages/DT/PetscGaussLobattoLegendreCreateType.html">PETSCGAUSSLOBATTOLEGENDRE_VIA_LINEAR_ALGEBRA</a>,
<a name="line37"> 37: </a> <a href="../manualpages/DT/PetscGaussLobattoLegendreCreateType.html">PETSCGAUSSLOBATTOLEGENDRE_VIA_NEWTON</a>
<a name="line38"> 38: </a>} <a href="../manualpages/DT/PetscGaussLobattoLegendreCreateType.html">PetscGaussLobattoLegendreCreateType</a>;
<a name="line40"> 40: </a><font color="#B22222">/*E</font>
<a name="line41"> 41: </a><font color="#B22222"> <a href="../manualpages/DT/PetscDTNodeType.html">PetscDTNodeType</a> - A description of strategies for generating nodes (both</font>
<a name="line42"> 42: </a><font color="#B22222"> quadrature nodes and nodes for Lagrange polynomials)</font>
<a name="line44"> 44: </a><font color="#B22222"> Values:</font>
<a name="line45"> 45: </a><font color="#B22222">+ `<a href="../manualpages/DT/PetscDTNodeType.html">PETSCDTNODES_DEFAULT</a>` - Nodes chosen by PETSc</font>
<a name="line46"> 46: </a><font color="#B22222">. `<a href="../manualpages/DT/PetscDTNodeType.html">PETSCDTNODES_GAUSSJACOBI</a>` - Nodes at either Gauss-Jacobi or Gauss-Lobatto-Jacobi quadrature points</font>
<a name="line47"> 47: </a><font color="#B22222">. `<a href="../manualpages/DT/PetscDTNodeType.html">PETSCDTNODES_EQUISPACED</a>` - Nodes equispaced either including the endpoints or excluding them</font>
<a name="line48"> 48: </a><font color="#B22222">- `<a href="../manualpages/DT/PetscDTNodeType.html">PETSCDTNODES_TANHSINH</a>` - Nodes at Tanh-Sinh quadrature points</font>
<a name="line50"> 50: </a><font color="#B22222"> Level: intermediate</font>
<a name="line52"> 52: </a><font color="#B22222"> Note:</font>
<a name="line53"> 53: </a><font color="#B22222"> A `<a href="../manualpages/DT/PetscDTNodeType.html">PetscDTNodeType</a>` can be paired with a `<a href="../manualpages/Sys/PetscBool.html">PetscBool</a>` to indicate whether</font>
<a name="line54"> 54: </a><font color="#B22222"> the nodes include endpoints or not, and in the case of `PETSCDT_GAUSSJACOBI`</font>
<a name="line55"> 55: </a><font color="#B22222"> with exponents for the weight function.</font>
<a name="line57"> 57: </a><font color="#B22222">.seealso: `<a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>`</font>
<a name="line58"> 58: </a><font color="#B22222">E*/</font>
<a name="line59"> 59: </a><font color="#4169E1">typedef</font> <font color="#4169E1">enum</font> {
<a name="line60"> 60: </a> <a href="../manualpages/DT/PetscDTNodeType.html">PETSCDTNODES_DEFAULT</a> = -1,
<a name="line61"> 61: </a> <a href="../manualpages/DT/PetscDTNodeType.html">PETSCDTNODES_GAUSSJACOBI</a> = 0,
<a name="line62"> 62: </a> <a href="../manualpages/DT/PetscDTNodeType.html">PETSCDTNODES_EQUISPACED</a> = 1,
<a name="line63"> 63: </a> <a href="../manualpages/DT/PetscDTNodeType.html">PETSCDTNODES_TANHSINH</a> = 2
<a name="line64"> 64: </a>} <a href="../manualpages/DT/PetscDTNodeType.html">PetscDTNodeType</a>;
<a name="line66"> 66: </a>PETSC_EXTERN const char *const *const PetscDTNodeTypes;
<a name="line68"> 68: </a><font color="#B22222">/*E</font>
<a name="line69"> 69: </a><font color="#B22222"> <a href="../manualpages/DT/PetscDTSimplexQuadratureType.html">PetscDTSimplexQuadratureType</a> - A description of classes of quadrature rules for simplices</font>
<a name="line71"> 71: </a><font color="#B22222"> Values:</font>
<a name="line72"> 72: </a><font color="#B22222">+ `<a href="../manualpages/DT/PetscDTSimplexQuadratureType.html">PETSCDTSIMPLEXQUAD_DEFAULT</a>` - Quadrature rule chosen by PETSc</font>
<a name="line73"> 73: </a><font color="#B22222">. `<a href="../manualpages/DT/PetscDTSimplexQuadratureType.html">PETSCDTSIMPLEXQUAD_CONIC</a>` - Quadrature rules constructed as</font>
<a name="line74"> 74: </a><font color="#B22222"> conically-warped tensor products of 1D</font>
<a name="line75"> 75: </a><font color="#B22222"> Gauss-Jacobi quadrature rules. These are</font>
<a name="line76"> 76: </a><font color="#B22222"> explicitly computable in any dimension for any</font>
<a name="line77"> 77: </a><font color="#B22222"> degree, and the tensor-product structure can be</font>
<a name="line78"> 78: </a><font color="#B22222"> exploited by sum-factorization methods, but</font>
<a name="line79"> 79: </a><font color="#B22222"> they are not efficient in terms of nodes per</font>
<a name="line80"> 80: </a><font color="#B22222"> polynomial degree.</font>
<a name="line81"> 81: </a><font color="#B22222">- `<a href="../manualpages/DT/PetscDTSimplexQuadratureType.html">PETSCDTSIMPLEXQUAD_MINSYM</a>` - Quadrature rules that are fully symmetric</font>
<a name="line82"> 82: </a><font color="#B22222"> (symmetries of the simplex preserve the nodes</font>
<a name="line83"> 83: </a><font color="#B22222"> and weights) with minimal (or near minimal)</font>
<a name="line84"> 84: </a><font color="#B22222"> number of nodes. In dimensions higher than 1</font>
<a name="line85"> 85: </a><font color="#B22222"> these are not simple to compute, so lookup</font>
<a name="line86"> 86: </a><font color="#B22222"> tables are used.</font>
<a name="line88"> 88: </a><font color="#B22222"> Level: intermediate</font>
<a name="line90"> 90: </a><font color="#B22222">.seealso: `<a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>`, `<a href="../manualpages/DT/PetscDTSimplexQuadrature.html">PetscDTSimplexQuadrature</a>()`</font>
<a name="line91"> 91: </a><font color="#B22222">E*/</font>
<a name="line92"> 92: </a><font color="#4169E1">typedef</font> <font color="#4169E1">enum</font> {
<a name="line93"> 93: </a> <a href="../manualpages/DT/PetscDTSimplexQuadratureType.html">PETSCDTSIMPLEXQUAD_DEFAULT</a> = -1,
<a name="line94"> 94: </a> <a href="../manualpages/DT/PetscDTSimplexQuadratureType.html">PETSCDTSIMPLEXQUAD_CONIC</a> = 0,
<a name="line95"> 95: </a> <a href="../manualpages/DT/PetscDTSimplexQuadratureType.html">PETSCDTSIMPLEXQUAD_MINSYM</a> = 1
<a name="line96"> 96: </a>} <a href="../manualpages/DT/PetscDTSimplexQuadratureType.html">PetscDTSimplexQuadratureType</a>;
<a name="line98"> 98: </a>PETSC_EXTERN const char *const *const PetscDTSimplexQuadratureTypes;
<a name="line100">100: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscQuadratureCreate.html">PetscQuadratureCreate</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a> *)</font></strong>;
<a name="line101">101: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscQuadratureDuplicate.html">PetscQuadratureDuplicate</a>(<a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>, <a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a> *)</font></strong>;
<a name="line102">102: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscQuadratureGetCellType.html">PetscQuadratureGetCellType</a>(<a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>, <a href="../manualpages/DM/DMPolytopeType.html">DMPolytopeType</a> *)</font></strong>;
<a name="line103">103: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscQuadratureSetCellType.html">PetscQuadratureSetCellType</a>(<a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>, <a href="../manualpages/DM/DMPolytopeType.html">DMPolytopeType</a>)</font></strong>;
<a name="line104">104: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscQuadratureGetOrder.html">PetscQuadratureGetOrder</a>(<a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;
<a name="line105">105: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscQuadratureSetOrder.html">PetscQuadratureSetOrder</a>(<a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>)</font></strong>;
<a name="line106">106: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscQuadratureGetNumComponents.html">PetscQuadratureGetNumComponents</a>(<a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;
<a name="line107">107: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscQuadratureSetNumComponents.html">PetscQuadratureSetNumComponents</a>(<a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>)</font></strong>;
<a name="line108">108: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscQuadratureEqual.html">PetscQuadratureEqual</a>(<a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>, <a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *)</font></strong>;
<a name="line109">109: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscQuadratureGetData.html">PetscQuadratureGetData</a>(<a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *[])</font></strong>;
<a name="line110">110: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscQuadratureSetData.html">PetscQuadratureSetData</a>(<a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line111">111: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscQuadratureView.html">PetscQuadratureView</a>(<a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>, <a href="../manualpages/Viewer/PetscViewer.html">PetscViewer</a>)</font></strong>;
<a name="line112">112: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscQuadratureDestroy.html">PetscQuadratureDestroy</a>(<a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a> *)</font></strong>;
<a name="line114">114: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTTensorQuadratureCreate.html">PetscDTTensorQuadratureCreate</a>(<a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>, <a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>, <a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a> *)</font></strong>;
<a name="line115">115: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscQuadratureExpandComposite.html">PetscQuadratureExpandComposite</a>(<a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a> *)</font></strong>;
<a name="line116">116: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscQuadratureComputePermutations.html">PetscQuadratureComputePermutations</a>(<a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/IS/IS.html">IS</a> *[])</font></strong>;
<a name="line118">118: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscQuadraturePushForward.html">PetscQuadraturePushForward</a>(<a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a> *)</font></strong>;
<a name="line120">120: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTLegendreEval.html">PetscDTLegendreEval</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line121">121: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTJacobiNorm.html">PetscDTJacobiNorm</a>(<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line122">122: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTJacobiEval.html">PetscDTJacobiEval</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line123">123: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTJacobiEvalJet.html">PetscDTJacobiEvalJet</a>(<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line124">124: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTPKDEvalJet.html">PetscDTPKDEvalJet</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line125">125: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTPTrimmedSize.html">PetscDTPTrimmedSize</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;
<a name="line126">126: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTPTrimmedEvalJet.html">PetscDTPTrimmedEvalJet</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line127">127: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTGaussQuadrature.html">PetscDTGaussQuadrature</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line128">128: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTGaussJacobiQuadrature.html">PetscDTGaussJacobiQuadrature</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line129">129: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTGaussLobattoJacobiQuadrature.html">PetscDTGaussLobattoJacobiQuadrature</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line130">130: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTGaussLobattoLegendreQuadrature.html">PetscDTGaussLobattoLegendreQuadrature</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/DT/PetscGaussLobattoLegendreCreateType.html">PetscGaussLobattoLegendreCreateType</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line131">131: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTReconstructPoly.html">PetscDTReconstructPoly</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line132">132: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTGaussTensorQuadrature.html">PetscDTGaussTensorQuadrature</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a> *)</font></strong>;
<a name="line133">133: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTStroudConicalQuadrature.html">PetscDTStroudConicalQuadrature</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a> *)</font></strong>;
<a name="line134">134: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTSimplexQuadrature.html">PetscDTSimplexQuadrature</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/DT/PetscDTSimplexQuadratureType.html">PetscDTSimplexQuadratureType</a>, <a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a> *)</font></strong>;
<a name="line135">135: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTCreateDefaultQuadrature.html">PetscDTCreateDefaultQuadrature</a>(<a href="../manualpages/DM/DMPolytopeType.html">DMPolytopeType</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a> *, <a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a> *)</font></strong>;
<a name="line137">137: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTTanhSinhTensorQuadrature.html">PetscDTTanhSinhTensorQuadrature</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/DT/PetscQuadrature.html">PetscQuadrature</a> *)</font></strong>;
<a name="line138">138: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscDTTanhSinhIntegrate(void (*)(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], void *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *), <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, void *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line139">139: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscDTTanhSinhIntegrateMPFR(void (*)(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], void *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *), <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, void *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line141">141: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscGaussLobattoLegendreIntegrate.html">PetscGaussLobattoLegendreIntegrate</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line142">142: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscGaussLobattoLegendreElementLaplacianCreate.html">PetscGaussLobattoLegendreElementLaplacianCreate</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> ***)</font></strong>;
<a name="line143">143: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscGaussLobattoLegendreElementLaplacianDestroy.html">PetscGaussLobattoLegendreElementLaplacianDestroy</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> ***)</font></strong>;
<a name="line144">144: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscGaussLobattoLegendreElementGradientCreate.html">PetscGaussLobattoLegendreElementGradientCreate</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> ***, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> ***)</font></strong>;
<a name="line145">145: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscGaussLobattoLegendreElementGradientDestroy.html">PetscGaussLobattoLegendreElementGradientDestroy</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> ***, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> ***)</font></strong>;
<a name="line146">146: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscGaussLobattoLegendreElementAdvectionCreate.html">PetscGaussLobattoLegendreElementAdvectionCreate</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> ***)</font></strong>;
<a name="line147">147: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscGaussLobattoLegendreElementAdvectionDestroy.html">PetscGaussLobattoLegendreElementAdvectionDestroy</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> ***)</font></strong>;
<a name="line148">148: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscGaussLobattoLegendreElementMassCreate(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> ***)</font></strong>;
<a name="line149">149: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscGaussLobattoLegendreElementMassDestroy(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> ***)</font></strong>;
<a name="line151">151: </a><font color="#B22222">/*MC</font>
<a name="line152">152: </a><font color="#B22222"> <a href="../manualpages/DT/PETSC_FORM_DEGREE_UNDEFINED.html">PETSC_FORM_DEGREE_UNDEFINED</a> - Indicates that a field does not have</font>
<a name="line153">153: </a><font color="#B22222"> a well-defined form degree in exterior calculus.</font>
<a name="line155">155: </a><font color="#B22222"> Level: advanced</font>
<a name="line157">157: </a><font color="#B22222">.seealso: `<a href="../manualpages/DT/PetscDTAltV.html">PetscDTAltV</a>`, `<a href="../manualpages/DUALSPACE/PetscDualSpaceGetFormDegree.html">PetscDualSpaceGetFormDegree</a>()`</font>
<a name="line158">158: </a><font color="#B22222">M*/</font>
<a name="line159">159: </a><strong><font color="#228B22">#define <a href="../manualpages/DT/PETSC_FORM_DEGREE_UNDEFINED.html">PETSC_FORM_DEGREE_UNDEFINED</a> PETSC_INT_MIN</font></strong>
<a name="line161">161: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTAltVApply.html">PetscDTAltVApply</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line162">162: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTAltVWedge.html">PetscDTAltVWedge</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line163">163: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTAltVWedgeMatrix.html">PetscDTAltVWedgeMatrix</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line164">164: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTAltVPullback.html">PetscDTAltVPullback</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line165">165: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTAltVPullbackMatrix.html">PetscDTAltVPullbackMatrix</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line166">166: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTAltVInterior.html">PetscDTAltVInterior</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line167">167: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTAltVInteriorMatrix.html">PetscDTAltVInteriorMatrix</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line168">168: </a><strong><font color="#4169E1"><a name="PetscDTAltVInteriorPattern"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTAltVInteriorPattern.html">PetscDTAltVInteriorPattern</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> (*)</font></strong>[3]);
<a name="line169">169: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTAltVStar.html">PetscDTAltVStar</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line171">171: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTBaryToIndex.html">PetscDTBaryToIndex</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;
<a name="line172">172: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTIndexToBary.html">PetscDTIndexToBary</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[])</font></strong>;
<a name="line173">173: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTGradedOrderToIndex.html">PetscDTGradedOrderToIndex</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;
<a name="line174">174: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTIndexToGradedOrder.html">PetscDTIndexToGradedOrder</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[])</font></strong>;
<a name="line176">176: </a><font color="#A020F0">#if defined(PETSC_USE_64BIT_INDICES)</font>
<a name="line177">177: </a><strong><font color="#228B22"> #define PETSC_FACTORIAL_MAX 20</font></strong>
<a name="line178">178: </a><strong><font color="#228B22"> #define PETSC_BINOMIAL_MAX 61</font></strong>
<a name="line179">179: </a><font color="#A020F0">#else</font>
<a name="line180">180: </a><strong><font color="#228B22"> #define PETSC_FACTORIAL_MAX 12</font></strong>
<a name="line181">181: </a><strong><font color="#228B22"> #define PETSC_BINOMIAL_MAX 29</font></strong>
<a name="line182">182: </a><font color="#A020F0">#endif</font>
<a name="line184">184: </a><font color="#B22222">/*MC</font>
<a name="line185">185: </a><font color="#B22222"> <a href="../manualpages/DT/PetscDTFactorial.html">PetscDTFactorial</a> - Approximate n! as a real number</font>
<a name="line187">187: </a><font color="#B22222"> Input Parameter:</font>
<a name="line188">188: </a><font color="#B22222">. n - a non-negative integer</font>
<a name="line190">190: </a><font color="#B22222"> Output Parameter:</font>
<a name="line191">191: </a><font color="#B22222">. factorial - n!</font>
<a name="line193">193: </a><font color="#B22222"> Level: beginner</font>
<a name="line195">195: </a><font color="#B22222">.seealso: `<a href="../manualpages/DT/PetscDTFactorialInt.html">PetscDTFactorialInt</a>()`, `<a href="../manualpages/DT/PetscDTBinomialInt.html">PetscDTBinomialInt</a>()`, `<a href="../manualpages/DT/PetscDTBinomial.html">PetscDTBinomial</a>()`</font>
<a name="line196">196: </a><font color="#B22222">M*/</font>
<a name="line197">197: </a><strong><font color="#4169E1"><a name="PetscDTFactorial"></a>static inline <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTFactorial.html">PetscDTFactorial</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> n, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *factorial)</font></strong>
<a name="line198">198: </a>{
<a name="line199">199: </a> <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> f = 1.0;
<a name="line201">201: </a> <a href="../manualpages/Sys/PetscFunctionBegin.html">PetscFunctionBegin</a>;
<a name="line202">202: </a> *factorial = -1.0;
<a name="line203">203: </a> <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(n >= 0, <a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>, <font color="#666666">"Factorial called with negative number %"</font> PetscInt_FMT, n);
<a name="line204">204: </a> <font color="#4169E1">for</font> (<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> i = 1; i < n + 1; ++i) f *= (<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>)i;
<a name="line205">205: </a> *factorial = f;
<a name="line206">206: </a> <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);
<a name="line207">207: </a>}
<a name="line209">209: </a><font color="#B22222">/*MC</font>
<a name="line210">210: </a><font color="#B22222"> <a href="../manualpages/DT/PetscDTFactorialInt.html">PetscDTFactorialInt</a> - Compute n! as an integer</font>
<a name="line212">212: </a><font color="#B22222"> Input Parameter:</font>
<a name="line213">213: </a><font color="#B22222">. n - a non-negative integer</font>
<a name="line215">215: </a><font color="#B22222"> Output Parameter:</font>
<a name="line216">216: </a><font color="#B22222">. factorial - n!</font>
<a name="line218">218: </a><font color="#B22222"> Level: beginner</font>
<a name="line220">220: </a><font color="#B22222"> Note:</font>
<a name="line221">221: </a><font color="#B22222"> This is limited to `n` such that n! can be represented by `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, which is 12 if `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` is a signed 32-bit integer and 20 if `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` is a signed 64-bit integer.</font>
<a name="line223">223: </a><font color="#B22222">.seealso: `<a href="../manualpages/DT/PetscDTFactorial.html">PetscDTFactorial</a>()`, `<a href="../manualpages/DT/PetscDTBinomialInt.html">PetscDTBinomialInt</a>()`, `<a href="../manualpages/DT/PetscDTBinomial.html">PetscDTBinomial</a>()`</font>
<a name="line224">224: </a><font color="#B22222">M*/</font>
<a name="line225">225: </a><strong><font color="#4169E1"><a name="PetscDTFactorialInt"></a>static inline <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTFactorialInt.html">PetscDTFactorialInt</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> n, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *factorial)</font></strong>
<a name="line226">226: </a>{
<a name="line227">227: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> facLookup[13] = {1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600};
<a name="line229">229: </a> <a href="../manualpages/Sys/PetscFunctionBegin.html">PetscFunctionBegin</a>;
<a name="line230">230: </a> *factorial = -1;
<a name="line231">231: </a> <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(n >= 0 && n <= PETSC_FACTORIAL_MAX, <a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>, <font color="#666666">"Number of elements %"</font> PetscInt_FMT <font color="#666666">" is not in supported range [0,%d]"</font>, n, PETSC_FACTORIAL_MAX);
<a name="line232">232: </a> <font color="#4169E1">if</font> (n <= 12) {
<a name="line233">233: </a> *factorial = facLookup[n];
<a name="line234">234: </a> } <font color="#4169E1">else</font> {
<a name="line235">235: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> f = facLookup[12];
<a name="line236">236: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> i;
<a name="line238">238: </a> <font color="#4169E1">for</font> (i = 13; i < n + 1; ++i) f *= i;
<a name="line239">239: </a> *factorial = f;
<a name="line240">240: </a> }
<a name="line241">241: </a> <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);
<a name="line242">242: </a>}
<a name="line244">244: </a><font color="#B22222">/*MC</font>
<a name="line245">245: </a><font color="#B22222"> <a href="../manualpages/DT/PetscDTBinomial.html">PetscDTBinomial</a> - Approximate the binomial coefficient `n` choose `k`</font>
<a name="line247">247: </a><font color="#B22222"> Input Parameters:</font>
<a name="line248">248: </a><font color="#B22222">+ n - a non-negative integer</font>
<a name="line249">249: </a><font color="#B22222">- k - an integer between 0 and `n`, inclusive</font>
<a name="line251">251: </a><font color="#B22222"> Output Parameter:</font>
<a name="line252">252: </a><font color="#B22222">. binomial - approximation of the binomial coefficient `n` choose `k`</font>
<a name="line254">254: </a><font color="#B22222"> Level: beginner</font>
<a name="line256">256: </a><font color="#B22222">.seealso: `<a href="../manualpages/DT/PetscDTFactorial.html">PetscDTFactorial</a>()`, `<a href="../manualpages/DT/PetscDTFactorialInt.html">PetscDTFactorialInt</a>()`, `<a href="../manualpages/DT/PetscDTBinomialInt.html">PetscDTBinomialInt</a>()`, `<a href="../manualpages/DT/PetscDTEnumPerm.html">PetscDTEnumPerm</a>()`</font>
<a name="line257">257: </a><font color="#B22222">M*/</font>
<a name="line258">258: </a><strong><font color="#4169E1"><a name="PetscDTBinomial"></a>static inline <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTBinomial.html">PetscDTBinomial</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> n, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> k, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *binomial)</font></strong>
<a name="line259">259: </a>{
<a name="line260">260: </a> <a href="../manualpages/Sys/PetscFunctionBeginHot.html">PetscFunctionBeginHot</a>;
<a name="line261">261: </a> *binomial = -1.0;
<a name="line262">262: </a> <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(n >= 0 && k >= 0 && k <= n, <a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>, <font color="#666666">"Binomial arguments (%"</font> PetscInt_FMT <font color="#666666">" %"</font> PetscInt_FMT <font color="#666666">") must be non-negative, k <= n"</font>, n, k);
<a name="line263">263: </a> <font color="#4169E1">if</font> (n <= 3) {
<a name="line264">264: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> binomLookup[4][4] = {
<a name="line265">265: </a> {1, 0, 0, 0},
<a name="line266">266: </a> {1, 1, 0, 0},
<a name="line267">267: </a> {1, 2, 1, 0},
<a name="line268">268: </a> {1, 3, 3, 1}
<a name="line269">269: </a> };
<a name="line271">271: </a> *binomial = (<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>)binomLookup[n][k];
<a name="line272">272: </a> } <font color="#4169E1">else</font> {
<a name="line273">273: </a> <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> binom = 1.0;
<a name="line275">275: </a> k = <a href="../manualpages/Sys/PetscMin.html">PetscMin</a>(k, n - k);
<a name="line276">276: </a> <font color="#4169E1">for</font> (<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> i = 0; i < k; i++) binom = (binom * (<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>)(n - i)) / (<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>)(i + 1);
<a name="line277">277: </a> *binomial = binom;
<a name="line278">278: </a> }
<a name="line279">279: </a> <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);
<a name="line280">280: </a>}
<a name="line282">282: </a><font color="#B22222">/*MC</font>
<a name="line283">283: </a><font color="#B22222"> <a href="../manualpages/DT/PetscDTBinomialInt.html">PetscDTBinomialInt</a> - Compute the binomial coefficient `n` choose `k`</font>
<a name="line285">285: </a><font color="#B22222"> Input Parameters:</font>
<a name="line286">286: </a><font color="#B22222">+ n - a non-negative integer</font>
<a name="line287">287: </a><font color="#B22222">- k - an integer between 0 and `n`, inclusive</font>
<a name="line289">289: </a><font color="#B22222"> Output Parameter:</font>
<a name="line290">290: </a><font color="#B22222">. binomial - the binomial coefficient `n` choose `k`</font>
<a name="line292">292: </a><font color="#B22222"> Level: beginner</font>
<a name="line294">294: </a><font color="#B22222"> Note:</font>
<a name="line295">295: </a><font color="#B22222"> This is limited by integers that can be represented by `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`.</font>
<a name="line297">297: </a><font color="#B22222"> Use `<a href="../manualpages/DT/PetscDTBinomial.html">PetscDTBinomial</a>()` for real number approximations of larger values</font>
<a name="line299">299: </a><font color="#B22222">.seealso: `<a href="../manualpages/DT/PetscDTFactorial.html">PetscDTFactorial</a>()`, `<a href="../manualpages/DT/PetscDTFactorialInt.html">PetscDTFactorialInt</a>()`, `<a href="../manualpages/DT/PetscDTBinomial.html">PetscDTBinomial</a>()`, `<a href="../manualpages/DT/PetscDTEnumPerm.html">PetscDTEnumPerm</a>()`</font>
<a name="line300">300: </a><font color="#B22222">M*/</font>
<a name="line301">301: </a><strong><font color="#4169E1"><a name="PetscDTBinomialInt"></a>static inline <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTBinomialInt.html">PetscDTBinomialInt</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> n, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> k, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *binomial)</font></strong>
<a name="line302">302: </a>{
<a name="line303">303: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> bin;
<a name="line305">305: </a> <a href="../manualpages/Sys/PetscFunctionBegin.html">PetscFunctionBegin</a>;
<a name="line306">306: </a> *binomial = -1;
<a name="line307">307: </a> <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(n >= 0 && k >= 0 && k <= n, <a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>, <font color="#666666">"Binomial arguments (%"</font> PetscInt_FMT <font color="#666666">" %"</font> PetscInt_FMT <font color="#666666">") must be non-negative, k <= n"</font>, n, k);
<a name="line308">308: </a> <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(n <= PETSC_BINOMIAL_MAX, <a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>, <font color="#666666">"Binomial elements %"</font> PetscInt_FMT <font color="#666666">" is larger than max for <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, %d"</font>, n, PETSC_BINOMIAL_MAX);
<a name="line309">309: </a> <font color="#4169E1">if</font> (n <= 3) {
<a name="line310">310: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> binomLookup[4][4] = {
<a name="line311">311: </a> {1, 0, 0, 0},
<a name="line312">312: </a> {1, 1, 0, 0},
<a name="line313">313: </a> {1, 2, 1, 0},
<a name="line314">314: </a> {1, 3, 3, 1}
<a name="line315">315: </a> };
<a name="line317">317: </a> bin = binomLookup[n][k];
<a name="line318">318: </a> } <font color="#4169E1">else</font> {
<a name="line319">319: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> binom = 1;
<a name="line321">321: </a> k = <a href="../manualpages/Sys/PetscMin.html">PetscMin</a>(k, n - k);
<a name="line322">322: </a> <font color="#4169E1">for</font> (<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> i = 0; i < k; i++) binom = (binom * (n - i)) / (i + 1);
<a name="line323">323: </a> bin = binom;
<a name="line324">324: </a> }
<a name="line325">325: </a> *binomial = bin;
<a name="line326">326: </a> <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);
<a name="line327">327: </a>}
<a name="line329">329: </a><font color="#B22222">/* the following inline routines should be not be inline routines and then Fortran binding can be built automatically */</font>
<a name="line330">330: </a><strong><font color="#228B22">#define PeOp</font></strong>
<a name="line332">332: </a><font color="#B22222">/*MC</font>
<a name="line333">333: </a><font color="#B22222"> <a href="../manualpages/DT/PetscDTEnumPerm.html">PetscDTEnumPerm</a> - Get a permutation of `n` integers from its encoding into the integers [0, n!) as a sequence of swaps.</font>
<a name="line335">335: </a><font color="#B22222"> Input Parameters:</font>
<a name="line336">336: </a><font color="#B22222">+ n - a non-negative integer (see note about limits below)</font>
<a name="line337">337: </a><font color="#B22222">- k - an integer in [0, n!)</font>
<a name="line339">339: </a><font color="#B22222"> Output Parameters:</font>
<a name="line340">340: </a><font color="#B22222">+ perm - the permuted list of the integers [0, ..., n-1]</font>
<a name="line341">341: </a><font color="#B22222">- isOdd - if not `NULL`, returns whether the permutation used an even or odd number of swaps.</font>
<a name="line343">343: </a><font color="#B22222"> Level: intermediate</font>
<a name="line345">345: </a><font color="#B22222"> Notes:</font>
<a name="line346">346: </a><font color="#B22222"> A permutation can be described by the operations that convert the lists [0, 1, ..., n-1] into the permutation,</font>
<a name="line347">347: </a><font color="#B22222"> by a sequence of swaps, where the ith step swaps whatever number is in ith position with a number that is in</font>
<a name="line348">348: </a><font color="#B22222"> some position j >= i. This swap is encoded as the difference (j - i). The difference d_i at step i is less than</font>
<a name="line349">349: </a><font color="#B22222"> (n - i). This sequence of n-1 differences [d_0, ..., d_{n-2}] is encoded as the number</font>
<a name="line350">350: </a><font color="#B22222"> (n-1)! * d_0 + (n-2)! * d_1 + ... + 1! * d_{n-2}.</font>
<a name="line352">352: </a><font color="#B22222"> Limited to `n` such that `n`! can be represented by `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, which is 12 if `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` is a signed 32-bit integer and 20 if `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` is a signed 64-bit integer.</font>
<a name="line354">354: </a><font color="#B22222">.seealso: `<a href="../manualpages/DT/PetscDTFactorial.html">PetscDTFactorial</a>()`, `<a href="../manualpages/DT/PetscDTFactorialInt.html">PetscDTFactorialInt</a>()`, `<a href="../manualpages/DT/PetscDTBinomial.html">PetscDTBinomial</a>()`, `<a href="../manualpages/DT/PetscDTBinomialInt.html">PetscDTBinomialInt</a>()`, `<a href="../manualpages/DT/PetscDTPermIndex.html">PetscDTPermIndex</a>()`</font>
<a name="line355">355: </a><font color="#B22222">M*/</font>
<a name="line356">356: </a><strong><font color="#4169E1"><a name="PetscDTEnumPerm"></a>static inline <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTEnumPerm.html">PetscDTEnumPerm</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> n, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> k, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *perm, PeOp <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *isOdd)</font></strong>
<a name="line357">357: </a>{
<a name="line358">358: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> odd = 0;
<a name="line359">359: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> i;
<a name="line360">360: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> work[PETSC_FACTORIAL_MAX];
<a name="line361">361: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *w;
<a name="line363">363: </a> <a href="../manualpages/Sys/PetscFunctionBegin.html">PetscFunctionBegin</a>;
<a name="line364">364: </a> <font color="#4169E1">if</font> (isOdd) *isOdd = <a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>;
<a name="line365">365: </a> <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(n >= 0 && n <= PETSC_FACTORIAL_MAX, <a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>, <font color="#666666">"Number of elements %"</font> PetscInt_FMT <font color="#666666">" is not in supported range [0,%d]"</font>, n, PETSC_FACTORIAL_MAX);
<a name="line366">366: </a> <font color="#4169E1">if</font> (n >= 2) {
<a name="line367">367: </a> w = &work[n - 2];
<a name="line368">368: </a> <font color="#4169E1">for</font> (i = 2; i <= n; i++) {
<a name="line369">369: </a> *(w--) = k % i;
<a name="line370">370: </a> k /= i;
<a name="line371">371: </a> }
<a name="line372">372: </a> }
<a name="line373">373: </a> <font color="#4169E1">for</font> (i = 0; i < n; i++) perm[i] = i;
<a name="line374">374: </a> <font color="#4169E1">for</font> (i = 0; i < n - 1; i++) {
<a name="line375">375: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> s = work[i];
<a name="line376">376: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> swap = perm[i];
<a name="line378">378: </a> perm[i] = perm[i + s];
<a name="line379">379: </a> perm[i + s] = swap;
<a name="line380">380: </a> odd ^= (!!s);
<a name="line381">381: </a> }
<a name="line382">382: </a> <font color="#4169E1">if</font> (isOdd) *isOdd = odd ? <a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a> : <a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>;
<a name="line383">383: </a> <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);
<a name="line384">384: </a>}
<a name="line386">386: </a><font color="#B22222">/*MC</font>
<a name="line387">387: </a><font color="#B22222"> <a href="../manualpages/DT/PetscDTPermIndex.html">PetscDTPermIndex</a> - Encode a permutation of n into an integer in [0, n!). This inverts `<a href="../manualpages/DT/PetscDTEnumPerm.html">PetscDTEnumPerm</a>()`.</font>
<a name="line389">389: </a><font color="#B22222"> Input Parameters:</font>
<a name="line390">390: </a><font color="#B22222">+ n - a non-negative integer (see note about limits below)</font>
<a name="line391">391: </a><font color="#B22222">- perm - the permuted list of the integers [0, ..., n-1]</font>
<a name="line393">393: </a><font color="#B22222"> Output Parameters:</font>
<a name="line394">394: </a><font color="#B22222">+ k - an integer in [0, n!)</font>
<a name="line395">395: </a><font color="#B22222">- isOdd - if not `NULL`, returns whether the permutation used an even or odd number of swaps.</font>
<a name="line397">397: </a><font color="#B22222"> Level: beginner</font>
<a name="line399">399: </a><font color="#B22222"> Note:</font>
<a name="line400">400: </a><font color="#B22222"> Limited to `n` such that `n`! can be represented by `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, which is 12 if `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` is a signed 32-bit integer and 20 if `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` is a signed 64-bit integer.</font>
<a name="line402">402: </a><font color="#B22222">.seealso: `<a href="../manualpages/DT/PetscDTFactorial.html">PetscDTFactorial</a>()`, `<a href="../manualpages/DT/PetscDTFactorialInt.html">PetscDTFactorialInt</a>()`, `<a href="../manualpages/DT/PetscDTBinomial.html">PetscDTBinomial</a>()`, `<a href="../manualpages/DT/PetscDTBinomialInt.html">PetscDTBinomialInt</a>()`, `<a href="../manualpages/DT/PetscDTEnumPerm.html">PetscDTEnumPerm</a>()`</font>
<a name="line403">403: </a><font color="#B22222">M*/</font>
<a name="line404">404: </a><strong><font color="#4169E1"><a name="PetscDTPermIndex"></a>static inline <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTPermIndex.html">PetscDTPermIndex</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> n, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *perm, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *k, PeOp <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *isOdd)</font></strong>
<a name="line405">405: </a>{
<a name="line406">406: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> odd = 0;
<a name="line407">407: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> i, idx;
<a name="line408">408: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> work[PETSC_FACTORIAL_MAX];
<a name="line409">409: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> iwork[PETSC_FACTORIAL_MAX];
<a name="line411">411: </a> <a href="../manualpages/Sys/PetscFunctionBeginHot.html">PetscFunctionBeginHot</a>;
<a name="line412">412: </a> *k = -1;
<a name="line413">413: </a> <font color="#4169E1">if</font> (isOdd) *isOdd = <a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>;
<a name="line414">414: </a> <a href="../manualpages/Sys/PetscCheck.html">PetscCheck</a>(n >= 0 && n <= PETSC_FACTORIAL_MAX, <a href="../manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>, <font color="#666666">"Number of elements %"</font> PetscInt_FMT <font color="#666666">" is not in supported range [0,%d]"</font>, n, PETSC_FACTORIAL_MAX);
<a name="line415">415: </a> <font color="#4169E1">for</font> (i = 0; i < n; i++) work[i] = i; <font color="#B22222">/* partial permutation */</font>
<a name="line416">416: </a> <font color="#4169E1">for</font> (i = 0; i < n; i++) iwork[i] = i; <font color="#B22222">/* partial permutation inverse */</font>
<a name="line417">417: </a> <font color="#4169E1">for</font> (idx = 0, i = 0; i < n - 1; i++) {
<a name="line418">418: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> j = perm[i];
<a name="line419">419: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> icur = work[i];
<a name="line420">420: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> jloc = iwork[j];
<a name="line421">421: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> diff = jloc - i;
<a name="line423">423: </a> idx = idx * (n - i) + diff;
<a name="line424">424: </a> <font color="#B22222">/* swap (i, jloc) */</font>
<a name="line425">425: </a> work[i] = j;
<a name="line426">426: </a> work[jloc] = icur;
<a name="line427">427: </a> iwork[j] = i;
<a name="line428">428: </a> iwork[icur] = jloc;
<a name="line429">429: </a> odd ^= (!!diff);
<a name="line430">430: </a> }
<a name="line431">431: </a> *k = idx;
<a name="line432">432: </a> <font color="#4169E1">if</font> (isOdd) *isOdd = odd ? <a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a> : <a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>;
<a name="line433">433: </a> <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);
<a name="line434">434: </a>}
<a name="line436">436: </a><font color="#B22222">/*MC</font>
<a name="line437">437: </a><font color="#B22222"> <a href="../manualpages/DT/PetscDTEnumSubset.html">PetscDTEnumSubset</a> - Get an ordered subset of the integers [0, ..., n - 1] from its encoding as an integers in [0, n choose k).</font>
<a name="line438">438: </a><font color="#B22222"> The encoding is in lexicographic order.</font>
<a name="line440">440: </a><font color="#B22222"> Input Parameters:</font>
<a name="line441">441: </a><font color="#B22222">+ n - a non-negative integer (see note about limits below)</font>
<a name="line442">442: </a><font color="#B22222">. k - an integer in [0, n]</font>
<a name="line443">443: </a><font color="#B22222">- j - an index in [0, n choose k)</font>
<a name="line445">445: </a><font color="#B22222"> Output Parameter:</font>
<a name="line446">446: </a><font color="#B22222">. subset - the jth subset of size k of the integers [0, ..., n - 1]</font>
<a name="line448">448: </a><font color="#B22222"> Level: beginner</font>
<a name="line450">450: </a><font color="#B22222"> Note:</font>
<a name="line451">451: </a><font color="#B22222"> Limited by arguments such that `n` choose `k` can be represented by `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`</font>
<a name="line453">453: </a><font color="#B22222">.seealso: `<a href="../manualpages/DT/PetscDTSubsetIndex.html">PetscDTSubsetIndex</a>()`, `<a href="../manualpages/DT/PetscDTFactorial.html">PetscDTFactorial</a>()`, `<a href="../manualpages/DT/PetscDTFactorialInt.html">PetscDTFactorialInt</a>()`, `<a href="../manualpages/DT/PetscDTBinomial.html">PetscDTBinomial</a>()`, `<a href="../manualpages/DT/PetscDTBinomialInt.html">PetscDTBinomialInt</a>()`, `<a href="../manualpages/DT/PetscDTEnumPerm.html">PetscDTEnumPerm</a>()`, `<a href="../manualpages/DT/PetscDTPermIndex.html">PetscDTPermIndex</a>()`</font>
<a name="line454">454: </a><font color="#B22222">M*/</font>
<a name="line455">455: </a><strong><font color="#4169E1"><a name="PetscDTEnumSubset"></a>static inline <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTEnumSubset.html">PetscDTEnumSubset</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> n, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> k, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> j, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *subset)</font></strong>
<a name="line456">456: </a>{
<a name="line457">457: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> Nk;
<a name="line459">459: </a> <a href="../manualpages/Sys/PetscFunctionBeginHot.html">PetscFunctionBeginHot</a>;
<a name="line460">460: </a> <a href="../manualpages/Sys/PetscCall.html">PetscCall</a>(<a href="../manualpages/DT/PetscDTBinomialInt.html">PetscDTBinomialInt</a>(n, k, &Nk));
<a name="line461">461: </a> <font color="#4169E1">for</font> (<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> i = 0, l = 0; i < n && l < k; i++) {
<a name="line462">462: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> Nminuskminus = (Nk * (k - l)) / (n - i);
<a name="line463">463: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> Nminusk = Nk - Nminuskminus;
<a name="line465">465: </a> <font color="#4169E1">if</font> (j < Nminuskminus) {
<a name="line466">466: </a> subset[l++] = i;
<a name="line467">467: </a> Nk = Nminuskminus;
<a name="line468">468: </a> } <font color="#4169E1">else</font> {
<a name="line469">469: </a> j -= Nminuskminus;
<a name="line470">470: </a> Nk = Nminusk;
<a name="line471">471: </a> }
<a name="line472">472: </a> }
<a name="line473">473: </a> <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);
<a name="line474">474: </a>}
<a name="line476">476: </a><font color="#B22222">/*MC</font>
<a name="line477">477: </a><font color="#B22222"> <a href="../manualpages/DT/PetscDTSubsetIndex.html">PetscDTSubsetIndex</a> - Convert an ordered subset of k integers from the set [0, ..., n - 1] to its encoding as an integers in [0, n choose k) in lexicographic order.</font>
<a name="line478">478: </a><font color="#B22222"> This is the inverse of `<a href="../manualpages/DT/PetscDTEnumSubset.html">PetscDTEnumSubset</a>`.</font>
<a name="line480">480: </a><font color="#B22222"> Input Parameters:</font>
<a name="line481">481: </a><font color="#B22222">+ n - a non-negative integer (see note about limits below)</font>
<a name="line482">482: </a><font color="#B22222">. k - an integer in [0, n]</font>
<a name="line483">483: </a><font color="#B22222">- subset - an ordered subset of the integers [0, ..., n - 1]</font>
<a name="line485">485: </a><font color="#B22222"> Output Parameter:</font>
<a name="line486">486: </a><font color="#B22222">. index - the rank of the subset in lexicographic order</font>
<a name="line488">488: </a><font color="#B22222"> Level: beginner</font>
<a name="line490">490: </a><font color="#B22222"> Note:</font>
<a name="line491">491: </a><font color="#B22222"> Limited by arguments such that `n` choose `k` can be represented by `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`</font>
<a name="line493">493: </a><font color="#B22222">.seealso: `<a href="../manualpages/DT/PetscDTEnumSubset.html">PetscDTEnumSubset</a>()`, `<a href="../manualpages/DT/PetscDTFactorial.html">PetscDTFactorial</a>()`, `<a href="../manualpages/DT/PetscDTFactorialInt.html">PetscDTFactorialInt</a>()`, `<a href="../manualpages/DT/PetscDTBinomial.html">PetscDTBinomial</a>()`, `<a href="../manualpages/DT/PetscDTBinomialInt.html">PetscDTBinomialInt</a>()`, `<a href="../manualpages/DT/PetscDTEnumPerm.html">PetscDTEnumPerm</a>()`, `<a href="../manualpages/DT/PetscDTPermIndex.html">PetscDTPermIndex</a>()`</font>
<a name="line494">494: </a><font color="#B22222">M*/</font>
<a name="line495">495: </a><strong><font color="#4169E1"><a name="PetscDTSubsetIndex"></a>static inline <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTSubsetIndex.html">PetscDTSubsetIndex</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> n, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> k, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *subset, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *index)</font></strong>
<a name="line496">496: </a>{
<a name="line497">497: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> j = 0, Nk;
<a name="line499">499: </a> <a href="../manualpages/Sys/PetscFunctionBegin.html">PetscFunctionBegin</a>;
<a name="line500">500: </a> *index = -1;
<a name="line501">501: </a> <a href="../manualpages/Sys/PetscCall.html">PetscCall</a>(<a href="../manualpages/DT/PetscDTBinomialInt.html">PetscDTBinomialInt</a>(n, k, &Nk));
<a name="line502">502: </a> <font color="#4169E1">for</font> (<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> i = 0, l = 0; i < n && l < k; i++) {
<a name="line503">503: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> Nminuskminus = (Nk * (k - l)) / (n - i);
<a name="line504">504: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> Nminusk = Nk - Nminuskminus;
<a name="line506">506: </a> <font color="#4169E1">if</font> (subset[l] == i) {
<a name="line507">507: </a> l++;
<a name="line508">508: </a> Nk = Nminuskminus;
<a name="line509">509: </a> } <font color="#4169E1">else</font> {
<a name="line510">510: </a> j += Nminuskminus;
<a name="line511">511: </a> Nk = Nminusk;
<a name="line512">512: </a> }
<a name="line513">513: </a> }
<a name="line514">514: </a> *index = j;
<a name="line515">515: </a> <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);
<a name="line516">516: </a>}
<a name="line518">518: </a><font color="#B22222">/*MC</font>
<a name="line519">519: </a><font color="#B22222"> <a href="../manualpages/DT/PetscDTEnumSplit.html">PetscDTEnumSplit</a> - Split the integers [0, ..., n - 1] into two complementary ordered subsets, the first subset of size k and being the jth subset of that size in lexicographic order.</font>
<a name="line521">521: </a><font color="#B22222"> Input Parameters:</font>
<a name="line522">522: </a><font color="#B22222">+ n - a non-negative integer (see note about limits below)</font>
<a name="line523">523: </a><font color="#B22222">. k - an integer in [0, n]</font>
<a name="line524">524: </a><font color="#B22222">- j - an index in [0, n choose k)</font>
<a name="line526">526: </a><font color="#B22222"> Output Parameters:</font>
<a name="line527">527: </a><font color="#B22222">+ perm - the jth subset of size k of the integers [0, ..., n - 1], followed by its complementary set.</font>
<a name="line528">528: </a><font color="#B22222">- isOdd - if not `NULL`, return whether perm is an even or odd permutation.</font>
<a name="line530">530: </a><font color="#B22222"> Level: beginner</font>
<a name="line532">532: </a><font color="#B22222"> Note:</font>
<a name="line533">533: </a><font color="#B22222"> Limited by arguments such that `n` choose `k` can be represented by `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`</font>
<a name="line535">535: </a><font color="#B22222">.seealso: `<a href="../manualpages/DT/PetscDTEnumSubset.html">PetscDTEnumSubset</a>()`, `<a href="../manualpages/DT/PetscDTSubsetIndex.html">PetscDTSubsetIndex</a>()`, `<a href="../manualpages/DT/PetscDTFactorial.html">PetscDTFactorial</a>()`, `<a href="../manualpages/DT/PetscDTFactorialInt.html">PetscDTFactorialInt</a>()`, `<a href="../manualpages/DT/PetscDTBinomial.html">PetscDTBinomial</a>()`, `<a href="../manualpages/DT/PetscDTBinomialInt.html">PetscDTBinomialInt</a>()`, `<a href="../manualpages/DT/PetscDTEnumPerm.html">PetscDTEnumPerm</a>()`,</font>
<a name="line536">536: </a><font color="#B22222"> `<a href="../manualpages/DT/PetscDTPermIndex.html">PetscDTPermIndex</a>()`</font>
<a name="line537">537: </a><font color="#B22222">M*/</font>
<a name="line538">538: </a><strong><font color="#4169E1"><a name="PetscDTEnumSplit"></a>static inline <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscDTEnumSplit.html">PetscDTEnumSplit</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a> n, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> k, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> j, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *perm, PeOp <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> *isOdd)</font></strong>
<a name="line539">539: </a>{
<a name="line540">540: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> i, l, m, Nk, odd = 0;
<a name="line541">541: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *subcomp = <a href="../manualpages/Sys/PetscSafePointerPlusOffset.html">PetscSafePointerPlusOffset</a>(perm, k);
<a name="line543">543: </a> <a href="../manualpages/Sys/PetscFunctionBegin.html">PetscFunctionBegin</a>;
<a name="line544">544: </a> <font color="#4169E1">if</font> (isOdd) *isOdd = <a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>;
<a name="line545">545: </a> <a href="../manualpages/Sys/PetscCall.html">PetscCall</a>(<a href="../manualpages/DT/PetscDTBinomialInt.html">PetscDTBinomialInt</a>(n, k, &Nk));
<a name="line546">546: </a> <font color="#4169E1">for</font> (i = 0, l = 0, m = 0; i < n && l < k; i++) {
<a name="line547">547: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> Nminuskminus = (Nk * (k - l)) / (n - i);
<a name="line548">548: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> Nminusk = Nk - Nminuskminus;
<a name="line550">550: </a> <font color="#4169E1">if</font> (j < Nminuskminus) {
<a name="line551">551: </a> perm[l++] = i;
<a name="line552">552: </a> Nk = Nminuskminus;
<a name="line553">553: </a> } <font color="#4169E1">else</font> {
<a name="line554">554: </a> subcomp[m++] = i;
<a name="line555">555: </a> j -= Nminuskminus;
<a name="line556">556: </a> odd ^= ((k - l) & 1);
<a name="line557">557: </a> Nk = Nminusk;
<a name="line558">558: </a> }
<a name="line559">559: </a> }
<a name="line560">560: </a> <font color="#4169E1">for</font> (; i < n; i++) subcomp[m++] = i;
<a name="line561">561: </a> <font color="#4169E1">if</font> (isOdd) *isOdd = odd ? <a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a> : <a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>;
<a name="line562">562: </a> <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);
<a name="line563">563: </a>}
<a name="line565">565: </a><font color="#4169E1"><a name="_n_PetscTabulation"></a>struct _n_PetscTabulation </font>{
<a name="line566">566: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> K; <font color="#B22222">/* Indicates a k-jet, namely tabulated derivatives up to order k */</font>
<a name="line567">567: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> Nr; <font color="#B22222">/* The number of tabulation replicas (often 1) */</font>
<a name="line568">568: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> Np; <font color="#B22222">/* The number of tabulation points in a replica */</font>
<a name="line569">569: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> Nb; <font color="#B22222">/* The number of functions tabulated */</font>
<a name="line570">570: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> Nc; <font color="#B22222">/* The number of function components */</font>
<a name="line571">571: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> cdim; <font color="#B22222">/* The coordinate dimension */</font>
<a name="line572">572: </a> <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> **T; <font color="#B22222">/* The tabulation T[K] of functions and their derivatives</font>
<a name="line573">573: </a><font color="#B22222"> T[0] = B[Nr*Np][Nb][Nc]: The basis function values at quadrature points</font>
<a name="line574">574: </a><font color="#B22222"> T[1] = D[Nr*Np][Nb][Nc][cdim]: The basis function derivatives at quadrature points</font>
<a name="line575">575: </a><font color="#B22222"> T[2] = H[Nr*Np][Nb][Nc][cdim][cdim]: The basis function second derivatives at quadrature points */</font>
<a name="line576">576: </a>};
<a name="line578">578: </a><font color="#B22222">/*S</font>
<a name="line579">579: </a><font color="#B22222"> <a href="../manualpages/DT/PetscTabulation.html">PetscTabulation</a> - PETSc object that manages tabulations for finite element methods.</font>
<a name="line581">581: </a><font color="#B22222"> Level: intermediate</font>
<a name="line583">583: </a><font color="#B22222"> Note:</font>
<a name="line584">584: </a><font color="#B22222"> This is a pointer to a C struct, hence the data in it may be accessed directly.</font>
<a name="line586">586: </a><font color="#B22222"> Fortran Note:</font>
<a name="line587">587: </a><font color="#B22222"> Use `PetscTabulationGetData()` and `PetscTabulationRestoreData()` to access the arrays in the tabulation.</font>
<a name="line589">589: </a><font color="#B22222"> Developer Note:</font>
<a name="line590">590: </a><font color="#B22222"> TODO: put the meaning of the struct fields in this manual page</font>
<a name="line592">592: </a><font color="#B22222">.seealso: `<a href="../manualpages/FE/PetscTabulationDestroy.html">PetscTabulationDestroy</a>()`, `<a href="../manualpages/FE/PetscFECreateTabulation.html">PetscFECreateTabulation</a>()`, `<a href="../manualpages/FE/PetscFEGetCellTabulation.html">PetscFEGetCellTabulation</a>()`</font>
<a name="line593">593: </a><font color="#B22222">S*/</font>
<a name="line594">594: </a><font color="#4169E1">typedef struct _n_PetscTabulation *<a href="../manualpages/DT/PetscTabulation.html">PetscTabulation</a>;</font>
<a name="line596">596: </a><strong><font color="#4169E1">typedef <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*PetscProbFunc)(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line598">598: </a><font color="#4169E1">typedef</font> <font color="#4169E1">enum</font> {
<a name="line599">599: </a> DTPROB_DENSITY_CONSTANT,
<a name="line600">600: </a> DTPROB_DENSITY_GAUSSIAN,
<a name="line601">601: </a> DTPROB_DENSITY_MAXWELL_BOLTZMANN,
<a name="line602">602: </a> DTPROB_NUM_DENSITY
<a name="line603">603: </a>} DTProbDensityType;
<a name="line604">604: </a>PETSC_EXTERN const char *const DTProbDensityTypes[];
<a name="line606">606: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscPDFMaxwellBoltzmann1D.html">PetscPDFMaxwellBoltzmann1D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line607">607: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscCDFMaxwellBoltzmann1D.html">PetscCDFMaxwellBoltzmann1D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line608">608: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscPDFMaxwellBoltzmann2D.html">PetscPDFMaxwellBoltzmann2D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line609">609: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscCDFMaxwellBoltzmann2D.html">PetscCDFMaxwellBoltzmann2D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line610">610: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscPDFMaxwellBoltzmann3D.html">PetscPDFMaxwellBoltzmann3D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line611">611: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscCDFMaxwellBoltzmann3D.html">PetscCDFMaxwellBoltzmann3D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line612">612: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscPDFGaussian1D.html">PetscPDFGaussian1D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line613">613: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscCDFGaussian1D(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line614">614: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscPDFSampleGaussian1D.html">PetscPDFSampleGaussian1D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line615">615: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscPDFGaussian2D.html">PetscPDFGaussian2D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line616">616: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscPDFSampleGaussian2D.html">PetscPDFSampleGaussian2D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line617">617: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscPDFGaussian3D.html">PetscPDFGaussian3D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line618">618: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscPDFSampleGaussian3D.html">PetscPDFSampleGaussian3D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line619">619: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscPDFConstant1D.html">PetscPDFConstant1D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line620">620: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscCDFConstant1D.html">PetscCDFConstant1D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line621">621: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscPDFSampleConstant1D.html">PetscPDFSampleConstant1D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line622">622: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscPDFConstant2D.html">PetscPDFConstant2D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line623">623: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscCDFConstant2D.html">PetscCDFConstant2D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line624">624: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscPDFSampleConstant2D.html">PetscPDFSampleConstant2D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line625">625: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscPDFConstant3D.html">PetscPDFConstant3D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line626">626: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscCDFConstant3D.html">PetscCDFConstant3D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line627">627: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscPDFSampleConstant3D.html">PetscPDFSampleConstant3D</a>(const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[])</font></strong>;
<a name="line628">628: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscProbCreateFromOptions.html">PetscProbCreateFromOptions</a>(<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const char[], const char[], PetscProbFunc *, PetscProbFunc *, PetscProbFunc *)</font></strong>;
<a name="line630">630: </a>#include <A href="../include/petscvec.h.html"><petscvec.h></A>
<a name="line632">632: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscProbComputeKSStatistic.html">PetscProbComputeKSStatistic</a>(<a href="../manualpages/Vec/Vec.html">Vec</a>, PetscProbFunc, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line633">633: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscProbComputeKSStatisticWeighted.html">PetscProbComputeKSStatisticWeighted</a>(<a href="../manualpages/Vec/Vec.html">Vec</a>, <a href="../manualpages/Vec/Vec.html">Vec</a>, PetscProbFunc, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
<a name="line634">634: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/DT/PetscProbComputeKSStatisticMagnitude.html">PetscProbComputeKSStatisticMagnitude</a>(<a href="../manualpages/Vec/Vec.html">Vec</a>, PetscProbFunc, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> *)</font></strong>;
</pre>
</body>
</html>
|