33
44#pragma once
55
6- #include < string>
7- #include < iostream>
6+ #include < Eigen/Dense> // Need for the container function
87#include < fstream>
9- #include < Eigen/Dense > // Need for the container function
10-
8+ #include < iostream >
9+ # include < string >
1110
1211#ifndef M_PI
1312 #define M_PI 3.14159265358979323846
1413#endif
14+
15+ /* *@brief Returns last index of vector element below value.
16+ *
17+ * @param value Input value
18+ * @param ticks Array of ticks from which to find lower-bound index (assuming ascending order)
19+ *
20+ */
21+ size_t get_lower_index (double value, const std::vector<double >& ticks);
22+
1523/* *@brief Base namespace for HydroChrono library
16- *
17- */
24+ *
25+ */
1826namespace hydroc {
1927
2028/* *@brief Set initial environment
21- *
29+ *
2230 * Use command line argument or env variables to set s
2331 * ome static data at initialization.
24- *
32+ *
2533 * Set the main data directory ..
26- *
34+ *
2735 * @param argc number of argument (same as for main function)
28- * @param argv arguments of main function
36+ * @param argv arguments of main function
2937 * @return 1 on error 0 else
30- */
38+ */
3139int SetInitialEnvironment (int argc, char * argv[]) noexcept ;
3240
3341/* *@brief Get base name of data directory
34- *
42+ *
3543 * @return the string containing the path in standard format
36- */
44+ */
3745std::string getDataDir () noexcept ;
3846template <typename T>
39- void WriteDataToFile (const std::vector<T>& data, const std::string& filename){
47+ void WriteDataToFile (const std::vector<T>& data, const std::string& filename) {
4048 std::ofstream outFile (filename);
4149 if (outFile.is_open ()) {
4250 for (const auto & item : data) {
@@ -66,7 +74,8 @@ void WriteContainerToFile(const Container& container, const std::string& file_na
6674 * @param file_name file to write container to
6775 */
6876template <>
69- void inline WriteContainerToFile<std::vector<double >>(const std::vector<double >& container, const std::string& file_name) {
77+ void inline WriteContainerToFile<std::vector<double >>(const std::vector<double >& container,
78+ const std::string& file_name) {
7079 std::ofstream output_file (file_name);
7180
7281 if (!output_file) {
@@ -103,6 +112,6 @@ void inline WriteContainerToFile<Eigen::VectorXd>(const Eigen::VectorXd& contain
103112 output_file.close ();
104113};
105114
106- } // end namespace hydroc
115+ } // end namespace hydroc
107116
108117#endif
0 commit comments