Skip to content

Commit 40ee042

Browse files
author
Martin D. Weinberg
committed
Add losts more comments [no CI]
1 parent 1291db3 commit 40ee042

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

include/tipsy.H

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ namespace TipsyReader
171171
//! Generate stream position for parallel read
172172
//! \param nsize The number of particles to read
173173
//! \param ssize The size of each particle structure in bytes
174+
//! \note Using unsigned long to avoid wrapping issues
175+
//! \return The number of particles to read for this process
174176
unsigned long xdr_psize(unsigned long nsize, unsigned long ssize)
175177
{
176178
// Number of particles per process
@@ -193,6 +195,9 @@ namespace TipsyReader
193195
}
194196

195197
//! Set stream position to next group of particles
198+
//! \param nsize The number of particles to read
199+
//! \param ssize The size of each particle structure in bytes
200+
//! \note Using unsigned long to avoid wrapping issues
196201
void xdr_pnext(unsigned long nsize, unsigned long ssize)
197202
{
198203
// Move the stream position to the start of the next particle
@@ -282,6 +287,7 @@ namespace TipsyReader
282287

283288
public:
284289

290+
//! Constructor that opens the file and reads the header
285291
TipsyXDR(const std::string filename)
286292
{
287293
// Attempt to read tipsy file
@@ -291,8 +297,10 @@ namespace TipsyReader
291297
}
292298
}
293299

300+
//! Read the particles from the file
294301
int readParticles() { return xdr_read(); }
295302

303+
//! Destructor that removes the stream and closes the file
296304
~TipsyXDR()
297305
{
298306
xdr_destroy(&xdrs);
@@ -326,6 +334,8 @@ namespace TipsyReader
326334
return 1;
327335
}
328336

337+
//! Open the file and read the header
338+
//! \param filename The name of the file to read
329339
int native_init(const std::string& filename)
330340
{
331341
try {
@@ -348,6 +358,8 @@ namespace TipsyReader
348358
//! Generate stream position for parallel read
349359
//! \param nsize The number of particles to read
350360
//! \param ssize The size of each particle structure in bytes
361+
//! \note Using unsigned long to avoid wrapping issues
362+
//! \return The number of particles to read for this process
351363
unsigned long ios_psize(unsigned long nsize, unsigned long ssize)
352364
{
353365
// Number of particles per process
@@ -373,6 +385,9 @@ namespace TipsyReader
373385
}
374386

375387
//! Move to next particle group
388+
//! \param nsize The number of particles to read
389+
//! \param ssize The size of each particle structure in bytes
390+
//! \note Using unsigned long to avoid wrapping issues
376391
void ios_pnext(unsigned long nsize, unsigned long ssize)
377392
{
378393
// Move the stream position to the start of the next particle
@@ -385,6 +400,8 @@ namespace TipsyReader
385400
}
386401
}
387402

403+
//! Read the particles from the file
404+
//! \return The number of particle groups read
388405
int native_read()
389406
{
390407
int N=0;
@@ -436,6 +453,7 @@ namespace TipsyReader
436453
return N;
437454
}
438455

456+
//! Read the gas particles from the file
439457
void read_gas()
440458
{
441459
try {
@@ -449,6 +467,7 @@ namespace TipsyReader
449467
}
450468
}
451469

470+
//! Read the dark particles from the file
452471
void read_dark()
453472
{
454473
try {
@@ -462,6 +481,7 @@ namespace TipsyReader
462481
}
463482
}
464483

484+
//! Read the star particles from the file
465485
void read_star()
466486
{
467487
try {
@@ -479,6 +499,7 @@ namespace TipsyReader
479499

480500
public:
481501

502+
//! Constructor that opens the file and reads the header
482503
TipsyNative(const std::string filename)
483504
{
484505
// Attempt to read tipsy file
@@ -488,8 +509,10 @@ namespace TipsyReader
488509
}
489510
}
490511

512+
//! Read the particles from the file
491513
int readParticles() { return native_read(); }
492514

515+
//! Destructor that closes the file by scoping
493516
~TipsyNative()
494517
{
495518
// Nothing

0 commit comments

Comments
 (0)