Changeset 24463


Ignore:
Timestamp:
12/10/19 12:49:10 (5 years ago)
Author:
Mathieu Morlighem
Message:

CHG: faster output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Elements/Element.cpp

    r24434 r24463  
    32163216void       Element::ResultToVector(Vector<IssmDouble>* vector,int output_enum){/*{{{*/
    32173217
     3218        int MAXVERTICES = 6;
     3219        IssmDouble values[MAXVERTICES];
     3220        int        connectivity[MAXVERTICES];
     3221        int        sidlist[MAXVERTICES];
     3222
    32183223        switch(this->inputs2->GetInputObjectEnum(output_enum)){
    32193224                case TriaInput2Enum:
     
    32373242                                        const int NUM_VERTICES = this->GetNumberOfVertices();
    32383243
    3239                                         IssmDouble *values      = xNew<IssmDouble>(NUM_VERTICES);
    3240                                         int        *connectivity= xNew<int>(NUM_VERTICES);
    3241                                         int        *sidlist     = xNew<int>(NUM_VERTICES);
    3242 
    3243                                         this->GetVerticesSidList(sidlist);
    3244                                         this->GetVerticesConnectivityList(connectivity);
    3245                                         this->GetInputListOnVertices(values,output_enum);
     3244
     3245
     3246                                        this->GetVerticesSidList(&sidlist[0]);
     3247                                        this->GetVerticesConnectivityList(&connectivity[0]);
     3248                                        this->GetInputListOnVertices(&values[0],output_enum);
    32463249                                        for(int i=0;i<NUM_VERTICES;i++) values[i] = values[i]/reCast<IssmDouble>(connectivity[i]);
    3247 
    32483250                                        vector->SetValues(NUM_VERTICES,sidlist,values,ADD_VAL);
    3249 
    3250                                         xDelete<IssmDouble>(values);
    3251                                         xDelete<int>(connectivity);
    3252                                         xDelete<int>(sidlist);
    32533251                                        break;
    32543252                                        }
Note: See TracChangeset for help on using the changeset viewer.