Changeset 3464


Ignore:
Timestamp:
04/08/10 10:00:48 (15 years ago)
Author:
Eric.Larour
Message:

New CreatePartitionVector abstract method for DofObject objects.

Location:
issm/trunk/src/c
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/DataSet/DataSet.cpp

    r3463 r3464  
    885885/*}}}*/
    886886/*FUNCTION DataSet::CreatePartitioningVector{{{1*/
    887 void  DataSet::CreatePartitioningVector(Vec* ppartition,int numberofnodes,int numdofspernode){
     887void  DataSet::CreatePartitioningVector(Vec* ppartition,int numberofobjects){
    888888
    889889        /*output: */
    890890        Vec partition=NULL;
    891891        vector<Object*>::iterator object;
    892         Node* node=NULL;
     892        DofObject* dofobject=NULL;
    893893
    894894        /*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: */
    905903                if((*object)->Enum()==NodeEnum()){
    906904
    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);
    912907                }
    913908        }
     
    919914        /*Assign output pointers: */
    920915        *ppartition=partition;
    921 
    922         return;
    923916}
    924917/*}}}*/
  • issm/trunk/src/c/DataSet/DataSet.h

    r3454 r3464  
    5959                void  Ranks(int* ranks);
    6060                void  DistributeDofs(int numberofnodes,int numdofspernode);
    61                 void  CreatePartitioningVector(Vec* ppartition,int numnods,int numdofspernode);
     61                void  CreatePartitioningVector(Vec* ppartition,int numobjects);
    6262                void  DistributeNumDofs(int** pnumdofspernode,int numberofnodes,int analysis_type,int sub_analysis_type);
    6363                void  FlagClones(int numberofnodes);
  • issm/trunk/src/c/Dofx/Dofx.cpp

    r3463 r3464  
    5555
    5656        /*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);
    5858
    5959        /*Transpose partition into tpartition: */
  • issm/trunk/src/c/objects/DofObject.h

    r3463 r3464  
    1818                virtual void  UpdateCloneDofs(int* allborderdofs)=0;
    1919                virtual void  SetClone(int* minranks)=0;
     20                virtual void  CreatePartition(Vec partition)=0;
    2021
    2122};
  • issm/trunk/src/c/objects/Node.cpp

    r3463 r3464  
    408408}
    409409/*}}}*/
    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 /*}}}*/
    425410/*FUNCTION Node CreateVecSets {{{2*/
    426411void  Node::CreateVecSets(Vec pv_g,Vec pv_m,Vec pv_n,Vec pv_f,Vec pv_s){
     
    914899}
    915900/*}}}*/
    916 /*}}}*/
     901/*FUNCTION Node CreatePartition{{{2*/
     902void  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  
    6363                /*}}}*/
    6464                /*FUNCTION numerical routines {{{1*/
    65                 void  CreatePartition(Vec partition);
    6665                int   GetNumberOfDofs();
    6766                int   IsClone();
     
    9695                void  UpdateCloneDofs(int* allborderdofs);
    9796                void  SetClone(int* minranks);
     97                void  CreatePartition(Vec partition);
    9898                /*}}}*/
    9999};
  • issm/trunk/src/c/objects/Vertex.cpp

    r3463 r3464  
    298298}
    299299/*}}}*/
    300 /*}}}*/
     300/*FUNCTION Vertex CreatePartition{{{2*/
     301void  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  
    5757                void  UpdateCloneDofs(int* allborderdofs);
    5858                void  SetClone(int* minranks);
     59                void  CreatePartition(Vec partition);
    5960                /*}}}*/
    6061
Note: See TracChangeset for help on using the changeset viewer.