Commit a88d2658 authored by jclamber's avatar jclamber

ramses metal in progress

git-svn-id: http://svn.oamp.fr/repos/unsio/trunk@146 ce2cc22f-6084-46ce-a062-084b172ee5dc
parent 8d89293f
......@@ -364,6 +364,11 @@ int CAmr::loadData(uns::CParticles * particles,
particles->metal.push_back(metal);
particles->load_bits |= METAL_BIT;
}
if (req_bits&METAL_BIT && nvarh<=5) {
float metal= 0.0; // we put 0 when no metellicity
particles->metal.push_back(metal);
particles->load_bits |= METAL_BIT;
}
if (take) {
particles->indexes.push_back(0); // GAS particles
particles->ngas++; // One more gas particles
......
......@@ -163,6 +163,10 @@ int CPart::loadData(uns::CParticles * particles,
particles->metal.push_back(metaltmp[k]);
particles->load_bits |= METAL_BIT;
}
if (agetmp[k]==0 && req_bits&METAL_BIT && found_metal) { // stars only (metallicity)
particles->metal.push_back(0.0); // put 0 for dark matter
particles->load_bits |= METAL_BIT;
}
if (take && agetmp[k]!=0) {
particles->indexes.push_back(4); // save star positions
particles->nstars++;
......
......@@ -252,14 +252,17 @@ int CSnapshotRamsesIn::reorderParticles(uns::UserSelection &user_select)
found=true;
mass[istart] = particles->mass[i];
}
#if 1
// metal
if (particles->metal.size()>0 && (icomp==0 || icomp==4)) { // metal for gas or stars
if (!(istart<(int)particles->metal.size())) {
std::cerr << " istart ="<<istart<< " metal.size ="<< particles->metal.size() << "\n";
}
assert(istart<(int)particles->metal.size());
found=true;
metal[istart] = particles->metal[i];
}
#endif
if (found) { // found particles
offset_comp[icomp]++; // update offset
}
......@@ -268,7 +271,9 @@ int CSnapshotRamsesIn::reorderParticles(uns::UserSelection &user_select)
particles->pos=pos;
particles->vel=vel;
particles->mass=mass;
#if 1
particles->metal=metal;
#endif
}
return 1;
}
......
......@@ -102,6 +102,8 @@
nsel=uns_get_array_i(ident,"all","id",id,nbody)
write (0,*) 'ID nsel =',nsel,' id(1)',id(1)
! check if gas component exist
status = uns_get_range(ident,"bndry",n,first,last);
status = uns_get_range(ident,"gas",n,first,last);
if (status.gt.0) then ! prepare gas data for saving
write (0,*) 'Gas ok, n=',n,' first=',first, ' last=',last
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment