Changeset 4140


Ignore:
Timestamp:
06/23/10 07:50:02 (15 years ago)
Author:
Eric.Larour
Message:

New sid in the two objects

Location:
issm/trunk/src/c/objects
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Node.cpp

    r4118 r4140  
    2727/*}}}*/
    2828/*FUNCTION Node::Node(int id, int vertex_id, int uppernode_id, int numdofs, NodeProperties*) {{{2*/
    29 Node::Node(int node_id,int node_vertex_id, int node_upper_node_id, int node_numdofs):
     29Node::Node(int node_id,int node_sid, int node_vertex_id, int node_upper_node_id, int node_numdofs):
    3030        indexing(node_numdofs),
    3131    hvertex(&node_vertex_id,1),
     
    3333
    3434        this->id=node_id;
     35        this->sid=node_sid;
    3536        this->inputs=new Inputs();
    3637}
    3738/*}}}*/
    3839/*FUNCTION Node::Node(int id, DofIndexing* indexing, Hook* vertex, Hook* uppernode,Inputs* inputs,int analysis_type){{{2*/
    39 Node::Node(int node_id,DofIndexing* node_indexing, Hook* node_vertex, Hook* node_upper_node,Inputs* node_inputs,int analysis_type):
     40Node::Node(int node_id,int node_sid, DofIndexing* node_indexing, Hook* node_vertex, Hook* node_upper_node,Inputs* node_inputs,int analysis_type):
    4041            indexing(node_indexing),
    4142                hvertex(node_vertex),
     
    4445            /*all the initialization has been done by the initializer, just fill in the id: */
    4546            this->id=node_id;
     47            this->sid=node_sid;
    4648                this->analysis_type=analysis_type;
    4749
     
    5557/*}}}*/
    5658/*FUNCTION Node::Node(int node_id,int vertex_id,int io_index, IoModel* iomodel,int analysis_type) {{{2*/
    57 Node::Node(int node_id,int vertex_id,int io_index, IoModel* iomodel,int analysis_type){
     59Node::Node(int node_id,int node_sid,int vertex_id,int io_index, IoModel* iomodel,int analysis_type){
    5860
    5961        /*Intermediary*/
     
    6365
    6466        /*id: */
    65         this->id=node_id; //matlab indexing
     67        this->id=node_id;
     68        this->sid=node_sid;
    6669        this->analysis_type=analysis_type;
    6770
     
    188191Object* Node::copy() {
    189192               
    190         return new Node(this->id,&this->indexing, &this->hvertex,&this->hupper_node,this->inputs,this->analysis_type);
     193        return new Node(this->id,this->sid,&this->indexing, &this->hvertex,&this->hupper_node,this->inputs,this->analysis_type);
    191194
    192195}
     
    198201        printf("Node:\n");
    199202        printf("   id: %i\n",id);
     203        printf("   sid: %i\n",sid);
    200204        printf("   analysis_type: %s\n",EnumAsString(analysis_type));
    201205        indexing.DeepEcho();
     
    222226
    223227        memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
     228        memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
    224229        memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    225230       
     
    242247        printf("Node:\n");
    243248        printf("   id: %i\n",id);
     249        printf("   sid: %i\n",sid);
    244250        printf("   analysis_type: %s\n",EnumAsString(analysis_type));
    245251        indexing.Echo();
     
    290296int    Node::Id(void){ return id; }
    291297/*}}}*/
     298/*FUNCTION Node::Sid{{{2*/
     299int    Node::Sid(void){ return sid; }
     300/*}}}*/
    292301/*FUNCTION Node::GetVertexId {{{2*/
    293302int   Node::GetVertexId(void){
     
    327336        /*marshall Node data: */
    328337        memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
     338        memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
    329339        memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    330340       
     
    351361
    352362        return sizeof(id)+
     363                sizeof(sid)+
    353364                indexing.MarshallSize()+
    354365                hvertex.MarshallSize()+
  • issm/trunk/src/c/objects/Node.h

    r4117 r4140  
    2222        private:
    2323
    24                 int         id;
     24                int         id;  //unique arbitrary id.
     25                int     sid; //sid for "serial" id, ie the rank of this node in the nodes dataset, if the dataset was serial on 1 cpu.
    2526                               
    2627                DofIndexing    indexing;
     
    3435                /*FUNCTION constructors, destructors {{{1*/
    3536                Node();
    36                 Node(int id,int vertex_id, int upper_node_id, int numberofdofs);
    37                 Node(int id,DofIndexing* indexing, Hook* vertex, Hook* upper_node, Inputs* inputs,int analysis_type);
    38                 Node(int node_id,int vertex_id,int io_index, IoModel* iomodel,int analysis_type);
     37                Node(int id,int sid, int vertex_id, int upper_node_id, int numberofdofs);
     38                Node(int id,ind sid, DofIndexing* indexing, Hook* vertex, Hook* upper_node, Inputs* inputs,int analysis_type);
     39                Node(int node_id,int node_sid, int vertex_id,int io_index, IoModel* iomodel,int analysis_type);
    3940                ~Node();
    4041                /*}}}*/
     
    4647                int   Enum();
    4748                int   Id(void);
     49                int   Sid(void);
    4850                int   GetVertexDof(void);
    4951                int   GetVertexId(void);
  • issm/trunk/src/c/objects/Vertex.cpp

    r4091 r4140  
    2424/*}}}*/
    2525/*FUNCTION Vertex::Vertex(int vertex_id, double vertex_x, double vertex_y, double vertex_z, double vertex_sigma){{{2*/
    26 Vertex::Vertex(int vertex_id, double vertex_x, double vertex_y, double vertex_z, double vertex_sigma){
    27         this->Init(vertex_id, vertex_x, vertex_y, vertex_z, vertex_sigma);
     26Vertex::Vertex(int vertex_id, int vertex_sid,double vertex_x, double vertex_y, double vertex_z, double vertex_sigma){
     27        this->Init(vertex_id, vertex_sid,vertex_x, vertex_y, vertex_z, vertex_sigma);
    2828}
    2929/*}}}*/
    3030/*FUNCTION Vertex::Init{{{2*/
    31 void Vertex::Init(int vertex_id, double vertex_x, double vertex_y, double vertex_z, double vertex_sigma){
     31void Vertex::Init(int vertex_id, int vertex_sid,double vertex_x, double vertex_y, double vertex_z, double vertex_sigma){
    3232
    3333        /*all the initialization has been done by the initializer, just fill in the id: */
    3434        this->id=vertex_id;
     35        this->sid=vertex_sid;
    3536        this->x=vertex_x;
    3637        this->y=vertex_y;
     
    4243}
    4344/*}}}*/
    44 /*FUNCTION Vertex::Vertex(int vertex_id, int i, IoModel* iomodel) {{{2*/
    45 Vertex::Vertex(int vertex_id, int i, IoModel* iomodel){
    46 
    47         this->Init(vertex_id, iomodel->x[i],iomodel->y[i],iomodel->z[i],(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]));
     45/*FUNCTION Vertex::Vertex(int vertex_id, int vertex_sid,int i, IoModel* iomodel) {{{2*/
     46Vertex::Vertex(int vertex_id, int vertex_sid,int i, IoModel* iomodel){
     47
     48        this->Init(vertex_id, vertex_sid, iomodel->x[i],iomodel->y[i],iomodel->z[i],(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]));
    4849
    4950}
     
    8283
    8384        memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
     85        memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
    8486        memcpy(&x,marshalled_dataset,sizeof(x));marshalled_dataset+=sizeof(x);
    8587        memcpy(&y,marshalled_dataset,sizeof(y));marshalled_dataset+=sizeof(y);
     
    100102        printf("Vertex:\n");
    101103        printf("   id: %i\n",id);
     104        printf("   sid: %i\n",sid);
    102105        printf("   x: %g\n",x);
    103106        printf("   y: %g\n",y);
     
    120123int    Vertex::Id(void){ return id; }
    121124/*}}}*/
     125/*FUNCTION Sid{{{2*/
     126int    Vertex::Sid(void){ return sid; }
     127/*}}}*/
    122128/*FUNCTION Marshall {{{2*/
    123129void  Vertex::Marshall(char** pmarshalled_dataset){
     
    137143        /*marshall Vertex data: */
    138144        memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
     145        memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
    139146        memcpy(marshalled_dataset,&x,sizeof(x));marshalled_dataset+=sizeof(x);
    140147        memcpy(marshalled_dataset,&y,sizeof(y));marshalled_dataset+=sizeof(y);
     
    152159       
    153160        return sizeof(id)+
     161                sizeof(sid)+
    154162                sizeof(x)+
    155163                sizeof(y)+
  • issm/trunk/src/c/objects/Vertex.h

    r4091 r4140  
    2222
    2323                int  id;
     24                int  sid; //sid for "serial" id, ie the rank of this vertex in the vertices dataset, if the dataset was serial on 1 cpu.
    2425                double x;
    2526                double y;
     
    3334                /*FUNCTION constructors, destructors {{{1*/
    3435                Vertex();
    35                 Vertex(int id, double x, double y, double z, double sigma);
    36                 void Init(int id, double x, double y, double z, double sigma);
    37                 Vertex(int id, int i, IoModel* iomodel);
     36                Vertex(int id, int sid,double x, double y, double z, double sigma);
     37                void Init(int id, int sid, double x, double y, double z, double sigma);
     38                Vertex(int id, int sid, int i, IoModel* iomodel);
    3839                ~Vertex();
    3940                /*}}}*/
     
    4546                int   Enum();
    4647                int   Id(void);
     48                int   Sid(void);
    4749                void  Marshall(char** pmarshalled_dataset);
    4850                int   MarshallSize();
Note: See TracChangeset for help on using the changeset viewer.