[问题] 遇到难搞bug求解

楼主: Vinygli (Vin)   2021-07-04 20:32:54
如题,小弟目前在当硕士生,明明是程式苦手
却还是读起了物理系,现在在实验室帮忙。
我现在手上的程式遇到一个看似很常见,
可是错误讯息讲得很笼统,
查了一堆资料后还是看不懂它要什么,
可以帮我看看吗?
void FB_UVFeedback( real (*Fluid)[PS2][PS2][PS2],
real &particleIonizingLuminosity, const int &pararticleWillExplode,
const int idx[], const double dh );
void FB_User_Template( const int lv, const double TimeNew, const double TimeOld,
const double dt, const int NPar, const int *ParSortID,
real *ParAtt[PAR_NATT_TOTAL], real (*Fluid)[PS2][PS2][PS2],
const double EdgeL[], const double dh, bool CoarseFine[], const int TID,
RandomNumber_t *RNG )
{

// 1: UV feedback
FB_UVFeedback( (Fluid*){[16][16][16]}, ionizeLuminosity,
willExplode[n], idx, dh);

}
void FB_UVFeedback( real (*Fluid)[PS2][PS2][PS2], real
&particleIonizingLuminosity, const int &pararticleWillExplode,
const int idx[], const double dh )
{
#ifdef DUAL_ENERGY
const real cell_volume = POW(dh*UNIT_L, 3);
const real mu = 0.6;
const real mass_h = 1.67262171e-24;
const real alpha = 2.60e-13; // Case B recombination, assuming T = 10^4 K.
const real flu_dens = Fluid[DENS][ idx[0] ][ idx[1] ][ idx[2] ];
// old density of this cell
const real flu_energy = Fluid[ENPY][ idx[0] ][ idx[1] ][ idx[2] ];
// old energy of this cell
const real num = flu_dens * UNIT_D / mu / mass_h;
const real stromgren_radius = POW( ( (3.0*particleIonizingLuminosity*1e49) / (4.0*M_PI*alpha*SQR(num)) ), (1.0/3.0) );
const real stromgren_volume = (4.0/3.0) * M_PI * CUBE(stromgren_radius);
real ionized = Const_kB*1e4 / mu / mass_h / SQR(UNIT_L) * SQR(UNIT_T);
if ( stromgren_volume < cell_volume ) ionized *= stromgren_volume/cell_volume;
if ( pararticleWillExplode == 1 && flu_energy < ionized )
{
// TODO: dual energy update
const real theDiff = ionized - flu_energy; // thermal energy difference caused by UV ionization
Fluid[ENGY][idx[0]][idx[1]][idx[2]] += theDiff; // Update the energy
Fluid[ENPY][idx[0]][idx[1]][idx[2]] += theDiff;
}
#endif // #ifdef DUAL_ENERGY
} // FUNCTION : FB_UVFeedback
error message: error: expected primary-expression before ‘)’ token
FB_UVFeedback( (Fluid*){[16][16][16]}, ionizeLuminosity, willExplode[n], idx, dh);
^
以上,要是有人路过,也遇过相同bug的话,
请跟我分享你怎么解决的,谢谢。
p.s. 今天是我第一次来这个版发文,
礼数不周请多指教。

Links booklink

Contact Us: admin [ a t ] ucptt.com