コード例 #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];
// 	    }
// 	}



}
コード例 #2
0
void BarycentricMapperRegularGridTopology<CudaVec3f1Types,CudaVec3f1Types>::applyJT( In::VecDeriv& out, const Out::VecDeriv& in )
{
    calcMapT();
    if (map.size() == 0) return;
    unsigned int gridsize[3] = { (unsigned int)topology->getNx(), (unsigned int)topology->getNy(), (unsigned int)topology->getNz() };
    unsigned int insize = out.size();

    RegularGridMapperCuda3f1_applyJT(insize, maxNOut, gridsize, mapT.deviceRead(), out.deviceWrite(), in.deviceRead());
}
コード例 #3
0
void BarycentricMapperRegularGridTopology<CudaVec3f1Types,CudaVec3f1Types>::applyJ( Out::VecDeriv& out, const In::VecDeriv& in )
{
    unsigned int gridsize[3] = { (unsigned int)topology->getNx(), (unsigned int)topology->getNy(), (unsigned int)topology->getNz() };
    out.fastResize(map.size());
    RegularGridMapperCuda3f1_applyJ(map.size(), gridsize, map.deviceRead(), out.deviceWrite(), in.deviceRead());
}
コード例 #4
0
void BarycentricMapperMeshTopology<CudaVec3f1Types,CudaVec3f1Types>::applyJT( In::VecDeriv& out, const Out::VecDeriv& in )
{
    if (size == 0) return;
    calcMapT();
    MeshMapperCuda3f1_applyPEq(insize, maxNOut, mapT.deviceRead(), out.deviceWrite(), in.deviceRead());
}
コード例 #5
0
void BarycentricMapperMeshTopology<CudaVec3f1Types,CudaVec3f1Types>::applyJ( Out::VecDeriv& out, const In::VecDeriv& in )
{
    out.fastResize(size);
    MeshMapperCuda3f1_apply(size, maxNIn, map.deviceRead(), out.deviceWrite(), in.deviceRead());
}
コード例 #6
0
void BarycentricMapperSparseGridTopology<CudaVec3f1Types,CudaVec3f1Types>::applyJT( In::VecDeriv& out, const Out::VecDeriv& in )
{
    buildTranslate(out.size());
    SparseGridMapperCuda3f1_applyJT(out.size(), CudaTnb.deviceRead(),CudaTst.deviceRead(),CudaTid.deviceRead(),CudaTVal.deviceRead(), out.deviceWrite(), in.deviceRead());
}
コード例 #7
0
void BarycentricMapperSparseGridTopology<CudaVec3f1Types,CudaVec3f1Types>::applyJ( Out::VecDeriv& out, const In::VecDeriv& in )
{
    out.fastResize(map.size());
    buildHexa();
    SparseGridMapperCuda3f1_applyJ(map.size(), CudaHexa.deviceRead(), map.deviceRead(), out.deviceWrite(), in.deviceRead());
}
コード例 #8
0
ファイル: CircleMapping.cpp プロジェクト: fredroy/sofa
 void applyJT( In::VecDeriv& out, const Out::VecDeriv& in )
 {
     for(unsigned int i=0; i<out.size(); i++)
         out[i] += dx[i]*in[i];
 }
コード例 #9
0
ファイル: CircleMapping.cpp プロジェクト: fredroy/sofa
 void applyJ( Out::VecDeriv& out, const In::VecDeriv& in )
 {
     out.resize(in.size());
     for(unsigned int i=0; i<out.size(); i++)
         out[i] = dx[i]*in[i];
 }