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// ConstitutiveModelParameters //
421//////////////////////////////////////////////////////////
422
423// The following classes are used to store parameters for
424// various constitutive models.
425
427{
428 public:
430 bool defined() const { return value_set; };
431 void set_values(tinyxml2::XMLElement* con_model_params);
432 void print_parameters();
438 bool value_set = false;
439};
440
442{
443 public:
445 bool defined() const { return value_set; };
446 void set_values(tinyxml2::XMLElement* con_model_params);
447 void print_parameters();
452 bool value_set = false;
453};
454
455//---------------------
456// HolzapfelParameters
457//---------------------
459{
460 public:
462 bool defined() const { return value_set; };
463 void set_values(tinyxml2::XMLElement* con_model_params);
464 void print_parameters();
465
475
476 bool value_set = false;
477};
478
480{
481 public:
483 bool defined() const { return value_set; };
484 void set_values(tinyxml2::XMLElement* con_model_params);
485 void print_parameters();
490 Parameter<double> kappa;
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();
503 bool value_set = false;
504};
505
507{
508 public:
510 void set_values(tinyxml2::XMLElement* modl_params);
511 void print_parameters();
512 bool value_set = false;
513};
514
516{
517 public:
519 void set_values(tinyxml2::XMLElement* modl_params);
520 void print_parameters();
521 bool value_set = false;
522};
523
524/// @brief The CANNRowParameters class is used to store the parameters for
525/// each row of the CANN table for the xml element "Add_row"
527{
528 public:
530
531 void print_parameters();
532 void set_values(tinyxml2::XMLElement* xml_elem);
533
534 static const std::string xml_element_name_;
535
536 Parameter<std::string> row_name; // to identify each row
537 CANNRow row;
538
539};
540
541/// @brief The CANNParameters class stores the parameters table rows
542/// for xml element "Constitutive_model type=CANN". Each row is handled
543/// with xml element "Add_row"
544///
545/// \code {.xml}
546/// <Constitutive_model type="CANN">
547/// <Add_row row_name="1">
548/// <Invariant_num> 1 </Invariant_num>
549/// <Activation_functions> (1,1,1) </Activation_functions>
550/// <Weights> (1.0,1.0,1.0) </Weights>
551/// </Add_row>
552/// </Constitutive_model>
553/// \endcode
555{
556 public:
559 bool defined() const { return value_set; };
560 void set_values(tinyxml2::XMLElement* con_model_params);
561 void print_parameters();
562
563 std::vector<CANNRowParameters*> rows; // Store multiple rows
564
565 bool value_set = false;
566};
567
568/// @brief The ConstitutiveModelParameters class store parameters
569/// for various constitutive models.
571{
572 public:
574 void print_parameters();
576 bool defined() const { return value_set; };
577 void set_values(tinyxml2::XMLElement* modl_params);
578 static const std::string xml_element_name_;
579
580 // Model types supported.
581 static const std::string GUCCIONE_MODEL;
582 static const std::string HGO_MODEL;
583 static const std::string HOLZAPFEL_OGDEN_MODEL;
584 static const std::string HOLZAPFEL_OGDEN_MA_MODEL;
585 static const std::string LEE_SACKS;
586 static const std::string NEOHOOKEAN_MODEL;
587 static const std::string STVENANT_KIRCHHOFF_MODEL;
588 static const std::string CANN_MODEL;
589 static const std::map<std::string, std::string> constitutive_model_types;
590
591 // Constitutive model type.
593
594 GuccioneParameters guccione;
595 HolzapfelParameters holzapfel;
596 HolzapfelGasserOgdenParameters holzapfel_gasser_ogden;
597 LeeSacksParameters lee_sacks;
598 MooneyRivlinParameters mooney_rivlin;
599 NeoHookeanParameters neo_hookean;
600 StVenantKirchhoffParameters stvenant_kirchhoff;
601 CANNParameters cann;
602
603 bool value_set = false;
604};
605
606/// @brief Couple to reduced-order models.
608{
609 public:
611
612 static const std::string xml_element_name_;
613
614 bool defined() const { return value_set; };
615 void set_values(tinyxml2::XMLElement* xml_elem);
616 void print_parameters();
617
618 // attribute.
620
621 Parameter<std::string> file_name_for_0D_3D_communication;
622 Parameter<std::string> file_name_for_saving_unknowns;
623 Parameter<int> number_of_unknowns;
624 Parameter<int> number_of_user_defined_outputs;
625 Parameter<std::string> unknowns_initialization_file_path;
626
627 Parameter<std::string> zerod_code_file_path;
628
629 bool value_set = false;
630};
631
632/// @brief Coupling to GenBC.
634{
635 public:
637
638 static const std::string xml_element_name_;
639
640 bool defined() const { return value_set; };
641 void set_values(tinyxml2::XMLElement* xml_elem);
642
643 // attributes.
645
646 // String parameters.
647 Parameter<std::string> zerod_code_file_path;
648
649 bool value_set = false;
650};
651
652//----------------------------------
653// svZeroDSolverInterfaceParameters
654//----------------------------------
655//
657{
658 public:
660
661 static const std::string xml_element_name_;
662
663 bool defined() const { return value_set; };
664 void set_values(tinyxml2::XMLElement* xml_elem);
665
666 Parameter<std::string> configuration_file;
667 Parameter<std::string> coupling_type;
668
669 Parameter<double> initial_flows;
670 Parameter<double> initial_pressures;
671
672 Parameter<std::string> shared_library;
673
674 bool value_set = false;
675};
676
677/// @brief Body force over a mesh using the "Add_BF" command.
678///
679/// \code {.xml}
680/// <Add_BF mesh="msh" >
681/// <Type> volumetric </Type>
682/// <Time_dependence> general </Time_dependence>
683/// <Temporal_and_spatial_values_file_path> bforce.dat </Temporal_and_spatial_values_file_path>
684/// </Add_BF>
685/// \endcode
687{
688 public:
690 void print_parameters();
691 void set_values(tinyxml2::XMLElement* xml_elem);
692 static const std::string xml_element_name_;
693
694 // Attributes.
695 Parameter<std::string> mesh_name;
696
697 // Boolean parameters.
698 Parameter<bool> ramp_function;
699
700 // Double parameters.
701 Parameter<double> value;
702
703 // String parameters.
704 Parameter<std::string> fourier_coefficients_file_path;
705 Parameter<std::string> spatial_values_file_path;
706 Parameter<std::string> temporal_and_spatial_values_file_path;
707 Parameter<std::string> temporal_values_file_path;
708 Parameter<std::string> time_dependence;
710};
711
712/// @brief RCR values for Neumann BC type.
713///
714/// \code {.xml}
715/// <RCR_values>
716/// <Proximal_resistance> 121.0 </Proximal_resistance>
717/// <Capacitance> 1.5e-5 </Capacitance>
718/// <Distal_resistance> 1212.0 </Distal_resistance>
719/// </RCR_values>
720/// \endcode
722{
723 public:
725
726 static const std::string xml_element_name_;
727
728 void set_values(tinyxml2::XMLElement* xml_elem);
729 void print_parameters();
730
731 Parameter<double> capacitance;
732 Parameter<double> distal_pressure;
733 Parameter<double> distal_resistance;
734 Parameter<double> initial_pressure;
735 Parameter<double> proximal_resistance;
736
737 bool value_set = false;
738};
739
740/// @brief The BoundaryConditionParameters stores paramaters for various
741/// type of boundary conditions under the Add_BC XML element.
743{
744 public:
746 void print_parameters();
747 void set_values(tinyxml2::XMLElement* bc_params);
748 static const std::string xml_element_name_;
749
750 // RCR parameters sub-element.
752
753 // Add_BC name= attribute.
755
756 // Add_BC XML elements.
757 //
758 Parameter<bool> apply_along_normal_direction;
759 Parameter<std::string> bct_file_path;
760
761 Parameter<double> damping;
762 Parameter<double> distal_pressure;
763 VectorParameter<int> effective_direction;
764 Parameter<bool> follower_pressure_load;
765 Parameter<std::string> fourier_coefficients_file_path;
766
767 Parameter<bool> impose_flux;
768 Parameter<bool> impose_on_state_variable_integral;
769 Parameter<std::string> initial_displacements_file_path;
770
771 Parameter<double> penalty_parameter;
772 Parameter<double> penalty_parameter_normal;
773 Parameter<double> penalty_parameter_tangential;
774 Parameter<std::string> prestress_file_path;
776 Parameter<bool> ramp_function;
777
778 Parameter<std::string> cst_shell_bc_type;
779 Parameter<std::string> spatial_profile_file_path;
780 Parameter<std::string> spatial_values_file_path;
781 Parameter<double> stiffness;
782 Parameter<std::string> svzerod_solver_block;
783
784 Parameter<std::string> temporal_and_spatial_values_file_path;
785 Parameter<std::string> temporal_values_file_path;
786 Parameter<std::string> time_dependence;
787 Parameter<std::string> traction_values_file_path;
788 Parameter<double> traction_multiplier;
790
791 Parameter<bool> undeforming_neu_face;
792 Parameter<double> value;
793 Parameter<bool> weakly_applied;
794 Parameter<bool> zero_out_perimeter;
795
796 Parameter<double> resistance;
797};
798
799/// @brief The OutputParameters class stores parameters for the
800/// Output XML element under Add_equation.
801///
802/// \code {.xml}
803/// <Output type="Volume_integral" >
804/// <Temperature> true </Temperature>
805/// </Output>
806/// \endcode
808{
809 public:
811
812 static const std::string xml_element_name_;
813
814 void print_parameters();
815 void set_values(tinyxml2::XMLElement* xml_elem);
816 bool get_output_value(const std::string& name);
817 std::string get_alias_value(const std::string& name);
818
820
821 // List of output names.
822 std::vector<Parameter<bool>> output_list;
823
824 // List of alias output names.
825 std::vector<Parameter<std::string>> alias_list;
826};
827
828/// @brief The PrecomputedSolutionParameters class stores parameters for the
829/// 'Precomputed_solution' XML element used to read in the data from a precomputed solution
830/// for the simulation state
831/// \code {.xml}
832/// <Precomputed_solution>
833/// <Project_from_face> lumen_wall </Project_from_face>
834/// </Precomputed_solution>
835/// \endcode
836
838{
839 public:
841
842 void set_values(tinyxml2::XMLElement* xml_elem);
843
844 static const std::string xml_element_name_;
845
846 Parameter<std::string> field_name;
847 Parameter<std::string> file_path;
848 Parameter<double> time_step;
849 Parameter<bool> use_precomputed_solution;
850};
851
852/// @brief The ProjectionParameters class stores parameters for the
853/// 'Add_projection' XML element used for fluid-structure interaction
854/// simulations.
855/// \code {.xml}
856/// <Add_projection name="wall_inner" >
857/// <Project_from_face> lumen_wall </Project_from_face>
858/// </Add_projection>
859/// \endcode
861{
862 public:
864
865 void set_values(tinyxml2::XMLElement* xml_elem);
866
867 static const std::string xml_element_name_;
868
870
871 Parameter<std::string> project_from_face;
872 Parameter<double> projection_tolerance;
873};
874
875/// @brief The VariableWallPropsParameters class stores parameters for
876/// variable wall properties for the CMM equation.
878{
879 public:
881 static const std::string xml_element_name_;
882 bool defined() const { return value_set; };
883 void set_values(tinyxml2::XMLElement* xml_elemnt);
884
885 Parameter<std::string> mesh_name;
886 Parameter<std::string> wall_properties_file_path;
887 bool value_set = false;
888};
889
890
891//////////////////////////////////////////////////////////
892// FluidViscosity //
893//////////////////////////////////////////////////////////
894
895// The following classes are used to store parameters for
896// various fluid viscosity models.
897
899{
900 public:
902 void print_parameters();
903 void set_values(tinyxml2::XMLElement* equation_params);
904 Parameter<double> constant_value;
905};
906
908{
909 public:
911 void print_parameters();
912 void set_values(tinyxml2::XMLElement* xml_elem);
913
914 Parameter<double> limiting_high_shear_rate_viscosity;
915 Parameter<double> limiting_low_shear_rate_viscosity;
916 Parameter<double> power_law_index;
917 Parameter<double> shear_rate_tensor_multipler;
918 Parameter<double> shear_rate_tensor_exponent;
919};
920
922{
923 public:
925 void print_parameters();
926 void set_values(tinyxml2::XMLElement* xml_elem);
927 Parameter<double> asymptotic_viscosity;
928 Parameter<double> yield_stress;
929 Parameter<double> low_shear_rate_threshold;
930};
931
933{
934 public:
936
937 static const std::string xml_element_name_;
938
939 static const std::string CONSTANT_MODEL;
940 static const std::string CARREAU_YASUDA_MODEL;
941 static const std::string CASSONS_MODEL;
942 static const std::set<std::string> model_names;
943
944 void print_parameters();
945 void set_values(tinyxml2::XMLElement* xml_elem);
946
948
949 FluidViscosityNewtonianParameters newtonian_model;
950 FluidViscosityCarreauYasudaParameters carreau_yasuda_model;
952};
953
954//////////////////////////////////////////////////////////
955// SolidViscosity //
956//////////////////////////////////////////////////////////
957
958// The following classes are used to store parameters for
959// various solid viscosity models.
960
962{
963 public:
965 void print_parameters();
966 void set_values(tinyxml2::XMLElement* equation_params);
967 Parameter<double> constant_value;
968};
969
971{
972 public:
974 void print_parameters();
975 void set_values(tinyxml2::XMLElement* equation_params);
976 Parameter<double> constant_value;
977};
978
980{
981 public:
983
984 static const std::string xml_element_name_;
985
986 static const std::string NEWTONIAN_MODEL;
987 static const std::string POTENTIAL_MODEL;
988 static const std::set<std::string> model_names;
989
990 void print_parameters();
991 void set_values(tinyxml2::XMLElement* xml_elem);
992
994
995 SolidViscosityNewtonianParameters newtonian_model;
996 SolidViscosityPotentialParameters potential_model;
997};
998
999
1000/// @brief The LinearAlgebraParameters class stores parameters for
1001/// the 'Linear_algebra' XML element.
1003{
1004 public:
1005 static const std::string xml_element_name_;
1008 void print_parameters();
1009 void set_values(tinyxml2::XMLElement* fsi_file);
1010 bool defined() const { return values_set_; };
1011
1012 bool values_set_ = false;
1014
1015 Parameter<std::string> assembly;
1016 Parameter<std::string> configuration_file;
1017 Parameter<std::string> preconditioner;
1018};
1019
1020/// @brief The LinearSolverParameters class stores parameters for
1021/// the 'LS' XML element.
1023{
1024 public:
1026
1027 void print_parameters();
1028 void set_values(tinyxml2::XMLElement* fsi_file);
1029
1030 static const std::string xml_element_name_;
1031
1033
1034 Parameter<double> absolute_tolerance;
1035 Parameter<int> krylov_space_dimension;
1036
1037 Parameter<int> max_iterations;
1038 Parameter<int> ns_cg_max_iterations;
1039 Parameter<double> ns_cg_tolerance;
1040 Parameter<int> ns_gm_max_iterations;
1041 Parameter<double> ns_gm_tolerance;
1042
1043 //Parameter<std::string> preconditioner;
1044
1045 Parameter<double> tolerance;
1046
1047 LinearAlgebraParameters linear_algebra;
1048};
1049
1050/// @brief The StimulusParameters class stores parameters for
1051/// 'Stimulus' XML element used to parameters for
1052/// pacemaker cells.
1053///
1054/// \code {.xml}
1055/// <Stimulus type="Istim" >
1056/// <Amplitude> -52.0 </Amplitude>
1057/// <Start_time> 0.0 </Start_time>
1058/// <Duration> 1.0 </Duration>
1059/// <Cycle_length> 10000.0 </Cycle_length>
1060/// </Stimulus>
1061/// \endcode
1063{
1064 public:
1066
1067 static const std::string xml_element_name_;
1068
1069 bool defined() const { return value_set; };
1070 void print_parameters();
1071 void set_values(tinyxml2::XMLElement* xml_elem);
1072
1074
1075 Parameter<double> amplitude;
1076 Parameter<double> cycle_length;
1077 Parameter<double> duration;
1078 Parameter<double> start_time;
1079
1080 bool value_set = false;
1081};
1082
1084{
1085 public:
1087
1088 static const std::string xml_element_name_;
1089
1090 bool defined() const { return value_set; };
1091 void print_parameters();
1092 void set_values(tinyxml2::XMLElement* xml_elem);
1093
1094 Parameter<std::string> x_coords_file_path;
1095 Parameter<std::string> y_coords_file_path;
1096 Parameter<std::string> z_coords_file_path;
1097
1098 bool value_set = false;
1099};
1100
1101/// @brief The FiberReinforcementStressParameters class stores fiber
1102/// reinforcement stress parameters for the 'Fiber_reinforcement_stress`
1103/// XML element.
1104///
1105/// \code {.xml}
1106/// <Fiber_reinforcement_stress type="Unsteady" >
1107/// <Temporal_values_file_path> fib_stress.dat </Temporal_values_file_path>
1108/// <Ramp_function> true </Ramp_function>
1109/// </Fiber_reinforcement_stress>
1110/// \endcode
1112{
1113 public:
1115
1116 static const std::string xml_element_name_;
1117
1118 bool defined() const { return value_set; };
1119 void print_parameters();
1120 void set_values(tinyxml2::XMLElement* xml_elem);
1121
1123
1124 Parameter<bool> ramp_function;
1125 Parameter<std::string> temporal_values_file_path;
1126 Parameter<double> value;
1127
1128 bool value_set = false;
1129};
1130
1131/// @brief The DomainParameters class stores parameters for the XML
1132/// 'Domain' element to specify properties for solving equations.
1133///
1134/// \code {.xml}
1135/// <Domain id="1" >
1136/// <Equation> fluid </Equation>
1137/// <Density> 1.06 </Density>
1138/// <Viscosity model="Constant" >
1139/// <Value> 0.04 </Value>
1140/// </Viscosity>
1141/// <Backflow_stabilization_coefficient> 0.2 </Backflow_stabilization_coefficient>
1142/// </Domain>
1143/// \endcode
1145{
1146 public:
1148
1149 static const std::string xml_element_name_;
1150
1151 void print_parameters();
1152 void set_values(tinyxml2::XMLElement* xml_elem);
1153
1154 // Parameters for sub-elements under the Domain element.
1155 ConstitutiveModelParameters constitutive_model;
1156 FiberReinforcementStressParameters fiber_reinforcement_stress;
1157 StimulusParameters stimulus;
1158 FluidViscosityParameters fluid_viscosity;
1159 SolidViscosityParameters solid_viscosity;
1160
1161 // Attributes.
1163
1164 Parameter<double> absolute_tolerance;
1165 VectorParameter<double> anisotropic_conductivity;
1166 Parameter<double> backflow_stabilization_coefficient;
1167
1168 Parameter<double> conductivity;
1169 //Parameter<std::string> constitutive_model_name;
1170 Parameter<double> continuity_stabilization_coefficient;
1171
1172 Parameter<double> density;
1173 Parameter<std::string> dilational_penalty_model;
1174
1175 Parameter<std::string> equation;
1176 Parameter<double> elasticity_modulus;
1177 Parameter<std::string> electrophysiology_model;
1178
1179 Parameter<double> feedback_parameter_for_stretch_activated_currents;
1180 Parameter<double> fluid_density;
1181 Parameter<double> force_x;
1182 Parameter<double> force_y;
1183 Parameter<double> force_z;
1184
1185 Parameter<double> isotropic_conductivity;
1186
1187 Parameter<double> mass_damping;
1188 Parameter<int> maximum_iterations;
1189 Parameter<double> momentum_stabilization_coefficient;
1190 Parameter<std::string> myocardial_zone;
1191
1192 Parameter<double> G_Na;
1193 Parameter<double> G_CaL;
1194 Parameter<double> G_Kr;
1195 Parameter<double> G_Ks;
1196 Parameter<double> G_to;
1197
1198 Parameter<double> tau_fi;
1199 Parameter<double> tau_si;
1200
1201 Parameter<std::string> ode_solver;
1202 Parameter<double> penalty_parameter;
1203 Parameter<double> poisson_ratio;
1204 Parameter<double> relative_tolerance;
1205
1206 Parameter<double> shell_thickness;
1207 Parameter<double> solid_density;
1208 Parameter<double> source_term;
1209 Parameter<double> time_step_for_integration;
1210
1211 // Inverse of Darcy permeability. Default value of 0.0 for Navier-Stokes and non-zero for Navier-Stokes-Brinkman
1212 Parameter<double> inverse_darcy_permeability;
1213};
1214
1215/// @brief The RemesherParameters class stores parameters for the
1216/// 'Remesher' XML element used for remeshing.
1217///
1218/// \code {.xml}
1219/// <Remesher type="Tetgen" >
1220/// <Max_edge_size name="lumen" value="0.7"> </Max_edge_size>
1221/// <Max_edge_size name="wall" value="0.5"> </Max_edge_size>
1222/// <Min_dihedral_angle> 10.0 </Min_dihedral_angle>
1223/// <Max_radius_ratio> 1.1 </Max_radius_ratio>
1224/// <Remesh_frequency> 1000 </Remesh_frequency>
1225/// <Frequency_for_copying_data> 1 </Frequency_for_copying_data>
1226/// </Remesher>
1227/// \endcode
1229{
1230 public:
1232
1233 static const std::string xml_element_name_;
1234 bool values_set_ = false;
1235
1236 bool defined() const { return values_set_; };
1237 void print_parameters();
1238 double get_edge_size(const std::string& name) const { return max_edge_sizes_.at(name); }
1239 bool has_edge_size(const std::string& name) const { return max_edge_sizes_.count(name) == 1; }
1240 void set_values(tinyxml2::XMLElement* mesh_elem);
1241
1242 // Values given in the 'Max_edge_size' element.
1243 std::map<std::string, double> max_edge_sizes_;
1244
1246 Parameter<double> min_dihedral_angle;
1247 Parameter<double> max_radius_ratio;
1248 Parameter<int> remesh_frequency;
1249 Parameter<int> frequency_for_copying_data;
1250};
1251
1252/// @brief The ContactParameters class stores parameters for the 'Contact''
1253/// XML element used to specify parameter values for contact
1254/// computations.
1256{
1257 public:
1259
1260 static const std::string xml_element_name_;
1261
1262 void print_parameters();
1263 void set_values(tinyxml2::XMLElement* xml_elem);
1264
1265 Parameter<double> closest_gap_to_activate_penalty;
1266
1267 Parameter<double> desired_separation;
1268
1269 Parameter<double> min_norm_of_face_normals;
1270
1272
1273 Parameter<double> penalty_constant;
1274};
1275
1276/// @brief The EquationParameters class stores parameters for the 'Add_equation'
1277/// XML element used to specify an equation to be solved (e.g. fluid).
1278///
1279/// \code {.xml}
1280/// <Add_equation type="FSI" >
1281/// <Coupled> true </Coupled>
1282/// <Min_iterations> 1 </Min_iterations>
1283/// <Max_iterations> 1 </Max_iterations>
1284/// .
1285/// .
1286/// .
1287/// </Add_equation>
1288/// \endcode
1290{
1291 public:
1293
1294 static const std::string xml_element_name_;
1295
1296 void print_parameters();
1297 void set_values(tinyxml2::XMLElement* xml_elem);
1298
1299 Parameter<double> backflow_stabilization_coefficient;
1300
1301 Parameter<double> conductivity;
1302 Parameter<double> continuity_stabilization_coefficient;
1303 Parameter<bool> coupled;
1304
1305 Parameter<double> density;
1306 Parameter<std::string> dilational_penalty_model;
1307
1308 Parameter<double> elasticity_modulus;
1309
1310 Parameter<std::string> initialize;
1311 Parameter<bool> initialize_rcr_from_flow;
1312
1313 Parameter<int> max_iterations;
1314 Parameter<int> min_iterations;
1315 Parameter<double> momentum_stabilization_coefficient;
1316
1317 Parameter<double> penalty_parameter;
1318 Parameter<double> poisson_ratio;
1319 Parameter<bool> prestress;
1320
1321 Parameter<double> source_term;
1322 Parameter<double> tolerance;
1323
1325 Parameter<bool> use_taylor_hood_type_basis;
1326
1327 // Inverse of Darcy permeability. Default value of 0.0 for Navier-Stokes and non-zero for Navier-Stokes-Brinkman
1328 Parameter<double> inverse_darcy_permeability;
1329
1330 // Sub-element parameters.
1331 //
1332 std::vector<BodyForceParameters*> body_forces;
1333
1334 std::vector<BoundaryConditionParameters*> boundary_conditions;
1335
1336 CoupleCplBCParameters couple_to_cplBC;
1337 CoupleGenBCParameters couple_to_genBC;
1338
1339 svZeroDSolverInterfaceParameters svzerodsolver_interface_parameters;
1340
1341 DomainParameters* default_domain = nullptr;
1342
1343 std::vector<DomainParameters*> domains;
1344
1345 LinearSolverParameters linear_solver;
1346
1347 std::vector<OutputParameters*> outputs;
1348
1349 RemesherParameters remesher;
1350
1351 VariableWallPropsParameters variable_wall_properties;
1352
1353 FluidViscosityParameters fluid_viscosity;
1354
1355 SolidViscosityParameters solid_viscosity;
1356
1357 ECGLeadsParameters ecg_leads;
1358};
1359
1360/// @brief The GeneralSimulationParameters class stores paramaters for the
1361/// 'GeneralSimulationParameters' XML element.
1362///
1363/// \code {.xml}
1364/// <GeneralSimulationParameters>
1365/// <Continue_previous_simulation> 0 </Continue_previous_simulation>
1366/// <Number_of_spatial_dimensions> 3 </Number_of_spatial_dimensions>
1367/// <Number_of_time_steps> 1 </Number_of_time_steps>
1368/// <Time_step_size> 1e-4 </Time_step_size>
1369/// <Spectral_radius_of_infinite_time_step> 0.50 </Spectral_radius_of_infinite_time_step>
1370/// <Searched_file_name_to_trigger_stop> STOP_SIM </Searched_file_name_to_trigger_stop>
1371/// <Save_results_to_VTK_format> true </Save_results_to_VTK_format>
1372/// <Name_prefix_of_saved_VTK_files> result </Name_prefix_of_saved_VTK_files>
1373/// <Increment_in_saving_VTK_files> 1 </Increment_in_saving_VTK_files>
1374/// <Start_saving_after_time_step> 1 </Start_saving_after_time_step>
1375/// <Increment_in_saving_restart_files> 1 </Increment_in_saving_restart_files>
1376/// <Convert_BIN_to_VTK_format> 0 </Convert_BIN_to_VTK_format>
1377/// <Verbose> 1 </Verbose>
1378/// <Warning> 0 </Warning>
1379/// <Debug> 0 </Debug>
1380/// <Simulation_requires_remeshing> true </Simulation_requires_remeshing>
1381/// </GeneralSimulationParameters>
1382/// \endcode
1384{
1385 public:
1387
1388 void print_parameters();
1389 void set_values(tinyxml2::XMLElement* xml_element);
1390
1391 std::string xml_element_name;
1392
1393 Parameter<bool> check_ien_order;
1394 Parameter<bool> continue_previous_simulation;
1395 Parameter<bool> convert_bin_to_vtk_format;
1396 Parameter<bool> debug;
1397 Parameter<bool> overwrite_restart_file;
1398 Parameter<bool> save_averaged_results;
1399 Parameter<bool> save_results_to_vtk_format;
1400 Parameter<bool> simulation_requires_remeshing;
1401 Parameter<bool> start_averaging_from_zero;
1402 Parameter<bool> verbose;
1403 Parameter<bool> warning;
1404
1405 Parameter<double> spectral_radius_of_infinite_time_step;
1406 Parameter<double> time_step_size;
1407
1408 Parameter<int> increment_in_saving_restart_files;
1409 Parameter<int> increment_in_saving_vtk_files;
1410 Parameter<int> number_of_spatial_dimensions;
1411 Parameter<int> number_of_initialization_time_steps;
1412 Parameter<int> start_saving_after_time_step;
1413 Parameter<int> starting_time_step;
1414 Parameter<int> number_of_time_steps;
1415
1416 Parameter<std::string> name_prefix_of_saved_vtk_files;
1417 Parameter<std::string> restart_file_name;
1418 Parameter<std::string> searched_file_name_to_trigger_stop;
1419 Parameter<std::string> save_results_in_folder;
1420 Parameter<std::string> simulation_initialization_file_path;
1421};
1422
1423/// @brief The FaceParameters class is used to store parameters for the
1424/// 'Add_face' XML element.
1426{
1427 public:
1429
1430 void print_parameters();
1431 void set_values(tinyxml2::XMLElement* xml_elem);
1432
1433 static const std::string xml_element_name_;
1434
1435 Parameter<std::string> end_nodes_face_file_path;
1436 Parameter<std::string> face_file_path;
1438
1439 Parameter<double> quadrature_modifier_TRI3;
1440};
1441
1442/// @brief The MeshParameters class is used to store paramaters for the
1443/// 'Add_mesh' XML element.
1444///
1445/// \code {.xml}
1446/// <Add_mesh name="lumen" >
1447/// <Mesh_file_path> mesh/lumen/mesh-complete.mesh.vtu </Mesh_file_path>
1448///
1449/// <Add_face name="lumen_inlet">
1450/// <Face_file_path> mesh/lumen/mesh-surfaces/lumen_inlet.vtp </Face_file_path>
1451/// </Add_face>
1452///
1453/// <Add_face name="lumen_outlet">
1454/// <Face_file_path> mesh/lumen/mesh-surfaces/lumen_outlet.vtp </Face_file_path>
1455/// </Add_face>
1456///
1457/// <Add_face name="lumen_wall">
1458/// <Face_file_path> mesh/lumen/mesh-surfaces/lumen_wall.vtp </Face_file_path>
1459/// </Add_face>
1460///
1461/// <Domain> 0 </Domain>
1462///
1463/// </Add_mesh>
1464/// \endcode
1466{
1467 public:
1469
1470 static const std::string xml_element_name_;
1471
1472 void print_parameters();
1473 void set_values(tinyxml2::XMLElement* mesh_elem);
1474 std::string get_name() const { return name.value(); };
1475 std::string get_path() const { return mesh_file_path.value(); };
1476
1477 std::vector<FaceParameters*> face_parameters;
1478
1479 // Add_mesh name=
1481
1482 // Parameters under Add_mesh
1483 //
1484 Parameter<int> domain_id;
1485 Parameter<std::string> domain_file_path;
1486
1487 VectorParameter<std::string> fiber_direction_file_paths;
1488 //Parameter<std::string> fiber_direction_file_path;
1489 std::vector<VectorParameter<double>> fiber_directions;
1490 //VectorParameter<double> fiber_direction;
1491
1492 Parameter<std::string> initial_displacements_file_path;
1493 Parameter<std::string> initial_pressures_file_path;
1494 Parameter<bool> initialize_rcr_from_flow;
1495 Parameter<std::string> initial_velocities_file_path;
1496
1497 Parameter<std::string> mesh_file_path;
1498 Parameter<double> mesh_scale_factor;
1499 Parameter<std::string> prestress_file_path;
1500
1501 Parameter<bool> set_mesh_as_fibers;
1502 Parameter<bool> set_mesh_as_shell;
1503
1504 Parameter<double> quadrature_modifier_TET4;
1505};
1506
1507//////////////////////////////////////////////////////////
1508// Resistive immersed surfaces method //
1509//////////////////////////////////////////////////////////
1510
1511/// @brief The RISProjectionParameters class stores parameters for the
1512/// 'Add_RIS_projection' XML element used for RIS valve simulations.
1513/// \code {.xml}
1514/// <Add_RIS_projection name="left_ris" >
1515/// <Project_from_face> right_ris </Project_from_face>
1516/// <Resistance> 1.e6 </Resistance>
1517/// </Add_RIS_projection>
1518/// \endcode
1520{
1521 public:
1523
1524 void set_values(tinyxml2::XMLElement* xml_elem);
1525
1526 static const std::string xml_element_name_;
1527
1529
1530 Parameter<std::string> project_from_face;
1531 Parameter<double> resistance;
1532 Parameter<double> projection_tolerance;
1533};
1534
1535/// @brief The URISFaceParameters class is used to store parameters for the
1536/// 'Add_URIS_face' XML element.
1538{
1539 public:
1541
1542 void print_parameters();
1543 void set_values(tinyxml2::XMLElement* xml_elem);
1544
1545 static const std::string xml_element_name_;
1546
1547 Parameter<std::string> name; // Name of the valve surface
1548
1549 Parameter<std::string> face_file_path; // File path for the valve surface
1550 Parameter<std::string> open_motion_file_path; // File path for the open motion of the valve
1551 Parameter<std::string> close_motion_file_path; // File path for the close motion of the valve
1552
1553};
1554
1555/// @brief The URISMeshParameters class is used to store paramaters for the
1556/// 'Add_URIS_mesh' XML element.
1557///
1558/// \code {.xml}
1559/// <Add_uris_mesh name="MV" >
1560/// <Add_uris_face name="LCC" >
1561/// <Face_file_path> meshes/uris_face.vtu </Face_file_path>
1562/// <Open_motion_file_path> meshes/uris_facemotion_open.dat </Open_motion_file_path>
1563/// <Close_motion_file_path> meshes/uris_facemotion_close.dat </Close_motion_file_path>
1564/// </Add_uris_face>
1565/// <Mesh_scale_factor> 1.0 </Mesh_scale_factor>
1566/// <Thickness> 0.25 </Thickness>
1567/// <Resistance> 1.0e5 </Resistance>
1568/// <Positive_flow_normal_file> meshes/normal.dat </Positive_flow_normal_file>
1569/// </Add_uris_mesh>
1570/// \endcode
1572{
1573 public:
1575
1576 static const std::string xml_element_name_;
1577
1578 void print_parameters();
1579 void set_values(tinyxml2::XMLElement* mesh_elem);
1580 std::string get_name() const { return name.value(); };
1581 // std::string get_path() const { return mesh_file_path.value(); };
1582
1583 std::vector<URISFaceParameters*> URIS_face_parameters;
1584
1585 // Add_mesh name
1586 Parameter<std::string> name; // Name of the valve mesh
1587
1588 // Parameters under Add_URIS_mesh
1589 Parameter<double> mesh_scale_factor; // Scale factor for the mesh
1590 Parameter<double> thickness; // Thickness of the valve
1591 Parameter<double> close_thickness; // Thickness of the valve when it is closed
1592 Parameter<double> resistance; // Resistance of the valve
1593 Parameter<double> resistance_close; // Resistance of the valve when it is closed
1594 Parameter<bool> valve_starts_as_closed; // Whether the valve starts as closed
1595 Parameter<std::string> positive_flow_normal_file_path; // File path for the positive flow normal
1596
1597};
1598
1599
1600
1601/// @brief The Parameters class stores parameter values read in from a solver input file.
1603
1604 public:
1605 Parameters();
1606
1607 static const std::set<std::string> constitutive_model_names;
1608 static const std::set<std::string> equation_names;
1609 static const std::string FSI_FILE;
1610
1611 void get_logging_levels(int& verbose, int& warning, int& debug);
1612 void print_parameters();
1613 void read_xml(std::string file_name);
1614
1615 void set_contact_values(tinyxml2::XMLElement* root_element);
1616 void set_equation_values(tinyxml2::XMLElement* root_element);
1617 void set_mesh_values(tinyxml2::XMLElement* root_element);
1618 void set_precomputed_solution_values(tinyxml2::XMLElement* root_element);
1619 void set_projection_values(tinyxml2::XMLElement* root_element);
1620 void set_svzerodsolver_interface_values(tinyxml2::XMLElement* root_element);
1621
1622 void set_RIS_projection_values(tinyxml2::XMLElement* root_element);
1623 void set_URIS_mesh_values(tinyxml2::XMLElement* root_element);
1624
1625 // Objects representing each parameter section of XML file.
1626 ContactParameters contact_parameters;
1627 GeneralSimulationParameters general_simulation_parameters;
1628 std::vector<MeshParameters*> mesh_parameters;
1629 std::vector<EquationParameters*> equation_parameters;
1630 std::vector<ProjectionParameters*> projection_parameters;
1631 PrecomputedSolutionParameters precomputed_solution_parameters;
1632
1633 std::vector<RISProjectionParameters*> RIS_projection_parameters;
1634 std::vector<URISMeshParameters*> URIS_mesh_parameters;
1635
1636};
1637
1638#endif
1639
Body force over a mesh using the "Add_BF" command.
Definition Parameters.h:687
static const std::string xml_element_name_
Define the XML element name for boundary condition parameters.
Definition Parameters.h:692
The BoundaryConditionParameters stores paramaters for various type of boundary conditions under the A...
Definition Parameters.h:743
static const std::string xml_element_name_
Define the XML element name for equation boundary condition parameters.
Definition Parameters.h:748
RCR values for Neumann BC type.
Definition Parameters.h:722
BoundaryConditionRCRParameters()
RCR values for Neumann BC type.
Definition Parameters.cpp:344
The CANNParameters class stores the parameters table rows for xml element "Constitutive_model type=CA...
Definition Parameters.h:555
CANNParameters()
Constructor for CANNParameters class. Initializes parameter table.
Definition Parameters.cpp:851
~CANNParameters()
Destructor for CANNParameters class. Deletes memory dynamically allocated to the rows of the table.
Definition Parameters.cpp:863
The CANNRowParameters class is used to store the parameters for each row of the CANN table for the xm...
Definition Parameters.h:527
static const std::string xml_element_name_
Process parameters for the "Add_row" xml element.
Definition Parameters.h:534
The ConstitutiveModelParameters class store parameters for various constitutive models.
Definition Parameters.h:571
void check_constitutive_model(const Parameter< std::string > &eq_type)
Check if a constitutive model is valid for the given equation.
Definition Parameters.cpp:963
static const std::map< std::string, std::string > constitutive_model_types
Supported constitutive model types and their aliases.
Definition Parameters.h:510
static const std::string xml_element_name_
Process parameters for various constitutive models.
Definition Parameters.h:578
The ContactParameters class stores parameters for the 'Contact'' XML element used to specify paramete...
Definition Parameters.h:1256
static const std::string xml_element_name_
Process parameters for the 'Contact' XML element used to specify parameters for contact computation.
Definition Parameters.h:1260
Couple to reduced-order models.
Definition Parameters.h:608
static const std::string xml_element_name_
Couple to reduced-order models.
Definition Parameters.h:612
Coupling to GenBC.
Definition Parameters.h:634
static const std::string xml_element_name_
Coupling to GenBC.
Definition Parameters.h:638
The DomainParameters class stores parameters for the XML 'Domain' element to specify properties for s...
Definition Parameters.h:1145
static const std::string xml_element_name_
Define the XML element name for domain parameters.
Definition Parameters.h:1149
Definition Parameters.h:1084
static const std::string xml_element_name_
Define the XML element name for ECG leads parameters.
Definition Parameters.h:1088
The EquationParameters class stores parameters for the 'Add_equation' XML element used to specify an ...
Definition Parameters.h:1290
static const std::string xml_element_name_
Define the XML element name for equation parameters.
Definition Parameters.h:1294
The FaceParameters class is used to store parameters for the 'Add_face' XML element.
Definition Parameters.h:1426
static const std::string xml_element_name_
Process parameters for the 'Add_face' XML element.
Definition Parameters.h:1433
The FiberReinforcementStressParameters class stores fiber reinforcement stress parameters for the 'Fi...
Definition Parameters.h:1112
static const std::string xml_element_name_
Define the XML element name for fiber reinforcement stress parameters.
Definition Parameters.h:1116
Definition Parameters.h:908
Definition Parameters.h:922
Definition Parameters.h:899
Definition Parameters.h:933
static const std::string xml_element_name_
Process parameters for various fluid viscosity models.
Definition Parameters.h:937
The GeneralSimulationParameters class stores paramaters for the 'GeneralSimulationParameters' XML ele...
Definition Parameters.h:1384
GeneralSimulationParameters()
Process paramaters for the 'GeneralSimulationParameters' XML element.
Definition Parameters.cpp:2148
void set_values(tinyxml2::XMLElement *xml_element)
Set general parameters values from XML.
Definition Parameters.cpp:2207
Definition Parameters.h:442
Definition Parameters.h:480
Definition Parameters.h:459
Definition Parameters.h:427
The LinearAlgebraParameters class stores parameters for the 'Linear_algebra' XML element.
Definition Parameters.h:1003
void check_input_parameters()
Check the validity of the input parameters.
Definition Parameters.cpp:2833
static const std::string xml_element_name_
Define the XML element name for equation output parameters.
Definition Parameters.h:1005
The LinearSolverParameters class stores parameters for the 'LS' XML element.
Definition Parameters.h:1023
static const std::string xml_element_name_
Define the XML element name for equation output parameters.
Definition Parameters.h:1030
The MeshParameters class is used to store paramaters for the 'Add_mesh' XML element.
Definition Parameters.h:1466
static const std::string xml_element_name_
Define the XML element name for mesh parameters.
Definition Parameters.h:1470
Definition Parameters.h:495
Definition Parameters.h:507
NeoHookeanParameters()
There are no parameters associated with a Neohookean model.
Definition Parameters.cpp:748
The OutputParameters class stores parameters for the Output XML element under Add_equation.
Definition Parameters.h:808
std::string get_alias_value(const std::string &name)
Get the value of an alias by name.
Definition Parameters.cpp:1191
bool get_output_value(const std::string &name)
Get the value of an output by name.
Definition Parameters.cpp:1203
static const std::string xml_element_name_
Define the XML element name for equation output parameters.
Definition Parameters.h:812
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:1602
void read_xml(std::string file_name)
Set the simulation parameter values given in an XML format file.
Definition Parameters.cpp:123
The PrecomputedSolutionParameters class stores parameters for the 'Precomputed_solution' XML element ...
Definition Parameters.h:838
The ProjectionParameters class stores parameters for the 'Add_projection' XML element used for fluid-...
Definition Parameters.h:861
static const std::string xml_element_name_
Define the XML element name for mesh parameters.
Definition Parameters.h:867
The RISProjectionParameters class stores parameters for the 'Add_RIS_projection' XML element used for...
Definition Parameters.h:1520
static const std::string xml_element_name_
Define the XML element name for mesh parameters.
Definition Parameters.h:1526
The RemesherParameters class stores parameters for the 'Remesher' XML element used for remeshing.
Definition Parameters.h:1229
static const std::string xml_element_name_
Define the XML element name for mesh parameters.
Definition Parameters.h:1233
Definition Parameters.h:962
Definition Parameters.h:980
static const std::string xml_element_name_
Process parameters for various solid viscosity models.
Definition Parameters.h:984
Definition Parameters.h:971
Definition Parameters.h:516
StVenantKirchhoffParameters()
There are no parameters associated with a StVenantKirchhoff model.
Definition Parameters.cpp:762
The StimulusParameters class stores parameters for 'Stimulus' XML element used to parameters for pace...
Definition Parameters.h:1063
static const std::string xml_element_name_
Define the XML element name for equation output parameters.
Definition Parameters.h:1067
The URISFaceParameters class is used to store parameters for the 'Add_URIS_face' XML element.
Definition Parameters.h:1538
static const std::string xml_element_name_
Process parameters for the 'Add_URIS_face' XML element.
Definition Parameters.h:1545
The URISMeshParameters class is used to store paramaters for the 'Add_URIS_mesh' XML element.
Definition Parameters.h:1572
static const std::string xml_element_name_
Define the XML element name for mesh parameters.
Definition Parameters.h:1576
The VariableWallPropsParameters class stores parameters for variable wall properties for the CMM equa...
Definition Parameters.h:878
static const std::string xml_element_name_
The VariableWallPropsParameters class stores parameters for variable wall properties for the CMM equa...
Definition Parameters.h:881
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:657
struct to define a row of CANN model parameter table
Definition Parameters.h:261