~esys-p-dev/esys-particle/trunk

« back to all changes in this revision

Viewing changes to Parallel/LatticeMaster.cpp

  • Committer: Steffen Abe
  • Date: 2019-12-03 14:39:10 UTC
  • Revision ID: s.abe@igem-energie.de-20191203143910-0s4xguvluq2jva3z
- added rotateMeshBy() function to rotate whole meshes around a given axis

Show diffs side-by-side

added added

removed removed

Lines of Context:
1239
1239
}
1240
1240
 
1241
1241
/*!
 
1242
  Rigidly rotate a whole mesh around a given axis.
 
1243
 
 
1244
  \param meshName the name of the mesh to be moved
 
1245
  \param origin a point on the axis
 
1246
  \param axis the orientation of the axis around which the mesh is rotated
 
1247
  \param angle the rotation angle in radians
 
1248
*/
 
1249
void CLatticeMaster::rotateMeshBy(
 
1250
    const string &meshName,
 
1251
    const Vec3& origin,
 
1252
    const Vec3& axis,
 
1253
    const double angle
 
1254
)
 
1255
{
 
1256
    console.Debug() << "CLatticeMaster::rotateMeshBy(): enter \n";
 
1257
    BroadcastCommand cmd(getGlobalRankAndComm(), CMD_ROTATEMESHBY);
 
1258
 
 
1259
    cmd.append(meshName.c_str());
 
1260
    cmd.append(origin);
 
1261
    cmd.append(axis.unit()); // force normalised axis vector
 
1262
    cmd.append(angle);
 
1263
    //send command to worker
 
1264
    cmd.broadcast();
 
1265
    console.Debug() << "CLatticeMaster::rotateMeshBy(): exit \n";
 
1266
    }
 
1267
 
 
1268
/*!
 
1269
        Apply pressure to a mesh interaction. EXPERIMENTAL!!
 
1270
         
 
1271
        \param meshName the name of the mesh to be moved
 
1272
        \param pressure  
 
1273
*/
 
1274
void CLatticeMaster::applyPressureToMeshInteraction(const std::string& meshName,double pressure)
 
1275
{
 
1276
        console.Debug() << "CLatticeMaster::applyPressureToMeshInteraction (" << meshName << " , " << pressure << " )\n";
 
1277
        BroadcastCommand cmd(getGlobalRankAndComm(), CMD_APPLYPRESSURRETOMESH);
 
1278
 
 
1279
        cmd.append(meshName.c_str());
 
1280
        cmd.append(pressure);
 
1281
        //send command to worker
 
1282
        cmd.broadcast();
 
1283
        
 
1284
        console.Debug() << "CLatticeMaster::applyPressureToMeshInteraction() : exit \n";
 
1285
}
 
1286
 
 
1287
 
 
1288
/*!
1242
1289
  Add a given tag to the particle closest to a given position. Only the bits
1243
1290
  set in the mask will be influenced, i.e. new_tag=(old_tag & !mask) | (tag & mask).
1244
1291