svFSIplus
ComMod.h
1 /**
2  * Copyright (c) Stanford University, The Regents of the University of California, and others.
3  *
4  * All Rights Reserved.
5  *
6  * See Copyright-SimVascular.txt for additional details.
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining
9  * a copy of this software and associated documentation files (the
10  * "Software"), to deal in the Software without restriction, including
11  * without limitation the rights to use, copy, modify, merge, publish,
12  * distribute, sublicense, and/or sell copies of the Software, and to
13  * permit persons to whom the Software is furnished to do so, subject
14  * to the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be included
17  * in all copies or substantial portions of the Software.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
20  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
23  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 // The classes defined here duplicate the data structures in the Fortran COMMOD module
33 // defined in MOD.f.
34 //
35 // All of the data structures used for the mesh, boundarsy conditions and solver parameters, etc.
36 // are defined here.
37 
38 #ifndef COMMOD_H
39 #define COMMOD_H
40 
41 #include "Array.h"
42 #include "Array3.h"
43 #include "CepMod.h"
44 #include "ChnlMod.h"
45 #include "CmMod.h"
46 #include "Timer.h"
47 #include "Vector.h"
48 
49 #include "DebugMsg.h"
50 
51 #include "consts.h"
52 
53 #include "fils_struct.hpp"
54 
55 #include <array>
56 #include <iostream>
57 #include <string>
58 #include <vector>
59 
60 /// @brief Fourier coefficients that are used to specify unsteady BCs
61 //
62 class fcType
63 {
64  public:
65 
66  bool defined() { return n != 0; };
67 
68  // If this is a ramp function
69  bool lrmp = false;
70 
71  // Number of Fourier coefficient
72  int n = 0;
73 
74  // No. of dimensions (scalar or vector)
75  int d = 0;
76 
77  // Initial value
78  Vector<double> qi;
79 
80  // Time derivative of linear part
81  Vector<double> qs;
82 
83  // Period
84  double T = 0.0;
85 
86  // Initial time
87  double ti = 0.0;
88 
89  // Imaginary part of coefficint
90  Array<double> i;
91 
92  // Real part of coefficint
93  Array<double> r;
94 };
95 
96 /// @brief Moving boundary data structure (used for general BC)
97 //
98 class MBType
99 {
100  public:
101 
102  bool defined() { return dof != 0; };
103 
104  // Degrees of freedom of d(:,.,.)
105  int dof = 0;
106 
107  // Number of time points to be read
108  int nTP = 0;
109 
110  // The period of data
111  double period = 0.0;
112 
113  // Time points
114  Vector<double> t;
115 
116  // Displacements at each direction, location, and time point
117  Array3<double> d;
118 };
119 
120 class rcrType
121 {
122  public:
123 
124  // Proximal resistance
125  double Rp = 0.0;
126 
127  // Capacitance
128  double C = 0.0;
129 
130  // Distance resistance
131  double Rd = 0.0;
132 
133  // Distal pressure
134  double Pd = 0.0;
135 
136  // Initial value
137  double Xo = 0.0;
138 };
139 
140 /// @brief Boundary condition data type
141 //
142 class bcType
143 {
144  public:
145 
146  // Strong/Weak application of Dirichlet BC
147  bool weakDir = false;
148 
149  // Whether load vector changes with deformation
150  // (Neu - struct/ustruct only)
151  bool flwP = false;
152 
153  // Robin: apply only in normal direction
154  bool rbnN = false;
155 
156  // Pre/Res/Flat/Para... boundary types
157  //
158  // This stores differnt BCs as bitwise values.
159  //
160  int bType = 0;
161 
162  // Pointer to coupledBC%face
163  int cplBCptr = -1;
164 
165  // The face index that corresponds to this BC
166  int iFa = -1;
167 
168  // The mesh index that corresponds to this BC
169  int iM = -1;
170 
171  // Pointer to FSILS%bc
172  int lsPtr = -1;
173 
174  // Undeforming Neu BC master-slave node parameters.
175  int masN = 0;
176 
177  // Defined steady value
178  double g = 0.0;
179 
180  // Neu: defined resistance
181  double r = 0.0;
182 
183  // Robin: stiffness
184  double k = 0.0;
185 
186  // Robin: damping
187  double c = 0.0;
188 
189  // Penalty parameters for weakly applied Dir BC
190  Vector<double> tauB{0.0, 0.0};
191  //double tauB[2];
192 
193  // Direction vector for imposing the BC
194  Vector<int> eDrn;
195 
196  // Defined steady vector (traction)
197  Vector<double> h;
198 
199  // Spatial dependant BC (profile data)
200  Vector<double> gx;
201 
202  // General BC (unsteady and UD combination)
203  //
204  // This is declare ALLOCATABLE in MOD.f.
205  //
206  MBType gm;
207 
208  // Time dependant BC (Unsteady imposed value);
209  //
210  // This is declare ALLOCATABLE in MOD.f.
211  //
212  fcType gt;
213 
214  // Neu: RCR
215  rcrType RCR;
216 };
217 
218 /// @brief Class storing data for B-Splines.
219 //
220 class bsType
221 {
222  public:
223 
224  // Number of knots (p + nNo + 1)
225  int n = 0;
226 
227  // Number of Gauss points for integration
228  int nG = 0;
229 
230  // Number of knot spans (element)
231  int nEl = 0;
232 
233  // Number of control points (nodes)
234  int nNo = 0;
235 
236  // Number of sample points in each element (for output)
237  int nSl = 0;
238 
239  // The order
240  int p = 0;
241 
242  // Knot vector.
243  Vector<double> xi;
244 };
245 
246 /// @brief Function spaces (basis) type.
247 //
248 class fsType {
249 
250  public:
251 
252  fsType();
253 
254  void destroy();
255 
256  // Whether the basis function is linear
257  bool lShpF = false;
258 
259  // Element type
260  consts::ElementType eType = consts::ElementType::NA;
261 
262  // Number of basis functions, typically equals msh%eNoN
263  int eNoN = 0;
264 
265  // Number of Gauss points for integration
266  int nG = 0;
267 
268  // Gauss weights
269  Vector<double> w;
270 
271  // Gauss integration points in parametric space
272  Array<double> xi;
273 
274  // Bounds on Gauss integration points in parametric space
275  Array<double> xib;
276 
277  // Parent shape function
278  Array<double> N;
279 
280  // Bounds on shape functions
281  Array<double> Nb;
282 
283  // Parent shape functions gradient
284  Array3<double> Nx;
285 
286  // Second derivatives of shape functions - used for shells & IGA
287  Array3<double> Nxx;
288 };
289 
290 //--------
291 // bfType
292 //--------
293 // Body force data structure type
294 //
295 class bfType
296 {
297  public:
298 
299  std::string file_name;
300  std::string mesh_name;
301 
302  // Type of body force applied
303  int bType = 0;
304 
305  // No. of dimensions (1 or nsd)
306  int dof = 0;
307 
308  // Mesh index corresponding to this body force
309  int iM = -1;
310 
311  // Steady value
312  Vector<double> b;
313 
314  // Steady but spatially dependant
315  Array<double> bx;
316 
317  // Time dependant (unsteady imposed value)
318  fcType bt;
319 
320  // General (unsteady and spatially dependent combination)
321  MBType bm;
322 };
323 
324 // Fiber stress type
326 {
327  public:
328 
329  // Type of fiber stress
330  int fType = 0;
331 
332  // Constant steady value
333  double g = 0.0;
334 
335  // Unsteady time-dependent values
336  fcType gt;
337 };
338 
339 /// @brief Structural domain type
340 //
342 {
343  public:
344  // Type of constitutive model (volumetric) for struct/FSI
345  consts::ConstitutiveModelType volType = consts::ConstitutiveModelType::stIso_NA;
346 
347  // Penalty parameter
348  double Kpen = 0.0;
349 
350  // Type of constitutive model (isochoric) for struct/FSI
351  consts::ConstitutiveModelType isoType = consts::ConstitutiveModelType::stIso_NA;
352 
353  // Parameters specific to the constitutive model (isochoric)
354  // NeoHookean model (C10 = mu/2)
355  double C10 = 0.0;
356 
357  // Mooney-Rivlin model (C10, C01)
358  double C01 = 0.0;
359 
360  // Holzapfel model(a, b, aff, bff, ass, bss, afs, bfs, kap)
361  double a = 0.0;
362  double b = 0.0;
363  double aff = 0.0;
364  double bff = 0.0;
365  double ass = 0.0;
366  double bss = 0.0;
367  double afs = 0.0;
368  double bfs = 0.0;
369 
370  // Collagen fiber dispersion parameter (Holzapfel model)
371  double kap = 0.0;
372 
373  // Heaviside function parameter (Holzapfel-Ogden model)
374  double khs = 100.0;
375 
376  // Lee-Sacks model
377  double a0 = 0.0;
378  double b1 = 0.0;
379  double b2 = 0.0;
380  double mu0 = 0.0;
381 
382  // Fiber reinforcement stress
383  fibStrsType Tf;
384 };
385 
386 /// @brief Fluid viscosity model type
387 //
389 {
390  public:
391 
392  // Type of constitutive model for fluid viscosity
393  consts::FluidViscosityModelType viscType = consts::FluidViscosityModelType::viscType_NA;
394 
395  // Limiting zero shear-rate viscosity value
396  double mu_o = 0.0;
397 
398  // Limiting high shear-rate viscosity (asymptotic) value
399  double mu_i = 0.0;
400 
401  // Strain-rate tensor multiplier
402  double lam = 0.0;
403 
404  // Strain-rate tensor exponent
405  double a = 0.0;
406 
407  // Power-law exponent
408  double n = 0.0;
409 };
410 
411 /// @brief Domain type is to keep track with element belong to which domain
412 /// and also different physical quantities
413 //
414 class dmnType
415 {
416  public:
417  dmnType();
418  ~dmnType();
419 
420  // The domain ID. Default includes entire domain
421  int Id = -1;
422 
423  // Which physics must be solved in this domain
424  consts::EquationType phys = consts::EquationType::phys_NA;
425 
426  // The volume of this domain
427  double v = 0.0;
428 
429  // General physical properties such as density, elastic modulus...
430  // FIX davep double prop[maxNProp] ;
431  std::map<consts::PhysicalProperyType,double> prop;
432  //double prop[consts::maxNProp];
433 
434  // Electrophysiology model
436 
437  // Structure material model
438  stModelType stM;
439 
440  // Viscosity model for fluids
441  viscModelType visc;
442 };
443 
444 /// @brief Mesh adjacency (neighboring element for each element)
445 //
446 class adjType
447 {
448  public:
449  void destroy();
450 
451  // No of non-zeros
452  int nnz = 0;
453 
454  // Column pointer
455  Vector<int> pcol;
456 
457  // Row pointer
458  Vector<int> prow;
459 
460 };
461 
462 /// @brief Tracer type used for immersed boundaries. Identifies traces of
463 /// nodes and integration points on background mesh elements
464 //
466 {
467  public:
468  // No. of non-zero nodal traces
469  int n = 0;
470 
471  // No. of non-zero integration point traces
472  int nG = 0;
473 
474  // Local to global nodes maping nNo --> tnNo
475  Vector<int> gN;
476 
477  // Self pointer of each trace to the IB integration point and
478  // element ID
479  Array<int> gE;
480 
481  // Nodal trace pointer array stores two values for each trace.
482  // (1) background mesh element to which the trace points to,
483  // (2) mesh ID
484  Array<int> nptr;
485 
486  // Integration point tracer array stores two values for each trace
487  // (1) background mesh element to which the trace points to,
488  // (2) mesh ID
489  Array<int> gptr;
490 
491  // Parametric coordinate for each nodal trace
492  Array<double> xi;
493 
494  // Parametric coordinate for each Gauss point trace
495  Array<double> xiG;
496 };
497 
498 /// @brief The face type containing mesh at boundary
499 //
500 class faceType
501 {
502  public:
503  faceType();
504  ~faceType();
505 
506  void destroy();
507 
508  //faceType& operator=(const faceType& rhs);
509 
510  // Parametric direction normal to this face (NURBS)
511  int d = 0;
512 
513  // Number of nodes (control points) in a single element
514  int eNoN = 0;
515 
516  // Element type
517  consts::ElementType eType = consts::ElementType::NA;
518 
519  // The mesh index that this face belongs to
520  int iM = 0;
521 
522  // Number of elements
523  int nEl = 0;
524 
525  // Global number of elements
526  int gnEl = 0;
527 
528  // Number of function spaces
529  int nFs = 0;
530 
531  // Number of Gauss points for integration
532  int nG = 0;
533 
534  // Number of nodes
535  int nNo = 0;
536 
537  // Global element Ids
538  Vector<int> gE;
539 
540  // Global node Ids
541  Vector<int> gN;
542 
543  // Global to local maping tnNo --> nNo
544  Vector<int> lN;
545 
546  // Connectivity array
547  Array<int> IEN;
548 
549  // EBC array (gE + gIEN)
550  Array<int> gebc;
551 
552  // Surface area
553  double area = 0.0;
554 
555  // Gauss point weights
556  Vector<double> w;
557 
558  // Position coordinates
559  Array<double> x;
560 
561  // Gauss points in parametric space
562  Array<double> xi;
563 
564  // Shape functions at Gauss points
565  Array<double> N;
566 
567  // Normal vector to each nodal point
568  Array<double> nV;
569 
570  // Shape functions derivative at Gauss points
571  // double Nx(:,:,:);
572  Array3<double> Nx;
573 
574  // Second derivatives of shape functions - for shells & IGA
575  // double Nxx(:,:,:);
576  Array3<double> Nxx;
577 
578  // Face name for flux files
579  std::string name;
580 
581  // Face nodal adjacency
582  adjType nAdj;
583 
584  // Face element adjacency
585  adjType eAdj;
586 
587  // Function spaces (basis)
588  std::vector<fsType> fs;
589 
590  // TRI3 quadrature modifier
591  double qmTRI3 = 2.0/3.0;
592 };
593 
594 /// @brief Declared type for outputed variables
595 //
597 {
598  public:
599 
600  // Is this output suppose to be written into VTK, boundary, vol
601  std::vector<bool> wtn{false, false, false};
602 
603  // The group that this belong to (one of outType_*)
604  consts::OutputType grp = consts::OutputType::outGrp_NA;
605  //int grp;
606 
607  // Length of the outputed variable
608  int l = 0;
609 
610  // Offset from the first index
611  int o = 0;
612 
613  // The name to be used for the output and also in input file
614  std::string name;
615 };
616 
617 
618 /// @brief Linear system of equations solver type
619 //
620 class lsType
621 {
622  public:
623 
624  /// @brief LS solver (IN)
625  consts::SolverType LS_type = consts::SolverType::lSolver_NA;
626 
627  /// @brief Preconditioner (IN)
628  consts::PreconditionerType PREC_Type = consts::PreconditionerType::PREC_NONE;
629 
630  /// @brief Successful solving (OUT)
631  bool suc = false;
632 
633  /// @brief Maximum iterations (IN)
634  int mItr = 1000;
635 
636  /// @brief Space dimension (IN)
637  int sD = 0;
638 
639  /// @brief Number of iteration (OUT)
640  int itr = 0;
641 
642  /// @brief Number of Ax multiple (OUT)
643  int cM = 0;
644 
645  /// @brief Number of |x| norms (OUT)
646  int cN = 0;
647 
648  /// @brief Number of <x.y> dot products (OUT)
649  int cD = 0;
650 
651  /// @brief Only for data alignment (-)
652  int reserve = 0;
653 
654  /// @brief Absolute tolerance (IN)
655  double absTol = 1e-08;
656 
657  /// @brief Relative tolerance (IN)
658  double relTol = 0.0;
659 
660  /// @brief Initial norm of residual (OUT)
661  double iNorm = 0.0;
662 
663  /// @brief Final norm of residual (OUT)
664  double fNorm = 0.0;
665 
666  /// @brief Res. rduction in last itr. (OUT)
667  double dB = 0.0;
668 
669  /// @brief Calling duration (OUT)
670  double callD = 0.0;
671 };
672 
673 
674 /// @brief Contact model type
675 //
677 {
678  public:
679  // Contact model
680  consts::ContactModelType cType = consts::ContactModelType::cntctM_NA;
681 
682  // Penalty parameter
683  double k = 0.0;
684 
685  // Min depth of penetration
686  double h = 0.0;
687 
688  // Max depth of penetration
689  double c = 0.0;
690 
691  // Min norm of face normals in contact
692  double al = 0.0;
693 
694  // Tolerance
695  double tol = 0.0;
696 };
697 
699 {
700  public:
701  // GenBC_Dir/GenBC_Neu
702  consts::CplBCType bGrp = consts::CplBCType::cplBC_NA;
703 
704  // Pointer to X
705  int Xptr = -1;
706 
707  // Internal genBC use
708  int eqv = 0;
709 
710  // Flow rates at t
711  double Qo = 0.0;
712 
713  // Flow rates at t+dt
714  double Qn = 0.0;
715 
716  // Pressures at t
717  double Po = 0.0;
718 
719  // Pressures at t+dt
720  double Pn = 0.0;
721 
722  // Imposed flow/pressure
723  double y = 0.0;
724 
725  // Name of the face
726  std::string name;
727 
728  // RCR type BC
729  rcrType RCR;
730 };
731 
732 /// @brief For coupled 0D-3D problems
733 //
735 {
736  public:
737  cplBCType();
738  /// @brief Is multi-domain active
739  bool coupled = false;
740 
741  /// @brief Whether to use genBC
742  bool useGenBC = false;
743 
744  /// @brief Whether to initialize RCR from flow data
745  bool initRCR = false;
746 
747  /// @brief Number of coupled faces
748  int nFa = 0;
749 
750  /// @brief Number of unknowns in the 0D domain
751  int nX = 0;
752 
753  /// @brief Number of output variables addition to nX
754  int nXp = 0;
755 
756  /// @brief Implicit/Explicit/Semi-implicit schemes
757  consts::CplBCType schm = consts::CplBCType::cplBC_NA;
758  //int schm = cplBC_NA;
759 
760  /// @brief Path to the 0D code binary file
761  std::string binPath;
762 
763  /// @brief File name for communication between 0D and 3D
764  std::string commuName;
765  //std::string commuName = ".CPLBC_0D_3D.tmp";
766 
767  /// @brief The name of history file containing "X"
768  std::string saveName;
769  //std::string(LEN=stdL) :: saveName = "LPN.dat";
770 
771  /// @brief New time step unknowns in the 0D domain
773 
774  /// @brief Old time step unknowns in the 0D domain
776 
777  /// @brief Output variables to be printed
779 
780  /// @brief Data structure used for communicating with 0D code
781  std::vector<cplFaceType> fa;
782 };
783 
784 /// @brief This is the container for a mesh or NURBS patch, those specific
785 /// to NURBS are noted
786 //
787 class mshType
788 {
789  public:
790  mshType();
791  std::string dname = "";
792 
793 /*
794  mshType(const mshType &other)
795  {
796  std::cout << "c c c c c mshType copy c c c c c" << std::endl;
797  }
798 
799  mshType& operator = (const mshType &other)
800  {
801  std::cout << "= = = = = mshType assignment = = = = =" << std::endl;
802  return *this;
803  }
804 */
805 
806  ~mshType()
807  {
808  //std::cout << "- - - - - mshType dtor - - - - - dname: " << dname << std::endl;
809  };
810 
811  /// @brief Whether the shape function is linear
812  bool lShpF = false;
813 
814  /// @brief Whether the mesh is shell
815  bool lShl = false;
816 
817  /// @brief Whether the mesh is fibers (Purkinje)
818  bool lFib = false;
819 
820  /// @brief Element type
821  consts::ElementType eType = consts::ElementType::NA;
822  //int eType = eType_NA
823 
824  /// @brief Number of nodes (control points) in a single element
825  int eNoN = 0;
826 
827  /// @brief Global number of elements (knot spans)
828  int gnEl = 0;
829 
830  /// @brief Global number of nodes (control points)
831  int gnNo = 0;
832 
833  /// @brief Number of element face. Used for reading Gambit mesh files
834  int nEf = 0;
835 
836  /// @brief Number of elements (knot spans)
837  int nEl = 0;
838 
839  /// @brief Number of faces
840  int nFa = 0;
841 
842  /// @brief Number of function spaces
843  int nFs = 0;
844 
845  /// @brief Number of Gauss points for integration
846  int nG = 0;
847 
848  /// @brief Number of nodes (control points) for 2D elements?
849  int nNo = 0;
850 
851  /// @brief Number of elements sample points to be outputs (NURBS)
852  int nSl = 0;
853 
854  /// @brief The element type recognized by VTK format
855  int vtkType = 0;
856 
857  /// @brief Number of fiber directions
858  int nFn = 0;
859 
860  /// @brief Mesh scale factor
861  double scF = 0.0;
862 
863  /// @brief IB: Mesh size parameter
864  double dx = 0.0;
865 
866  /// @breif ordering: node ordering for boundaries
867  std::vector<std::vector<int>> ordering;
868 
869  /// @brief Element distribution between processors
871 
872  /// @brief Element domain ID number
874 
875  /// @brief Global nodes maping nNo --> tnNo
877 
878  /// @brief GLobal projected nodes mapping projected -> unprojected mapping
880 
881  /// @brief Global connectivity array mappig eNoN,nEl --> gnNo
882  Array<int> gIEN;
883 
884  /// @brief The connectivity array mapping eNoN,nEl --> nNo
885  Array<int> IEN;
886 
887  /// @brief gIEN mapper from old to new
889 
890  /// @brief Local knot pointer (NURBS)
891  Array<int> INN;
892 
893  /// @brief Global to local maping tnNo --> nNo
895 
896  /// @brief Shells: extended IEN array with neighboring nodes
897  Array<int> eIEN;
898 
899  /// @brief Shells: boundary condition variable
900  Array<int> sbc;
901 
902  /// @brief IB: Whether a cell is a ghost cell or not
904 
905  /// @brief Control points weights (NURBS)
907 
908  /// @brief Gauss weights
910 
911  /// @brief Gauss integration points in parametric space
912  Array<double> xi;
913 
914  /// @brief Bounds on parameteric coordinates
915  Array<double> xib;
916 
917  /// @brief Position coordinates
918  Array<double> x;
919 
920  /// @brief Parent shape function
921  Array<double> N;
922 
923  /// @brief Shape function bounds
924  Array<double> Nb;
925 
926  /// @brief Normal vector to each nodal point (for Shells)
927  Array<double> nV;
928 
929  /// @brief Fiber orientations stored at the element level - used for
930  /// electrophysiology and solid mechanics
931  Array<double> fN;
932 
933  /// @brief Parent shape functions gradient
934  /// double Nx(:,:,:)
936 
937  /// @brief Second derivatives of shape functions - used for shells & IGA
938  /// davep double Nxx(:,:,:)
940 
941  /// @brief Mesh Name
942  std::string name;
943 
944  /// @brief Mesh nodal adjacency
946 
947  /// @brief Mesh element adjacency
949 
950  /// @brief Function spaces (basis)
951  std::vector<fsType> fs;
952 
953  /// @brief BSpline in different directions (NURBS)
954  std::vector<bsType> bs;
955 
956  /// @brief Faces are stored in this variable
957  std::vector<faceType> fa;
958 
959  /// @brief IB: tracers
961 
962  /// @brief TET4 quadrature modifier
963  double qmTET4 = (5.0+3.0*sqrt(5.0))/20.0;
964 
965  private:
966  //mshType(const mshType&);
967  //mshType& operator=(const mshType&);
968 
969 };
970 
971 /// @brief Equation type
972 //
973 class eqType
974 {
975  public:
976  eqType();
977  ~eqType();
978 
979  /// @brief Should be satisfied in a coupled/uncoupled fashion
980  bool coupled = false;
981  //bool coupled = .TRUE.
982 
983  /// @brief Satisfied/not satisfied
984  bool ok = false;
985 
986  /// @brief Use C++ Trilinos framework for the linear solvers
987  bool useTLS = false;
988 
989  /// @brief Use C++ Trilinos framework for assembly and for linear solvers
990  bool assmTLS = false;
991 
992  /// @brief Degrees of freedom
993  int dof = 0;
994 
995  /// @brief Pointer to end of unknown Yo(:,s:e)
996  int e = -1;
997 
998  /// @brief Pointer to start of unknown Yo(:,s:e)
999  int s = -1;
1000 
1001  /// @brief Number of performed iterations
1002  int itr = 0;
1003 
1004  /// @brief Maximum iteration for this eq.
1005  int maxItr = 5;
1006 
1007  /// @brief Minimum iteration for this eq.
1008  int minItr = 1;
1009 
1010  /// @brief Number of possible outputs
1011  int nOutput = 0;
1012 
1013  /// @brief IB: Number of possible outputs
1014  int nOutIB = 0;
1015 
1016  /// @brief Number of domains
1017  int nDmn = 0;
1018 
1019  /// @brief IB: Number of immersed domains
1020  int nDmnIB = 0;
1021 
1022  /// @brief Number of BCs
1023  int nBc = 0;
1024 
1025  /// @brief Number of BCs on immersed surfaces
1026  int nBcIB = 0;
1027 
1028  /// @brief Number of BFs
1029  int nBf = 0;
1030 
1031  /// @brief Type of equation fluid/heatF/heatS/lElas/FSI
1032  consts::EquationType phys = consts::EquationType::phys_NA;
1033 
1034  // Parameters used for the Generalized α− Method.
1035  //
1036  /// @brief \f$\alpha_f\f$
1037  double af = 0.0;
1038 
1039  /// @brief \f$\alpha_m\f$
1040  ///
1041  /// For second order equations: am = (2.0 - roInf) / (1.0 + roInf)
1042  /// First order equations: am = 0.5 * (3.0 - roInf) / (1.0 + roInf)
1043  //
1044  double am = 0.0;
1045 
1046  /// @brief \f$\beta\f$
1047  double beta = 0.0;
1048 
1049  /// @brief \f$\gamma\f$
1050  double gam = 0.0;
1051 
1052  /// @brief Initial norm of residual
1053  double iNorm = 0.0;
1054 
1055  /// @brief First iteration norm
1056  double pNorm = 0.0;
1057 
1058  /// @brief \f$\rho_{infinity}\f$
1059  double roInf = 0.0;
1060 
1061  /// @brief Accepted relative tolerance
1062  double tol = 0.0;
1063 
1064  /// @brief Equation symbol
1065  std::string sym;
1066  //std::string(LEN=2) :: sym = "NA";
1067 
1068  /// @brief type of linear solver
1070 
1071  /// @brief FSILS type of linear solver
1072  fsi_linear_solver::FSILS_lsType FSILS;
1073 
1074  /// @brief BCs associated with this equation;
1075  std::vector<bcType> bc;
1076 
1077  /// @brief IB: BCs associated with this equation on immersed surfaces
1078  std::vector<bcType> bcIB;
1079 
1080  /// @brief domains that this equation must be solved
1081  std::vector<dmnType> dmn;
1082 
1083  /// @brief IB: immersed domains that this equation must be solved
1084  std::vector<dmnType> dmnIB;
1085 
1086  /// @brief Outputs
1087  std::vector<outputType> output;
1088 
1089  /// @brief IB: Outputs
1090  std::vector<outputType> outIB;
1091 
1092  /// @brief Body force associated with this equation
1093  std::vector<bfType> bf;
1094 };
1095 
1096 /// @brief This type will be used to write data in the VTK files.
1097 //
1099 {
1100  public:
1101 
1102  // Element number of nodes
1103  int eNoN = 0;
1104 
1105  // Number of elements
1106  int nEl = 0;
1107 
1108  // Number of nodes
1109  int nNo = 0;
1110 
1111  // vtk type
1112  int vtkType = 0;
1113 
1114  // Connectivity array
1115  Array<int> IEN;
1116 
1117  // Element based variables to be written
1118  Array<double> xe;
1119 
1120  // All the variables after transformation to global format
1121  Array<double> gx;
1122 
1123  // All the variables to be written (including position)
1124  Array<double> x;
1125 };
1126 
1127 
1129 {
1130  public:
1131 
1132  rmshType();
1133 
1134  /// @brief Whether remesh is required for problem or not
1135  bool isReqd = false;
1136 
1137  /// @brief Method for remeshing: 1-TetGen, 2-MeshSim
1138  consts::MeshGeneratorType method = consts::MeshGeneratorType::RMSH_TETGEN;
1139 
1140  /// @brief Counter to track number of remesh done
1141  int cntr = 0;
1142 
1143  /// @brief Time step from which remeshing is done
1144  int rTS = 0;
1145 
1146  /// @brief Time step freq for saving data
1147  int cpVar = 0;
1148 
1149  /// @brief Time step at which forced remeshing is done
1150  int fTS = 1000;
1151 
1152  /// @brief Time step frequency for forced remeshing
1153  int freq = 1000;
1154 
1155  /// @brief Time where remeshing starts
1156  double time = 0.0;
1157 
1158  /// @brief Mesh quality parameters
1159  double minDihedAng = 0.0;
1160  double maxRadRatio = 0.0;
1161 
1162  /// @brief Edge size of mesh
1164 
1165  /// @brief Initial norm of an equation
1167 
1168  /// @brief Copy of solution variables where remeshing starts
1169  Array<double> A0;
1170  Array<double> Y0;
1171  Array<double> D0;
1172 
1173  /// @brief Flag is set if remeshing is required for each mesh
1174  std::vector<bool> flag;
1175 };
1176 
1178 {
1179  public:
1180  /// @brief Num traces (nodes) local to each process
1182 
1183  /// @brief Pointer to global trace (node num) stacked contiguously
1185 
1186  /// @brief Num traces (Gauss points) local to each process
1188 
1189  /// @brief Pointer to global trace (Gauss point) stacked contiguously
1191 };
1192 
1193 
1194 /// @brief Immersed Boundary (IB) data type
1195 //
1196 class ibType
1197 {
1198  public:
1199 
1200  /// @brief Whether any file being saved
1201  bool savedOnce = false;
1202  //bool savedOnce = .FALSE.
1203 
1204  /// @brief IB method
1205  int mthd = 0;
1206  //int mthd = ibMthd_NA;
1207 
1208  /// @brief IB coupling
1209  int cpld = 0;
1210  //int cpld = ibCpld_NA;
1211 
1212  /// @brief IB interpolation method
1213  int intrp = 0;
1214  //int intrp = ibIntrp_NA;
1215 
1216  /// @brief Current IB domain ID
1217  int cDmn = 0;
1218 
1219  /// @brief Current equation
1220  int cEq = 0;
1221 
1222  /// @brief Total number of IB nodes
1223  int tnNo = 0;
1224 
1225  /// @brief Number of IB meshes
1226  int nMsh = 0;
1227 
1228  /// @brief IB call duration (1: total time; 2: update; 3,4: communication)
1229  double callD[4] = {0.0, 0.0, 0.0, 0.0};
1230 
1231  /// @brief IB Domain ID
1233 
1234  /// @brief Row pointer (for sparse LHS matrix storage)
1236 
1237  /// @brief Column pointer (for sparse LHS matrix storage)
1239 
1240  /// @brief IB position coordinates
1241  Array<double> x;
1242 
1243  /// @brief Velocity (new)
1244  Array<double> Yb;
1245 
1246  /// @brief Time derivative of displacement (old)
1247  Array<double> Auo;
1248 
1249  /// @brief Time derivative of displacement (new)
1250  Array<double> Aun;
1251 
1252  /// @brief Time derivative of displacement (n+am)
1253  Array<double> Auk;
1254 
1255  /// @brief Displacement (old)
1256  Array<double> Ubo;
1257 
1258  /// @brief Displacement (new)
1259  Array<double> Ubn;
1260 
1261  /// @brief Displacement (n+af)
1262  Array<double> Ubk;
1263 
1264  /// @brief Displacement (projected on background mesh, old)
1265  Array<double> Uo;
1266 
1267  /// @brief Displacement (projected on background mesh, new, n+af)
1268  Array<double> Un;
1269 
1270  /// @brief Residual (FSI force)
1271  Array<double> R;
1272 
1273  /// @brief Residual (displacement, background mesh)
1274  Array<double> Ru;
1275 
1276  /// @brief Residual (displacement, IB mesh)
1277  Array<double> Rub;
1278 
1279  /// @brief LHS tangent matrix for displacement
1280  Array<double> Ku;
1281 
1282  /// @brief DERIVED class VARIABLES IB meshes;
1283  std::vector<mshType> msh;
1284 
1285  /// @brief IB communicator
1287 };
1288 
1289 /// @brief Data type for Trilinos Linear Solver related arrays
1290 //
1291 class tlsType
1292 {
1293  public:
1294 
1295  /// @brief Local to global mapping
1297 
1298  /// @brief Factor for Dirichlet BCs
1299  Array<double> W;
1300 
1301  /// @brief Residual
1302  Array<double> R;
1303 };
1304 
1305 
1306 /// @brief The ComMod class duplicates the data structures in the Fortran COMMOD module
1307 /// defined in MOD.f.
1308 ///
1309 /// The data members here are the global variables exposed by the COMMOD module.
1310 //
1311 class ComMod {
1312 
1313  public:
1314  ComMod();
1315  ~ComMod();
1316 
1317  //----- bool members -----//
1318 
1319  /// @brief Whether there is a requirement to update mesh and Dn-Do variables
1320  bool dFlag = false;
1321 
1322  /// @brief Whether mesh is moving
1323  bool mvMsh = false;
1324 
1325  /// @brief Whether to averaged results
1326  bool saveAve = false;
1327 
1328  /// @brief Whether to save to VTK files
1329  bool saveVTK = false;
1330 
1331  /// @brief Whether any file being saved
1332  bool savedOnce = false;
1333 
1334  /// @brief Whether to use separator in output
1335  bool sepOutput = false;
1336 
1337  /// @brief Whether start from beginning or from simulations
1338  bool stFileFlag = false;
1339 
1340  /// @brief Whether to overwrite restart file or not
1341  bool stFileRepl = false;
1342 
1343  /// @brief Restart simulation after remeshing
1344  bool resetSim = false;
1345 
1346  /// @brief Check IEN array for initial mesh
1347  bool ichckIEN = false;
1348 
1349  /// @brief Reset averaging variables from zero
1350  bool zeroAve = false;
1351 
1352  /// @brief Whether CMM equation is initialized
1353  bool cmmInit = false;
1354 
1355  /// @brief Whether variable wall properties are used for CMM
1356  bool cmmVarWall = false;
1357 
1358  /// @brief Whether shell equation is being solved
1359  bool shlEq = false;
1360 
1361  /// @brief Whether PRESTRESS is being solved
1362  bool pstEq = false;
1363 
1364  /// @brief Whether velocity-pressure based structural dynamics solver is used
1365  bool sstEq = false;
1366 
1367  /// @brief Whether to detect and apply any contact model
1368  bool iCntct = false;
1369 
1370  /// @brief Whether any Immersed Boundary (IB) treatment is required
1371  bool ibFlag = false;
1372 
1373  /// @brief Postprocess step - convert bin to vtk
1374  bool bin2VTK = false;
1375 
1376 
1377  //----- int members -----//
1378 
1379  /// @brief Current domain
1380  int cDmn = 0;
1381 
1382  /// @brief Current equation
1383  int cEq = 0;
1384 
1385  /// @brief Current time step
1386  int cTS = 0;
1387 
1388  std::array<double,3> timeP;
1389 
1390  /// @brief Starting time step
1391  int startTS = 0;
1392 
1393  /// @brief Current equation degrees of freedom
1394  int dof = 0;
1395 
1396  /// @brief Global total number of nodes
1397  int gtnNo = 0;
1398 
1399  /// @brief Number of equations
1400  int nEq = 0;
1401 
1402  /// @brief Number of faces in the LHS passed to FSILS
1403  int nFacesLS = 0;
1404 
1405  /// @brief Number of meshes
1406  int nMsh = 0;
1407 
1408  /// @brief Number of spatial dimensions
1409  int nsd = 0;
1410 
1411  /// @brief Number of time steps
1412  int nTS = 0;
1413 
1414  /// @brief Number of initialization time steps
1415  int nITs = 0;
1416 
1417  /// @brief stFiles record length
1418  int recLn = 0;
1419 
1420  /// @brief Start saving after this number of time step
1421  int saveATS = 0;
1422 
1423  /// @brief Increment in saving solutions
1424  int saveIncr = 0;
1425 
1426  /// @brief Stamp ID to make sure simulation is compatible with stFiles
1427  std::array<int,7> stamp;
1428 
1429  /// @brief Increment in saving restart file
1430  int stFileIncr = 0;
1431 
1432  /// @brief Total number of degrees of freedom per node
1433  int tDof = 0;
1434 
1435  /// @brief Total number of nodes
1436  int tnNo = 0;
1437 
1438  /// @brief Restart Time Step
1439  int rsTS = 0;
1440 
1441  /// @brief Number of stress values to be stored
1442  int nsymd = 0;
1443 
1444 
1445  //----- double members -----//
1446 
1447  /// @brief Time step size
1448  double dt = 0.0;
1449 
1450  /// @brief Time
1451  double time = 0.0;
1452 
1453 
1454  //----- string members -----//
1455 
1456  /// @brief Initialization file path
1457  std::string iniFilePath;
1458 
1459  /// @brief Saved output file name
1460  std::string saveName;
1461 
1462  /// @brief Restart file name
1463  std::string stFileName;
1464 
1465  /// @brief Stop_trigger file name
1466  std::string stopTrigName;
1467 
1468  // ALLOCATABLE DATA
1469 
1470  /// @brief Column pointer (for sparse LHS matrix structure)
1471  /// Modified in: lhsa()
1473 
1474  /// @brief Domain ID
1476 
1477  /// @brief Local to global pointer tnNo --> gtnNo
1479 
1480  /// @brief Row pointer (for sparse LHS matrix structure)
1481  /// Modified in: lhsa()
1483 
1484  /// @brief Array that maps global node id to rowN in the matrix
1485  /// Modified in: lhsa()
1487 
1488  /// @brief Boundary nodes set for CMM initialization and for zeroing-out
1489  /// non-wall nodal displacements
1491 
1492  /// @brief IB: iblank used for immersed boundaries (1 => solid, 0 => fluid)
1494 
1495  /// @brief Old time derivative of variables (acceleration)
1496  Array<double> Ao;
1497 
1498  /// @brief New time derivative of variables
1499  Array<double> An;
1500 
1501  /// @brief Old integrated variables (dissplacement)
1502  Array<double> Do;
1503 
1504  /// @brief New integrated variables
1505  Array<double> Dn;
1506 
1507  /// @brief Residual vector
1508  Array<double> R;
1509 
1510  /// @brief LHS matrix
1511  Array<double> Val;
1512 
1513  /// @brief Position vector
1514  Array<double> x;
1515 
1516  /// @brief Old variables (velocity)
1517  Array<double> Yo;
1518 
1519  /// @brief New variables
1520  Array<double> Yn;
1521 
1522  /// @brief Body force
1523  Array<double> Bf;
1524 
1525  //-----------------------------------------------------
1526  // Additional arrays for velocity-based formulation of
1527  // nonlinear solid mechanics.
1528  //-----------------------------------------------------
1529 
1530  /// @brief Time derivative of displacement
1531  Array<double> Ad;
1532 
1533  /// @brief Residual of the displacement equation
1534  Array<double> Rd;
1535 
1536  /// @brief LHS matrix for displacement equation
1537  Array<double> Kd;
1538 
1539  /// @brief Variables for prestress calculations
1540  Array<double> pS0;
1541  Array<double> pSn;
1542  Vector<double> pSa;
1543 
1544  /// @brief Temporary storage for initializing state variables
1546  Array<double> Vinit;
1547  Array<double> Dinit;
1548 
1549  /// @brief CMM-variable wall properties: 1-thickness, 2-Elasticity modulus
1550  Array<double> varWallProps;
1551 
1552  //------------------------
1553  // DERIVED TYPE VARIABLES
1554  //------------------------
1555 
1556  /// @brief Coupled BCs structures used for multidomain simulations
1558 
1559  /// @brief All data related to equations are stored in this container
1560  std::vector<eqType> eq;
1561 
1562  /// @brief FSILS data structure to produce LHS sparse matrix
1563  fsi_linear_solver::FSILS_lhsType lhs;
1564 
1565  /// @brief All the meshes are stored in this variable
1566  std::vector<mshType> msh;
1567 
1568  /// @brief Input/output to the screen is handled by this structure
1569  chnlType std, err, wrn, dbg;
1570 
1571  /// @brief To group above channels
1573 
1574  /// @brief The general communicator
1576 
1577  /// @brief Remesher type
1579 
1580  /// @brief Contact model type
1582 
1583  /// @brief IB: Immersed boundary data structure
1585 
1586  /// @brief Trilinos Linear Solver data type
1588 
1589  bool debug_active = false;
1590 
1591  Timer timer;
1592 };
1593 
1594 #endif
1595 
The ComMod class duplicates the data structures in the Fortran COMMOD module defined in MOD....
Definition: ComMod.h:1311
std::string stopTrigName
Stop_trigger file name.
Definition: ComMod.h:1466
ibType ib
IB: Immersed boundary data structure.
Definition: ComMod.h:1584
int stFileIncr
Increment in saving restart file.
Definition: ComMod.h:1430
int nITs
Number of initialization time steps.
Definition: ComMod.h:1415
bool ibFlag
Whether any Immersed Boundary (IB) treatment is required.
Definition: ComMod.h:1371
Vector< int > colPtr
Column pointer (for sparse LHS matrix structure) Modified in: lhsa()
Definition: ComMod.h:1472
bool zeroAve
Reset averaging variables from zero.
Definition: ComMod.h:1350
std::string saveName
Saved output file name.
Definition: ComMod.h:1460
int nMsh
Number of meshes.
Definition: ComMod.h:1406
chnlType std
Input/output to the screen is handled by this structure.
Definition: ComMod.h:1569
bool savedOnce
Whether any file being saved.
Definition: ComMod.h:1332
bool stFileRepl
Whether to overwrite restart file or not.
Definition: ComMod.h:1341
Array< double > varWallProps
CMM-variable wall properties: 1-thickness, 2-Elasticity modulus.
Definition: ComMod.h:1550
Array< double > x
Position vector.
Definition: ComMod.h:1514
bool cmmVarWall
Whether variable wall properties are used for CMM.
Definition: ComMod.h:1356
std::array< int, 7 > stamp
Stamp ID to make sure simulation is compatible with stFiles.
Definition: ComMod.h:1427
Array< double > Ad
Time derivative of displacement.
Definition: ComMod.h:1531
int cTS
Current time step.
Definition: ComMod.h:1386
int dof
Current equation degrees of freedom.
Definition: ComMod.h:1394
int gtnNo
Global total number of nodes.
Definition: ComMod.h:1397
std::string stFileName
Restart file name.
Definition: ComMod.h:1463
int tnNo
Total number of nodes.
Definition: ComMod.h:1436
int nsd
Number of spatial dimensions.
Definition: ComMod.h:1409
int nFacesLS
Number of faces in the LHS passed to FSILS.
Definition: ComMod.h:1403
int nsymd
Number of stress values to be stored.
Definition: ComMod.h:1442
tlsType tls
Trilinos Linear Solver data type.
Definition: ComMod.h:1587
Array< double > Yn
New variables.
Definition: ComMod.h:1520
bool ichckIEN
Check IEN array for initial mesh.
Definition: ComMod.h:1347
std::string iniFilePath
Initialization file path.
Definition: ComMod.h:1457
Vector< int > rowPtr
Row pointer (for sparse LHS matrix structure) Modified in: lhsa()
Definition: ComMod.h:1482
int cEq
Current equation.
Definition: ComMod.h:1383
Vector< int > cmmBdry
Boundary nodes set for CMM initialization and for zeroing-out non-wall nodal displacements.
Definition: ComMod.h:1490
Array< double > Val
LHS matrix.
Definition: ComMod.h:1511
bool bin2VTK
Postprocess step - convert bin to vtk.
Definition: ComMod.h:1374
bool saveAve
Whether to averaged results.
Definition: ComMod.h:1326
bool saveVTK
Whether to save to VTK files.
Definition: ComMod.h:1329
ComMod()
Definition: ComMod.cpp:40
int tDof
Total number of degrees of freedom per node.
Definition: ComMod.h:1433
bool cmmInit
Whether CMM equation is initialized.
Definition: ComMod.h:1353
Array< double > Rd
Residual of the displacement equation.
Definition: ComMod.h:1534
cplBCType cplBC
Coupled BCs structures used for multidomain simulations.
Definition: ComMod.h:1557
double time
Time.
Definition: ComMod.h:1451
Array< double > Dn
New integrated variables.
Definition: ComMod.h:1505
bool pstEq
Whether PRESTRESS is being solved.
Definition: ComMod.h:1362
bool resetSim
Restart simulation after remeshing.
Definition: ComMod.h:1344
Array< double > An
New time derivative of variables.
Definition: ComMod.h:1499
double dt
Time step size.
Definition: ComMod.h:1448
Array< double > R
Residual vector.
Definition: ComMod.h:1508
rmshType rmsh
Remesher type.
Definition: ComMod.h:1578
int saveIncr
Increment in saving solutions.
Definition: ComMod.h:1424
ioType io
To group above channels.
Definition: ComMod.h:1572
cntctModelType cntctM
Contact model type.
Definition: ComMod.h:1581
cmType cm
The general communicator.
Definition: ComMod.h:1575
int startTS
Starting time step.
Definition: ComMod.h:1391
Vector< int > idMap
Array that maps global node id to rowN in the matrix Modified in: lhsa()
Definition: ComMod.h:1486
bool stFileFlag
Whether start from beginning or from simulations.
Definition: ComMod.h:1338
bool sepOutput
Whether to use separator in output.
Definition: ComMod.h:1335
bool shlEq
Whether shell equation is being solved.
Definition: ComMod.h:1359
std::vector< eqType > eq
All data related to equations are stored in this container.
Definition: ComMod.h:1560
bool iCntct
Whether to detect and apply any contact model.
Definition: ComMod.h:1368
Array< double > Do
Old integrated variables (dissplacement)
Definition: ComMod.h:1502
bool dFlag
Whether there is a requirement to update mesh and Dn-Do variables.
Definition: ComMod.h:1320
int cDmn
Current domain.
Definition: ComMod.h:1380
int nTS
Number of time steps.
Definition: ComMod.h:1412
Array< double > Ao
Old time derivative of variables (acceleration)
Definition: ComMod.h:1496
int nEq
Number of equations.
Definition: ComMod.h:1400
Vector< int > iblank
IB: iblank used for immersed boundaries (1 => solid, 0 => fluid)
Definition: ComMod.h:1493
Array< double > Kd
LHS matrix for displacement equation.
Definition: ComMod.h:1537
std::vector< mshType > msh
All the meshes are stored in this variable.
Definition: ComMod.h:1566
int recLn
stFiles record length
Definition: ComMod.h:1418
int rsTS
Restart Time Step.
Definition: ComMod.h:1439
bool mvMsh
Whether mesh is moving.
Definition: ComMod.h:1323
Vector< double > Pinit
Temporary storage for initializing state variables.
Definition: ComMod.h:1545
Vector< int > ltg
Local to global pointer tnNo --> gtnNo.
Definition: ComMod.h:1478
fsi_linear_solver::FSILS_lhsType lhs
FSILS data structure to produce LHS sparse matrix.
Definition: ComMod.h:1563
Array< double > Yo
Old variables (velocity)
Definition: ComMod.h:1517
Array< double > Bf
Body force.
Definition: ComMod.h:1523
Vector< int > dmnId
Domain ID.
Definition: ComMod.h:1475
Array< double > pS0
Variables for prestress calculations.
Definition: ComMod.h:1540
int saveATS
Start saving after this number of time step.
Definition: ComMod.h:1421
bool sstEq
Whether velocity-pressure based structural dynamics solver is used.
Definition: ComMod.h:1365
Moving boundary data structure (used for general BC)
Definition: ComMod.h:99
Keep track of time.
Definition: Timer.h:41
Mesh adjacency (neighboring element for each element)
Definition: ComMod.h:447
Boundary condition data type.
Definition: ComMod.h:143
Definition: ComMod.h:296
Class storing data for B-Splines.
Definition: ComMod.h:221
Cardiac electrophysiology model type.
Definition: CepMod.h:159
Channel type, used in I/O.
Definition: ChnlMod.h:47
The cmType class stores data and defines methods used for mpi communication.
Definition: CmMod.h:83
Contact model type.
Definition: ComMod.h:677
For coupled 0D-3D problems.
Definition: ComMod.h:735
consts::CplBCType schm
Implicit/Explicit/Semi-implicit schemes.
Definition: ComMod.h:757
bool initRCR
Whether to initialize RCR from flow data.
Definition: ComMod.h:745
int nX
Number of unknowns in the 0D domain.
Definition: ComMod.h:751
int nFa
Number of coupled faces.
Definition: ComMod.h:748
Vector< double > xo
Old time step unknowns in the 0D domain.
Definition: ComMod.h:775
bool useGenBC
Whether to use genBC.
Definition: ComMod.h:742
std::string binPath
Path to the 0D code binary file.
Definition: ComMod.h:761
std::string saveName
The name of history file containing "X".
Definition: ComMod.h:768
std::string commuName
File name for communication between 0D and 3D.
Definition: ComMod.h:764
bool coupled
Is multi-domain active.
Definition: ComMod.h:739
std::vector< cplFaceType > fa
Data structure used for communicating with 0D code.
Definition: ComMod.h:781
Vector< double > xp
Output variables to be printed.
Definition: ComMod.h:778
Vector< double > xn
New time step unknowns in the 0D domain.
Definition: ComMod.h:772
int nXp
Number of output variables addition to nX.
Definition: ComMod.h:754
Definition: ComMod.h:699
This type will be used to write data in the VTK files.
Definition: ComMod.h:1099
Domain type is to keep track with element belong to which domain and also different physical quantiti...
Definition: ComMod.h:415
Equation type.
Definition: ComMod.h:974
double roInf
Definition: ComMod.h:1059
int maxItr
Maximum iteration for this eq.
Definition: ComMod.h:1005
int s
Pointer to start of unknown Yo(:,s:e)
Definition: ComMod.h:999
int nDmnIB
IB: Number of immersed domains.
Definition: ComMod.h:1020
bool coupled
Should be satisfied in a coupled/uncoupled fashion.
Definition: ComMod.h:980
bool ok
Satisfied/not satisfied.
Definition: ComMod.h:984
int nBcIB
Number of BCs on immersed surfaces.
Definition: ComMod.h:1026
std::string sym
Equation symbol.
Definition: ComMod.h:1065
bool assmTLS
Use C++ Trilinos framework for assembly and for linear solvers.
Definition: ComMod.h:990
lsType ls
type of linear solver
Definition: ComMod.h:1069
std::vector< outputType > outIB
IB: Outputs.
Definition: ComMod.h:1090
double tol
Accepted relative tolerance.
Definition: ComMod.h:1062
bool useTLS
Use C++ Trilinos framework for the linear solvers.
Definition: ComMod.h:987
int itr
Number of performed iterations.
Definition: ComMod.h:1002
double gam
Definition: ComMod.h:1050
int nBc
Number of BCs.
Definition: ComMod.h:1023
int e
Pointer to end of unknown Yo(:,s:e)
Definition: ComMod.h:996
std::vector< dmnType > dmn
domains that this equation must be solved
Definition: ComMod.h:1081
int nOutIB
IB: Number of possible outputs.
Definition: ComMod.h:1014
double am
Definition: ComMod.h:1044
double iNorm
Initial norm of residual.
Definition: ComMod.h:1053
std::vector< bfType > bf
Body force associated with this equation.
Definition: ComMod.h:1093
double pNorm
First iteration norm.
Definition: ComMod.h:1056
double af
Definition: ComMod.h:1037
int nBf
Number of BFs.
Definition: ComMod.h:1029
int nDmn
Number of domains.
Definition: ComMod.h:1017
int nOutput
Number of possible outputs.
Definition: ComMod.h:1011
std::vector< dmnType > dmnIB
IB: immersed domains that this equation must be solved.
Definition: ComMod.h:1084
std::vector< bcType > bc
BCs associated with this equation;.
Definition: ComMod.h:1075
std::vector< bcType > bcIB
IB: BCs associated with this equation on immersed surfaces.
Definition: ComMod.h:1078
int dof
Degrees of freedom.
Definition: ComMod.h:993
fsi_linear_solver::FSILS_lsType FSILS
FSILS type of linear solver.
Definition: ComMod.h:1072
consts::EquationType phys
Type of equation fluid/heatF/heatS/lElas/FSI.
Definition: ComMod.h:1032
std::vector< outputType > output
Outputs.
Definition: ComMod.h:1087
double beta
Definition: ComMod.h:1047
int minItr
Minimum iteration for this eq.
Definition: ComMod.h:1008
The face type containing mesh at boundary.
Definition: ComMod.h:501
void destroy()
Free memory and reset some data members.
Definition: ComMod.cpp:139
Fourier coefficients that are used to specify unsteady BCs.
Definition: ComMod.h:63
Definition: ComMod.h:326
Function spaces (basis) type.
Definition: ComMod.h:248
void destroy()
SUBROUTINE DESTROYFS(fs)
Definition: ComMod.cpp:176
Definition: ComMod.h:1178
Vector< int > nG
Num traces (Gauss points) local to each process.
Definition: ComMod.h:1187
Vector< int > n
Num traces (nodes) local to each process.
Definition: ComMod.h:1181
Vector< int > gE
Pointer to global trace (Gauss point) stacked contiguously.
Definition: ComMod.h:1190
Vector< int > gN
Pointer to global trace (node num) stacked contiguously.
Definition: ComMod.h:1184
Immersed Boundary (IB) data type.
Definition: ComMod.h:1197
Array< double > x
IB position coordinates.
Definition: ComMod.h:1241
Array< double > Aun
Time derivative of displacement (new)
Definition: ComMod.h:1250
int cpld
IB coupling.
Definition: ComMod.h:1209
Array< double > Ku
LHS tangent matrix for displacement.
Definition: ComMod.h:1280
int tnNo
Total number of IB nodes.
Definition: ComMod.h:1223
Array< double > Un
Displacement (projected on background mesh, new, n+af)
Definition: ComMod.h:1268
int cEq
Current equation.
Definition: ComMod.h:1220
Array< double > R
Residual (FSI force)
Definition: ComMod.h:1271
int intrp
IB interpolation method.
Definition: ComMod.h:1213
Array< double > Uo
Displacement (projected on background mesh, old)
Definition: ComMod.h:1265
Array< double > Yb
Velocity (new)
Definition: ComMod.h:1244
Array< double > Ubn
Displacement (new)
Definition: ComMod.h:1259
int cDmn
Current IB domain ID.
Definition: ComMod.h:1217
double callD[4]
IB call duration (1: total time; 2: update; 3,4: communication)
Definition: ComMod.h:1229
ibCommType cm
IB communicator.
Definition: ComMod.h:1286
Vector< int > rowPtr
Row pointer (for sparse LHS matrix storage)
Definition: ComMod.h:1235
Array< double > Rub
Residual (displacement, IB mesh)
Definition: ComMod.h:1277
bool savedOnce
Whether any file being saved.
Definition: ComMod.h:1201
Vector< int > dmnID
IB Domain ID.
Definition: ComMod.h:1232
Array< double > Auo
Time derivative of displacement (old)
Definition: ComMod.h:1247
Array< double > Ubk
Displacement (n+af)
Definition: ComMod.h:1262
int nMsh
Number of IB meshes.
Definition: ComMod.h:1226
int mthd
IB method.
Definition: ComMod.h:1205
std::vector< mshType > msh
DERIVED class VARIABLES IB meshes;.
Definition: ComMod.h:1283
Array< double > Ubo
Displacement (old)
Definition: ComMod.h:1256
Vector< int > colPtr
Column pointer (for sparse LHS matrix storage)
Definition: ComMod.h:1238
Array< double > Ru
Residual (displacement, background mesh)
Definition: ComMod.h:1274
Array< double > Auk
Time derivative of displacement (n+am)
Definition: ComMod.h:1253
Only to group four channels, in case I rather have them as one variable.
Definition: ChnlMod.h:78
Linear system of equations solver type.
Definition: ComMod.h:621
double absTol
Absolute tolerance (IN)
Definition: ComMod.h:655
int cN
Number of |x| norms (OUT)
Definition: ComMod.h:646
int cD
Number of <x.y> dot products (OUT)
Definition: ComMod.h:649
double fNorm
Final norm of residual (OUT)
Definition: ComMod.h:664
double callD
Calling duration (OUT)
Definition: ComMod.h:670
consts::PreconditionerType PREC_Type
Preconditioner (IN)
Definition: ComMod.h:628
int reserve
Only for data alignment (-)
Definition: ComMod.h:652
bool suc
Successful solving (OUT)
Definition: ComMod.h:631
int mItr
Maximum iterations (IN)
Definition: ComMod.h:634
consts::SolverType LS_type
LS solver (IN)
Definition: ComMod.h:625
int itr
Number of iteration (OUT)
Definition: ComMod.h:640
double relTol
Relative tolerance (IN)
Definition: ComMod.h:658
double dB
Res. rduction in last itr. (OUT)
Definition: ComMod.h:667
int sD
Space dimension (IN)
Definition: ComMod.h:637
int cM
Number of Ax multiple (OUT)
Definition: ComMod.h:643
double iNorm
Initial norm of residual (OUT)
Definition: ComMod.h:661
This is the container for a mesh or NURBS patch, those specific to NURBS are noted.
Definition: ComMod.h:788
int nNo
Number of nodes (control points) for 2D elements?
Definition: ComMod.h:849
Vector< double > w
Gauss weights.
Definition: ComMod.h:909
std::vector< std::vector< int > > ordering
@breif ordering: node ordering for boundaries
Definition: ComMod.h:867
Array< double > N
Parent shape function.
Definition: ComMod.h:921
traceType trc
IB: tracers.
Definition: ComMod.h:960
Vector< int > eDist
Element distribution between processors.
Definition: ComMod.h:870
Vector< int > iGC
IB: Whether a cell is a ghost cell or not.
Definition: ComMod.h:903
adjType nAdj
Mesh nodal adjacency.
Definition: ComMod.h:945
Array< double > xib
Bounds on parameteric coordinates.
Definition: ComMod.h:915
adjType eAdj
Mesh element adjacency.
Definition: ComMod.h:948
int nG
Number of Gauss points for integration.
Definition: ComMod.h:846
int nFa
Number of faces.
Definition: ComMod.h:840
Array< double > x
Position coordinates.
Definition: ComMod.h:918
std::vector< fsType > fs
Function spaces (basis)
Definition: ComMod.h:951
Array3< double > Nxx
Second derivatives of shape functions - used for shells & IGA davep double Nxx(:,:,...
Definition: ComMod.h:939
int gnNo
Global number of nodes (control points)
Definition: ComMod.h:831
double dx
IB: Mesh size parameter.
Definition: ComMod.h:864
bool lShpF
Whether the shape function is linear.
Definition: ComMod.h:812
Vector< int > lN
Global to local maping tnNo --> nNo.
Definition: ComMod.h:894
Vector< int > otnIEN
gIEN mapper from old to new
Definition: ComMod.h:888
int nFn
Number of fiber directions.
Definition: ComMod.h:858
Array< int > eIEN
Shells: extended IEN array with neighboring nodes.
Definition: ComMod.h:897
Vector< int > gN
Global nodes maping nNo --> tnNo.
Definition: ComMod.h:876
bool lFib
Whether the mesh is fibers (Purkinje)
Definition: ComMod.h:818
int eNoN
Number of nodes (control points) in a single element.
Definition: ComMod.h:825
double scF
Mesh scale factor.
Definition: ComMod.h:861
Vector< int > eId
Element domain ID number.
Definition: ComMod.h:873
int gnEl
Global number of elements (knot spans)
Definition: ComMod.h:828
int nSl
Number of elements sample points to be outputs (NURBS)
Definition: ComMod.h:852
Array< double > xi
Gauss integration points in parametric space.
Definition: ComMod.h:912
Array< double > fN
Fiber orientations stored at the element level - used for electrophysiology and solid mechanics.
Definition: ComMod.h:931
int nFs
Number of function spaces.
Definition: ComMod.h:843
Array< int > sbc
Shells: boundary condition variable.
Definition: ComMod.h:900
bool lShl
Whether the mesh is shell.
Definition: ComMod.h:815
Array< double > Nb
Shape function bounds.
Definition: ComMod.h:924
Array< double > nV
Normal vector to each nodal point (for Shells)
Definition: ComMod.h:927
Vector< double > nW
Control points weights (NURBS)
Definition: ComMod.h:906
Array3< double > Nx
Parent shape functions gradient double Nx(:,:,:)
Definition: ComMod.h:935
std::vector< faceType > fa
Faces are stored in this variable.
Definition: ComMod.h:957
Vector< int > gpN
GLobal projected nodes mapping projected -> unprojected mapping.
Definition: ComMod.h:879
Array< int > gIEN
Global connectivity array mappig eNoN,nEl --> gnNo.
Definition: ComMod.h:882
int vtkType
The element type recognized by VTK format.
Definition: ComMod.h:855
int nEl
Number of elements (knot spans)
Definition: ComMod.h:837
consts::ElementType eType
Element type.
Definition: ComMod.h:821
int nEf
Number of element face. Used for reading Gambit mesh files.
Definition: ComMod.h:834
std::string name
Mesh Name.
Definition: ComMod.h:942
std::vector< bsType > bs
BSpline in different directions (NURBS)
Definition: ComMod.h:954
Array< int > IEN
The connectivity array mapping eNoN,nEl --> nNo.
Definition: ComMod.h:885
double qmTET4
TET4 quadrature modifier.
Definition: ComMod.h:963
Array< int > INN
Local knot pointer (NURBS)
Definition: ComMod.h:891
Declared type for outputed variables.
Definition: ComMod.h:597
Definition: ComMod.h:121
Definition: ComMod.h:1129
Vector< double > iNorm
Initial norm of an equation.
Definition: ComMod.h:1166
int rTS
Time step from which remeshing is done.
Definition: ComMod.h:1144
int freq
Time step frequency for forced remeshing.
Definition: ComMod.h:1153
int cpVar
Time step freq for saving data.
Definition: ComMod.h:1147
Array< double > A0
Copy of solution variables where remeshing starts.
Definition: ComMod.h:1169
int cntr
Counter to track number of remesh done.
Definition: ComMod.h:1141
std::vector< bool > flag
Flag is set if remeshing is required for each mesh.
Definition: ComMod.h:1174
double time
Time where remeshing starts.
Definition: ComMod.h:1156
consts::MeshGeneratorType method
Method for remeshing: 1-TetGen, 2-MeshSim.
Definition: ComMod.h:1138
double minDihedAng
Mesh quality parameters.
Definition: ComMod.h:1159
int fTS
Time step at which forced remeshing is done.
Definition: ComMod.h:1150
Vector< double > maxEdgeSize
Edge size of mesh.
Definition: ComMod.h:1163
bool isReqd
Whether remesh is required for problem or not.
Definition: ComMod.h:1135
Structural domain type.
Definition: ComMod.h:342
Data type for Trilinos Linear Solver related arrays.
Definition: ComMod.h:1292
Vector< int > ltg
Local to global mapping.
Definition: ComMod.h:1296
Array< double > R
Residual.
Definition: ComMod.h:1302
Array< double > W
Factor for Dirichlet BCs.
Definition: ComMod.h:1299
Tracer type used for immersed boundaries. Identifies traces of nodes and integration points on backgr...
Definition: ComMod.h:466
Fluid viscosity model type.
Definition: ComMod.h:389
Definition: cep.cpp:46
CplBCType
Differenty type of coupling for cplBC.
Definition: consts.h:240
EquationType
Types of equations that are included in this solver.
Definition: consts.h:294
ElementType
Element type replicating eType_NA, eType_PNT, etc.
Definition: consts.h:255
Definition: fs.cpp:38