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