/[escript]/branches/doubleplusgood/finley/src/BasisFunctions.cpp
ViewVC logotype

Diff of /branches/doubleplusgood/finley/src/BasisFunctions.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4326 by jfenwick, Wed Feb 27 06:09:33 2013 UTC revision 4327 by jfenwick, Wed Mar 20 05:09:11 2013 UTC
# Line 430  Finley_ReferenceElement* Finley_Referenc Line 430  Finley_ReferenceElement* Finley_Referenc
430        
431    /*  allocate the Finley_ReferenceElement to be returned: */    /*  allocate the Finley_ReferenceElement to be returned: */
432        
433    out=MEMALLOC(1,Finley_ReferenceElement);    out=new Finley_ReferenceElement;
434    if (Finley_checkPtr(out)) return NULL;    if (Finley_checkPtr(out)) return NULL;
435    out->Type=&(Finley_ReferenceElement_InfoList[id]);    out->Type=&(Finley_ReferenceElement_InfoList[id]);
436    out->numQuadNodes=numQuadNodes;    out->numQuadNodes=numQuadNodes;
# Line 443  Finley_ReferenceElement* Finley_Referenc Line 443  Finley_ReferenceElement* Finley_Referenc
443        
444    Ndim=Finley_ReferenceElement_InfoList[id].numDim;    Ndim=Finley_ReferenceElement_InfoList[id].numDim;
445    NS=Finley_ReferenceElement_InfoList[id].numShapes;    NS=Finley_ReferenceElement_InfoList[id].numShapes;
446    out->QuadNodes=MEMALLOC(numQuadNodes*Ndim,double);    out->QuadNodes=new double[numQuadNodes*Ndim];
447    out->QuadWeights=MEMALLOC(numQuadNodes,double);    out->QuadWeights=new double[numQuadNodes];
448    out->S=MEMALLOC(NS*numQuadNodes,double);    out->S=new double[NS*numQuadNodes];
449    out->dSdv=MEMALLOC(NS*Ndim*numQuadNodes,double);    out->dSdv=new double[NS*Ndim*numQuadNodes];
450    if ( Finley_checkPtr(out->QuadNodes) || Finley_checkPtr(out->QuadWeights) || Finley_checkPtr(out->S) || Finley_checkPtr(out->dSdv) ) {    if ( Finley_checkPtr(out->QuadNodes) || Finley_checkPtr(out->QuadWeights) || Finley_checkPtr(out->S) || Finley_checkPtr(out->dSdv) ) {
451           Finley_ReferenceElement_dealloc(out);           Finley_ReferenceElement_dealloc(out);
452           return NULL;           return NULL;
# Line 483  void Finley_ReferenceElement_dealloc(Fin Line 483  void Finley_ReferenceElement_dealloc(Fin
483       #ifdef Finley_TRACE       #ifdef Finley_TRACE
484       printf("reference element %s is deallocated.\n",in->Type->Name);       printf("reference element %s is deallocated.\n",in->Type->Name);
485       #endif       #endif
486       MEMFREE(in->QuadNodes);       delete[] in->QuadNodes;
487       MEMFREE(in->QuadWeights);       delete[] in->QuadWeights;
488       MEMFREE(in->S);       delete[] in->S;
489       MEMFREE(in->dSdv);       delete[] in->dSdv;
490       MEMFREE(in);       delete in;
491    }    }
492  }  }
493    

Legend:
Removed from v.4326  
changed lines
  Added in v.4327

  ViewVC Help
Powered by ViewVC 1.1.26