PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
Loading...
Searching...
No Matches
variables.h File Reference

Main header file for a complex fluid dynamics solver. More...

#include "petscvec.h"
#include "petscdmda.h"
#include "petscksp.h"
#include "petscsnes.h"
#include "petscdmswarm.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
Include dependency graph for variables.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Cmpnts
 A 3D point or vector with PetscScalar components. More...
 
struct  Cmpnts2
 A 2D point or vector with PetscScalar components. More...
 
struct  Cpt2D
 A 2D vector of PETSc real numbers (for geometry/coordinates). More...
 
struct  FlowWave
 Represents a single point in a time-varying flow waveform. More...
 
struct  BCS
 Legacy boundary condition data. More...
 
struct  BoundingBox
 Defines a 3D axis-aligned bounding box. More...
 
struct  Cell
 Defines the vertices of a single hexahedral grid cell. More...
 
struct  Particle
 Defines a particle's core properties for Lagrangian tracking. More...
 
struct  RankNeighbors
 Stores the MPI ranks of neighboring subdomains. More...
 
struct  RankCellInfo
 A lean struct to hold the global cell ownership range for a single MPI rank. More...
 
struct  MigrationInfo
 Information needed to migrate a single particle between MPI ranks. More...
 
struct  BC_Param_s
 A node in a linked list for storing key-value parameters from the bcs.dat file. More...
 
struct  BCContext
 Provides execution context for a boundary condition handler. More...
 
struct  BoundaryCondition
 The "virtual table" struct for a boundary condition handler object. More...
 
struct  BoundaryFaceConfig
 Holds the complete configuration for one of the six boundary faces. More...
 
struct  IBMInfo
 Holds interpolation and distance information for a single IBM point. More...
 
struct  IBMNodes
 Represents a collection of nodes forming a surface for the IBM. More...
 
struct  IBMVNodes
 Represents a collection of nodes forming a volume for the IBM. More...
 
struct  node
 A generic C-style linked list node for integers. More...
 
struct  list
 Head of a generic C-style linked list. More...
 
struct  list_node
 A generic C-style linked list node for indices. More...
 
struct  IBMListNode
 A linked list node containing IBM interpolation info. More...
 
struct  IBMList
 Head of a linked list for IBM data. More...
 
struct  SurfElmtInfo
 Information about a surface element for FSI calculations. More...
 
struct  FSInfo
 Holds all data related to the state and motion of a body in FSI. More...
 
struct  Cstart
 Defines prescribed body motion using splines. More...
 
struct  MGCtx
 Context for Multigrid operations. More...
 
struct  UserMG
 User-level context for managing the entire multigrid hierarchy. More...
 
struct  PostProcessParams
 Holds all configuration parameters for a post-processing run. More...
 
struct  VTKFieldInfo
 Stores all necessary information for a single data array in a VTK file. More...
 
struct  SimCtx
 The master context for the entire simulation. More...
 
struct  UserCtx
 User-defined context containing data specific to a single computational grid level. More...
 

Macros

#define COEF_TIME_ACCURACY   1.5
 Coefficient controlling the temporal accuracy scheme (e.g., 1.5 for BDF2).
 
#define MAX_PIPELINE_LENGTH   1024
 
#define MAX_FIELD_LIST_LENGTH   1024
 
#define MAX_FILENAME_LENGTH   256
 
#define MAX_POINT_DATA_FIELDS   20
 Defines the maximum number of data fields for VTK point data.
 
#define MAX_VTK_FIELD_NAME_LENGTH   64
 Maximum length for VTK field names.
 

Typedefs

typedef struct SimCtx SimCtx
 The master context for the entire simulation.
 
typedef struct UserCtx UserCtx
 User-defined context containing data specific to a single computational grid level.
 
typedef struct BC_Param_s BC_Param
 
typedef struct BoundaryCondition BoundaryCondition
 The "virtual table" struct for a boundary condition handler object.
 
typedef struct BoundaryFaceConfig BoundaryFaceConfig
 Holds the complete configuration for one of the six boundary faces.
 
typedef struct IBMNodes IBMNodes
 Represents a collection of nodes forming a surface for the IBM.
 
typedef struct IBMVNodes IBMVNodes
 Represents a collection of nodes forming a volume for the IBM.
 
typedef struct FSInfo FSInfo
 Holds all data related to the state and motion of a body in FSI.
 
typedef struct UserMG UserMG
 User-level context for managing the entire multigrid hierarchy.
 
typedef struct BoundingBox BoundingBox
 Defines a 3D axis-aligned bounding box.
 
typedef struct Cell Cell
 Defines the vertices of a single hexahedral grid cell.
 
typedef struct Particle Particle
 Defines a particle's core properties for Lagrangian tracking.
 
typedef struct RankNeighbors RankNeighbors
 Stores the MPI ranks of neighboring subdomains.
 
typedef struct RankCellInfo RankCellInfo
 A lean struct to hold the global cell ownership range for a single MPI rank.
 
typedef struct MigrationInfo MigrationInfo
 Information needed to migrate a single particle between MPI ranks.
 
typedef struct Cstart Cstart
 Defines prescribed body motion using splines.
 
typedef struct MGCtx MGCtx
 Context for Multigrid operations.
 
typedef struct PostProcessParams PostProcessParams
 Holds all configuration parameters for a post-processing run.
 
typedef struct VTKFieldInfo VTKFieldInfo
 Stores all necessary information for a single data array in a VTK file.
 
typedef struct VTKMetaData VTKMetaData
 
typedef struct IBMInfo IBMInfo
 Holds interpolation and distance information for a single IBM point.
 
typedef struct SurfElmtInfo SurfElmtInfo
 Information about a surface element for FSI calculations.
 
typedef struct Cmpnts Cmpnts
 A 3D point or vector with PetscScalar components.
 
typedef struct Cmpnts2 Cmpnts2
 A 2D point or vector with PetscScalar components.
 
typedef struct Cpt2D Cpt2D
 A 2D vector of PETSc real numbers (for geometry/coordinates).
 
typedef struct FlowWave FlowWave
 Represents a single point in a time-varying flow waveform.
 
typedef struct BCS BCS
 Legacy boundary condition data.
 
typedef struct BCContext BCContext
 Provides execution context for a boundary condition handler.
 
typedef struct node node
 A generic C-style linked list node for integers.
 
typedef struct list List
 Head of a generic C-style linked list.
 
typedef struct list_node Node_List
 A generic C-style linked list node for indices.
 
typedef struct IBMListNode IBMListNode
 A linked list node containing IBM interpolation info.
 
typedef struct IBMList IBMList
 Head of a linked list for IBM data.
 

Enumerations

enum  ParticleLocationStatus {
  NEEDS_LOCATION , ACTIVE_AND_LOCATED , MIGRATING_OUT , LOST ,
  UNINITIALIZED
}
 Defines the state of a particle with respect to its location and migration status during the iterative SettleParticles() process. More...
 
enum  Face {
  LEFT = 0 , RIGHT , BOTTOM , TOP ,
  FRONT , BACK , NUM_FACES
}
 Enumerates the six faces of a cubic cell for distance calculations. More...
 
enum  BCFace {
  BC_FACE_NEG_X = 0 , BC_FACE_POS_X = 1 , BC_FACE_NEG_Y = 2 , BC_FACE_POS_Y = 3 ,
  BC_FACE_NEG_Z = 4 , BC_FACE_POS_Z = 5
}
 Identifies the six logical faces of a structured computational block. More...
 
enum  BCType {
  WALLFUNCTION = -1 , INTERFACE = 0 , WALL = 1 , MOVING_WALL = 2 ,
  SYMMETRY = 3 , INLET = 4 , OUTLET , FARFIELD ,
  PERIODIC , CHARACTERISTIC_BC , ANALYTICAL_VORTEX , JUNCTION ,
  ANNULUS , OGRID , RHEOLOGY , NOGRAD
}
 Defines the general mathematical/physical category of a boundary. More...
 
enum  BCHandlerType {
  BC_HANDLER_UNDEFINED = 0 , BC_HANDLER_NOGRAD_COPY_GHOST , BC_HANDLER_WALL_NOSLIP , BC_HANDLER_WALL_MOVING ,
  BC_HANDLER_SYMMETRY_PLANE , BC_HANDLER_INLET_PARABOLIC , BC_HANDLER_INLET_CONSTANT_VELOCITY , BC_HANDLER_INLET_PULSANTILE_FLUX ,
  BC_HANDLER_INLET_DEVELOPED_PROFILE , BC_HANDLER_OUTLET_CONSERVATION , BC_HANDLER_OUTLET_PRESSURE , BC_HANDLER_FARFIELD_NONREFLECTING ,
  BC_HANDLER_PERIODIC , BC_HANDLER_INTERFACE_OVERSET
}
 Defines the specific computational "strategy" for a boundary handler. More...
 
enum  VTKFileType { VTK_STRUCTURED , VTK_POLYDATA }
 Enumerates the type of VTK file to be written. More...
 
enum  ExecutionMode { EXEC_MODE_SOLVER , EXEC_MODE_POSTPROCESSOR , EXEC_MODE_UNKNOWN }
 Defines the execution mode of the application. More...
 

Detailed Description

Main header file for a complex fluid dynamics solver.

Author
Vishal Kandala

This file defines the core data structures, global variables, and function prototypes for a CFD application. It combines features for a curvilinear, multi-block, immersed boundary (IBM) solver with fluid-structure interaction (FSI), a modern particle tracking system, a modular boundary condition framework, and post-processing utilities. It heavily utilizes the PETSc library.

*** REVISION NOTE *** This version introduces a central SimulationContext struct to encapsulate all simulation-wide configuration, replacing the legacy system of global variables. The UserCtx struct has been refactored to hold only data specific to a single grid level and now contains a back-pointer to the SimulationContext. All struct definitions now follow the typedef struct Name { ... } Name; convention.

Definition in file variables.h.


Data Structure Documentation

◆ Cmpnts

struct Cmpnts

A 3D point or vector with PetscScalar components.

Definition at line 99 of file variables.h.

Data Fields
PetscScalar x
PetscScalar y
PetscScalar z

◆ Cmpnts2

struct Cmpnts2

A 2D point or vector with PetscScalar components.

Definition at line 104 of file variables.h.

Data Fields
PetscScalar x
PetscScalar y

◆ Cpt2D

struct Cpt2D

A 2D vector of PETSc real numbers (for geometry/coordinates).

Definition at line 109 of file variables.h.

Data Fields
PetscReal x
PetscReal y

◆ FlowWave

struct FlowWave

Represents a single point in a time-varying flow waveform.

Definition at line 114 of file variables.h.

Data Fields
PetscReal t
PetscReal f

◆ BCS

struct BCS

Legacy boundary condition data.

Likely superseded by the newer BC system.

Definition at line 119 of file variables.h.

Data Fields
Vec Ubcs Boundary condition velocity values. (Comment: "An ugly hack, waste of memory")
Vec Uch Characteristic velocity for boundary conditions.

◆ BoundingBox

struct BoundingBox

Defines a 3D axis-aligned bounding box.

Definition at line 153 of file variables.h.

Collaboration diagram for BoundingBox:
[legend]
Data Fields
Cmpnts min_coords Minimum x, y, z coordinates of the bounding box.
Cmpnts max_coords Maximum x, y, z coordinates of the bounding box.

◆ Cell

struct Cell

Defines the vertices of a single hexahedral grid cell.

Definition at line 159 of file variables.h.

Collaboration diagram for Cell:
[legend]
Data Fields
Cmpnts vertices[8] Coordinates of the eight vertices of the cell.

◆ Particle

struct Particle

Defines a particle's core properties for Lagrangian tracking.

Definition at line 164 of file variables.h.

Collaboration diagram for Particle:
[legend]
Data Fields
PetscInt64 PID
PetscInt cell[3]
Cmpnts loc
Cmpnts vel
Cmpnts weights
ParticleLocationStatus location_status
PetscMPIInt destination_rank

◆ RankNeighbors

struct RankNeighbors

Stores the MPI ranks of neighboring subdomains.

Definition at line 175 of file variables.h.

Data Fields
PetscMPIInt rank_xm
PetscMPIInt rank_xp
PetscMPIInt rank_ym
PetscMPIInt rank_yp
PetscMPIInt rank_zm
PetscMPIInt rank_zp

◆ RankCellInfo

struct RankCellInfo

A lean struct to hold the global cell ownership range for a single MPI rank.

Definition at line 182 of file variables.h.

Data Fields
PetscInt xs_cell
PetscInt ys_cell
PetscInt zs_cell
PetscInt xm_cell
PetscInt ym_cell
PetscInt zm_cell

◆ MigrationInfo

struct MigrationInfo

Information needed to migrate a single particle between MPI ranks.

Definition at line 188 of file variables.h.

Data Fields
PetscInt local_index
PetscInt target_rank

◆ BC_Param_s

struct BC_Param_s

A node in a linked list for storing key-value parameters from the bcs.dat file.

Definition at line 236 of file variables.h.

Collaboration diagram for BC_Param_s:
[legend]
Data Fields
char * key
char * value
struct BC_Param_s * next

◆ BCContext

struct BCContext

Provides execution context for a boundary condition handler.

Definition at line 243 of file variables.h.

Collaboration diagram for BCContext:
[legend]
Data Fields
UserCtx * user
BCFace face_id
const PetscReal * global_inflow_sum
const PetscReal * global_outflow_sum

◆ BoundaryFaceConfig

struct BoundaryFaceConfig

Holds the complete configuration for one of the six boundary faces.

Definition at line 262 of file variables.h.

Collaboration diagram for BoundaryFaceConfig:
[legend]
Data Fields
BCFace face_id
BCType mathematical_type
BCHandlerType handler_type
BC_Param * params
BoundaryCondition * handler

◆ IBMInfo

struct IBMInfo

Holds interpolation and distance information for a single IBM point.

Definition at line 275 of file variables.h.

Collaboration diagram for IBMInfo:
[legend]
Data Fields
PetscInt i1
PetscInt j1
PetscInt k1
PetscInt i2
PetscInt j2
PetscInt k2
PetscInt i3
PetscInt j3
PetscInt k3
PetscReal cr1
PetscReal cr2
PetscReal cr3
PetscReal d_i
PetscInt imode
PetscInt ni
PetscInt nj
PetscInt nk
PetscReal d_s
Cmpnts pmin
PetscInt cell
PetscReal cs1
PetscReal cs2
PetscReal cs3
PetscInt i11
PetscInt j11
PetscInt k11
PetscInt i22
PetscInt j22
PetscInt k22
PetscInt i33
PetscInt j33
PetscInt k33
PetscReal cr11
PetscReal cr22
PetscReal cr33
PetscReal d_ii
PetscInt iimode
PetscReal cs11
PetscReal cs22
PetscReal cs33
PetscInt ii1
PetscInt jj1
PetscInt kk1
PetscInt ii2
PetscInt jj2
PetscInt kk2
PetscInt ii3
PetscInt jj3
PetscInt kk3
PetscReal ct1
PetscReal ct2
PetscReal ct3
PetscInt smode
PetscInt ii11
PetscInt jj11
PetscInt kk11
PetscInt ii22
PetscInt jj22
PetscInt kk22
PetscInt ii33
PetscInt jj33
PetscInt kk33
PetscReal ct11
PetscReal ct22
PetscReal ct33
PetscReal d_ss
PetscInt ssmode

◆ IBMNodes

struct IBMNodes

Represents a collection of nodes forming a surface for the IBM.

Definition at line 300 of file variables.h.

Collaboration diagram for IBMNodes:
[legend]
Data Fields
PetscInt nbnumber
PetscInt n_v
PetscInt n_elmt
PetscInt * nv1
PetscInt * nv2
PetscInt * nv3
PetscReal * nf_x
PetscReal * nf_y
PetscReal * nf_z
PetscReal * x_bp
PetscReal * y_bp
PetscReal * z_bp
PetscReal * x_bp0
PetscReal * y_bp0
PetscReal * z_bp0
PetscReal * x_bp_o
PetscReal * y_bp_o
PetscReal * z_bp_o
PetscReal * cf
PetscReal * cfsum
PetscReal * CCp
PetscReal x_bp_in[101][3270]
PetscReal y_bp_in[101][3270]
PetscReal z_bp_in[101][3270]
Cmpnts * u
Cmpnts * uold
Cmpnts * urm1
PetscReal * dA
PetscReal * nt_x
PetscReal * nt_y
PetscReal * nt_z
PetscReal * ns_x
PetscReal * ns_y
PetscReal * ns_z
PetscReal * cent_x
PetscReal * cent_y
PetscReal * cent_z
PetscReal * pres
PetscReal * tau0
PetscReal * tauN
PetscReal * Bvel_u
PetscReal * Bvel_v
PetscReal * Bvel_w
PetscReal x_min
PetscReal x_max
PetscReal y_min
PetscReal y_max
PetscReal z_min
PetscReal z_max
Cmpnts * qvec
PetscReal * radvec

◆ IBMVNodes

struct IBMVNodes

Represents a collection of nodes forming a volume for the IBM.

Definition at line 320 of file variables.h.

Collaboration diagram for IBMVNodes:
[legend]
Data Fields
PetscInt nbnumber
PetscInt n_v
PetscInt n_elmt
PetscInt * nv1
PetscInt * nv2
PetscInt * nv3
PetscInt * nv4
PetscReal * x_bp
PetscReal * y_bp
PetscReal * z_bp
PetscReal * x_bp0
PetscReal * y_bp0
PetscReal * z_bp0
PetscReal * x_bp_o
PetscReal * y_bp_o
PetscReal * z_bp_o
Cmpnts * u
Cmpnts * uold
Cmpnts * urm1
PetscReal V
PetscReal * dV0
PetscReal * cent_x
PetscReal * cent_y
PetscReal * cent_z
PetscReal x_c
PetscReal y_c
PetscReal z_c
PetscReal J[3][3]
PetscReal I_inv[3][3]

◆ node

struct node

A generic C-style linked list node for integers.

Definition at line 335 of file variables.h.

Collaboration diagram for node:
[legend]
Data Fields
PetscInt Node
struct node * next

◆ list

struct list

Head of a generic C-style linked list.

Definition at line 341 of file variables.h.

Collaboration diagram for list:
[legend]
Data Fields
node * head

◆ list_node

struct list_node

A generic C-style linked list node for indices.

Definition at line 346 of file variables.h.

Collaboration diagram for list_node:
[legend]
Data Fields
PetscInt index
struct list_node * next

◆ IBMListNode

struct IBMListNode

A linked list node containing IBM interpolation info.

Definition at line 352 of file variables.h.

Collaboration diagram for IBMListNode:
[legend]
Data Fields
IBMInfo ibm_intp
struct IBMListNode * next

◆ IBMList

struct IBMList

Head of a linked list for IBM data.

Definition at line 358 of file variables.h.

Collaboration diagram for IBMList:
[legend]
Data Fields
IBMListNode * head

◆ SurfElmtInfo

struct SurfElmtInfo

Information about a surface element for FSI calculations.

Definition at line 363 of file variables.h.

Data Fields
PetscReal P
PetscInt n_P
PetscReal Tow_ws
PetscReal Tow_wt
PetscReal Tow_wn
PetscInt Clsnbpt_i
PetscInt Clsnbpt_j
PetscInt Clsnbpt_k
PetscInt icell
PetscInt jcell
PetscInt kcell
PetscInt FoundAroundcell
PetscInt Need3rdPoint

◆ FSInfo

struct FSInfo

Holds all data related to the state and motion of a body in FSI.

Definition at line 373 of file variables.h.

Collaboration diagram for FSInfo:
[legend]
Data Fields
PetscReal S_new[6]
PetscReal S_old[6]
PetscReal S_real[6]
PetscReal S_realm1[6]
PetscReal S_ang_n[6]
PetscReal S_ang_o[6]
PetscReal S_ang_r[6]
PetscReal S_ang_rm1[6]
PetscReal red_vel
PetscReal damp
PetscReal mu_s
PetscReal F_x
PetscReal F_y
PetscReal F_z
PetscReal A_tot
PetscReal F_x_old
PetscReal F_y_old
PetscReal F_z_old
PetscReal F_x_real
PetscReal F_y_real
PetscReal F_z_real
PetscReal M_x
PetscReal M_y
PetscReal M_z
PetscReal M_x_old
PetscReal M_y_old
PetscReal M_z_old
PetscReal M_x_real
PetscReal M_y_real
PetscReal M_z_real
PetscReal M_x_rm2
PetscReal M_y_rm2
PetscReal M_z_rm2
PetscReal M_x_rm3
PetscReal M_y_rm3
PetscReal M_z_rm3
PetscReal x_c
PetscReal y_c
PetscReal z_c
PetscReal a_c[3]
PetscReal Mdpdn_x
PetscReal Mdpdn_y
PetscReal Mdpdn_z
PetscReal Mdpdn_x_old
PetscReal Mdpdn_y_old
PetscReal Mdpdn_z_old
PetscReal Power
PetscReal clone
PetscInt pbc[3]
PetscReal I_inv[3][3]
PetscReal L_n[3]
PetscReal L_o[3]
PetscReal L_r[3]
PetscReal alpha[3]
PetscReal acc[3]
PetscReal R[3][3]
PetscReal q[4]
PetscReal q_r[4]
PetscReal dS[6]
PetscReal dS_o[6]
PetscReal atk
PetscReal atk_o
SurfElmtInfo * elmtinfo
IBMInfo * fsi_intp
PetscReal Max_xbc
PetscReal Min_xbc
PetscReal Max_ybc
PetscReal Min_ybc
PetscReal Max_zbc
PetscReal Min_zbc
PetscInt CV_ys
PetscInt CV_ye
PetscInt CV_zs
PetscInt CV_ze

◆ Cstart

struct Cstart

Defines prescribed body motion using splines.

Definition at line 403 of file variables.h.

Data Fields
PetscInt n_time
PetscInt n_midp
PetscInt n_subit
PetscReal * x_midp
PetscReal * y_midp
PetscReal * z_midp
PetscReal * x_com
PetscReal * y_com
PetscReal * head_ang
PetscReal * s1
PetscReal * s2
PetscReal * s3
PetscReal * st1
PetscReal * st2
PetscReal * st3
Mat Mphi
PetscReal xmin
PetscReal xmax
PetscReal ymin
PetscReal ymax
PetscReal zmin
PetscReal zmax

◆ MGCtx

struct MGCtx

Context for Multigrid operations.

Definition at line 417 of file variables.h.

Collaboration diagram for MGCtx:
[legend]
Data Fields
UserCtx * user
PetscInt thislevel
DM packer

◆ UserMG

struct UserMG

User-level context for managing the entire multigrid hierarchy.

Definition at line 424 of file variables.h.

Collaboration diagram for UserMG:
[legend]
Data Fields
PetscInt mglevels
PetscInt thislevel
PetscBool isc
PetscBool jsc
PetscBool ksc
MGCtx * mgctx
DM packer
SNES snespacker

◆ PostProcessParams

struct PostProcessParams

Holds all configuration parameters for a post-processing run.

This is an enhanced version combining command-line and file-based settings.

Definition at line 443 of file variables.h.

Data Fields
PetscInt startTime
PetscInt endTime
PetscInt timeStep
PetscBool outputParticles
char process_pipeline[1024]
char output_fields_instantaneous[1024]
char output_fields_averaged[1024]
char output_prefix[256]
char particle_pipeline[1024]
char particle_fields[1024]
char particle_output_prefix[256]
PetscInt particle_output_freq
char eulerianExt[8]
char particleExt[8]

◆ VTKFieldInfo

struct VTKFieldInfo

Stores all necessary information for a single data array in a VTK file.

Definition at line 469 of file variables.h.

Data Fields
char name[64]
PetscInt num_components
PetscScalar * data

◆ VTKMetaData

struct VTKMetaData

Definition at line 481 of file variables.h.

Collaboration diagram for VTKMetaData:
[legend]
Data Fields
VTKFileType fileType
PetscInt mx
PetscInt my
PetscInt mz
PetscInt npoints
PetscScalar * coords
VTKFieldInfo point_data_fields[20]
PetscInt num_point_data_fields
PetscInt * connectivity
PetscInt * offsets

◆ SimCtx

struct SimCtx

The master context for the entire simulation.

This struct encapsulates all global configuration flags, physical parameters, simulation control settings, and top-level data objects. It replaces the numerous global variables from the legacy codebase, providing a single, explicit source of truth for the simulation's setup.

Definition at line 513 of file variables.h.

Collaboration diagram for SimCtx:
[legend]
Data Fields
PetscMPIInt rank
PetscMPIInt size
PetscInt step
PetscReal ti
PetscInt StartStep
PetscInt StepsToRun
PetscInt tiout
PetscReal StartTime
PetscReal dt
PetscBool rstart_flg
PetscBool OnlySetup
PetscViewer logviewer
PetscInt OutputFreq
ExecutionMode exec_mode
PetscInt immersed
PetscInt movefsi
PetscInt rotatefsi
PetscInt sediment
PetscInt rheology
PetscInt invicid
PetscInt TwoD
PetscInt thin
PetscInt moveframe
PetscInt rotateframe
PetscInt blank
PetscInt dgf_x
PetscInt dgf_y
PetscInt dgf_z
PetscInt dgf_ax
PetscInt dgf_ay
PetscInt dgf_az
PetscInt cop
PetscInt fish
PetscInt fish_c
PetscInt fishcyl
PetscInt eel
PetscInt pizza
PetscInt turbine
PetscInt Pipe
PetscInt wing
PetscInt hydro
PetscInt MHV
PetscInt LV
PetscInt implicit
PetscInt implicit_type
PetscInt imp_MAX_IT
PetscReal imp_atol
PetscReal imp_rtol
PetscReal imp_stol
PetscInt mglevels
PetscInt mg_MAX_IT
PetscInt mg_idx
PetscInt mg_preItr
PetscInt mg_poItr
PetscInt poisson
PetscReal poisson_tol
PetscInt STRONG_COUPLING
PetscInt InitialGuessOne
PetscInt central
PetscReal ren
PetscReal st
PetscReal cfl
PetscReal vnn
PetscReal cdisx
PetscReal cdisy
PetscReal cdisz
PetscInt FieldInitialization
Cmpnts InitialConstantContra
PetscInt NumberOfBodies
PetscReal Flux_in
PetscReal angle
PetscReal L_dim
PetscReal St_exp
PetscReal wavelength
PetscReal max_angle
PetscReal CMx_c
PetscReal CMy_c
PetscReal CMz_c
PetscInt regime
PetscInt radi
PetscReal chact_leng
PetscInt block_number
PetscInt inletprofile
PetscInt grid1d
PetscInt Ogrid
PetscInt channelz
PetscInt i_periodic
PetscInt j_periodic
PetscInt k_periodic
PetscInt blkpbc
PetscInt pseudo_periodic
PetscBool generate_grid
PetscReal grid_rotation_angle
PetscReal Croty
PetscReal Crotz
char grid_file[PETSC_MAX_PATH_LEN]
PetscInt da_procs_x
PetscInt da_procs_y
PetscInt da_procs_z
PetscInt num_bcs_files
char ** bcs_files
PetscReal FluxInSum
PetscReal FluxOutSum
PetscReal Fluxsum
PetscReal AreaOutSum
PetscReal U_bc
PetscInt ccc
PetscReal ratio
PetscInt les
PetscInt rans
PetscInt wallfunction
PetscInt mixed
PetscInt clark
PetscInt dynamic_freq
PetscReal max_cs
PetscInt testfilter_ik
PetscInt testfilter_1d
PetscInt i_homo_filter
PetscInt j_homo_filter
PetscInt k_homo_filter
PetscBool averaging
PetscInt np
PetscBool readFields
DM dm_swarm
BoundingBox * bboxlist
PetscInt ParticleInitialization
IBMNodes * ibm
IBMVNodes * ibmv
FSInfo * fsi
PetscBool rstart_fsi
PetscInt duplicate
UserMG usermg
char allowedFile[PETSC_MAX_PATH_LEN]
PetscBool useCfg
char ** allowedFuncs
PetscInt nAllowed
PetscInt LoggingFrequency
PetscReal summationRHS
PetscReal MaxDiv
PetscInt MaxDivFlatArg
PetscInt MaxDivx
PetscInt MaxDivy
PetscInt MaxDivz
char criticalFuncsFile[PETSC_MAX_PATH_LEN]
PetscBool useCriticalFuncsCfg
char ** criticalFuncs
PetscInt nCriticalFuncs
char PostprocessingControlFile[PETSC_MAX_PATH_LEN]
PostProcessParams * pps
PetscReal r[101]
PetscReal tin[101]
PetscReal uinr[101][1001]

◆ UserCtx

struct UserCtx

User-defined context containing data specific to a single computational grid level.

This is the primary data structure passed to low-level numerical and solver functions.

Definition at line 630 of file variables.h.

Collaboration diagram for UserCtx:
[legend]
Data Fields
SimCtx * simCtx Back-pointer to the master simulation context.
DM da
DM fda
DM fda2
DMDALocalInfo info
AO ao
PetscInt IM
PetscInt JM
PetscInt KM
PetscReal Max_X
PetscReal Max_Y
PetscReal Max_Z
PetscReal Min_X
PetscReal Min_Y
PetscReal Min_Z
BoundingBox bbox
RankNeighbors neighbors
PetscInt GridOrientation
PetscInt isc
PetscInt jsc
PetscInt ksc
PetscInt _this
PetscReal rx
PetscReal ry
PetscReal rz
PetscInt cgrid
BoundaryFaceConfig boundary_faces[6]
PetscBool inletFaceDefined
BCFace identifiedInletBCFace
BCS Bcs
Vec lUstar
PetscInt bctype[6]
PetscReal FluxIntpSum
PetscReal FluxIntfcSum
Vec Ucont
Vec lUcont
Vec Ucat
Vec lUcat
Vec P
Vec lP
Vec Phi
Vec lPhi
Vec Nvert
Vec lNvert
Vec Ucont_o
Vec lUcont_o
Vec Ucat_o
Vec P_o
Vec Nvert_o
Vec lNvert_o
Vec Ucont_rm1
Vec lUcont_rm1
Vec Rhs
Vec dUcont
Vec pUcont
Mat A
Mat C
KSP ksp
MatNullSpace nullsp
PetscInt * KSKE
PetscBool multinullspace
Vec B
Vec R
Mat MR
Mat MP
PetscBool assignedA
Vec Cent
Vec lCent
Vec Csi
Vec Eta
Vec Zet
Vec Aj
Vec lCsi
Vec lEta
Vec lZet
Vec lAj
Vec GridSpace
Vec lGridSpace
Vec Centx
Vec Centy
Vec Centz
Vec ICsi
Vec IEta
Vec IZet
Vec IAj
Vec lICsi
Vec lIEta
Vec lIZet
Vec lIAj
Vec JCsi
Vec JEta
Vec JZet
Vec JAj
Vec lJCsi
Vec lJEta
Vec lJZet
Vec lJAj
Vec KCsi
Vec KEta
Vec KZet
Vec KAj
Vec lKCsi
Vec lKEta
Vec lKZet
Vec lKAj
Vec Nu_t
Vec lNu_t
Vec CS
Vec lCs
Vec K_Omega
Vec lK_Omega
Vec K_Omega_o
Vec lK_Omega_o
Vec Distance
Vec Ucat_sum
Vec Ucat_cross_sum
Vec Ucat_square_sum
Vec P_sum
IBMNodes * ibm
IBMList * ibmlist
PetscInt thislevel
PetscInt mglevels
UserCtx * user_f
UserCtx * user_c
DM * da_f
DM * da_c
Vec * lNvert_c
DM swarm
RankCellInfo * RankCellInfoMap
Vec ParticleCount
Vec Psi
DM post_swarm
Vec P_nodal
Vec Ucat_nodal
Vec Qcrit

Macro Definition Documentation

◆ COEF_TIME_ACCURACY

#define COEF_TIME_ACCURACY   1.5

Coefficient controlling the temporal accuracy scheme (e.g., 1.5 for BDF2).

Definition at line 57 of file variables.h.

◆ MAX_PIPELINE_LENGTH

#define MAX_PIPELINE_LENGTH   1024

Definition at line 433 of file variables.h.

◆ MAX_FIELD_LIST_LENGTH

#define MAX_FIELD_LIST_LENGTH   1024

Definition at line 434 of file variables.h.

◆ MAX_FILENAME_LENGTH

#define MAX_FILENAME_LENGTH   256

Definition at line 435 of file variables.h.

◆ MAX_POINT_DATA_FIELDS

#define MAX_POINT_DATA_FIELDS   20

Defines the maximum number of data fields for VTK point data.

Definition at line 437 of file variables.h.

◆ MAX_VTK_FIELD_NAME_LENGTH

#define MAX_VTK_FIELD_NAME_LENGTH   64

Maximum length for VTK field names.

Definition at line 438 of file variables.h.

Typedef Documentation

◆ SimCtx

typedef struct SimCtx SimCtx

The master context for the entire simulation.

This struct encapsulates all global configuration flags, physical parameters, simulation control settings, and top-level data objects. It replaces the numerous global variables from the legacy codebase, providing a single, explicit source of truth for the simulation's setup.

Definition at line 73 of file variables.h.

◆ UserCtx

typedef struct UserCtx UserCtx

User-defined context containing data specific to a single computational grid level.

This is the primary data structure passed to low-level numerical and solver functions.

Definition at line 74 of file variables.h.

◆ BC_Param

typedef struct BC_Param_s BC_Param

Definition at line 75 of file variables.h.

◆ BoundaryCondition

The "virtual table" struct for a boundary condition handler object.

Definition at line 76 of file variables.h.

◆ BoundaryFaceConfig

Holds the complete configuration for one of the six boundary faces.

Definition at line 77 of file variables.h.

◆ IBMNodes

typedef struct IBMNodes IBMNodes

Represents a collection of nodes forming a surface for the IBM.

Definition at line 78 of file variables.h.

◆ IBMVNodes

typedef struct IBMVNodes IBMVNodes

Represents a collection of nodes forming a volume for the IBM.

Definition at line 79 of file variables.h.

◆ FSInfo

typedef struct FSInfo FSInfo

Holds all data related to the state and motion of a body in FSI.

Definition at line 80 of file variables.h.

◆ UserMG

typedef struct UserMG UserMG

User-level context for managing the entire multigrid hierarchy.

Definition at line 81 of file variables.h.

◆ BoundingBox

typedef struct BoundingBox BoundingBox

Defines a 3D axis-aligned bounding box.

Definition at line 82 of file variables.h.

◆ Cell

typedef struct Cell Cell

Defines the vertices of a single hexahedral grid cell.

Definition at line 83 of file variables.h.

◆ Particle

typedef struct Particle Particle

Defines a particle's core properties for Lagrangian tracking.

Definition at line 84 of file variables.h.

◆ RankNeighbors

typedef struct RankNeighbors RankNeighbors

Stores the MPI ranks of neighboring subdomains.

Definition at line 85 of file variables.h.

◆ RankCellInfo

typedef struct RankCellInfo RankCellInfo

A lean struct to hold the global cell ownership range for a single MPI rank.

Definition at line 86 of file variables.h.

◆ MigrationInfo

typedef struct MigrationInfo MigrationInfo

Information needed to migrate a single particle between MPI ranks.

Definition at line 87 of file variables.h.

◆ Cstart

typedef struct Cstart Cstart

Defines prescribed body motion using splines.

Definition at line 88 of file variables.h.

◆ MGCtx

typedef struct MGCtx MGCtx

Context for Multigrid operations.

Definition at line 89 of file variables.h.

◆ PostProcessParams

Holds all configuration parameters for a post-processing run.

This is an enhanced version combining command-line and file-based settings.

Definition at line 90 of file variables.h.

◆ VTKFieldInfo

typedef struct VTKFieldInfo VTKFieldInfo

Stores all necessary information for a single data array in a VTK file.

Definition at line 91 of file variables.h.

◆ VTKMetaData

typedef struct VTKMetaData VTKMetaData

Definition at line 92 of file variables.h.

◆ IBMInfo

typedef struct IBMInfo IBMInfo

Holds interpolation and distance information for a single IBM point.

Definition at line 93 of file variables.h.

◆ SurfElmtInfo

typedef struct SurfElmtInfo SurfElmtInfo

Information about a surface element for FSI calculations.

Definition at line 94 of file variables.h.

◆ Cmpnts

typedef struct Cmpnts Cmpnts

A 3D point or vector with PetscScalar components.

◆ Cmpnts2

typedef struct Cmpnts2 Cmpnts2

A 2D point or vector with PetscScalar components.

◆ Cpt2D

typedef struct Cpt2D Cpt2D

A 2D vector of PETSc real numbers (for geometry/coordinates).

◆ FlowWave

typedef struct FlowWave FlowWave

Represents a single point in a time-varying flow waveform.

◆ BCS

typedef struct BCS BCS

Legacy boundary condition data.

Likely superseded by the newer BC system.

◆ BCContext

typedef struct BCContext BCContext

Provides execution context for a boundary condition handler.

◆ node

typedef struct node node

A generic C-style linked list node for integers.

◆ List

typedef struct list List

Head of a generic C-style linked list.

◆ Node_List

typedef struct list_node Node_List

A generic C-style linked list node for indices.

◆ IBMListNode

typedef struct IBMListNode IBMListNode

A linked list node containing IBM interpolation info.

◆ IBMList

typedef struct IBMList IBMList

Head of a linked list for IBM data.

Enumeration Type Documentation

◆ ParticleLocationStatus

Defines the state of a particle with respect to its location and migration status during the iterative SettleParticles() process.

Enumerator
NEEDS_LOCATION 
ACTIVE_AND_LOCATED 
MIGRATING_OUT 
LOST 
UNINITIALIZED 

Definition at line 134 of file variables.h.

134 {
138 LOST,
ParticleLocationStatus
Defines the state of a particle with respect to its location and migration status during the iterativ...
Definition variables.h:134
@ LOST
Definition variables.h:138
@ NEEDS_LOCATION
Definition variables.h:135
@ ACTIVE_AND_LOCATED
Definition variables.h:136
@ UNINITIALIZED
Definition variables.h:139
@ MIGRATING_OUT
Definition variables.h:137

◆ Face

enum Face

Enumerates the six faces of a cubic cell for distance calculations.

Enumerator
LEFT 
RIGHT 
BOTTOM 
TOP 
FRONT 
BACK 
NUM_FACES 

Definition at line 143 of file variables.h.

143 {
145} Face;
Face
Enumerates the six faces of a cubic cell for distance calculations.
Definition variables.h:143
@ TOP
Definition variables.h:144
@ FRONT
Definition variables.h:144
@ BOTTOM
Definition variables.h:144
@ BACK
Definition variables.h:144
@ LEFT
Definition variables.h:144
@ NUM_FACES
Definition variables.h:144
@ RIGHT
Definition variables.h:144

◆ BCFace

enum BCFace

Identifies the six logical faces of a structured computational block.

Enumerator
BC_FACE_NEG_X 
BC_FACE_POS_X 
BC_FACE_NEG_Y 
BC_FACE_POS_Y 
BC_FACE_NEG_Z 
BC_FACE_POS_Z 

Definition at line 199 of file variables.h.

199 {
203} BCFace;
BCFace
Identifies the six logical faces of a structured computational block.
Definition variables.h:199
@ BC_FACE_NEG_X
Definition variables.h:200
@ BC_FACE_POS_Z
Definition variables.h:202
@ BC_FACE_POS_Y
Definition variables.h:201
@ BC_FACE_NEG_Z
Definition variables.h:202
@ BC_FACE_POS_X
Definition variables.h:200
@ BC_FACE_NEG_Y
Definition variables.h:201

◆ BCType

enum BCType

Defines the general mathematical/physical category of a boundary.

Enumerator
WALLFUNCTION 
INTERFACE 
WALL 
MOVING_WALL 
SYMMETRY 
INLET 
OUTLET 
FARFIELD 
PERIODIC 
CHARACTERISTIC_BC 
ANALYTICAL_VORTEX 
JUNCTION 
ANNULUS 
OGRID 
RHEOLOGY 
NOGRAD 

Definition at line 206 of file variables.h.

206 {
207 WALLFUNCTION = -1,
208 INTERFACE = 0,
209 WALL = 1 , MOVING_WALL = 2,SYMMETRY = 3,
210 INLET = 4,
213 ANNULUS,
214 OGRID,
215 RHEOLOGY,
216 NOGRAD
217} BCType;
BCType
Defines the general mathematical/physical category of a boundary.
Definition variables.h:206
@ MOVING_WALL
Definition variables.h:209
@ INLET
Definition variables.h:210
@ NOGRAD
Definition variables.h:216
@ INTERFACE
Definition variables.h:208
@ ANNULUS
Definition variables.h:213
@ ANALYTICAL_VORTEX
Definition variables.h:212
@ RHEOLOGY
Definition variables.h:215
@ FARFIELD
Definition variables.h:211
@ CHARACTERISTIC_BC
Definition variables.h:211
@ SYMMETRY
Definition variables.h:209
@ WALLFUNCTION
Definition variables.h:207
@ OGRID
Definition variables.h:214
@ OUTLET
Definition variables.h:211
@ PERIODIC
Definition variables.h:211
@ JUNCTION
Definition variables.h:212
@ WALL
Definition variables.h:209

◆ BCHandlerType

Defines the specific computational "strategy" for a boundary handler.

Enumerator
BC_HANDLER_UNDEFINED 
BC_HANDLER_NOGRAD_COPY_GHOST 
BC_HANDLER_WALL_NOSLIP 
BC_HANDLER_WALL_MOVING 
BC_HANDLER_SYMMETRY_PLANE 
BC_HANDLER_INLET_PARABOLIC 
BC_HANDLER_INLET_CONSTANT_VELOCITY 
BC_HANDLER_INLET_PULSANTILE_FLUX 
BC_HANDLER_INLET_DEVELOPED_PROFILE 
BC_HANDLER_OUTLET_CONSERVATION 
BC_HANDLER_OUTLET_PRESSURE 
BC_HANDLER_FARFIELD_NONREFLECTING 
BC_HANDLER_PERIODIC 
BC_HANDLER_INTERFACE_OVERSET 

Definition at line 220 of file variables.h.

220 {
BCHandlerType
Defines the specific computational "strategy" for a boundary handler.
Definition variables.h:220
@ BC_HANDLER_INLET_PULSANTILE_FLUX
Definition variables.h:224
@ BC_HANDLER_INLET_PARABOLIC
Definition variables.h:223
@ BC_HANDLER_INLET_CONSTANT_VELOCITY
Definition variables.h:224
@ BC_HANDLER_INTERFACE_OVERSET
Definition variables.h:227
@ BC_HANDLER_INLET_DEVELOPED_PROFILE
Definition variables.h:224
@ BC_HANDLER_WALL_MOVING
Definition variables.h:222
@ BC_HANDLER_NOGRAD_COPY_GHOST
Definition variables.h:221
@ BC_HANDLER_WALL_NOSLIP
Definition variables.h:222
@ BC_HANDLER_OUTLET_CONSERVATION
Definition variables.h:225
@ BC_HANDLER_PERIODIC
Definition variables.h:227
@ BC_HANDLER_FARFIELD_NONREFLECTING
Definition variables.h:226
@ BC_HANDLER_OUTLET_PRESSURE
Definition variables.h:225
@ BC_HANDLER_SYMMETRY_PLANE
Definition variables.h:223
@ BC_HANDLER_UNDEFINED
Definition variables.h:221

◆ VTKFileType

Enumerates the type of VTK file to be written.

Enumerator
VTK_STRUCTURED 
VTK_POLYDATA 

Definition at line 476 of file variables.h.

476 {
VTKFileType
Enumerates the type of VTK file to be written.
Definition variables.h:476
@ VTK_POLYDATA
Definition variables.h:478
@ VTK_STRUCTURED
Definition variables.h:477

◆ ExecutionMode

Defines the execution mode of the application.

Enumerator
EXEC_MODE_SOLVER 
EXEC_MODE_POSTPROCESSOR 
EXEC_MODE_UNKNOWN 

Definition at line 495 of file variables.h.

495 {
496 EXEC_MODE_SOLVER, // The application is running as the main fluid solver.
497 EXEC_MODE_POSTPROCESSOR, // The application is running as the post-processor.
498 EXEC_MODE_UNKNOWN // Default/error state.
ExecutionMode
Defines the execution mode of the application.
Definition variables.h:495
@ EXEC_MODE_UNKNOWN
Definition variables.h:498
@ EXEC_MODE_SOLVER
Definition variables.h:496
@ EXEC_MODE_POSTPROCESSOR
Definition variables.h:497