Voxelisation
› Forums › on OpenLB › Bug Reports › Voxelisation
- This topic has 3 replies, 2 voices, and was last updated 7 months, 3 weeks ago by sfraniatte.
-
AuthorPosts
-
March 20, 2025 at 7:02 pm #9946sfraniatteParticipant
Dear community,
Voxelization works very well on the CPU but does not work properly on the GPU in my case. Some volumes are marked as solid when they should be fluid. Is it possible to force the code to run on the CPU during voxelization?
Best regards,
Sylvain
March 20, 2025 at 7:07 pm #9947AdrianKeymasterWhich voxelization do you mean exactly?
If you refer to the material geometry / indicators in general: They are only evaluated on CPU in any case. Are you sure that the GPU usage is the problem and not e.g. difference in domain decomposition?
March 20, 2025 at 7:46 pm #9948sfraniatteParticipantI do not know where is the problem exactly. If it is during the stlReader operation or rename operation. I have some indicator’s voxels which are wrong and the only solution seems to do not use GPU. I am sure that the problem comes from the GPU usage or the nvcc (whtih an nvidia card on Ampere architecture) usage to compile the code because I tested with gcc and mpirun on CPU whithout any problem.
Thank you for your time !
March 21, 2025 at 10:56 am #9950sfraniatteParticipantHello,
I have solved my problem by looking in the file “stlReader.hh”. Then I have seen these lines :
template<typename T>
bool STLtriangle<T>::isPointInside(const PhysR<T,3>& pt) const
{
// tests with T=double and T=float show that the epsilon must be increased
const T epsilon = std::numeric_limits<BaseType<T>>::epsilon()*T(10);const T beta = pt * uBeta + kBeta;
const T gamma = pt * uGamma + kGamma;// check if approximately equal
if ( util::nearZero(norm(pt – (point[0].coords + beta*(point[1].coords-point[0].coords) + gamma*(point[2].coords-point[0].coords))), epsilon) ) {
const T alpha = T(1) – beta – gamma;
return (beta >= T(0) || util::nearZero(beta, epsilon))
&& (gamma >= T(0) || util::nearZero(gamma, epsilon))
&& (alpha >= T(0) || util::nearZero(alpha, epsilon));
}
return false;
}There is a first solution which is change the FLOATING_POINT_TYPE in the file “config.mk” from double to float. But the calculation is slower. So, I am trying another solution which is to change the “epsilon” used by the STLreader in two files : “stlReader.hh” and “octree.hh”
-
AuthorPosts
- You must be logged in to reply to this topic.
