From 34c848d22f21ea5d5ce068f115c50658a8bf0471 Mon Sep 17 00:00:00 2001 From: Thiago Araujo Date: Mon, 12 Jul 2021 15:38:20 -0500 Subject: [PATCH] :construction::hammer: Add working directory to input of math function file --- include/io/io_mesh_ascii.tcc | 2 +- include/solvers/mpm_base.tcc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/io/io_mesh_ascii.tcc b/include/io/io_mesh_ascii.tcc index b45caae22..485868896 100644 --- a/include/io/io_mesh_ascii.tcc +++ b/include/io/io_mesh_ascii.tcc @@ -586,7 +586,7 @@ std::array, 2> mpm::IOMeshAscii::read_math_functions( // Read from csv file try { - io::CSVReader<2> in(math_file); + io::CSVReader<2> in(math_file.c_str()); double x_value, fx_value; while (in.read_row(x_value, fx_value)) { xfx_values[0].push_back(x_value); diff --git a/include/solvers/mpm_base.tcc b/include/solvers/mpm_base.tcc index 0f4e14a4e..9e135e9c3 100644 --- a/include/solvers/mpm_base.tcc +++ b/include/solvers/mpm_base.tcc @@ -774,8 +774,8 @@ bool mpm::MPMBase::initialise_math_functions(const Json& math_functions) { // Math function is specified in a file, replace function_props_update if (function_props.find("file") != function_props.end()) { // Read file and store in array of vectors - std::string math_file = - function_props.at("file").template get(); + std::string math_file = io_->file_name( + function_props.at("file").template get()); auto xfx_values = reader->read_math_functions(math_file); function_props_update["xvalues"] = xfx_values[0];