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

Diff of /branches/doubleplusgood/finley/src/ShapeFunctions.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 75  Finley_ShapeFunction* Finley_ShapeFuncti Line 75  Finley_ShapeFunction* Finley_ShapeFuncti
75            
76      /*  allocate the Finley_ShapeFunction to be returned: */      /*  allocate the Finley_ShapeFunction to be returned: */
77        
78      out=MEMALLOC(1,Finley_ShapeFunction);      out=new Finley_ShapeFunction;
79      if (Finley_checkPtr(out)) return NULL;      if (Finley_checkPtr(out)) return NULL;
80    
81        
# Line 89  Finley_ShapeFunction* Finley_ShapeFuncti Line 89  Finley_ShapeFunction* Finley_ShapeFuncti
89        
90      /*  allocate memory: */      /*  allocate memory: */
91        
92      out->QuadNodes=MEMALLOC(numQuadNodes*numDim,double);      out->QuadNodes=new double[numQuadNodes*numDim];
93      out->QuadWeights=MEMALLOC(numQuadNodes,double);      out->QuadWeights=new double[numQuadNodes];
94      out->S=MEMALLOC(numShapes*numQuadNodes,double);      out->S=new double[numShapes*numQuadNodes];
95      out->dSdv=MEMALLOC(numShapes*numDim*numQuadNodes,double);      out->dSdv=new double[numShapes*numDim*numQuadNodes];
96      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) ) {
97           Finley_ShapeFunction_dealloc(out);           Finley_ShapeFunction_dealloc(out);
98           return NULL;           return NULL;
# Line 130  void Finley_ShapeFunction_dealloc(Finley Line 130  void Finley_ShapeFunction_dealloc(Finley
130    if (in!=NULL) {    if (in!=NULL) {
131        in->reference_counter--;        in->reference_counter--;
132        if (in->reference_counter<1) {        if (in->reference_counter<1) {
133            MEMFREE(in->QuadNodes);            delete[] in->QuadNodes;
134            MEMFREE(in->QuadWeights);            delete[] in->QuadWeights;
135            MEMFREE(in->S);            delete[] in->S;
136            MEMFREE(in->dSdv);            delete[] in->dSdv;
137            MEMFREE(in);            delete in;
138        }        }
139    }    }
140  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26