svMultiPhysics
Loading...
Searching...
No Matches
Parameters.h
1// SPDX-FileCopyrightText: Copyright (c) Stanford University, The Regents of the University of California, and others.
2// SPDX-License-Identifier: BSD-3-Clause
3
4#ifndef PARAMETERS_H
5#define PARAMETERS_H
6
7#include <any>
8#include <functional>
9#include <iostream>
10#include <map>
11#include <regex>
12#include <set>
13#include <sstream>
14#include <string>
15#include <tuple>
16#include <variant>
17#include <vector>
18
19#include "tinyxml2.h"
20
21template<typename T>
22
23/// @brief The Parameter class template is used to store a named
24/// paramater and its scalar value as a basic type: bool, double,
25/// int and string.
26///
27/// The classes defined here are used to process svFSIplus simulation parameters read in
28/// from an Extensible Markup Language (XML) format file. XML is a simple text-based format
29/// for representing structured information.
30///
31/// An XML document is formed as an element tree. The XML tree starts at a root element and
32/// branches from the root to sub-elements. All elements can have sub-elements:
33///
34/// \code{.cpp}
35/// <svMultiPhysicsFile>
36/// <element>
37/// <subelement>.....</subelement>
38/// </element>
39/// </svMultiPhysicsFile>
40/// \endcode
41///
42/// The elements in the svFSIplus simulation file are represented by sections of
43/// related parameters. Sub-elements are refered to as sub-sections.
44///
45///-----------------
46/// Parameters class
47///-----------------
48/// The Parameters class is the top level class. It contains objects used to store
49/// parameters for the sections making up an XML simulation parameters file
50///
51/// 1) General (GeneralSimulationParameters)
52/// 2) Mesh (MeshParameters)
53/// 3) Equation (EquationParameters)
54/// 4) Projection (ProjectionParameters)
55/// 5) RIS Projection (RIS ProjectionParameters)
56///
57/// Each object contains methods to parse the XML file for the parameters defined for it.
58/// These section objects may also contain objects representing the sub-sections defined
59/// for each section.
60///
61///-----------------
62/// Section objects
63///-----------------
64/// Each section object contains objects representing parameters. A parameter's name and value
65/// is stored using either a Parameter and VectorParamater template objects. A parameter
66/// value is stored as a basic type: bool, double, int and string.
67///
68/// Parameter objects in a section class are named using the same XML element name with the 1st
69/// character lower case.
70///
71/// Example: GeneralSimulationParameters class
72///
73/// \code{.cpp}
74/// Parameter<bool> verbose; // <Verbose>
75/// Parameter<double> spectral_radius_of_infinite_time_step; // <Spectral_radius_of_infinite_time_step>
76/// Parameter<double> time_step_size; // <Time_step_size>
77/// \endcode
78///
79/// The name and default value for each parameter is defined in a section object's constructor.
80///
81/// Parameter values are set using the set_values() method which contains calls to tinyxml2
82/// to parse parameter values from an XML file.
83///
84/// Each section object inherits from the ParameterLists class. This class provides methods to
85/// store parameters in a map and process iterated over them for setting values and other operations.
87{
88 public:
89 Parameter() {};
90
91 Parameter(const std::string& name, T value, bool required, std::vector<T> range = {}) :
92 value_(value), name_(name), required_(required)
93 {
94 value_ = value;
95 range_ = range;
96 };
97
98 std::string name() const { return name_; };
99 T value() const { return value_; };
100 T operator()() const { return value_; };
101 bool defined() const { return value_set_; };
102
103 /// @brief Get the value of a parameter as a string.
104 std::string svalue()
105 {
106 std::ostringstream str_stream;
107 str_stream << value_;
108 return str_stream.str();
109 }
110
111 friend std::ostream& operator << (std::ostream& out, const Parameter<T>& param)
112 {
113 out << param.value();
114 return out;
115 }
116
117 /// @brief Set the parameter name and value, and if it is required.
118 void set(const std::string& name, bool required, T value) {
119 name_ = name;
120 required_ = required;
121 value_ = value;
122 }
123
124 /// @brief Set the parameter value from a string.
125 void set(const std::string& str_value)
126 {
127 if (str_value == "") {
128 value_ = T{0};
129 }
130
131 auto str = str_value;
132 std::string::iterator end_pos = std::remove(str.begin(), str.end(), ' ');
133 str.erase(end_pos, str.end());
134
135 std::istringstream str_stream(str);
136 if (!(str_stream >> value_)) {
137 std::istringstream str_stream(str);
138 if (!(str_stream >> std::boolalpha >> value_)) {
139 throw std::runtime_error("Incorrect value '" + str + "' for '" + name_ + "'.");
140 }
141 }
142
143 value_set_ = true;
144 }
145
146 bool check_required_set()
147 {
148 if (!required_) {
149 return true;
150 }
151 return value_set_;
152 }
153
154 T value_ = T{0};
155 std::string name_ = "";
156 bool required_ = false;
157 bool value_set_ = false;
158 std::vector<T> range_;
159};
160
161/// @brief The VectorParameter class template is used to store a named
162/// paramater and its vector of values as a basic type: bool, double,
163/// int and string.
164template<typename T>
166{
167 public:
168 VectorParameter() {};
169
170 VectorParameter(const std::string& name, const std::vector<T>& value, bool required, std::vector<T> range = {}) :
171 value_(value), name_(name), required_(required)
172 {
173 value_ = value;
174 range_ = range;
175 };
176
177 std::string name() const { return name_; };
178 std::vector<T> value() const { return value_; };
179 bool defined() const { return value_set_; };
180 int size() const { return value_.size(); };
181
182 std::vector<T> operator()() const { return value_; };
183 const double& operator[](const int i) const { return value_[i]; };
184
185 /// @brief Get the string representation of the parameter value.
186 std::string svalue()
187 {
188 std::string str;
189
190 if constexpr (std::is_same<T, std::string>::value) {
191 for (auto v : value_) {
192 str += " " + v + " ";
193 }
194 } else {
195 for (auto v : value_) {
196 str += " " + std::to_string(v);
197 }
198 }
199
200 return str;
201 }
202
203 friend std::ostream& operator << (std::ostream& out, const VectorParameter<T>& param)
204 {
205 for (int i = 0; i < param.size(); i++) {
206 out << param.value_[i];
207 }
208 return out;
209 }
210
211 /// @brief Set the parameter name and value, and if it is required.
212 void set(const std::string& name, bool required, const std::vector<T>& value)
213 {
214 name_ = name;
215 required_ = required;
216 value_ = value;
217 }
218
219 /// @brief Set the parameter value from a string.
220 void set(const std::string& str_value)
221 {
222 if (str_value == "") {
223 return;
224 }
225
226 std::string error_msg = "Improper vector format '" + str_value + "' found in '" + name_ + "'." + " Vector format is: (x,y,z)";
227 std::regex sep("\\(|\\)|\\,");
228 auto str = std::regex_replace(str_value, sep, " ");
229
230 if constexpr (std::is_same<T, std::string>::value) {
231 std::stringstream ssin(str);
232 std::string value;
233 while (ssin >> value) {
234 value_.push_back(value);
235 }
236 } else {
237 T value;
238 std::istringstream ssin(str);
239 while (ssin >> value) {
240 value_.push_back(value);
241 }
242 }
243 }
244
245 bool check_required_set()
246 {
247 if (!required_) {
248 return true;
249 }
250 return value_set_;
251 }
252
253 std::vector<T> value_;
254 std::string name_;
255 bool required_ = false;
256 bool value_set_ = false;
257 std::vector<T> range_;
258};
259
260/// @brief struct to define a row of CANN model parameter table
261struct CANNRow {
262 Parameter<int> invariant_index;
263 VectorParameter<int> activation_functions; // Fixed size (3 values)
264 VectorParameter<double> weights; // Fixed size (3 values)
265};
266
267/// @brief Defines parameter name and value, and stores them in
268/// maps for settng values from XML.
270{
271 public:
272
273 ParameterLists() { }
274
275 void set_xml_element_name(const std::string& name)
276 {
277 xml_element_name = name;
278 }
279
280 /// @brief Set the name, default value and the parameter required flag.
281 void set_parameter(const std::string& name, const bool value, bool required, Parameter<bool>& param)
282 {
283 param.set(name, required, value);
284 params_map[name] = &param;
285 }
286
287 void set_parameter(const std::string& name, const double value, bool required, Parameter<double>& param)
288 {
289 param.set(name, required, value);
290 params_map[name] = &param;
291 }
292
293 void set_parameter(const std::string& name, std::initializer_list<double> value, bool required, VectorParameter<double>& param)
294 {
295 param.set(name, required, value);
296 params_map[name] = &param;
297 }
298
299 void set_parameter(const std::string& name, std::initializer_list<int> value, bool required, VectorParameter<int>& param)
300 {
301 param.set(name, required, value);
302 params_map[name] = &param;
303 }
304
305 void set_parameter(const std::string& name, std::initializer_list<std::string> value, bool required,
307 {
308 param.set(name, required, value);
309 params_map[name] = &param;
310 }
311
312 void set_parameter(const std::string& name, const int value, bool required, Parameter<int>& param, std::vector<int> range = {})
313 {
314 param.set(name, required, value);
315 params_map[name] = &param;
316 }
317
318 void set_parameter(const std::string& name, const std::string& value, bool required, Parameter<std::string>& param)
319 {
320 param.set(name, required, value);
321 params_map[name] = &param;
322 }
323
324 /// @brief set_parameter function to handle CANNRow
325 void set_parameter_value_CANN(const std::string& name, const std::string& value)
326 {
327 if (params_map.count(name) == 0) {
328 throw std::runtime_error("Unknown " + xml_element_name + " XML element '" + name + "'.");
329 }
330
331 auto& param_variant = params_map[name];
332
333 // Check for Activation_functions
334 if (name == "Activation_functions") {
335 if (auto* vec_param = std::get_if<VectorParameter<int>*>(&param_variant)) {
336 (*vec_param)->value_.clear(); // Clear the vector before setting
337 (*vec_param)->set(value); // Set the new value
338 } else {
339 throw std::runtime_error("Activation_functions is not a VectorParameter<int>.");
340 }
341 }
342 // Check for Weights
343 else if (name == "Weights") {
344 if (auto* vec_param = std::get_if<VectorParameter<double>*>(&param_variant)) {
345 (*vec_param)->value_.clear(); // Clear the vector before setting
346 (*vec_param)->set(value); // Set the new value
347 } else {
348 throw std::runtime_error("Weights is not a VectorParameter<double>.");
349 }
350 }
351 // Default: everything else
352 else {
353 std::visit([&](auto&& p) -> void {
354 p->set(value);
355 }, param_variant);
356 }
357 }
358
359
360
361 /// @brief Set the value of a paramter from a string.
362 void set_parameter_value(const std::string& name, const std::string& value)
363 {
364 if (params_map.count(name) == 0) {
365 throw std::runtime_error("Unknown " + xml_element_name + " XML element '" + name + "'.");
366 }
367
368 std::visit([value](auto&& p) { p->set(value); }, params_map[name]);
369 }
370
371 /// @brief Check if any required parameters have not been set.
373 {
374 bool unset_found = false;
375
376 for (auto& [ key, param ] : params_map) {
377 if (std::visit([](auto&& p) {
378 return !p->check_required_set();
379 }, param)) {
380 throw std::runtime_error(xml_element_name + " XML element '" + key + "' has not been set.");
381 }
382 }
383 }
384
385 /// @brief Get the defined parameters as a map of strings.
386 std::map<std::string,std::string> get_parameter_list()
387 {
388 std::map<std::string,std::string> params;
389
390 for (auto& [ key, param ] : params_map) {
391 std::visit([&params](auto&& p) {
392 params[p->name()] = p->svalue();
393 }, param);
394 }
395
396 return params;
397 }
398
399 /// @brief Print the parameters.
401 {
402 for (auto& [ key, param ] : params_map) {
403 std::cout << key << ": ";
404 std::visit([](auto& p) {
405 std::cout << p->name_ << std::endl;
406 std::cout << p->svalue() << std::endl;
407 }, param);
408 }
409 }
410
411 /// @brief Map used for storing parameters by name / Parameter template union.
412 std::map<std::string, std::variant<Parameter<bool>*, Parameter<double>*, Parameter<int>*,
415
416 std::string xml_element_name = "";
417};
418
419//----------------------
420// IncludeParameterFile
421//----------------------
422// The IncludeParameterFile class is used to read and set the
423// root element of external XML file.
424//
426{
427 public:
428 IncludeParametersFile(const char* file_name);
429 tinyxml2::XMLDocument document;
430 tinyxml2::XMLElement* root_element = nullptr;
431 static std::string NAME;
432};
433
434//////////////////////////////////////////////////////////
435// ConstitutiveModelParameters //
436//////////////////////////////////////////////////////////
437
438// The following classes are used to store parameters for
439// various constitutive models.
440
442{
443 public:
445 bool defined() const { return value_set; };
446 void set_values(tinyxml2::XMLElement* con_model_params);
447 void print_parameters();
453 bool value_set = false;
454};
455
457{
458 public:
460 bool defined() const { return value_set; };
461 void set_values(tinyxml2::XMLElement* con_model_params);
462 void print_parameters();
467 bool value_set = false;
468};
469
470//---------------------
471// HolzapfelParameters
472//---------------------
474{
475 public:
477 bool defined() const { return value_set; };
478 void set_values(tinyxml2::XMLElement* con_model_params);
479 void print_parameters();
480
490
491 bool value_set = false;
492};
493
495{
496 public:
498 bool defined() const { return value_set; };
499 void set_values(tinyxml2::XMLElement* con_model_params);
500 void print_parameters();
505 Parameter<double> kappa;
506 bool value_set = false;
507};
508
510{
511 public:
513 bool defined() const { return value_set; };
514 void set_values(tinyxml2::XMLElement* con_model_params);
515 void print_parameters();
518 bool value_set = false;
519};
520
522{
523 public:
525 void set_values(tinyxml2::XMLElement* modl_params);
526 void print_parameters();
527 bool value_set = false;
528};
529
531{
532 public:
534 void set_values(tinyxml2::XMLElement* modl_params);
535 void print_parameters();
536 bool value_set = false;
537};
539/// @brief The CANNRowParameters class is used to store the parameters for
540/// each row of the CANN table for the xml element "Add_row"
542{
543 public:
545
546 void print_parameters();
547 void set_values(tinyxml2::XMLElement* xml_elem);
548
549 static const std::string xml_element_name_;
550
551 Parameter<std::string> row_name; // to identify each row
552 CANNRow row;
553
554};
555
556/// @brief The CANNParameters class stores the parameters table rows
557/// for xml element "Constitutive_model type=CANN". Each row is handled
558/// with xml element "Add_row"
559///
560/// \code {.xml}
561/// <Constitutive_model type="CANN">
562/// <Add_row row_name="1">
563/// <Invariant_num> 1 </Invariant_num>
564/// <Activation_functions> (1,1,1) </Activation_functions>
565/// <Weights> (1.0,1.0,1.0) </Weights>
566/// </Add_row>
567/// </Constitutive_model>
568/// \endcode
570{
571 public:
574 bool defined() const { return value_set; };
575 void set_values(tinyxml2::XMLElement* con_model_params);
576 void print_parameters();
577
578 std::vector<CANNRowParameters*> rows; // Store multiple rows
579
580 bool value_set = false;
581};
582
583/// @brief The ConstitutiveModelParameters class store parameters
584/// for various constitutive models.
586{
587 public:
589 void print_parameters();
591 bool defined() const { return value_set; };
592 void set_values(tinyxml2::XMLElement* modl_params);
593 static const std::string xml_element_name_;
594
595 // Model types supported.
596 static const std::string GUCCIONE_MODEL;
597 static const std::string HGO_MODEL;
598 static const std::string HOLZAPFEL_OGDEN_MODEL;
599 static const std::string HOLZAPFEL_OGDEN_MA_MODEL;
600 static const std::string LEE_SACKS;
601 static const std::string NEOHOOKEAN_MODEL;
602 static const std::string STVENANT_KIRCHHOFF_MODEL;
603 static const std::string CANN_MODEL;
604 static const std::map<std::string, std::string> constitutive_model_types;
605
606 // Constitutive model type.
608
609 GuccioneParameters guccione;
610 HolzapfelParameters holzapfel;
611 HolzapfelGasserOgdenParameters holzapfel_gasser_ogden;
612 LeeSacksParameters lee_sacks;
613 MooneyRivlinParameters mooney_rivlin;
614 NeoHookeanParameters neo_hookean;
615 StVenantKirchhoffParameters stvenant_kirchhoff;
616 CANNParameters cann;
617
618 bool value_set = false;
619};
620
621/// @brief Couple to reduced-order models.
623{
624 public:
626
627 static const std::string xml_element_name_;
628
629 bool defined() const { return value_set; };
630 void set_values(tinyxml2::XMLElement* xml_elem);
631 void print_parameters();
632
633 // attribute.
635
636 Parameter<std::string> file_name_for_0D_3D_communication;
637 Parameter<std::string> file_name_for_saving_unknowns;
638 Parameter<int> number_of_unknowns;
639 Parameter<int> number_of_user_defined_outputs;
640 Parameter<std::string> unknowns_initialization_file_path;
641
642 Parameter<std::string> zerod_code_file_path;
643
644 bool value_set = false;
645};
646
647/// @brief Coupling to GenBC.
649{
650 public:
652
653 static const std::string xml_element_name_;
654
655 bool defined() const { return value_set; };
656 void set_values(tinyxml2::XMLElement* xml_elem);
657
658 // attributes.
660
661 // String parameters.
662 Parameter<std::string> zerod_code_file_path;
663
664 bool value_set = false;
665};
666
667//----------------------------------
668// svZeroDSolverInterfaceParameters
669//----------------------------------
670//
672{
673 public:
675
676 static const std::string xml_element_name_;
677
678 bool defined() const { return value_set; };
679 void set_values(tinyxml2::XMLElement* xml_elem);
680
681 Parameter<std::string> configuration_file;
682 Parameter<std::string> coupling_type;
683
684 Parameter<double> initial_flows;
685 Parameter<double> initial_pressures;
686
687 Parameter<std::string> shared_library;
688
689 bool value_set = false;
690};
691
692/// @brief Body force over a mesh using the "Add_BF" command.
693///
694/// \code {.xml}
695/// <Add_BF mesh="msh" >
696/// <Type> volumetric </Type>
697/// <Time_dependence> general </Time_dependence>
698/// <Temporal_and_spatial_values_file_path> bforce.dat </Temporal_and_spatial_values_file_path>
699/// </Add_BF>
700/// \endcode
702{
703 public:
705 void print_parameters();
706 void set_values(tinyxml2::XMLElement* xml_elem);
707 static const std::string xml_element_name_;
708
709 // Attributes.
710 Parameter<std::string> mesh_name;
711
712 // Boolean parameters.
713 Parameter<bool> ramp_function;
714
715 // Double parameters.
716 Parameter<double> value;
717
718 // String parameters.
719 Parameter<std::string> fourier_coefficients_file_path;
720 Parameter<std::string> spatial_values_file_path;
721 Parameter<std::string> temporal_and_spatial_values_file_path;
722 Parameter<std::string> temporal_values_file_path;
723 Parameter<std::string> time_dependence;
725};
726
727/// @brief RCR values for Neumann BC type.
728///
729/// \code {.xml}
730/// <RCR_values>
731/// <Proximal_resistance> 121.0 </Proximal_resistance>
732/// <Capacitance> 1.5e-5 </Capacitance>
733/// <Distal_resistance> 1212.0 </Distal_resistance>
734/// </RCR_values>
735/// \endcode
737{
738 public:
740
741 static const std::string xml_element_name_;
742
743 void set_values(tinyxml2::XMLElement* xml_elem);
744 void print_parameters();
745
746 Parameter<double> capacitance;
747 Parameter<double> distal_pressure;
748 Parameter<double> distal_resistance;
749 Parameter<double> initial_pressure;
750 Parameter<double> proximal_resistance;
751
752 bool value_set = false;
753};
754
755/// @brief The BoundaryConditionParameters stores paramaters for various
756/// type of boundary conditions under the Add_BC XML element.
758{
759 public:
761 void print_parameters();
762 void set_values(tinyxml2::XMLElement* bc_params);
763 static const std::string xml_element_name_;
764
765 // RCR parameters sub-element.
767
768 // Add_BC name= attribute.
770
771 // Add_BC XML elements.
772 //
773 Parameter<bool> apply_along_normal_direction;
774 Parameter<std::string> bct_file_path;
775
776 Parameter<double> damping;
777 Parameter<double> distal_pressure;
778 VectorParameter<int> effective_direction;
779 Parameter<bool> follower_pressure_load;
780 Parameter<std::string> fourier_coefficients_file_path;
781
782 Parameter<bool> impose_flux;
783 Parameter<bool> impose_on_state_variable_integral;
784 Parameter<std::string> initial_displacements_file_path;
785
786 Parameter<double> penalty_parameter;
787 Parameter<double> penalty_parameter_normal;
788 Parameter<double> penalty_parameter_tangential;
789 Parameter<std::string> prestress_file_path;
791 Parameter<bool> ramp_function;
792
793 Parameter<std::string> cst_shell_bc_type;
794 Parameter<std::string> spatial_profile_file_path;
795 Parameter<std::string> spatial_values_file_path;
796 Parameter<double> stiffness;
797 Parameter<std::string> svzerod_solver_block;
798
799 Parameter<std::string> temporal_and_spatial_values_file_path;
800 Parameter<std::string> temporal_values_file_path;
801 Parameter<std::string> time_dependence;
802 Parameter<std::string> traction_values_file_path;
803 Parameter<double> traction_multiplier;
805
806 Parameter<bool> undeforming_neu_face;
807 Parameter<double> value;
808 Parameter<bool> weakly_applied;
809 Parameter<bool> zero_out_perimeter;
810
811 Parameter<double> resistance;
812};
813
814/// @brief The OutputParameters class stores parameters for the
815/// Output XML element under Add_equation.
816///
817/// \code {.xml}
818/// <Output type="Volume_integral" >
819/// <Temperature> true </Temperature>
820/// </Output>
821/// \endcode
823{
824 public:
826
827 static const std::string xml_element_name_;
828
829 void print_parameters();
830 void set_values(tinyxml2::XMLElement* xml_elem);
831 bool get_output_value(const std::string& name);
832 std::string get_alias_value(const std::string& name);
833
835
836 // List of output names.
837 std::vector<Parameter<bool>> output_list;
838
839 // List of alias output names.
840 std::vector<Parameter<std::string>> alias_list;
841};
842
843/// @brief The PrecomputedSolutionParameters class stores parameters for the
844/// 'Precomputed_solution' XML element used to read in the data from a precomputed solution
845/// for the simulation state
846/// \code {.xml}
847/// <Precomputed_solution>
848/// <Project_from_face> lumen_wall </Project_from_face>
849/// </Precomputed_solution>
850/// \endcode
851
853{
854 public:
856
857 void set_values(tinyxml2::XMLElement* xml_elem);
858
859 static const std::string xml_element_name_;
860
861 Parameter<std::string> field_name;
862 Parameter<std::string> file_path;
863 Parameter<double> time_step;
864 Parameter<bool> use_precomputed_solution;
865};
866
867/// @brief The ProjectionParameters class stores parameters for the
868/// 'Add_projection' XML element used for fluid-structure interaction
869/// simulations.
870/// \code {.xml}
871/// <Add_projection name="wall_inner" >
872/// <Project_from_face> lumen_wall </Project_from_face>
873/// </Add_projection>
874/// \endcode
876{
877 public:
879
880 void set_values(tinyxml2::XMLElement* xml_elem);
881
882 static const std::string xml_element_name_;
883
885
886 Parameter<std::string> project_from_face;
887 Parameter<double> projection_tolerance;
888};
889
890/// @brief The VariableWallPropsParameters class stores parameters for
891/// variable wall properties for the CMM equation.
893{
894 public:
896 static const std::string xml_element_name_;
897 bool defined() const { return value_set; };
898 void set_values(tinyxml2::XMLElement* xml_elemnt);
899
900 Parameter<std::string> mesh_name;
901 Parameter<std::string> wall_properties_file_path;
902 bool value_set = false;
903};
904
905
906//////////////////////////////////////////////////////////
907// FluidViscosity //
908//////////////////////////////////////////////////////////
909
910// The following classes are used to store parameters for
911// various fluid viscosity models.
912
914{
915 public:
917 void print_parameters();
918 void set_values(tinyxml2::XMLElement* equation_params);
919 Parameter<double> constant_value;
920};
921
923{
924 public:
926 void print_parameters();
927 void set_values(tinyxml2::XMLElement* xml_elem);
928
929 Parameter<double> limiting_high_shear_rate_viscosity;
930 Parameter<double> limiting_low_shear_rate_viscosity;
931 Parameter<double> power_law_index;
932 Parameter<double> shear_rate_tensor_multipler;
933 Parameter<double> shear_rate_tensor_exponent;
934};
935
937{
938 public:
940 void print_parameters();
941 void set_values(tinyxml2::XMLElement* xml_elem);
942 Parameter<double> asymptotic_viscosity;
943 Parameter<double> yield_stress;
944 Parameter<double> low_shear_rate_threshold;
945};
946
948{
949 public:
951
952 static const std::string xml_element_name_;
953
954 static const std::string CONSTANT_MODEL;
955 static const std::string CARREAU_YASUDA_MODEL;
956 static const std::string CASSONS_MODEL;
957 static const std::set<std::string> model_names;
958
959 void print_parameters();
960 void set_values(tinyxml2::XMLElement* xml_elem);
961
963
964 FluidViscosityNewtonianParameters newtonian_model;
965 FluidViscosityCarreauYasudaParameters carreau_yasuda_model;
967};
968
969//////////////////////////////////////////////////////////
970// SolidViscosity //
971//////////////////////////////////////////////////////////
972
973// The following classes are used to store parameters for
974// various solid viscosity models.
975
977{
978 public:
980 void print_parameters();
981 void set_values(tinyxml2::XMLElement* equation_params);
982 Parameter<double> constant_value;
983};
984
986{
987 public:
989 void print_parameters();
990 void set_values(tinyxml2::XMLElement* equation_params);
991 Parameter<double> constant_value;
992};
993
995{
996 public:
998
999 static const std::string xml_element_name_;
1000
1001 static const std::string NEWTONIAN_MODEL;
1002 static const std::string POTENTIAL_MODEL;
1003 static const std::set<std::string> model_names;
1004
1005 void print_parameters();
1006 void set_values(tinyxml2::XMLElement* xml_elem);
1007
1009
1010 SolidViscosityNewtonianParameters newtonian_model;
1011 SolidViscosityPotentialParameters potential_model;
1012};
1013
1014
1015/// @brief The LinearAlgebraParameters class stores parameters for
1016/// the 'Linear_algebra' XML element.
1018{
1019 public:
1020 static const std::string xml_element_name_;
1023 void print_parameters();
1024 void set_values(tinyxml2::XMLElement* fsi_file);
1025 bool defined() const { return values_set_; };
1026
1027 bool values_set_ = false;
1029
1030 Parameter<std::string> assembly;
1031 Parameter<std::string> configuration_file;
1032 Parameter<std::string> preconditioner;
1033};
1034
1035/// @brief The LinearSolverParameters class stores parameters for
1036/// the 'LS' XML element.
1038{
1039 public:
1041
1042 void print_parameters();
1043 void set_values(tinyxml2::XMLElement* fsi_file);
1044
1045 static const std::string xml_element_name_;
1046
1048
1049 Parameter<double> absolute_tolerance;
1050 Parameter<int> krylov_space_dimension;
1051
1052 Parameter<int> max_iterations;
1053 Parameter<int> ns_cg_max_iterations;
1054 Parameter<double> ns_cg_tolerance;
1055 Parameter<int> ns_gm_max_iterations;
1056 Parameter<double> ns_gm_tolerance;
1057
1058 //Parameter<std::string> preconditioner;
1059
1060 Parameter<double> tolerance;
1061
1062 LinearAlgebraParameters linear_algebra;
1063};
1064
1065/// @brief The StimulusParameters class stores parameters for
1066/// 'Stimulus' XML element used to parameters for
1067/// pacemaker cells.
1068///
1069/// \code {.xml}
1070/// <Stimulus type="Istim" >
1071/// <Amplitude> -52.0 </Amplitude>
1072/// <Start_time> 0.0 </Start_time>
1073/// <Duration> 1.0 </Duration>
1074/// <Cycle_length> 10000.0 </Cycle_length>
1075/// </Stimulus>
1076/// \endcode
1078{
1079 public:
1081
1082 static const std::string xml_element_name_;
1083
1084 bool defined() const { return value_set; };
1085 void print_parameters();
1086 void set_values(tinyxml2::XMLElement* xml_elem);
1087
1089
1090 Parameter<double> amplitude;
1091 Parameter<double> cycle_length;
1092 Parameter<double> duration;
1093 Parameter<double> start_time;
1094
1095 bool value_set = false;
1096};
1097
1099{
1100 public:
1102
1103 static const std::string xml_element_name_;
1104
1105 bool defined() const { return value_set; };
1106 void print_parameters();
1107 void set_values(tinyxml2::XMLElement* xml_elem);
1108
1109 Parameter<std::string> x_coords_file_path;
1110 Parameter<std::string> y_coords_file_path;
1111 Parameter<std::string> z_coords_file_path;
1112
1113 bool value_set = false;
1114};
1115
1116/// @brief The DirectionalDistributionParameters class stores directional
1117/// distribution parameters for active stress.
1118///
1119/// \code {.xml}
1120/// <Directional_distribution>
1121/// <Fiber_direction> 1.0 </Fiber_direction>
1122/// <Sheet_direction> 0.0 </Sheet_direction>
1123/// <Sheet_normal_direction> 0.0 </Sheet_normal_direction>
1124/// </Directional_distribution>
1125/// \endcode
1127{
1128 public:
1130
1131 static const std::string xml_element_name_;
1132
1133 bool defined() const { return value_set; };
1134 void print_parameters();
1135 void set_values(tinyxml2::XMLElement* xml_elem);
1136 void validate() const; // Validate directional fractions
1137
1138 Parameter<double> fiber_direction;
1139 Parameter<double> sheet_direction;
1140 Parameter<double> sheet_normal_direction;
1141
1142 bool value_set = false;
1143};
1144
1145/// @brief The FiberReinforcementStressParameters class stores fiber
1146/// reinforcement stress parameters for the 'Fiber_reinforcement_stress`
1147/// XML element.
1148///
1149/// \code {.xml}
1150/// <Fiber_reinforcement_stress type="Unsteady" >
1151/// <Temporal_values_file_path> fib_stress.dat </Temporal_values_file_path>
1152/// <Ramp_function> true </Ramp_function>
1153/// <Directional_distribution>
1154/// <Fiber_direction> 0.7 </Fiber_direction>
1155/// <Sheet_direction> 0.2 </Sheet_direction>
1156/// <Sheet_normal_direction> 0.1 </Sheet_normal_direction>
1157/// </Directional_distribution>
1158/// </Fiber_reinforcement_stress>
1159/// \endcode
1161{
1162 public:
1164
1165 static const std::string xml_element_name_;
1166
1167 bool defined() const { return value_set; };
1168 void print_parameters();
1169 void set_values(tinyxml2::XMLElement* xml_elem);
1170
1172
1173 Parameter<bool> ramp_function;
1174 Parameter<std::string> temporal_values_file_path;
1175 Parameter<double> value;
1176
1177 // Directional stress distribution parameters
1178 DirectionalDistributionParameters directional_distribution;
1179
1180 bool value_set = false;
1181};
1182
1183/// @brief The DomainParameters class stores parameters for the XML
1184/// 'Domain' element to specify properties for solving equations.
1185///
1186/// \code {.xml}
1187/// <Domain id="1" >
1188/// <Equation> fluid </Equation>
1189/// <Density> 1.06 </Density>
1190/// <Viscosity model="Constant" >
1191/// <Value> 0.04 </Value>
1192/// </Viscosity>
1193/// <Backflow_stabilization_coefficient> 0.2 </Backflow_stabilization_coefficient>
1194/// </Domain>
1195/// \endcode
1197{
1198 public:
1200
1201 static const std::string xml_element_name_;
1202
1203 void print_parameters();
1204 void set_values(tinyxml2::XMLElement* xml_elem, bool from_external_xml = false);
1205
1206 // Parameters for sub-elements under the Domain element.
1207 ConstitutiveModelParameters constitutive_model;
1208 FiberReinforcementStressParameters fiber_reinforcement_stress;
1209 StimulusParameters stimulus;
1210 FluidViscosityParameters fluid_viscosity;
1211 SolidViscosityParameters solid_viscosity;
1212
1213 // Attributes.
1215
1216 Parameter<double> absolute_tolerance;
1217 VectorParameter<double> anisotropic_conductivity;
1218 Parameter<double> backflow_stabilization_coefficient;
1219
1220 Parameter<double> conductivity;
1221 //Parameter<std::string> constitutive_model_name;
1222 Parameter<double> continuity_stabilization_coefficient;
1223
1224 Parameter<double> density;
1225 Parameter<std::string> dilational_penalty_model;
1226
1227 Parameter<std::string> equation;
1228 Parameter<double> elasticity_modulus;
1229 Parameter<std::string> electrophysiology_model;
1230
1231 Parameter<double> feedback_parameter_for_stretch_activated_currents;
1232 Parameter<double> fluid_density;
1233 Parameter<double> force_x;
1234 Parameter<double> force_y;
1235 Parameter<double> force_z;
1236
1237 Parameter<std::string> include_xml;
1238 Parameter<double> isotropic_conductivity;
1239
1240 Parameter<double> mass_damping;
1241 Parameter<int> maximum_iterations;
1242 Parameter<double> momentum_stabilization_coefficient;
1243 Parameter<std::string> myocardial_zone;
1244
1245 Parameter<double> G_Na;
1246 Parameter<double> G_CaL;
1247 Parameter<double> G_Kr;
1248 Parameter<double> G_Ks;
1249 Parameter<double> G_to;
1250
1251 Parameter<double> tau_fi;
1252 Parameter<double> tau_si;
1253
1254 Parameter<std::string> ode_solver;
1255 Parameter<double> penalty_parameter;
1256 Parameter<double> poisson_ratio;
1257 Parameter<double> relative_tolerance;
1258
1259 Parameter<double> shell_thickness;
1260 Parameter<double> solid_density;
1261 Parameter<double> source_term;
1262 Parameter<double> time_step_for_integration;
1263
1264 // Inverse of Darcy permeability. Default value of 0.0 for Navier-Stokes and non-zero for Navier-Stokes-Brinkman
1265 Parameter<double> inverse_darcy_permeability;
1266};
1267
1268/// @brief The RemesherParameters class stores parameters for the
1269/// 'Remesher' XML element used for remeshing.
1270///
1271/// \code {.xml}
1272/// <Remesher type="Tetgen" >
1273/// <Max_edge_size name="lumen" value="0.7"> </Max_edge_size>
1274/// <Max_edge_size name="wall" value="0.5"> </Max_edge_size>
1275/// <Min_dihedral_angle> 10.0 </Min_dihedral_angle>
1276/// <Max_radius_ratio> 1.1 </Max_radius_ratio>
1277/// <Remesh_frequency> 1000 </Remesh_frequency>
1278/// <Frequency_for_copying_data> 1 </Frequency_for_copying_data>
1279/// </Remesher>
1280/// \endcode
1282{
1283 public:
1285
1286 static const std::string xml_element_name_;
1287 bool values_set_ = false;
1288
1289 bool defined() const { return values_set_; };
1290 void print_parameters();
1291 double get_edge_size(const std::string& name) const { return max_edge_sizes_.at(name); }
1292 bool has_edge_size(const std::string& name) const { return max_edge_sizes_.count(name) == 1; }
1293 void set_values(tinyxml2::XMLElement* mesh_elem);
1294
1295 // Values given in the 'Max_edge_size' element.
1296 std::map<std::string, double> max_edge_sizes_;
1297
1299 Parameter<double> min_dihedral_angle;
1300 Parameter<double> max_radius_ratio;
1301 Parameter<int> remesh_frequency;
1302 Parameter<int> frequency_for_copying_data;
1303};
1304
1305/// @brief The ContactParameters class stores parameters for the 'Contact''
1306/// XML element used to specify parameter values for contact
1307/// computations.
1309{
1310 public:
1312
1313 static const std::string xml_element_name_;
1314
1315 void print_parameters();
1316 void set_values(tinyxml2::XMLElement* xml_elem);
1317
1318 Parameter<double> closest_gap_to_activate_penalty;
1319
1320 Parameter<double> desired_separation;
1321
1322 Parameter<double> min_norm_of_face_normals;
1323
1325
1326 Parameter<double> penalty_constant;
1327};
1328
1329/// @brief The EquationParameters class stores parameters for the 'Add_equation'
1330/// XML element used to specify an equation to be solved (e.g. fluid).
1331///
1332/// \code {.xml}
1333/// <Add_equation type="FSI" >
1334/// <Coupled> true </Coupled>
1335/// <Min_iterations> 1 </Min_iterations>
1336/// <Max_iterations> 1 </Max_iterations>
1337/// .
1338/// .
1339/// .
1340/// </Add_equation>
1341/// \endcode
1343{
1344 public:
1346
1347 static const std::string xml_element_name_;
1348
1349 void print_parameters();
1350 void set_values(tinyxml2::XMLElement* xml_elem, DomainParameters* default_domain=nullptr);
1351
1352 Parameter<double> backflow_stabilization_coefficient;
1353
1354 Parameter<double> conductivity;
1355 Parameter<double> continuity_stabilization_coefficient;
1356 Parameter<bool> coupled;
1357
1358 Parameter<double> density;
1359 Parameter<std::string> dilational_penalty_model;
1360
1361 Parameter<double> elasticity_modulus;
1362
1363 Parameter<std::string> include_xml;
1364 Parameter<std::string> initialize;
1365 Parameter<bool> initialize_rcr_from_flow;
1366
1367 Parameter<int> max_iterations;
1368 Parameter<int> min_iterations;
1369 Parameter<double> momentum_stabilization_coefficient;
1370
1371 Parameter<double> penalty_parameter;
1372 Parameter<double> poisson_ratio;
1373 Parameter<bool> prestress;
1374
1375 Parameter<double> source_term;
1376 Parameter<double> tolerance;
1377
1379 Parameter<bool> use_taylor_hood_type_basis;
1380
1381 // Explicit geometric coupling for FSI simulations: the fluid-structure equations
1382 // are solved to convergence using the mesh displacement from the previous time step,
1383 // and only then is the mesh equation solved.
1384 Parameter<bool> explicit_geometric_coupling;
1385
1386 // Inverse of Darcy permeability. Default value of 0.0 for Navier-Stokes and non-zero for Navier-Stokes-Brinkman
1387 Parameter<double> inverse_darcy_permeability;
1388
1389 // Sub-element parameters.
1390 //
1391 std::vector<BodyForceParameters*> body_forces;
1392
1393 std::vector<BoundaryConditionParameters*> boundary_conditions;
1394
1395 CoupleCplBCParameters couple_to_cplBC;
1396 CoupleGenBCParameters couple_to_genBC;
1397
1398 svZeroDSolverInterfaceParameters svzerodsolver_interface_parameters;
1399
1400 DomainParameters* default_domain = nullptr;
1401
1402 std::vector<DomainParameters*> domains;
1403
1404 LinearSolverParameters linear_solver;
1405
1406 std::vector<OutputParameters*> outputs;
1407
1408 RemesherParameters remesher;
1409
1410 VariableWallPropsParameters variable_wall_properties;
1411
1412 FluidViscosityParameters fluid_viscosity;
1413
1414 SolidViscosityParameters solid_viscosity;
1415
1416 ECGLeadsParameters ecg_leads;
1417
1418};
1419
1420/// @brief The GeneralSimulationParameters class stores paramaters for the
1421/// 'GeneralSimulationParameters' XML element.
1422///
1423/// \code {.xml}
1424/// <GeneralSimulationParameters>
1425/// <Continue_previous_simulation> 0 </Continue_previous_simulation>
1426/// <Number_of_spatial_dimensions> 3 </Number_of_spatial_dimensions>
1427/// <Number_of_time_steps> 1 </Number_of_time_steps>
1428/// <Time_step_size> 1e-4 </Time_step_size>
1429/// <Spectral_radius_of_infinite_time_step> 0.50 </Spectral_radius_of_infinite_time_step>
1430/// <Searched_file_name_to_trigger_stop> STOP_SIM </Searched_file_name_to_trigger_stop>
1431/// <Save_results_to_VTK_format> true </Save_results_to_VTK_format>
1432/// <Name_prefix_of_saved_VTK_files> result </Name_prefix_of_saved_VTK_files>
1433/// <Increment_in_saving_VTK_files> 1 </Increment_in_saving_VTK_files>
1434/// <Start_saving_after_time_step> 1 </Start_saving_after_time_step>
1435/// <Increment_in_saving_restart_files> 1 </Increment_in_saving_restart_files>
1436/// <Convert_BIN_to_VTK_format> 0 </Convert_BIN_to_VTK_format>
1437/// <Verbose> 1 </Verbose>
1438/// <Warning> 0 </Warning>
1439/// <Debug> 0 </Debug>
1440/// <Simulation_requires_remeshing> true </Simulation_requires_remeshing>
1441/// </GeneralSimulationParameters>
1442/// \endcode
1444{
1445 public:
1447
1448 void print_parameters();
1449 void set_values(tinyxml2::XMLElement* xml_element, bool from_external_xml = false);
1450
1451 std::string xml_element_name;
1452
1453 Parameter<bool> check_ien_order;
1454 Parameter<bool> continue_previous_simulation;
1455 Parameter<bool> convert_bin_to_vtk_format;
1456 Parameter<bool> debug;
1457 Parameter<bool> overwrite_restart_file;
1458 Parameter<bool> save_averaged_results;
1459 Parameter<bool> save_results_to_vtk_format;
1460 Parameter<bool> simulation_requires_remeshing;
1461 Parameter<bool> start_averaging_from_zero;
1462 Parameter<bool> verbose;
1463 Parameter<bool> warning;
1464
1465 Parameter<double> spectral_radius_of_infinite_time_step;
1466 Parameter<double> time_step_size;
1467
1468 Parameter<std::string> include_xml;
1469 Parameter<int> increment_in_saving_restart_files;
1470 Parameter<int> increment_in_saving_vtk_files;
1471 Parameter<int> number_of_spatial_dimensions;
1472 Parameter<int> number_of_initialization_time_steps;
1473 Parameter<int> start_saving_after_time_step;
1474 Parameter<int> starting_time_step;
1475 Parameter<int> number_of_time_steps;
1476
1477 Parameter<std::string> name_prefix_of_saved_vtk_files;
1478 Parameter<std::string> restart_file_name;
1479 Parameter<std::string> searched_file_name_to_trigger_stop;
1480 Parameter<std::string> save_results_in_folder;
1481 Parameter<std::string> simulation_initialization_file_path;
1482};
1483
1484/// @brief The FaceParameters class is used to store parameters for the
1485/// 'Add_face' XML element.
1487{
1488 public:
1490
1491 void print_parameters();
1492 void set_values(tinyxml2::XMLElement* xml_elem);
1493
1494 static const std::string xml_element_name_;
1495
1496 Parameter<std::string> end_nodes_face_file_path;
1497 Parameter<std::string> face_file_path;
1499
1500 Parameter<double> quadrature_modifier_TRI3;
1501};
1502
1503/// @brief The MeshParameters class is used to store paramaters for the
1504/// 'Add_mesh' XML element.
1505///
1506/// \code {.xml}
1507/// <Add_mesh name="lumen" >
1508/// <Mesh_file_path> mesh/lumen/mesh-complete.mesh.vtu </Mesh_file_path>
1509///
1510/// <Add_face name="lumen_inlet">
1511/// <Face_file_path> mesh/lumen/mesh-surfaces/lumen_inlet.vtp </Face_file_path>
1512/// </Add_face>
1513///
1514/// <Add_face name="lumen_outlet">
1515/// <Face_file_path> mesh/lumen/mesh-surfaces/lumen_outlet.vtp </Face_file_path>
1516/// </Add_face>
1517///
1518/// <Add_face name="lumen_wall">
1519/// <Face_file_path> mesh/lumen/mesh-surfaces/lumen_wall.vtp </Face_file_path>
1520/// </Add_face>
1521///
1522/// <Domain> 0 </Domain>
1523///
1524/// </Add_mesh>
1525/// \endcode
1527{
1528 public:
1530
1531 static const std::string xml_element_name_;
1532
1533 void print_parameters();
1534 void set_values(tinyxml2::XMLElement* mesh_elem, bool from_external_xml = false);
1535 std::string get_name() const { return name.value(); };
1536 std::string get_path() const { return mesh_file_path.value(); };
1537
1538 std::vector<FaceParameters*> face_parameters;
1539
1540 // Add_mesh name=
1542
1543 // Parameters under Add_mesh
1544 //
1545 Parameter<int> domain_id;
1546 Parameter<std::string> domain_file_path;
1547
1548 VectorParameter<std::string> fiber_direction_file_paths;
1549 //Parameter<std::string> fiber_direction_file_path;
1550 std::vector<VectorParameter<double>> fiber_directions;
1551 //VectorParameter<double> fiber_direction;
1552
1553 Parameter<std::string> include_xml;
1554 Parameter<std::string> initial_displacements_file_path;
1555 Parameter<std::string> initial_pressures_file_path;
1556 Parameter<bool> initialize_rcr_from_flow;
1557 Parameter<std::string> initial_velocities_file_path;
1558
1559 Parameter<std::string> mesh_file_path;
1560 Parameter<double> mesh_scale_factor;
1561 Parameter<std::string> prestress_file_path;
1562
1563 Parameter<bool> set_mesh_as_fibers;
1564 Parameter<bool> set_mesh_as_shell;
1565
1566 Parameter<double> quadrature_modifier_TET4;
1567};
1568
1569//////////////////////////////////////////////////////////
1570// Resistive immersed surfaces method //
1571//////////////////////////////////////////////////////////
1572
1573/// @brief The RISProjectionParameters class stores parameters for the
1574/// 'Add_RIS_projection' XML element used for RIS valve simulations.
1575/// \code {.xml}
1576/// <Add_RIS_projection name="left_ris" >
1577/// <Project_from_face> right_ris </Project_from_face>
1578/// <Resistance> 1.e6 </Resistance>
1579/// </Add_RIS_projection>
1580/// \endcode
1582{
1583 public:
1585
1586 void set_values(tinyxml2::XMLElement* xml_elem);
1587
1588 static const std::string xml_element_name_;
1589
1591
1592 Parameter<std::string> project_from_face;
1593 Parameter<double> resistance;
1594 Parameter<double> projection_tolerance;
1595};
1596
1597/// @brief The URISFaceParameters class is used to store parameters for the
1598/// 'Add_URIS_face' XML element.
1600{
1601 public:
1603
1604 void print_parameters();
1605 void set_values(tinyxml2::XMLElement* xml_elem);
1606
1607 static const std::string xml_element_name_;
1608
1609 Parameter<std::string> name; // Name of the valve surface
1610
1611 Parameter<std::string> face_file_path; // File path for the valve surface
1612 Parameter<std::string> open_motion_file_path; // File path for the open motion of the valve
1613 Parameter<std::string> close_motion_file_path; // File path for the close motion of the valve
1614
1615};
1616
1617/// @brief The URISMeshParameters class is used to store paramaters for the
1618/// 'Add_URIS_mesh' XML element.
1619///
1620/// \code {.xml}
1621/// <Add_uris_mesh name="MV" >
1622/// <Add_uris_face name="LCC" >
1623/// <Face_file_path> meshes/uris_face.vtu </Face_file_path>
1624/// <Open_motion_file_path> meshes/uris_facemotion_open.dat </Open_motion_file_path>
1625/// <Close_motion_file_path> meshes/uris_facemotion_close.dat </Close_motion_file_path>
1626/// </Add_uris_face>
1627/// <Mesh_scale_factor> 1.0 </Mesh_scale_factor>
1628/// <Thickness> 0.25 </Thickness>
1629/// <Resistance> 1.0e5 </Resistance>
1630/// <Positive_flow_normal_file> meshes/normal.dat </Positive_flow_normal_file>
1631/// </Add_uris_mesh>
1632/// \endcode
1634{
1635 public:
1637
1638 static const std::string xml_element_name_;
1639
1640 void print_parameters();
1641 void set_values(tinyxml2::XMLElement* mesh_elem);
1642 std::string get_name() const { return name.value(); };
1643 // std::string get_path() const { return mesh_file_path.value(); };
1644
1645 std::vector<URISFaceParameters*> URIS_face_parameters;
1646
1647 // Add_mesh name
1648 Parameter<std::string> name; // Name of the valve mesh
1649
1650 // Parameters under Add_URIS_mesh
1651 Parameter<double> mesh_scale_factor; // Scale factor for the mesh
1652 Parameter<double> thickness; // Thickness of the valve
1653 Parameter<double> close_thickness; // Thickness of the valve when it is closed
1654 Parameter<double> resistance; // Resistance of the valve
1655 Parameter<double> resistance_close; // Resistance of the valve when it is closed
1656 Parameter<bool> valve_starts_as_closed; // Whether the valve starts as closed
1657 Parameter<std::string> positive_flow_normal_file_path; // File path for the positive flow normal
1658
1659};
1660
1661
1662
1663/// @brief The Parameters class stores parameter values read in from a solver input file.
1665
1666 public:
1667 Parameters();
1668
1669 static const std::set<std::string> constitutive_model_names;
1670 static const std::set<std::string> equation_names;
1671 static const std::string FSI_FILE;
1672
1673 void get_logging_levels(int& verbose, int& warning, int& debug);
1674 void print_parameters();
1675 void read_xml(std::string file_name);
1676
1677 void set_contact_values(tinyxml2::XMLElement* root_element);
1678 void set_equation_values(tinyxml2::XMLElement* root_element);
1679 void set_mesh_values(tinyxml2::XMLElement* root_element);
1680 void set_precomputed_solution_values(tinyxml2::XMLElement* root_element);
1681 void set_projection_values(tinyxml2::XMLElement* root_element);
1682 void set_svzerodsolver_interface_values(tinyxml2::XMLElement* root_element);
1683
1684 void set_RIS_projection_values(tinyxml2::XMLElement* root_element);
1685 void set_URIS_mesh_values(tinyxml2::XMLElement* root_element);
1686
1687 // Objects representing each parameter section of XML file.
1688 ContactParameters contact_parameters;
1689 GeneralSimulationParameters general_simulation_parameters;
1690 std::vector<MeshParameters*> mesh_parameters;
1691 std::vector<EquationParameters*> equation_parameters;
1692 std::vector<ProjectionParameters*> projection_parameters;
1693 PrecomputedSolutionParameters precomputed_solution_parameters;
1694
1695 std::vector<RISProjectionParameters*> RIS_projection_parameters;
1696 std::vector<URISMeshParameters*> URIS_mesh_parameters;
1697
1698};
1699
1700#endif
1701
Body force over a mesh using the "Add_BF" command.
Definition Parameters.h:702
static const std::string xml_element_name_
Define the XML element name for boundary condition parameters.
Definition Parameters.h:707
The BoundaryConditionParameters stores paramaters for various type of boundary conditions under the A...
Definition Parameters.h:758
static const std::string xml_element_name_
Define the XML element name for equation boundary condition parameters.
Definition Parameters.h:763
RCR values for Neumann BC type.
Definition Parameters.h:737
BoundaryConditionRCRParameters()
RCR values for Neumann BC type.
Definition Parameters.cpp:372
The CANNParameters class stores the parameters table rows for xml element "Constitutive_model type=CA...
Definition Parameters.h:570
CANNParameters()
Constructor for CANNParameters class. Initializes parameter table.
Definition Parameters.cpp:879
~CANNParameters()
Destructor for CANNParameters class. Deletes memory dynamically allocated to the rows of the table.
Definition Parameters.cpp:891
The CANNRowParameters class is used to store the parameters for each row of the CANN table for the xm...
Definition Parameters.h:542
static const std::string xml_element_name_
Process parameters for the "Add_row" xml element.
Definition Parameters.h:549
The ConstitutiveModelParameters class store parameters for various constitutive models.
Definition Parameters.h:586
void check_constitutive_model(const Parameter< std::string > &eq_type)
Check if a constitutive model is valid for the given equation.
Definition Parameters.cpp:991
static const std::map< std::string, std::string > constitutive_model_types
Supported constitutive model types and their aliases.
Definition Parameters.h:538
static const std::string xml_element_name_
Process parameters for various constitutive models.
Definition Parameters.h:593
The ContactParameters class stores parameters for the 'Contact'' XML element used to specify paramete...
Definition Parameters.h:1309
static const std::string xml_element_name_
Process parameters for the 'Contact' XML element used to specify parameters for contact computation.
Definition Parameters.h:1313
Couple to reduced-order models.
Definition Parameters.h:623
static const std::string xml_element_name_
Couple to reduced-order models.
Definition Parameters.h:627
Coupling to GenBC.
Definition Parameters.h:649
static const std::string xml_element_name_
Coupling to GenBC.
Definition Parameters.h:653
The DirectionalDistributionParameters class stores directional distribution parameters for active str...
Definition Parameters.h:1127
static const std::string xml_element_name_
Define the XML element name for directional distribution parameters.
Definition Parameters.h:1131
The DomainParameters class stores parameters for the XML 'Domain' element to specify properties for s...
Definition Parameters.h:1197
static const std::string xml_element_name_
Define the XML element name for domain parameters.
Definition Parameters.h:1201
Definition Parameters.h:1099
static const std::string xml_element_name_
Define the XML element name for ECG leads parameters.
Definition Parameters.h:1103
The EquationParameters class stores parameters for the 'Add_equation' XML element used to specify an ...
Definition Parameters.h:1343
static const std::string xml_element_name_
Define the XML element name for equation parameters.
Definition Parameters.h:1347
The FaceParameters class is used to store parameters for the 'Add_face' XML element.
Definition Parameters.h:1487
static const std::string xml_element_name_
Process parameters for the 'Add_face' XML element.
Definition Parameters.h:1494
The FiberReinforcementStressParameters class stores fiber reinforcement stress parameters for the 'Fi...
Definition Parameters.h:1161
static const std::string xml_element_name_
Define the XML element name for fiber reinforcement stress parameters.
Definition Parameters.h:1165
Definition Parameters.h:923
Definition Parameters.h:937
Definition Parameters.h:914
Definition Parameters.h:948
static const std::string xml_element_name_
Process parameters for various fluid viscosity models.
Definition Parameters.h:952
The GeneralSimulationParameters class stores paramaters for the 'GeneralSimulationParameters' XML ele...
Definition Parameters.h:1444
void set_values(tinyxml2::XMLElement *xml_element, bool from_external_xml=false)
Set general parameters values from XML.
Definition Parameters.cpp:2395
GeneralSimulationParameters()
Process paramaters for the 'GeneralSimulationParameters' XML element.
Definition Parameters.cpp:2335
Definition Parameters.h:457
Definition Parameters.h:495
Definition Parameters.h:474
Definition Parameters.h:426
Definition Parameters.h:442
The LinearAlgebraParameters class stores parameters for the 'Linear_algebra' XML element.
Definition Parameters.h:1018
void check_input_parameters()
Check the validity of the input parameters.
Definition Parameters.cpp:3044
static const std::string xml_element_name_
Define the XML element name for equation output parameters.
Definition Parameters.h:1020
The LinearSolverParameters class stores parameters for the 'LS' XML element.
Definition Parameters.h:1038
static const std::string xml_element_name_
Define the XML element name for equation output parameters.
Definition Parameters.h:1045
The MeshParameters class is used to store paramaters for the 'Add_mesh' XML element.
Definition Parameters.h:1527
static const std::string xml_element_name_
Define the XML element name for mesh parameters.
Definition Parameters.h:1531
Definition Parameters.h:510
Definition Parameters.h:522
NeoHookeanParameters()
There are no parameters associated with a Neohookean model.
Definition Parameters.cpp:776
The OutputParameters class stores parameters for the Output XML element under Add_equation.
Definition Parameters.h:823
std::string get_alias_value(const std::string &name)
Get the value of an alias by name.
Definition Parameters.cpp:1219
bool get_output_value(const std::string &name)
Get the value of an output by name.
Definition Parameters.cpp:1231
static const std::string xml_element_name_
Define the XML element name for equation output parameters.
Definition Parameters.h:827
The Parameter class template is used to store a named paramater and its scalar value as a basic type:...
Definition Parameters.h:87
void set(const std::string &name, bool required, T value)
Set the parameter name and value, and if it is required.
Definition Parameters.h:118
void set(const std::string &str_value)
Set the parameter value from a string.
Definition Parameters.h:125
std::string svalue()
Get the value of a parameter as a string.
Definition Parameters.h:104
Defines parameter name and value, and stores them in maps for settng values from XML.
Definition Parameters.h:270
void check_required()
Check if any required parameters have not been set.
Definition Parameters.h:372
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:281
void set_parameter_value_CANN(const std::string &name, const std::string &value)
set_parameter function to handle CANNRow
Definition Parameters.h:325
std::map< std::string, std::string > get_parameter_list()
Get the defined parameters as a map of strings.
Definition Parameters.h:386
void set_parameter_value(const std::string &name, const std::string &value)
Set the value of a paramter from a string.
Definition Parameters.h:362
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:414
void print_parameter_list()
Print the parameters.
Definition Parameters.h:400
The Parameters class stores parameter values read in from a solver input file.
Definition Parameters.h:1664
void read_xml(std::string file_name)
Set the simulation parameter values given in an XML format file.
Definition Parameters.cpp:151
The PrecomputedSolutionParameters class stores parameters for the 'Precomputed_solution' XML element ...
Definition Parameters.h:853
The ProjectionParameters class stores parameters for the 'Add_projection' XML element used for fluid-...
Definition Parameters.h:876
static const std::string xml_element_name_
Define the XML element name for mesh parameters.
Definition Parameters.h:882
The RISProjectionParameters class stores parameters for the 'Add_RIS_projection' XML element used for...
Definition Parameters.h:1582
static const std::string xml_element_name_
Define the XML element name for mesh parameters.
Definition Parameters.h:1588
The RemesherParameters class stores parameters for the 'Remesher' XML element used for remeshing.
Definition Parameters.h:1282
static const std::string xml_element_name_
Define the XML element name for mesh parameters.
Definition Parameters.h:1286
Definition Parameters.h:977
Definition Parameters.h:995
static const std::string xml_element_name_
Process parameters for various solid viscosity models.
Definition Parameters.h:999
Definition Parameters.h:986
Definition Parameters.h:531
StVenantKirchhoffParameters()
There are no parameters associated with a StVenantKirchhoff model.
Definition Parameters.cpp:790
The StimulusParameters class stores parameters for 'Stimulus' XML element used to parameters for pace...
Definition Parameters.h:1078
static const std::string xml_element_name_
Define the XML element name for equation output parameters.
Definition Parameters.h:1082
The URISFaceParameters class is used to store parameters for the 'Add_URIS_face' XML element.
Definition Parameters.h:1600
static const std::string xml_element_name_
Process parameters for the 'Add_URIS_face' XML element.
Definition Parameters.h:1607
The URISMeshParameters class is used to store paramaters for the 'Add_URIS_mesh' XML element.
Definition Parameters.h:1634
static const std::string xml_element_name_
Define the XML element name for mesh parameters.
Definition Parameters.h:1638
The VariableWallPropsParameters class stores parameters for variable wall properties for the CMM equa...
Definition Parameters.h:893
static const std::string xml_element_name_
The VariableWallPropsParameters class stores parameters for variable wall properties for the CMM equa...
Definition Parameters.h:896
The VectorParameter class template is used to store a named paramater and its vector of values as a b...
Definition Parameters.h:166
void set(const std::string &str_value)
Set the parameter value from a string.
Definition Parameters.h:220
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:212
std::string svalue()
Get the string representation of the parameter value.
Definition Parameters.h:186
Definition Parameters.h:672
struct to define a row of CANN model parameter table
Definition Parameters.h:261