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 "14"
5
6#include <algorithm>
7#include <cstdint>
8#include <ctime>
9#include <exception>
10#include <fstream>
11#include <iomanip>
12#include <iostream>
13#include <memory>
14#include <ostream>
15#include <sstream>
16#include <string>
17#include <valarray>
18#include <vector>
19
20#include "../../src/GenericManagingModule.h"
21#include "../../src/ModuleFactory.h"
22
23#ifdef MPI_PRESENT
24#include <mpi.h>
25
26#include "../../src/MpiCommunicationPatterns.h"
27#endif
28
51template <typename T>
53{
54 private:
55 static bool m_registered;
56 std::string m_ini_filepath{"tools/OutputCsvTool.ini"};
57 std::string m_output_filepath{};
58 std::string m_save_mode{};
59 std::vector<std::string>
60 m_save_fields; // Right now this lives only in the local ini, but we make it live in
61 // the sim class, so that the other modules can write their save request
62 // to it.
63 std::string m_start_time_utc{};
64 int64_t m_start_time_seconds{};
65 std::vector<int64_t> m_interval_start_times_seconds{};
66 std::vector<int64_t> m_interval_end_times_seconds{};
67 std::vector<int> m_save_steps{};
68 int m_currentIndex{0};
69 double m_time_delta;
70 double m_time_max;
71 std::ofstream output_file;
72
73 void _writeData();
74 void _writeDataSurface(int period);
75 void _utcIntervalToSeconds();
76 void _verifyIntervalIntegrity();
77 bool _checkInterval();
78
79#ifdef MPI_PRESENT
84 int count{0};
88 std::string footer{};
89 void _writeDataMpi();
91 MPI_Offset _calcDisplacement(const std::valarray<T>& field);
92 void _writeFooter();
93#endif
94
95 public:
97 bool setup(std::vector<std::shared_ptr<GenericSubmodule<T>>> all_submodules) override;
98 bool exec(std::string_view param) override; // main functionality of the module
99
100 bool init() override;
101 bool preTimeStep() override { return true; };
102 bool postNonLinIter() override { return true; };
103 bool postTimeStep() override;
104 bool output() override;
105 std::vector<std::string> getChainInsertion() const override
106 {
107 return this->ini_file_data.getStringVectorParameters("chain_insertion");
108 };
109
110 static std::shared_ptr<GenericManagingModule<T>> createMethode(SimulationClassBase<T>* sim)
111 {
112 return std::make_shared<OutputCsvTool<T>>(sim);
113 };
114 static std::string getName() { return "OutputCsvTool"; };
115 std::string_view getNameLocal() const override { return "OutputCsvTool"; };
116};
117
118// ================= Implementation =================
119
120template <typename T>
122{
123 try
124 {
125 std::string ini_folder_path{
126 this->sim->m_simulation_config.getStringParameters("ini_folder_path")};
127 this->ini_file_data.loadUserInput(ini_folder_path + m_ini_filepath);
128 m_output_filepath = this->ini_file_data.getStringParameters("file_path");
129 m_save_mode = this->ini_file_data.getStringParameters("save_mode");
130 m_save_fields = this->ini_file_data.getStringVectorParameters("save_fields");
132 }
133 catch (const BadInput& e)
134 {
135 std::cerr << "[OutputCsvTool]: " << e.what() << '\n';
136 throw BadInput(static_cast<std::string>("[OutputCsvTool]: ")
137 + static_cast<std::string>(e.what()));
138 }
139}
140
141template <typename T>
143{
144#ifdef MPI_PRESENT
145 // Get information necessary to calculate byte sizes of output
146 numerical_layers = this->sim->m_simulation_config.getIntParameters("numerical_layers");
147 local_number_of_facets = this->sim->m_simulation_config.getIntParameters("number_of_facets");
149 this->sim->m_simulation_config.getIntParameters("global_number_of_facets");
150 // Set datatype of field to the one used across this simulation
154 if (this->sim->my_rank == 0)
155 {
156 // Flush the file
157 std::ofstream file(m_output_filepath);
158 }
159#else
160 // Flush the file
161 std::ofstream file(m_output_filepath);
162#endif
163 if (m_save_mode == "specific_time_steps" || m_save_mode == "specific_time_steps_surface")
164 {
165 try
166 {
167 std::vector<double> save_steps{
168 this->ini_file_data.getDoubleVectorParameters("save_time_steps")};
169 for (int i{0}; i < save_steps.size(); i++)
170 {
171 m_save_steps.push_back(static_cast<int>(save_steps[i]));
172 }
173 }
174 catch (const BadInput& e)
175 {
176 std::cerr << "[OutputCsvTool]: " << e.what() << '\n';
177 throw BadInput(static_cast<std::string>("[OutputCsvTool]: ")
178 + static_cast<std::string>(e.what()));
179 }
180 }
181 if (m_save_mode == "time_interval" || m_save_mode == "time_interval_surface")
182 {
183 try
184 {
185 m_time_delta = this->sim->m_simulation_config.getDoubleParameters("time_delta");
186 m_time_max = this->sim->m_simulation_config.getDoubleParameters("time_max");
187 m_start_time_utc = this->ini_file_data.getStringParameters("start_time_utc");
188 _utcIntervalToSeconds();
189 }
190 catch (const BadInput& e)
191 {
192 std::cerr << e.what() << '\n';
193 }
194 }
195 return true;
196}
197
198template <typename T>
199bool OutputCsvTool<T>::exec(std::string_view param)
200{
201 if (param == "InitChain")
202 {
203 return init();
204 }
205 if (param == "PreTimeStepChain")
206 {
207 return preTimeStep();
208 }
209 if (param == "PostNonLinIterChain")
210 {
211 return postNonLinIter();
212 }
213 if (param == "PostTimeStepChain")
214 {
215 return postTimeStep();
216 }
217 if (param == "OutputChain")
218 {
219 return output();
220 }
221 return false;
222}
223
224template <typename T>
226{
227#ifdef MPI_PRESENT
228 MPI_File_open(MPI_COMM_WORLD, m_output_filepath.c_str(), MPI_MODE_WRONLY | MPI_MODE_CREATE,
230#endif
231 return true;
232}
233
234template <typename T>
236{
237 try
238 {
239 if ((m_save_mode == "specific_time_steps") && (m_currentIndex < m_save_steps.size())
240 && (m_save_steps[m_currentIndex] == this->sim->time_step))
241 {
242#ifdef MPI_PRESENT
244#else
245 _writeData();
246#endif
247 m_currentIndex++;
248 }
249 else if ((m_save_mode == "specific_time_steps_surface")
250 && (m_currentIndex < m_save_steps.size())
251 && (m_save_steps[m_currentIndex] == this->sim->time_step))
252 {
253#ifdef MPI_PRESENT
255 this->sim->m_simulation_config.getIntParameters("numerical_layers"));
256#else
257 _writeDataSurface(this->sim->m_simulation_config.getIntParameters("numerical_layers"));
258#endif
259 m_currentIndex++;
260 }
261 else if ((m_save_mode == "interval")
262 && (this->sim->time_step % this->ini_file_data.getIntParameters("interval") == 0))
263 {
264#ifdef MPI_PRESENT
266#else
267 _writeData();
268#endif
269 }
270 else if ((m_save_mode == "interval_surface")
271 && (this->sim->time_step % this->ini_file_data.getIntParameters("interval") == 0))
272 {
273#ifdef MPI_PRESENT
275 this->sim->m_simulation_config.getIntParameters("numerical_layers"));
276#else
277 _writeDataSurface(this->sim->m_simulation_config.getIntParameters("numerical_layers"));
278#endif
279 }
280 else if ((m_save_mode == "time_interval") && _checkInterval())
281 {
282#ifdef MPI_PRESENT
284#else
285 _writeData();
286#endif
287 }
288 else if ((m_save_mode == "time_interval_surface") && _checkInterval())
289 {
290#ifdef MPI_PRESENT
292 this->sim->m_simulation_config.getIntParameters("numerical_layers"));
293#else
294 _writeDataSurface(this->sim->m_simulation_config.getIntParameters("numerical_layers"));
295#endif
296 }
297 }
298 catch (const BadInput& e)
299 {
300 std::cerr << "[OutputCsvTool]: " << e.what() << '\n';
301 throw BadInput(static_cast<std::string>("[OutputCsvTool]: ")
302 + static_cast<std::string>(e.what()));
303 }
304 return true;
305}
306
307template <typename T>
309{
310#ifdef MPI_PRESENT
311 // Check to only write footer, if it hasn't already been written (in preTimeStep)
312 if (!(footer.empty()))
313 {
314 _writeFooter();
315 }
317#else
318 if (m_save_mode == "surface")
319 {
320 try
321 {
322 _writeDataSurface(this->sim->m_simulation_config.getIntParameters("numerical_layers"));
323 }
324 catch (const BadInput& e)
325 {
326 std::cerr << "[OutputCsvTool]: " << e.what() << '\n';
327 throw BadInput(static_cast<std::string>("[OutputCsvTool]: ")
328 + static_cast<std::string>(e.what()));
329 }
330 }
331 else
332 {
333 _writeData();
334 }
335#endif
336 return true;
337}
338
345template <typename T>
347{
348 output_file.open(m_output_filepath, std::ios::app);
349
350 for (const auto& field_name : m_save_fields)
351 {
352 output_file << field_name << "," << this->sim->elapsed_time << ",";
353 try
354 {
355 const std::valarray<T>& field{this->sim->getField(field_name)};
356 for (int i{0}; i < field.size() - 1; i++)
357 {
358 output_file << field[i] << std::setprecision(15) << ",";
359 }
360 output_file << field[field.size() - 1] << std::setprecision(15) << "\n";
361 }
362 catch (const BadInput& e)
363 {
364 std::cerr << "[OutputCsvTool]: " << field_name
365 << " module not "
366 "loaded or accessable!\n "
367 "[OutputCsvTool]:"
368 << e.what() << '\n';
369 throw BadInput(static_cast<std::string>("[OutputCsvTool]: ") + field_name
370 + static_cast<std::string>(" module "
371 "not loaded or "
372 "accessable!\n [OutputCsvTool]: ")
373 + static_cast<std::string>(e.what()));
374 }
375 }
376
377 output_file.close();
378}
379
380#ifdef MPI_PRESENT
389template <typename T>
391{
393 {
394 std::cerr << "[OutputCsvTool]: Trying to access an unopened file. Please also use init and "
395 "output chains "
396 "when using MPI I/O.\n";
397 throw std::runtime_error(
398 "[OutputCsvTool]: Trying to access an unopened file. Please also use init and output "
399 "chains when using "
400 "MPI I/O.");
401 }
402 for (const auto& field_name : m_save_fields)
403 {
404 try
405 {
406 const std::valarray<T>& field{this->sim->getField(field_name)};
409 static_cast<int>(field.size()), m_dtype, MPI_STATUS_IGNORE);
410 // Update the starting position (in bytes) for the next write
411 // Each process from the first k can write at position rank * size of its array.
412 // Each process > k needs to account for the larger k processes to determine its pointer
413 // start.
415 {
417 footer += field_name + "," + std::to_string(this->sim->elapsed_time) + ","
418 + std::to_string(numerical_layers * global_number_of_facets) + ",";
419 }
420 else if (field.size() == local_number_of_facets)
421 {
423 footer += field_name + "," + std::to_string(this->sim->elapsed_time) + ","
424 + std::to_string(global_number_of_facets) + ",";
425 }
426 else
427 {
428 start += type_size * static_cast<MPI_Offset>(field.size()) * this->sim->world_size;
429 footer += field_name + "," + std::to_string(this->sim->elapsed_time) + ","
430 + std::to_string(field.size() * this->sim->world_size) + ",";
431 }
432 }
433 catch (const BadInput& e)
434 {
435 std::cerr << "[OutputCsvTool]: " << field_name
436 << " module not "
437 "loaded or accessable!\n "
438 "[OutputCsvTool]:"
439 << e.what() << '\n';
440 throw BadInput(static_cast<std::string>("[OutputCsvTool]: ") + field_name
441 + static_cast<std::string>(" module "
442 "not loaded or "
443 "accessable!\n [OutputCsvTool]: ")
444 + static_cast<std::string>(e.what()));
445 }
446 }
447}
448#endif
449
458template <typename T>
460{
461 output_file.open(m_output_filepath, std::ios::app);
462
463 for (const auto& field_name : m_save_fields)
464 {
465 output_file << field_name << "," << this->sim->elapsed_time << ",";
466 try
467 {
468 const std::valarray<T>& field{this->sim->getField(field_name)};
469 for (int i{0}; i < static_cast<int>(field.size() / period) - 1; i++)
470 {
471 output_file << field[i * period] << std::setprecision(15) << ",";
472 }
473 output_file << field[field.size() - period] << std::setprecision(15) << "\n";
474 }
475 catch (const BadInput& e)
476 {
477 std::cerr << "[OutputCsvTool]: " << field_name
478 << " module not "
479 "loaded or accessable!\n "
480 "[OutputCsvTool]:"
481 << e.what() << '\n';
482 throw BadInput(static_cast<std::string>("[OutputCsvTool]: ") + field_name
483 + static_cast<std::string>(" module "
484 "not loaded or "
485 "accessable!\n [OutputCsvTool]:")
486 + static_cast<std::string>(e.what()));
487 }
488 }
489
490 output_file.close();
491}
492
493#ifdef MPI_PRESENT
503template <typename T>
505{
507 {
508 std::cerr << "[OutputCsvTool]: Trying to access an unopened file. Please also use init and "
509 "output chains "
510 "when using MPI I/O.\n";
511 throw std::runtime_error(
512 "[OutputCsvTool]: Trying to access an unopened file. Please also use init and output "
513 "chains when using "
514 "MPI I/O.");
515 }
516 for (const auto& field_name : m_save_fields)
517 {
518 // Get only the surface values of the field variable.
519 try
520 {
521 const std::valarray<T>& field{this->sim->getField(field_name)};
522 std::valarray<T> field_surface(field.size() / period);
523 for (int i{0}; i < field_surface.size(); i++)
524 {
526 }
527 // Update the starting position (in bytes) for the next write
528 // Each process from the first k can write at position rank * size of its array.
529 // Each process > k needs to account for the larger k processes to determine its pointer
530 // start.
533 static_cast<int>(field_surface.size()), m_dtype,
535 // Update the starting position (in bytes) for the next write
537 {
539 footer += field_name + "," + std::to_string(this->sim->elapsed_time) + ","
541 + ",";
542 }
543 }
544 catch (const BadInput& e)
545 {
546 std::cerr << "[OutputCsvTool]: " << field_name
547 << " module not "
548 "loaded or accessable!\n "
549 "[OutputCsvTool]:"
550 << e.what() << '\n';
551 throw BadInput(static_cast<std::string>("[OutputCsvTool]: ") + field_name
552 + static_cast<std::string>(" module "
553 "not loaded or "
554 "accessable!\n [OutputCsvTool]: ")
555 + static_cast<std::string>(e.what()));
556 }
557 }
558}
559
569template <typename T>
571{
574 {
575 // For the block of same size processes, displacement is rank * local_field_size *
576 // data_type_byte_size.
577 if (this->sim->my_rank < this->sim->number_of_larger_procs)
578 {
580 this->sim->my_rank * static_cast<MPI_Offset>(field.size()) * type_size;
581 }
582 // For the second block, add the first block displacement and count how many second block
583 // processes are between the targeted position and the first block.
584 // local_field_size_large_proc = local_field_size_small_proc + numerical_layers.
585 else
586 {
588 (this->sim->number_of_larger_procs * (field.size() + numerical_layers)
589 + (this->sim->my_rank - this->sim->number_of_larger_procs)
590 * static_cast<MPI_Offset>(field.size()))
591 * type_size;
592 }
593 }
594 else if (field.size() == local_number_of_facets)
595 {
596 // For the block of same size processes, displacement is rank * local_field_size *
597 // data_type_byte_size.
598 if (this->sim->my_rank < this->sim->number_of_larger_procs)
599 {
601 this->sim->my_rank * static_cast<MPI_Offset>(field.size()) * type_size;
602 }
603 // For the second block, add the first block displacement and count how many second block
604 // processes are between the targeted position and the first block.
605 // local_field_size_large_proc = local_field_size_small_proc + 1.
606 else
607 {
609 (this->sim->number_of_larger_procs * (field.size() + 1)
610 + (this->sim->my_rank - this->sim->number_of_larger_procs) * field.size())
611 * type_size;
612 }
613 }
614 else
615 {
616 proc_displacement = type_size * static_cast<MPI_Offset>(field.size());
617 }
618 return proc_displacement;
619}
620
628template <typename T>
630{
633 static_cast<MPI_Offset>(start + footer_type_size * footer.size())};
634 if (this->sim->my_rank == 0)
635 {
637 static_cast<int>(footer.size()), MPI_UNSIGNED_CHAR, MPI_STATUS_IGNORE);
639 data_sizes[1] = footer.size();
642 }
643}
644#endif
645
659template <typename T>
661{
662 std::vector<std::string> m_interval_start_times_utc{
663 this->ini_file_data.getStringVectorParameters("interval_start_times_utc")};
664 std::vector<std::string> m_interval_end_times_utc{
665 this->ini_file_data.getStringVectorParameters("interval_end_times_utc")};
666 const std::string format = "%Y-%m-%dT%H:%M:%S";
667 std::tm tm_struct{}; // Always zero-initialize this type.
668 tm_struct.tm_isdst = -1;
669 std::istringstream sstream{};
670 std::time_t time_point{};
671
672 sstream.str(m_start_time_utc);
673 sstream >> std::get_time(&tm_struct, format.c_str());
674 time_point = std::mktime(&tm_struct);
675 m_start_time_seconds = static_cast<int64_t>(time_point);
676 if (sstream.fail())
677 {
678 std::cerr << "[OutputCsvTool]: Could not parse the start time stamp: " << m_start_time_utc
679 << "!\nPlease use the format YYYY-MM-DDThh:mm:ss\n";
680 throw std::runtime_error("[OutputCsvTool]: Could not parse the start time stamp: "
681 + m_start_time_utc
682 + "!\nPlease use the format YYYY-MM-DDThh:mm:ss\n");
683 }
684 sstream.clear();
685
686 for (int i{0}; i < m_interval_start_times_utc.size(); i++)
687 {
689 sstream >> std::get_time(&tm_struct, format.c_str());
690 time_point = std::mktime(&tm_struct);
691 m_interval_start_times_seconds.push_back(static_cast<int64_t>(time_point));
692 if (sstream.fail())
693 {
694 std::cerr << "[OutputCsvTool]: Could not parse the starting interval time stamp: "
696 << "!\nPlease use the format YYYY-MM-DDThh:mm:ss\n";
697 throw std::runtime_error(
698 "[OutputCsvTool]: Could not parse the starting interval time stamp: "
699 + m_interval_start_times_utc[i] + "!\nPlease use the format YYYY-MM-DDThh:mm:ss\n");
700 }
701 sstream.clear();
702 }
703
704 for (int i{0}; i < m_interval_end_times_utc.size(); i++)
705 {
707 sstream >> std::get_time(&tm_struct, format.c_str());
708 time_point = std::mktime(&tm_struct);
709 m_interval_end_times_seconds.push_back(static_cast<int64_t>(time_point));
710 if (sstream.fail())
711 {
712 std::cerr << "[OutputCsvTool]: Could not parse the starting interval time stamp: "
714 << "!\nPlease use the format YYYY-MM-DDThh:mm:ss\n";
715 throw std::runtime_error(
716 "[OutputCsvTool]: Could not parse the starting interval time stamp: "
717 + m_interval_end_times_utc[i] + "!\nPlease use the format YYYY-MM-DDThh:mm:ss\n");
718 }
719 sstream.clear();
720 }
721
722 // I do this test here and not in checkIntervalIntegrity to not have them sorted yet so I can
723 // give the utc time stamps back to the user.
724 for (int i{0}; i < m_interval_end_times_utc.size(); i++)
725 {
726 if (m_interval_start_times_seconds[i] > m_interval_end_times_seconds[i])
727 {
728 std::cerr << "[OutputCsvTool]: Starting time of interval "
729 << m_interval_start_times_utc[i] << " is after the end time of the interval "
731 << "! Please ensure that interval start time < interval end time.\n";
732 throw std::runtime_error(
733 "[OutputCsvTool]: Starting time of interval " + m_interval_start_times_utc[i]
734 + " is after the end time of the interval " + m_interval_end_times_utc[i]
735 + "! Please ensure that interval start time < interval end time.\n");
736 }
737
738 // I sort here, because I expect the user to give disjoint intervals. If I didn't and the
739 // user did not sort the intervals in ascending order themself, the code would lock up and
740 // might skip intervals, so sorting here should do what the user wants more often than not
741 // sorting.
742 std::sort(m_interval_start_times_seconds.begin(), m_interval_start_times_seconds.end());
743 std::sort(m_interval_end_times_seconds.begin(), m_interval_end_times_seconds.end());
744
745 _verifyIntervalIntegrity();
746 }
747}
748
760template <typename T>
762{
763 if (m_interval_start_times_seconds.size() != m_interval_end_times_seconds.size())
764 {
765 std::cerr << "[OutputCsvTool]: Start and end intervalls have different amount of time "
766 "stamps!\n";
767 throw std::runtime_error(
768 "[OutputCsvTool]: Start and end intervalls have different amount of time "
769 "stamps!\n");
770 }
771
773 double sim_end_time{m_start_time_seconds + m_time_max};
774 for (int i{0}; i < m_interval_start_times_seconds.size(); i++)
775 {
776 if (m_interval_start_times_seconds[i] > sim_end_time
777 || m_interval_end_times_seconds[i] < m_start_time_seconds)
778 {
780 }
781 }
782 if (intervals_out_of_range == m_interval_start_times_seconds.size())
783 {
784 std::cerr << "[OutputCsvTool]: None of the given intervals are within the simulation "
785 "time span! Please provide at least one valid interval.\n";
786 throw std::runtime_error(
787 "[OutputCsvTool]: None of the given intervals are within the simulation time span! "
788 "Please provide at least one valid interval.\n");
789 }
790 else if (intervals_out_of_range > 0)
791 {
792 std::cerr << "[OutputCsvTool]: " << intervals_out_of_range << " out of "
793 << m_interval_start_times_seconds.size()
794 << " intervals are outside of the simulation time span and will be ignored\n";
795 }
796}
797
805template <typename T>
807{
808 while (m_currentIndex < m_interval_start_times_seconds.size())
809 {
810 // If we are within an time interval, check if we are also within a time step interval and
811 // return true or false.
812 if (m_interval_start_times_seconds[m_currentIndex]
813 <= m_start_time_seconds + this->sim->time_step * m_time_delta
814 && m_interval_end_times_seconds[m_currentIndex]
815 >= m_start_time_seconds + this->sim->time_step * m_time_delta)
816 {
817 if (this->sim->time_step % this->ini_file_data.getIntParameters("interval") == 0)
818 {
819 return true;
820 }
821 else
822 {
823 return false;
824 }
825 }
826 // If we have passed an interval, go to the next one (don't return yet, for there might be
827 // multiple intervals out of the time span).
828 else if (m_interval_end_times_seconds[m_currentIndex]
829 < m_start_time_seconds + this->sim->time_step * m_time_delta)
830 {
831 m_currentIndex++;
832 }
833 // Otherwise, we are currently outside of an interval and return false.
834 else
835 {
836 return false;
837 }
838 }
839 // If the while loop exits, we have passed the final interval and can always return false.
840 return false;
841}
842
843template <typename T>
845
846#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:76
Saves specified simulation field data into CSV files.
Definition OutputCsvTool.h:53
bool output() override
Definition OutputCsvTool.h:308
bool preTimeStep() override
Definition OutputCsvTool.h:101
std::string_view getNameLocal() const override
Definition OutputCsvTool.h:115
bool postNonLinIter() override
Definition OutputCsvTool.h:102
bool init() override
Definition OutputCsvTool.h:225
static std::string getName()
Definition OutputCsvTool.h:114
bool exec(std::string_view param) override
Definition OutputCsvTool.h:199
bool setup(std::vector< std::shared_ptr< GenericSubmodule< T > > > all_submodules) override
Definition OutputCsvTool.h:142
OutputCsvTool(SimulationClassBase< T > *sim)
Definition OutputCsvTool.h:121
static std::shared_ptr< GenericManagingModule< T > > createMethode(SimulationClassBase< T > *sim)
Definition OutputCsvTool.h:110
std::vector< std::string > getChainInsertion() const override
Definition OutputCsvTool.h:105
bool postTimeStep() override
Definition OutputCsvTool.h:235