Changeset 22282


Ignore:
Timestamp:
11/30/17 09:15:05 (7 years ago)
Author:
bdef
Message:

BUG: fixing leaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp

    r22281 r22282  
    333333                switch(input->ObjectEnum()){
    334334                case TriaInputEnum:{
    335                         TriaInput* triainput = xDynamicCast<TriaInput*>(this->inputs->GetObjectByOffset(i)); _assert_(triainput);
    336                         numnodes= triainput->NumberofNodes(triainput->interpolation_type);
    337                         values=xNewZeroInit<IssmDouble>(numnodes);
     335                        TriaInput* triainput = (TriaInput*)this->inputs->GetObjectByOffset(i); _assert_(triainput);
     336                        if(i==0){
     337                                numnodes= triainput->NumberofNodes(triainput->interpolation_type);
     338                                values=xNewZeroInit<IssmDouble>(numnodes);
     339                        }
    338340                        /*Sum the values weighted by their respective sub-timestep*/
    339341                        for(int j=0;j<numnodes;j++){
     
    343345                }
    344346                case PentaInputEnum:{
    345                         PentaInput*     pentainput = xDynamicCast<PentaInput*>(this->inputs->GetObjectByOffset(i)); _assert_(pentainput);
    346                         numnodes= pentainput->NumberofNodes(pentainput->interpolation_type);
    347                         values=xNewZeroInit<IssmDouble>(numnodes);
     347                        PentaInput*     pentainput = (PentaInput*)this->inputs->GetObjectByOffset(i); _assert_(pentainput);
     348                        if(i==0){
     349                                numnodes= pentainput->NumberofNodes(pentainput->interpolation_type);
     350                                values=xNewZeroInit<IssmDouble>(numnodes);
     351                        }
    348352                        /*Sum the values weighted by their respective sub-timestep*/
    349353                        for(int j=0;j<numnodes;j++){
     
    353357                }
    354358                case TetraInputEnum:{
    355                         TetraInput*     tetrainput = xDynamicCast<TetraInput*>(this->inputs->GetObjectByOffset(i)); _assert_(tetrainput);
    356                         numnodes= tetrainput->NumberofNodes(tetrainput->interpolation_type);
    357                         values=xNewZeroInit<IssmDouble>(numnodes);
     359                        TetraInput*     tetrainput = (TetraInput*)this->inputs->GetObjectByOffset(i); _assert_(tetrainput);
     360                        if(i==0){
     361                                numnodes= tetrainput->NumberofNodes(tetrainput->interpolation_type);
     362                                values=xNewZeroInit<IssmDouble>(numnodes);
     363                        }
    358364                        /*Sum the values weighted by their respective sub-timestep*/
    359365                        for(int j=0;j<numnodes;j++){
Note: See TracChangeset for help on using the changeset viewer.