Skip to content

Commit

Permalink
🚧🔨 Add working directory to input of math function file
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagordonho committed Jul 12, 2021
1 parent 05c2acc commit 34c848d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/io/io_mesh_ascii.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ std::array<std::vector<double>, 2> mpm::IOMeshAscii<Tdim>::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);
Expand Down
4 changes: 2 additions & 2 deletions include/solvers/mpm_base.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -774,8 +774,8 @@ bool mpm::MPMBase<Tdim>::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>();
std::string math_file = io_->file_name(
function_props.at("file").template get<std::string>());
auto xfx_values = reader->read_math_functions(math_file);

function_props_update["xvalues"] = xfx_values[0];
Expand Down

0 comments on commit 34c848d

Please sign in to comment.