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