Exemplo n.º 1
0
void BarycentricMapperSparseGridTopology<CudaVec3fTypes,CudaVec3fTypes>::applyJT( In::VecDeriv& out, const Out::VecDeriv& in )
{
    buildTranslate(out.size());
    SparseGridMapperCuda3f_applyJT(out.size(), CudaTnb.deviceRead(),CudaTst.deviceRead(),CudaTid.deviceRead(),CudaTVal.deviceRead(), out.deviceWrite(), in.deviceRead());
    /*
            for ( unsigned int i=0;i<map.size();i++ ) {
                    Out::Deriv v = in[i];
            const topology::SparseGridTopology::Hexa cube = this->topology->getHexahedron ( map[i].in_index );
                    const OutReal fx = ( OutReal ) map[i].baryCoords[0];
                    const OutReal fy = ( OutReal ) map[i].baryCoords[1];
                    const OutReal fz = ( OutReal ) map[i].baryCoords[2];
                    out[cube[0]] += v * ( ( 1-fx ) * ( 1-fy ) * ( 1-fz ) );
                    out[cube[1]] += v * ( (   fx ) * ( 1-fy ) * ( 1-fz ) );
                    out[cube[3]] += v * ( ( 1-fx ) * (   fy ) * ( 1-fz ) );
                    out[cube[2]] += v * ( (   fx ) * (   fy ) * ( 1-fz ) );
                    out[cube[4]] += v * ( ( 1-fx ) * ( 1-fy ) * (   fz ) );
                    out[cube[5]] += v * ( (   fx ) * ( 1-fy ) * (   fz ) );
                    out[cube[7]] += v * ( ( 1-fx ) * (   fy ) * (   fz ) );
                    out[cube[6]] += v * ( (   fx ) * (   fy ) * (   fz ) );
            }
    */
// 	for ( unsigned int o=0;o<out.size();o++ ) {
// 	    for (unsigned n=CudaTst[o];n<CudaTst[o]+CudaTnb[o];n++) {
// 	      out[o] += in[CudaTid[n]] * CudaTVal[n];
// 	    }
// 	}



}
void BarycentricMapperSparseGridTopology<CudaVec3fTypes,CudaVec3f1Types>::applyJT( In::VecDeriv& out, const Out::VecDeriv& in )
{
    buildTranslate(out.size());
    SparseGridMapperCuda3f_3f1_applyJT(out.size(), CudaTnb.deviceRead(),CudaTst.deviceRead(),CudaTid.deviceRead(),CudaTVal.deviceRead(), out.deviceWrite(), in.deviceRead());
}