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