Tesllation seems stable with new boundary handling procedure. Rooted out strange adjacency record-keeping due to some galaxies connecting to guard particles. Zobov still generates warning about guard particle encounters, but this is fine for observational datasets because we don't trust the tesselation at the edge galaxies anyway.

This commit is contained in:
Paul M. Sutter 2025-01-16 18:40:54 +08:00
parent 091cf5d1dc
commit 5d93a8a737
8 changed files with 63 additions and 12 deletions

View file

@ -202,6 +202,44 @@ void placeGalaxiesInCube(NYU_VData& data, ParticleData& output_data,
% (1e-2*output_data.box[1][1]) % (1e-2*output_data.box[1][0])
% (1e-2*output_data.box[2][1]) % (1e-2*output_data.box[2][0]) << endl;
/*
// TEST DEBUG
int nNewPerSide = 100;
Position p;
int idx = data.size() + 1;
float xwidth = output_data.box[0][0] - output_data.box[0][1];
float ywidth = output_data.box[1][0] - output_data.box[1][1];
float zwidth = output_data.box[2][0] - output_data.box[2][1];
float dx = xwidth / nNewPerSide;
float dy = ywidth / nNewPerSide;
float dz = zwidth / nNewPerSide;
for (int i = 0; i < nNewPerSide; i++) {
for (int j = 0; j < nNewPerSide; j++) {
for (int k = 0; k < nNewPerSide; k++) {
p.xyz[0] = output_data.box[0][1] + i*dx;
p.xyz[1] = output_data.box[1][1] + j*dy;
p.xyz[2] = output_data.box[2][1] + k*dz;
cout << "INSERT " << p.xyz[0] << ", " << p.xyz[1] << ", " << p.xyz[2] << endl;
cout << "COMPARING " << output_data.pos[i].xyz[0] << endl;
output_data.pos.push_back(p);
output_data.id_gal.push_back(idx);
output_data.ra.push_back(-1);
output_data.dec.push_back(-1);
output_data.redshift.push_back(-1);
output_data.uniqueID.push_back(-1);
idx++;
}
}
}
*/
// END TEST DEBUG
}
void flagEdgeGalaxies(prepObservation_info& args ,
@ -230,8 +268,10 @@ void flagEdgeGalaxies(prepObservation_info& args ,
// write a small text file with galaxy position (for diagnostic purposes)
// TODO - remove this
FILE *fp;
fp = fopen("galaxies.txt", "w");
//for (int i = 0; i < output_data.id_gal.size(); i++) {
for (int i = 0; i < data.size(); i++) {
Position& p = output_data.pos[i];
fprintf(fp, "%e %e %e\n",
@ -326,7 +366,7 @@ void saveForZobov(ParticleData& pdata, const string& fname,
f.writeInt32(pdata.pos.size());
f.endCheckpoint();
cout << format("Saving %d galaxies...") % pdata.pos.size() << endl;
for (int j = 0; j < 3; j++)
{
cout << format("Writing %c components...") % axis[j] << endl;