1
1
#include < AMReX.H>
2
2
#include < AMReX_Print.H>
3
3
#include " Utilities.H"
4
+ #include " Table.H"
5
+ #include " BlackBoxFunction.H"
4
6
5
7
namespace m2c = pele::physics::utilities::mks2cgs;
6
8
namespace c2m = pele::physics::utilities::cgs2mks;
@@ -10,6 +12,23 @@ main(int argc, char* argv[])
10
12
{
11
13
amrex::Initialize (argc, argv);
12
14
15
+ // Test table interpolation
16
+ pele::physics::TabulatedFunctionParams tabfunc_par;
17
+ tabfunc_par.host_only_parm ().parm_parse_prefix = " test" ;
18
+ tabfunc_par.initialize ();
19
+ pele::physics::TabulatedFunction tabfunc (
20
+ static_cast <const pele::physics::TabulatedFunctionData*>(
21
+ &tabfunc_par.host_parm ()));
22
+ amrex::Real outval;
23
+ const amrex::GpuArray<amrex::Real, 2 > invals{1.0 , 1.0 };
24
+ const std::string varname = " T" ;
25
+ const int idxT =
26
+ pele::physics::get_var_index (varname.c_str (), &tabfunc_par.host_parm ());
27
+ tabfunc.get_value (idxT, invals.data (), outval);
28
+ AMREX_ALWAYS_ASSERT (amrex::almostEqual (outval, 3.60 ));
29
+ tabfunc_par.deallocate ();
30
+ amrex::Print () << " TabulatedFunction Tests passed" << std::endl;
31
+
13
32
// Test Unit Conversions
14
33
AMREX_ALWAYS_ASSERT (m2c::Length (1.0 ) == 100.0 );
15
34
AMREX_ALWAYS_ASSERT (c2m::Length (1.0 , 2 ) == 1.0e-4 );
0 commit comments