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