ceed-operator.c (e9b533fb9793b92fee16c1660fbf6414c678b8a7) ceed-operator.c (b7c9bbdafc9b91976b65f80ebb2c5357c2efd8bc)
1// Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
2// the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
3// reserved. See files LICENSE and NOTICE for details.
4//
5// This file is part of CEED, a collection of benchmarks, miniapps, software
6// libraries and APIs for efficient high-order finite element and spectral
7// element discretizations for exascale applications. For more information and
8// source code availability see http://github.com/ceed.

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

331
332/// ----------------------------------------------------------------------------
333/// CeedOperator Backend API
334/// ----------------------------------------------------------------------------
335/// @addtogroup CeedOperatorBackend
336/// @{
337
338/**
1// Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
2// the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
3// reserved. See files LICENSE and NOTICE for details.
4//
5// This file is part of CEED, a collection of benchmarks, miniapps, software
6// libraries and APIs for efficient high-order finite element and spectral
7// element discretizations for exascale applications. For more information and
8// source code availability see http://github.com/ceed.

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

331
332/// ----------------------------------------------------------------------------
333/// CeedOperator Backend API
334/// ----------------------------------------------------------------------------
335/// @addtogroup CeedOperatorBackend
336/// @{
337
338/**
339 @brief Get the Ceed associated with a CeedOperator
340
341 @param op CeedOperator
342 @param[out] ceed Variable to store Ceed
343
344 @return An error code: 0 - success, otherwise - failure
345
346 @ref Backend
347**/
348
349int CeedOperatorGetCeed(CeedOperator op, Ceed *ceed) {
350 *ceed = op->ceed;
351 return CEED_ERROR_SUCCESS;
352}
353
354/**
355 @brief Get the number of elements associated with a CeedOperator
356
357 @param op CeedOperator
358 @param[out] num_elem Variable to store number of elements
359
360 @return An error code: 0 - success, otherwise - failure
361
362 @ref Backend
363**/
364
365int CeedOperatorGetNumElements(CeedOperator op, CeedInt *num_elem) {
366 if (op->is_composite)
367 // LCOV_EXCL_START
368 return CeedError(op->ceed, CEED_ERROR_MINOR,
369 "Not defined for composite operator");
370 // LCOV_EXCL_STOP
371
372 *num_elem = op->num_elem;
373 return CEED_ERROR_SUCCESS;
374}
375
376/**
377 @brief Get the number of quadrature points associated with a CeedOperator
378
379 @param op CeedOperator
380 @param[out] num_qpts Variable to store vector number of quadrature points
381
382 @return An error code: 0 - success, otherwise - failure
383
384 @ref Backend
385**/
386
387int CeedOperatorGetNumQuadraturePoints(CeedOperator op, CeedInt *num_qpts) {
388 if (op->is_composite)
389 // LCOV_EXCL_START
390 return CeedError(op->ceed, CEED_ERROR_MINOR,
391 "Not defined for composite operator");
392 // LCOV_EXCL_STOP
393
394 *num_qpts = op->num_qpts;
395 return CEED_ERROR_SUCCESS;
396}
397
398/**
399 @brief Get the number of arguments associated with a CeedOperator
400
401 @param op CeedOperator
402 @param[out] num_args Variable to store vector number of arguments
403
404 @return An error code: 0 - success, otherwise - failure
405
406 @ref Backend

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

1026 } else {
1027 fprintf(stream, "CeedOperator\n");
1028 ierr = CeedOperatorSingleView(op, 0, stream); CeedChk(ierr);
1029 }
1030 return CEED_ERROR_SUCCESS;
1031}
1032
1033/**
339 @brief Get the number of arguments associated with a CeedOperator
340
341 @param op CeedOperator
342 @param[out] num_args Variable to store vector number of arguments
343
344 @return An error code: 0 - success, otherwise - failure
345
346 @ref Backend

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

966 } else {
967 fprintf(stream, "CeedOperator\n");
968 ierr = CeedOperatorSingleView(op, 0, stream); CeedChk(ierr);
969 }
970 return CEED_ERROR_SUCCESS;
971}
972
973/**
974 @brief Get the Ceed associated with a CeedOperator
975
976 @param op CeedOperator
977 @param[out] ceed Variable to store Ceed
978
979 @return An error code: 0 - success, otherwise - failure
980
981 @ref Advanced
982**/
983int CeedOperatorGetCeed(CeedOperator op, Ceed *ceed) {
984 *ceed = op->ceed;
985 return CEED_ERROR_SUCCESS;
986}
987
988/**
989 @brief Get the number of elements associated with a CeedOperator
990
991 @param op CeedOperator
992 @param[out] num_elem Variable to store number of elements
993
994 @return An error code: 0 - success, otherwise - failure
995
996 @ref Advanced
997**/
998int CeedOperatorGetNumElements(CeedOperator op, CeedInt *num_elem) {
999 if (op->is_composite)
1000 // LCOV_EXCL_START
1001 return CeedError(op->ceed, CEED_ERROR_MINOR,
1002 "Not defined for composite operator");
1003 // LCOV_EXCL_STOP
1004
1005 *num_elem = op->num_elem;
1006 return CEED_ERROR_SUCCESS;
1007}
1008
1009/**
1010 @brief Get the number of quadrature points associated with a CeedOperator
1011
1012 @param op CeedOperator
1013 @param[out] num_qpts Variable to store vector number of quadrature points
1014
1015 @return An error code: 0 - success, otherwise - failure
1016
1017 @ref Advanced
1018**/
1019int CeedOperatorGetNumQuadraturePoints(CeedOperator op, CeedInt *num_qpts) {
1020 if (op->is_composite)
1021 // LCOV_EXCL_START
1022 return CeedError(op->ceed, CEED_ERROR_MINOR,
1023 "Not defined for composite operator");
1024 // LCOV_EXCL_STOP
1025
1026 *num_qpts = op->num_qpts;
1027 return CEED_ERROR_SUCCESS;
1028}
1029
1030/**
1034 @brief Apply CeedOperator to a vector
1035
1036 This computes the action of the operator on the specified (active) input,
1037 yielding its (active) output. All inputs and outputs must be specified using
1038 CeedOperatorSetField().
1039
1040 Note: Calling this function asserts that setup is complete
1041 and sets the CeedOperator as immutable.

--- 188 unchanged lines hidden ---
1031 @brief Apply CeedOperator to a vector
1032
1033 This computes the action of the operator on the specified (active) input,
1034 yielding its (active) output. All inputs and outputs must be specified using
1035 CeedOperatorSetField().
1036
1037 Note: Calling this function asserts that setup is complete
1038 and sets the CeedOperator as immutable.

--- 188 unchanged lines hidden ---