@@ -190,22 +190,34 @@ namespace polyMPO{
190190 });
191191 }
192192
193+
193194 void Mesh::aggregateDeluDyn (){
194195 std::cout<<__FUNCTION__<<std::endl;
195196
196197 int numVtx = getNumVertices ();
198+ auto elasticTimeStep = getElasticTimeStep ();
197199
198- constexpr MeshFieldIndex mfIndex1 = MeshF_OnSurfDispIncr;
199- auto meshField1 = getMeshField<mfIndex1 >();
200+ constexpr MeshFieldIndex mfIndex_surfDispIncr = MeshF_OnSurfDispIncr;
201+ auto meshField_surfDispIncr = getMeshField<mfIndex_surfDispIncr >();
200202
201- constexpr MeshFieldIndex mfIndex2 = MeshF_TanLatVertexRotatedOverRadius;
202- auto meshField2 = getMeshField<mfIndex2>();
203-
204- constexpr MeshFieldIndex mfIndex3 = MeshF_Vel;
205- auto meshField3 = getMeshField<mfIndex3>();
203+ constexpr MeshFieldIndex mfIndex_metric = MeshF_TanLatVertexRotatedOverRadius;
204+ auto meshField_metric = getMeshField<mfIndex_metric>();
205+
206+ constexpr MeshFieldIndex mfIndex_vel = MeshF_Vel;
207+ auto meshFieldVel = getMeshField<mfIndex_vel>();
208+
209+ Kokkos::parallel_for (" update_velocity" , numVtx, KOKKOS_LAMBDA (int vtx) {
210+ auto u = meshFieldVel (vtx, 0 );
211+ auto v = meshFieldVel (vtx, 1 );
212+
213+ auto Del = elasticTimeStep * u * meshField_metric (vtx, 0 );
214+ meshFieldVel (vtx, 0 ) = cos (Del) * u + sin (Del) * v ;
215+ meshFieldVel (vtx, 1 ) = -sin (Del) * u + cos (Del) * v ;
216+ });
206217
207- Kokkos::parallel_for (" calcVelIncr" , numVtx, KOKKOS_LAMBDA (int i) {
208-
218+ Kokkos::parallel_for (" calcVelIncr" , numVtx, KOKKOS_LAMBDA (int vtx) {
219+ meshField_surfDispIncr (vtx, 0 ) = meshField_surfDispIncr (vtx, 0 ) + meshFieldVel (vtx, 0 );
220+ meshField_surfDispIncr (vtx, 1 ) = meshField_surfDispIncr (vtx, 1 ) + meshFieldVel (vtx, 1 );
209221 });
210222 }
211223
0 commit comments