|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
哪位前辈指点下,在IB-LBM中,对受力和速度使用两点插值,可是在一段程序中:
// Identify the lowest fluid lattice node in interpolation range.
// 'Lowest' means: its x- and y-values are the smallest.
// The other fluid nodes in range have coordinates
// (x_int + 1, y_int), (x_int, y_int + 1), and (x_int + 1, y_int + 1).
int x_int = (int)(particle.node[n].x - 0.5 + Nx) - Nx;
int y_int = (int)(particle.node[n].y + 0.5);
// Run over all neighboring fluid nodes.
// In the case of the two-point interpolation, it is 2x2 fluid nodes.
for (int X = x_int; X <= x_int + 1; ++X) {
for (int Y = y_int; Y <= y_int + 1; ++Y) {
// Compute distance between object node and fluid lattice node.
const double dist_x = particle.node[n].x - 0.5 - X;
const double dist_y = particle.node[n].y + 0.5 - Y;
为什么X方向要-0.5,Y方向要+0.5,不是直接向下取整就行了么?
|
|