Commit d8ce4670 authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles

debugging ramses gravity

parent 8c896c93
Pipeline #284 skipped
......@@ -288,7 +288,7 @@ template <class T> int CAmr::loadData(uns::CParticles<T> * particles,
// Read grid center
//
for (int idim=0;idim<ndim;idim++) {
if (j==icpu) {
if (j==icpu && ngrida>0) {
amr.readDataBlock((char *) &xg[idim*ngrida]);
}
else amr.skipBlock();
......@@ -299,7 +299,7 @@ template <class T> int CAmr::loadData(uns::CParticles<T> * particles,
// Read son index
//
for (int ind=0;ind<twotondim;ind++) {
if (j==icpu) {
if (j==icpu&& ngrida>0) {
amr.readDataBlock((char *) &son[ind*ngrida]);
}
else amr.skipBlock();
......@@ -315,7 +315,7 @@ template <class T> int CAmr::loadData(uns::CParticles<T> * particles,
// Read hydro variables
for (int ind=0;ind<twotondim;ind++) {
for (int ivar=0; ivar<nvarh; ivar++) {
if (j==icpu) {
if (j==icpu&& ngrida>0) {
hydro.readDataBlock((char *) &var[ivar*ngrida*twotondim+ind*ngrida]);
}
else hydro.skipBlock();
......@@ -331,7 +331,7 @@ template <class T> int CAmr::loadData(uns::CParticles<T> * particles,
// Read grav variables
for (int ind=0;ind<twotondim;ind++) {
for (int ivar=0; ivar<nvarg; ivar++) {
if (j==icpu) {
if (j==icpu&& ngrida>0) {
grav.readDataBlock((char *) &varg[ivar*ngrida*twotondim+ind*ngrida]);
}
else grav.skipBlock();
......@@ -473,8 +473,12 @@ template <class T> int CAmr::loadData(uns::CParticles<T> * particles,
delete [] xg;
//delete [] x;
delete [] son;
if (!count_only)
if (!count_only) {
delete [] var;
if (is_gravity && (req_bits&POT_BIT || req_bits&ACC_BIT)) {
delete [] varg;
}
}
}
}
} // ilevel
......
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