diff --git a/src/interface/Meddle.cpp b/src/interface/Meddle.cpp index 40efab412..720bba39e 100644 --- a/src/interface/Meddle.cpp +++ b/src/interface/Meddle.cpp @@ -351,8 +351,7 @@ void pcmsolver_load_surface_function(pcmsolver_context_t * context, void pcm::Meddle::loadSurfaceFunction(const char * name) const { std::string functionName(name); hostWriter_("\nLoading surface function " + functionName + " from .npy file"); - std::string fname = functionName + ".npy"; - Eigen::VectorXd values = cnpy::custom::npy_load(fname); + Eigen::VectorXd values = cnpy::custom::npy_load(functionName + ".npy"); if (values.size() != cavity_->size()) PCMSOLVER_ERROR("The loaded " + functionName + " surface function is bigger than the cavity!"); diff --git a/tests/C_host/C_host.c b/tests/C_host/C_host.c index ed866f450..848147a57 100644 --- a/tests/C_host/C_host.c +++ b/tests/C_host/C_host.c @@ -157,8 +157,9 @@ int main() { test_surface_functions( output, grid_size, mep, asc_Ag, asc_B3g, asc_neq_B3g, areas); - pcmsolver_save_surface_function(pcm_context, mep_lbl); + pcmsolver_save_surface_functions(pcm_context); pcmsolver_save_surface_function(pcm_context, asc_lbl); + pcmsolver_load_surface_function(pcm_context, mep_lbl); pcmsolver_write_timings(pcm_context); diff --git a/tests/Fortran_host/Fortran_host.f90 b/tests/Fortran_host/Fortran_host.f90 index 921f5c897..40e154186 100644 --- a/tests/Fortran_host/Fortran_host.f90 +++ b/tests/Fortran_host/Fortran_host.f90 @@ -168,6 +168,9 @@ program pcm_fortran_host ! Surface functions call test_surface_functions(grid_size, mep, asc_Ag, asc_B3g, asc_neq_B3g, areas) + call pcmsolver_save_surface_function(pcm_context, mep_lbl) + call pcmsolver_load_surface_function(pcm_context, mep_lbl) + call pcmsolver_write_timings(pcm_context) call pcmsolver_delete(pcm_context)