btSoftBodySolverData.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748
  1. /*
  2. Bullet Continuous Collision Detection and Physics Library
  3. Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
  4. This software is provided 'as-is', without any express or implied warranty.
  5. In no event will the authors be held liable for any damages arising from the use of this software.
  6. Permission is granted to anyone to use this software for any purpose,
  7. including commercial applications, and to alter it and redistribute it freely,
  8. subject to the following restrictions:
  9. 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  10. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  11. 3. This notice may not be removed or altered from any source distribution.
  12. */
  13. #ifndef BT_SOFT_BODY_SOLVER_DATA_H
  14. #define BT_SOFT_BODY_SOLVER_DATA_H
  15. #include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h"
  16. #include "vectormath/vmInclude.h"
  17. class btSoftBodyLinkData
  18. {
  19. public:
  20. /**
  21. * Class representing a link as a set of three indices into the vertex array.
  22. */
  23. class LinkNodePair
  24. {
  25. public:
  26. int vertex0;
  27. int vertex1;
  28. LinkNodePair()
  29. {
  30. vertex0 = 0;
  31. vertex1 = 0;
  32. }
  33. LinkNodePair( int v0, int v1 )
  34. {
  35. vertex0 = v0;
  36. vertex1 = v1;
  37. }
  38. };
  39. /**
  40. * Class describing a link for input into the system.
  41. */
  42. class LinkDescription
  43. {
  44. protected:
  45. int m_vertex0;
  46. int m_vertex1;
  47. float m_linkLinearStiffness;
  48. float m_linkStrength;
  49. public:
  50. LinkDescription()
  51. {
  52. m_vertex0 = 0;
  53. m_vertex1 = 0;
  54. m_linkLinearStiffness = 1.0;
  55. m_linkStrength = 1.0;
  56. }
  57. LinkDescription( int newVertex0, int newVertex1, float linkLinearStiffness )
  58. {
  59. m_vertex0 = newVertex0;
  60. m_vertex1 = newVertex1;
  61. m_linkLinearStiffness = linkLinearStiffness;
  62. m_linkStrength = 1.0;
  63. }
  64. LinkNodePair getVertexPair() const
  65. {
  66. LinkNodePair nodes;
  67. nodes.vertex0 = m_vertex0;
  68. nodes.vertex1 = m_vertex1;
  69. return nodes;
  70. }
  71. void setVertex0( int vertex )
  72. {
  73. m_vertex0 = vertex;
  74. }
  75. void setVertex1( int vertex )
  76. {
  77. m_vertex1 = vertex;
  78. }
  79. void setLinkLinearStiffness( float linearStiffness )
  80. {
  81. m_linkLinearStiffness = linearStiffness;
  82. }
  83. void setLinkStrength( float strength )
  84. {
  85. m_linkStrength = strength;
  86. }
  87. int getVertex0() const
  88. {
  89. return m_vertex0;
  90. }
  91. int getVertex1() const
  92. {
  93. return m_vertex1;
  94. }
  95. float getLinkStrength() const
  96. {
  97. return m_linkStrength;
  98. }
  99. float getLinkLinearStiffness() const
  100. {
  101. return m_linkLinearStiffness;
  102. }
  103. };
  104. protected:
  105. // NOTE:
  106. // Vertex reference data is stored relative to global array, not relative to individual cloth.
  107. // Values must be correct if being passed into single-cloth VBOs or when migrating from one solver
  108. // to another.
  109. btAlignedObjectArray< LinkNodePair > m_links; // Vertex pair for the link
  110. btAlignedObjectArray< float > m_linkStrength; // Strength of each link
  111. // (inverseMassA + inverseMassB)/ linear stiffness coefficient
  112. btAlignedObjectArray< float > m_linksMassLSC;
  113. btAlignedObjectArray< float > m_linksRestLengthSquared;
  114. // Current vector length of link
  115. btAlignedObjectArray< Vectormath::Aos::Vector3 > m_linksCLength;
  116. // 1/(current length * current length * massLSC)
  117. btAlignedObjectArray< float > m_linksLengthRatio;
  118. btAlignedObjectArray< float > m_linksRestLength;
  119. btAlignedObjectArray< float > m_linksMaterialLinearStiffnessCoefficient;
  120. public:
  121. btSoftBodyLinkData()
  122. {
  123. }
  124. virtual ~btSoftBodyLinkData()
  125. {
  126. }
  127. virtual void clear()
  128. {
  129. m_links.resize(0);
  130. m_linkStrength.resize(0);
  131. m_linksMassLSC.resize(0);
  132. m_linksRestLengthSquared.resize(0);
  133. m_linksLengthRatio.resize(0);
  134. m_linksRestLength.resize(0);
  135. m_linksMaterialLinearStiffnessCoefficient.resize(0);
  136. }
  137. int getNumLinks()
  138. {
  139. return m_links.size();
  140. }
  141. /** Allocate enough space in all link-related arrays to fit numLinks links */
  142. virtual void createLinks( int numLinks )
  143. {
  144. int previousSize = m_links.size();
  145. int newSize = previousSize + numLinks;
  146. // Resize all the arrays that store link data
  147. m_links.resize( newSize );
  148. m_linkStrength.resize( newSize );
  149. m_linksMassLSC.resize( newSize );
  150. m_linksRestLengthSquared.resize( newSize );
  151. m_linksCLength.resize( newSize );
  152. m_linksLengthRatio.resize( newSize );
  153. m_linksRestLength.resize( newSize );
  154. m_linksMaterialLinearStiffnessCoefficient.resize( newSize );
  155. }
  156. /** Insert the link described into the correct data structures assuming space has already been allocated by a call to createLinks */
  157. virtual void setLinkAt( const LinkDescription &link, int linkIndex )
  158. {
  159. m_links[linkIndex] = link.getVertexPair();
  160. m_linkStrength[linkIndex] = link.getLinkStrength();
  161. m_linksMassLSC[linkIndex] = 0.f;
  162. m_linksRestLengthSquared[linkIndex] = 0.f;
  163. m_linksCLength[linkIndex] = Vectormath::Aos::Vector3(0.f, 0.f, 0.f);
  164. m_linksLengthRatio[linkIndex] = 0.f;
  165. m_linksRestLength[linkIndex] = 0.f;
  166. m_linksMaterialLinearStiffnessCoefficient[linkIndex] = link.getLinkLinearStiffness();
  167. }
  168. /**
  169. * Return true if data is on the accelerator.
  170. * The CPU version of this class will return true here because
  171. * the CPU is the same as the accelerator.
  172. */
  173. virtual bool onAccelerator()
  174. {
  175. return true;
  176. }
  177. /**
  178. * Move data from host memory to the accelerator.
  179. * The CPU version will always return that it has moved it.
  180. */
  181. virtual bool moveToAccelerator()
  182. {
  183. return true;
  184. }
  185. /**
  186. * Move data from host memory from the accelerator.
  187. * The CPU version will always return that it has moved it.
  188. */
  189. virtual bool moveFromAccelerator()
  190. {
  191. return true;
  192. }
  193. /**
  194. * Return reference to the vertex index pair for link linkIndex as stored on the host.
  195. */
  196. LinkNodePair &getVertexPair( int linkIndex )
  197. {
  198. return m_links[linkIndex];
  199. }
  200. /**
  201. * Return reference to strength of link linkIndex as stored on the host.
  202. */
  203. float &getStrength( int linkIndex )
  204. {
  205. return m_linkStrength[linkIndex];
  206. }
  207. /**
  208. * Return a reference to the strength of the link corrected for link sorting.
  209. * This is important if we are using data on an accelerator which has the data sorted in some fashion.
  210. */
  211. virtual float &getStrengthCorrected( int linkIndex )
  212. {
  213. return getStrength( linkIndex );
  214. }
  215. /**
  216. * Return reference to the rest length of link linkIndex as stored on the host.
  217. */
  218. float &getRestLength( int linkIndex )
  219. {
  220. return m_linksRestLength[linkIndex];
  221. }
  222. /**
  223. * Return reference to linear stiffness coefficient for link linkIndex as stored on the host.
  224. */
  225. float &getLinearStiffnessCoefficient( int linkIndex )
  226. {
  227. return m_linksMaterialLinearStiffnessCoefficient[linkIndex];
  228. }
  229. /**
  230. * Return reference to the MassLSC value for link linkIndex as stored on the host.
  231. */
  232. float &getMassLSC( int linkIndex )
  233. {
  234. return m_linksMassLSC[linkIndex];
  235. }
  236. /**
  237. * Return reference to rest length squared for link linkIndex as stored on the host.
  238. */
  239. float &getRestLengthSquared( int linkIndex )
  240. {
  241. return m_linksRestLengthSquared[linkIndex];
  242. }
  243. /**
  244. * Return reference to current length of link linkIndex as stored on the host.
  245. */
  246. Vectormath::Aos::Vector3 &getCurrentLength( int linkIndex )
  247. {
  248. return m_linksCLength[linkIndex];
  249. }
  250. /**
  251. * Return the link length ratio from for link linkIndex as stored on the host.
  252. */
  253. float &getLinkLengthRatio( int linkIndex )
  254. {
  255. return m_linksLengthRatio[linkIndex];
  256. }
  257. };
  258. /**
  259. * Wrapper for vertex data information.
  260. * By wrapping it like this we stand a good chance of being able to optimise for storage format easily.
  261. * It should also help us make sure all the data structures remain consistent.
  262. */
  263. class btSoftBodyVertexData
  264. {
  265. public:
  266. /**
  267. * Class describing a vertex for input into the system.
  268. */
  269. class VertexDescription
  270. {
  271. private:
  272. Vectormath::Aos::Point3 m_position;
  273. /** Inverse mass. If this is 0f then the mass was 0 because that simplifies calculations. */
  274. float m_inverseMass;
  275. public:
  276. VertexDescription()
  277. {
  278. m_position = Vectormath::Aos::Point3( 0.f, 0.f, 0.f );
  279. m_inverseMass = 0.f;
  280. }
  281. VertexDescription( const Vectormath::Aos::Point3 &position, float mass )
  282. {
  283. m_position = position;
  284. if( mass > 0.f )
  285. m_inverseMass = 1.0f/mass;
  286. else
  287. m_inverseMass = 0.f;
  288. }
  289. void setPosition( const Vectormath::Aos::Point3 &position )
  290. {
  291. m_position = position;
  292. }
  293. void setInverseMass( float inverseMass )
  294. {
  295. m_inverseMass = inverseMass;
  296. }
  297. void setMass( float mass )
  298. {
  299. if( mass > 0.f )
  300. m_inverseMass = 1.0f/mass;
  301. else
  302. m_inverseMass = 0.f;
  303. }
  304. Vectormath::Aos::Point3 getPosition() const
  305. {
  306. return m_position;
  307. }
  308. float getInverseMass() const
  309. {
  310. return m_inverseMass;
  311. }
  312. float getMass() const
  313. {
  314. if( m_inverseMass == 0.f )
  315. return 0.f;
  316. else
  317. return 1.0f/m_inverseMass;
  318. }
  319. };
  320. protected:
  321. // identifier for the individual cloth
  322. // For the CPU we don't really need this as we can grab the cloths and iterate over only their vertices
  323. // For a parallel accelerator knowing on a per-vertex basis which cloth we're part of will help for obtaining
  324. // per-cloth data
  325. // For sorting etc it might also be helpful to be able to use in-array data such as this.
  326. btAlignedObjectArray< int > m_clothIdentifier;
  327. btAlignedObjectArray< Vectormath::Aos::Point3 > m_vertexPosition; // vertex positions
  328. btAlignedObjectArray< Vectormath::Aos::Point3 > m_vertexPreviousPosition; // vertex positions
  329. btAlignedObjectArray< Vectormath::Aos::Vector3 > m_vertexVelocity; // Velocity
  330. btAlignedObjectArray< Vectormath::Aos::Vector3 > m_vertexForceAccumulator; // Force accumulator
  331. btAlignedObjectArray< Vectormath::Aos::Vector3 > m_vertexNormal; // Normals
  332. btAlignedObjectArray< float > m_vertexInverseMass; // Inverse mass
  333. btAlignedObjectArray< float > m_vertexArea; // Area controlled by the vertex
  334. btAlignedObjectArray< int > m_vertexTriangleCount; // Number of triangles touching this vertex
  335. public:
  336. btSoftBodyVertexData()
  337. {
  338. }
  339. virtual ~btSoftBodyVertexData()
  340. {
  341. }
  342. virtual void clear()
  343. {
  344. m_clothIdentifier.resize(0);
  345. m_vertexPosition.resize(0);
  346. m_vertexPreviousPosition.resize(0);
  347. m_vertexVelocity.resize(0);
  348. m_vertexForceAccumulator.resize(0);
  349. m_vertexNormal.resize(0);
  350. m_vertexInverseMass.resize(0);
  351. m_vertexArea.resize(0);
  352. m_vertexTriangleCount.resize(0);
  353. }
  354. int getNumVertices()
  355. {
  356. return m_vertexPosition.size();
  357. }
  358. int getClothIdentifier( int vertexIndex )
  359. {
  360. return m_clothIdentifier[vertexIndex];
  361. }
  362. void setVertexAt( const VertexDescription &vertex, int vertexIndex )
  363. {
  364. m_vertexPosition[vertexIndex] = vertex.getPosition();
  365. m_vertexPreviousPosition[vertexIndex] = vertex.getPosition();
  366. m_vertexVelocity[vertexIndex] = Vectormath::Aos::Vector3(0.f, 0.f, 0.f);
  367. m_vertexForceAccumulator[vertexIndex] = Vectormath::Aos::Vector3(0.f, 0.f, 0.f);
  368. m_vertexNormal[vertexIndex] = Vectormath::Aos::Vector3(0.f, 0.f, 0.f);
  369. m_vertexInverseMass[vertexIndex] = vertex.getInverseMass();
  370. m_vertexArea[vertexIndex] = 0.f;
  371. m_vertexTriangleCount[vertexIndex] = 0;
  372. }
  373. /**
  374. * Create numVertices new vertices for cloth clothIdentifier
  375. * maxVertices allows a buffer zone of extra vertices for alignment or tearing reasons.
  376. */
  377. void createVertices( int numVertices, int clothIdentifier, int maxVertices = 0 )
  378. {
  379. int previousSize = m_vertexPosition.size();
  380. if( maxVertices == 0 )
  381. maxVertices = numVertices;
  382. int newSize = previousSize + maxVertices;
  383. // Resize all the arrays that store vertex data
  384. m_clothIdentifier.resize( newSize );
  385. m_vertexPosition.resize( newSize );
  386. m_vertexPreviousPosition.resize( newSize );
  387. m_vertexVelocity.resize( newSize );
  388. m_vertexForceAccumulator.resize( newSize );
  389. m_vertexNormal.resize( newSize );
  390. m_vertexInverseMass.resize( newSize );
  391. m_vertexArea.resize( newSize );
  392. m_vertexTriangleCount.resize( newSize );
  393. for( int vertexIndex = previousSize; vertexIndex < newSize; ++vertexIndex )
  394. m_clothIdentifier[vertexIndex] = clothIdentifier;
  395. for( int vertexIndex = (previousSize + numVertices); vertexIndex < newSize; ++vertexIndex )
  396. m_clothIdentifier[vertexIndex] = -1;
  397. }
  398. // Get and set methods in header so they can be inlined
  399. /**
  400. * Return a reference to the position of vertex vertexIndex as stored on the host.
  401. */
  402. Vectormath::Aos::Point3 &getPosition( int vertexIndex )
  403. {
  404. return m_vertexPosition[vertexIndex];
  405. }
  406. Vectormath::Aos::Point3 getPosition( int vertexIndex ) const
  407. {
  408. return m_vertexPosition[vertexIndex];
  409. }
  410. /**
  411. * Return a reference to the previous position of vertex vertexIndex as stored on the host.
  412. */
  413. Vectormath::Aos::Point3 &getPreviousPosition( int vertexIndex )
  414. {
  415. return m_vertexPreviousPosition[vertexIndex];
  416. }
  417. /**
  418. * Return a reference to the velocity of vertex vertexIndex as stored on the host.
  419. */
  420. Vectormath::Aos::Vector3 &getVelocity( int vertexIndex )
  421. {
  422. return m_vertexVelocity[vertexIndex];
  423. }
  424. /**
  425. * Return a reference to the force accumulator of vertex vertexIndex as stored on the host.
  426. */
  427. Vectormath::Aos::Vector3 &getForceAccumulator( int vertexIndex )
  428. {
  429. return m_vertexForceAccumulator[vertexIndex];
  430. }
  431. /**
  432. * Return a reference to the normal of vertex vertexIndex as stored on the host.
  433. */
  434. Vectormath::Aos::Vector3 &getNormal( int vertexIndex )
  435. {
  436. return m_vertexNormal[vertexIndex];
  437. }
  438. Vectormath::Aos::Vector3 getNormal( int vertexIndex ) const
  439. {
  440. return m_vertexNormal[vertexIndex];
  441. }
  442. /**
  443. * Return a reference to the inverse mass of vertex vertexIndex as stored on the host.
  444. */
  445. float &getInverseMass( int vertexIndex )
  446. {
  447. return m_vertexInverseMass[vertexIndex];
  448. }
  449. /**
  450. * Get access to the area controlled by this vertex.
  451. */
  452. float &getArea( int vertexIndex )
  453. {
  454. return m_vertexArea[vertexIndex];
  455. }
  456. /**
  457. * Get access to the array of how many triangles touch each vertex.
  458. */
  459. int &getTriangleCount( int vertexIndex )
  460. {
  461. return m_vertexTriangleCount[vertexIndex];
  462. }
  463. /**
  464. * Return true if data is on the accelerator.
  465. * The CPU version of this class will return true here because
  466. * the CPU is the same as the accelerator.
  467. */
  468. virtual bool onAccelerator()
  469. {
  470. return true;
  471. }
  472. /**
  473. * Move data from host memory to the accelerator.
  474. * The CPU version will always return that it has moved it.
  475. */
  476. virtual bool moveToAccelerator()
  477. {
  478. return true;
  479. }
  480. /**
  481. * Move data to host memory from the accelerator if bCopy is false.
  482. * If bCopy is true, copy data to host memory from the accelerator so that data
  483. * won't be moved to accelerator when moveToAccelerator() is called next time.
  484. * If bCopyMinimum is true, only vertex position and normal are copied.
  485. * bCopyMinimum will be meaningful only if bCopy is true.
  486. * The CPU version will always return that it has moved it.
  487. */
  488. virtual bool moveFromAccelerator(bool bCopy = false, bool bCopyMinimum = true)
  489. {
  490. return true;
  491. }
  492. btAlignedObjectArray< Vectormath::Aos::Point3 > &getVertexPositions()
  493. {
  494. return m_vertexPosition;
  495. }
  496. };
  497. class btSoftBodyTriangleData
  498. {
  499. public:
  500. /**
  501. * Class representing a triangle as a set of three indices into the
  502. * vertex array.
  503. */
  504. class TriangleNodeSet
  505. {
  506. public:
  507. int vertex0;
  508. int vertex1;
  509. int vertex2;
  510. int _padding;
  511. TriangleNodeSet( )
  512. {
  513. vertex0 = 0;
  514. vertex1 = 0;
  515. vertex2 = 0;
  516. _padding = -1;
  517. }
  518. TriangleNodeSet( int newVertex0, int newVertex1, int newVertex2 )
  519. {
  520. vertex0 = newVertex0;
  521. vertex1 = newVertex1;
  522. vertex2 = newVertex2;
  523. }
  524. };
  525. class TriangleDescription
  526. {
  527. protected:
  528. int m_vertex0;
  529. int m_vertex1;
  530. int m_vertex2;
  531. public:
  532. TriangleDescription()
  533. {
  534. m_vertex0 = 0;
  535. m_vertex1 = 0;
  536. m_vertex2 = 0;
  537. }
  538. TriangleDescription( int newVertex0, int newVertex1, int newVertex2 )
  539. {
  540. m_vertex0 = newVertex0;
  541. m_vertex1 = newVertex1;
  542. m_vertex2 = newVertex2;
  543. }
  544. TriangleNodeSet getVertexSet() const
  545. {
  546. btSoftBodyTriangleData::TriangleNodeSet nodes;
  547. nodes.vertex0 = m_vertex0;
  548. nodes.vertex1 = m_vertex1;
  549. nodes.vertex2 = m_vertex2;
  550. return nodes;
  551. }
  552. };
  553. protected:
  554. // NOTE:
  555. // Vertex reference data is stored relative to global array, not relative to individual cloth.
  556. // Values must be correct if being passed into single-cloth VBOs or when migrating from one solver
  557. // to another.
  558. btAlignedObjectArray< TriangleNodeSet > m_vertexIndices;
  559. btAlignedObjectArray< float > m_area;
  560. btAlignedObjectArray< Vectormath::Aos::Vector3 > m_normal;
  561. public:
  562. btSoftBodyTriangleData()
  563. {
  564. }
  565. virtual ~btSoftBodyTriangleData()
  566. {
  567. }
  568. virtual void clear()
  569. {
  570. m_vertexIndices.resize(0);
  571. m_area.resize(0);
  572. m_normal.resize(0);
  573. }
  574. int getNumTriangles()
  575. {
  576. return m_vertexIndices.size();
  577. }
  578. virtual void setTriangleAt( const TriangleDescription &triangle, int triangleIndex )
  579. {
  580. m_vertexIndices[triangleIndex] = triangle.getVertexSet();
  581. }
  582. virtual void createTriangles( int numTriangles )
  583. {
  584. int previousSize = m_vertexIndices.size();
  585. int newSize = previousSize + numTriangles;
  586. // Resize all the arrays that store triangle data
  587. m_vertexIndices.resize( newSize );
  588. m_area.resize( newSize );
  589. m_normal.resize( newSize );
  590. }
  591. /**
  592. * Return the vertex index set for triangle triangleIndex as stored on the host.
  593. */
  594. const TriangleNodeSet &getVertexSet( int triangleIndex )
  595. {
  596. return m_vertexIndices[triangleIndex];
  597. }
  598. /**
  599. * Get access to the triangle area.
  600. */
  601. float &getTriangleArea( int triangleIndex )
  602. {
  603. return m_area[triangleIndex];
  604. }
  605. /**
  606. * Get access to the normal vector for this triangle.
  607. */
  608. Vectormath::Aos::Vector3 &getNormal( int triangleIndex )
  609. {
  610. return m_normal[triangleIndex];
  611. }
  612. /**
  613. * Return true if data is on the accelerator.
  614. * The CPU version of this class will return true here because
  615. * the CPU is the same as the accelerator.
  616. */
  617. virtual bool onAccelerator()
  618. {
  619. return true;
  620. }
  621. /**
  622. * Move data from host memory to the accelerator.
  623. * The CPU version will always return that it has moved it.
  624. */
  625. virtual bool moveToAccelerator()
  626. {
  627. return true;
  628. }
  629. /**
  630. * Move data from host memory from the accelerator.
  631. * The CPU version will always return that it has moved it.
  632. */
  633. virtual bool moveFromAccelerator()
  634. {
  635. return true;
  636. }
  637. };
  638. #endif // #ifndef BT_SOFT_BODY_SOLVER_DATA_H