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