Changeset 3464
- Timestamp:
- 04/08/10 10:00:48 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/DataSet/DataSet.cpp
r3463 r3464 885 885 /*}}}*/ 886 886 /*FUNCTION DataSet::CreatePartitioningVector{{{1*/ 887 void DataSet::CreatePartitioningVector(Vec* ppartition,int numberof nodes,int numdofspernode){887 void DataSet::CreatePartitioningVector(Vec* ppartition,int numberofobjects){ 888 888 889 889 /*output: */ 890 890 Vec partition=NULL; 891 891 vector<Object*>::iterator object; 892 Node* node=NULL;892 DofObject* dofobject=NULL; 893 893 894 894 /*Create partition vector: */ 895 partition=NewVec(numberofnodes); 896 897 /*Go through all nodes, and ask each node to plug its 1D doflist in 898 * partition. The location where each node plugs its doflist into 899 * partition is determined by its (id-1)*3 (ie, serial * organisation of the dofs). 900 */ 901 902 for ( object=objects.begin() ; object < objects.end(); object++ ){ 903 904 /*Check this is a node: */ 895 partition=NewVec(numberofobjects); 896 897 /*Go through all objects, and ask each object to plug its doflist in 898 * partition: */ 899 900 for ( object=objects.begin() ; object < objects.end(); object++ ){ 901 902 /*Check this is a object: */ 905 903 if((*object)->Enum()==NodeEnum()){ 906 904 907 node=(Node*)(*object); 908 909 /*Ok, this object is a node, ask it to plug values into partition: */ 910 node->CreatePartition(partition); 911 905 dofobject=(DofObject*)(*object); 906 dofobject->CreatePartition(partition); 912 907 } 913 908 } … … 919 914 /*Assign output pointers: */ 920 915 *ppartition=partition; 921 922 return;923 916 } 924 917 /*}}}*/ -
issm/trunk/src/c/DataSet/DataSet.h
r3454 r3464 59 59 void Ranks(int* ranks); 60 60 void DistributeDofs(int numberofnodes,int numdofspernode); 61 void CreatePartitioningVector(Vec* ppartition,int num nods,int numdofspernode);61 void CreatePartitioningVector(Vec* ppartition,int numobjects); 62 62 void DistributeNumDofs(int** pnumdofspernode,int numberofnodes,int analysis_type,int sub_analysis_type); 63 63 void FlagClones(int numberofnodes); -
issm/trunk/src/c/Dofx/Dofx.cpp
r3463 r3464 55 55 56 56 /*Now that dofs have been distributed, create partitioning vector and its transpose: */ 57 nodes->CreatePartitioningVector(&partition->vector,numberofnodes,numberofdofspernode);57 vertices->CreatePartitioningVector(&partition->vector,numberofvertices); 58 58 59 59 /*Transpose partition into tpartition: */ -
issm/trunk/src/c/objects/DofObject.h
r3463 r3464 18 18 virtual void UpdateCloneDofs(int* allborderdofs)=0; 19 19 virtual void SetClone(int* minranks)=0; 20 virtual void CreatePartition(Vec partition)=0; 20 21 21 22 }; -
issm/trunk/src/c/objects/Node.cpp
r3463 r3464 408 408 } 409 409 /*}}}*/ 410 /*FUNCTION Node CreatePartition{{{2*/411 void Node::CreatePartition(Vec partition){412 413 int idxm;414 double value;415 416 idxm=(id-1);417 value=(double)this->GetVertexDof();418 ISSMASSERT(value>=0);419 420 VecSetValues(partition,1,&idxm,&value,INSERT_VALUES);421 422 return;423 }424 /*}}}*/425 410 /*FUNCTION Node CreateVecSets {{{2*/ 426 411 void Node::CreateVecSets(Vec pv_g,Vec pv_m,Vec pv_n,Vec pv_f,Vec pv_s){ … … 914 899 } 915 900 /*}}}*/ 916 /*}}}*/ 901 /*FUNCTION Node CreatePartition{{{2*/ 902 void Node::CreatePartition(Vec partition){ 903 904 int idxm; 905 double value; 906 907 idxm=(id-1); 908 value=(double)this->indexing.doflist[0]; 909 ISSMASSERT(value>=0); 910 911 VecSetValues(partition,1,&idxm,&value,INSERT_VALUES); 912 913 return; 914 } 915 /*}}}*/ 916 /*}}}*/ -
issm/trunk/src/c/objects/Node.h
r3463 r3464 63 63 /*}}}*/ 64 64 /*FUNCTION numerical routines {{{1*/ 65 void CreatePartition(Vec partition);66 65 int GetNumberOfDofs(); 67 66 int IsClone(); … … 96 95 void UpdateCloneDofs(int* allborderdofs); 97 96 void SetClone(int* minranks); 97 void CreatePartition(Vec partition); 98 98 /*}}}*/ 99 99 }; -
issm/trunk/src/c/objects/Vertex.cpp
r3463 r3464 298 298 } 299 299 /*}}}*/ 300 /*}}}*/ 300 /*FUNCTION Vertex CreatePartition{{{2*/ 301 void Vertex::CreatePartition(Vec partition){ 302 303 int idxm; 304 double value; 305 306 idxm=(id-1); 307 value=(double)this->dof; 308 ISSMASSERT(value>=0); 309 310 VecSetValues(partition,1,&idxm,&value,INSERT_VALUES); 311 312 return; 313 } 314 /*}}}*/ 315 /*}}}*/ -
issm/trunk/src/c/objects/Vertex.h
r3463 r3464 57 57 void UpdateCloneDofs(int* allborderdofs); 58 58 void SetClone(int* minranks); 59 void CreatePartition(Vec partition); 59 60 /*}}}*/ 60 61
Note:
See TracChangeset
for help on using the changeset viewer.