j[even] are only used when calclating Surface.
const uchar flagsji_su = flags[j[i]]&TYPE_SU; // extract SURFACE flags
when resetting velocity of nodes with only solid neighbors, which seems rare or even unnecessary because a node with only solid neighbors is likely to be solid itself, which zeros the velocity anyway.
for(uint i=1u; i<def_velocity_set; i++) TYPE_ONLY_S = TYPE_ONLY_S&&(flagsj[i]&TYPE_BO)==TYPE_S;
Only half of these values are ever used in the esoteric pull algorithm. Only the odd indexes are used, while the even ones are never used.
Given the purpose seems to be to to ensure high degree of optimization, It seems like these can either be removed entirely, or guarded by a SURFACE or MOVING BOUNDARIES requirement.
https://github.com/ProjectPhysX/FluidX3D/blob/4258d2e5b69ce5966dea1237aeec4bb7cee69f46/src/kernel.cpp#L993
j[even]
are only used when calclating Surface.const uchar flagsji_su = flags[j[i]]&TYPE_SU; // extract SURFACE flags
when resetting velocity of nodes with only solid neighbors, which seems rare or even unnecessary because a node with only solid neighbors is likely to be solid itself, which zeros the velocity anyway.for(uint i=1u; i<def_velocity_set; i++) TYPE_ONLY_S = TYPE_ONLY_S&&(flagsj[i]&TYPE_BO)==TYPE_S;
Only half of these values are ever used in the esoteric pull algorithm. Only the odd indexes are used, while the even ones are never used.
Given the purpose seems to be to to ensure high degree of optimization, It seems like these can either be removed entirely, or guarded by a SURFACE or MOVING BOUNDARIES requirement.