Changeset 23628
- Timestamp:
- 01/11/19 21:22:50 (6 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Node.cpp
r23627 r23628 756 756 } 757 757 /*}}}*/ 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){/*{{{*/758 void Node::VecMerge(Vector<IssmDouble>* ug,IssmDouble* local_uf,int* indices_uf,IssmDouble* local_ys,int* indices_ys){/*{{{*/ 759 759 760 760 /*Only perform operation if not clone*/ 761 761 if(this->IsClone()) return; 762 763 /*Recover indices*/764 int ind_uf = *pindex_uf;765 int ind_ys = *pindex_ys;766 762 767 763 if(this->fsize){ … … 773 769 if(this->f_set[i]){ 774 770 _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]]; 778 774 indices[count]=this->gdoflist[i]; 779 775 count++; 780 ind_uf++;781 776 } 782 777 } 783 778 ug->SetValues(this->fsize,indices,values,INS_VAL); 784 /*Free ressources:*/ 779 785 780 xDelete<IssmDouble>(values); 786 781 xDelete<int>(indices); … … 794 789 if(this->s_set[i]){ 795 790 _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]]; 799 794 indices[count]=this->gdoflist[i]; 800 795 count++; 801 ind_ys++;802 796 } 803 797 } 804 798 ug->SetValues(this->ssize,indices,values,INS_VAL); 805 /*Free ressources:*/799 806 800 xDelete<IssmDouble>(values); 807 801 xDelete<int>(indices); 808 802 } 809 810 /*Update index values*/811 *pindex_uf = ind_uf;812 *pindex_ys = ind_ys;813 803 } 814 804 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Node.h
r23627 r23628 105 105 int Sid(void); 106 106 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); 108 108 void VecReduce(Vector<IssmDouble>* vector, IssmDouble* ug_serial,int setnum); 109 109 void SetApproximation(int in_approximation); -
issm/trunk-jpl/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp
r23602 r23628 18 18 /*serialize uf and ys: those two vectors will be indexed by the nodes, who are the only ones 19 19 *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); 25 21 26 22 /*Get local vectors ys and uf*/ … … 36 32 37 33 /*Let nodes figure it out*/ 38 int index_uf = 0;39 int index_ys = 0;40 34 for(int i=0;i<nodes->Size();i++){ 41 35 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); 43 37 } 44 38
Note:
See TracChangeset
for help on using the changeset viewer.