Changeset 23628


Ignore:
Timestamp:
01/11/19 21:22:50 (6 years ago)
Author:
Mathieu Morlighem
Message:

CHG: simplyfied VecMerge now that we have local indices

Location:
issm/trunk-jpl/src/c
Files:
3 edited

Legend:

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

    r23627 r23628  
    756756}
    757757/*}}}*/
    758 void Node::VecMerge(Vector<IssmDouble>* ug,IssmDouble* local_uf,int* indices_uf,int* pindex_uf,IssmDouble* local_ys,int* indices_ys,int* pindex_ys){/*{{{*/
     758void Node::VecMerge(Vector<IssmDouble>* ug,IssmDouble* local_uf,int* indices_uf,IssmDouble* local_ys,int* indices_ys){/*{{{*/
    759759
    760760        /*Only perform operation if not clone*/
    761761        if(this->IsClone()) return;
    762 
    763         /*Recover indices*/
    764         int ind_uf = *pindex_uf;
    765         int ind_ys = *pindex_ys;
    766762
    767763        if(this->fsize){
     
    773769                        if(this->f_set[i]){
    774770                                _assert_(local_uf);
    775                                 _assert_(this->fdoflist[count]==indices_uf[ind_uf]);
    776 
    777                                 values[count]=local_uf[ind_uf];
     771                                _assert_(this->fdoflist[count]==indices_uf[this->fdoflist_local[count]]);
     772
     773                                values[count] =local_uf[this->fdoflist_local[count]];
    778774                                indices[count]=this->gdoflist[i];
    779775                                count++;
    780                                 ind_uf++;
    781776                        }
    782777                }
    783778                ug->SetValues(this->fsize,indices,values,INS_VAL);
    784                 /*Free ressources:*/
     779
    785780                xDelete<IssmDouble>(values);
    786781                xDelete<int>(indices);
     
    794789                        if(this->s_set[i]){
    795790                                _assert_(local_ys);
    796                                 _assert_(this->sdoflist[count]==indices_ys[ind_ys]);
    797 
    798                                 values[count]=local_ys[ind_ys];
     791                                _assert_(this->sdoflist[count]==indices_ys[this->sdoflist_local[count]]);
     792
     793                                values[count] =local_ys[this->sdoflist_local[count]];
    799794                                indices[count]=this->gdoflist[i];
    800795                                count++;
    801                                 ind_ys++;
    802796                        }
    803797                }
    804798                ug->SetValues(this->ssize,indices,values,INS_VAL);
    805                 /*Free ressources:*/
     799               
    806800                xDelete<IssmDouble>(values);
    807801                xDelete<int>(indices);
    808802        }
    809 
    810         /*Update index values*/
    811         *pindex_uf = ind_uf;
    812         *pindex_ys = ind_ys;
    813803}
    814804/*}}}*/
  • issm/trunk-jpl/src/c/classes/Node.h

    r23627 r23628  
    105105                int   Sid(void);
    106106                void  UpdateCloneDofs(int* alltruerows,int setenum);
    107                 void  VecMerge(Vector<IssmDouble>* ug,IssmDouble* local_uf,int* indices_uf,int* pindex_uf,IssmDouble* local_ys,int* indices_ys,int* pindex_ys);
     107                void  VecMerge(Vector<IssmDouble>* ug,IssmDouble* local_uf,int* indices_uf,IssmDouble* local_ys,int* indices_ys);
    108108                void  VecReduce(Vector<IssmDouble>* vector, IssmDouble* ug_serial,int setnum);
    109109                void  SetApproximation(int in_approximation);
  • issm/trunk-jpl/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp

    r23602 r23628  
    1818        /*serialize uf and ys: those two vectors will be indexed by the nodes, who are the only ones
    1919         *that know which values should be plugged into ug and where: */
    20         if(ssize){
    21                 if(flag_ys0){
    22                         ys->Set(0.0);
    23                 }
    24         }
     20        if(ssize) if(flag_ys0) ys->Set(0.0);
    2521
    2622        /*Get local vectors ys and uf*/
     
    3632
    3733        /*Let nodes figure it out*/
    38         int index_uf = 0;
    39         int index_ys = 0;
    4034        for(int i=0;i<nodes->Size();i++){
    4135                Node* node=(Node*)nodes->GetObjectByOffset(i);
    42                 node->VecMerge(ug,local_uf,indices_uf,&index_uf,local_ys,indices_ys,&index_ys);
     36                node->VecMerge(ug,local_uf,indices_uf,local_ys,indices_ys);
    4337        }
    4438
Note: See TracChangeset for help on using the changeset viewer.