1becbf5cdSJeremy L Thompson // Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors. 2becbf5cdSJeremy L Thompson // All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 3becbf5cdSJeremy L Thompson // 4becbf5cdSJeremy L Thompson // SPDX-License-Identifier: BSD-2-Clause 5becbf5cdSJeremy L Thompson // 6becbf5cdSJeremy L Thompson // This file is part of CEED: http://github.com/ceed 7becbf5cdSJeremy L Thompson 8becbf5cdSJeremy L Thompson #include <ceed.h> 9becbf5cdSJeremy L Thompson #include <ceed/backend.h> 10becbf5cdSJeremy L Thompson #include <ceed/jit-source/gallery/ceed-scale-scalar.h> 11becbf5cdSJeremy L Thompson #include <string.h> 12becbf5cdSJeremy L Thompson 13becbf5cdSJeremy L Thompson /** 14becbf5cdSJeremy L Thompson @brief Set fields for vector scaling `CeedQFunction` that scales inputs 15becbf5cdSJeremy L Thompson **/ 16becbf5cdSJeremy L Thompson static int CeedQFunctionInit_ScaleScalar(Ceed ceed, const char *requested, CeedQFunction qf) { 17becbf5cdSJeremy L Thompson // Check QFunction name 18becbf5cdSJeremy L Thompson const char *name = "Scale (scalar)"; 19*6261a418SJeremy L Thompson 20becbf5cdSJeremy L Thompson CeedCheck(!strcmp(name, requested), ceed, CEED_ERROR_UNSUPPORTED, "QFunction '%s' does not match requested name: %s", name, requested); 21becbf5cdSJeremy L Thompson 22becbf5cdSJeremy L Thompson // QFunction fields 'input' and 'output' with requested emodes added by the library rather than being added here 23becbf5cdSJeremy L Thompson return CEED_ERROR_SUCCESS; 24becbf5cdSJeremy L Thompson } 25becbf5cdSJeremy L Thompson 26becbf5cdSJeremy L Thompson /** 27becbf5cdSJeremy L Thompson @brief Register scaling `CeedQFunction` 28becbf5cdSJeremy L Thompson **/ 29becbf5cdSJeremy L Thompson CEED_INTERN int CeedQFunctionRegister_ScaleScalar(void) { 30becbf5cdSJeremy L Thompson return CeedQFunctionRegister("Scale (scalar)", ScaleScalar_loc, 1, ScaleScalar, CeedQFunctionInit_ScaleScalar); 31becbf5cdSJeremy L Thompson } 32