| ceed-qfunctioncontext.c (87f5e94eb5ebc31c829c6285c42d209cb32e9b36) | ceed-qfunctioncontext.c (5b6ec284bdf44cf80e0149478c71a532d645e5cd) |
|---|---|
| 1// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors. 2// All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 3// 4// SPDX-License-Identifier: BSD-2-Clause 5// 6// This file is part of CEED: http://github.com/ceed 7 8#include <ceed-impl.h> --- 35 unchanged lines hidden (view full) --- 44/** 45 @brief Common function for registering QFunctionContext fields 46 47 @param[in,out] ctx CeedQFunctionContext 48 @param[in] field_name Name of field to register 49 @param[in] field_offset Offset of field to register 50 @param[in] field_description Description of field, or NULL for none 51 @param[in] field_type Field data type, such as double or int32 | 1// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors. 2// All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 3// 4// SPDX-License-Identifier: BSD-2-Clause 5// 6// This file is part of CEED: http://github.com/ceed 7 8#include <ceed-impl.h> --- 35 unchanged lines hidden (view full) --- 44/** 45 @brief Common function for registering QFunctionContext fields 46 47 @param[in,out] ctx CeedQFunctionContext 48 @param[in] field_name Name of field to register 49 @param[in] field_offset Offset of field to register 50 @param[in] field_description Description of field, or NULL for none 51 @param[in] field_type Field data type, such as double or int32 |
| 52 @param[in] field_size Size of field, in bytes | |
| 53 @param[in] num_values Number of values to register, must be contiguous in memory 54 55 @return An error code: 0 - success, otherwise - failure 56 57 @ref Developer 58**/ 59int CeedQFunctionContextRegisterGeneric(CeedQFunctionContext ctx, const char *field_name, size_t field_offset, const char *field_description, | 52 @param[in] num_values Number of values to register, must be contiguous in memory 53 54 @return An error code: 0 - success, otherwise - failure 55 56 @ref Developer 57**/ 58int CeedQFunctionContextRegisterGeneric(CeedQFunctionContext ctx, const char *field_name, size_t field_offset, const char *field_description, |
| 60 CeedContextFieldType field_type, size_t field_size, size_t num_values) { | 59 CeedContextFieldType field_type, size_t num_values) { 60 size_t field_size = 0; |
| 61 CeedInt field_index = -1; 62 63 // Check for duplicate 64 CeedCall(CeedQFunctionContextGetFieldIndex(ctx, field_name, &field_index)); 65 CeedCheck(field_index == -1, ctx->ceed, CEED_ERROR_UNSUPPORTED, "QFunctionContext field with name \"%s\" already registered", field_name); 66 67 // Allocate space for field data 68 if (ctx->num_fields == 0) { 69 CeedCall(CeedCalloc(1, &ctx->field_labels)); 70 ctx->max_fields = 1; 71 } else if (ctx->num_fields == ctx->max_fields) { 72 CeedCall(CeedRealloc(2 * ctx->max_fields, &ctx->field_labels)); 73 ctx->max_fields *= 2; 74 } 75 CeedCall(CeedCalloc(1, &ctx->field_labels[ctx->num_fields])); 76 | 61 CeedInt field_index = -1; 62 63 // Check for duplicate 64 CeedCall(CeedQFunctionContextGetFieldIndex(ctx, field_name, &field_index)); 65 CeedCheck(field_index == -1, ctx->ceed, CEED_ERROR_UNSUPPORTED, "QFunctionContext field with name \"%s\" already registered", field_name); 66 67 // Allocate space for field data 68 if (ctx->num_fields == 0) { 69 CeedCall(CeedCalloc(1, &ctx->field_labels)); 70 ctx->max_fields = 1; 71 } else if (ctx->num_fields == ctx->max_fields) { 72 CeedCall(CeedRealloc(2 * ctx->max_fields, &ctx->field_labels)); 73 ctx->max_fields *= 2; 74 } 75 CeedCall(CeedCalloc(1, &ctx->field_labels[ctx->num_fields])); 76 |
| 77 // Compute field size 78 switch (field_type) { 79 case CEED_CONTEXT_FIELD_DOUBLE: 80 field_size = sizeof(double); 81 break; 82 case CEED_CONTEXT_FIELD_INT32: 83 field_size = sizeof(int); 84 break; 85 case CEED_CONTEXT_FIELD_BOOL: 86 field_size = sizeof(bool); 87 break; 88 } 89 |
|
| 77 // Copy field data 78 CeedCall(CeedStringAllocCopy(field_name, (char **)&ctx->field_labels[ctx->num_fields]->name)); 79 CeedCall(CeedStringAllocCopy(field_description, (char **)&ctx->field_labels[ctx->num_fields]->description)); 80 ctx->field_labels[ctx->num_fields]->type = field_type; 81 ctx->field_labels[ctx->num_fields]->offset = field_offset; 82 ctx->field_labels[ctx->num_fields]->size = field_size * num_values; 83 ctx->field_labels[ctx->num_fields]->num_values = num_values; 84 ctx->num_fields++; --- 211 unchanged lines hidden (view full) --- 296 *(void **)values = &data[field_label->offset]; 297 switch (field_type) { 298 case CEED_CONTEXT_FIELD_INT32: 299 *num_values = field_label->size / sizeof(int); 300 break; 301 case CEED_CONTEXT_FIELD_DOUBLE: 302 *num_values = field_label->size / sizeof(double); 303 break; | 90 // Copy field data 91 CeedCall(CeedStringAllocCopy(field_name, (char **)&ctx->field_labels[ctx->num_fields]->name)); 92 CeedCall(CeedStringAllocCopy(field_description, (char **)&ctx->field_labels[ctx->num_fields]->description)); 93 ctx->field_labels[ctx->num_fields]->type = field_type; 94 ctx->field_labels[ctx->num_fields]->offset = field_offset; 95 ctx->field_labels[ctx->num_fields]->size = field_size * num_values; 96 ctx->field_labels[ctx->num_fields]->num_values = num_values; 97 ctx->num_fields++; --- 211 unchanged lines hidden (view full) --- 309 *(void **)values = &data[field_label->offset]; 310 switch (field_type) { 311 case CEED_CONTEXT_FIELD_INT32: 312 *num_values = field_label->size / sizeof(int); 313 break; 314 case CEED_CONTEXT_FIELD_DOUBLE: 315 *num_values = field_label->size / sizeof(double); 316 break; |
| 317 case CEED_CONTEXT_FIELD_BOOL: 318 *num_values = field_label->size / sizeof(bool); 319 break; |
|
| 304 } 305 return CEED_ERROR_SUCCESS; 306} 307 308/** 309 @brief Restore QFunctionContext field data, read-only 310 311 @param[in] ctx CeedQFunctionContext --- 12 unchanged lines hidden (view full) --- 324 "QFunctionContext field with name \"%s\" registered as %s, not registered as %s", field_label->name, 325 CeedContextFieldTypes[field_label->type], CeedContextFieldTypes[field_type]); 326 327 CeedCall(CeedQFunctionContextRestoreDataRead(ctx, values)); 328 return CEED_ERROR_SUCCESS; 329} 330 331/** | 320 } 321 return CEED_ERROR_SUCCESS; 322} 323 324/** 325 @brief Restore QFunctionContext field data, read-only 326 327 @param[in] ctx CeedQFunctionContext --- 12 unchanged lines hidden (view full) --- 340 "QFunctionContext field with name \"%s\" registered as %s, not registered as %s", field_label->name, 341 CeedContextFieldTypes[field_label->type], CeedContextFieldTypes[field_type]); 342 343 CeedCall(CeedQFunctionContextRestoreDataRead(ctx, values)); 344 return CEED_ERROR_SUCCESS; 345} 346 347/** |
| 332 @brief Set QFunctionContext field holding a double precision value | 348 @brief Set QFunctionContext field holding double precision values |
| 333 334 @param[in,out] ctx CeedQFunctionContext 335 @param[in] field_label Label for field to set 336 @param[in] values Values to set 337 338 @return An error code: 0 - success, otherwise - failure 339 340 @ref Backend 341**/ 342int CeedQFunctionContextSetDouble(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, double *values) { 343 CeedCheck(field_label, ctx->ceed, CEED_ERROR_UNSUPPORTED, "Invalid field label"); 344 CeedCall(CeedQFunctionContextSetGeneric(ctx, field_label, CEED_CONTEXT_FIELD_DOUBLE, values)); 345 return CEED_ERROR_SUCCESS; 346} 347 348/** | 349 350 @param[in,out] ctx CeedQFunctionContext 351 @param[in] field_label Label for field to set 352 @param[in] values Values to set 353 354 @return An error code: 0 - success, otherwise - failure 355 356 @ref Backend 357**/ 358int CeedQFunctionContextSetDouble(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, double *values) { 359 CeedCheck(field_label, ctx->ceed, CEED_ERROR_UNSUPPORTED, "Invalid field label"); 360 CeedCall(CeedQFunctionContextSetGeneric(ctx, field_label, CEED_CONTEXT_FIELD_DOUBLE, values)); 361 return CEED_ERROR_SUCCESS; 362} 363 364/** |
| 349 @brief Get QFunctionContext field holding a double precision value, read-only | 365 @brief Get QFunctionContext field holding double precision values, read-only |
| 350 351 @param[in] ctx CeedQFunctionContext 352 @param[in] field_label Label for field to get 353 @param[out] num_values Number of values in the field label 354 @param[out] values Pointer to context values 355 356 @return An error code: 0 - success, otherwise - failure 357 358 @ref Backend 359**/ 360int CeedQFunctionContextGetDoubleRead(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, size_t *num_values, const double **values) { 361 CeedCheck(field_label, ctx->ceed, CEED_ERROR_UNSUPPORTED, "Invalid field label"); 362 CeedCall(CeedQFunctionContextGetGenericRead(ctx, field_label, CEED_CONTEXT_FIELD_DOUBLE, num_values, values)); 363 return CEED_ERROR_SUCCESS; 364} 365 366/** | 366 367 @param[in] ctx CeedQFunctionContext 368 @param[in] field_label Label for field to get 369 @param[out] num_values Number of values in the field label 370 @param[out] values Pointer to context values 371 372 @return An error code: 0 - success, otherwise - failure 373 374 @ref Backend 375**/ 376int CeedQFunctionContextGetDoubleRead(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, size_t *num_values, const double **values) { 377 CeedCheck(field_label, ctx->ceed, CEED_ERROR_UNSUPPORTED, "Invalid field label"); 378 CeedCall(CeedQFunctionContextGetGenericRead(ctx, field_label, CEED_CONTEXT_FIELD_DOUBLE, num_values, values)); 379 return CEED_ERROR_SUCCESS; 380} 381 382/** |
| 367 @brief Restore QFunctionContext field holding a double precision value, read-only | 383 @brief Restore QFunctionContext field holding double precision values, read-only |
| 368 369 @param[in] ctx CeedQFunctionContext 370 @param[in] field_label Label for field to restore 371 @param[out] values Pointer to context values 372 373 @return An error code: 0 - success, otherwise - failure 374 375 @ref Backend 376**/ 377int CeedQFunctionContextRestoreDoubleRead(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, const double **values) { 378 CeedCheck(field_label, ctx->ceed, CEED_ERROR_UNSUPPORTED, "Invalid field label"); 379 CeedCall(CeedQFunctionContextRestoreGenericRead(ctx, field_label, CEED_CONTEXT_FIELD_DOUBLE, values)); 380 return CEED_ERROR_SUCCESS; 381} 382 383/** | 384 385 @param[in] ctx CeedQFunctionContext 386 @param[in] field_label Label for field to restore 387 @param[out] values Pointer to context values 388 389 @return An error code: 0 - success, otherwise - failure 390 391 @ref Backend 392**/ 393int CeedQFunctionContextRestoreDoubleRead(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, const double **values) { 394 CeedCheck(field_label, ctx->ceed, CEED_ERROR_UNSUPPORTED, "Invalid field label"); 395 CeedCall(CeedQFunctionContextRestoreGenericRead(ctx, field_label, CEED_CONTEXT_FIELD_DOUBLE, values)); 396 return CEED_ERROR_SUCCESS; 397} 398 399/** |
| 384 @brief Set QFunctionContext field holding an int32 value | 400 @brief Set QFunctionContext field holding int32 values |
| 385 386 @param[in,out] ctx CeedQFunctionContext 387 @param[in] field_label Label for field to set 388 @param[in] values Values to set 389 390 @return An error code: 0 - success, otherwise - failure 391 392 @ref Backend 393**/ 394int CeedQFunctionContextSetInt32(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, int *values) { 395 CeedCheck(field_label, ctx->ceed, CEED_ERROR_UNSUPPORTED, "Invalid field label"); 396 CeedCall(CeedQFunctionContextSetGeneric(ctx, field_label, CEED_CONTEXT_FIELD_INT32, values)); 397 return CEED_ERROR_SUCCESS; 398} 399 400/** | 401 402 @param[in,out] ctx CeedQFunctionContext 403 @param[in] field_label Label for field to set 404 @param[in] values Values to set 405 406 @return An error code: 0 - success, otherwise - failure 407 408 @ref Backend 409**/ 410int CeedQFunctionContextSetInt32(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, int *values) { 411 CeedCheck(field_label, ctx->ceed, CEED_ERROR_UNSUPPORTED, "Invalid field label"); 412 CeedCall(CeedQFunctionContextSetGeneric(ctx, field_label, CEED_CONTEXT_FIELD_INT32, values)); 413 return CEED_ERROR_SUCCESS; 414} 415 416/** |
| 401 @brief Get QFunctionContext field holding a int32 value, read-only | 417 @brief Get QFunctionContext field holding int32 values, read-only |
| 402 403 @param[in] ctx CeedQFunctionContext 404 @param[in] field_label Label for field to get 405 @param[out] num_values Number of values in the field label 406 @param[out] values Pointer to context values 407 408 @return An error code: 0 - success, otherwise - failure 409 410 @ref Backend 411**/ 412int CeedQFunctionContextGetInt32Read(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, size_t *num_values, const int **values) { 413 CeedCheck(field_label, ctx->ceed, CEED_ERROR_UNSUPPORTED, "Invalid field label"); 414 CeedCall(CeedQFunctionContextGetGenericRead(ctx, field_label, CEED_CONTEXT_FIELD_INT32, num_values, values)); 415 return CEED_ERROR_SUCCESS; 416} 417 418/** | 418 419 @param[in] ctx CeedQFunctionContext 420 @param[in] field_label Label for field to get 421 @param[out] num_values Number of values in the field label 422 @param[out] values Pointer to context values 423 424 @return An error code: 0 - success, otherwise - failure 425 426 @ref Backend 427**/ 428int CeedQFunctionContextGetInt32Read(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, size_t *num_values, const int **values) { 429 CeedCheck(field_label, ctx->ceed, CEED_ERROR_UNSUPPORTED, "Invalid field label"); 430 CeedCall(CeedQFunctionContextGetGenericRead(ctx, field_label, CEED_CONTEXT_FIELD_INT32, num_values, values)); 431 return CEED_ERROR_SUCCESS; 432} 433 434/** |
| 419 @brief Restore QFunctionContext field holding a int32 value, read-only | 435 @brief Restore QFunctionContext field holding int32 values, read-only |
| 420 421 @param[in] ctx CeedQFunctionContext 422 @param[in] field_label Label for field to restore 423 @param[out] values Pointer to context values 424 425 @return An error code: 0 - success, otherwise - failure 426 427 @ref Backend 428**/ 429int CeedQFunctionContextRestoreInt32Read(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, const int **values) { 430 CeedCheck(field_label, ctx->ceed, CEED_ERROR_UNSUPPORTED, "Invalid field label"); 431 CeedCall(CeedQFunctionContextRestoreGenericRead(ctx, field_label, CEED_CONTEXT_FIELD_INT32, values)); 432 return CEED_ERROR_SUCCESS; 433} 434 435/** | 436 437 @param[in] ctx CeedQFunctionContext 438 @param[in] field_label Label for field to restore 439 @param[out] values Pointer to context values 440 441 @return An error code: 0 - success, otherwise - failure 442 443 @ref Backend 444**/ 445int CeedQFunctionContextRestoreInt32Read(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, const int **values) { 446 CeedCheck(field_label, ctx->ceed, CEED_ERROR_UNSUPPORTED, "Invalid field label"); 447 CeedCall(CeedQFunctionContextRestoreGenericRead(ctx, field_label, CEED_CONTEXT_FIELD_INT32, values)); 448 return CEED_ERROR_SUCCESS; 449} 450 451/** |
| 452 @brief Set QFunctionContext field holding boolean values 453 454 @param[in,out] ctx CeedQFunctionContext 455 @param[in] field_label Label for field to set 456 @param[in] values Values to set 457 458 @return An error code: 0 - success, otherwise - failure 459 460 @ref Backend 461**/ 462int CeedQFunctionContextSetBoolean(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, bool *values) { 463 CeedCheck(field_label, ctx->ceed, CEED_ERROR_UNSUPPORTED, "Invalid field label"); 464 CeedCall(CeedQFunctionContextSetGeneric(ctx, field_label, CEED_CONTEXT_FIELD_BOOL, values)); 465 return CEED_ERROR_SUCCESS; 466} 467 468/** 469 @brief Get QFunctionContext field holding boolean values, read-only 470 471 @param[in] ctx CeedQFunctionContext 472 @param[in] field_label Label for field to get 473 @param[out] num_values Number of values in the field label 474 @param[out] values Pointer to context values 475 476 @return An error code: 0 - success, otherwise - failure 477 478 @ref Backend 479**/ 480int CeedQFunctionContextGetBooleanRead(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, size_t *num_values, const bool **values) { 481 CeedCheck(field_label, ctx->ceed, CEED_ERROR_UNSUPPORTED, "Invalid field label"); 482 CeedCall(CeedQFunctionContextGetGenericRead(ctx, field_label, CEED_CONTEXT_FIELD_BOOL, num_values, values)); 483 return CEED_ERROR_SUCCESS; 484} 485 486/** 487 @brief Restore QFunctionContext field holding boolean values, read-only 488 489 @param[in] ctx CeedQFunctionContext 490 @param[in] field_label Label for field to restore 491 @param[out] values Pointer to context values 492 493 @return An error code: 0 - success, otherwise - failure 494 495 @ref Backend 496**/ 497int CeedQFunctionContextRestoreBooleanRead(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, const bool **values) { 498 CeedCheck(field_label, ctx->ceed, CEED_ERROR_UNSUPPORTED, "Invalid field label"); 499 CeedCall(CeedQFunctionContextRestoreGenericRead(ctx, field_label, CEED_CONTEXT_FIELD_BOOL, values)); 500 return CEED_ERROR_SUCCESS; 501} 502 503/** |
|
| 436 @brief Get additional destroy routine for CeedQFunctionContext user data 437 438 @param[in] ctx CeedQFunctionContext to get user destroy function 439 @param[out] f_mem_type Memory type to use when passing data into `f` 440 @param[out] f Additional routine to use to destroy user data 441 442 @return An error code: 0 - success, otherwise - failure 443 --- 235 unchanged lines hidden (view full) --- 679 680 ctx->num_readers--; 681 if (ctx->num_readers == 0 && ctx->RestoreDataRead) CeedCall(ctx->RestoreDataRead(ctx)); 682 *(void **)data = NULL; 683 return CEED_ERROR_SUCCESS; 684} 685 686/** | 504 @brief Get additional destroy routine for CeedQFunctionContext user data 505 506 @param[in] ctx CeedQFunctionContext to get user destroy function 507 @param[out] f_mem_type Memory type to use when passing data into `f` 508 @param[out] f Additional routine to use to destroy user data 509 510 @return An error code: 0 - success, otherwise - failure 511 --- 235 unchanged lines hidden (view full) --- 747 748 ctx->num_readers--; 749 if (ctx->num_readers == 0 && ctx->RestoreDataRead) CeedCall(ctx->RestoreDataRead(ctx)); 750 *(void **)data = NULL; 751 return CEED_ERROR_SUCCESS; 752} 753 754/** |
| 687 @brief Register QFunctionContext a field holding a double precision value | 755 @brief Register QFunctionContext a field holding double precision values |
| 688 689 @param[in,out] ctx CeedQFunctionContext 690 @param[in] field_name Name of field to register 691 @param[in] field_offset Offset of field to register 692 @param[in] num_values Number of values to register, must be contiguous in memory 693 @param[in] field_description Description of field, or NULL for none 694 695 @return An error code: 0 - success, otherwise - failure 696 697 @ref User 698**/ 699int CeedQFunctionContextRegisterDouble(CeedQFunctionContext ctx, const char *field_name, size_t field_offset, size_t num_values, 700 const char *field_description) { | 756 757 @param[in,out] ctx CeedQFunctionContext 758 @param[in] field_name Name of field to register 759 @param[in] field_offset Offset of field to register 760 @param[in] num_values Number of values to register, must be contiguous in memory 761 @param[in] field_description Description of field, or NULL for none 762 763 @return An error code: 0 - success, otherwise - failure 764 765 @ref User 766**/ 767int CeedQFunctionContextRegisterDouble(CeedQFunctionContext ctx, const char *field_name, size_t field_offset, size_t num_values, 768 const char *field_description) { |
| 701 return CeedQFunctionContextRegisterGeneric(ctx, field_name, field_offset, field_description, CEED_CONTEXT_FIELD_DOUBLE, sizeof(double), num_values); | 769 return CeedQFunctionContextRegisterGeneric(ctx, field_name, field_offset, field_description, CEED_CONTEXT_FIELD_DOUBLE, num_values); |
| 702} 703 704/** | 770} 771 772/** |
| 705 @brief Register QFunctionContext a field holding a int32 value | 773 @brief Register QFunctionContext a field holding int32 values |
| 706 707 @param[in,out] ctx CeedQFunctionContext 708 @param[in] field_name Name of field to register 709 @param[in] field_offset Offset of field to register 710 @param[in] num_values Number of values to register, must be contiguous in memory 711 @param[in] field_description Description of field, or NULL for none 712 713 @return An error code: 0 - success, otherwise - failure 714 715 @ref User 716**/ 717int CeedQFunctionContextRegisterInt32(CeedQFunctionContext ctx, const char *field_name, size_t field_offset, size_t num_values, 718 const char *field_description) { | 774 775 @param[in,out] ctx CeedQFunctionContext 776 @param[in] field_name Name of field to register 777 @param[in] field_offset Offset of field to register 778 @param[in] num_values Number of values to register, must be contiguous in memory 779 @param[in] field_description Description of field, or NULL for none 780 781 @return An error code: 0 - success, otherwise - failure 782 783 @ref User 784**/ 785int CeedQFunctionContextRegisterInt32(CeedQFunctionContext ctx, const char *field_name, size_t field_offset, size_t num_values, 786 const char *field_description) { |
| 719 return CeedQFunctionContextRegisterGeneric(ctx, field_name, field_offset, field_description, CEED_CONTEXT_FIELD_INT32, sizeof(int), num_values); | 787 return CeedQFunctionContextRegisterGeneric(ctx, field_name, field_offset, field_description, CEED_CONTEXT_FIELD_INT32, num_values); |
| 720} 721 722/** | 788} 789 790/** |
| 791 @brief Register QFunctionContext a field holding boolean values 792 793 @param[in,out] ctx CeedQFunctionContext 794 @param[in] field_name Name of field to register 795 @param[in] field_offset Offset of field to register 796 @param[in] num_values Number of values to register, must be contiguous in memory 797 @param[in] field_description Description of field, or NULL for none 798 799 @return An error code: 0 - success, otherwise - failure 800 801 @ref User 802**/ 803int CeedQFunctionContextRegisterBoolean(CeedQFunctionContext ctx, const char *field_name, size_t field_offset, size_t num_values, 804 const char *field_description) { 805 return CeedQFunctionContextRegisterGeneric(ctx, field_name, field_offset, field_description, CEED_CONTEXT_FIELD_BOOL, num_values); 806} 807 808/** |
|
| 723 @brief Get labels for all registered QFunctionContext fields 724 725 @param[in] ctx CeedQFunctionContext 726 @param[out] field_labels Variable to hold array of field labels 727 @param[out] num_fields Length of field descriptions array 728 729 @return An error code: 0 - success, otherwise - failure 730 --- 116 unchanged lines hidden --- | 809 @brief Get labels for all registered QFunctionContext fields 810 811 @param[in] ctx CeedQFunctionContext 812 @param[out] field_labels Variable to hold array of field labels 813 @param[out] num_fields Length of field descriptions array 814 815 @return An error code: 0 - success, otherwise - failure 816 --- 116 unchanged lines hidden --- |