Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion expui/Centering.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ namespace Utility

int count = 0;
for (auto it=combo.rbegin(); it!=combo.rend(); it++) {
if (count > Nsort) break;
if (++count > Nsort) break;
for (int k=0; k<3; k++)
ctr[k] += it->first * points[it->second].get(k);
dentot += it->first;
Expand Down
38 changes: 28 additions & 10 deletions exputil/ParticleReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace PR {
{ {"Gas", 0}, {"Halo", 1}, {"Disk", 2}, {"Bulge", 3}, {"Stars", 4}, {"Bndry", 5}};


GadgetNative::GadgetNative(const std::vector<std::string>& files, bool verbose)
GadgetNative::GadgetNative(const std::vector<std::string>& files, bool verbose) : ParticleReader()
{
_files = files; // Copy file list (bunch)
_verbose = verbose;
Expand Down Expand Up @@ -317,7 +317,7 @@ namespace PR {
{ {"Gas", 0}, {"Halo", 1}, {"Disk", 2}, {"Bulge", 3}, {"Stars", 4}, {"Bndry", 5}};


GadgetHDF5::GadgetHDF5(const std::vector<std::string>& files, bool verbose)
GadgetHDF5::GadgetHDF5(const std::vector<std::string>& files, bool verbose) : ParticleReader()
{
_files = files;
_verbose = verbose;
Expand Down Expand Up @@ -705,7 +705,7 @@ namespace PR {
}


PSPhdf5::PSPhdf5(const std::vector<std::string>& files, bool verbose)
PSPhdf5::PSPhdf5(const std::vector<std::string>& files, bool verbose) : ParticleReader()
{
_files = files;
_verbose = verbose;
Expand Down Expand Up @@ -1896,7 +1896,7 @@ namespace PR {

std::vector<std::string> ParticleReader::readerTypes
{"PSPout", "PSPspl", "GadgetNative", "GadgetHDF5", "PSPhdf5",
"TipsyNative", "TipsyXDR", "Bonsai"};
"TipsyNative", "TipsyXDR", "Bonsai1", "Bonsai"};


std::vector<std::vector<std::string>>
Expand Down Expand Up @@ -2031,7 +2031,8 @@ namespace PR {
exit(1);
}
#endif

else if (reader.find("Bonsai1") == 0)
ret = std::make_shared<Tipsy>(file, Tipsy::TipsyType::bonsai1, verbose);
else if (reader.find("Bonsai") == 0)
ret = std::make_shared<Tipsy>(file, Tipsy::TipsyType::bonsai, verbose);
else {
Expand Down Expand Up @@ -2071,6 +2072,8 @@ namespace PR {
// Native tipsy with ID conversion
else if (ttype == TipsyType::bonsai)
ps = std::make_shared<TipsyReader::TipsyNative>(file);
else if (ttype == TipsyType::bonsai1)
ps = std::make_shared<TipsyReader::TipsyNative>(file);
// Make a tipsy xdr reader
else {
#ifdef HAVE_XDR
Expand Down Expand Up @@ -2110,6 +2113,8 @@ namespace PR {
ps = std::make_shared<TipsyReader::TipsyNative>(*curfile);
else if (ttype == TipsyType::bonsai)
ps = std::make_shared<TipsyReader::TipsyNative>(*curfile);
else if (ttype == TipsyType::bonsai1)
ps = std::make_shared<TipsyReader::TipsyNative>(*curfile);
else {
#ifdef HAVE_XDR
ps = std::make_shared<TipsyReader::TipsyXDR>(*curfile);
Expand All @@ -2125,7 +2130,7 @@ namespace PR {
}

Tipsy::Tipsy(const std::string& file, TipsyType Type,
bool verbose)
bool verbose) : ParticleReader()
{
ttype = Type;
files.push_back(file);
Expand All @@ -2137,7 +2142,7 @@ namespace PR {
}

Tipsy::Tipsy(const std::vector<std::string>& filelist, TipsyType Type,
bool verbose)
bool verbose) : ParticleReader()
{
files = filelist;

Expand Down Expand Up @@ -2184,7 +2189,8 @@ namespace PR {
P.pos[k] = ps->gas_particles[pcount].pos[k];
P.vel[k] = ps->gas_particles[pcount].vel[k];
}
if (ttype == TipsyType::bonsai) P.indx = ps->gas_particles[pcount].ID();
P.indx = ps->getIndexOffset(TipsyReader::Ptype::gas) + pcount + 1;

pcount++;
return;
}
Expand All @@ -2196,7 +2202,13 @@ namespace PR {
P.pos[k] = ps->dark_particles[pcount].pos[k];
P.vel[k] = ps->dark_particles[pcount].vel[k];
}
if (ttype == TipsyType::bonsai) P.indx = ps->dark_particles[pcount].ID();
if (ttype == TipsyType::bonsai)
P.indx = ps->dark_particles[pcount].ID2();
else if (ttype == TipsyType::bonsai1)
P.indx = ps->dark_particles[pcount].ID();
else
P.indx = ps->getIndexOffset(TipsyReader::Ptype::dark) + pcount + 1;

pcount++;
return;
}
Expand All @@ -2208,7 +2220,13 @@ namespace PR {
P.pos[k] = ps->star_particles[pcount].pos[k];
P.vel[k] = ps->star_particles[pcount].vel[k];
}
if (ttype == TipsyType::bonsai) P.indx = ps->star_particles[pcount].ID();
if (ttype == TipsyType::bonsai)
P.indx = ps->star_particles[pcount].ID2();
else if (ttype == TipsyType::bonsai1)
P.indx = ps->star_particles[pcount].ID();
else
P.indx = ps->getIndexOffset(TipsyReader::Ptype::star) + pcount + 1;

pcount++;
return;
}
Expand Down
1 change: 1 addition & 0 deletions exputil/SLGridMP2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2910,6 +2910,7 @@ void SLGridSlab::compute_table(struct TableSlab* table, int KX, int KY)

if (VERBOSE && iflag[i] != 0) {


if (iflag[i] > -10) {
cout << std::setw(14) << "x"
<< std::setw(25) << "u(x)"
Expand Down
4 changes: 2 additions & 2 deletions include/ParticleReader.H
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ namespace PR
public:

//! Default constructor
PSP(bool verbose) : VERBOSE(verbose) { init(); }
PSP(bool verbose) : VERBOSE(verbose), ParticleReader() { init(); }

//! Destructor
virtual ~PSP() { if (in.is_open()) in.close(); }
Expand Down Expand Up @@ -573,7 +573,7 @@ namespace PR

public:

enum class TipsyType { native, xdr, bonsai };
enum class TipsyType { native, xdr, bonsai1, bonsai };

private:
//! List of files
Expand Down
Loading