Commit f3f52925 authored by jclamber's avatar jclamber

fix temperature for ramses 2D

git-svn-id: http://svn.oamp.fr/repos/unsio/trunk@215 ce2cc22f-6084-46ce-a062-084b172ee5dc
parent a450abe1
1.1.0 (september 2014)
-----------------------
- Ramses: 2D support
1.0.1 (June, 19th 2014)
----------------------------
- Bugs fix release
......
......@@ -336,13 +336,17 @@ int CAmr::loadData(uns::CParticles * particles,
particles->rho.push_back(rho); // rho var(i,ind,1) * scale_nH
particles->load_bits |= RHO_BIT;
}
if (req_bits&TEMP_BIT && nvarh>4) {
float temp= std::max(0.0,var[4*ngrida*twotondim+ind*ngrida+i]/rho);
// with RAMSES 2D simulations, variables from var[] array are shifted to the left
int offset_2d=-1;
if (ndim>2) offset_2d=0;
if (req_bits&TEMP_BIT && nvarh>(4+offset_2d)) {
float temp= std::max(0.0,var[(4+offset_2d)*ngrida*twotondim+ind*ngrida+i]/rho);
particles->temp.push_back(temp);
particles->load_bits |= TEMP_BIT;
}
if (req_bits&METAL_BIT && nvarh>5) {
float metal= var[5*ngrida*twotondim+ind*ngrida+i];
if (req_bits&METAL_BIT && nvarh>(5+offset_2d)) {
float metal= var[(5+offset_2d)*ngrida*twotondim+ind*ngrida+i];
particles->metal.push_back(metal);
particles->load_bits |= METAL_BIT;
}
......
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