ceed-operator.c (3fc26417eed2a741fbe87278f1202e55bc8ed18b) ceed-operator.c (c5d0f99595ca9b554c7cfa8252936d76dafb0ce5)
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>

--- 317 unchanged lines hidden (view full) ---

326 @brief Get QFunctionContext field values of the specified type, read-only.
327 For composite operators, the values retrieved are for the first sub-operator QFunctionContext that have a matching `field_name`.
328 A non-zero error code is returned for single operators that do not have a matching field of the same type or composite operators that do
329not have any field of a matching type.
330
331 @param[in,out] op CeedOperator
332 @param[in] field_label Label of field to set
333 @param[in] field_type Type of field to set
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>

--- 317 unchanged lines hidden (view full) ---

326 @brief Get QFunctionContext field values of the specified type, read-only.
327 For composite operators, the values retrieved are for the first sub-operator QFunctionContext that have a matching `field_name`.
328 A non-zero error code is returned for single operators that do not have a matching field of the same type or composite operators that do
329not have any field of a matching type.
330
331 @param[in,out] op CeedOperator
332 @param[in] field_label Label of field to set
333 @param[in] field_type Type of field to set
334 @param[in] value Value to set
334 @param[out] num_values Number of values of type `field_type` in array `values`
335 @param[out] values Values in the label
335
336 @return An error code: 0 - success, otherwise - failure
337
338 @ref User
339**/
340static int CeedOperatorContextGetGenericRead(CeedOperator op, CeedContextFieldLabel field_label, CeedContextFieldType field_type, size_t *num_values,
341 void *values) {
342 if (!field_label) {

--- 43 unchanged lines hidden (view full) ---

386 @brief Restore QFunctionContext field values of the specified type, read-only.
387 For composite operators, the values restored are for the first sub-operator QFunctionContext that have a matching `field_name`.
388 A non-zero error code is returned for single operators that do not have a matching field of the same type or composite operators that do
389not have any field of a matching type.
390
391 @param[in,out] op CeedOperator
392 @param[in] field_label Label of field to set
393 @param[in] field_type Type of field to set
336
337 @return An error code: 0 - success, otherwise - failure
338
339 @ref User
340**/
341static int CeedOperatorContextGetGenericRead(CeedOperator op, CeedContextFieldLabel field_label, CeedContextFieldType field_type, size_t *num_values,
342 void *values) {
343 if (!field_label) {

--- 43 unchanged lines hidden (view full) ---

387 @brief Restore QFunctionContext field values of the specified type, read-only.
388 For composite operators, the values restored are for the first sub-operator QFunctionContext that have a matching `field_name`.
389 A non-zero error code is returned for single operators that do not have a matching field of the same type or composite operators that do
390not have any field of a matching type.
391
392 @param[in,out] op CeedOperator
393 @param[in] field_label Label of field to set
394 @param[in] field_type Type of field to set
394 @param[in] value Value to set
395 @param[in] values Values array to restore
395
396 @return An error code: 0 - success, otherwise - failure
397
398 @ref User
399**/
400static int CeedOperatorContextRestoreGenericRead(CeedOperator op, CeedContextFieldLabel field_label, CeedContextFieldType field_type, void *values) {
401 if (!field_label) {
402 // LCOV_EXCL_START

--- 1178 unchanged lines hidden (view full) ---

1581}
1582
1583/**
1584 @brief Get QFunctionContext field holding int32 values, read-only.
1585 For composite operators, the values correspond to the first sub-operator QFunctionContexts that has a matching `field_name`.
1586
1587 @param[in] op CeedOperator
1588 @param[in] field_label Label of field to get
396
397 @return An error code: 0 - success, otherwise - failure
398
399 @ref User
400**/
401static int CeedOperatorContextRestoreGenericRead(CeedOperator op, CeedContextFieldLabel field_label, CeedContextFieldType field_type, void *values) {
402 if (!field_label) {
403 // LCOV_EXCL_START

--- 1178 unchanged lines hidden (view full) ---

1582}
1583
1584/**
1585 @brief Get QFunctionContext field holding int32 values, read-only.
1586 For composite operators, the values correspond to the first sub-operator QFunctionContexts that has a matching `field_name`.
1587
1588 @param[in] op CeedOperator
1589 @param[in] field_label Label of field to get
1589 @param[out] num_values Number of values in the field label
1590 @param[out] num_values Number of int32 values in `values`
1590 @param[out] values Pointer to context values
1591
1592 @return An error code: 0 - success, otherwise - failure
1593
1594 @ref User
1595**/
1596int CeedOperatorContextGetInt32Read(CeedOperator op, CeedContextFieldLabel field_label, size_t *num_values, const int **values) {
1597 return CeedOperatorContextGetGenericRead(op, field_label, CEED_CONTEXT_FIELD_INT32, num_values, values);
1598}
1599
1600/**
1601 @brief Restore QFunctionContext field holding int32 values, read-only.
1602
1603 @param[in] op CeedOperator
1604 @param[in] field_label Label of field to get
1591 @param[out] values Pointer to context values
1592
1593 @return An error code: 0 - success, otherwise - failure
1594
1595 @ref User
1596**/
1597int CeedOperatorContextGetInt32Read(CeedOperator op, CeedContextFieldLabel field_label, size_t *num_values, const int **values) {
1598 return CeedOperatorContextGetGenericRead(op, field_label, CEED_CONTEXT_FIELD_INT32, num_values, values);
1599}
1600
1601/**
1602 @brief Restore QFunctionContext field holding int32 values, read-only.
1603
1604 @param[in] op CeedOperator
1605 @param[in] field_label Label of field to get
1605 @param[out] num_values Number of values in the field label
1606 @param[out] values Pointer to context values
1607
1608 @return An error code: 0 - success, otherwise - failure
1609
1610 @ref User
1611**/
1612int CeedOperatorContextRestoreInt32Read(CeedOperator op, CeedContextFieldLabel field_label, const int **values) {
1613 return CeedOperatorContextRestoreGenericRead(op, field_label, CEED_CONTEXT_FIELD_INT32, values);

--- 184 unchanged lines hidden ---
1606 @param[out] values Pointer to context values
1607
1608 @return An error code: 0 - success, otherwise - failure
1609
1610 @ref User
1611**/
1612int CeedOperatorContextRestoreInt32Read(CeedOperator op, CeedContextFieldLabel field_label, const int **values) {
1613 return CeedOperatorContextRestoreGenericRead(op, field_label, CEED_CONTEXT_FIELD_INT32, values);

--- 184 unchanged lines hidden ---