/usr/include/ug/assemble.h is in libug-dev 3.11.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 | // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
/****************************************************************************/
/* */
/* File: assemble.h */
/* */
/* Purpose: definition of the assemble num proc type */
/* */
/* Author: Christian Wieners */
/* Institut fuer Computeranwendungen III */
/* Universitaet Stuttgart */
/* Pfaffenwaldring 27 */
/* 70569 Stuttgart */
/* email: ug@ica3.uni-stuttgart.de */
/* */
/* History: November 29, 1996 */
/* */
/* Remarks: */
/* */
/****************************************************************************/
/* RCS_ID
$Header$
*/
/****************************************************************************/
/* */
/* auto include mechanism and other include files */
/* */
/****************************************************************************/
#ifndef __ASSEMBLE__
#define __ASSEMBLE__
#include "np.h"
#include "namespace.h"
START_UGDIM_NAMESPACE
/****************************************************************************/
/* */
/* defines in the following order */
/* */
/* compile time constants defining static data size (i.e. arrays) */
/* other constants */
/* macros */
/* */
/****************************************************************************/
#define ASSEMBLE_CLASS_NAME "assemble"
#define NL_ASSEMBLE_CLASS_NAME "nlass"
#define ENL_ASSEMBLE_CLASS_NAME "enlass"
#define T_ASSEMBLE_CLASS_NAME "tass"
#define NL_PARTASS_CLASS_NAME "nlpass"
#define T_PARTASS_CLASS_NAME "tpass"
enum PP_ACTIONS {
PARTASS_UNKNOWN,
PARTASS_DEFECT = 1<<0,
PARTASS_MATRIX = 1<<1
};
#define PARTASS_DEF_AND_MAT (PARTASS_DEFECT | PARTASS_MATRIX)
/* access macros for NP_ASSEMBLE */
#define NPASS_x(p) (((NP_ASSEMBLE*)(p))->x)
#define NPASS_c(p) (((NP_ASSEMBLE*)(p))->c)
#define NPASS_b(p) (((NP_ASSEMBLE*)(p))->b)
#define NPASS_A(p) (((NP_ASSEMBLE*)(p))->A)
#define NPASS_PRE(p) (((NP_ASSEMBLE*)(p))->PreProcess)
#define NPASS_ASSSOL(p) (((NP_ASSEMBLE*)(p))->AssembleSolution)
#define NPASS_ASSDEF(p) (((NP_ASSEMBLE*)(p))->AssembleDefect)
#define NPASS_ASSMAT(p) (((NP_ASSEMBLE*)(p))->AssembleMatrix)
#define NPASS_ASS(p) (((NP_ASSEMBLE*)(p))->Assemble)
#define NPASS_POST(p) (((NP_ASSEMBLE*)(p))->PostProcess)
/* access macros for NP_LOCAL_ASSEMBLE */
#define NPLOC_GALERKIN(p) (((NP_LOCAL_ASSEMBLE*)(p))->galerkin)
#define NPLOC_PRE(p) (((NP_LOCAL_ASSEMBLE*)(p))->PreProcess)
#define NPLOC_ASS(p) (((NP_LOCAL_ASSEMBLE*)(p))->AssembleLocal)
#define NPLOC_ASSDEF(p) (((NP_LOCAL_ASSEMBLE*)(p))->AssembleLocalDefect)
#define NPLOC_ASSMAT(p) (((NP_LOCAL_ASSEMBLE*)(p))->AssembleLocalMatrix)
#define NPLOC_POSTMAT(p) (((NP_LOCAL_ASSEMBLE*)(p))->PostMatrix)
#define NPLOC_POST(p) (((NP_LOCAL_ASSEMBLE*)(p))->PostProcess)
/* access macros for NP_NL_ASSEMBLE */
#define NPANL_x(p) (((NP_NL_ASSEMBLE*)(p))->x)
#define NPANL_c(p) (((NP_NL_ASSEMBLE*)(p))->c)
#define NPANL_b(p) (((NP_NL_ASSEMBLE*)(p))->b)
#define NPANL_A(p) (((NP_NL_ASSEMBLE*)(p))->A)
#define NPANL_PRE(p) (((NP_NL_ASSEMBLE*)(p))->PreProcess)
#define NPANL_ASSDEF(p) (((NP_NL_ASSEMBLE*)(p))->NLAssembleDefect)
#define NPANL_ASSSOL(p) (((NP_NL_ASSEMBLE*)(p))->NLAssembleSolution)
#define NPANL_ASSMAT(p) (((NP_NL_ASSEMBLE*)(p))->NLAssembleMatrix)
#define NPANL_POST(p) (((NP_NL_ASSEMBLE*)(p))->PostProcess)
/* access macros for NP_T_ASSEMBLE */
#define NPAT_x(p) (((NP_T_ASSEMBLE*)(p))->x)
#define NPAT_c(p) (((NP_T_ASSEMBLE*)(p))->c)
#define NPAT_b(p) (((NP_T_ASSEMBLE*)(p))->b)
#define NPAT_A(p) (((NP_T_ASSEMBLE*)(p))->A)
#define NPAT_PRE(p) (((NP_T_ASSEMBLE*)(p))->TAssemblePreProcess)
#define NPAT_INITIAL(p) (((NP_T_ASSEMBLE*)(p))->TAssembleInitial)
#define NPAT_ASSDEF(p) (((NP_T_ASSEMBLE*)(p))->TAssembleDefect)
#define NPAT_ASSSOL(p) (((NP_T_ASSEMBLE*)(p))->TAssembleSolution)
#define NPAT_ASSMAT(p) (((NP_T_ASSEMBLE*)(p))->TAssembleMatrix)
#define NPAT_POST(p) (((NP_T_ASSEMBLE*)(p))->TAssemblePostProcess)
#define NPAT_FINAL(p) (((NP_T_ASSEMBLE*)(p))->TAssembleFinal)
/* PARTASS_PARAMS access macros */
#define PP_ACTION(p) ((p)->action)
#define PP_SCALE_A(p) ((p)->s_a)
#define PP_SCALE_M(p) ((p)->s_m)
#define PP_TIME(p) ((p)->time)
#define PP_DELTA_T(p) ((p)->dt)
#define PP_OLD_DELTA_T(p) ((p)->dt_old)
#define PP_TIMEDEP(p) ((p)->dt!=0.0)
#define PP_ASS_PART(p) ((p)->ass_part)
#define PP_SKIP(p) ((p)->partskip)
#define PP_CO_SKIP(p) ((p)->co_partskip)
#define PP_MD_A(p) ((p)->MD_A)
#define PP_MD_A_glob(p) ((p)->MD_A_glob)
#define PP_VD_s(p) ((p)->VD_s)
#define PP_VD_s_glob(p) ((p)->VD_s_glob)
#define PP_VD_s_i(p) ((p)->VD_s_i)
#define PP_VD_s_co(p) ((p)->VD_s_co)
#define PP_VD_s_ico(p) ((p)->VD_s_ico)
#define PP_VD_o(p) ((p)->VD_o)
#define PP_VD_o_glob(p) ((p)->VD_o_glob)
#define PP_VD_c(p) ((p)->VD_c)
#define PP_VD_c_glob(p) ((p)->VD_c_glob)
#define PP_VD_r(p) ((p)->VD_r)
#define PP_VD_r_glob(p) ((p)->VD_r_glob)
#define PP_VD_gridvel(p) ((p)->VD_gridvel)
/* NP_NL_PARTASS access macros */
#define NPPNL_t(p) (((NP_NL_PARTASS*)(p))->t)
#define NPPNL_s(p) (((NP_NL_PARTASS*)(p))->s)
#define NPPNL_x(p) (((NP_NL_PARTASS*)(p))->x)
#define NPPNL_c(p) (((NP_NL_PARTASS*)(p))->c)
#define NPPNL_b(p) (((NP_NL_PARTASS*)(p))->b)
#define NPPNL_g(p) (((NP_NL_PARTASS*)(p))->g)
#define NPPNL_A(p) (((NP_NL_PARTASS*)(p))->A)
#define NPPNL_PRE(p) (((NP_NL_PARTASS*)(p))->NLPpreprocess)
#define NPPNL_ASSSOL(p) (((NP_NL_PARTASS*)(p))->NLPassembleSolution)
#define NPPNL_ASS(p) (((NP_NL_PARTASS*)(p))->NLPassemble)
#define NPPNL_POST(p) (((NP_NL_PARTASS*)(p))->NLPpostprocess)
/* NP_T_PARTASS access macros */
#define NPPT_t(p) (((NP_T_PARTASS*)(p))->t)
#define NPPT_s(p) (((NP_T_PARTASS*)(p))->s)
#define NPPT_INITIAL(p) (((NP_T_PARTASS*)(p))->TPassembleInitial)
#define NPPT_PRE(p) (((NP_T_PARTASS*)(p))->TPpreprocess)
#define NPPT_ASSSOL(p) (((NP_T_PARTASS*)(p))->TPassembleSolution)
#define NPPT_ASS(p) (((NP_T_PARTASS*)(p))->TPassemble)
#define NPPT_POST(p) (((NP_T_PARTASS*)(p))->TPpostprocess)
#define NPPT_FINAL(p) (((NP_T_PARTASS*)(p))->TPassembleFinal)
/****************************************************************************/
/* */
/* definition of exported data structures */
/* */
/****************************************************************************/
/****************************************************************************/
/* */
/* linear assemble interface */
/* */
/****************************************************************************/
struct np_assemble {
NP_BASE base; /* inherits base class */
/* data (optinal, necessary for calling the generic execute routine) */
VECDATA_DESC *x; /* solution */
VECDATA_DESC *b; /* defect */
MATDATA_DESC *A; /* matrix */
/* functions */
INT (*PreProcess)
(struct np_assemble *, /* pointer to (derived) object */
INT, /* level */
VECDATA_DESC *, /* solution vector */
VECDATA_DESC *, /* rhs vector */
MATDATA_DESC *, /* matrix */
INT *); /* result */
INT (*Assemble)
(struct np_assemble *, /* pointer to (derived) object */
INT, /* level */
VECDATA_DESC *, /* current solution (initial) */
VECDATA_DESC *, /* right hand side */
MATDATA_DESC *, /* matrix */
INT *); /* result */
INT (*PostProcess)
(struct np_assemble *, /* pointer to (derived) object */
INT, /* level */
VECDATA_DESC *, /* solution vector */
VECDATA_DESC *, /* defect vector */
MATDATA_DESC *, /* matrix */
INT *); /* result */
};
typedef struct np_assemble NP_ASSEMBLE;
typedef INT (*PreProcessAssembleProcPtr) \
(NP_ASSEMBLE *, INT, VECDATA_DESC *, VECDATA_DESC *, MATDATA_DESC *, INT *);
typedef INT (*AssembleProcPtr) \
(NP_ASSEMBLE *, INT, VECDATA_DESC *, VECDATA_DESC *, MATDATA_DESC *, INT *);
typedef INT (*PostProcessAssembleProcPtr) \
(NP_ASSEMBLE *, INT, VECDATA_DESC *, VECDATA_DESC *, MATDATA_DESC *, INT *);
/****************************************************************************/
/* */
/* local assemble interface */
/* */
/****************************************************************************/
struct np_local_assemble {
NP_ASSEMBLE assemble; /* inherits assemble class */
/* data */
INT galerkin; /* Galerkin assembling */
/* functions */
INT (*PreProcess)
(struct np_local_assemble *, /* pointer to (derived) object */
INT, /* level */
VECDATA_DESC *, /* solution vector */
VECDATA_DESC *, /* defect vector */
MATDATA_DESC *, /* matrix */
DOUBLE **, /* local solution */
DOUBLE **, /* local defect */
DOUBLE **, /* local matrix */
INT **, /* local vecskip */
INT *); /* result */
INT (*AssembleLocal)
(ELEMENT *, /* pointer to an element */
INT *); /* result */
INT (*AssembleLocalDefect)
(ELEMENT *, /* pointer to an element */
INT *); /* result */
INT (*AssembleLocalMatrix)
(ELEMENT *, /* pointer to an element */
INT *); /* result */
INT (*PostMatrix)
(struct np_local_assemble *, /* pointer to (derived) object */
INT, /* level */
VECDATA_DESC *, /* solution vector */
VECDATA_DESC *, /* defect vector */
MATDATA_DESC *, /* matrix */
INT *); /* result */
INT (*PostProcess)
(struct np_local_assemble *, /* pointer to (derived) object */
INT, /* level */
VECDATA_DESC *, /* solution vector */
VECDATA_DESC *, /* defect vector */
MATDATA_DESC *, /* matrix */
INT *); /* result */
};
typedef struct np_local_assemble NP_LOCAL_ASSEMBLE;
typedef INT (*PreProcessLocalAssembleProcPtr) \
(NP_ASSEMBLE *, INT, VECDATA_DESC *, VECDATA_DESC *, MATDATA_DESC *, \
DOUBLE **, DOUBLE **, DOUBLE **, INT **, INT *);
typedef INT (*AssembleLocalProcPtr) \
(ELEMENT *, INT *);
typedef INT (*AssembleLocalDefectProcPtr) \
(ELEMENT *, INT *);
typedef INT (*AssembleLocalMatrixProcPtr) \
(ELEMENT *, INT *);
typedef INT (*PostMatrixLocalAssembleProcPtr) \
(NP_ASSEMBLE *, INT, VECDATA_DESC *, VECDATA_DESC *, MATDATA_DESC *, INT *);
typedef INT (*PostProcessLocalAssembleProcPtr) \
(NP_ASSEMBLE *, INT, VECDATA_DESC *, VECDATA_DESC *, MATDATA_DESC *, INT *);
/****************************************************************************/
/* */
/* nonlinear assemble interface */
/* */
/****************************************************************************/
struct np_nl_assemble {
NP_BASE base; /* inherits base class */
/* data (optinal, necessary for calling the generic execute routine) */
VECDATA_DESC *x; /* solution */
VECDATA_DESC *c; /* correction */
VECDATA_DESC *b; /* defect */
MATDATA_DESC *A; /* matrix */
/* functions */
INT (*PreProcess)
(struct np_nl_assemble *, /* pointer to (derived) object */
INT, /* from level */
INT, /* to level */
VECDATA_DESC *, /* solution vector */
INT *); /* result */
INT (*NLAssembleSolution)
(struct np_nl_assemble *, /* pointer to (derived) object */
INT, /* from level */
INT, /* to level */
VECDATA_DESC *, /* solution vector */
INT *); /* result */
INT (*NLAssembleDefect)
(struct np_nl_assemble *, /* pointer to (derived) object */
INT, /* from level */
INT, /* to level */
VECDATA_DESC *, /* solution vector */
VECDATA_DESC *, /* defect vector */
MATDATA_DESC *, /* matrix */
INT *); /* result */
INT (*NLAssembleMatrix)
(struct np_nl_assemble *, /* pointer to (derived) object */
INT, /* from level */
INT, /* to level */
VECDATA_DESC *, /* current solution (initial) */
VECDATA_DESC *, /* defect for current solution */
VECDATA_DESC *, /* correction to be computed */
MATDATA_DESC *, /* matrix */
INT *); /* result */
INT (*NLNAssembleMatrix)
(struct np_nl_assemble *, /* pointer to (derived) object */
INT, /* from level */
INT, /* to level */
NODE *, /* pointer to node */
VECDATA_DESC *, /* current solution (initial) */
VECDATA_DESC *, /* defect for current solution */
VECDATA_DESC *, /* correction to be computed */
MATDATA_DESC *, /* matrix */
INT *); /* result */
INT (*PostProcess)
(struct np_nl_assemble *, /* pointer to (derived) object */
INT, /* from level */
INT, /* to level */
VECDATA_DESC *, /* solution vector */
VECDATA_DESC *, /* defect vector */
MATDATA_DESC *, /* matrix */
INT *); /* result */
};
typedef struct np_nl_assemble NP_NL_ASSEMBLE;
typedef INT (*PreProcessNLAssembleProcPtr) \
(NP_NL_ASSEMBLE *, INT, INT, VECDATA_DESC *, INT *);
typedef INT (*NLAssembleSolutionProcPtr) \
(NP_NL_ASSEMBLE *, INT, INT, VECDATA_DESC *, INT *);
typedef INT (*NLAssembleDefectProcPtr) \
(NP_NL_ASSEMBLE *, INT, INT, VECDATA_DESC *, VECDATA_DESC *, MATDATA_DESC *, INT *);
typedef INT (*NLAssembleMatrixProcPtr) \
(NP_NL_ASSEMBLE *, INT, INT, VECDATA_DESC *, VECDATA_DESC *, VECDATA_DESC *,\
MATDATA_DESC *, INT *);
typedef INT (*NLNAssembleMatrixProcPtr) \
(NP_NL_ASSEMBLE *, INT, INT, NODE *, VECDATA_DESC *, VECDATA_DESC *, VECDATA_DESC *,\
MATDATA_DESC *, INT *);
typedef INT (*PostProcessNLAssembleProcPtr) \
(NP_NL_ASSEMBLE *, INT, INT, VECDATA_DESC *, VECDATA_DESC *, MATDATA_DESC *, INT *);
/****************************************************************************/
/* */
/* non-linear extension to nonlinear assemble interface */
/* */
/****************************************************************************/
struct np_enl_assemble {
NP_BASE base; /* inherits base class */
/* data (optinal, necessary for calling the generic execute routine) */
EVECDATA_DESC *x; /* solution */
EVECDATA_DESC *c; /* correction */
EVECDATA_DESC *b; /* defect */
EMATDATA_DESC *A; /* matrix */
/* functions */
INT (*PreProcess)
(struct np_enl_assemble *, /* pointer to (derived) object */
INT, /* from level */
INT, /* to level */
EVECDATA_DESC *, /* solution vector */
INT *); /* result */
INT (*ENLAssembleSolution)
(struct np_enl_assemble *, /* pointer to (derived) object */
INT, /* from level */
INT, /* to level */
EVECDATA_DESC *, /* solution vector */
INT *); /* result */
INT (*ENLAssembleDefect)
(struct np_enl_assemble *, /* pointer to (derived) object */
INT, /* from level */
INT, /* to level */
EVECDATA_DESC *, /* solution vector */
EVECDATA_DESC *, /* defect vector */
EMATDATA_DESC *, /* matrix */
INT *); /* result */
INT (*ENLAssembleMatrix)
(struct np_enl_assemble *, /* pointer to (derived) object */
INT, /* from level */
INT, /* to level */
EVECDATA_DESC *, /* current solution (initial) */
EVECDATA_DESC *, /* defect for current solution */
EVECDATA_DESC *, /* correction to be computed */
EMATDATA_DESC *, /* matrix */
INT *); /* result */
INT (*PostProcess)
(struct np_enl_assemble *, /* pointer to (derived) object */
INT, /* from level */
INT, /* to level */
EVECDATA_DESC *, /* solution vector */
EVECDATA_DESC *, /* defect vector */
EMATDATA_DESC *, /* matrix */
INT *); /* result */
};
typedef struct np_enl_assemble NP_ENL_ASSEMBLE;
/****************************************************************************/
/* */
/* time-dependent assemble interface */
/* */
/****************************************************************************/
struct np_t_assemble {
NP_BASE base; /* inherits base class */
/* data (optional) */
DOUBLE dtc; /* time step suggestion */
DOUBLE dt; /* time step */
/* functions */
INT (*TAssemblePreProcess) /* call at begin of timestep */
(struct np_t_assemble *, /* pointer to (derived) object */
INT, /* from level */
INT, /* to level */
DOUBLE, /* time t_k+1 */
DOUBLE, /* time t_k */
DOUBLE, /* time t_k-1 */
VECDATA_DESC *, /* (unknown) solution at t_k+1 */
VECDATA_DESC *, /* solution vector at t_k */
VECDATA_DESC *, /* solution vector at t_k-1 */
INT *); /* result */
INT (*TAssembleInitial) /* set initial values */
(struct np_t_assemble *, /* pointer to (derived) object */
INT, /* from level */
INT, /* to level */
DOUBLE, /* time value t */
VECDATA_DESC *, /* solution vector at time t */
INT *); /* result */
INT (*TAssembleSolution) /* set dirichlet conditions in sol.*/
(struct np_t_assemble *, /* pointer to (derived) object */
INT, /* from level */
INT, /* to level */
DOUBLE, /* time value t */
VECDATA_DESC *, /* solution vector at time t */
INT *); /* result */
INT (*TAssembleDefect) /* accumulate to defect vector */
(struct np_t_assemble *, /* pointer to (derived) object */
INT, /* from level */
INT, /* to level */
DOUBLE, /* time value t */
DOUBLE, /* scaling for m-term: s_m */
DOUBLE, /* scaling for a-term: s_a */
VECDATA_DESC *, /* solution vector y */
VECDATA_DESC *, /* accumulate s_m*m(t,y)+s_a*a(t,y)*/
MATDATA_DESC *, /* matrix may be handy for Picard */
INT *); /* result */
INT (*TAssembleMatrix) /* compute linearization (Jacobian)*/
(struct np_t_assemble *, /* pointer to (derived) object */
INT, /* from level */
INT, /* to level */
DOUBLE, /* time value t */
DOUBLE, /* scaling for a-term: s_a (s_m=1!)*/
VECDATA_DESC *, /* current sol (linearization pt) */
VECDATA_DESC *, /* defect for current solution */
VECDATA_DESC *, /* correction to be computed */
MATDATA_DESC *, /* matrix */
INT *); /* result */
INT (*TNAssembleMatrix) /* compute linearization (Jacobian)*/
(struct np_t_assemble *, /* pointer to (derived) object */
INT, /* from level */
INT, /* to level */
NODE *, /* pointer to node */
DOUBLE, /* time value t */
DOUBLE, /* scaling for a-term: s_a (s_m=1!)*/
VECDATA_DESC *, /* current sol (linearization pt) */
VECDATA_DESC *, /* defect for current solution */
VECDATA_DESC *, /* correction to be computed */
MATDATA_DESC *, /* matrix */
INT *); /* result */
INT (*TAssemblePostProcess) /* call after solution t_k+1 known */
(struct np_t_assemble *, /* pointer to (derived) object */
INT, /* from level */
INT, /* to level */
DOUBLE, /* time t_k+1 */
DOUBLE, /* time t_k */
DOUBLE, /* time t_k-1 */
VECDATA_DESC *, /* solution t_k+1 (just computed!) */
VECDATA_DESC *, /* solution vector at t_k */
VECDATA_DESC *, /* solution vector at t_k-1 */
INT *); /* result */
INT (*TAssembleFinal) /* call after finishing integration*/
(struct np_t_assemble *, /* pointer to (derived) object */
INT, /* from level */
INT, /* to level */
INT *); /* result */
};
typedef struct np_t_assemble NP_T_ASSEMBLE;
typedef INT (*TAssemblePreProcessProcPtr) \
(NP_T_ASSEMBLE *, INT, INT, DOUBLE, DOUBLE, DOUBLE, VECDATA_DESC *, VECDATA_DESC *, VECDATA_DESC *, INT *);
typedef INT (*TAssembleInitialProcPtr) \
(NP_T_ASSEMBLE *, INT, INT, DOUBLE, VECDATA_DESC *, INT *);
typedef INT (*TAssembleSolutionProcPtr) \
(NP_T_ASSEMBLE *, INT, INT, DOUBLE, VECDATA_DESC *, INT *);
typedef INT (*TAssembleDefectProcPtr) \
(NP_T_ASSEMBLE *, INT, INT, DOUBLE, DOUBLE, DOUBLE, VECDATA_DESC *, VECDATA_DESC *, MATDATA_DESC *, INT *);
typedef INT (*TAssembleMatrixProcPtr) \
(NP_T_ASSEMBLE *, INT, INT, DOUBLE, DOUBLE, VECDATA_DESC *, VECDATA_DESC *, VECDATA_DESC *, MATDATA_DESC *, INT *);
typedef INT (*TNAssembleMatrixProcPtr) \
(NP_T_ASSEMBLE *, INT, INT, NODE *, DOUBLE, DOUBLE, VECDATA_DESC *, VECDATA_DESC *, VECDATA_DESC *, MATDATA_DESC *, INT *);
typedef INT (*TAssemblePostProcessProcPtr) \
(NP_T_ASSEMBLE *, INT, INT, DOUBLE, DOUBLE, DOUBLE, VECDATA_DESC *, VECDATA_DESC *, VECDATA_DESC *, INT *);
/****************************************************************************/
/* */
/* nonlinear assemble interface */
/* */
/****************************************************************************/
typedef struct {
INT action; /* def/mat (enum PP_ACTIONS) */
DOUBLE s_a; /* scale stiffness mat */
DOUBLE s_m; /* scale mass matrix */
DOUBLE time; /* time */
DOUBLE dt; /* time step */
DOUBLE dt_old; /* last time step */
INT ass_part; /* assemble part only */
INT partskip[NVECTYPES]; /* own skip flag positions */
INT co_partskip[NVECTYPES]; /* co skip flag positions */
MATDATA_DESC *MD_A; /* stiffness matrix */
MATDATA_DESC *MD_A_glob;
VECDATA_DESC *VD_s; /* solution */
VECDATA_DESC *VD_s_glob;
VECDATA_DESC *VD_s_i;
VECDATA_DESC *VD_s_co;
VECDATA_DESC *VD_s_ico;
VECDATA_DESC *VD_o; /* last time step sol */
VECDATA_DESC *VD_o_glob;
VECDATA_DESC *VD_c; /* correction */
VECDATA_DESC *VD_c_glob;
VECDATA_DESC *VD_r; /* right hand side */
VECDATA_DESC *VD_r_glob;
VECDATA_DESC *VD_gridvel; /* grid velocity */
} PARTASS_PARAMS;
struct np_nl_partass {
NP_BASE base; /* inherits base class */
/* data (optional, necessary for calling the generic execute routine) */
VEC_TEMPLATE *t; /* template matching x */
INT s; /* sub vec for own part */
VECDATA_DESC *x; /* solution */
VECDATA_DESC *c; /* correction */
VECDATA_DESC *b; /* defect */
VECDATA_DESC *g; /* grid velocity */
MATDATA_DESC *A; /* matrix */
/* functions */
INT (*NLPpreprocess)(
struct np_nl_partass *, /* pointer to (derived) object */
INT fl, /* from level */
INT tl, /* to level */
PARTASS_PARAMS *pp, /* part assemble parameters */
INT * /* result */
);
INT (*NLPassembleSolution)(
struct np_nl_partass *, /* pointer to (derived) object */
INT fl, /* from level */
INT tl, /* to level */
PARTASS_PARAMS *pp, /* part assemble parameters */
INT * /* result */
);
INT (*NLPassemble)(
struct np_nl_partass *, /* pointer to (derived) object */
INT fl, /* from level */
INT tl, /* to level */
PARTASS_PARAMS *pp, /* part assemble parameters */
INT * /* result */
);
INT (*NLPpostprocess)(
struct np_nl_partass *, /* pointer to (derived) object */
INT fl, /* from level */
INT tl, /* to level */
PARTASS_PARAMS *pp, /* part assemble parameters */
INT * /* result */
);
};
typedef struct np_nl_partass NP_NL_PARTASS;
/****************************************************************************/
/* */
/* time-dependent part assemble interface */
/* */
/****************************************************************************/
struct np_t_partass {
NP_BASE base; /* inherits base class */
/* data (optional, necessary for calling the generic execute routine) */
VEC_TEMPLATE *t; /* template matching x */
INT s; /* sub vec for own part */
/* functions */
INT (*TPassembleInitial)(
struct np_t_partass *, /* pointer to (derived) object */
INT fl, /* from level */
INT tl, /* to level */
PARTASS_PARAMS *pp, /* part assemble parameters */
INT * /* result */
);
INT (*TPpreprocess)(
struct np_t_partass *, /* pointer to (derived) object */
INT fl, /* from level */
INT tl, /* to level */
PARTASS_PARAMS *pp, /* part assemble parameters */
INT * /* result */
);
INT (*TPassembleSolution)(
struct np_t_partass *, /* pointer to (derived) object */
INT fl, /* from level */
INT tl, /* to level */
PARTASS_PARAMS *pp, /* part assemble parameters */
INT * /* result */
);
INT (*TPassemble)(
struct np_t_partass *, /* pointer to (derived) object */
INT fl, /* from level */
INT tl, /* to level */
PARTASS_PARAMS *pp, /* part assemble parameters */
INT * /* result */
);
INT (*TPpostprocess)(
struct np_t_partass *, /* pointer to (derived) object */
INT fl, /* from level */
INT tl, /* to level */
PARTASS_PARAMS *pp, /* part assemble parameters */
INT * /* result */
);
INT (*TPassembleFinal) /* call after finishing integration*/
(struct np_t_partass *, /* pointer to (derived) object */
INT fl, /* from level */
INT tl, /* to level */
PARTASS_PARAMS *pp, /* part assemble parameters */
INT * /* result */
);
};
typedef struct np_t_partass NP_T_PARTASS;
/****************************************************************************/
/* */
/* definition of exported functions */
/* */
/****************************************************************************/
/* generic init/display/execute functions for Assemble num procs */
INT NPAssembleInit (NP_BASE *theNP, INT argc , char **argv);
INT NPAssembleDisplay (NP_BASE *theNP);
INT NPAssembleExecute (NP_BASE *theNP, INT argc , char **argv);
/* generic init/display function for LocalAssemble num procs */
INT NPLocalAssembleInit (NP_LOCAL_ASSEMBLE *theNP, INT argc , char **argv);
INT NPLocalAssembleDisplay (NP_LOCAL_ASSEMBLE *theNP);
/* modification of the matrix for Dirichlet values */
INT NPLocalAssemblePostMatrix (NP_LOCAL_ASSEMBLE *theNP, INT level,
VECDATA_DESC *x,
VECDATA_DESC *b, MATDATA_DESC *A, INT *result);
/* generic construction of NP_ASSEMBLE from NP_LOCAL_ASSEMBLE */
INT NPLocalAssembleConstruct (NP_ASSEMBLE *theNP);
/* generic init/display/execute functions for NLAssemble num procs */
INT NPNLAssembleInit (NP_BASE *theNP, INT argc , char **argv);
INT NPNLAssembleDisplay (NP_BASE *theNP);
INT NPNLAssembleExecute (NP_BASE *theNP, INT argc , char **argv);
/* generic init/display/execute functions for time--dependent assembly */
INT NPTAssembleInit (NP_BASE *theNP, INT argc , char **argv);
INT NPTAssembleDisplay (NP_BASE *theNP);
INT NPTAssembleExecute (NP_BASE *theNP, INT argc , char **argv);
INT SetPartassParams (PARTASS_PARAMS *pp,
DOUBLE s_a, DOUBLE s_m, DOUBLE t, DOUBLE dt, DOUBLE dt_old,
VECDATA_DESC *s, VECDATA_DESC *r, VECDATA_DESC *o,
VECDATA_DESC *c, VECDATA_DESC *g, MATDATA_DESC *A);
INT SetPartassParamsX (PARTASS_PARAMS *pp, const VEC_TEMPLATE *vt, INT sub,
DOUBLE s_a, DOUBLE s_m, DOUBLE t, DOUBLE dt, DOUBLE dt_old,
VECDATA_DESC *s, VECDATA_DESC *r, VECDATA_DESC *o,
VECDATA_DESC *c, VECDATA_DESC *g, MATDATA_DESC *A);
/* generic init/display/execute functions for NP_NL_PARTASS num procs */
INT NPNLPartAssInit (NP_BASE *theNP, INT argc, char **argv);
INT NPNLPartAssDisplay (NP_BASE *theNP);
INT NPNLPartAssExecute (NP_BASE *theNP, INT argc, char **argv);
/* generic init/display/execute functions for NP_T_PARTASS num procs */
INT NPTPartAssInit (NP_BASE *theNP, INT argc, char **argv);
INT NPTPartAssDisplay (NP_BASE *theNP);
INT NPTPartAssExecute (NP_BASE *theNP, INT argc, char **argv);
const char *pp_action2str (const PARTASS_PARAMS *pp);
/* init tis file */
INT InitAssemble (void);
END_UGDIM_NAMESPACE
#endif
|