Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ jobs:
ccache -z
make -j ${{env.NPROCS}} TINY_PROFILE=TRUE USE_CCACHE=TRUE USE_AMREX_LIB=TRUE ${{matrix.amrex_build_args}}; \
if [ "${{matrix.comp}}" == 'gnu' ] || [ "${{matrix.comp}}" == 'llvm' ]; then \
./Pele2d.${{matrix.comp}}.TPROF.ex;
./Pele2d.${{matrix.comp}}.TPROF.ex input;
fi;
make realclean;
if [ $? -ne 0 ]; then exit 1; fi; \
Expand Down
1 change: 1 addition & 0 deletions Source/Utility/BlackBoxFunction/Table.H
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#define MAXD_TABLE 5
#include <iostream>
#include <fstream>
#include <AMReX_ParmParse.H>
#include "BlackBoxFunction.H"
#include "Utilities.H"

Expand Down
1 change: 1 addition & 0 deletions Testing/Exec/UtilityUnitTest/input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test.table.filename = ../../../Support/CMLM/peletable_2dim_10grid
19 changes: 19 additions & 0 deletions Testing/Exec/UtilityUnitTest/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include <AMReX.H>
#include <AMReX_Print.H>
#include "Utilities.H"
#include "Table.H"
#include "BlackBoxFunction.H"

namespace m2c = pele::physics::utilities::mks2cgs;
namespace c2m = pele::physics::utilities::cgs2mks;
Expand All @@ -10,6 +12,23 @@ main(int argc, char* argv[])
{
amrex::Initialize(argc, argv);

// Test table interpolation
pele::physics::TabulatedFunctionParams tabfunc_par;
tabfunc_par.host_only_parm().parm_parse_prefix = "test";
tabfunc_par.initialize();
pele::physics::TabulatedFunction tabfunc(
static_cast<const pele::physics::TabulatedFunctionData*>(
&tabfunc_par.host_parm()));
amrex::Real outval;
const amrex::GpuArray<amrex::Real, 2> invals{1.0, 1.0};
const std::string varname = "T";
const int idxT =
pele::physics::get_var_index(varname.c_str(), &tabfunc_par.host_parm());
tabfunc.get_value(idxT, invals.data(), outval);
AMREX_ALWAYS_ASSERT(amrex::almostEqual(outval, 3.60));
tabfunc_par.deallocate();
amrex::Print() << "TabulatedFunction Tests passed" << std::endl;

// Test Unit Conversions
AMREX_ALWAYS_ASSERT(m2c::Length(1.0) == 100.0);
AMREX_ALWAYS_ASSERT(c2m::Length(1.0, 2) == 1.0e-4);
Expand Down
Loading