1d99fa3c5SJeremy L Thompson // Copyright (c) 2017-2018, Lawrence Livermore National Security, LLC. 2d99fa3c5SJeremy L Thompson // Produced at the Lawrence Livermore National Laboratory. LLNL-CODE-734707. 3d99fa3c5SJeremy L Thompson // All Rights reserved. See files LICENSE and NOTICE for details. 4d99fa3c5SJeremy L Thompson // 5d99fa3c5SJeremy L Thompson // This file is part of CEED, a collection of benchmarks, miniapps, software 6d99fa3c5SJeremy L Thompson // libraries and APIs for efficient high-order finite element and spectral 7d99fa3c5SJeremy L Thompson // element discretizations for exascale applications. For more information and 8d99fa3c5SJeremy L Thompson // source code availability see http://github.com/ceed. 9d99fa3c5SJeremy L Thompson // 10d99fa3c5SJeremy L Thompson // The CEED research is supported by the Exascale Computing Project 17-SC-20-SC, 11d99fa3c5SJeremy L Thompson // a collaborative effort of two U.S. Department of Energy organizations (Office 12d99fa3c5SJeremy L Thompson // of Science and the National Nuclear Security Administration) responsible for 13d99fa3c5SJeremy L Thompson // the planning and preparation of a capable exascale ecosystem, including 14d99fa3c5SJeremy L Thompson // software, applications, hardware, advanced system engineering and early 15d99fa3c5SJeremy L Thompson // testbed platforms, in support of the nation's exascale computing imperative. 16d99fa3c5SJeremy L Thompson 173d576824SJeremy L Thompson #include <ceed.h> 183d576824SJeremy L Thompson #include <ceed-backend.h> 19d99fa3c5SJeremy L Thompson #include <string.h> 20d99fa3c5SJeremy L Thompson #include "ceed-scale.h" 21d99fa3c5SJeremy L Thompson 22d99fa3c5SJeremy L Thompson /** 23d99fa3c5SJeremy L Thompson @brief Set fields for vector scaling QFunction that scales inputs 24d99fa3c5SJeremy L Thompson **/ 25d99fa3c5SJeremy L Thompson static int CeedQFunctionInit_Scale(Ceed ceed, const char *requested, 26d99fa3c5SJeremy L Thompson CeedQFunction qf) { 27d99fa3c5SJeremy L Thompson // Check QFunction name 28d99fa3c5SJeremy L Thompson const char *name = "Scale"; 29d99fa3c5SJeremy L Thompson if (strcmp(name, requested)) 30d99fa3c5SJeremy L Thompson // LCOV_EXCL_START 31*e15f9bd0SJeremy L Thompson return CeedError(ceed, CEED_ERROR_UNSUPPORTED, 32*e15f9bd0SJeremy L Thompson "QFunction '%s' does not match requested name: %s", 33d99fa3c5SJeremy L Thompson name, requested); 34d99fa3c5SJeremy L Thompson // LCOV_EXCL_STOP 35d99fa3c5SJeremy L Thompson 36d99fa3c5SJeremy L Thompson // QFunction fields 'input' and 'output' with requested emodes added 37d99fa3c5SJeremy L Thompson // by the library rather than being added here 38d99fa3c5SJeremy L Thompson 39*e15f9bd0SJeremy L Thompson return CEED_ERROR_SUCCESS; 40d99fa3c5SJeremy L Thompson } 41d99fa3c5SJeremy L Thompson 42d99fa3c5SJeremy L Thompson /** 43d99fa3c5SJeremy L Thompson @brief Register scaling QFunction 44d99fa3c5SJeremy L Thompson **/ 451d013790SJed Brown CEED_INTERN int CeedQFunctionRegister_Scale(void) { 461d013790SJed Brown return CeedQFunctionRegister("Scale", Scale_loc, 1, Scale, 47d99fa3c5SJeremy L Thompson CeedQFunctionInit_Scale); 48d99fa3c5SJeremy L Thompson } 49