Function in CNS_derive.cpp #2351
-
I am learning the example in GPU->CNS. But the function void cns_derpres (const Box& bx, FArrayBox& pfab, int dcomp, int /ncomp/, void cns_dervel (const Box& bx, FArrayBox& velfab, int dcomp, int /ncomp/, in the file CNS_derive.cpp makes me unable to understand. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
These functions are used to compute so-called derived variables. You don't seem to see a difference by deleting the function body, because they are only used in writing plotfiles. They compute pressure and velocity based on conservative variables. I assume what
So |
Beta Was this translation helpful? Give feedback.
These functions are used to compute so-called derived variables. You don't seem to see a difference by deleting the function body, because they are only used in writing plotfiles. They compute pressure and velocity based on conservative variables. I assume what
p = (gamma-1)*rhoe
does is obvious. Incns_dervel
,dat(i,j,k,1)
isrho*vx
anddat(i,j,k,0)
isrho
as specified inCNS_setup.cpp