ceed-ref-qfunction.c (7f565272b8651519e1f8332c5b9e73ffa0fc04e9) ceed-ref-qfunction.c (bf4cb66493dbcc06b8d25c9c91cf89fe1cab7c9b)
1// Copyright (c) 2017-2018, Lawrence Livermore National Security, LLC.
2// Produced at the Lawrence Livermore National Laboratory. LLNL-CODE-734707.
3// All Rights 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.

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

86//------------------------------------------------------------------------------
87int CeedQFunctionCreate_Ref(CeedQFunction qf) {
88 int ierr;
89 Ceed ceed;
90 ierr = CeedQFunctionGetCeed(qf, &ceed); CeedChkBackend(ierr);
91
92 CeedQFunction_Ref *impl;
93 ierr = CeedCalloc(1, &impl); CeedChkBackend(ierr);
1// Copyright (c) 2017-2018, Lawrence Livermore National Security, LLC.
2// Produced at the Lawrence Livermore National Laboratory. LLNL-CODE-734707.
3// All Rights 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.

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

86//------------------------------------------------------------------------------
87int CeedQFunctionCreate_Ref(CeedQFunction qf) {
88 int ierr;
89 Ceed ceed;
90 ierr = CeedQFunctionGetCeed(qf, &ceed); CeedChkBackend(ierr);
91
92 CeedQFunction_Ref *impl;
93 ierr = CeedCalloc(1, &impl); CeedChkBackend(ierr);
94 ierr = CeedCalloc(16, &impl->inputs); CeedChkBackend(ierr);
95 ierr = CeedCalloc(16, &impl->outputs); CeedChkBackend(ierr);
94 ierr = CeedCalloc(CEED_FIELD_MAX, &impl->inputs); CeedChkBackend(ierr);
95 ierr = CeedCalloc(CEED_FIELD_MAX, &impl->outputs); CeedChkBackend(ierr);
96 ierr = CeedQFunctionSetData(qf, impl); CeedChkBackend(ierr);
97
98 ierr = CeedSetBackendFunction(ceed, "QFunction", qf, "Apply",
99 CeedQFunctionApply_Ref); CeedChkBackend(ierr);
100 ierr = CeedSetBackendFunction(ceed, "QFunction", qf, "Destroy",
101 CeedQFunctionDestroy_Ref); CeedChkBackend(ierr);
102
103 return CEED_ERROR_SUCCESS;
104}
105//------------------------------------------------------------------------------
96 ierr = CeedQFunctionSetData(qf, impl); CeedChkBackend(ierr);
97
98 ierr = CeedSetBackendFunction(ceed, "QFunction", qf, "Apply",
99 CeedQFunctionApply_Ref); CeedChkBackend(ierr);
100 ierr = CeedSetBackendFunction(ceed, "QFunction", qf, "Destroy",
101 CeedQFunctionDestroy_Ref); CeedChkBackend(ierr);
102
103 return CEED_ERROR_SUCCESS;
104}
105//------------------------------------------------------------------------------