Skip to content

Commit 7b528c2

Browse files
authored
Merge pull request #71 from robertodr/fix-fortran-api
Fix API for the surface function NumPy save/load functions
2 parents af4df2a + bdb2783 commit 7b528c2

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/interface/Meddle.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,7 @@ void pcmsolver_load_surface_function(pcmsolver_context_t * context,
351351
void pcm::Meddle::loadSurfaceFunction(const char * name) const {
352352
std::string functionName(name);
353353
hostWriter_("\nLoading surface function " + functionName + " from .npy file");
354-
std::string fname = functionName + ".npy";
355-
Eigen::VectorXd values = cnpy::custom::npy_load<double>(fname);
354+
Eigen::VectorXd values = cnpy::custom::npy_load<double>(functionName + ".npy");
356355
if (values.size() != cavity_->size())
357356
PCMSOLVER_ERROR("The loaded " + functionName +
358357
" surface function is bigger than the cavity!");

tests/C_host/C_host.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,9 @@ int main() {
157157
test_surface_functions(
158158
output, grid_size, mep, asc_Ag, asc_B3g, asc_neq_B3g, areas);
159159

160-
pcmsolver_save_surface_function(pcm_context, mep_lbl);
160+
pcmsolver_save_surface_functions(pcm_context);
161161
pcmsolver_save_surface_function(pcm_context, asc_lbl);
162+
pcmsolver_load_surface_function(pcm_context, mep_lbl);
162163

163164
pcmsolver_write_timings(pcm_context);
164165

tests/Fortran_host/Fortran_host.f90

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ program pcm_fortran_host
168168
! Surface functions
169169
call test_surface_functions(grid_size, mep, asc_Ag, asc_B3g, asc_neq_B3g, areas)
170170

171+
call pcmsolver_save_surface_function(pcm_context, mep_lbl)
172+
call pcmsolver_load_surface_function(pcm_context, mep_lbl)
173+
171174
call pcmsolver_write_timings(pcm_context)
172175

173176
call pcmsolver_delete(pcm_context)

0 commit comments

Comments
 (0)