MoCSI API Reference
Loading...
Searching...
No Matches
OutputCsvTool.h
Go to the documentation of this file.
1#ifndef OUTPUT_CSV_TOOL_H
2#define OUTPUT_CSV_TOOL_H
3
4#define OUTPUT_CSV_TOOL_VERSION "12"
5
6#include <algorithm>
7#include <ctime>
8#include <exception>
9#include <fstream>
10#include <iomanip>
11#include <iostream>
12#include <memory>
13#include <ostream>
14#include <sstream>
15#include <string>
16#include <valarray>
17#include <vector>
18
19#include "../../src/GenericManagingModule.h"
20#include "../../src/ModuleFactory.h"
21
22#ifdef MPI_PRESENT
23#include <mpi.h>
24
25#endif
26
49template <typename T>
51{
52 private:
53 static bool m_registered;
54 std::string m_ini_filepath{"tools/OutputCsvTool.ini"};
55 std::string m_output_filepath{};
56 std::string m_save_mode{};
57 std::vector<std::string>
58 m_save_fields; // Right now this lives only in the local ini, but we make it live in
59 // the sim class, so that the other modules can write their save request
60 // to it.
61 std::string m_start_time_utc{};
62 int64_t m_start_time_seconds{};
63 std::vector<int64_t> m_interval_start_times_seconds{};
64 std::vector<int64_t> m_interval_end_times_seconds{};
65 std::vector<int> m_save_steps{};
66 int m_currentIndex{0};
67 double m_time_delta;
68 double m_time_max;
69 std::ofstream output_file;
70
71 void _writeData();
72 void _writeDataSurface(int period);
73 void _utcIntervalToSeconds();
74 void _verifyIntervalIntegrity();
75 bool _checkInterval();
76
77#ifdef MPI_PRESENT
80 int displacement{0};
81 int start{0};
82 int count{0};
85 long data_sizes[2];
86 std::string footer{};
87 void _writeDataMpi();
89 int _calcDisplacement(const std::valarray<T>& field);
90 void _writeFooter();
91#endif
92
93 public:
95 bool setup(std::vector<std::shared_ptr<GenericSubmodule<T>>> all_submodules) override;
96 bool exec(std::string_view param) override; // main functionality of the module
97
98 bool init() override;
99 bool preTimeStep() override { return true; };
100 bool postNonLinIter() override { return true; };
101 bool postTimeStep() override;
102 bool output() override;
103 std::vector<std::string> getChainInsertion() const override
104 {
105 return this->ini_file_data.getStringVectorParameters("chain_insertion");
106 };
107
108 static std::shared_ptr<GenericManagingModule<T>> createMethode(SimulationClassBase<T>* sim)
109 {
110 return std::make_shared<OutputCsvTool<T>>(sim);
111 };
112 static std::string getName() { return "OutputCsvTool"; };
113 std::string_view getNameLocal() const override { return "OutputCsvTool"; };
114};
115
116// ================= Implementation =================
117
118template <typename T>
120{
121 try
122 {
123 std::string ini_folder_path{
124 this->sim->m_simulation_config.getStringParameters("ini_folder_path")};
125 this->ini_file_data.loadUserInput(ini_folder_path + m_ini_filepath);
126 m_output_filepath = this->ini_file_data.getStringParameters("file_path");
127 m_save_mode = this->ini_file_data.getStringParameters("save_mode");
128 m_save_fields = this->ini_file_data.getStringVectorParameters("save_fields");
130 }
131 catch (const BadInput& e)
132 {
133 std::cerr << "[OutputCsvTool]: " << e.what() << '\n';
134 throw BadInput(static_cast<std::string>("[OutputCsvTool]: ")
135 + static_cast<std::string>(e.what()));
136 }
137}
138
139template <typename T>
141{
142#ifdef MPI_PRESENT
143 // Get information necessary to calculate byte sizes of output
144 numerical_layers = this->sim->m_simulation_config.getIntParameters("numerical_layers");
145 local_number_of_facets = this->sim->m_simulation_config.getIntParameters("number_of_facets");
147 this->sim->m_simulation_config.getIntParameters("global_number_of_facets");
148 // Set datatype of field to the one used across this simulation
152 if (this->sim->my_rank == 0)
153 {
154 // Flush the file
155 std::ofstream file(m_output_filepath);
156 }
157#else
158 // Flush the file
159 std::ofstream file(m_output_filepath);
160#endif
161 if (m_save_mode == "specific_time_steps" || m_save_mode == "specific_time_steps_surface")
162 {
163 try
164 {
165 std::vector<double> save_steps{
166 this->ini_file_data.getDoubleVectorParameters("save_time_steps")};
167 for (int i{0}; i < save_steps.size(); i++)
168 {
169 m_save_steps.push_back(static_cast<int>(save_steps[i]));
170 }
171 }
172 catch (const BadInput& e)
173 {
174 std::cerr << "[OutputCsvTool]: " << e.what() << '\n';
175 throw BadInput(static_cast<std::string>("[OutputCsvTool]: ")
176 + static_cast<std::string>(e.what()));
177 }
178 }
179 if (m_save_mode == "time_interval" || m_save_mode == "time_interval_surface")
180 {
181 try
182 {
183 m_time_delta = this->sim->m_simulation_config.getDoubleParameters("time_delta");
184 m_time_max = this->sim->m_simulation_config.getDoubleParameters("time_max");
185 m_start_time_utc = this->ini_file_data.getStringParameters("start_time_utc");
186 _utcIntervalToSeconds();
187 }
188 catch (const BadInput& e)
189 {
190 std::cerr << e.what() << '\n';
191 }
192 }
193 return true;
194}
195
196template <typename T>
197bool OutputCsvTool<T>::exec(std::string_view param)
198{
199 if (param == "InitChain")
200 {
201 return init();
202 }
203 if (param == "PreTimeStepChain")
204 {
205 return preTimeStep();
206 }
207 if (param == "PostNonLinIterChain")
208 {
209 return postNonLinIter();
210 }
211 if (param == "PostTimeStepChain")
212 {
213 return postTimeStep();
214 }
215 if (param == "OutputChain")
216 {
217 return output();
218 }
219 return false;
220}
221
222template <typename T>
224{
225#ifdef MPI_PRESENT
226 MPI_File_open(MPI_COMM_WORLD, m_output_filepath.c_str(), MPI_MODE_WRONLY | MPI_MODE_CREATE,
228#endif
229 return true;
230}
231
232template <typename T>
234{
235 try
236 {
237 if ((m_save_mode == "specific_time_steps") && (m_currentIndex < m_save_steps.size())
238 && (m_save_steps[m_currentIndex] == this->sim->time_step))
239 {
240#ifdef MPI_PRESENT
242#else
243 _writeData();
244#endif
245 m_currentIndex++;
246 }
247 else if ((m_save_mode == "specific_time_steps_surface")
248 && (m_currentIndex < m_save_steps.size())
249 && (m_save_steps[m_currentIndex] == this->sim->time_step))
250 {
251#ifdef MPI_PRESENT
253 this->sim->m_simulation_config.getIntParameters("numerical_layers"));
254#else
255 _writeDataSurface(this->sim->m_simulation_config.getIntParameters("numerical_layers"));
256#endif
257 m_currentIndex++;
258 }
259 else if ((m_save_mode == "interval")
260 && (this->sim->time_step % this->ini_file_data.getIntParameters("interval") == 0))
261 {
262#ifdef MPI_PRESENT
264#else
265 _writeData();
266#endif
267 }
268 else if ((m_save_mode == "interval_surface")
269 && (this->sim->time_step % this->ini_file_data.getIntParameters("interval") == 0))
270 {
271#ifdef MPI_PRESENT
273 this->sim->m_simulation_config.getIntParameters("numerical_layers"));
274#else
275 _writeDataSurface(this->sim->m_simulation_config.getIntParameters("numerical_layers"));
276#endif
277 }
278 else if ((m_save_mode == "time_interval") && _checkInterval())
279 {
280#ifdef MPI_PRESENT
282#else
283 _writeData();
284#endif
285 }
286 else if ((m_save_mode == "time_interval_surface") && _checkInterval())
287 {
288#ifdef MPI_PRESENT
290 this->sim->m_simulation_config.getIntParameters("numerical_layers"));
291#else
292 _writeDataSurface(this->sim->m_simulation_config.getIntParameters("numerical_layers"));
293#endif
294 }
295 }
296 catch (const BadInput& e)
297 {
298 std::cerr << "[OutputCsvTool]: " << e.what() << '\n';
299 throw BadInput(static_cast<std::string>("[OutputCsvTool]: ")
300 + static_cast<std::string>(e.what()));
301 }
302 return true;
303}
304
305template <typename T>
307{
308#ifdef MPI_PRESENT
309 // Check to only write footer, if it hasn't already been written (in preTimeStep)
310 if (!(footer.empty()))
311 {
312 _writeFooter();
313 }
315#else
316 if (m_save_mode == "surface")
317 {
318 try
319 {
320 _writeDataSurface(this->sim->m_simulation_config.getIntParameters("numerical_layers"));
321 }
322 catch (const BadInput& e)
323 {
324 std::cerr << "[OutputCsvTool]: " << e.what() << '\n';
325 throw BadInput(static_cast<std::string>("[OutputCsvTool]: ")
326 + static_cast<std::string>(e.what()));
327 }
328 }
329 else
330 {
331 _writeData();
332 }
333#endif
334 return true;
335}
336
343template <typename T>
345{
346 output_file.open(m_output_filepath, std::ios::app);
347
348 for (const auto& field_name : m_save_fields)
349 {
350 output_file << field_name << "," << this->sim->elapsed_time << ",";
351 try
352 {
353 const std::valarray<T>& field{this->sim->getField(field_name)};
354 for (int i{0}; i < field.size() - 1; i++)
355 {
356 output_file << field[i] << std::setprecision(15) << ",";
357 }
358 output_file << field[field.size() - 1] << std::setprecision(15) << "\n";
359 }
360 catch (const BadInput& e)
361 {
362 std::cerr << "[OutputCsvTool]: " << field_name
363 << " module not "
364 "loaded or accessable!\n "
365 "[OutputCsvTool]:"
366 << e.what() << '\n';
367 throw BadInput(static_cast<std::string>("[OutputCsvTool]: ") + field_name
368 + static_cast<std::string>(" module "
369 "not loaded or "
370 "accessable!\n [OutputCsvTool]: ")
371 + static_cast<std::string>(e.what()));
372 }
373 }
374
375 output_file.close();
376}
377
378#ifdef MPI_PRESENT
386template <typename T>
388{
390 {
391 std::cerr << "[OutputCsvTool]: Trying to access an unopened file. Please also use init and "
392 "output chains "
393 "when using MPI I/O.\n";
394 throw std::runtime_error(
395 "[OutputCsvTool]: Trying to access an unopened file. Please also use init and output "
396 "chains when using "
397 "MPI I/O.");
398 }
399 for (const auto& field_name : m_save_fields)
400 {
401 try
402 {
403 const std::valarray<T>& field{this->sim->getField(field_name)};
406 static_cast<int>(field.size()), m_dtype, MPI_STATUS_IGNORE);
407 // Update the starting position (in bytes) for the next write
408 // Each process from the first k can write at position rank * size of its array.
409 // Each process > k needs to account for the larger k processes to determine its pointer
410 // start.
412 {
414 footer += field_name + "," + std::to_string(this->sim->elapsed_time) + ","
415 + std::to_string(numerical_layers * global_number_of_facets) + ",";
416 }
417 else if (field.size() == local_number_of_facets)
418 {
420 footer += field_name + "," + std::to_string(this->sim->elapsed_time) + ","
421 + std::to_string(global_number_of_facets) + ",";
422 }
423 else
424 {
425 start += type_size * static_cast<int>(field.size()) * this->sim->world_size;
426 footer += field_name + "," + std::to_string(this->sim->elapsed_time) + ","
427 + std::to_string(field.size() * this->sim->world_size) + ",";
428 }
429 }
430 catch (const BadInput& e)
431 {
432 std::cerr << "[OutputCsvTool]: " << field_name
433 << " module not "
434 "loaded or accessable!\n "
435 "[OutputCsvTool]:"
436 << e.what() << '\n';
437 throw BadInput(static_cast<std::string>("[OutputCsvTool]: ") + field_name
438 + static_cast<std::string>(" module "
439 "not loaded or "
440 "accessable!\n [OutputCsvTool]: ")
441 + static_cast<std::string>(e.what()));
442 }
443 }
444}
445#endif
446
455template <typename T>
457{
458 output_file.open(m_output_filepath, std::ios::app);
459
460 for (const auto& field_name : m_save_fields)
461 {
462 output_file << field_name << "," << this->sim->elapsed_time << ",";
463 try
464 {
465 const std::valarray<T>& field{this->sim->getField(field_name)};
466 for (int i{0}; i < static_cast<int>(field.size() / period) - 1; i++)
467 {
468 output_file << field[i * period] << std::setprecision(15) << ",";
469 }
470 output_file << field[field.size() - period] << std::setprecision(15) << "\n";
471 }
472 catch (const BadInput& e)
473 {
474 std::cerr << "[OutputCsvTool]: " << field_name
475 << " module not "
476 "loaded or accessable!\n "
477 "[OutputCsvTool]:"
478 << e.what() << '\n';
479 throw BadInput(static_cast<std::string>("[OutputCsvTool]: ") + field_name
480 + static_cast<std::string>(" module "
481 "not loaded or "
482 "accessable!\n [OutputCsvTool]:")
483 + static_cast<std::string>(e.what()));
484 }
485 }
486
487 output_file.close();
488}
489
490#ifdef MPI_PRESENT
500template <typename T>
502{
504 {
505 std::cerr << "[OutputCsvTool]: Trying to access an unopened file. Please also use init and "
506 "output chains "
507 "when using MPI I/O.\n";
508 throw std::runtime_error(
509 "[OutputCsvTool]: Trying to access an unopened file. Please also use init and output "
510 "chains when using "
511 "MPI I/O.");
512 }
513 for (const auto& field_name : m_save_fields)
514 {
515 // Get only the surface values of the field variable.
516 try
517 {
518 const std::valarray<T>& field{this->sim->getField(field_name)};
519 std::valarray<T> field_surface(field.size() / period);
520 for (int i{0}; i < field_surface.size(); i++)
521 {
523 }
524 // Update the starting position (in bytes) for the next write
525 // Each process from the first k can write at position rank * size of its array.
526 // Each process > k needs to account for the larger k processes to determine its pointer
527 // start.
530 static_cast<int>(field_surface.size()), m_dtype,
532 // Update the starting position (in bytes) for the next write
534 {
536 footer += field_name + "," + std::to_string(this->sim->elapsed_time) + ","
538 + ",";
539 }
540 }
541 catch (const BadInput& e)
542 {
543 std::cerr << "[OutputCsvTool]: " << field_name
544 << " module not "
545 "loaded or accessable!\n "
546 "[OutputCsvTool]:"
547 << e.what() << '\n';
548 throw BadInput(static_cast<std::string>("[OutputCsvTool]: ") + field_name
549 + static_cast<std::string>(" module "
550 "not loaded or "
551 "accessable!\n [OutputCsvTool]: ")
552 + static_cast<std::string>(e.what()));
553 }
554 }
555}
556
566template <typename T>
567int OutputCsvTool<T>::_calcDisplacement(const std::valarray<T>& field)
568{
571 {
572 // For the block of same size processes, displacement is rank * local_field_size *
573 // data_type_byte_size.
574 if (this->sim->my_rank < this->sim->number_of_larger_procs)
575 {
576 proc_displacement = this->sim->my_rank * static_cast<int>(field.size()) * type_size;
577 }
578 // For the second block, add the first block displacement and count how many second block
579 // processes are between the targeted position and the first block.
580 // local_field_size_large_proc = local_field_size_small_proc + numerical_layers.
581 else
582 {
584 (this->sim->number_of_larger_procs * (field.size() + numerical_layers)
585 + (this->sim->my_rank - this->sim->number_of_larger_procs)
586 * static_cast<int>(field.size()))
587 * type_size;
588 }
589 }
590 else if (field.size() == local_number_of_facets)
591 {
592 // For the block of same size processes, displacement is rank * local_field_size *
593 // data_type_byte_size.
594 if (this->sim->my_rank < this->sim->number_of_larger_procs)
595 {
596 proc_displacement = this->sim->my_rank * static_cast<int>(field.size()) * type_size;
597 }
598 // For the second block, add the first block displacement and count how many second block
599 // processes are between the targeted position and the first block.
600 // local_field_size_large_proc = local_field_size_small_proc + 1.
601 else
602 {
603 proc_displacement = (this->sim->number_of_larger_procs * (field.size() + 1)
604 + (this->sim->my_rank - this->sim->number_of_larger_procs)
605 * static_cast<int>(field.size()))
606 * type_size;
607 }
608 }
609 else
610 {
611 proc_displacement = type_size * static_cast<int>(field.size());
612 }
613 return proc_displacement;
614}
615
623template <typename T>
625{
627 long data_size_displacement{static_cast<long>(start + footer_type_size * footer.size())};
628 if (this->sim->my_rank == 0)
629 {
631 static_cast<int>(footer.size()), MPI_UNSIGNED_CHAR, MPI_STATUS_IGNORE);
633 data_sizes[1] = static_cast<long>(footer.size());
636 }
637}
638#endif
639
653template <typename T>
655{
656 std::vector<std::string> m_interval_start_times_utc{
657 this->ini_file_data.getStringVectorParameters("interval_start_times_utc")};
658 std::vector<std::string> m_interval_end_times_utc{
659 this->ini_file_data.getStringVectorParameters("interval_end_times_utc")};
660 const std::string format = "%Y-%m-%dT%H:%M:%S";
661 std::tm tm_struct{}; // Always zero-initialize this type.
662 tm_struct.tm_isdst = -1;
663 std::istringstream sstream{};
664 std::time_t time_point{};
665
666 sstream.str(m_start_time_utc);
667 sstream >> std::get_time(&tm_struct, format.c_str());
668 time_point = std::mktime(&tm_struct);
669 m_start_time_seconds = static_cast<int64_t>(time_point);
670 if (sstream.fail())
671 {
672 std::cerr << "[OutputCsvTool]: Could not parse the start time stamp: " << m_start_time_utc
673 << "!\nPlease use the format YYYY-MM-DDThh:mm:ss\n";
674 throw std::runtime_error("[OutputCsvTool]: Could not parse the start time stamp: "
675 + m_start_time_utc
676 + "!\nPlease use the format YYYY-MM-DDThh:mm:ss\n");
677 }
678 sstream.clear();
679
680 for (int i{0}; i < m_interval_start_times_utc.size(); i++)
681 {
683 sstream >> std::get_time(&tm_struct, format.c_str());
684 time_point = std::mktime(&tm_struct);
685 m_interval_start_times_seconds.push_back(static_cast<int64_t>(time_point));
686 if (sstream.fail())
687 {
688 std::cerr << "[OutputCsvTool]: Could not parse the starting interval time stamp: "
690 << "!\nPlease use the format YYYY-MM-DDThh:mm:ss\n";
691 throw std::runtime_error(
692 "[OutputCsvTool]: Could not parse the starting interval time stamp: "
693 + m_interval_start_times_utc[i] + "!\nPlease use the format YYYY-MM-DDThh:mm:ss\n");
694 }
695 sstream.clear();
696 }
697
698 for (int i{0}; i < m_interval_end_times_utc.size(); i++)
699 {
701 sstream >> std::get_time(&tm_struct, format.c_str());
702 time_point = std::mktime(&tm_struct);
703 m_interval_end_times_seconds.push_back(static_cast<int64_t>(time_point));
704 if (sstream.fail())
705 {
706 std::cerr << "[OutputCsvTool]: Could not parse the starting interval time stamp: "
708 << "!\nPlease use the format YYYY-MM-DDThh:mm:ss\n";
709 throw std::runtime_error(
710 "[OutputCsvTool]: Could not parse the starting interval time stamp: "
711 + m_interval_end_times_utc[i] + "!\nPlease use the format YYYY-MM-DDThh:mm:ss\n");
712 }
713 sstream.clear();
714 }
715
716 // I do this test here and not in checkIntervalIntegrity to not have them sorted yet so I can
717 // give the utc time stamps back to the user.
718 for (int i{0}; i < m_interval_end_times_utc.size(); i++)
719 {
720 if (m_interval_start_times_seconds[i] > m_interval_end_times_seconds[i])
721 {
722 std::cerr << "[OutputCsvTool]: Starting time of interval "
723 << m_interval_start_times_utc[i] << " is after the end time of the interval "
725 << "! Please ensure that interval start time < interval end time.\n";
726 throw std::runtime_error(
727 "[OutputCsvTool]: Starting time of interval " + m_interval_start_times_utc[i]
728 + " is after the end time of the interval " + m_interval_end_times_utc[i]
729 + "! Please ensure that interval start time < interval end time.\n");
730 }
731
732 // I sort here, because I expect the user to give disjoint intervals. If I didn't and the
733 // user did not sort the intervals in ascending order themself, the code would lock up and
734 // might skip intervals, so sorting here should do what the user wants more often than not
735 // sorting.
736 std::sort(m_interval_start_times_seconds.begin(), m_interval_start_times_seconds.end());
737 std::sort(m_interval_end_times_seconds.begin(), m_interval_end_times_seconds.end());
738
739 _verifyIntervalIntegrity();
740 }
741}
742
754template <typename T>
756{
757 if (m_interval_start_times_seconds.size() != m_interval_end_times_seconds.size())
758 {
759 std::cerr << "[OutputCsvTool]: Start and end intervalls have different amount of time "
760 "stamps!\n";
761 throw std::runtime_error(
762 "[OutputCsvTool]: Start and end intervalls have different amount of time "
763 "stamps!\n");
764 }
765
767 double sim_end_time{m_start_time_seconds + m_time_max};
768 for (int i{0}; i < m_interval_start_times_seconds.size(); i++)
769 {
770 if (m_interval_start_times_seconds[i] > sim_end_time
771 || m_interval_end_times_seconds[i] < m_start_time_seconds)
772 {
774 }
775 }
776 if (intervals_out_of_range == m_interval_start_times_seconds.size())
777 {
778 std::cerr << "[OutputCsvTool]: None of the given intervals are within the simulation "
779 "time span! Please provide at least one valid interval.\n";
780 throw std::runtime_error(
781 "[OutputCsvTool]: None of the given intervals are within the simulation time span! "
782 "Please provide at least one valid interval.\n");
783 }
784 else if (intervals_out_of_range > 0)
785 {
786 std::cerr << "[OutputCsvTool]: " << intervals_out_of_range << " out of "
787 << m_interval_start_times_seconds.size()
788 << " intervals are outside of the simulation time span and will be ignored\n";
789 }
790}
791
799template <typename T>
801{
802 while (m_currentIndex < m_interval_start_times_seconds.size())
803 {
804 // If we are within an time interval, check if we are also within a time step interval and
805 // return true or false.
806 if (m_interval_start_times_seconds[m_currentIndex]
807 <= m_start_time_seconds + this->sim->time_step * m_time_delta
808 && m_interval_end_times_seconds[m_currentIndex]
809 >= m_start_time_seconds + this->sim->time_step * m_time_delta)
810 {
811 if (this->sim->time_step % this->ini_file_data.getIntParameters("interval") == 0)
812 {
813 return true;
814 }
815 else
816 {
817 return false;
818 }
819 }
820 // If we have passed an interval, go to the next one (don't return yet, for there might be
821 // multiple intervals out of the time span).
822 else if (m_interval_end_times_seconds[m_currentIndex]
823 < m_start_time_seconds + this->sim->time_step * m_time_delta)
824 {
825 m_currentIndex++;
826 }
827 // Otherwise, we are currently outside of an interval and return false.
828 else
829 {
830 return false;
831 }
832 }
833 // If the while loop exits, we have passed the final interval and can always return false.
834 return false;
835}
836
837template <typename T>
839
840#endif // OUTPUT_CSV_TOOL_H
This error class inherits from std::exception and marks faulty parameter or CL inputs....
Definition IniParser.h:71
Concrete implementation of a matrix class representing a Compressed Sparse Rows (CSR) matrix....
Definition CsrMatrix.h:37
CsrSparseMatrix()
Constructor for an empty CsrSparseMatrix object. Leaves all storage arrays empty but sets the flag to...
Definition CsrMatrix.h:94
Abstract base class for the managing modules. Managing modules are the highest tier of modules and ar...
Definition GenericManagingModule.h:29
InputManager ini_file_data
Definition GenericManagingModule.h:38
SimulationClassBase< T > * sim
Definition GenericManagingModule.h:31
std::vector< std::string > m_generic_submodules
Definition GenericManagingModule.h:36
std::pair< int, int > size() const
Function that returns the size of the matrix as a pair in (rows, columns) format.
Definition GenericMatrix.h:120
std::vector< std::string > getStringVectorParameters(const std::string &key) const
Definition InputManager.cpp:508
void loadUserInput(const std::string &user_ini_file_path)
Public function to load and merge user supplied ini files with the already stored data.
Definition InputManager.cpp:45
std::string getStringParameters(const std::string &key) const
Getter function to access the m_parameters map and returns a string. Throws a BadInput error,...
Definition InputManager.cpp:498
static constexpr bool registerModule(std::string name, creation_method module) noexcept
Function that adds a module to the module registry map.
Definition ModuleFactory.h:75
Saves specified simulation field data into CSV files.
Definition OutputCsvTool.h:51
bool output() override
Definition OutputCsvTool.h:306
bool preTimeStep() override
Definition OutputCsvTool.h:99
std::string_view getNameLocal() const override
Definition OutputCsvTool.h:113
bool postNonLinIter() override
Definition OutputCsvTool.h:100
bool init() override
Definition OutputCsvTool.h:223
static std::string getName()
Definition OutputCsvTool.h:112
bool exec(std::string_view param) override
Definition OutputCsvTool.h:197
bool setup(std::vector< std::shared_ptr< GenericSubmodule< T > > > all_submodules) override
Definition OutputCsvTool.h:140
OutputCsvTool(SimulationClassBase< T > *sim)
Definition OutputCsvTool.h:119
static std::shared_ptr< GenericManagingModule< T > > createMethode(SimulationClassBase< T > *sim)
Definition OutputCsvTool.h:108
std::vector< std::string > getChainInsertion() const override
Definition OutputCsvTool.h:103
bool postTimeStep() override
Definition OutputCsvTool.h:233