21 template<
typename MotionModel>
25 triMotionIndex_.reserve( this->surface().capacity() );
26 triMotionIndex_.clear();
28 ForAll( surfI, motionComponentName_)
30 auto mName = motionComponentName_[surfI];
31 auto mInd = motionModel_.nameToIndex(mName);
32 motionIndex_.push_back(mInd);
34 int32 surfSize = this->surface().surfNumTriangles(surfI);
35 for(
int32 i=0; i<surfSize; i++)
37 triMotionIndex_.push_back(mInd);
40 motionIndex_.syncViews();
41 triMotionIndex_.syncViews();
43 pointMotionIndex_.reserve(triSurface_.numPoints());
44 pointMotionIndex_.clear();
46 ForAll(surfI, motionIndex_)
48 auto nP = triSurface_.surfNumPoints(surfI);
49 for(
int32 i=0; i<nP; i++)
51 pointMotionIndex_.push_back(motionIndex_[surfI]);
54 pointMotionIndex_.syncViews();
60 template<
typename MotionModel>
69 this->owner().
template emplaceObject<MotionModel>(
73 objectFile::READ_ALWAYS,
74 objectFile::WRITE_ALWAYS
78 moveGeomTimer_(
"move geometry", &this->timers())
83 template<
typename MotionModel>
102 this->owner().
template emplaceObject<MotionModel>(
106 objectFile::READ_NEVER,
107 objectFile::WRITE_ALWAYS
112 moveGeomTimer_(
"move geometry", &this->timers())
117 template<
typename MotionModel>
137 this->owner().
template emplaceObject<MotionModel>(
141 objectFile::READ_NEVER,
142 objectFile::WRITE_ALWAYS
147 moveGeomTimer_(
"move geometry", &this->timers())
152 template<
typename MotionModel>
155 geometry::beforeIteration();
159 template<
typename MotionModel>
162 if( motionModel_.isMoving() )
164 moveGeomTimer_.start();
166 moveGeomTimer_.end();
171 template<
typename MotionModel>
174 geometry::afterIteration();
178 template<
typename MotionModel>
182 real dt = this->dt();
183 real t = this->currentTime();
185 auto pointMIndex= pointMotionIndex_.deviceVector();
186 auto mModel = motionModel_.getModel(t);
187 realx3* points = triSurface_.pointsData_D();
188 auto numPoints = triSurface_.numPoints();
191 Kokkos::parallel_for(
192 "geometryMotion<MotionModel>::movePoints",
195 auto newPos = mModel.transferPoint(pointMIndex[i], points[i], dt);
202 motionModel_.move(t,dt);
205 moveGeomTimer_.end();