Skip to content
Merged
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
16 changes: 14 additions & 2 deletions source/structured_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,10 @@ namespace aspect
"text `$ASPECT_SOURCE_DIR' which will be interpreted as the path "
"in which the ASPECT source files were located when ASPECT was "
"compiled. This interpretation allows, for example, to reference "
"files located in the `data/' subdirectory of ASPECT.");
"files located in the `data/' subdirectory of ASPECT. A trailing "
"slash at the end of the directory path is optional; the plugin "
"will automatically append a '/' when the parameters are parsed if "
"it is missing.");
prm.declare_entry ("Data file name",
default_filename,
Patterns::Anything (),
Expand Down Expand Up @@ -972,6 +975,9 @@ namespace aspect
// to $ASPECT_SOURCE_DIR, replace it by what CMake has given us
// as a #define
data_directory = Utilities::expand_ASPECT_SOURCE_DIR(prm.get ("Data directory"));
// ensure directory ends with a slash so callers can safely do data_directory + filename
if (!data_directory.empty() && data_directory.back() != '/')
data_directory.push_back('/');
data_file_name = prm.get ("Data file name");
scale_factor = prm.get_double ("Scale factor");
}
Expand Down Expand Up @@ -1680,7 +1686,10 @@ namespace aspect
"text `$ASPECT_SOURCE_DIR' which will be interpreted as the path "
"in which the ASPECT source files were located when ASPECT was "
"compiled. This interpretation allows, for example, to reference "
"files located in the `data/' subdirectory of ASPECT. ");
"files located in the `data/' subdirectory of ASPECT. A trailing "
"slash at the end of the directory path is optional; the plugin "
"will automatically append a '/' when the parameters are parsed if "
"it is missing. ");

prm.declare_entry ("Data file names",
default_filename,
Expand Down Expand Up @@ -1711,6 +1720,9 @@ namespace aspect
prm.enter_subsection(subsection_name);
{
data_directory = Utilities::expand_ASPECT_SOURCE_DIR(prm.get ("Data directory"));
// ensure directory ends with a slash so callers can safely do data_directory + filename
if (!data_directory.empty() && data_directory.back() != '/')
data_directory.push_back('/');
data_file_names = Utilities::split_string_list(prm.get ("Data file names"), ',');
interpolation_scheme = prm.get("Interpolation scheme");
}
Expand Down