ceed-ref-basis.c (de686571da193802df261a10fbc2ea743b9830da) ceed-ref-basis.c (c71e1dcdcfce633cdb19fa81aa6735b006eb809d)
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.

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

258 ierr = CeedCalloc(1, &impl); CeedChk(ierr);
259 ierr = CeedMalloc(Q1d*Q1d, &impl->colograd1d); CeedChk(ierr);
260 ierr = CeedBasisGetCollocatedGrad(basis, impl->colograd1d); CeedChk(ierr);
261 ierr = CeedBasisSetData(basis, (void *)&impl); CeedChk(ierr);
262
263 Ceed parent;
264 ierr = CeedGetParent(ceed, &parent); CeedChk(ierr);
265 CeedTensorContract contract;
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.

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

258 ierr = CeedCalloc(1, &impl); CeedChk(ierr);
259 ierr = CeedMalloc(Q1d*Q1d, &impl->colograd1d); CeedChk(ierr);
260 ierr = CeedBasisGetCollocatedGrad(basis, impl->colograd1d); CeedChk(ierr);
261 ierr = CeedBasisSetData(basis, (void *)&impl); CeedChk(ierr);
262
263 Ceed parent;
264 ierr = CeedGetParent(ceed, &parent); CeedChk(ierr);
265 CeedTensorContract contract;
266 ierr = CeedTensorContractCreate(parent, &contract); CeedChk(ierr);
266 ierr = CeedTensorContractCreate(parent, basis, &contract); CeedChk(ierr);
267 ierr = CeedBasisSetTensorContract(basis, &contract); CeedChk(ierr);
268
269 ierr = CeedSetBackendFunction(ceed, "Basis", basis, "Apply",
270 CeedBasisApply_Ref); CeedChk(ierr);
271 ierr = CeedSetBackendFunction(ceed, "Basis", basis, "Destroy",
272 CeedBasisDestroyTensor_Ref); CeedChk(ierr);
273 return 0;
274}

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

281 const CeedScalar *grad,
282 const CeedScalar *qref,
283 const CeedScalar *qweight,
284 CeedBasis basis) {
285 int ierr;
286 Ceed ceed;
287 ierr = CeedBasisGetCeed(basis, &ceed); CeedChk(ierr);
288
267 ierr = CeedBasisSetTensorContract(basis, &contract); CeedChk(ierr);
268
269 ierr = CeedSetBackendFunction(ceed, "Basis", basis, "Apply",
270 CeedBasisApply_Ref); CeedChk(ierr);
271 ierr = CeedSetBackendFunction(ceed, "Basis", basis, "Destroy",
272 CeedBasisDestroyTensor_Ref); CeedChk(ierr);
273 return 0;
274}

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

281 const CeedScalar *grad,
282 const CeedScalar *qref,
283 const CeedScalar *qweight,
284 CeedBasis basis) {
285 int ierr;
286 Ceed ceed;
287 ierr = CeedBasisGetCeed(basis, &ceed); CeedChk(ierr);
288
289 Ceed parent;
290 ierr = CeedGetParent(ceed, &parent); CeedChk(ierr);
289 CeedTensorContract contract;
291 CeedTensorContract contract;
290 ierr = CeedTensorContractCreate(ceed, &contract); CeedChk(ierr);
292 ierr = CeedTensorContractCreate(parent, basis, &contract); CeedChk(ierr);
291 ierr = CeedBasisSetTensorContract(basis, &contract); CeedChk(ierr);
292
293 ierr = CeedSetBackendFunction(ceed, "Basis", basis, "Apply",
294 CeedBasisApply_Ref); CeedChk(ierr);
295 ierr = CeedSetBackendFunction(ceed, "Basis", basis, "Destroy",
296 CeedBasisDestroyNonTensor_Ref); CeedChk(ierr);
297
298 return 0;
299}
293 ierr = CeedBasisSetTensorContract(basis, &contract); CeedChk(ierr);
294
295 ierr = CeedSetBackendFunction(ceed, "Basis", basis, "Apply",
296 CeedBasisApply_Ref); CeedChk(ierr);
297 ierr = CeedSetBackendFunction(ceed, "Basis", basis, "Destroy",
298 CeedBasisDestroyNonTensor_Ref); CeedChk(ierr);
299
300 return 0;
301}