Exemple #1
0
void CartBlock::clearLists(void)
{
  int i;
  if (donorList) {
  for(i=0;i<ndof;i++) { deallocateLinkList(donorList[i]); donorList[i]=NULL;}
  free(donorList);
  }
  deallocateLinkList4(interpList);
  interpList=NULL;
}
Exemple #2
0
//
// destructor that deallocates all the
// the dynamic objects inside
//
MeshBlock::~MeshBlock()
{
  int i;
  //
  // free all data that is owned by this MeshBlock
  // i.e not the pointers of the external code.
  //
  if (cellRes) free(cellRes);
  if (nodeRes) free(nodeRes);
  if (elementBbox) free(elementBbox);
  if (elementList) free(elementList);
  if (adt) delete[] adt;
  if (donorList) {
    for(i=0;i<nnodes;i++) deallocateLinkList(donorList[i]);
    free(donorList);
  }
  if (interpList) {
    for(i=0;i<ninterp;i++)
      {
	free(interpList[i].inode);
	free(interpList[i].weights);
      }
    free(interpList);
  }
  if (interpList2) {
    for(i=0;i<ninterp2;i++)
      {
	free(interpList2[i].inode);
	free(interpList2[i].weights);
      }
    free(interpList2);
  }
  if (!ihigh) {
   if (iblank_cell) free(iblank_cell);
  }
  if (obb) free(obb);
  if (isearch) free(isearch);
  if (xsearch) free(xsearch);
  if (rst) free(rst);
  if (interp2donor) free(interp2donor);
  if (cancelList) deallocateLinkList2(cancelList);
  if (ctag) free(ctag);
  if (pointsPerCell) free(pointsPerCell);
  if (rxyz) free(rxyz);
  if (picked) free(picked);
  // need to add code here for other objects as and
  // when they become part of MeshBlock object  
};