# | Line 194 | Line 194 | namespace oopse { | |
---|---|---|
194 | os << " <FrameData>\n"; | |
195 | ||
196 | RealType currentTime = s->getTime(); | |
197 | < | sprintf(buffer, " Time: %.10g\n", time); |
197 | > | sprintf(buffer, " Time: %.10g\n", currentTime); |
198 | os << buffer; | |
199 | ||
200 | Mat3x3d hmat; | |
# | Line 234 | Line 234 | namespace oopse { | |
234 | ||
235 | #ifndef IS_MPI | |
236 | os << " <Snapshot>\n"; | |
237 | < | |
237 | > | |
238 | writeFrameProperties(os, info_->getSnapshotManager()->getCurrentSnapshot()); | |
239 | ||
240 | os << " <StuntDoubles>\n"; | |
# | Line 267 | Line 267 | namespace oopse { | |
267 | if (worldRank == masterNode) { | |
268 | os << " <Snapshot>\n"; | |
269 | writeFrameProperties(os, info_->getSnapshotManager()->getCurrentSnapshot()); | |
270 | – | os << buffer; |
270 | os << " <StuntDoubles>\n"; | |
271 | ||
272 | + | os << buffer; |
273 | + | |
274 | int nProc; | |
275 | MPI_Comm_size(MPI_COMM_WORLD, &nProc); | |
276 | for (int i = 1; i < nProc; ++i) { | |
# | Line 281 | Line 282 | namespace oopse { | |
282 | MPI_Recv(&recvLength, 1, MPI_INT, i, 0, MPI_COMM_WORLD, &istatus); | |
283 | char* recvBuffer = new char[recvLength]; | |
284 | if (recvBuffer == NULL) { | |
284 | – | |
285 | } else { | |
286 | < | MPI_Recv(&recvBuffer, recvLength, MPI_CHAR, i, 0, MPI_COMM_WORLD, &istatus); |
286 | > | MPI_Recv(recvBuffer, recvLength, MPI_CHAR, i, 0, MPI_COMM_WORLD, &istatus); |
287 | os << recvBuffer; | |
288 | delete recvBuffer; | |
289 | } | |
290 | – | |
290 | } | |
291 | os << " </StuntDoubles>\n"; | |
292 | ||
293 | os << " </Snapshot>\n"; | |
294 | os.flush(); | |
295 | } else { | |
296 | < | int sendBufferLength = buffer.size(); |
296 | > | int sendBufferLength = buffer.size() + 1; |
297 | MPI_Send(&sendBufferLength, 1, MPI_INT, masterNode, 0, MPI_COMM_WORLD); | |
298 | < | MPI_Send((void *)buffer.c_str(), sendBufferLength, MPI_CHAR, masterNode, 0, MPI_COMM_WORLD); |
298 | > | MPI_Send((void *)buffer.c_str(), sendBufferLength, MPI_CHAR, masterNode, 0, MPI_COMM_WORLD); |
299 | } | |
300 | ||
301 | #endif // is_mpi | |
# | Line 314 | Line 313 | namespace oopse { | |
313 | Vector3d vel; | |
314 | pos = integrableObject->getPos(); | |
315 | vel = integrableObject->getVel(); | |
316 | < | sprintf(tempBuffer, "%18.10g\t%18.10g\t%18.10g\t%14.10g\t%14.10g\t%14.10g", |
316 | > | sprintf(tempBuffer, "%18.10g %18.10g %18.10g %13e %13e %13e", |
317 | pos[0], pos[1], pos[2], | |
318 | vel[0], vel[1], vel[2]); | |
319 | line += tempBuffer; | |
# | Line 325 | Line 324 | namespace oopse { | |
324 | Vector3d ji; | |
325 | q = integrableObject->getQ(); | |
326 | ji = integrableObject->getJ(); | |
327 | < | sprintf(tempBuffer, "\t%14.10g\t%14.10g\t%14.10g\t%14.10g\t%14.10g\t%14.10g\t%14.10g", |
327 | > | sprintf(tempBuffer, " %13e %13e %13e %13e %13e %13e %13e", |
328 | q[0], q[1], q[2], q[3], | |
329 | ji[0], ji[1], ji[2]); | |
330 | line += tempBuffer; | |
# | Line 338 | Line 337 | namespace oopse { | |
337 | frc = integrableObject->getFrc(); | |
338 | trq = integrableObject->getTrq(); | |
339 | ||
340 | < | sprintf(tempBuffer, "\t%14.10g\t%14.10g\t%14.10g\t%14.10g\t%14.10g\t%14.10g", |
340 | > | sprintf(tempBuffer, " %13e %13e %13e %13e %13e %13e", |
341 | frc[0], frc[1], frc[2], | |
342 | trq[0], trq[1], trq[2]); | |
343 | line += tempBuffer; | |
344 | } | |
345 | ||
346 | < | sprintf(tempBuffer, "%d\t%s\t%s\n", index, type.c_str(), line.c_str()); |
346 | > | sprintf(tempBuffer, "%10d %7s %s\n", index, type.c_str(), line.c_str()); |
347 | return std::string(tempBuffer); | |
348 | } | |
349 |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |