summaryrefslogtreecommitdiff
path: root/src/EOS_GeneralHybrid.c
blob: 9e4d44316c27273223446c35dd88d13a82f285ab (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>

#include "cctk.h"
#include "cctk_Parameters.h"
#include "cctk_Arguments.h"

#include "EOS_GeneralHybrid.h"

void CCTK_FCALL CCTK_FNAME(EOS_GeneralHybrid_Pressure) (const CCTK_INT* nelems,
                                             const CCTK_REAL* const rho,
                                             const CCTK_REAL* const eps,
                                             const CCTK_REAL* press);
void CCTK_FCALL CCTK_FNAME(EOS_GeneralHybrid_DPDRho)   (const CCTK_INT* nelems,
                                             const CCTK_REAL* const rho,
                                             const CCTK_REAL* const eps,
                                             const CCTK_REAL* dpdrho);
void CCTK_FCALL CCTK_FNAME(EOS_GeneralHybrid_DPDIE)    (const CCTK_INT* nelems,
                                             const CCTK_REAL* const rho,
                                             const CCTK_REAL* const eps,
                                             const CCTK_REAL* dpdie);
void CCTK_FCALL CCTK_FNAME(EOS_GeneralHybrid_cs2)      (const CCTK_INT* nelems,
                                             const CCTK_REAL* const rho,
                                             const CCTK_REAL* const eps,
                                             const CCTK_REAL* cs2);

CCTK_INT EOS_GeneralHybrid_SetArray(const CCTK_INT param_table,
                                    const CCTK_INT n_elems,
                                    const CCTK_POINTER* indep_vars,
                                    const CCTK_INT* which_deps_to_set,
                                    CCTK_POINTER* dep_vars)
{

  DECLARE_CCTK_PARAMETERS;
  
  CCTK_INT ierr = 0, var;

  for (var = 0; var < N_DEPS; ++var)
  {
    if (which_deps_to_set[var])
    {
      switch (var)
      {
        case (0):
          CCTK_FNAME(EOS_GeneralHybrid_Pressure) (&n_elems,
                                                  (const CCTK_REAL*)indep_vars[0],
						  (const CCTK_REAL*)indep_vars[1], 
                                                  (const CCTK_REAL*)dep_vars[0]);
          break;
        case (1):
          CCTK_FNAME(EOS_GeneralHybrid_DPDRho)   (&n_elems,
                                       
                                                  (const CCTK_REAL*)indep_vars[0], 
                                                  (const CCTK_REAL*)indep_vars[1], 
                                                  (const CCTK_REAL*)dep_vars[1]);
          break;
        case (2):
          CCTK_FNAME(EOS_GeneralHybrid_DPDIE)    (&n_elems,
                                                  (const CCTK_REAL*)indep_vars[0], 
                                                  (const CCTK_REAL*)indep_vars[1], 
                                                  (const CCTK_REAL*)dep_vars[2]);
          break;
        case (3):
          CCTK_FNAME(EOS_GeneralHybrid_cs2)      (&n_elems,
                                                  (const CCTK_REAL*)indep_vars[0], 
                                                  (const CCTK_REAL*)indep_vars[1], 
                                                  (const CCTK_REAL*)dep_vars[3]);
          break;
      }
    }
  }
  
  return ierr;
}