void eamDestroy(BasePotential** pPot) { if ( ! pPot ) return; EamPotential* pot = *(EamPotential**)pPot; if ( ! pot ) return; destroyInterpolationObject(&(pot->phi)); destroyInterpolationObject(&(pot->rho)); destroyInterpolationObject(&(pot->f)); destroyHaloExchange(&(pot->forceExchange)); comdFree(pot); *pPot = NULL; return; }
/// frees all data associated with *ps and frees *ps void destroySimulation(SimFlat** ps) { if ( ! ps ) return; SimFlat* s = *ps; if ( ! s ) return; BasePotential* pot = s->pot; if ( pot) pot->destroy(&pot); destroyLinkCells(&(s->boxes)); destroyAtoms(s->atoms); destroyHaloExchange(&(s->atomExchange)); comdFree(s->species); comdFree(s->domain); comdFree(s); *ps = NULL; return; }
/// frees all data associated with *ps and frees *ps void destroySimulation(SimFlat** ps) { if ( ! ps ) return; SimFlat* s = *ps; if ( ! s ) return; BasePotential* pot = s->pot; //if ( pot)//UNCOMMENT pot->destroy(&pot); free(pot);//???? destroyLinkCells(&(s->boxes)); destroyAtoms(s->atoms); destroyHaloExchange(&(s->atomExchange)); free(s->atoms); comdFree(s); *ps = NULL; return; }