53 #include "fils_struct.hpp"
66 bool defined() {
return n != 0; };
102 bool defined() {
return dof != 0; };
147 bool weakDir =
false;
299 std::string file_name;
300 std::string mesh_name;
345 consts::ConstitutiveModelType volType = consts::ConstitutiveModelType::stIso_NA;
351 consts::ConstitutiveModelType isoType = consts::ConstitutiveModelType::stIso_NA;
393 consts::FluidViscosityModelType viscType = consts::FluidViscosityModelType::viscType_NA;
431 std::map<consts::PhysicalProperyType,double> prop;
588 std::vector<fsType>
fs;
591 double qmTRI3 = 2.0/3.0;
601 std::vector<bool> wtn{
false,
false,
false};
604 consts::OutputType grp = consts::OutputType::outGrp_NA;
625 consts::SolverType
LS_type = consts::SolverType::lSolver_NA;
628 consts::PreconditionerType
PREC_Type = consts::PreconditionerType::PREC_NONE;
680 consts::ContactModelType cType = consts::ContactModelType::cntctM_NA;
781 std::vector<cplFaceType>
fa;
791 std::string dname =
"";
951 std::vector<fsType>
fs;
954 std::vector<bsType>
bs;
957 std::vector<faceType>
fa;
963 double qmTET4 = (5.0+3.0*sqrt(5.0))/20.0;
1138 consts::MeshGeneratorType
method = consts::MeshGeneratorType::RMSH_TETGEN;
1160 double maxRadRatio = 0.0;
1388 std::array<double,3> timeP;
1546 Array<double> Vinit;
1547 Array<double> Dinit;
1563 fsi_linear_solver::FSILS_lhsType
lhs;
1589 bool debug_active =
false;
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
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
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
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: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
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