svMultiPhysics
Loading...
Searching...
No Matches
ComMod.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// The classes defined here duplicate the data structures in the Fortran COMMOD module
5// defined in MOD.f.
6//
7// All of the data structures used for the mesh, boundarsy conditions and solver parameters, etc.
8// are defined here.
9
10#ifndef COMMOD_H
11#define COMMOD_H
12
13#include "Array.h"
14#include "Array3.h"
15#include "CepMod.h"
16#include "ChnlMod.h"
17#include "CmMod.h"
18#include "CoupledBoundaryCondition.h"
19#include "FourierInterpolation.h"
20#include "Fibers.h"
21#include "Parameters.h"
22#include "RobinBoundaryCondition.h"
23#include "SolutionStates.h"
24#include "Timer.h"
25#include "Vector.h"
26#include "ActiveStress.h"
27
28#include "DebugMsg.h"
29
30#include "consts.h"
31
32#include "fils_struct.hpp"
33
34#include "Parameters.h"
35
36#include "ArtificialNeuralNetMaterial.h"
37
38#include <array>
39#include <iostream>
40#include <memory>
41#include <string>
42#include <utility>
43#include <vector>
44#include <fstream>
45#include <sstream>
46
47class LinearAlgebra;
48
49/// @brief Moving boundary data structure (used for general BC)
50//
51class MBType
52{
53 public:
54
55 bool defined() { return dof != 0; };
56
57 // Degrees of freedom of d(:,.,.)
58 int dof = 0;
59
60 // Number of time points to be read
61 int nTP = 0;
62
63 // The period of data
64 double period = 0.0;
65
66 // Time points
68
69 // Displacements at each direction, location, and time point
71};
72
74{
75 public:
76
77 // Proximal resistance
78 double Rp = 0.0;
79
80 // Capacitance
81 double C = 0.0;
82
83 // Distance resistance
84 double Rd = 0.0;
85
86 // Distal pressure
87 double Pd = 0.0;
88
89 // Initial value
90 double Xo = 0.0;
91};
92
93/// @brief Boundary condition data type
94//
95class bcType
96{
97 public:
98 // Strong/Weak application of Dirichlet BC
99 bool weakDir = false;
100
101 // Whether load vector changes with deformation
102 // (Neu - struct/ustruct only)
103 bool flwP = false;
104
105 // Strong/Weak application of Dirichlet BC
106 int clsFlgRis = 0;
107
108 // Pre/Res/Flat/Para... boundary types
109 //
110 // This stores differnt BCs as bitwise values.
111 //
112 int bType = 0;
113
114 // Pointer to coupledBC%face
115 int cplBCptr = -1;
116
117 // The face index that corresponds to this BC
118 int iFa = -1;
119
120 // The mesh index that corresponds to this BC
121 int iM = -1;
122
123 // Pointer to FSILS%bc
124 int lsPtr = -1;
125
126 // Undeforming Neu BC master-slave node parameters.
127 int masN = 0;
128
129 // Defined steady value
130 double g = 0.0;
131
132 // Neu: defined resistance
133 double r = 0.0;
134
135 // Robin: VTP file path for per-node stiffness and damping
136 std::string robin_vtp_file = "";
137
138 // RIS0D: resistance
139 double resistance = 0.0;
140
141 // Penalty parameters for weakly applied Dir BC
142 Vector<double> tauB{0.0, 0.0};
143 //double tauB[2];
144
145 // Direction vector for imposing the BC
146 Vector<int> eDrn;
147
148 // Defined steady vector (traction)
150
151 // Spatial dependant BC (profile data)
153
154 // General BC (unsteady and UD combination)
155 //
156 // This is declare ALLOCATABLE in MOD.f.
157 //
158 MBType gm;
159
160 // Time dependant BC (Unsteady imposed value);
161 //
162 // This is declare ALLOCATABLE in MOD.f.
163 //
165
166 // Neu: RCR
167 rcrType RCR;
168
169 // Robin BC class
170 RobinBoundaryCondition robin_bc;
171
172 // Coupled BC class
173 CoupledBoundaryCondition coupled_bc;
174
175};
176
177/// @brief Class storing data for B-Splines.
178//
179class bsType
180{
181 public:
182
183 // Number of knots (p + nNo + 1)
184 int n = 0;
185
186 // Number of Gauss points for integration
187 int nG = 0;
188
189 // Number of knot spans (element)
190 int nEl = 0;
191
192 // Number of control points (nodes)
193 int nNo = 0;
194
195 // Number of sample points in each element (for output)
196 int nSl = 0;
197
198 // The order
199 int p = 0;
200
201 // Knot vector.
203};
204
205/// @brief Function spaces (basis) type.
206//
207class fsType {
208
209 public:
210
211 fsType();
212
213 void destroy();
214
215 // Whether the basis function is linear
216 bool lShpF = false;
217
218 // Element type
219 consts::ElementType eType = consts::ElementType::NA;
220
221 // Number of basis functions, typically equals msh%eNoN
222 int eNoN = 0;
223
224 // Number of Gauss points for integration
225 int nG = 0;
226
227 // Gauss weights
229
230 // Gauss integration points in parametric space
231 Array<double> xi;
232
233 // Bounds on Gauss integration points in parametric space
234 Array<double> xib;
235
236 // Parent shape function
237 Array<double> N;
238
239 // Bounds on shape functions
240 Array<double> Nb;
241
242 // Parent shape functions gradient
244
245 // Second derivatives of shape functions - used for shells & IGA
246 Array3<double> Nxx;
247};
248
249//--------
250// bfType
251//--------
252// Body force data structure type
253//
255{
256 public:
257
258 std::string file_name;
259 std::string mesh_name;
260
261 // Type of body force applied
262 int bType = 0;
263
264 // No. of dimensions (1 or nsd)
265 int dof = 0;
266
267 // Mesh index corresponding to this body force
268 int iM = -1;
269
270 // Steady value
272
273 // Steady but spatially dependant
274 Array<double> bx;
275
276 // Time dependant (unsteady imposed value)
278
279 // General (unsteady and spatially dependent combination)
280 MBType bm;
281};
282
283/// @brief Structural domain type
284//
285class stModelType
286{
287 public:
288 // Type of constitutive model (volumetric) for struct/FSI
289 consts::ConstitutiveModelType volType = consts::ConstitutiveModelType::stIso_NA;
290
291 // Penalty parameter
292 double Kpen = 0.0;
293
294 // Type of constitutive model (isochoric) for struct/FSI
295 consts::ConstitutiveModelType isoType = consts::ConstitutiveModelType::stIso_NA;
296
297 // Parameters specific to the constitutive model (isochoric)
298 // NeoHookean model (C10 = mu/2)
299 double C10 = 0.0;
300
301 // Mooney-Rivlin model (C10, C01)
302 double C01 = 0.0;
303
304 // Holzapfel model(a, b, aff, bff, ass, bss, afs, bfs, kap)
305 double a = 0.0;
306 double b = 0.0;
307 double aff = 0.0;
308 double bff = 0.0;
309 double ass = 0.0;
310 double bss = 0.0;
311 double afs = 0.0;
312 double bfs = 0.0;
313
314 // Collagen fiber dispersion parameter (Holzapfel model)
315 double kap = 0.0;
316
317 // Heaviside function parameter (Holzapfel-Ogden model)
318 double khs = 100.0;
319
320 // Lee-Sacks model
321 double a0 = 0.0;
322 double b1 = 0.0;
323 double b2 = 0.0;
324 double mu0 = 0.0;
325
326 // CANN Model/UAnisoHyper_inv
328
329 stModelType();
330};
331
332
333/// @brief Fluid viscosity model type
334//
336{
337 public:
338
339 // Type of constitutive model for fluid viscosity
340 consts::FluidViscosityModelType viscType = consts::FluidViscosityModelType::viscType_NA;
341
342 // Limiting zero shear-rate viscosity value
343 double mu_o = 0.0;
344
345 // Limiting high shear-rate viscosity (asymptotic) value (at infinity)
346 double mu_i = 0.0;
347
348 // Strain-rate tensor multiplier
349 double lam = 0.0;
350
351 // Strain-rate tensor exponent
352 double a = 0.0;
353
354 // Power-law exponent
355 double n = 0.0;
356};
357
358/// @brief Fluid viscosity model type
359//
361{
362 public:
363
364 // Type of constitutive model for fluid viscosity
365 consts::SolidViscosityModelType viscType = consts::SolidViscosityModelType::viscType_NA;
366
367 // Viscosity value
368 double mu = 0.0;
369};
370
371/// @brief Domain type is to keep track with element belong to which domain
372/// and also different physical quantities
373//
374class dmnType
375{
376 public:
377 dmnType();
378 ~dmnType();
379
380 // The domain ID. Default includes entire domain
381 int Id = -1;
382
383 // Which physics must be solved in this domain
384 consts::EquationType phys = consts::EquationType::phys_NA;
385
386 // The volume of this domain
387 double v = 0.0;
388
389 // General physical properties such as density, elastic modulus...
390 // FIX davep double prop[maxNProp] ;
391 std::map<consts::PhysicalPropertyType,double> prop;
392 //double prop[consts::maxNProp];
393
394 // Electrophysiology model
395 cepModelType cep;
396
397 /// Active stress model name.
398 std::string active_stress_model_name = "";
399
400 /// Active stress model.
401 std::shared_ptr<ActiveStress> active_stress;
402
403 // Structure material model
404 stModelType stM;
405
406 // Viscosity model for fluids
407 fluidViscModelType fluid_visc;
408
409 // Viscosity model for solids
410 solidViscModelType solid_visc;
411};
412
413/// @brief Mesh adjacency (neighboring element for each element)
414//
416{
417 public:
418 void destroy();
419
420 // No of non-zeros
421 int nnz = 0;
422
423 // Column pointer
424 Vector<int> pcol;
425
426 // Row pointer
427 Vector<int> prow;
428
429};
430
431/// @brief Tracer type used for immersed boundaries. Identifies traces of
432/// nodes and integration points on background mesh elements
433//
435{
436 public:
437 // No. of non-zero nodal traces
438 int n = 0;
439
440 // No. of non-zero integration point traces
441 int nG = 0;
442
443 // Local to global nodes maping nNo --> tnNo
444 Vector<int> gN;
445
446 // Self pointer of each trace to the IB integration point and
447 // element ID
448 Array<int> gE;
449
450 // Nodal trace pointer array stores two values for each trace.
451 // (1) background mesh element to which the trace points to,
452 // (2) mesh ID
453 Array<int> nptr;
454
455 // Integration point tracer array stores two values for each trace
456 // (1) background mesh element to which the trace points to,
457 // (2) mesh ID
458 Array<int> gptr;
459
460 // Parametric coordinate for each nodal trace
461 Array<double> xi;
462
463 // Parametric coordinate for each Gauss point trace
464 Array<double> xiG;
465};
466
467/// @brief The face type containing mesh at boundary
468//
469class faceType
470{
471 public:
472 faceType();
473 ~faceType();
474
475 void destroy();
476
477 //faceType& operator=(const faceType& rhs);
478
479 // Parametric direction normal to this face (NURBS)
480 int d = 0;
481
482 // Number of nodes (control points) in a single element
483 int eNoN = 0;
484
485 // Element type
486 consts::ElementType eType = consts::ElementType::NA;
487
488 // The mesh index that this face belongs to
489 int iM = 0;
490
491 // Number of elements
492 int nEl = 0;
493
494 // Global number of elements
495 int gnEl = 0;
496
497 // Number of function spaces
498 int nFs = 0;
499
500 // Number of Gauss points for integration
501 int nG = 0;
502
503 // Number of nodes
504 int nNo = 0;
505
506 // Global element Ids
507 Vector<int> gE;
508
509 // Global node Ids
510 Vector<int> gN;
511
512 // Global to local maping tnNo --> nNo
513 Vector<int> lN;
514
515 // Connectivity array
516 Array<int> IEN;
517
518 // EBC array (gE + gIEN)
519 Array<int> gebc;
520
521 // Surface area
522 double area = 0.0;
523
524 // Gauss point weights
526
527 // Position coordinates
528 Array<double> x;
529
530 // Gauss points in parametric space
531 Array<double> xi;
532
533 // Shape functions at Gauss points
534 Array<double> N;
535
536 // Normal vector to each nodal point
537 Array<double> nV;
538
539 // Shape functions derivative at Gauss points
540 // double Nx(:,:,:);
542
543 // Second derivatives of shape functions - for shells & IGA
544 // double Nxx(:,:,:);
545 Array3<double> Nxx;
546
547 // Face name for flux files
548 std::string name;
549
550 // Face nodal adjacency
551 adjType nAdj;
552
553 // Face element adjacency
554 adjType eAdj;
555
556 // Function spaces (basis)
557 std::vector<fsType> fs;
558
559 // TRI3 quadrature modifier
560 double qmTRI3 = 2.0/3.0;
561};
562
563/// @brief Store options for output types.
564//
566 bool boundary_integral = false;
567 bool spatial = false;
568 bool volume_integral = false;
569
570 bool no_options_set() {
571 return !(boundary_integral | spatial | volume_integral);
572 }
573
574 void set_option(consts::OutputType type, bool value)
575 {
576 if (type == consts::OutputType::boundary_integral) {
577 boundary_integral = value;
578 } else if (type == consts::OutputType::spatial) {
579 spatial = value;
580 } else if (type == consts::OutputType::volume_integral) {
581 volume_integral = value;
582 }
583 }
584};
585
586/// @brief Declared type for outputed variables
587//
589{
590 public:
591
592 // Options to write various output types.
593 OutputOptions options;
594
595 // The group that this belong to (one of outType_*)
596 consts::OutputNameType grp = consts::OutputNameType::outGrp_NA;
597
598 // Length of the outputed variable
599 int l = 0;
600
601 // Offset from the first index
602 int o = 0;
603
604 // The name to be used for the output and also in input file
605 std::string name;
606};
607
608/// @brief Linear system of equations solver type
609//
611{
612 public:
613
614 /// @brief LS solver (IN)
615 consts::SolverType LS_type = consts::SolverType::lSolver_NA;
616
617 /// @brief Successful solving (OUT)
618 bool suc = false;
619
620 /// @brief Maximum iterations (IN)
621 int mItr = 1000;
622
623 /// @brief Space dimension (IN)
624 int sD = 0;
625
626 /// @brief Number of iteration (OUT)
627 int itr = 0;
628
629 /// @brief Number of Ax multiple (OUT)
630 int cM = 0;
631
632 /// @brief Number of |x| norms (OUT)
633 int cN = 0;
634
635 /// @brief Number of <x.y> dot products (OUT)
636 int cD = 0;
637
638 /// @brief Only for data alignment (-)
639 int reserve = 0;
640
641 /// @brief Absolute tolerance (IN)
642 double absTol = 1e-08;
643
644 /// @brief Relative tolerance (IN)
645 double relTol = 0.0;
646
647 /// @brief Initial norm of residual (OUT)
648 double iNorm = 0.0;
649
650 /// @brief Final norm of residual (OUT)
651 double fNorm = 0.0;
652
653 /// @brief Res. rduction in last itr. (OUT)
654 double dB = 0.0;
655
656 /// @brief Calling duration (OUT)
657 double callD = 0.0;
658
659 //@brief Configuration file for linear solvers (Trilinos, PETSc)
660 std::string config;
661};
662
663
664/// @brief Contact model type
665//
667{
668 public:
669 // Contact model
670 consts::ContactModelType cType = consts::ContactModelType::cntctM_NA;
671
672 // Penalty parameter
673 double k = 0.0;
674
675 // Min depth of penetration
676 double h = 0.0;
677
678 // Max depth of penetration
679 double c = 0.0;
680
681 // Min norm of face normals in contact
682 double al = 0.0;
683
684 // Tolerance
685 double tol = 0.0;
686};
687
689{
690 public:
691 // GenBC_Dir/GenBC_Neu
692 consts::CplBCType bGrp = consts::CplBCType::cplBC_NA;
693
694 // Pointer to X
695 int Xptr = -1;
696
697 // Internal genBC use
698 int eqv = 0;
699
700 // Flow rates at t
701 double Qo = 0.0;
702
703 // Flow rates at t+dt
704 double Qn = 0.0;
705
706 // Pressures at t
707 double Po = 0.0;
708
709 // Pressures at t+dt
710 double Pn = 0.0;
711
712 // Imposed flow/pressure
713 double y = 0.0;
714
715 // Name of the face
716 std::string name;
717
718 // RCR type BC
719 rcrType RCR;
720
721 // svOneD: path to the per-face 1D solver input file.
722 std::string oned_input_file;
723
724 // Whether this face uses RCR (Windkessel) boundary condition.
725 bool isRCR = false;
726};
727
728//----------------------------
729// svZeroDSolverInterfaceData
730//----------------------------
731// This class stores information used to interface to
732// the svZeroDSolver.
733//
735{
736 public:
737
738 // The path/name of the 0D solver shared library.
739 std::string solver_library;
740
741 // The path/name of the 0D solver JSON file.
742 std::string configuration_file;
743
744 // How often the 0D contribution to solver tangent matrix is added.
745 std::string coupling_type;
746
747 // Initialize the 0D flows.
748 bool have_initial_flows = false;
749 double initial_flows;
750
751 // Initialize the 0D pressures.
752 bool have_initial_pressures = false;
753 double initial_pressures;
754
755 // If the data has been set for the interface. This is only true if
756 // the svZeroDSolver_interface XML parameter has been defined.
757 bool has_data = false;
758
759 void set_data(const svZeroDSolverInterfaceParameters& params);
760};
761
762/// \brief Stores information used to interface with svOneDSolver.
763///
764/// This class stores the global svOneDSolver interface settings read from the
765/// solver XML file. Per-face 1D input files are stored separately in
766/// cplFaceType::oned_input_file.
768{
769 public:
770 /// \brief Path to the svOneDSolver interface shared library.
771 ///
772 /// This may be provided either with the platform-specific extension
773 /// (.so/.dylib) or without it.
774 std::string solver_library;
775
776 /// \brief True if the svOneDSolver interface settings were read from XML.
777 ///
778 /// This is set to true after the svOneDSolver_interface XML element has
779 /// been parsed successfully.
780 bool has_data = false;
781
782 /// \brief Read svOneDSolver interface settings from parsed parameters.
783 ///
784 /// \param params Parsed svOneDSolver interface parameters.
785 void set_data(const svOneDSolverInterfaceParameters& params);
786};
787
788/// @brief For coupled 0D-3D problems
789//
790class cplBCType
791{
792 public:
793 cplBCType();
794
795 /// @brief Index of the equation that this condition is associated with.
796 unsigned int equationIndex = 0;
797
798 /// @brief Is multi-domain active
799 bool coupled = false;
800
801 /// @brief Whether to use genBC
802 bool useGenBC = false;
803
804 /// @brief Whether to use svZeroD
805 bool useSvZeroD = false;
806
807 /// @brief Whether to use svOneD (svOneDSolver)
808 bool useSvOneD = false;
809
810 /// @brief Whether to initialize RCR from flow data
811 bool initRCR = false;
812
813 /// @brief Number of coupled faces
814 int nFa = 0;
815
816 /// @brief Number of \c Time_dependence Coupled BCs for svZeroD (set in \c init_svZeroD).
818
819 /// @brief (\c iEq, \c iBc) for each svZeroD coupled BC in deterministic traversal order.
820 std::vector<std::pair<int, int>> svZeroD_coupled_bc_idxs;
821
822 /// @brief Number of unknowns in the 0D domain
823 int nX = 0;
824
825 /// @brief Number of output variables addition to nX
826 int nXp = 0;
827
828 /// @brief Implicit/Explicit/Semi-implicit schemes
829 consts::CplBCType schm = consts::CplBCType::cplBC_NA;
830 //int schm = cplBC_NA;
831
832 /// @brief Absolute floor on the flow-rate perturbation used to
833 /// finite-difference the coupled-BC tangent dP/dQ in
834 /// \c set_bc::calc_der_cpl_bc. This is a dimensional quantity, so it must
835 /// be set consistently with the unit system of the simulation.
837
838 /// @brief Flow-rate perturbation used to finite-difference the coupled-BC
839 /// tangent dP/dQ in \c set_bc::calc_der_cpl_bc, relative to the RMS coupled
840 /// flow rate. The perturbation actually applied is
841 /// \c max(rms(Q)*finite_difference_relative_perturbation,
842 /// \c finite_difference_absolute_perturbation).
844
845 /// @brief Path to the 0D code binary file
846 std::string binPath;
847
848 /// @brief File name for communication between 0D and 3D
849 std::string commuName;
850 //std::string commuName = ".CPLBC_0D_3D.tmp";
851
852 /// @brief Data structure used for coupling with svZeroD code
854
855 /// @brief Data structure used for coupling with svOneD code
857
858 /// @brief The name of history file containing "X"
859 std::string saveName;
860 //std::string(LEN=stdL) :: saveName = "LPN.dat";
861
862 /// @brief New time step unknowns in the 0D domain
864
865 /// @brief Old time step unknowns in the 0D domain
867
868 /// @brief Output variables to be printed
870
871 /// @brief Data structure used for communicating with 0D code
872 std::vector<cplFaceType> fa;
873};
874
875/// @brief This is the container for a mesh or NURBS patch, those specific
876/// to NURBS are noted
877//
878class mshType
879{
880 public:
881 mshType();
882 std::string dname = "";
883
884/*
885 mshType(const mshType &other)
886 {
887 std::cout << "c c c c c mshType copy c c c c c" << std::endl;
888 }
889
890 mshType& operator = (const mshType &other)
891 {
892 std::cout << "= = = = = mshType assignment = = = = =" << std::endl;
893 return *this;
894 }
895*/
896
897 ~mshType()
898 {
899 //std::cout << "- - - - - mshType dtor - - - - - dname: " << dname << std::endl;
900 };
901
902 /// @brief Whether the shape function is linear
903 bool lShpF = false;
904
905 /// @brief Whether the mesh is shell
906 bool lShl = false;
907
908 /// @brief Whether the mesh is fibers (Purkinje)
909 bool lFib = false;
910
911 /// @brief Element type
912 consts::ElementType eType = consts::ElementType::NA;
913 //int eType = eType_NA
914
915 /// @brief Number of nodes (control points) in a single element
916 int eNoN = 0;
917
918 /// @brief Global number of elements (knot spans)
919 int gnEl = 0;
920
921 /// @brief Global number of nodes (control points) on a single mesh
922 int gnNo = 0;
923
924 /// @brief Number of element face. Used for reading Gambit mesh files
925 int nEf = 0;
926
927 /// @brief Number of elements (knot spans)
928 int nEl = 0;
929
930 /// @brief Number of faces
931 int nFa = 0;
932
933 /// @brief Number of function spaces
934 int nFs = 0;
935
936 /// @brief Number of Gauss points for integration
937 int nG = 0;
938
939 /// @brief Number of nodes (control points) for 2D elements?
940 int nNo = 0;
941
942 /// @brief Number of elements sample points to be outputs (NURBS)
943 int nSl = 0;
944
945 /// @brief The element type recognized by VTK format
946 int vtkType = 0;
947
948 /// @brief Mesh scale factor
949 double scF = 0.0;
950
951 /// @brief IB: Mesh size parameter
952 double dx = 0.0;
953
954 /// @brief RIS resistance value
955 double res = 0.0;
956
957 /// @brief RIS projection tolerance
958 double tol = 0.0;
959
960 /// @brief The volume of this mesh
961 double v = 0.0;
962
963 /// @breif ordering: node ordering for boundaries
964 std::vector<std::vector<int>> ordering;
965
966 /// @brief Element distribution between processors
968
969 /// @brief Element domain ID number
971
972 /// @brief Global nodes maping nNo --> tnNo
974
975 /// @brief GLobal projected nodes mapping projected -> unprojected mapping
977
978 /// @brief Global connectivity array mappig eNoN,nEl --> gnNo
979 Array<int> gIEN;
980
981 /// @brief The connectivity array mapping eNoN,nEl --> nNo
982 Array<int> IEN;
983
984 /// @brief gIEN mapper from old to new
986
987 /// @brief Local knot pointer (NURBS)
988 Array<int> INN;
989
990 /// @brief Global to local maping tnNo --> nNo
992
993 /// @brief Shells: extended IEN array with neighboring nodes
994 Array<int> eIEN;
995
996 /// @brief Shells: boundary condition variable
997 Array<int> sbc;
998
999 /// @brief IB: Whether a cell is a ghost cell or not
1001
1002 /// @brief Control points weights (NURBS)
1004
1005 /// @brief Gauss weights
1007
1008 /// @brief Gauss integration points in parametric space
1009 Array<double> xi;
1010
1011 /// @brief Bounds on parameteric coordinates
1012 Array<double> xib;
1013
1014 /// @brief Position coordinates (not always, however, as they get overwritten by read_vtu_pdata())
1015 Array<double> x;
1016
1017 /// @brief Parent shape function
1018 Array<double> N;
1019
1020 /// @brief Shape function bounds
1021 Array<double> Nb;
1022
1023 /// @brief Normal vector to each nodal point (for Shells)
1024 Array<double> nV;
1025
1026 /// @brief Fiber orientations used for electrophysiology and solid mechanics.
1028
1029 /// @brief Parent shape functions gradient
1030 /// double Nx(:,:,:)
1032
1033 /// @brief Second derivatives of shape functions - used for shells & IGA
1034 /// davep double Nxx(:,:,:)
1036
1037 /// @brief Solution field (displacement, velocity, pressure, etc.) for a known, potentially
1038 /// time-varying, quantity of interest across a mesh
1040
1041 /// @brief Mesh Name
1042 std::string name;
1043
1044 /// @brief Mesh nodal adjacency
1046
1047 /// @brief Mesh element adjacency
1049
1050 /// @brief Function spaces (basis)
1051 std::vector<fsType> fs;
1052
1053 /// @brief BSpline in different directions (NURBS)
1054 std::vector<bsType> bs;
1055
1056 /// @brief Faces are stored in this variable
1057 std::vector<faceType> fa;
1058
1059 /// @brief IB: tracers
1061
1062 /// @brief RIS: flags of whether elemets are adjacent to RIS projections
1063 // std::vector<bool> eRIS;
1065
1066 /// @brief RIS: processor ids to change element partitions to
1068
1069 /// @brief TET4 quadrature modifier
1070 double qmTET4 = (5.0+3.0*sqrt(5.0))/20.0;
1071
1072 private:
1073 //mshType(const mshType&);
1074 //mshType& operator=(const mshType&);
1075
1076};
1077
1078/// @brief Equation type
1079//
1080class eqType
1081{
1082 public:
1083 eqType();
1084 ~eqType();
1085
1086 /// @brief Should be satisfied in a coupled/uncoupled fashion
1087 bool coupled = false;
1088 //bool coupled = .TRUE.
1089
1090 /// @brief Satisfied/not satisfied
1091 bool ok = false;
1092
1093 /// @brief Use C++ Trilinos framework for the linear solvers
1094 bool useTLS = false;
1095
1096 /// @brief Use C++ Trilinos framework for assembly and for linear solvers
1097 bool assmTLS = false;
1098
1099 /// @brief Degrees of freedom
1100 int dof = 0;
1101
1102 /// @brief Pointer to end of unknown Yo(:,s:e)
1103 int e = -1;
1104
1105 /// @brief Pointer to start of unknown Yo(:,s:e)
1106 int s = -1;
1107
1108 /// @brief Number of performed iterations
1109 int itr = 0;
1110
1111 /// @brief Maximum iteration for this eq.
1112 int maxItr = 5;
1113
1114 /// @brief Minimum iteration for this eq.
1115 int minItr = 1;
1116
1117 /// @brief Number of possible outputs
1118 int nOutput = 0;
1119
1120 /// @brief IB: Number of possible outputs
1121 int nOutIB = 0;
1122
1123 /// @brief URIS: Number of possible outputs
1124 int nOutURIS = 0;
1125
1126 /// @brief Number of domains
1127 int nDmn = 0;
1128
1129 /// @brief IB: Number of immersed domains
1130 int nDmnIB = 0;
1131
1132 /// @brief Number of BCs
1133 int nBc = 0;
1134
1135 /// @brief Number of BCs on immersed surfaces
1136 int nBcIB = 0;
1137
1138 /// @brief Number of BFs
1139 int nBf = 0;
1140
1141 /// @brief Type of equation fluid/heatF/heatS/lElas/FSI
1142 consts::EquationType phys = consts::EquationType::phys_NA;
1143
1144 // Parameters used for the Generalized α− Method.
1145 //
1146 /// @brief \f$\alpha_f\f$
1147 double af = 0.0;
1148
1149 /// @brief \f$\alpha_m\f$
1150 ///
1151 /// For second order equations: am = (2.0 - roInf) / (1.0 + roInf)
1152 /// First order equations: am = 0.5 * (3.0 - roInf) / (1.0 + roInf)
1153 //
1154 double am = 0.0;
1155
1156 /// @brief \f$\beta\f$
1157 double beta = 0.0;
1158
1159 /// @brief \f$\gamma\f$
1160 double gam = 0.0;
1161
1162 /// @brief Initial norm of residual
1163 double iNorm = 0.0;
1164
1165 /// @brief First iteration norm
1166 double pNorm = 0.0;
1167
1168 /// @brief \f$\rho_{infinity}\f$
1169 double roInf = 0.0;
1170
1171 /// @brief Accepted relative tolerance
1172 double tol = 0.0;
1173
1174 /// @name Line search settings.
1175 /// @{
1176
1177 /// @brief Toggle line search for this equation.
1178 ///
1179 /// See the documentation of @ref Integrator for additional details.
1181
1182 /// @brief Minimum decrease of the residual norm for line search.
1183 ///
1184 /// A step is accepted if it decreases the residual norm by at least this
1185 /// fraction, relative to the norm at the start of the step.
1186 ///
1187 /// See the documentation of @ref Integrator for additional details.
1189
1190 /// @brief Line search step reduction factor.
1191 ///
1192 /// If a step is rejected, the step length is multiplied by this factor for
1193 /// the next trial. Must be in the range (0, 1).
1194 ///
1195 /// See the documentation of @ref Integrator for additional details.
1197
1198 /// @brief Line search minimum step length.
1199 ///
1200 /// A line search step shorter than or equal to this length is accepted
1201 /// unconditionally. Must be non-negative.
1202 ///
1203 /// See the documentation of @ref Integrator for additional details.
1205
1206 /// @brief If enabled, report line search progress to stdout.
1207 ///
1208 /// See the documentation of @ref Integrator for additional details.
1210
1211 /// @}
1212
1213 /// @brief Equation symbol
1214 std::string sym;
1215 //std::string(LEN=2) :: sym = "NA";
1216
1217 /// @brief type of linear solver
1219
1220 /// @brief The type of interface to a numerical linear algebra library.
1221 consts::LinearAlgebraType linear_algebra_type;
1222
1223 /// @brief The type of assembly interface to a numerical linear algebra library.
1224 consts::LinearAlgebraType linear_algebra_assembly_type;
1225
1226 /// @brief The type of preconditioner used by the interface to a numerical linear algebra library.
1227 consts::PreconditionerType linear_algebra_preconditioner = consts::PreconditionerType::PREC_FSILS;
1228
1229 /// @brief Interface to a numerical linear algebra library.
1231
1232 /// @brief FSILS type of linear solver
1233 fsi_linear_solver::FSILS_lsType FSILS;
1234
1235 /// @brief BCs associated with this equation;
1236 std::vector<bcType> bc;
1237
1238 /// @brief IB: BCs associated with this equation on immersed surfaces
1239 std::vector<bcType> bcIB;
1240
1241 /// @brief domains that this equation must be solved
1242 std::vector<dmnType> dmn;
1243
1244 /// @brief IB: immersed domains that this equation must be solved
1245 std::vector<dmnType> dmnIB;
1246
1247 /// @brief Outputs
1248 std::vector<outputType> output;
1249
1250 /// @brief IB: Outputs
1251 std::vector<outputType> outIB;
1252
1253 /// @brief URIS: Outputs
1254 std::vector<outputType> outURIS;
1255
1256 /// @brief Explicit geometry coupling
1257 bool expl_geom_cpl = false;
1258
1259 /// @brief Body force associated with this equation
1260 std::vector<bfType> bf;
1261};
1262
1263/// @brief This type will be used to write data in the VTK files.
1264//
1266{
1267 public:
1268
1269 // Element number of nodes
1270 int eNoN = 0;
1271
1272 // Number of elements
1273 int nEl = 0;
1274
1275 // Number of nodes
1276 int nNo = 0;
1277
1278 // vtk type
1279 int vtkType = 0;
1280
1281 // Connectivity array
1282 Array<int> IEN;
1283
1284 // Element based variables to be written
1285 Array<double> xe;
1286
1287 // All the variables after transformation to global format
1288 Array<double> gx;
1289
1290 // All the variables to be written (including position)
1291 Array<double> x;
1292};
1293
1294
1295class rmshType
1296{
1297 public:
1298
1299 rmshType();
1300
1301 /// @brief Whether remesh is required for problem or not
1302 bool isReqd = false;
1303
1304 /// @brief Method for remeshing: 1-TetGen, 2-MeshSim
1305 consts::MeshGeneratorType method = consts::MeshGeneratorType::RMSH_TETGEN;
1306
1307 /// @brief Counter to track number of remesh done
1308 int cntr = 0;
1309
1310 /// @brief Time step from which remeshing is done
1311 int rTS = 0;
1312
1313 /// @brief Time step freq for saving data
1314 int cpVar = 0;
1315
1316 /// @brief Time step at which forced remeshing is done
1317 int fTS = 1000;
1318
1319 /// @brief Time step frequency for forced remeshing
1320 int freq = 1000;
1321
1322 /// @brief Time where remeshing starts
1323 double time = 0.0;
1324
1325 /// @brief Mesh quality parameters
1326 double minDihedAng = 0.0;
1327 double maxRadRatio = 0.0;
1328
1329 /// @brief Edge size of mesh
1331
1332 /// @brief Initial norm of an equation
1334
1335 /// @brief Copy of solution variables where remeshing starts
1336 Array<double> A0;
1337 Array<double> Y0;
1338 Array<double> D0;
1339
1340 /// @brief Flag is set if remeshing is required for each mesh
1341 std::vector<bool> flag;
1342};
1343
1345{
1346 public:
1347 /// @brief Num traces (nodes) local to each process
1349
1350 /// @brief Pointer to global trace (node num) stacked contiguously
1352
1353 /// @brief Num traces (Gauss points) local to each process
1355
1356 /// @brief Pointer to global trace (Gauss point) stacked contiguously
1358};
1359
1360
1361/// @brief Immersed Boundary (IB) data type
1362//
1364{
1365 public:
1366
1367 /// @brief Whether any file being saved
1368 bool savedOnce = false;
1369 //bool savedOnce = .FALSE.
1370
1371 /// @brief IB method
1372 int mthd = 0;
1373 //int mthd = ibMthd_NA;
1374
1375 /// @brief IB coupling
1376 int cpld = 0;
1377 //int cpld = ibCpld_NA;
1378
1379 /// @brief IB interpolation method
1380 int intrp = 0;
1381 //int intrp = ibIntrp_NA;
1382
1383 /// @brief Current IB domain ID
1384 int cDmn = 0;
1385
1386 /// @brief Current equation
1387 int cEq = 0;
1388
1389 /// @brief Total number of IB nodes
1390 int tnNo = 0;
1391
1392 /// @brief Number of IB meshes
1393 int nMsh = 0;
1394
1395 /// @brief IB call duration (1: total time; 2: update; 3,4: communication)
1396 double callD[4] = {0.0, 0.0, 0.0, 0.0};
1397
1398 /// @brief IB Domain ID
1400
1401 /// @brief Row pointer (for sparse LHS matrix storage)
1403
1404 /// @brief Column pointer (for sparse LHS matrix storage)
1406
1407 /// @brief IB position coordinates
1408 Array<double> x;
1409
1410 /// @brief Velocity (new)
1411 Array<double> Yb;
1412
1413 /// @brief Time derivative of displacement (old)
1414 Array<double> Auo;
1415
1416 /// @brief Time derivative of displacement (new)
1417 Array<double> Aun;
1418
1419 /// @brief Time derivative of displacement (n+am)
1420 Array<double> Auk;
1421
1422 /// @brief Displacement (old)
1423 Array<double> Ubo;
1424
1425 /// @brief Displacement (new)
1426 Array<double> Ubn;
1427
1428 /// @brief Displacement (n+af)
1429 Array<double> Ubk;
1430
1431 /// @brief Displacement (projected on background mesh, old)
1432 Array<double> Uo;
1433
1434 /// @brief Displacement (projected on background mesh, new, n+af)
1435 Array<double> Un;
1436
1437 /// @brief Residual (FSI force)
1438 Array<double> R;
1439
1440 /// @brief Residual (displacement, background mesh)
1441 Array<double> Ru;
1442
1443 /// @brief Residual (displacement, IB mesh)
1444 Array<double> Rub;
1445
1446 /// @brief LHS tangent matrix for displacement
1447 Array<double> Ku;
1448
1449 /// @brief DERIVED class VARIABLES IB meshes;
1450 std::vector<mshType> msh;
1451
1452 /// @brief IB communicator
1454};
1455
1456/// @brief Data type for Resistive Immersed Surface
1457//
1459{
1460 public:
1461
1462 /// @brief Number of RIS surface
1463 int nbrRIS = 0;
1464
1465 /// @brief Count time steps where no check is needed
1467
1468 /// @brief List of meshes, and faces connected. The first face is the
1469 // proximal pressure's face, while the second is the distal one
1471
1472 /// @brief Resistance value
1474
1475 /// @brief Flag closed surface active, the valve is considerd open initially
1476 std::vector<bool> clsFlg;
1477
1478 /// @brief Mean distal and proximal pressure (1: distal, 2: proximal)
1479 Array<double> meanP;
1480
1481 /// @brief Mean flux on the RIS surface
1483
1484 /// @brief Status RIS interface
1485 std::vector<bool> status;
1486};
1487
1488/// @brief Unfitted Resistive Immersed Surface (URIS) data type.
1489///
1490/// Stores the immersed valve surface geometry, motion state, distance fields,
1491/// resistance parameters, and background-mesh interpolation data used by the
1492/// URIS formulation.
1493///
1494/// ### Scaffolding
1495///
1496/// A scaffold is an optional auxiliary surface mesh associated with a URIS
1497/// valve. It represents supporting valve structure that contributes
1498/// additional resistance near the scaffold surface without being treated as a
1499/// moving valve leaflet surface. When enabled, the scaffold mesh is loaded from
1500/// `Scaffold_file_path`, scaled with the URIS mesh scale factor, and stored as a
1501/// separate mesh. The solver computes an unsigned distance function (UDF) from
1502/// background fluid mesh nodes to the scaffold and uses the closed-valve
1503/// thickness parameter to apply the scaffold resistance contribution.
1504///
1505/// Scaffold is disabled by default. Set `Scaffold_file_path` in the
1506/// `Add_URIS_mesh` input section to a VTU scaffold mesh file to enable it.
1508{
1509 public:
1510
1511 /// @brief Name of the URIS instance.
1512 std::string name;
1513
1514 /// @brief Whether any file has been saved.
1515 bool savedOnce = false;
1516
1517 /// @brief Total number of immersed boundary nodes.
1518 int tnNo = 0;
1519
1520 /// @brief Number of immersed boundary meshes.
1521 int nFa = 0;
1522
1523 /// @brief Valve surface position coordinates.
1524 Array<double> x;
1525
1526 /// @brief Valve position coordinates at the previous time step.
1527 Array<double> x_prev;
1528
1529 /// @brief Valve velocity on the valve surface nodes.
1530 Array<double> valve_velocity;
1531
1532 /// @brief Valve displacement.
1533 Array<double> Yd;
1534
1535 /// @brief Default signed distance value away from the valve.
1537
1538 /// @brief Half-valve thickness when the valve is open.
1539 double sdf_deps;
1540
1541 /// @brief Half-thickness used when the valve is closed.
1542 ///
1543 /// Set larger than sdf_deps if the fully closed position alone is not able
1544 /// to prevent backflow.
1546
1547 /// @brief Resistance value of the valve.
1549
1550 /// @brief Whether to invert the valve surface normal vector.
1551 ///
1552 /// Valve normal vectors are assumed to point downstream, so that the
1553 /// downstream region has positive signed distance and the upstream region
1554 /// has negative signed distance. If the input surface does not satisfy
1555 /// this assumption, this flag should be set to true to flip the normals.
1557
1558 /// @brief Whether to include the valve velocity in the RIS implementation.
1560
1561 /// @brief Opening positions of the valve surfaces.
1563
1564 /// @brief Closing positions of the valve surfaces.
1566
1567 /// @brief Normal vector pointing in the positive flow direction.
1569
1570 /// @brief Close flag.
1572
1573 /// @brief Iteration count.
1574 int cnt = 1000000;
1575
1576 /// @brief Flag indicating whether the signed distance function is computed.
1577 bool sdf_computed = false;
1578
1579 /// @brief Signed distance function indexed by background fluid mesh node.
1581
1582 /// @brief Valve velocity interpolated on background fluid mesh nodes.
1584
1585 /// @brief Mesh scale factor.
1586 double scF;
1587
1588 /// @brief Mean pressure upstream.
1589 double meanPU = 0.0;
1590
1591 /// @brief Mean pressure downstream.
1592 double meanPD = 0.0;
1593
1594 /// @brief Relaxation factor to compute weighted averages of pressure values.
1595 double relax_factor = 0.5;
1596
1597 /// @brief Background fluid mesh element containing each immersed surface node.
1598 ///
1599 /// `elemId(0, nd)` is the mesh index `jM`, and `elemId(1, nd)` is the
1600 /// element index `iEln` for the fluid element containing immersed surface
1601 /// node `nd`. Set to -1 if no containing element was found on this rank.
1602 Array<int> elemId;
1603
1604 /// @brief Per-node ownership flag set by uris_find_tetra.
1605 ///
1606 /// A value of 1 means this rank owns the node and is used for interpolating
1607 /// its displacement. A value of 0 means another rank owns it, so this rank
1608 /// skips it to avoid double-counting in the MPI_SUM gather.
1610
1611 /// @brief Immersed boundary meshes.
1612 std::vector<mshType> msh;
1613
1614 /// @brief Whether a scaffold mesh is enabled for this URIS instance.
1615 bool scaffold_flag = false;
1616
1617 /// @brief Scaffold mesh data.
1619
1620 /// @brief Unsigned distance function (UDF) for the scaffold mesh.
1622
1623 /// @brief Flag indicating whether the scaffold mesh UDF is computed.
1625
1626};
1627
1628/// @brief The ComMod class duplicates the data structures in the Fortran COMMOD module
1629/// defined in MOD.f.
1630///
1631/// The data members here are the global variables exposed by the COMMOD module.
1632//
1633class ComMod {
1634
1635 public:
1636 ComMod();
1637 ~ComMod();
1638
1639 //----- bool members -----//
1640
1641 /// @brief Whether there is a requirement to update mesh and Dn-Do variables
1642 bool dFlag = false;
1643
1644 /// @brief Whether mesh is moving
1645 bool mvMsh = false;
1646
1647 /// @brief Whether to averaged results
1648 bool saveAve = false;
1649
1650 /// @brief Whether to save the domain ID to every VTK file rather than to
1651 /// the first one only
1653
1654 /// @brief Whether to save to VTK files
1655 bool saveVTK = false;
1656
1657 /// @brief Whether any file being saved
1658 bool savedOnce = false;
1659
1660 /// @brief Whether start from beginning or from simulations
1661 bool stFileFlag = false;
1662
1663 /// @brief Whether to overwrite restart file or not
1664 bool stFileRepl = false;
1665
1666 /// @brief Restart simulation after remeshing
1667 bool resetSim = false;
1668
1669 /// @brief Check IEN array for initial mesh
1670 bool ichckIEN = false;
1671
1672 /// @brief Reset averaging variables from zero
1673 bool zeroAve = false;
1674
1675 /// @brief Whether CMM equation is initialized
1676 bool cmmInit = false;
1677
1678 /// @brief Whether variable wall properties are used for CMM
1679 bool cmmVarWall = false;
1680
1681 /// @brief Whether shell equation is being solved
1682 bool shlEq = false;
1683
1684 /// @brief Whether PRESTRESS is being solved
1685 bool pstEq = false;
1686
1687 /// @brief Whether velocity-pressure based structural dynamics solver is used
1688 bool sstEq = false;
1689
1690 /// @brief Whether to detect and apply any contact model
1691 bool iCntct = false;
1692
1693 /// @brief Whether any Immersed Boundary (IB) treatment is required
1694 bool ibFlag = false;
1695
1696 /// @brief Postprocess step - convert bin to vtk
1697 bool bin2VTK = false;
1698
1699 /// @brief Whether any RIS surface is considered
1700 bool risFlag = false;
1701
1702 /// @brief Whether any one-sided RIS surface with 0D coupling is considered
1703 bool ris0DFlag = false;
1704
1705 /// @brief Whether any URIS surface is considered
1706 bool urisFlag = false;
1707
1708 /// @brief Whether the URIS surface is active
1709 bool urisActFlag = false;
1710
1711 /// @brief Number of URIS surfaces (uninitialized, to be set later)
1713
1714 /// @brief Fluid-related node mask for URIS SDF. Built once when
1715 /// consistent with tnNo; rebuilt automatically if tnNo changes.
1716 std::vector<bool> urisFluidNodeMask;
1717
1718 /// @brief Whether to use precomputed state-variable solutions
1719 bool usePrecomp = false;
1720
1721 /// @brief Whether a spatially uniform initial pressure is provided in solver.xml
1723
1724 //----- int members -----//
1725
1726 /// @brief Current domain
1727 int cDmn = 0;
1728
1729 /// @brief Current equation
1730 int cEq = 0;
1731
1732 /// @brief Current time step
1733 int cTS = 0;
1734
1735 std::array<double,3> timeP;
1736
1737 /// @brief Starting time step
1738 int startTS = 0;
1739
1740 /// @brief Current equation degrees of freedom
1741 int dof = 0;
1742
1743 /// @brief Global total number of nodes, across all meshes (total) and all
1744 /// procs (global)
1745 int gtnNo = 0;
1746
1747 /// @brief Number of equations
1748 int nEq = 0;
1749
1750 /// @brief Number of faces in the LHS passed to FSILS
1751 int nFacesLS = 0;
1752
1753 /// @brief Number of meshes
1754 int nMsh = 0;
1755
1756 /// @brief Number of spatial dimensions
1757 int nsd = 0;
1758
1759 /// @brief Number of time steps
1760 int nTS = 0;
1761
1762 /// @brief Number of initialization time steps
1763 int nITs = 0;
1764
1765 /// @brief stFiles record length
1766 int recLn = 0;
1767
1768 /// @brief Start saving after this number of time step
1769 int saveATS = 0;
1770
1771 /// @brief Increment in saving solutions
1772 int saveIncr = 0;
1773
1774 /// @brief Stamp ID to make sure simulation is compatible with stFiles
1775 std::array<int,7> stamp;
1776
1777 /// @brief Increment in saving restart file
1778 int stFileIncr = 0;
1779
1780 /// @brief Total number of degrees of freedom per node
1781 int tDof = 0;
1782
1783 /// @brief Total number of nodes (number of nodes on current proc across
1784 /// all meshes)
1785 int tnNo = 0;
1786
1787 /// @brief Restart Time Step
1788 int rsTS = 0;
1789
1790 /// @brief Number of stress values to be stored
1791 int nsymd = 0;
1792
1793 /// @brief Nbr of iterations
1794 int RisnbrIter = 0;
1795
1796
1797 //----- double members -----//
1798
1799 /// @brief Time step size
1800 double dt = 0.0;
1801
1802 /// @brief Time step size of the precomputed state-variables
1803 double precompDt = 0.0;
1804
1805 /// @brief Time
1806 double time = 0.0;
1807
1808 /// @brief Spatially uniform initial pressure used to initialize the 3D pressure field
1810
1811 //----- string members -----//
1812
1813 /// @brief Initialization file path
1814 std::string iniFilePath;
1815
1816 /// @brief Saved output file name
1817 std::string saveName;
1818
1819 /// @brief Restart file name
1820 std::string stFileName;
1821
1822 /// @brief Stop_trigger file name
1823 std::string stopTrigName;
1824
1825 /// @brief Precomputed state-variable file name
1826 std::string precompFileName;
1827
1828 /// @brief Precomputed state-variable field name
1829 std::string precompFieldName;
1830 // ALLOCATABLE DATA
1831
1832 /// @brief Column pointer (for sparse LHS matrix structure)
1833 /// Modified in: lhsa()
1835
1836 /// @brief Domain ID
1838
1839 /// @brief Local to global pointer tnNo --> gtnNo
1841
1842 /// @brief Row pointer (for sparse LHS matrix structure)
1843 /// Modified in: lhsa()
1845
1846 /// @brief Array that maps global node id to rowN in the matrix
1847 /// Modified in: lhsa()
1849
1850 /// @brief Boundary nodes set for CMM initialization and for zeroing-out
1851 /// non-wall nodal displacements
1853
1854 /// @brief IB: iblank used for immersed boundaries (1 => solid, 0 => fluid)
1856
1857 /// @brief TODO: for now, better to organize these within a class
1858 struct Array2D {
1859 // std::vector<std::vector<int>> map;
1860 Array<int> map;
1861 };
1862
1863 /// @brief RIS mapping array, with local (mesh) enumeration
1864 std::vector<Array2D> risMapList;
1865
1866 /// @brief RIS mapping array, with global (total) enumeration
1867 std::vector<Array2D> grisMapList;
1868
1869 /// @brief Residual vector
1870 Array<double> R;
1871
1872 /// @brief LHS matrix
1873 Array<double> Val;
1874
1875 /// @brief Position vector of mesh nodes (in ref config)
1876 Array<double> x;
1877
1878 /// @brief Body force
1879 Array<double> Bf;
1880
1881 //-----------------------------------------------------
1882 // Additional arrays for velocity-based formulation of
1883 // nonlinear solid mechanics.
1884 //-----------------------------------------------------
1885
1886 /// @brief Time derivative of displacement
1887 Array<double> Ad;
1888
1889 /// @brief Residual of the displacement equation
1890 Array<double> Rd;
1891
1892 /// @brief LHS matrix for displacement equation
1893 Array<double> Kd;
1894
1895 /// @brief Variables for prestress calculations
1896 Array<double> pS0;
1897 Array<double> pSn;
1898 Vector<double> pSa;
1899
1900 /// @brief Temporary storage for initializing state variables
1902 Array<double> Vinit;
1903 Array<double> Dinit;
1904
1905 /// @brief CMM-variable wall properties: 1-thickness, 2-Elasticity modulus
1906 Array<double> varWallProps;
1907
1908 //------------------------
1909 // DERIVED TYPE VARIABLES
1910 //------------------------
1911
1912 /// @brief Coupled BCs structures used for multidomain simulations
1914
1915 /// @brief All data related to equations are stored in this container
1916 std::vector<eqType> eq;
1917
1918 /// @brief FSILS data structure to produce LHS sparse matrix
1919 fsi_linear_solver::FSILS_lhsType lhs;
1920
1921 /// @brief All the meshes are stored in this variable
1922 std::vector<mshType> msh;
1923
1924 /// @brief Input/output to the screen is handled by this structure
1925 chnlType std, err, wrn, dbg;
1926
1927 /// @brief To group above channels
1929
1930 /// @brief The general communicator
1932
1933 /// @brief Remesher type
1935
1936 /// @brief Contact model type
1938
1939 /// @brief IB: Immersed boundary data structure
1941
1942 /// @brief risFace object
1944
1945 /// @brief unfitted RIS object
1946 std::vector<urisType> uris;
1947
1948 bool debug_active = false;
1949
1950 Timer timer;
1951};
1952
1953#endif
The Array3 template class implements a simple interface to 3D arrays.
Definition Array3.h:25
Definition ArtificialNeuralNetMaterial.h:30
std::string stopTrigName
Stop_trigger file name.
Definition ComMod.h:1823
ibType ib
IB: Immersed boundary data structure.
Definition ComMod.h:1940
int stFileIncr
Increment in saving restart file.
Definition ComMod.h:1778
int nITs
Number of initialization time steps.
Definition ComMod.h:1763
bool ibFlag
Whether any Immersed Boundary (IB) treatment is required.
Definition ComMod.h:1694
Vector< int > colPtr
Column pointer (for sparse LHS matrix structure) Modified in: lhsa().
Definition ComMod.h:1834
bool zeroAve
Reset averaging variables from zero.
Definition ComMod.h:1673
std::string saveName
Saved output file name.
Definition ComMod.h:1817
std::vector< Array2D > grisMapList
RIS mapping array, with global (total) enumeration.
Definition ComMod.h:1867
int nMsh
Number of meshes.
Definition ComMod.h:1754
chnlType std
Input/output to the screen is handled by this structure.
Definition ComMod.h:1925
bool savedOnce
Whether any file being saved.
Definition ComMod.h:1658
risFaceType ris
risFace object
Definition ComMod.h:1943
bool stFileRepl
Whether to overwrite restart file or not.
Definition ComMod.h:1664
Array< double > varWallProps
CMM-variable wall properties: 1-thickness, 2-Elasticity modulus.
Definition ComMod.h:1906
Array< double > x
Position vector of mesh nodes (in ref config).
Definition ComMod.h:1876
bool cmmVarWall
Whether variable wall properties are used for CMM.
Definition ComMod.h:1679
bool have_initial_homogeneous_pressure
Whether a spatially uniform initial pressure is provided in solver.xml.
Definition ComMod.h:1722
std::array< int, 7 > stamp
Stamp ID to make sure simulation is compatible with stFiles.
Definition ComMod.h:1775
Array< double > Ad
Time derivative of displacement.
Definition ComMod.h:1887
int cTS
Current time step.
Definition ComMod.h:1733
int dof
Current equation degrees of freedom.
Definition ComMod.h:1741
bool urisFlag
Whether any URIS surface is considered.
Definition ComMod.h:1706
int gtnNo
Global total number of nodes, across all meshes (total) and all procs (global).
Definition ComMod.h:1745
std::string stFileName
Restart file name.
Definition ComMod.h:1820
int tnNo
Total number of nodes (number of nodes on current proc across all meshes).
Definition ComMod.h:1785
int nsd
Number of spatial dimensions.
Definition ComMod.h:1757
int nFacesLS
Number of faces in the LHS passed to FSILS.
Definition ComMod.h:1751
int nsymd
Number of stress values to be stored.
Definition ComMod.h:1791
bool ichckIEN
Check IEN array for initial mesh.
Definition ComMod.h:1670
std::string iniFilePath
Initialization file path.
Definition ComMod.h:1814
double initial_homogeneous_pressure
Spatially uniform initial pressure used to initialize the 3D pressure field.
Definition ComMod.h:1809
Vector< int > rowPtr
Row pointer (for sparse LHS matrix structure) Modified in: lhsa().
Definition ComMod.h:1844
std::string precompFileName
Precomputed state-variable file name.
Definition ComMod.h:1826
std::vector< Array2D > risMapList
RIS mapping array, with local (mesh) enumeration.
Definition ComMod.h:1864
int cEq
Current equation.
Definition ComMod.h:1730
Vector< int > cmmBdry
Boundary nodes set for CMM initialization and for zeroing-out non-wall nodal displacements.
Definition ComMod.h:1852
Array< double > Val
LHS matrix.
Definition ComMod.h:1873
std::vector< bool > urisFluidNodeMask
Fluid-related node mask for URIS SDF. Built once when consistent with tnNo; rebuilt automatically if ...
Definition ComMod.h:1716
bool bin2VTK
Postprocess step - convert bin to vtk.
Definition ComMod.h:1697
bool saveAve
Whether to averaged results.
Definition ComMod.h:1648
bool saveVTK
Whether to save to VTK files.
Definition ComMod.h:1655
int tDof
Total number of degrees of freedom per node.
Definition ComMod.h:1781
std::vector< urisType > uris
unfitted RIS object
Definition ComMod.h:1946
bool ris0DFlag
Whether any one-sided RIS surface with 0D coupling is considered.
Definition ComMod.h:1703
bool risFlag
Whether any RIS surface is considered.
Definition ComMod.h:1700
std::string precompFieldName
Precomputed state-variable field name.
Definition ComMod.h:1829
bool cmmInit
Whether CMM equation is initialized.
Definition ComMod.h:1676
Array< double > Rd
Residual of the displacement equation.
Definition ComMod.h:1890
cplBCType cplBC
Coupled BCs structures used for multidomain simulations.
Definition ComMod.h:1913
double time
Time.
Definition ComMod.h:1806
bool pstEq
Whether PRESTRESS is being solved.
Definition ComMod.h:1685
bool resetSim
Restart simulation after remeshing.
Definition ComMod.h:1667
double dt
Time step size.
Definition ComMod.h:1800
bool urisActFlag
Whether the URIS surface is active.
Definition ComMod.h:1709
Array< double > R
Residual vector.
Definition ComMod.h:1870
rmshType rmsh
Remesher type.
Definition ComMod.h:1934
int saveIncr
Increment in saving solutions.
Definition ComMod.h:1772
bool usePrecomp
Whether to use precomputed state-variable solutions.
Definition ComMod.h:1719
ioType io
To group above channels.
Definition ComMod.h:1928
cntctModelType cntctM
Contact model type.
Definition ComMod.h:1937
int RisnbrIter
Nbr of iterations.
Definition ComMod.h:1794
bool alwaysSaveDomainID
Whether to save the domain ID to every VTK file rather than to the first one only.
Definition ComMod.h:1652
cmType cm
The general communicator.
Definition ComMod.h:1931
int nUris
Number of URIS surfaces (uninitialized, to be set later).
Definition ComMod.h:1712
int startTS
Starting time step.
Definition ComMod.h:1738
Vector< int > idMap
Array that maps global node id to rowN in the matrix Modified in: lhsa().
Definition ComMod.h:1848
bool stFileFlag
Whether start from beginning or from simulations.
Definition ComMod.h:1661
bool shlEq
Whether shell equation is being solved.
Definition ComMod.h:1682
std::vector< eqType > eq
All data related to equations are stored in this container.
Definition ComMod.h:1916
bool iCntct
Whether to detect and apply any contact model.
Definition ComMod.h:1691
double precompDt
Time step size of the precomputed state-variables.
Definition ComMod.h:1803
bool dFlag
Whether there is a requirement to update mesh and Dn-Do variables.
Definition ComMod.h:1642
int cDmn
Current domain.
Definition ComMod.h:1727
int nTS
Number of time steps.
Definition ComMod.h:1760
int nEq
Number of equations.
Definition ComMod.h:1748
Vector< int > iblank
IB: iblank used for immersed boundaries (1 => solid, 0 => fluid).
Definition ComMod.h:1855
Array< double > Kd
LHS matrix for displacement equation.
Definition ComMod.h:1893
std::vector< mshType > msh
All the meshes are stored in this variable.
Definition ComMod.h:1922
int recLn
stFiles record length
Definition ComMod.h:1766
int rsTS
Restart Time Step.
Definition ComMod.h:1788
bool mvMsh
Whether mesh is moving.
Definition ComMod.h:1645
Vector< double > Pinit
Temporary storage for initializing state variables.
Definition ComMod.h:1901
Vector< int > ltg
Local to global pointer tnNo --> gtnNo.
Definition ComMod.h:1840
fsi_linear_solver::FSILS_lhsType lhs
FSILS data structure to produce LHS sparse matrix.
Definition ComMod.h:1919
Array< double > Bf
Body force.
Definition ComMod.h:1879
Vector< int > dmnId
Domain ID.
Definition ComMod.h:1837
Array< double > pS0
Variables for prestress calculations.
Definition ComMod.h:1896
int saveATS
Start saving after this number of time step.
Definition ComMod.h:1769
bool sstEq
Whether velocity-pressure based structural dynamics solver is used.
Definition ComMod.h:1688
Object-oriented Coupled boundary condition.
Definition CoupledBoundaryCondition.h:199
Fiber directions associated with one mesh.
Definition Fibers.h:19
Fourier interpolation of time dependent data.
Definition FourierInterpolation.h:113
The LinearAlgebra class provides an abstract interface to linear algebra frameworks: FSILS,...
Definition LinearAlgebra.h:13
Moving boundary data structure (used for general BC).
Definition ComMod.h:52
Definition RobinBoundaryCondition.h:37
Keep track of time.
Definition Timer.h:11
The Vector template class is used for storing int and double data.
Definition Vector.h:26
Mesh adjacency (neighboring element for each element).
Definition ComMod.h:416
Boundary condition data type.
Definition ComMod.h:96
Definition ComMod.h:255
Class storing data for B-Splines.
Definition ComMod.h:180
Cardiac electrophysiology model type.
Definition CepMod.h:144
Channel type, used in I/O.
Definition ChnlMod.h:19
The cmType class stores data and defines methods used for mpi communication.
Definition CmMod.h:57
Contact model type.
Definition ComMod.h:667
For coupled 0D-3D problems.
Definition ComMod.h:791
consts::CplBCType schm
Implicit/Explicit/Semi-implicit schemes.
Definition ComMod.h:829
bool initRCR
Whether to initialize RCR from flow data.
Definition ComMod.h:811
bool useSvOneD
Whether to use svOneD (svOneDSolver).
Definition ComMod.h:808
int nX
Number of unknowns in the 0D domain.
Definition ComMod.h:823
int nFa
Number of coupled faces.
Definition ComMod.h:814
svZeroDSolverInterfaceData svzerod_solver_interface
Data structure used for coupling with svZeroD code.
Definition ComMod.h:853
Vector< double > xo
Old time step unknowns in the 0D domain.
Definition ComMod.h:866
std::vector< std::pair< int, int > > svZeroD_coupled_bc_idxs
(iEq, iBc) for each svZeroD coupled BC in deterministic traversal order.
Definition ComMod.h:820
int nSvZeroD_coupled_bc
Number of Time_dependence Coupled BCs for svZeroD (set in init_svZeroD).
Definition ComMod.h:817
bool useGenBC
Whether to use genBC.
Definition ComMod.h:802
double finite_difference_relative_perturbation
Flow-rate perturbation used to finite-difference the coupled-BC tangent dP/dQ in set_bc::calc_der_cpl...
Definition ComMod.h:843
std::string binPath
Path to the 0D code binary file.
Definition ComMod.h:846
std::string saveName
The name of history file containing "X".
Definition ComMod.h:859
std::string commuName
File name for communication between 0D and 3D.
Definition ComMod.h:849
unsigned int equationIndex
Index of the equation that this condition is associated with.
Definition ComMod.h:796
bool coupled
Is multi-domain active.
Definition ComMod.h:799
std::vector< cplFaceType > fa
Data structure used for communicating with 0D code.
Definition ComMod.h:872
double finite_difference_absolute_perturbation
Absolute floor on the flow-rate perturbation used to finite-difference the coupled-BC tangent dP/dQ i...
Definition ComMod.h:836
Vector< double > xp
Output variables to be printed.
Definition ComMod.h:869
bool useSvZeroD
Whether to use svZeroD.
Definition ComMod.h:805
Vector< double > xn
New time step unknowns in the 0D domain.
Definition ComMod.h:863
int nXp
Number of output variables addition to nX.
Definition ComMod.h:826
svOneDSolverInterfaceData svOneD_solver_interface
Data structure used for coupling with svOneD code.
Definition ComMod.h:856
Definition ComMod.h:689
This type will be used to write data in the VTK files.
Definition ComMod.h:1266
std::string active_stress_model_name
Active stress model name.
Definition ComMod.h:398
std::shared_ptr< ActiveStress > active_stress
Active stress model.
Definition ComMod.h:401
LinearAlgebra * linear_algebra
Interface to a numerical linear algebra library.
Definition ComMod.h:1230
double roInf
Definition ComMod.h:1169
int maxItr
Maximum iteration for this eq.
Definition ComMod.h:1112
int s
Pointer to start of unknown Yo(:,s:e).
Definition ComMod.h:1106
int nDmnIB
IB: Number of immersed domains.
Definition ComMod.h:1130
bool coupled
Should be satisfied in a coupled/uncoupled fashion.
Definition ComMod.h:1087
bool line_search_verbose
If enabled, report line search progress to stdout.
Definition ComMod.h:1209
bool ok
Satisfied/not satisfied.
Definition ComMod.h:1091
int nBcIB
Number of BCs on immersed surfaces.
Definition ComMod.h:1136
std::string sym
Equation symbol.
Definition ComMod.h:1214
bool expl_geom_cpl
Explicit geometry coupling.
Definition ComMod.h:1257
bool assmTLS
Use C++ Trilinos framework for assembly and for linear solvers.
Definition ComMod.h:1097
lsType ls
type of linear solver
Definition ComMod.h:1218
double line_search_minimum_decrease
Minimum decrease of the residual norm for line search.
Definition ComMod.h:1188
std::vector< outputType > outIB
IB: Outputs.
Definition ComMod.h:1251
double tol
Accepted relative tolerance.
Definition ComMod.h:1172
bool useTLS
Use C++ Trilinos framework for the linear solvers.
Definition ComMod.h:1094
int itr
Number of performed iterations.
Definition ComMod.h:1109
double gam
Definition ComMod.h:1160
std::vector< outputType > outURIS
URIS: Outputs.
Definition ComMod.h:1254
int nBc
Number of BCs.
Definition ComMod.h:1133
int e
Pointer to end of unknown Yo(:,s:e).
Definition ComMod.h:1103
std::vector< dmnType > dmn
domains that this equation must be solved
Definition ComMod.h:1242
consts::PreconditionerType linear_algebra_preconditioner
The type of preconditioner used by the interface to a numerical linear algebra library.
Definition ComMod.h:1227
int nOutIB
IB: Number of possible outputs.
Definition ComMod.h:1121
double am
Definition ComMod.h:1154
double iNorm
Initial norm of residual.
Definition ComMod.h:1163
consts::LinearAlgebraType linear_algebra_assembly_type
The type of assembly interface to a numerical linear algebra library.
Definition ComMod.h:1224
consts::LinearAlgebraType linear_algebra_type
The type of interface to a numerical linear algebra library.
Definition ComMod.h:1221
int nOutURIS
URIS: Number of possible outputs.
Definition ComMod.h:1124
std::vector< bfType > bf
Body force associated with this equation.
Definition ComMod.h:1260
double pNorm
First iteration norm.
Definition ComMod.h:1166
double af
Definition ComMod.h:1147
int nBf
Number of BFs.
Definition ComMod.h:1139
int nDmn
Number of domains.
Definition ComMod.h:1127
int nOutput
Number of possible outputs.
Definition ComMod.h:1118
std::vector< dmnType > dmnIB
IB: immersed domains that this equation must be solved.
Definition ComMod.h:1245
double line_search_minimum_step_length
Line search minimum step length.
Definition ComMod.h:1204
std::vector< bcType > bc
BCs associated with this equation;.
Definition ComMod.h:1236
std::vector< bcType > bcIB
IB: BCs associated with this equation on immersed surfaces.
Definition ComMod.h:1239
int dof
Degrees of freedom.
Definition ComMod.h:1100
double line_search_step_reduction_factor
Line search step reduction factor.
Definition ComMod.h:1196
fsi_linear_solver::FSILS_lsType FSILS
FSILS type of linear solver.
Definition ComMod.h:1233
consts::EquationType phys
Type of equation fluid/heatF/heatS/lElas/FSI.
Definition ComMod.h:1142
std::vector< outputType > output
Outputs.
Definition ComMod.h:1248
double beta
Definition ComMod.h:1157
int minItr
Minimum iteration for this eq.
Definition ComMod.h:1115
bool line_search_enabled
Toggle line search for this equation.
Definition ComMod.h:1180
void destroy()
Free memory and reset some data members.
Definition ComMod.cpp:121
Fluid viscosity model type.
Definition ComMod.h:336
void destroy()
SUBROUTINE DESTROYFS(fs).
Definition ComMod.cpp:158
Definition ComMod.h:1345
Vector< int > nG
Num traces (Gauss points) local to each process.
Definition ComMod.h:1354
Vector< int > n
Num traces (nodes) local to each process.
Definition ComMod.h:1348
Vector< int > gE
Pointer to global trace (Gauss point) stacked contiguously.
Definition ComMod.h:1357
Vector< int > gN
Pointer to global trace (node num) stacked contiguously.
Definition ComMod.h:1351
Immersed Boundary (IB) data type.
Definition ComMod.h:1364
Array< double > x
IB position coordinates.
Definition ComMod.h:1408
Array< double > Aun
Time derivative of displacement (new).
Definition ComMod.h:1417
int cpld
IB coupling.
Definition ComMod.h:1376
Array< double > Ku
LHS tangent matrix for displacement.
Definition ComMod.h:1447
int tnNo
Total number of IB nodes.
Definition ComMod.h:1390
Array< double > Un
Displacement (projected on background mesh, new, n+af).
Definition ComMod.h:1435
int cEq
Current equation.
Definition ComMod.h:1387
Array< double > R
Residual (FSI force).
Definition ComMod.h:1438
int intrp
IB interpolation method.
Definition ComMod.h:1380
Array< double > Uo
Displacement (projected on background mesh, old).
Definition ComMod.h:1432
Array< double > Yb
Velocity (new).
Definition ComMod.h:1411
Array< double > Ubn
Displacement (new).
Definition ComMod.h:1426
int cDmn
Current IB domain ID.
Definition ComMod.h:1384
double callD[4]
IB call duration (1: total time; 2: update; 3,4: communication).
Definition ComMod.h:1396
ibCommType cm
IB communicator.
Definition ComMod.h:1453
Vector< int > rowPtr
Row pointer (for sparse LHS matrix storage).
Definition ComMod.h:1402
Array< double > Rub
Residual (displacement, IB mesh).
Definition ComMod.h:1444
bool savedOnce
Whether any file being saved.
Definition ComMod.h:1368
Vector< int > dmnID
IB Domain ID.
Definition ComMod.h:1399
Array< double > Auo
Time derivative of displacement (old).
Definition ComMod.h:1414
Array< double > Ubk
Displacement (n+af).
Definition ComMod.h:1429
int nMsh
Number of IB meshes.
Definition ComMod.h:1393
int mthd
IB method.
Definition ComMod.h:1372
std::vector< mshType > msh
DERIVED class VARIABLES IB meshes;.
Definition ComMod.h:1450
Array< double > Ubo
Displacement (old).
Definition ComMod.h:1423
Vector< int > colPtr
Column pointer (for sparse LHS matrix storage).
Definition ComMod.h:1405
Array< double > Ru
Residual (displacement, background mesh).
Definition ComMod.h:1441
Array< double > Auk
Time derivative of displacement (n+am).
Definition ComMod.h:1420
Only to group four channels, in case I rather have them as one variable.
Definition ChnlMod.h:50
Linear system of equations solver type.
Definition ComMod.h:611
double absTol
Absolute tolerance (IN).
Definition ComMod.h:642
int cN
Number of |x| norms (OUT).
Definition ComMod.h:633
int cD
Number of <x.y> dot products (OUT).
Definition ComMod.h:636
double fNorm
Final norm of residual (OUT).
Definition ComMod.h:651
double callD
Calling duration (OUT).
Definition ComMod.h:657
int reserve
Only for data alignment (-).
Definition ComMod.h:639
bool suc
Successful solving (OUT).
Definition ComMod.h:618
int mItr
Maximum iterations (IN).
Definition ComMod.h:621
consts::SolverType LS_type
LS solver (IN).
Definition ComMod.h:615
int itr
Number of iteration (OUT).
Definition ComMod.h:627
double relTol
Relative tolerance (IN).
Definition ComMod.h:645
double dB
Res. rduction in last itr. (OUT).
Definition ComMod.h:654
int sD
Space dimension (IN).
Definition ComMod.h:624
int cM
Number of Ax multiple (OUT).
Definition ComMod.h:630
double iNorm
Initial norm of residual (OUT).
Definition ComMod.h:648
This is the container for a mesh or NURBS patch, those specific to NURBS are noted.
Definition ComMod.h:879
int nNo
Number of nodes (control points) for 2D elements?
Definition ComMod.h:940
Vector< double > w
Gauss weights.
Definition ComMod.h:1006
std::vector< std::vector< int > > ordering
@breif ordering: node ordering for boundaries
Definition ComMod.h:964
Array< double > N
Parent shape function.
Definition ComMod.h:1018
traceType trc
IB: tracers.
Definition ComMod.h:1060
Array3< double > Ys
Solution field (displacement, velocity, pressure, etc.) for a known, potentially time-varying,...
Definition ComMod.h:1039
Vector< int > eDist
Element distribution between processors.
Definition ComMod.h:967
Vector< int > iGC
IB: Whether a cell is a ghost cell or not.
Definition ComMod.h:1000
adjType nAdj
Mesh nodal adjacency.
Definition ComMod.h:1045
Array< double > xib
Bounds on parameteric coordinates.
Definition ComMod.h:1012
adjType eAdj
Mesh element adjacency.
Definition ComMod.h:1048
int nG
Number of Gauss points for integration.
Definition ComMod.h:937
int nFa
Number of faces.
Definition ComMod.h:931
Array< double > x
Position coordinates (not always, however, as they get overwritten by read_vtu_pdata()).
Definition ComMod.h:1015
std::vector< fsType > fs
Function spaces (basis).
Definition ComMod.h:1051
Array3< double > Nxx
Second derivatives of shape functions - used for shells & IGA davep double Nxx(:,:,...
Definition ComMod.h:1035
int gnNo
Global number of nodes (control points) on a single mesh.
Definition ComMod.h:922
double dx
IB: Mesh size parameter.
Definition ComMod.h:952
bool lShpF
Whether the shape function is linear.
Definition ComMod.h:903
Vector< int > lN
Global to local maping tnNo --> nNo.
Definition ComMod.h:991
Vector< int > otnIEN
gIEN mapper from old to new
Definition ComMod.h:985
Vector< int > eRIS
RIS: flags of whether elemets are adjacent to RIS projections.
Definition ComMod.h:1064
Array< int > eIEN
Shells: extended IEN array with neighboring nodes.
Definition ComMod.h:994
Fibers fibers
Fiber orientations used for electrophysiology and solid mechanics.
Definition ComMod.h:1027
Vector< int > gN
Global nodes maping nNo --> tnNo.
Definition ComMod.h:973
bool lFib
Whether the mesh is fibers (Purkinje).
Definition ComMod.h:909
double v
The volume of this mesh.
Definition ComMod.h:961
int eNoN
Number of nodes (control points) in a single element.
Definition ComMod.h:916
double scF
Mesh scale factor.
Definition ComMod.h:949
Vector< int > eId
Element domain ID number.
Definition ComMod.h:970
int gnEl
Global number of elements (knot spans).
Definition ComMod.h:919
double res
RIS resistance value.
Definition ComMod.h:955
Vector< int > partRIS
RIS: processor ids to change element partitions to.
Definition ComMod.h:1067
int nSl
Number of elements sample points to be outputs (NURBS).
Definition ComMod.h:943
Array< double > xi
Gauss integration points in parametric space.
Definition ComMod.h:1009
int nFs
Number of function spaces.
Definition ComMod.h:934
Array< int > sbc
Shells: boundary condition variable.
Definition ComMod.h:997
bool lShl
Whether the mesh is shell.
Definition ComMod.h:906
Array< double > Nb
Shape function bounds.
Definition ComMod.h:1021
Array< double > nV
Normal vector to each nodal point (for Shells).
Definition ComMod.h:1024
Vector< double > nW
Control points weights (NURBS).
Definition ComMod.h:1003
Array3< double > Nx
Parent shape functions gradient double Nx(:,:,:).
Definition ComMod.h:1031
std::vector< faceType > fa
Faces are stored in this variable.
Definition ComMod.h:1057
Vector< int > gpN
GLobal projected nodes mapping projected -> unprojected mapping.
Definition ComMod.h:976
Array< int > gIEN
Global connectivity array mappig eNoN,nEl --> gnNo.
Definition ComMod.h:979
int vtkType
The element type recognized by VTK format.
Definition ComMod.h:946
int nEl
Number of elements (knot spans).
Definition ComMod.h:928
consts::ElementType eType
Element type.
Definition ComMod.h:912
int nEf
Number of element face. Used for reading Gambit mesh files.
Definition ComMod.h:925
std::string name
Mesh Name.
Definition ComMod.h:1042
std::vector< bsType > bs
BSpline in different directions (NURBS).
Definition ComMod.h:1054
double tol
RIS projection tolerance.
Definition ComMod.h:958
Array< int > IEN
The connectivity array mapping eNoN,nEl --> nNo.
Definition ComMod.h:982
double qmTET4
TET4 quadrature modifier.
Definition ComMod.h:1070
Array< int > INN
Local knot pointer (NURBS).
Definition ComMod.h:988
Declared type for outputed variables.
Definition ComMod.h:589
Definition ComMod.h:74
Data type for Resistive Immersed Surface.
Definition ComMod.h:1459
Array3< int > lst
List of meshes, and faces connected. The first face is the.
Definition ComMod.h:1470
std::vector< bool > status
Status RIS interface.
Definition ComMod.h:1485
Vector< double > Res
Resistance value.
Definition ComMod.h:1473
Vector< int > nbrIter
Count time steps where no check is needed.
Definition ComMod.h:1466
Array< double > meanP
Mean distal and proximal pressure (1: distal, 2: proximal).
Definition ComMod.h:1479
int nbrRIS
Number of RIS surface.
Definition ComMod.h:1463
Vector< double > meanFl
Mean flux on the RIS surface.
Definition ComMod.h:1482
std::vector< bool > clsFlg
Flag closed surface active, the valve is considerd open initially.
Definition ComMod.h:1476
Definition ComMod.h:1296
Vector< double > iNorm
Initial norm of an equation.
Definition ComMod.h:1333
int rTS
Time step from which remeshing is done.
Definition ComMod.h:1311
int freq
Time step frequency for forced remeshing.
Definition ComMod.h:1320
int cpVar
Time step freq for saving data.
Definition ComMod.h:1314
Array< double > A0
Copy of solution variables where remeshing starts.
Definition ComMod.h:1336
int cntr
Counter to track number of remesh done.
Definition ComMod.h:1308
std::vector< bool > flag
Flag is set if remeshing is required for each mesh.
Definition ComMod.h:1341
double time
Time where remeshing starts.
Definition ComMod.h:1323
consts::MeshGeneratorType method
Method for remeshing: 1-TetGen, 2-MeshSim.
Definition ComMod.h:1305
double minDihedAng
Mesh quality parameters.
Definition ComMod.h:1326
int fTS
Time step at which forced remeshing is done.
Definition ComMod.h:1317
Vector< double > maxEdgeSize
Edge size of mesh.
Definition ComMod.h:1330
bool isReqd
Whether remesh is required for problem or not.
Definition ComMod.h:1302
Fluid viscosity model type.
Definition ComMod.h:361
Structural domain type.
Definition ComMod.h:286
Stores information used to interface with svOneDSolver.
Definition ComMod.h:768
bool has_data
True if the svOneDSolver interface settings were read from XML.
Definition ComMod.h:780
void set_data(const svOneDSolverInterfaceParameters &params)
Read svOneDSolver interface settings from parsed parameters.
Definition ComMod.cpp:220
std::string solver_library
Path to the svOneDSolver interface shared library.
Definition ComMod.h:774
Parameters for coupling to the svOneDSolver (1D blood-flow solver).
Definition Parameters.h:728
Definition ComMod.h:735
Parameters for coupling to the svZeroDSolver (0D lumped-parameter solver).
Definition Parameters.h:679
Tracer type used for immersed boundaries. Identifies traces of nodes and integration points on backgr...
Definition ComMod.h:435
Unfitted Resistive Immersed Surface (URIS) data type.
Definition ComMod.h:1508
Array< double > Yd
Valve displacement.
Definition ComMod.h:1533
Array< double > valve_velocity_fluid
Valve velocity interpolated on background fluid mesh nodes.
Definition ComMod.h:1583
int nFa
Number of immersed boundary meshes.
Definition ComMod.h:1521
double scF
Mesh scale factor.
Definition ComMod.h:1586
bool sdf_computed
Flag indicating whether the signed distance function is computed.
Definition ComMod.h:1577
bool scaffold_udf_computed
Flag indicating whether the scaffold mesh UDF is computed.
Definition ComMod.h:1624
Vector< int > localNode
Per-node ownership flag set by uris_find_tetra.
Definition ComMod.h:1609
mshType scaffold_msh
Scaffold mesh data.
Definition ComMod.h:1618
double meanPD
Mean pressure downstream.
Definition ComMod.h:1592
Array< double > x
Valve surface position coordinates.
Definition ComMod.h:1524
double sdf_deps_close
Half-thickness used when the valve is closed.
Definition ComMod.h:1545
std::vector< mshType > msh
Immersed boundary meshes.
Definition ComMod.h:1612
int cnt
Iteration count.
Definition ComMod.h:1574
bool include_uris_velocity
Whether to include the valve velocity in the RIS implementation.
Definition ComMod.h:1559
double sdf_deps
Half-valve thickness when the valve is open.
Definition ComMod.h:1539
Array3< double > DxClose
Closing positions of the valve surfaces.
Definition ComMod.h:1565
Array< double > valve_velocity
Valve velocity on the valve surface nodes.
Definition ComMod.h:1530
int tnNo
Total number of immersed boundary nodes.
Definition ComMod.h:1518
bool clsFlg
Close flag.
Definition ComMod.h:1571
bool scaffold_flag
Whether a scaffold mesh is enabled for this URIS instance.
Definition ComMod.h:1615
Array< int > elemId
Background fluid mesh element containing each immersed surface node.
Definition ComMod.h:1602
bool invert_normal
Whether to invert the valve surface normal vector.
Definition ComMod.h:1556
Array< double > x_prev
Valve position coordinates at the previous time step.
Definition ComMod.h:1527
Vector< double > scaffold_udf
Unsigned distance function (UDF) for the scaffold mesh.
Definition ComMod.h:1621
double sdf_default
Default signed distance value away from the valve.
Definition ComMod.h:1536
bool savedOnce
Whether any file has been saved.
Definition ComMod.h:1515
Array3< double > DxOpen
Opening positions of the valve surfaces.
Definition ComMod.h:1562
std::string name
Name of the URIS instance.
Definition ComMod.h:1512
Vector< double > nrm
Normal vector pointing in the positive flow direction.
Definition ComMod.h:1568
double relax_factor
Relaxation factor to compute weighted averages of pressure values.
Definition ComMod.h:1595
Vector< double > sdf
Signed distance function indexed by background fluid mesh node.
Definition ComMod.h:1580
double resistance
Resistance value of the valve.
Definition ComMod.h:1548
double meanPU
Mean pressure upstream.
Definition ComMod.h:1589
TODO: for now, better to organize these within a class.
Definition ComMod.h:1858
Store options for output types.
Definition ComMod.h:565