ceed-operator.c (8b919e6b544da496037dee7de9325ce15d8e67f1) ceed-operator.c (beecbf24d1afba41e856b0aa9f999ecb1ad5fea6)
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.

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

971 if (op->dqfT && op->dqfT != CEED_QFUNCTION_NONE)
972 // LCOV_EXCL_START
973 op->dqfT->is_immutable = true;
974 // LCOV_EXCL_STOP
975 return CEED_ERROR_SUCCESS;
976}
977
978/**
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.

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

971 if (op->dqfT && op->dqfT != CEED_QFUNCTION_NONE)
972 // LCOV_EXCL_START
973 op->dqfT->is_immutable = true;
974 // LCOV_EXCL_STOP
975 return CEED_ERROR_SUCCESS;
976}
977
978/**
979 @brief Set reuse of CeedQFunction data in CeedOperatorLinearAssemble* functions.
980 When `reuse_assembly_data = false` (default), the CeedQFunction associated
981 with this CeedOperator is re-assembled every time a `CeedOperatorLinearAssemble*`
982 function is called.
983 When `reuse_assembly_data = true`, the CeedQFunction associated with
984 this CeedOperator is reused between calls to
985 `CeedOperatorSetQFunctionAssemblyDataUpdated`.
986
987 @param[in] op CeedOperator
988 @param[in] reuse_assembly_data Boolean flag setting assembly data reuse
989
990 @return An error code: 0 - success, otherwise - failure
991
992 @ref Advanced
993**/
994int CeedOperatorSetQFunctionAssemblyReuse(CeedOperator op,
995 bool reuse_assembly_data) {
996 int ierr;
997 bool is_composite;
998
999 ierr = CeedOperatorIsComposite(op, &is_composite); CeedChk(ierr);
1000 if (is_composite) {
1001 for (CeedInt i = 0; i < op->num_suboperators; i++) {
1002 ierr = CeedOperatorSetQFunctionAssemblyReuse(op->sub_operators[i],
1003 reuse_assembly_data); CeedChk(ierr);
1004 }
1005 } else {
1006 ierr = CeedQFunctionAssemblyDataSetReuse(op->qf_assembled, reuse_assembly_data);
1007 CeedChk(ierr);
1008 }
1009
1010 return CEED_ERROR_SUCCESS;
1011}
1012
1013/**
979 @brief Mark CeedQFunction data as updated and the CeedQFunction as requiring re-assembly.
1014 @brief Mark CeedQFunction data as updated and the CeedQFunction as requiring re-assembly.
980 When this function is not used, the CeedQFunction associated with this
981 CeedOperator is re-assembled every time a CeedOperatorLinearAssemble*
982 function is called. When this function is used, the CeedQFunction
983 associated with this CeedOperator is only re-assembled the first time
984 CeedOperatorLinearAssemble* is called after this function is called.
985 The same assembled CeedQFunction data is reused internally until this
986 function is called again.
987
1015
988 @param op CeedOperator
1016 @param[in] op CeedOperator
1017 @param[in] reuse_assembly_data Boolean flag setting assembly data reuse
989
990 @return An error code: 0 - success, otherwise - failure
991
992 @ref Advanced
993**/
1018
1019 @return An error code: 0 - success, otherwise - failure
1020
1021 @ref Advanced
1022**/
994int CeedOperatorSetQFunctionUpdated(CeedOperator op) {
1023int CeedOperatorSetQFunctionAssemblyDataUpdateNeeded(CeedOperator op,
1024 bool needs_data_update) {
995 int ierr;
996 bool is_composite;
997
998 ierr = CeedOperatorIsComposite(op, &is_composite); CeedChk(ierr);
999 if (is_composite) {
1000 for (CeedInt i = 0; i < op->num_suboperators; i++) {
1025 int ierr;
1026 bool is_composite;
1027
1028 ierr = CeedOperatorIsComposite(op, &is_composite); CeedChk(ierr);
1029 if (is_composite) {
1030 for (CeedInt i = 0; i < op->num_suboperators; i++) {
1001 ierr = CeedOperatorSetQFunctionUpdated(op->sub_operators[i]); CeedChk(ierr);
1031 ierr = CeedOperatorSetQFunctionAssemblyDataUpdateNeeded(op->sub_operators[i],
1032 needs_data_update); CeedChk(ierr);
1002 }
1003 } else {
1033 }
1034 } else {
1004 ierr = CeedQFunctionAssemblyDataSetQFunctionUpdated(op->qf_assembled, true);
1035 ierr = CeedQFunctionAssemblyDataSetUpdateNeeded(op->qf_assembled,
1036 needs_data_update);
1005 CeedChk(ierr);
1006 }
1007
1008 return CEED_ERROR_SUCCESS;
1009}
1010
1011/**
1012 @brief Set the number of quadrature points associated with a CeedOperator.

--- 468 unchanged lines hidden ---
1037 CeedChk(ierr);
1038 }
1039
1040 return CEED_ERROR_SUCCESS;
1041}
1042
1043/**
1044 @brief Set the number of quadrature points associated with a CeedOperator.

--- 468 unchanged lines hidden ---