![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 TAPsCUDAListOfFunctions.hpp 00003 ******************************************************************************/ 00008 /****************************************************************************** 00009 SUKITTI PUNAK (09/02/2008) 00010 UPDATE (09/18/2009) 00011 ******************************************************************************/ 00012 00013 #ifndef TAPs_CUDA_LIST_OF_FNS_HPP 00014 #define TAPs_CUDA_LIST_OF_FNS_HPP 00015 //----------------------------------------------------------------------------- 00016 #ifdef TAPs_USE_CUDA 00017 00018 #include "../Core/TAPsListOfNamespaces.hpp" 00019 00020 BEGIN_NAMESPACE_TAPs__CUDA 00021 //============================================================================= 00022 // Functions that have to be included into the project 00023 //----------------------------------------------------------------------------- 00024 00026 extern void Host__Init ( int argc, char ** argv ); 00027 00029 extern void Host__Init_withPLHM ( int argc, char ** argv ); 00030 00031 // Get number of devices 00032 extern int DeviceCount (); 00033 00035 extern bool GetDevice ( int & device ); 00036 00041 extern bool SetDevice ( int device ); 00042 00044 extern bool GetDeviceProperties ( struct cudaDeviceProp * prop, int device ); 00045 00047 extern bool CanDeviceMapHostMemory ( int device ); 00048 00049 //----------------------------------------------------------------------------- 00050 // Functions that have to be included into the project 00051 //============================================================================= 00052 00053 00054 00055 00056 //============================================================================= 00057 // List of Functions that are used by TAPs Models 00058 //----------------------------------------------------------------------------- 00059 00060 00061 //----------------------------------------------------------------------------- 00062 // Suture / Strand Model 00063 //----------------------------------------------------------------------------- 00065 extern void Global__ModelStrand_AdvSim ( 00066 unsigned int cudaID, 00067 unsigned int numOfVertices, 00068 unsigned int numOfThreads, 00069 float currentTime, 00070 float timeStep, 00071 int numOfSubSteps, 00072 float ptMass, 00073 float Ks, 00074 float Kd, 00075 float Lrest, 00076 float * host_vertex_data, 00077 float * host_prev_vertex_data 00078 ); 00079 00082 extern void Global__ModelStrand_AdvSim_ADVSIM ( 00083 unsigned int cudaID, 00084 unsigned int numOfVertices, 00085 unsigned int numOfThreads, 00086 float currentTime, 00087 float timeStep, 00088 int numOfSubSteps, 00089 float ptMass, 00090 float Ks, 00091 float Kd, 00092 float Lrest, 00093 float * host_vertex_data, 00094 float * host_prev_vertex_data, 00095 unsigned int * host_sim_flags_data, 00096 float * host_pos_constraint_data 00097 ); 00098 00100 extern bool InitailizeDataForSutureModel ( 00101 unsigned int & cudaID, 00102 unsigned int numOfVertices, 00103 float * vertexList, 00104 float * prevVertexList 00105 ); 00106 00109 extern bool InitailizeDataForSutureModel_ADVSIM ( 00110 unsigned int & cudaID, 00111 unsigned int numOfVertices, 00112 float * vertexList, 00113 float * prevVertexList, 00114 unsigned int * simFlagsList, 00115 float * posConstraintList 00116 ); 00117 //----------------------------------------------------------------------------- 00118 // Suture / Strand Model 00119 //----------------------------------------------------------------------------- 00120 00121 00122 //----------------------------------------------------------------------------- 00123 // Elastic Rod Model 00124 //----------------------------------------------------------------------------- 00126 extern bool InitailizeDataForElasticRodModel ( 00127 unsigned int & cudaID, 00128 unsigned int numOfNodes, 00129 float * posList, 00130 float * prevPosList, 00131 float * oriList, 00132 float * prevOriList, 00133 float * intForceList, 00134 float * extForceList 00135 ); 00136 00138 extern void ClearDataForElasticRodModel ( 00139 unsigned int & cudaID 00140 ); 00141 00143 extern void Global__ModelElasticRod_AdvSim ( 00144 unsigned int cudaID, 00145 unsigned int numOfNodes, 00146 unsigned int numOfThreads, 00147 float currentTime, 00148 float timeStep, 00149 int numOfSubSteps, 00150 float radius, 00151 float length, 00152 float length_ori, 00153 float mass, 00154 float material_density, 00155 //float Kt, //!< kinetic translational constant 00156 //float Kr_x, //!< kinetic rotational constant -- x 00157 //float Kr_y, //!< kinetic rotational constant -- y 00158 //float Kr_z, //!< kinetic rotational constant -- z 00159 //float Dt, //!< translational constant 00160 //float Dr_x, //!< rotational dissipation constant -- x 00161 //float Dr_y, //!< rotational dissipation constant -- y 00162 //float Dr_z, //!< rotational dissipation constant -- z 00163 float Kconstraint_3rdDirAlignTangent, 00164 float Kvdamping, 00165 float Ps, 00166 float Pb_x, 00167 float Pb_y, 00168 float Pb_z, 00169 float * host_pos_data, 00170 float * host_prev_pos_data, 00171 float * host_ori_data, 00172 float * host_prev_ori_data, 00173 float * host_int_force_data, 00174 float * host_ext_force_data 00175 ); 00176 00179 extern bool InitailizeDataForPLHMElasticRodModel ( 00180 unsigned int & cudaID, 00181 unsigned int numOfNodes, 00182 float * (&posList), 00183 float * (&prevPosList), 00184 float * (&oriList), 00185 float * (&prevOriList), 00186 float * (&intForceList), 00187 float * (&extForceList) 00188 ); 00189 00192 extern void ClearDataForPLHMElasticRodModel ( 00193 unsigned int & cudaID 00194 ); 00195 00198 extern void Global__PLHMModelElasticRod_AdvSim ( 00199 unsigned int cudaID, 00200 unsigned int numOfNodes, 00201 unsigned int numOfThreads, 00202 float currentTime, 00203 float timeStep, 00204 int numOfSubSteps, 00205 float radius, 00206 float length, 00207 float length_ori, 00208 float mass, 00209 float material_density, 00210 //float Kt, //!< kinetic translational constant 00211 //float Kr_x, //!< kinetic rotational constant -- x 00212 //float Kr_y, //!< kinetic rotational constant -- y 00213 //float Kr_z, //!< kinetic rotational constant -- z 00214 //float Dt, //!< translational constant 00215 //float Dr_x, //!< rotational dissipation constant -- x 00216 //float Dr_y, //!< rotational dissipation constant -- y 00217 //float Dr_z, //!< rotational dissipation constant -- z 00218 float Kconstraint_3rdDirAlignTangent, 00219 float Kvdamping, 00220 float Ps, 00221 float Pb_x, 00222 float Pb_y, 00223 float Pb_z, 00224 float * (&host_pos_data), 00225 float * (&host_prev_pos_data), 00226 float * (&host_ori_data), 00227 float * (&host_prev_ori_data), 00228 float * (&host_int_force_data), 00229 float * (&host_ext_force_data) 00230 ); 00231 //------------------------------------------------------------------- 00232 #if defined(__gl_h_) || defined(__GL_H__) 00233 00235 extern void GL__UnregisterBufferObject ( GLuint & vbo_GL ); 00236 00238 extern bool GL__IsInitailizeDataForElasticRodModel_Drawing (); 00239 00241 extern bool GL__InitailizeDataForElasticRodModel_Drawing ( 00242 unsigned int numberOfCrossSectionVertices, 00243 float * crossSectionVertexData, 00244 GLuint vbo_GL 00245 ); 00246 00248 extern void GL__ClearDataForElasticRodModel_Drawing (); 00249 00251 extern void GL__GenCylinderForElasticRodModel ( 00252 unsigned int cudaID, 00253 unsigned int numOfNodes, 00254 unsigned int numOfThreads, 00255 GLuint vbo_GL, 00256 unsigned int numOfCrossSectionVertices, 00257 float radius 00258 ); 00259 00261 extern void GL__GenCylinderForElasticRodModel_PLHM ( 00262 unsigned int cudaID, 00263 unsigned int numOfNodes, 00264 unsigned int numOfThreads, 00265 GLuint vbo_GL, 00266 unsigned int numOfCrossSectionVertices, 00267 float radius 00268 ); 00269 00270 #endif//#if defined(__gl_h_) || defined(__GL_H__) 00271 //------------------------------------------------------------------- 00272 00273 //----------------------------------------------------------------------------- 00274 // Elastic Rod Model 00275 //----------------------------------------------------------------------------- 00276 00277 00278 //----------------------------------------------------------------------------- 00279 // Mesh Models 00280 //----------------------------------------------------------------------------- 00282 extern void Global__SimPropForMultiPartMeshModel_HalfEdge_AdvSim ( 00283 int numOfVertices, 00284 int numOfThreads, 00285 float tCurrent, 00286 float tNext, 00287 float * data 00288 ); 00289 00291 extern void Global__HETriMeshOneModelMultiParts_AdvSim ( 00292 unsigned int cudaID, 00293 unsigned int numOfVertices, 00294 unsigned int numOfThreads, 00295 float currentTime, 00296 float timeStep, 00297 int numOfSubSteps, 00298 float ptMass, 00299 float Ks, 00300 float Kd, 00301 float HKs, 00302 float HKd, 00303 float * host_vertex_data, 00304 float * host_prev_vertex_data, 00305 float * host_home_vertex_data, 00306 int * host_connection_list, 00307 unsigned int max_connection_size 00308 ); 00309 00311 extern bool InitailizeDataForVertexList ( 00312 unsigned int & cudaID, 00313 unsigned int numOfVertices, 00314 unsigned int max_connection_size, 00315 float * vertexList, 00316 float * prevVertexList, 00317 float * homeVertexList, 00318 int * vertexConnectionList 00319 ); 00320 //----------------------------------------------------------------------------- 00321 // Mesh Models 00322 //----------------------------------------------------------------------------- 00323 00324 //----------------------------------------------------------------------------- 00325 // List of Functions that are used by TAPs' Models 00326 //============================================================================= 00327 END_NAMESPACE_TAPs__CUDA 00328 00329 #endif//TAPs_USE_CUDA 00330 //----------------------------------------------------------------------------- 00331 #endif//TAPs_CUDA_LIST_OF_FNS_HPP 00332 //34567890123456789012345678901234567890123456789012345678901234567890123456789 00333 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----