xref: /libCEED/gallery/scale/ceed-scale.c (revision ca94c3ddc8f82b7d93a79f9e4812e99b8be840ff)
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 
849aac155SJeremy 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 /**
14*ca94c3ddSJeremy L Thompson   @brief  Set fields for vector scaling `CeedQFunction` 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";
196574a04fSJeremy L Thompson   CeedCheck(!strcmp(name, requested), ceed, CEED_ERROR_UNSUPPORTED, "QFunction '%s' does not match requested name: %s", name, requested);
20d99fa3c5SJeremy L Thompson 
21ea61e9acSJeremy L Thompson   // QFunction fields 'input' and 'output' with requested emodes added by the library rather than being added here
22d99fa3c5SJeremy L Thompson 
23e15f9bd0SJeremy L Thompson   return CEED_ERROR_SUCCESS;
24d99fa3c5SJeremy L Thompson }
25d99fa3c5SJeremy L Thompson 
26d99fa3c5SJeremy L Thompson /**
27*ca94c3ddSJeremy L Thompson   @brief Register scaling `CeedQFunction`
28d99fa3c5SJeremy L Thompson **/
292b730f8bSJeremy L Thompson CEED_INTERN int CeedQFunctionRegister_Scale(void) { return CeedQFunctionRegister("Scale", Scale_loc, 1, Scale, CeedQFunctionInit_Scale); }
30