13d8e8822SJeremy L Thompson // Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors. 23d8e8822SJeremy L Thompson // All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 3d99fa3c5SJeremy L Thompson // 43d8e8822SJeremy L Thompson // SPDX-License-Identifier: BSD-2-Clause 5d99fa3c5SJeremy L Thompson // 63d8e8822SJeremy L Thompson // This file is part of CEED: http://github.com/ceed 7d99fa3c5SJeremy L Thompson 8*49aac155SJeremy L Thompson #include <ceed.h> 9ec3da8bcSJed Brown #include <ceed/backend.h> 10a0154adeSJed Brown #include <ceed/jit-source/gallery/ceed-scale.h> 112b730f8bSJeremy L Thompson #include <string.h> 12d99fa3c5SJeremy L Thompson 13d99fa3c5SJeremy L Thompson /** 14d99fa3c5SJeremy L Thompson @brief Set fields for vector scaling QFunction that scales inputs 15d99fa3c5SJeremy L Thompson **/ 162b730f8bSJeremy L Thompson static int CeedQFunctionInit_Scale(Ceed ceed, const char *requested, CeedQFunction qf) { 17d99fa3c5SJeremy L Thompson // Check QFunction name 18d99fa3c5SJeremy L Thompson const char *name = "Scale"; 192b730f8bSJeremy L Thompson if (strcmp(name, requested)) { 20d99fa3c5SJeremy L Thompson // LCOV_EXCL_START 212b730f8bSJeremy L Thompson return CeedError(ceed, CEED_ERROR_UNSUPPORTED, "QFunction '%s' does not match requested name: %s", name, requested); 22d99fa3c5SJeremy L Thompson // LCOV_EXCL_STOP 232b730f8bSJeremy L Thompson } 24d99fa3c5SJeremy L Thompson 25ea61e9acSJeremy L Thompson // QFunction fields 'input' and 'output' with requested emodes added by the library rather than being added here 26d99fa3c5SJeremy L Thompson 27e15f9bd0SJeremy L Thompson return CEED_ERROR_SUCCESS; 28d99fa3c5SJeremy L Thompson } 29d99fa3c5SJeremy L Thompson 30d99fa3c5SJeremy L Thompson /** 31d99fa3c5SJeremy L Thompson @brief Register scaling QFunction 32d99fa3c5SJeremy L Thompson **/ 332b730f8bSJeremy L Thompson CEED_INTERN int CeedQFunctionRegister_Scale(void) { return CeedQFunctionRegister("Scale", Scale_loc, 1, Scale, CeedQFunctionInit_Scale); } 34