xref: /libCEED/interface/ceed-qfunction-register.c (revision bf185410af015d53ed6d3b520013ce284095d550)
1 #include <ceed/ceed.h>
2 #include <ceed/backend.h>
3 #include <stdbool.h>
4 
5 static bool register_all_called;
6 
7 #define MACRO(name) CEED_INTERN int name(void);
8 #include "../gallery/ceed-gallery-list.h"
9 #undef MACRO
10 
11 /**
12   @brief Register the gallery of preconfigured QFunctions.
13 
14   This is called automatically by CeedQFunctionCreateInteriorByName() and thus normally need not be called by users.
15   Users can call CeedQFunctionRegister() to register additional backends.
16 
17   @return An error code: 0 - success, otherwise - failure
18 
19   @sa CeedQFunctionRegister()
20 
21   @ref User
22 **/
23 int CeedQFunctionRegisterAll() {
24   if (register_all_called) return 0;
25   register_all_called = true;
26 
27 #define MACRO(name) CeedChk(name());
28 #include "../gallery/ceed-gallery-list.h"
29 #undef MACRO
30   return CEED_ERROR_SUCCESS;
31 }
32