Skip to content

Voxelisation

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #9946
    sfraniatte
    Participant

    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

    #9947
    Adrian
    Keymaster

    Which 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?

    #9948
    sfraniatte
    Participant

    I 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 !

    #9950
    sfraniatte
    Participant

    Hello,

    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”

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.