| ceed-tensor.c (2f86a9204e4fbd31e43e0982a43b4a40f1fd11a7) | ceed-tensor.c (c71e1dcdcfce633cdb19fa81aa6735b006eb809d) |
|---|---|
| 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. --- 20 unchanged lines hidden (view full) --- 29 @param ceed A Ceed object where the CeedTensorContract will be created 30 @param contract Address of the variable where the newly created 31 CeedTensorContract will be stored. 32 33 @return An error code: 0 - success, otherwise - failure 34 35 @ref Advanced 36**/ | 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. --- 20 unchanged lines hidden (view full) --- 29 @param ceed A Ceed object where the CeedTensorContract will be created 30 @param contract Address of the variable where the newly created 31 CeedTensorContract will be stored. 32 33 @return An error code: 0 - success, otherwise - failure 34 35 @ref Advanced 36**/ |
| 37int CeedTensorContractCreate(Ceed ceed, CeedTensorContract *contract) { | 37int CeedTensorContractCreate(Ceed ceed, CeedBasis basis, 38 CeedTensorContract *contract) { |
| 38 int ierr; 39 40 if (!ceed->TensorContractCreate) { 41 Ceed delegate; 42 ierr = CeedGetDelegate(ceed, &delegate); CeedChk(ierr); 43 44 if (!delegate) 45 return CeedError(ceed, 1, 46 "Backend does not support TensorContractCreate"); 47 | 39 int ierr; 40 41 if (!ceed->TensorContractCreate) { 42 Ceed delegate; 43 ierr = CeedGetDelegate(ceed, &delegate); CeedChk(ierr); 44 45 if (!delegate) 46 return CeedError(ceed, 1, 47 "Backend does not support TensorContractCreate"); 48 |
| 48 ierr = CeedTensorContractCreate(delegate, contract); | 49 ierr = CeedTensorContractCreate(delegate, basis, contract); |
| 49 CeedChk(ierr); 50 return 0; 51 } 52 53 ierr = CeedCalloc(1,contract); CeedChk(ierr); 54 55 (*contract)->ceed = ceed; 56 ceed->refcount++; | 50 CeedChk(ierr); 51 return 0; 52 } 53 54 ierr = CeedCalloc(1,contract); CeedChk(ierr); 55 56 (*contract)->ceed = ceed; 57 ceed->refcount++; |
| 57 ierr = ceed->TensorContractCreate(*contract); | 58 ierr = ceed->TensorContractCreate(basis, *contract); |
| 58 CeedChk(ierr); 59 return 0; 60}; 61 62/** 63 @brief Apply tensor contraction 64 65 Contracts on the middle index --- 100 unchanged lines hidden --- | 59 CeedChk(ierr); 60 return 0; 61}; 62 63/** 64 @brief Apply tensor contraction 65 66 Contracts on the middle index --- 100 unchanged lines hidden --- |