aboutsummaryrefslogtreecommitdiff
path: root/src/Ell_Register.c
blob: 80d568e3140ebdee6d61db5ac3fd22f4b5752591 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "cctk.h"
#include "cctk_parameters.h"

#include "StoreNamedData.h"

static pNamedData *EqNameDB;

void Ell_RegisterEq(void *(function)(const char *, void*), const char *eqname) {
    StoreNamedData(&EqNameDB, eqname, (void*)function);
}


void Ell_RegisterSolver(void (*function),  const char *sname, const char *eqname) {
  void (*fn)(void *, const char *);

  fn = (void(*)(void (*function), const char *sname))GetNamedData(EqNameDB, eqname);
  if (!fn) CCTK_WARN(0,"Cannot get function in EqName");

  fn(function,sname);
}