svFSIplus
Parameters.h
1 /* Copyright (c) Stanford University, The Regents of the University of California, and others.
2  *
3  * All Rights Reserved.
4  *
5  * See Copyright-SimVascular.txt for additional details.
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining
8  * a copy of this software and associated documentation files (the
9  * "Software"), to deal in the Software without restriction, including
10  * without limitation the rights to use, copy, modify, merge, publish,
11  * distribute, sublicense, and/or sell copies of the Software, and to
12  * permit persons to whom the Software is furnished to do so, subject
13  * to the following conditions:
14  *
15  * The above copyright notice and this permission notice shall be included
16  * in all copies or substantial portions of the Software.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
19  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
21  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
22  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 #ifndef PARAMETERS_H
32 #define PARAMETERS_H
33 
34 #include <any>
35 #include <functional>
36 #include <iostream>
37 #include <map>
38 #include <regex>
39 #include <set>
40 #include <sstream>
41 #include <string>
42 #include <tuple>
43 #include <variant>
44 #include <vector>
45 
46 #include "tinyxml2.h"
47 
48 template<typename T>
49 
50 /// @brief The Parameter class template is used to store a named
51 /// paramater and its scalar value as a basic type: bool, double,
52 /// int and string.
53 ///
54 /// The classes defined here are used to process svFSIplus simulation parameters read in
55 /// from an Extensible Markup Language (XML) format file. XML is a simple text-based format
56 /// for representing structured information.
57 ///
58 /// An XML document is formed as an element tree. The XML tree starts at a root element and
59 /// branches from the root to sub-elements. All elements can have sub-elements:
60 ///
61 /// \code{.cpp}
62 /// <svFSIFile>
63 /// <element>
64 /// <subelement>.....</subelement>
65 /// </element>
66 /// </svFSIFile>
67 /// \endcode
68 ///
69 /// The elements in the svFSIplus simulation file are represented by sections of
70 /// related parameters. Sub-elements are refered to as sub-sections.
71 ///
72 ///-----------------
73 /// Parameters class
74 ///-----------------
75 /// The Parameters class is the top level class. It contains objects used to store
76 /// parameters for the sections making up an XML simulation parameters file
77 ///
78 /// 1) General (GeneralSimulationParameters)
79 /// 2) Mesh (MeshParameters)
80 /// 3) Equation (EquationParameters)
81 /// 4) Projection (ProjectionParameters)
82 ///
83 /// Each object contains methods to parse the XML file for the parameters defined for it.
84 /// These section objects may also contain objects representing the sub-sections defined
85 /// for each section.
86 ///
87 ///-----------------
88 /// Section objects
89 ///-----------------
90 /// Each section object contains objects representing parameters. A parameter's name and value
91 /// is stored using either a Parameter and VectorParamater template objects. A parameter
92 /// value is stored as a basic type: bool, double, int and string.
93 ///
94 /// Parameter objects in a section class are named using the same XML element name with the 1st
95 /// character lower case.
96 ///
97 /// Example: GeneralSimulationParameters class
98 ///
99 /// \code{.cpp}
100 /// Parameter<bool> verbose; // <Verbose>
101 /// Parameter<double> spectral_radius_of_infinite_time_step; // <Spectral_radius_of_infinite_time_step>
102 /// Parameter<double> time_step_size; // <Time_step_size>
103 /// \endcode
104 ///
105 /// The name and default value for each parameter is defined in a section object's constructor.
106 ///
107 /// Parameter values are set using the set_values() method which contains calls to tinyxml2
108 /// to parse parameter values from an XML file.
109 ///
110 /// Each section object inherits from the ParameterLists class. This class provides methods to
111 /// store parameters in a map and process iterated over them for setting values and other operations.
113 {
114  public:
115  Parameter() {};
116 
117  Parameter(const std::string& name, T value, bool required, std::vector<T> range = {}) :
118  value_(value), name_(name), required_(required)
119  {
120  value_ = value;
121  range_ = range;
122  };
123 
124  std::string name() const { return name_; };
125  T value() const { return value_; };
126  T operator()() const { return value_; };
127  bool defined() const { return value_set_; };
128 
129  /// @brief Get the value of a parameter as a string.
130  std::string svalue()
131  {
132  std::ostringstream str_stream;
133  str_stream << value_;
134  return str_stream.str();
135  }
136 
137  friend std::ostream& operator << (std::ostream& out, const Parameter<T>& param)
138  {
139  out << param.value();
140  return out;
141  }
142 
143  /// @brief Set the parameter name and value, and if it is required.
144  void set(const std::string& name, bool required, T value) {
145  name_ = name;
146  required_ = required;
147  value_ = value;
148  }
149 
150  /// @brief Set the parameter value from a string.
151  void set(const std::string& str_value)
152  {
153  if (str_value == "") {
154  value_ = T{0};
155  }
156 
157  auto str = str_value;
158  std::string::iterator end_pos = std::remove(str.begin(), str.end(), ' ');
159  str.erase(end_pos, str.end());
160 
161  std::istringstream str_stream(str);
162  if (!(str_stream >> value_)) {
163  std::istringstream str_stream(str);
164  if (!(str_stream >> std::boolalpha >> value_)) {
165  throw std::runtime_error("Incorrect value '" + str + "' for '" + name_ + "'.");
166  }
167  }
168 
169  value_set_ = true;
170  }
171 
172  bool check_required_set()
173  {
174  if (!required_) {
175  return true;
176  }
177  return value_set_;
178  }
179 
180  T value_ = T{0};
181  std::string name_ = "";
182  bool required_ = false;
183  bool value_set_ = false;
184  std::vector<T> range_;
185 };
186 
187 /// @brief The VectorParameter class template is used to store a named
188 /// paramater and its vector of values as a basic type: bool, double,
189 /// int and string.
190 template<typename T>
192 {
193  public:
194  VectorParameter() {};
195 
196  VectorParameter(const std::string& name, const std::vector<T>& value, bool required, std::vector<T> range = {}) :
197  value_(value), name_(name), required_(required)
198  {
199  value_ = value;
200  range_ = range;
201  };
202 
203  std::string name() const { return name_; };
204  std::vector<T> value() const { return value_; };
205  bool defined() const { return value_set_; };
206  int size() const { return value_.size(); };
207 
208  std::vector<T> operator()() const { return value_; };
209  const double& operator[](const int i) const { return value_[i]; };
210 
211  /// @brief Get the string representation of the parameter value.
212  std::string svalue()
213  {
214  std::string str;
215 
216  if constexpr (std::is_same<T, std::string>::value) {
217  for (auto v : value_) {
218  str += " " + v + " ";
219  }
220  } else {
221  for (auto v : value_) {
222  str += " " + std::to_string(v);
223  }
224  }
225 
226  return str;
227  }
228 
229  friend std::ostream& operator << (std::ostream& out, const VectorParameter<T>& param)
230  {
231  for (int i = 0; i < param.size(); i++) {
232  out << param.value_[i];
233  }
234  return out;
235  }
236 
237  /// @brief Set the parameter name and value, and if it is required.
238  void set(const std::string& name, bool required, const std::vector<T>& value)
239  {
240  name_ = name;
241  required_ = required;
242  value_ = value;
243  }
244 
245  /// @brief Set the parameter value from a string.
246  void set(const std::string& str_value)
247  {
248  if (str_value == "") {
249  return;
250  }
251 
252  std::string error_msg = "Improper vector format '" + str_value + "' found in '" + name_ + "'." + " Vector format is: (x,y,z)";
253  std::regex sep("\\(|\\)|\\,");
254  auto str = std::regex_replace(str_value, sep, " ");
255 
256  if constexpr (std::is_same<T, std::string>::value) {
257  std::stringstream ssin(str);
258  std::string value;
259  while (ssin >> value) {
260  value_.push_back(value);
261  }
262  } else {
263  T value;
264  std::istringstream ssin(str);
265  while (ssin >> value) {
266  value_.push_back(value);
267  }
268  }
269  }
270 
271  bool check_required_set()
272  {
273  if (!required_) {
274  return true;
275  }
276  return value_set_;
277  }
278 
279  std::vector<T> value_;
280  std::string name_;
281  bool required_ = false;
282  bool value_set_ = false;
283  std::vector<T> range_;
284 };
285 
286 /// @brief Defines parameter name and value, and stores them in
287 /// maps for settng values from XML.
289 {
290  public:
291 
292  ParameterLists() { }
293 
294  void set_xml_element_name(const std::string& name)
295  {
296  xml_element_name = name;
297  }
298 
299  /// @brief Set the name, default value and the parameter required flag.
300  void set_parameter(const std::string& name, const bool value, bool required, Parameter<bool>& param)
301  {
302  param.set(name, required, value);
303  params_map[name] = &param;
304  }
305 
306  void set_parameter(const std::string& name, const double value, bool required, Parameter<double>& param)
307  {
308  param.set(name, required, value);
309  params_map[name] = &param;
310  }
311 
312  void set_parameter(const std::string& name, std::initializer_list<double> value, bool required, VectorParameter<double>& param)
313  {
314  param.set(name, required, value);
315  params_map[name] = &param;
316  }
317 
318  void set_parameter(const std::string& name, std::initializer_list<int> value, bool required, VectorParameter<int>& param)
319  {
320  param.set(name, required, value);
321  params_map[name] = &param;
322  }
323 
324  void set_parameter(const std::string& name, std::initializer_list<std::string> value, bool required,
326  {
327  param.set(name, required, value);
328  params_map[name] = &param;
329  }
330 
331  void set_parameter(const std::string& name, const int value, bool required, Parameter<int>& param, std::vector<int> range = {})
332  {
333  param.set(name, required, value);
334  params_map[name] = &param;
335  }
336 
337  void set_parameter(const std::string& name, const std::string& value, bool required, Parameter<std::string>& param)
338  {
339  param.set(name, required, value);
340  params_map[name] = &param;
341  }
342 
343  /// @brief Set the value of a paramter from a string.
344  void set_parameter_value(const std::string& name, const std::string& value)
345  {
346  if (params_map.count(name) == 0) {
347  throw std::runtime_error("Unknown " + xml_element_name + " XML element '" + name + "'.");
348  }
349 
350  std::visit([value](auto&& p) { p->set(value); }, params_map[name]);
351  }
352 
353  /// @brief Check if any required parameters have not been set.
355  {
356  bool unset_found = false;
357 
358  for (auto& [ key, param ] : params_map) {
359  if (std::visit([](auto&& p) {
360  return !p->check_required_set();
361  }, param)) {
362  throw std::runtime_error(xml_element_name + " XML element '" + key + "' has not been set.");
363  }
364  }
365  }
366 
367  /// @brief Get the defined parameters as a map of strings.
368  std::map<std::string,std::string> get_parameter_list()
369  {
370  std::map<std::string,std::string> params;
371 
372  for (auto& [ key, param ] : params_map) {
373  std::visit([&params](auto&& p) {
374  params[p->name()] = p->svalue();
375  }, param);
376  }
377 
378  return params;
379  }
380 
381  /// @brief Print the parameters.
383  {
384  for (auto& [ key, param ] : params_map) {
385  std::cout << key << ": ";
386  std::visit([](auto& p) {
387  std::cout << p->name_ << std::endl;
388  std::cout << p->svalue() << std::endl;
389  }, param);
390  }
391  }
392 
393  /// @brief Map used for storing parameters by name / Parameter template union.
394  std::map<std::string, std::variant<Parameter<bool>*, Parameter<double>*, Parameter<int>*,
397 
398  std::string xml_element_name = "";
399 };
400 
401 //////////////////////////////////////////////////////////
402 // ConstitutiveModelParameters //
403 //////////////////////////////////////////////////////////
404 
405 // The following classes are used to store parameters for
406 // various constitutive models.
407 
409 {
410  public:
412  bool defined() const { return value_set; };
413  void set_values(tinyxml2::XMLElement* con_model_params);
414  void print_parameters();
419  Parameter<double> mu0;
420  bool value_set = false;
421 };
422 
424 {
425  public:
427  bool defined() const { return value_set; };
428  void set_values(tinyxml2::XMLElement* con_model_params);
429  void print_parameters();
431  Parameter<double> bfs;
434  bool value_set = false;
435 };
436 
437 //---------------------
438 // HolzapfelParameters
439 //---------------------
441 {
442  public:
444  bool defined() const { return value_set; };
445  void set_values(tinyxml2::XMLElement* con_model_params);
446  void print_parameters();
447 
450  Parameter<double> a4f;
451  Parameter<double> b4f;
452  Parameter<double> a4s;
453  Parameter<double> b4s;
454  Parameter<double> afs;
455  Parameter<double> bfs;
457 
458  bool value_set = false;
459 };
460 
462 {
463  public:
465  bool defined() const { return value_set; };
466  void set_values(tinyxml2::XMLElement* con_model_params);
467  void print_parameters();
472  Parameter<double> kappa;
473  bool value_set = false;
474 };
475 
477 {
478  public:
480  bool defined() const { return value_set; };
481  void set_values(tinyxml2::XMLElement* con_model_params);
482  void print_parameters();
485  bool value_set = false;
486 };
487 
489 {
490  public:
492  void set_values(tinyxml2::XMLElement* modl_params);
493  void print_parameters();
494  bool value_set = false;
495 };
496 
498 {
499  public:
501  void set_values(tinyxml2::XMLElement* modl_params);
502  void print_parameters();
503  bool value_set = false;
504 };
505 
506 /// @brief The ConstitutiveModelParameters class store parameters
507 /// for various constitutive models.
509 {
510  public:
512  void print_parameters();
513  bool defined() const { return value_set; };
514  void set_values(tinyxml2::XMLElement* modl_params);
515  static const std::string xml_element_name_;
516 
517  // Model types supported.
518  static const std::string GUCCIONE_MODEL;
519  static const std::string HGO_MODEL;
520  static const std::string HOLZAPFEL_OGDEN_MODEL;
521  static const std::string HOLZAPFEL_OGDEN_MA_MODEL;
522  static const std::string LEE_SACKS;
523  static const std::string NEOHOOKEAN_MODEL;
524  static const std::string STVENANT_KIRCHHOFF_MODEL;
525  static const std::map<std::string, std::string> constitutive_model_types;
526 
527  // Constitutive model type.
529 
530  GuccioneParameters guccione;
531  HolzapfelParameters holzapfel;
532  HolzapfelGasserOgdenParameters holzapfel_gasser_ogden;
533  LeeSacksParameters lee_sacks;
534  MooneyRivlinParameters mooney_rivlin;
535  NeoHookeanParameters neo_hookean;
536  StVenantKirchhoffParameters stvenant_kirchhoff;
537 
538  bool value_set = false;
539 };
540 
541 /// @brief Couple to reduced-order models.
543 {
544  public:
546 
547  static const std::string xml_element_name_;
548 
549  bool defined() const { return value_set; };
550  void set_values(tinyxml2::XMLElement* xml_elem);
551  void print_parameters();
552 
553  // attribute.
555 
556  Parameter<std::string> file_name_for_0D_3D_communication;
557  Parameter<std::string> file_name_for_saving_unknowns;
558  Parameter<int> number_of_unknowns;
559  Parameter<int> number_of_user_defined_outputs;
560  Parameter<std::string> unknowns_initialization_file_path;
561 
562  Parameter<std::string> zerod_code_file_path;
563 
564  bool value_set = false;
565 };
566 
567 /// @brief Coupling to GenBC.
569 {
570  public:
572 
573  static const std::string xml_element_name_;
574 
575  bool defined() const { return value_set; };
576  void set_values(tinyxml2::XMLElement* xml_elem);
577 
578  // attributes.
580 
581  // String parameters.
582  Parameter<std::string> zerod_code_file_path;
583 
584  bool value_set = false;
585 };
586 
587 //-----------------------
588 // CoupleSvZeroDParameters
589 //-----------------------
590 // Coupling to svZeroD.
591 //
593 {
594  public:
596 
597  static const std::string xml_element_name_;
598 
599  bool defined() const { return value_set; };
600  void set_values(tinyxml2::XMLElement* xml_elem);
601 
602  // attributes.
604 
605  bool value_set = false;
606 };
607 /// @brief Body force over a mesh using the "Add_BF" command.
608 ///
609 /// \code {.xml}
610 /// <Add_BF mesh="msh" >
611 /// <Type> volumetric </Type>
612 /// <Time_dependence> general </Time_dependence>
613 /// <Temporal_and_spatial_values_file_path> bforce.dat </Temporal_and_spatial_values_file_path>
614 /// </Add_BF>
615 /// \endcode
617 {
618  public:
620  void print_parameters();
621  void set_values(tinyxml2::XMLElement* xml_elem);
622  static const std::string xml_element_name_;
623 
624  // Attributes.
625  Parameter<std::string> mesh_name;
626 
627  // Boolean parameters.
628  Parameter<bool> ramp_function;
629 
630  // Double parameters.
631  Parameter<double> value;
632 
633  // String parameters.
634  Parameter<std::string> fourier_coefficients_file_path;
635  Parameter<std::string> spatial_values_file_path;
636  Parameter<std::string> temporal_and_spatial_values_file_path;
637  Parameter<std::string> temporal_values_file_path;
638  Parameter<std::string> time_dependence;
640 };
641 
642 /// @brief RCR values for Neumann BC type.
643 ///
644 /// \code {.xml}
645 /// <RCR_values>
646 /// <Proximal_resistance> 121.0 </Proximal_resistance>
647 /// <Capacitance> 1.5e-5 </Capacitance>
648 /// <Distal_resistance> 1212.0 </Distal_resistance>
649 /// </RCR_values>
650 /// \endcode
652 {
653  public:
655 
656  static const std::string xml_element_name_;
657 
658  void set_values(tinyxml2::XMLElement* xml_elem);
659  void print_parameters();
660 
661  Parameter<double> capacitance;
662  Parameter<double> distal_pressure;
663  Parameter<double> distal_resistance;
664  Parameter<double> initial_pressure;
665  Parameter<double> proximal_resistance;
666 
667  bool value_set = false;
668 };
669 
670 /// @brief The BoundaryConditionParameters stores paramaters for various
671 /// type of boundary conditions under the Add_BC XML element.
673 {
674  public:
676  void print_parameters();
677  void set_values(tinyxml2::XMLElement* bc_params);
678  static const std::string xml_element_name_;
679 
680  // RCR parameters sub-element.
682 
683  // Add_BC name= attribute.
685 
686  // Add_BC XML elements.
687  //
688  Parameter<bool> apply_along_normal_direction;
689  Parameter<std::string> bct_file_path;
690 
691  Parameter<double> damping;
692  Parameter<double> distal_pressure;
693  VectorParameter<int> effective_direction;
694  Parameter<bool> follower_pressure_load;
695  Parameter<std::string> fourier_coefficients_file_path;
696 
697  Parameter<bool> impose_flux;
698  Parameter<bool> impose_on_state_variable_integral;
699  Parameter<std::string> initial_displacements_file_path;
700 
701  Parameter<double> penalty_parameter;
702  Parameter<double> penalty_parameter_normal;
703  Parameter<double> penalty_parameter_tangential;
704  Parameter<std::string> prestress_file_path;
705  Parameter<std::string> profile;
706  Parameter<bool> ramp_function;
707 
708  Parameter<std::string> cst_shell_bc_type;
709  Parameter<std::string> spatial_profile_file_path;
710  Parameter<std::string> spatial_values_file_path;
711  Parameter<double> stiffness;
712 
713  Parameter<std::string> temporal_and_spatial_values_file_path;
714  Parameter<std::string> temporal_values_file_path;
715  Parameter<std::string> time_dependence;
716  Parameter<std::string> traction_values_file_path;
717  Parameter<double> traction_multiplier;
719 
720  Parameter<bool> undeforming_neu_face;
721  Parameter<double> value;
722  Parameter<bool> weakly_applied;
723  Parameter<bool> zero_out_perimeter;
724 };
725 
726 /// @brief The OutputParameters class stores parameters for the
727 /// Output XML element under Add_equation.
728 ///
729 /// \code {.xml}
730 /// <Output type="Volume_integral" >
731 /// <Temperature> true </Temperature>
732 /// </Output>
733 /// \endcode
735 {
736  public:
738 
739  static const std::string xml_element_name_;
740 
741  void print_parameters();
742  void set_values(tinyxml2::XMLElement* xml_elem);
743  bool get_output_value(const std::string& name);
744  std::string get_alias_value(const std::string& name);
745 
747 
748  // List of output names.
749  std::vector<Parameter<bool>> output_list;
750 
751  // List of alias output names.
752  std::vector<Parameter<std::string>> alias_list;
753 };
754 
755 /// @brief The ProjectionParameters class stores parameters for the
756 /// 'Add_projection' XML element used for fluid-structure interaction
757 /// simulations.
758 /// \code {.xml}
759 /// <Add_projection name="wall_inner" >
760 /// <Project_from_face> lumen_wall </Project_from_face>
761 /// </Add_projection>
762 /// \endcode
764 {
765  public:
767 
768  void set_values(tinyxml2::XMLElement* xml_elem);
769 
770  static const std::string xml_element_name_;
771 
773 
774  Parameter<std::string> project_from_face;
775  Parameter<double> projection_tolerance;
776 };
777 
778 /// @brief The VariableWallPropsParameters class stores parameters for
779 /// variable wall properties for the CMM equation.
781 {
782  public:
784  static const std::string xml_element_name_;
785  bool defined() const { return value_set; };
786  void set_values(tinyxml2::XMLElement* xml_elemnt);
787 
788  Parameter<std::string> mesh_name;
789  Parameter<std::string> wall_properties_file_path;
790  bool value_set = false;
791 };
792 
793 
794 //////////////////////////////////////////////////////////
795 // FluidViscosity //
796 //////////////////////////////////////////////////////////
797 
798 // The following classes are used to store parameters for
799 // various fluid viscosity models.
800 
802 {
803  public:
805  void print_parameters();
806  void set_values(tinyxml2::XMLElement* equation_params);
807  Parameter<double> constant_value;
808 };
809 
811 {
812  public:
814  void print_parameters();
815  void set_values(tinyxml2::XMLElement* xml_elem);
816 
817  Parameter<double> limiting_high_shear_rate_viscosity;
818  Parameter<double> limiting_low_shear_rate_viscosity;
819  Parameter<double> power_law_index;
820  Parameter<double> shear_rate_tensor_multipler;
821  Parameter<double> shear_rate_tensor_exponent;
822 };
823 
825 {
826  public:
828  void print_parameters();
829  void set_values(tinyxml2::XMLElement* xml_elem);
830  Parameter<double> asymptotic_viscosity;
831  Parameter<double> yield_stress;
832  Parameter<double> low_shear_rate_threshold;
833 };
834 
836 {
837  public:
839 
840  static const std::string xml_element_name_;
841 
842  static const std::string CONSTANT_MODEL;
843  static const std::string CARREAU_YASUDA_MODEL;
844  static const std::string CASSONS_MODEL;
845  static const std::set<std::string> model_names;
846 
847  void print_parameters();
848  void set_values(tinyxml2::XMLElement* xml_elem);
849 
851 
852  FluidViscosityNewtonianParameters newtonian_model;
853  FluidViscosityCarreauYasudaParameters carreau_yasuda_model;
854  FluidViscosityCassonsParameters cassons_model;
855 };
856 
857 //////////////////////////////////////////////////////////
858 // SolidViscosity //
859 //////////////////////////////////////////////////////////
860 
861 // The following classes are used to store parameters for
862 // various solid viscosity models.
863 
865 {
866  public:
868  void print_parameters();
869  void set_values(tinyxml2::XMLElement* equation_params);
870  Parameter<double> constant_value;
871 };
872 
874 {
875  public:
877  void print_parameters();
878  void set_values(tinyxml2::XMLElement* equation_params);
879  Parameter<double> constant_value;
880 };
881 
883 {
884  public:
886 
887  static const std::string xml_element_name_;
888 
889  static const std::string NEWTONIAN_MODEL;
890  static const std::string POTENTIAL_MODEL;
891  static const std::set<std::string> model_names;
892 
893  void print_parameters();
894  void set_values(tinyxml2::XMLElement* xml_elem);
895 
897 
898  SolidViscosityNewtonianParameters newtonian_model;
899  SolidViscosityPotentialParameters potential_model;
900 };
901 
902 
903 /// @brief The LinearAlgebraParameters class stores parameters for
904 /// the 'Linear_algebra' XML element.
906 {
907  public:
908  static const std::string xml_element_name_;
910  void check_input_parameters();
911  void print_parameters();
912  void set_values(tinyxml2::XMLElement* fsi_file);
913  bool defined() const { return values_set_; };
914 
915  bool values_set_ = false;
917 
918  Parameter<std::string> assembly;
919  Parameter<std::string> configuration_file;
920  Parameter<std::string> preconditioner;
921 };
922 
923 /// @brief The LinearSolverParameters class stores parameters for
924 /// the 'LS' XML element.
926 {
927  public:
929 
930  void print_parameters();
931  void set_values(tinyxml2::XMLElement* fsi_file);
932 
933  static const std::string xml_element_name_;
934 
936 
937  Parameter<double> absolute_tolerance;
938  Parameter<int> krylov_space_dimension;
939 
940  Parameter<int> max_iterations;
941  Parameter<int> ns_cg_max_iterations;
942  Parameter<double> ns_cg_tolerance;
943  Parameter<int> ns_gm_max_iterations;
944  Parameter<double> ns_gm_tolerance;
945 
946  //Parameter<std::string> preconditioner;
947 
948  Parameter<double> tolerance;
949 
950  LinearAlgebraParameters linear_algebra;
951 };
952 
953 /// @brief The StimulusParameters class stores parameters for
954 /// 'Stimulus' XML element used to parameters for
955 /// pacemaker cells.
956 ///
957 /// \code {.xml}
958 /// <Stimulus type="Istim" >
959 /// <Amplitude> -52.0 </Amplitude>
960 /// <Start_time> 0.0 </Start_time>
961 /// <Duration> 1.0 </Duration>
962 /// <Cycle_length> 10000.0 </Cycle_length>
963 /// </Stimulus>
964 /// \endcode
966 {
967  public:
969 
970  static const std::string xml_element_name_;
971 
972  bool defined() const { return value_set; };
973  void print_parameters();
974  void set_values(tinyxml2::XMLElement* xml_elem);
975 
977 
978  Parameter<double> amplitude;
979  Parameter<double> cycle_length;
980  Parameter<double> duration;
981  Parameter<double> start_time;
982 
983  bool value_set = false;
984 };
985 
987 {
988  public:
990 
991  static const std::string xml_element_name_;
992 
993  bool defined() const { return value_set; };
994  void print_parameters();
995  void set_values(tinyxml2::XMLElement* xml_elem);
996 
997  Parameter<std::string> x_coords_file_path;
998  Parameter<std::string> y_coords_file_path;
999  Parameter<std::string> z_coords_file_path;
1000 
1001  bool value_set = false;
1002 };
1003 
1004 /// @brief The FiberReinforcementStressParameters class stores fiber
1005 /// reinforcement stress parameters for the 'Fiber_reinforcement_stress`
1006 /// XML element.
1007 ///
1008 /// \code {.xml}
1009 /// <Fiber_reinforcement_stress type="Unsteady" >
1010 /// <Temporal_values_file_path> fib_stress.dat </Temporal_values_file_path>
1011 /// <Ramp_function> true </Ramp_function>
1012 /// </Fiber_reinforcement_stress>
1013 /// \endcode
1015 {
1016  public:
1018 
1019  static const std::string xml_element_name_;
1020 
1021  bool defined() const { return value_set; };
1022  void print_parameters();
1023  void set_values(tinyxml2::XMLElement* xml_elem);
1024 
1026 
1027  Parameter<bool> ramp_function;
1028  Parameter<std::string> temporal_values_file_path;
1029  Parameter<double> value;
1030 
1031  bool value_set = false;
1032 };
1033 
1034 /// @brief The DomainParameters class stores parameters for the XML
1035 /// 'Domain' element to specify properties for solving equations.
1036 ///
1037 /// \code {.xml}
1038 /// <Domain id="1" >
1039 /// <Equation> fluid </Equation>
1040 /// <Density> 1.06 </Density>
1041 /// <Viscosity model="Constant" >
1042 /// <Value> 0.04 </Value>
1043 /// </Viscosity>
1044 /// <Backflow_stabilization_coefficient> 0.2 </Backflow_stabilization_coefficient>
1045 /// </Domain>
1046 /// \endcode
1048 {
1049  public:
1050  DomainParameters();
1051 
1052  static const std::string xml_element_name_;
1053 
1054  void print_parameters();
1055  void set_values(tinyxml2::XMLElement* xml_elem);
1056 
1057  // Parameters for sub-elements under the Domain element.
1058  ConstitutiveModelParameters constitutive_model;
1059  FiberReinforcementStressParameters fiber_reinforcement_stress;
1060  StimulusParameters stimulus;
1061  FluidViscosityParameters fluid_viscosity;
1062  SolidViscosityParameters solid_viscosity;
1063 
1064  // Attributes.
1066 
1067  Parameter<double> absolute_tolerance;
1068  VectorParameter<double> anisotropic_conductivity;
1069  Parameter<double> backflow_stabilization_coefficient;
1070 
1071  Parameter<double> conductivity;
1072  //Parameter<std::string> constitutive_model_name;
1073  Parameter<double> continuity_stabilization_coefficient;
1074 
1075  Parameter<double> density;
1076  Parameter<std::string> dilational_penalty_model;
1077 
1078  Parameter<std::string> equation;
1079  Parameter<double> elasticity_modulus;
1080  Parameter<std::string> electrophysiology_model;
1081 
1082  Parameter<double> feedback_parameter_for_stretch_activated_currents;
1083  Parameter<double> fluid_density;
1084  Parameter<double> force_x;
1085  Parameter<double> force_y;
1086  Parameter<double> force_z;
1087 
1088  Parameter<double> isotropic_conductivity;
1089 
1090  Parameter<double> mass_damping;
1091  Parameter<int> maximum_iterations;
1092  Parameter<double> momentum_stabilization_coefficient;
1093  Parameter<std::string> myocardial_zone;
1094 
1095  Parameter<double> G_Na;
1096  Parameter<double> G_CaL;
1097  Parameter<double> G_Kr;
1098  Parameter<double> G_Ks;
1099  Parameter<double> G_to;
1100 
1101  Parameter<double> tau_fi;
1102  Parameter<double> tau_si;
1103 
1104  Parameter<std::string> ode_solver;
1105  Parameter<double> penalty_parameter;
1106  Parameter<double> poisson_ratio;
1107  Parameter<double> relative_tolerance;
1108 
1109  Parameter<double> shell_thickness;
1110  Parameter<double> solid_density;
1111  Parameter<double> source_term;
1112  Parameter<double> time_step_for_integration;
1113 
1114  // Inverse of Darcy permeability. Default value of 0.0 for Navier-Stokes and non-zero for Navier-Stokes-Brinkman
1115  Parameter<double> inverse_darcy_permeability;
1116 };
1117 
1118 /// @brief The RemesherParameters class stores parameters for the
1119 /// 'Remesher' XML element used for remeshing.
1120 ///
1121 /// \code {.xml}
1122 /// <Remesher type="Tetgen" >
1123 /// <Max_edge_size name="lumen" value="0.7"> </Max_edge_size>
1124 /// <Max_edge_size name="wall" value="0.5"> </Max_edge_size>
1125 /// <Min_dihedral_angle> 10.0 </Min_dihedral_angle>
1126 /// <Max_radius_ratio> 1.1 </Max_radius_ratio>
1127 /// <Remesh_frequency> 1000 </Remesh_frequency>
1128 /// <Frequency_for_copying_data> 1 </Frequency_for_copying_data>
1129 /// </Remesher>
1130 /// \endcode
1132 {
1133  public:
1135 
1136  static const std::string xml_element_name_;
1137  bool values_set_ = false;
1138 
1139  bool defined() const { return values_set_; };
1140  void print_parameters();
1141  double get_edge_size(const std::string& name) const { return max_edge_sizes_.at(name); }
1142  bool has_edge_size(const std::string& name) const { return max_edge_sizes_.count(name) == 1; }
1143  void set_values(tinyxml2::XMLElement* mesh_elem);
1144 
1145  // Values given in the 'Max_edge_size' element.
1146  std::map<std::string, double> max_edge_sizes_;
1147 
1149  Parameter<double> min_dihedral_angle;
1150  Parameter<double> max_radius_ratio;
1151  Parameter<int> remesh_frequency;
1152  Parameter<int> frequency_for_copying_data;
1153 };
1154 
1155 /// @brief The ContactParameters class stores parameters for the 'Contact''
1156 /// XML element used to specify parameter values for contact
1157 /// computations.
1159 {
1160  public:
1162 
1163  static const std::string xml_element_name_;
1164 
1165  void print_parameters();
1166  void set_values(tinyxml2::XMLElement* xml_elem);
1167 
1168  Parameter<double> closest_gap_to_activate_penalty;
1169 
1170  Parameter<double> desired_separation;
1171 
1172  Parameter<double> min_norm_of_face_normals;
1173 
1174  Parameter<std::string> model;
1175 
1176  Parameter<double> penalty_constant;
1177 };
1178 
1179 /// @brief The EquationParameters class stores parameters for the 'Add_equation'
1180 /// XML element used to specify an equation to be solved (e.g. fluid).
1181 ///
1182 /// \code {.xml}
1183 /// <Add_equation type="FSI" >
1184 /// <Coupled> true </Coupled>
1185 /// <Min_iterations> 1 </Min_iterations>
1186 /// <Max_iterations> 1 </Max_iterations>
1187 /// .
1188 /// .
1189 /// .
1190 /// </Add_equation>
1191 /// \endcode
1193 {
1194  public:
1196 
1197  static const std::string xml_element_name_;
1198 
1199  void print_parameters();
1200  void set_values(tinyxml2::XMLElement* xml_elem);
1201 
1202  Parameter<double> backflow_stabilization_coefficient;
1203 
1204  Parameter<double> conductivity;
1205  Parameter<double> continuity_stabilization_coefficient;
1206  Parameter<bool> coupled;
1207 
1208  Parameter<double> density;
1209  Parameter<std::string> dilational_penalty_model;
1210 
1211  Parameter<double> elasticity_modulus;
1212 
1213  Parameter<std::string> initialize;
1214  Parameter<bool> initialize_rcr_from_flow;
1215 
1216  Parameter<int> max_iterations;
1217  Parameter<int> min_iterations;
1218  Parameter<double> momentum_stabilization_coefficient;
1219 
1220  Parameter<double> penalty_parameter;
1221  Parameter<double> poisson_ratio;
1222  Parameter<bool> prestress;
1223 
1224  Parameter<double> source_term;
1225  Parameter<double> tolerance;
1226 
1228  Parameter<bool> use_taylor_hood_type_basis;
1229 
1230  // Inverse of Darcy permeability. Default value of 0.0 for Navier-Stokes and non-zero for Navier-Stokes-Brinkman
1231  Parameter<double> inverse_darcy_permeability;
1232 
1233  // Sub-element parameters.
1234  //
1235  std::vector<BodyForceParameters*> body_forces;
1236 
1237  std::vector<BoundaryConditionParameters*> boundary_conditions;
1238 
1239  CoupleCplBCParameters couple_to_cplBC;
1240  CoupleGenBCParameters couple_to_genBC;
1241  CoupleSvZeroDParameters couple_to_svZeroD;
1242 
1243  DomainParameters* default_domain = nullptr;
1244 
1245  std::vector<DomainParameters*> domains;
1246 
1247  LinearSolverParameters linear_solver;
1248 
1249  std::vector<OutputParameters*> outputs;
1250 
1251  RemesherParameters remesher;
1252 
1253  VariableWallPropsParameters variable_wall_properties;
1254 
1255  FluidViscosityParameters fluid_viscosity;
1256 
1257  SolidViscosityParameters solid_viscosity;
1258 
1259  ECGLeadsParameters ecg_leads;
1260 };
1261 
1262 /// @brief The GeneralSimulationParameters class stores paramaters for the
1263 /// 'GeneralSimulationParameters' XML element.
1264 ///
1265 /// \code {.xml}
1266 /// <GeneralSimulationParameters>
1267 /// <Continue_previous_simulation> 0 </Continue_previous_simulation>
1268 /// <Number_of_spatial_dimensions> 3 </Number_of_spatial_dimensions>
1269 /// <Number_of_time_steps> 1 </Number_of_time_steps>
1270 /// <Time_step_size> 1e-4 </Time_step_size>
1271 /// <Spectral_radius_of_infinite_time_step> 0.50 </Spectral_radius_of_infinite_time_step>
1272 /// <Searched_file_name_to_trigger_stop> STOP_SIM </Searched_file_name_to_trigger_stop>
1273 /// <Save_results_to_VTK_format> true </Save_results_to_VTK_format>
1274 /// <Name_prefix_of_saved_VTK_files> result </Name_prefix_of_saved_VTK_files>
1275 /// <Increment_in_saving_VTK_files> 1 </Increment_in_saving_VTK_files>
1276 /// <Start_saving_after_time_step> 1 </Start_saving_after_time_step>
1277 /// <Increment_in_saving_restart_files> 1 </Increment_in_saving_restart_files>
1278 /// <Convert_BIN_to_VTK_format> 0 </Convert_BIN_to_VTK_format>
1279 /// <Verbose> 1 </Verbose>
1280 /// <Warning> 0 </Warning>
1281 /// <Debug> 0 </Debug>
1282 /// <Simulation_requires_remeshing> true </Simulation_requires_remeshing>
1283 /// </GeneralSimulationParameters>
1284 /// \endcode
1286 {
1287  public:
1289 
1290  void print_parameters();
1291  void set_values(tinyxml2::XMLElement* xml_element);
1292 
1293  std::string xml_element_name;
1294 
1295  Parameter<bool> check_ien_order;
1296  Parameter<bool> continue_previous_simulation;
1297  Parameter<bool> convert_bin_to_vtk_format;
1298  Parameter<bool> debug;
1299  Parameter<bool> overwrite_restart_file;
1300  Parameter<bool> save_averaged_results;
1301  Parameter<bool> save_results_to_vtk_format;
1302  Parameter<bool> simulation_requires_remeshing;
1303  Parameter<bool> start_averaging_from_zero;
1304  Parameter<bool> verbose;
1305  Parameter<bool> warning;
1306  Parameter<bool> use_precomputed_solution;
1307 
1308  Parameter<double> spectral_radius_of_infinite_time_step;
1309  Parameter<double> time_step_size;
1310  Parameter<double> precomputed_time_step_size;
1311 
1312  Parameter<int> increment_in_saving_restart_files;
1313  Parameter<int> increment_in_saving_vtk_files;
1314  Parameter<int> number_of_spatial_dimensions;
1315  Parameter<int> number_of_initialization_time_steps;
1316  Parameter<int> start_saving_after_time_step;
1317  Parameter<int> starting_time_step;
1318  Parameter<int> number_of_time_steps;
1319 
1320  Parameter<std::string> name_prefix_of_saved_vtk_files;
1321  Parameter<std::string> restart_file_name;
1322  Parameter<std::string> searched_file_name_to_trigger_stop;
1323  Parameter<std::string> save_results_in_folder;
1324  Parameter<std::string> simulation_initialization_file_path;
1325  Parameter<std::string> precomputed_solution_file_path;
1326  Parameter<std::string> precomputed_solution_field_name;
1327 };
1328 
1329 /// @brief The FaceParameters class is used to store parameters for the
1330 /// 'Add_face' XML element.
1332 {
1333  public:
1334  FaceParameters();
1335 
1336  void print_parameters();
1337  void set_values(tinyxml2::XMLElement* xml_elem);
1338 
1339  static const std::string xml_element_name_;
1340 
1341  Parameter<std::string> end_nodes_face_file_path;
1342  Parameter<std::string> face_file_path;
1344 
1345  Parameter<double> quadrature_modifier_TRI3;
1346 };
1347 
1348 /// @brief The MeshParameters class is used to store paramaters for the
1349 /// 'Add_mesh' XML element.
1350 ///
1351 /// \code {.xml}
1352 /// <Add_mesh name="lumen" >
1353 /// <Mesh_file_path> mesh/lumen/mesh-complete.mesh.vtu </Mesh_file_path>
1354 ///
1355 /// <Add_face name="lumen_inlet">
1356 /// <Face_file_path> mesh/lumen/mesh-surfaces/lumen_inlet.vtp </Face_file_path>
1357 /// </Add_face>
1358 ///
1359 /// <Add_face name="lumen_outlet">
1360 /// <Face_file_path> mesh/lumen/mesh-surfaces/lumen_outlet.vtp </Face_file_path>
1361 /// </Add_face>
1362 ///
1363 /// <Add_face name="lumen_wall">
1364 /// <Face_file_path> mesh/lumen/mesh-surfaces/lumen_wall.vtp </Face_file_path>
1365 /// </Add_face>
1366 ///
1367 /// <Domain> 0 </Domain>
1368 ///
1369 /// </Add_mesh>
1370 /// \endcode
1372 {
1373  public:
1374  MeshParameters();
1375 
1376  static const std::string xml_element_name_;
1377 
1378  void print_parameters();
1379  void set_values(tinyxml2::XMLElement* mesh_elem);
1380  std::string get_name() const { return name.value(); };
1381  std::string get_path() const { return mesh_file_path.value(); };
1382 
1383  std::vector<FaceParameters*> face_parameters;
1384 
1385  // Add_mesh name=
1387 
1388  // Parameters under Add_mesh
1389  //
1390  Parameter<int> domain_id;
1391  Parameter<std::string> domain_file_path;
1392 
1393  VectorParameter<std::string> fiber_direction_file_paths;
1394  //Parameter<std::string> fiber_direction_file_path;
1395  std::vector<VectorParameter<double>> fiber_directions;
1396  //VectorParameter<double> fiber_direction;
1397 
1398  Parameter<std::string> initial_displacements_file_path;
1399  Parameter<std::string> initial_pressures_file_path;
1400  Parameter<bool> initialize_rcr_from_flow;
1401  Parameter<std::string> initial_velocities_file_path;
1402 
1403  Parameter<std::string> mesh_file_path;
1404  Parameter<double> mesh_scale_factor;
1405  Parameter<std::string> prestress_file_path;
1406 
1407  Parameter<bool> set_mesh_as_fibers;
1408  Parameter<bool> set_mesh_as_shell;
1409 
1410  Parameter<double> quadrature_modifier_TET4;
1411 };
1412 
1413 /// @brief The Parameters class stores parameter values read in from a solver input file.
1414 class Parameters {
1415 
1416  public:
1417  Parameters();
1418 
1419  static const std::set<std::string> constitutive_model_names;
1420  static const std::set<std::string> equation_names;
1421  static const std::string FSI_FILE;
1422 
1423  void get_logging_levels(int& verbose, int& warning, int& debug);
1424  void print_parameters();
1425  void read_xml(std::string file_name);
1426 
1427  void set_contact_values(tinyxml2::XMLElement* root_element);
1428  void set_equation_values(tinyxml2::XMLElement* root_element);
1429  void set_mesh_values(tinyxml2::XMLElement* root_element);
1430  void set_projection_values(tinyxml2::XMLElement* root_element);
1431 
1432  // Objects representing each parameter section of XML file.
1433  ContactParameters contact_parameters;
1434  GeneralSimulationParameters general_simulation_parameters;
1435  std::vector<MeshParameters*> mesh_parameters;
1436  std::vector<EquationParameters*> equation_parameters;
1437  std::vector<ProjectionParameters*> projection_parameters;
1438 };
1439 
1440 #endif
1441 
Body force over a mesh using the "Add_BF" command.
Definition: Parameters.h:617
static const std::string xml_element_name_
Define the XML element name for boundary condition parameters.
Definition: Parameters.h:622
The BoundaryConditionParameters stores paramaters for various type of boundary conditions under the A...
Definition: Parameters.h:673
static const std::string xml_element_name_
Define the XML element name for equation boundary condition parameters.
Definition: Parameters.h:678
RCR values for Neumann BC type.
Definition: Parameters.h:652
BoundaryConditionRCRParameters()
RCR values for Neumann BC type.
Definition: Parameters.cpp:315
The ConstitutiveModelParameters class store parameters for various constitutive models.
Definition: Parameters.h:509
static const std::map< std::string, std::string > constitutive_model_types
Supported constitutive model types and their aliases.
Definition: Parameters.h:525
static const std::string xml_element_name_
Process parameters for various constitutive models.
Definition: Parameters.h:515
The ContactParameters class stores parameters for the 'Contact'' XML element used to specify paramete...
Definition: Parameters.h:1159
static const std::string xml_element_name_
Process parameters for the 'Contact' XML element used to specify parameters for contact computation.
Definition: Parameters.h:1163
Couple to reduced-order models.
Definition: Parameters.h:543
static const std::string xml_element_name_
Couple to reduced-order models.
Definition: Parameters.h:547
Coupling to GenBC.
Definition: Parameters.h:569
static const std::string xml_element_name_
Coupling to GenBC.
Definition: Parameters.h:573
Definition: Parameters.h:593
The DomainParameters class stores parameters for the XML 'Domain' element to specify properties for s...
Definition: Parameters.h:1048
static const std::string xml_element_name_
Define the XML element name for domain parameters.
Definition: Parameters.h:1052
Definition: Parameters.h:987
static const std::string xml_element_name_
Define the XML element name for ECG leads parameters.
Definition: Parameters.h:991
The EquationParameters class stores parameters for the 'Add_equation' XML element used to specify an ...
Definition: Parameters.h:1193
static const std::string xml_element_name_
Define the XML element name for equation parameters.
Definition: Parameters.h:1197
The FaceParameters class is used to store parameters for the 'Add_face' XML element.
Definition: Parameters.h:1332
static const std::string xml_element_name_
Process parameters for the 'Add_face' XML element.
Definition: Parameters.h:1339
The FiberReinforcementStressParameters class stores fiber reinforcement stress parameters for the 'Fi...
Definition: Parameters.h:1015
static const std::string xml_element_name_
Define the XML element name for fiber reinforcement stress parameters.
Definition: Parameters.h:1019
Definition: Parameters.h:811
Definition: Parameters.h:825
Definition: Parameters.h:802
Definition: Parameters.h:836
static const std::string xml_element_name_
Process parameters for various fluid viscosity models.
Definition: Parameters.h:840
The GeneralSimulationParameters class stores paramaters for the 'GeneralSimulationParameters' XML ele...
Definition: Parameters.h:1286
GeneralSimulationParameters()
Process paramaters for the 'GeneralSimulationParameters' XML element.
Definition: Parameters.cpp:1966
void set_values(tinyxml2::XMLElement *xml_element)
Set general parameters values from XML.
Definition: Parameters.cpp:2029
Definition: Parameters.h:424
Definition: Parameters.h:462
Definition: Parameters.h:441
Definition: Parameters.h:409
The LinearAlgebraParameters class stores parameters for the 'Linear_algebra' XML element.
Definition: Parameters.h:906
void check_input_parameters()
Check the validity of the input parameters.
Definition: Parameters.cpp:2438
static const std::string xml_element_name_
Define the XML element name for equation output parameters.
Definition: Parameters.h:908
The LinearSolverParameters class stores parameters for the 'LS' XML element.
Definition: Parameters.h:926
static const std::string xml_element_name_
Define the XML element name for equation output parameters.
Definition: Parameters.h:933
The MeshParameters class is used to store paramaters for the 'Add_mesh' XML element.
Definition: Parameters.h:1372
static const std::string xml_element_name_
Define the XML element name for mesh parameters.
Definition: Parameters.h:1376
Definition: Parameters.h:477
Definition: Parameters.h:489
NeoHookeanParameters()
There are no parameters associated with a Neohookean model.
Definition: Parameters.cpp:710
The OutputParameters class stores parameters for the Output XML element under Add_equation.
Definition: Parameters.h:735
std::string get_alias_value(const std::string &name)
Get the value of an alias by name.
Definition: Parameters.cpp:1009
bool get_output_value(const std::string &name)
Get the value of an output by name.
Definition: Parameters.cpp:1021
static const std::string xml_element_name_
Define the XML element name for equation output parameters.
Definition: Parameters.h:739
The Parameter class template is used to store a named paramater and its scalar value as a basic type:...
Definition: Parameters.h:113
void set(const std::string &name, bool required, T value)
Set the parameter name and value, and if it is required.
Definition: Parameters.h:144
void set(const std::string &str_value)
Set the parameter value from a string.
Definition: Parameters.h:151
std::string svalue()
Get the value of a parameter as a string.
Definition: Parameters.h:130
Defines parameter name and value, and stores them in maps for settng values from XML.
Definition: Parameters.h:289
void check_required()
Check if any required parameters have not been set.
Definition: Parameters.h:354
void set_parameter(const std::string &name, const bool value, bool required, Parameter< bool > &param)
Set the name, default value and the parameter required flag.
Definition: Parameters.h:300
void set_parameter_value(const std::string &name, const std::string &value)
Set the value of a paramter from a string.
Definition: Parameters.h:344
std::map< std::string, std::variant< Parameter< bool > *, Parameter< double > *, Parameter< int > *, Parameter< std::string > *, VectorParameter< double > *, VectorParameter< int > *, VectorParameter< std::string > * > > params_map
Map used for storing parameters by name / Parameter template union.
Definition: Parameters.h:396
std::map< std::string, std::string > get_parameter_list()
Get the defined parameters as a map of strings.
Definition: Parameters.h:368
void print_parameter_list()
Print the parameters.
Definition: Parameters.h:382
The Parameters class stores parameter values read in from a solver input file.
Definition: Parameters.h:1414
void read_xml(std::string file_name)
Set the simulation parameter values given in an XML format file.
Definition: Parameters.cpp:147
The ProjectionParameters class stores parameters for the 'Add_projection' XML element used for fluid-...
Definition: Parameters.h:764
static const std::string xml_element_name_
Define the XML element name for mesh parameters.
Definition: Parameters.h:770
The RemesherParameters class stores parameters for the 'Remesher' XML element used for remeshing.
Definition: Parameters.h:1132
static const std::string xml_element_name_
Define the XML element name for mesh parameters.
Definition: Parameters.h:1136
Definition: Parameters.h:865
Definition: Parameters.h:883
static const std::string xml_element_name_
Process parameters for various solid viscosity models.
Definition: Parameters.h:887
Definition: Parameters.h:874
Definition: Parameters.h:498
StVenantKirchhoffParameters()
There are no parameters associated with a StVenantKirchhoff model.
Definition: Parameters.cpp:724
The StimulusParameters class stores parameters for 'Stimulus' XML element used to parameters for pace...
Definition: Parameters.h:966
static const std::string xml_element_name_
Define the XML element name for equation output parameters.
Definition: Parameters.h:970
The VariableWallPropsParameters class stores parameters for variable wall properties for the CMM equa...
Definition: Parameters.h:781
static const std::string xml_element_name_
The VariableWallPropsParameters class stores parameters for variable wall properties for the CMM equa...
Definition: Parameters.h:784
The VectorParameter class template is used to store a named paramater and its vector of values as a b...
Definition: Parameters.h:192
void set(const std::string &str_value)
Set the parameter value from a string.
Definition: Parameters.h:246
void set(const std::string &name, bool required, const std::vector< T > &value)
Set the parameter name and value, and if it is required.
Definition: Parameters.h:238
std::string svalue()
Get the string representation of the parameter value.
Definition: Parameters.h:212