NasCar
Loading...
Searching...
No Matches
Data Structures | Macros
struct.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Proc
 Processors information. More...
 
struct  Grid
 Grid information. More...
 
struct  Simu
 Simulation parameters. More...
 
struct  Obs
 Osbtacles parameters. More...
 
struct  Vectors
 Petsc Vectors. More...
 
struct  Fields
 Vector fields (at iteration, n, n+1, ...) More...
 
struct  Pointers
 The arrays associated to the petsc vectors. More...
 
struct  Arrays
 Arrays fields (at iteration, n, n+1, ...) More...
 
struct  Linear
 Vector and matrices for linear systems. More...
 
struct  Obs.mouv
 Motion parameters. More...
 
struct  Obs.coef
 Forces, Torques, Power, Energy, ... More...
 
struct  Obs.geom
 Geometry parameters. More...
 
struct  Obs.elast
 Lagrangian elasticity parameters. More...
 
struct  Linear.vec
 Petsc Vectors. More...
 
struct  Linear.arr
 Arrays associated to petsc vectors. More...
 

Macros

#define RESET   "\033[0m"
 
#define BLACK   "\033[30m" /* Black */
 
#define RED   "\033[31m" /* Red */
 
#define GREEN   "\033[32m" /* Green */
 
#define YELLOW   "\033[33m" /* Yellow */
 
#define BLUE   "\033[34m" /* Blue */
 
#define MAGENTA   "\033[35m" /* Magenta */
 
#define CYAN   "\033[36m" /* Cyan */
 
#define WHITE   "\033[37m" /* White */
 
#define BOLDBLACK   "\033[1m" /* Bold Black */
 
#define BOLDRED   "\033[1m\033[31m" /* Bold Red */
 
#define BOLDGREEN   "\033[1m\033[32m" /* Bold Green */
 
#define BOLDYELLOW   "\033[1m\033[33m" /* Bold Yellow */
 
#define BOLDBLUE   "\033[1m\033[34m" /* Bold Blue */
 
#define BOLDMAGENTA   "\033[1m\033[35m" /* Bold Magenta */
 
#define BOLDCYAN   "\033[1m\033[36m" /* Bold Cyan */
 
#define BOLDWHITE   "\033[1m\033[37m" /* Bold White */
 

Data Structure Documentation

◆ Proc

struct Proc

Processors information.

Data Fields
int gxm

number of points in the X direction for the current processors with ghost nodes

int gxs

Index of the first mesh point in the X direction for the corrent processor with ghost nodes

int gym

number of points in the Y direction for the current processors with ghost nodes

int gys

Index of the first mesh point in the Y direction for the corrent processor with ghost nodes

int gzm

number of points in the Z direction for the current processors with ghost nodes

int gzs

Index of the first mesh point in the Y direction for the corrent processor with ghost nodes

PetscMPIInt rank

Rank of the current processor

PetscMPIInt size

Number of processors used

int xm

number of points in the X direction for the current processors

int xs

Index of the first mesh point in the X direction for the corrent processor

int ym

number of points in the Y direction for the current processors

int ys

Index of the first mesh point in the Y direction for the current processor

int zm

number of points in the Z direction for the current processors

int zs

Index of the first mesh point in the Z direction for the current processor

◆ Grid

struct Grid

Grid information.

Data Fields
DM da

petsc Distributed Array (3D Cartesian Grid)

double dx

\( \Delta x \): space step in the X direction

double dy

\( \Delta y \): space step in the Y direction

double dz

\( \Delta z \): space step in the Z direction

double epsilon

\( \varepsilon \) : interface regularization

int ip

Shift if xperiodic=TRUE

int jp

Shift if yperiodic=TRUE

int kp

Shift if zperiodic=TRUE

int nx

\( N_X \): number of points in the X direction

int ny

\( N_Y \): number of points in the Y direction

int nz

\( N_Z \): number of points in the Z direction

double xmax

\( x_{max} \) for computational domain

double xmin

\( x_{min} \) for computational domain

PetscBool xperiodic

X-periodic boundary condition if TRUE

double ymax

\( y_{max} \) for computational domain

double ymin

\( y_{min} \) for computational domain

PetscBool yperiodic

Y-periodic boundary condition if TRUE

double zmax

\( z_{max} \) for computational domain

double zmin

\( z_{min} \) for computational domain

PetscBool zperiodic

Z-periodic boundary condition if TRUE

◆ Simu

struct Simu

Simulation parameters.

Data Fields
PetscBool bi_fluid

Bi-fluid computation if TRUE

int carac
double Cc

Stability condition for convective terms

double cfl
double Cg

Stability condition for gravity

double Cs

Stability condition for surface tension

int cscheme

Choice of the scheme for convective terms

double Cv

Stability condition for vicous terms

double dt
double dtelast
double E
int fluid

Choice of the fluid (air, water, both)

PetscBool force_exa

Compute forces and torques with surface appraoch if TRUE

PetscBool force_ext1

Compute forces and torques with volume appraoch (small box) if TRUE

PetscBool force_ext2

Compute forces and torques with volume appraoch (large box) if TRUE

double g
double hsurf

Initial bi-fuid position

int ischeme

Choice of explicit/implicit diffusive term

int kk
double lambda
double mu1
double mu2
double mue
int ni

Number of iteration in time

PetscBool redist

Level Set reinitialisation if TRUE

double rho1
double rho2
double rhoe
double st
int test

Choice of the predifined test case in TEST_CASES.DAT

double time
double timeac
double timeac2
double volume

◆ Obs

struct Obs

Osbtacles parameters.

Data Fields
int * choice

Choice of the kind of obstacle (Fish, torus, etc)

struct Obs.coef coef Forces, Torques, Power, Energy, ...
struct Obs.elast elast Lagrangian elasticity parameters.
int * file_format

User defined or obj geometry

struct Obs.geom geom Geometry parameters.
int ib

\( ib \): index of the structures

struct Obs.mouv mouv Motion parameters.
int nb

\( N_b \): number of non elastc structures

int nbe

\( N_{be} \): number of elastc structures

int * ne

\( N_E \): number of points on each slice (for regular body mesh)

int nexp
int nexp2
int nexp3
int * no

\( N_0 \):

int * ns

\( N_S \): number of slices on the body (for regular body mesh)

int * nst
char OBJ_FILE[30][PETSC_MAX_PATH_LEN]
double * St
double * St_swim
int test
double thetafood
double xfood
double * xhead
double * xtail
double yfood
double * yhead
double * ytail
double zfood
double * zhead
double * ztail

◆ Vectors

struct Vectors

Petsc Vectors.

Data Fields
Vec a
Vec an
Vec as
Vec DIV

Global vector for the velocity divergence

Vec DU

Global vector for the stress tensor (possibly with elasticity)

Vec la
Vec lan
Vec las
Vec lD

Local vector for bi-flui Dirac function

Vec ldPdy

Local vector for the pressure gradient in the gravity direction Y

Vec lDU

Local vector for the stress tensor (possibly with elasticity)

Vec lH

Local vector for bi-fluid Heaviside function

Vec lLS

Local vector for the Level Set

Vec lLSind

Local vector to indcate which is the closest body

Vec lnx

Local vector for the X derivative of the elastic Level Set function

Vec lny

Local vector for the Y derivative of the elastic Level Set function

Vec lnz

Local vector for the Z derivative of the elastic Level Set function

Vec lOn

Local vector for the norma of the Vorticity

Vec lOx

Local vector for the X-Vorticity

Vec lOy

Local vector for the Y-Vorticity

Vec lOz

Local vector for the Z-Vorticity

Vec lP

Local vector for tye pressure

Vec lPHI

Local vector for solution of the Poisson equation

Vec lPSI

Local vector the bi-fluid Level Set

Vec lQ

Local vector for Q-criterion

Vec lU

Local vector for cell center x-velocity U

Vec lUf

Local vector for face center x-velocity Uf

Vec lV

Local vector for cell center y-velocity V

Vec lVf

Local vector for face center y-velocity Vf

Vec lW

Local vector for cell center z-velocity W

Vec lWf

Local vector for face center z-velocity Wf

Vec lYx

Local vector for backward characteristics in X direction

Vec lYy

Local vector for backward characteristics in Y direction

Vec lYz

Local vector for backward characteristics in Z direction

Vec PHI

Global vector for solution of the Poisson equation

Vec U

Global vector for cell center x-velocity U

Vec Uf

Global vector for face center x-velocity Uf

Vec V

Global vector for cell center y-velocity V

Vec Vf

Global vector for face center y-velocity Vf

Vec W

Global vector for cell center z-velocity W

Vec Wf

Global vector for face center z-velocity Wf

Vec Yx

Global vector for backward characteristics in X direction

Vec Yy

Global vector for backward characteristics in Y direction

Vec Yz

Global vector for backward characteristics in Z direction

◆ Fields

struct Fields

Vector fields (at iteration, n, n+1, ...)

Collaboration diagram for Fields:
Data Fields
Vectors e

iteration \( \ast \) (for the predicted fields)

Vectors el[10]
Vectors elm1[10]
Vectors elt[10]
Vectors i[10]
Vectors im1[10]
Vectors it[10]
Vectors k[10]
Vectors l[10]
Vectors m
Vectors mat[6][3][3]
Vectors n

iteration \( n \)

Vectors nm1

iteration \( n-1 \)

Vectors np1

iteration \( n+1 \)

Vectors t

◆ Pointers

struct Pointers

The arrays associated to the petsc vectors.

Data Fields
double *** a
double *** an
double *** as
double *** D

Array for the bi-fluid Dirac function

double *** DIV

Array for the velocity divergence

double *** dPdy

Array for the cell center pressure gradient in the gravity Y direction

double *** DU

Array for the stress tensor (possibly with elasticity)

double *** H

Array for the bi-fluid Heaviside function

double *** LS

Array for the body Level Set

int *** LSind
double *** nx

Array for the X derivative of the elastic Level Set function

double *** ny

Array for the Y derivative of the elastic Level Set function

double *** nz

Array for the Z derivative of the elastic Level Set function

double *** On

Array for norm of the Vorticity

double *** Ox

Array for X-Vorticity

double *** Oy

Array for Y-Vorticity

double *** Oz

Array for Z-Vorticity

double *** P

Array for the cell center pressure P

double *** PHI

Array for the Poisson solution

double *** PSI

Array for bi-fluid Level Set

double *** Q

Array for Q-criterion

double *** U

Array for the X-cell center velocity U

double *** Uf

Array for the X-face center velocity Uf

double *** V

Array for the Y-cell center velocity V

double *** Vf

Array for the Y-face center velocity Vf

double *** W

Array for the Z-cell center velocity W

double *** Wf

Array for the Z-face center velocity Wf

double *** Yx

Array for the X- backward characterisctics

double *** Yy

Array for the Y- backward characterisctics

double *** Yz

Array for the Z- backward characterisctics

◆ Arrays

struct Arrays

Arrays fields (at iteration, n, n+1, ...)

Collaboration diagram for Arrays:
Data Fields
Pointers cl
Pointers e

iteration \( \ast \) (for the predicted fields)

Pointers el[10]
Pointers elm1[10]
Pointers elt[10]
Pointers i[10]
Pointers im1[10]
Pointers it[10]
Pointers k[10]
Pointers l[10]
Pointers m
Pointers mat[6][3][3]
Pointers n

iteration \( n \)

Pointers nm1

iteration \( n-1 \)

Pointers np1

iteration \( n+1 \)

Pointers t

◆ Linear

struct Linear

Vector and matrices for linear systems.

Data Fields
Mat Ap

Matrix for Poisson equation

struct Linear.arr arr Arrays associated to petsc vectors.
Mat Au

Matrix for Momentum equation

int itp

number of iterations for Poisson equation

int itu

number of iterations for X-Momentum equation

int itv

number of iterations for Y-Momentum equation

int itw

number of iterations for Y-Momentum equation

KSP kspp

Krylov solver for Poisson equation

KSP kspu

Krylov solver for Momentum equation

MatNullSpace nullsp

nullspace: to solve Poisson equation with Homogeneous Neumann Boundary Conditions

struct Linear.vec vec Petsc Vectors.

◆ Obs.mouv

struct Obs.mouv

Motion parameters.

Data Fields
double a
double * cp
double f
double ** Omega
double ** Omegat
double rpm
double ** Theta

\( \theta \): Angle (position) of the body

double theta
double ** Theta_def

\( \theta_d \): Angle generated by the body deformation

double ** Thetai

\( \theta_i \): Initial angle of the body

double ** u
double *** Ub

\( u_b \): x-velocity of each body mesh point

double * ubar

\( \overline{u} \): linear x-velocity (mass center)

double Uin

\( U_0 \): initial condition for x-velocity

double ** v
double *** Vb

\( v_b \): y-velocity of each body mesh point

double * vbar

\( \overline{v} \): linear y-velocity (mass center)

double Vin

\( V_0 \): initial condition for y-velocity

double Vref

\( U_{ref} \): Reference velocity

double *** Wb

\( w_b \): z-velocity of each body mesh point

double * wbar

\( \overline{w} \): linear z-velocity (mass center)

double Win

\( W_0 \): initial condition for z-velocity

double * xbar

\( \overline{x} \): linear x-displacement (mass center)

double * ybar

\( \overline{y} \): linear y-displacement (mass center)

double * zbar

\( \overline{z} \): linear z-displacement (mass center)

◆ Obs.coef

struct Obs.coef

Forces, Torques, Power, Energy, ...

Data Fields
double *** C_other
double *** C_total
double *** C_useful
double *** C_useless
double * Cn
double *** Cp

Pressure distribution on the body surface

double *** Cpt
double *** Cs
double *** Cst
double *** Ct_other
double *** Ct_total
double *** Ct_useful
double *** Ct_useless
double * Cx

\( C_X \): aero/hydrodynamique coefficient in the X-direction

double * Cxt

\( \widetilde{C}_X \): Auxiliary aero/hydrodynamique coefficient in the X-direction

double * Cy

\( C_Y \): aero/hydrodynamique coefficient in the Y-direction

double * Cyt

\( \widetilde{C}_Y \): Auxiliary aero/hydrodynamique coefficient in the Y-direction

double * Cz

\( C_Z \): aero/hydrodynamiquecoefficient in the Z-direction

double * Czt

\( \widetilde{C}_Z \): Auxiliary aero/hydrodynamique coefficient in the Z-direction

double *** dist
int *** distk
int *** distkt
double *** distm1
double *** distt
double Ec
double Ecm1
double Ecm1t
double Ect
double * eta
double * etas
double ** Fx

\( F_X \): aero/hydrodynamique force exerted by the fluid on the body in the X-direction

double ** Fxt

\( \widetilde{F}_X \): auxiliary aero/hydrodynamique force exerted by the fluid on the body in the X-direction

double *** Fxx
double *** Fxxt
double ** Fy

\( F_Y \): aero/hydrodynamique force exerted by the fluid on the body in the Y-direction

double ** Fyt

\( \widetilde{F}_Y \): auxiliary aero/hydrodynamique force exerted by the fluid on the body in the Y-direction

double *** Fyy
double *** Fyyt
double ** Fz

\( F_Z \): aero/hydrodynamique force exerted by the fluid on the body in the Z-direction

double ** Fzt

\( \widetilde{F}_Z \): auxiliary aero/hydrodynamique force exerted by the fluid on the body in the Y-direction

double *** Fzz
double *** Fzzt
int * ie
int * ie1
int * ie2
int * iet
int * is
int * is1
int * is2
int * ist
int * je
int * je1
int * je2
int * jet
int * js
int * js1
int * js2
int * jst
int * ke
int * ke1
int * ke2
int * ket
int * ks
int * ks1
int * ks2
int * kst
double Mn_exa
double Mn_ext
double * Mx

\( M_X \): aero/hydrodynamique torque exerted by the fluid on the body on the X-direction

double * Mxt

\( \widetilde{M}_X \): auxiliary aero/hydrodynamique torque exerted by the fluid on the body on the X-direction

double * My

\( M_Y \): aero/hydrodynamique torque exerted by the fluid on the body on the Y-direction

double * Myt

\( \widetilde{M}_Y \): auxiliary aero/hydrodynamique torque exerted by the fluid on the body on the Y-direction

double * Mz

\( M_Z \): aero/hydrodynamique torque exerted by the fluid on the body on the Z-direction

double * Mzt

\( \widetilde{M}_Z \): auxiliary aero/hydrodynamique torque exerted by the fluid on the body on the Z-direction

double P
double ** P_other
double ** P_total
double ** P_useful
double ** P_useless
double Pb
double Pbt
double Pc
double Pct
double Pext
double Pextt
double Pm
double * Power
double * Power_other
double * Power_useful
double * Power_useless
double * Powert
double * Powert_other
double * Powert_useful
double * Powert_useless
double Pt
double Pv
double Pvt
double * W_other
double * W_total
double * W_useful
double * W_useless

◆ Obs.geom

struct Obs.geom

Geometry parameters.

Data Fields
double * Amax
double * Amin
double h
int *** ind_normal_q
int *** ind_normal_t
int *** ind_texture_q
int *** ind_texture_t
int *** ind_vertex_q
int *** ind_vertex_t
double *** Jinv

\( J^{-1} \): inverse of the body intertia matrix

double *** Jxyz

\( J^{(n)}\): intertia matrix at time n

double *** Jxyzm1

\( J^{(n-1)}\): intertia matrix at time n-1

double * length

\( \ell \): body length

double m1
double m2
double *** n

\( \bf{n} \): outward unit normal to each body mesh cell

int * nb_normal

obj file: number of normals

int * nb_quad

obj file: number of quads

int * nb_texture

obj file: number of textures

int * nb_triangle

obj file: number of triangles

int * nb_vertex

obj file: number of vertex

int nbarres[100]
double ** nx
double ** ny
double ** nz
double r1
double r2
double rc
double re
double rh
double * rho

\( \rho \): body density

double ri
double * S

\( S \): body surface

double * St

\(\widetilde{S}\): auxiliary body surface

double ** theta

\( \theta^{(n)} \): angle between each backbone segment at time n

double ** theta_m1

\( \theta^{(n-1)} \): angle between each backbone segment at time n-1

double ** theta_m2

\( \theta^{(n-2)} \): angle between each backbone segment at time n-2

double ** tx
double ** ty
double ** tz
double ** ub
double * V

\( V \): body volume

double ** vb
double * Vs

\( V_S \): backup body volume

double * Vt

\(\widetilde{V}\): auxiliary body volume

double ** vx
double ** vy
double ** vz
double ** wb
double *** x

\( x^{(n)} \): X position of the body surface grid points at time \( n \)

double *** x0
double *** x0m1
double *** x1
double ** xb

\( x_b \): X position of the backbone points (midline)

double ** xb_m1
double ** xbs
double * xg

\( x_g \): X prosition of the center of mass

double * xg1
double * xg2
double * xgd
double * xgs
double * xi

\( x_i \): initial X position of the mass center

double *** xm1

\( x^{(n-1)} \): X position of the body surface grid points at time \( n-1 \)

double * xmax
double * xmin
double *** xs
double *** y

\( y^{(n)} \): Y position of the body surface grid points at time \( n \)

double *** y0
double *** y0m1
double *** y1
double ** yb

\( y_b \): Y position of the backbone points (midline)

double ** yb_m1
double ** ybs
double yc
double * yg

\( y_g \): Y prosition of the center of mass

double * yg1
double * yg2
double * ygd
double * ygs
double * yi

\( y_i \): initial Y position of the mass center

double yl
double ym
double *** ym1

\( y^{(n-1)} \): Y position of the body surface grid points at time \( n-1 \)

double * ymax
double * ymin
double *** ys
double yt
double *** z

\( z^{(n)} \): Z position of the body surface grid points at time \( n \)

double *** z0
double *** z0m1
double *** z1
double ** zb

\( z_b \): Z position of the backbone points (midline)

double ** zb_m1
double ** zbs
double * zg

\( z_g \): Z prosition of the center of mass

double * zg1
double * zg2
double * zgd
double * zgs
double * zi

\( z_i \): initial Z position of the mass center

double *** zm1

\( z^{(n-1)} \): Z position of the body surface grid points at time \( n-1 \)

double * zmax
double * zmin
double *** zs

◆ Obs.elast

struct Obs.elast

Lagrangian elasticity parameters.

Data Fields
double ** a
double *** A
double *** A2
double ** Aibphi
double *** Ap
double *** Aphi
double ** b
double ** bphi
double ** ce
double ** cem1
double ** cem2
double ** curv
double * Cx
double * Cy
double ** d2ce
double ** d2phi
double ** d2se
double dist
double distance
double ** dphi
double ** e
double * E
double *** Gc
double *** GcAp
double *** GcApHc
double *** GcApHs
double *** Gs
double *** GsAp
double *** GsApHc
double *** GsApHs
double *** Hc
double *** Hs
double ** In
double *** Jn
double ** l
double ** m
double ** Mm
double ** Mmt
double * mu
int n[100]
double ** phi
double ** phim1
double ** phim2
double ** S
double ** se
double ** sem1
double ** sem2
double ** Wx
double ** Wxt
double ** Wy
double ** Wyt
double ** x
double ** xc
double ** xm1
double ** xm2
double ** y
double ** yc
double ** ym1
double ** ym2

◆ Linear.vec

struct Linear.vec

Petsc Vectors.

Data Fields
Vec Bp

RHS for Poisson equation

Vec Bu

RHS for X-Momentum equation

Vec Bv

RHS for Y-Momentum equation

Vec Bw

RHS for Z-Momentum equation

◆ Linear.arr

struct Linear.arr

Arrays associated to petsc vectors.

Data Fields
double *** Bp

Array RHS for Poisson equation

double *** Bu

Array RHS for X-Momentum equation

double *** Bv

Array RHS for Y-Momentum equation

double *** Bw

Array RHS for Z-Momentum equation