Changeset 3549


Ignore:
Timestamp:
04/16/10 08:21:11 (15 years ago)
Author:
Mathieu Morlighem
Message:

Some fixing in prognostic2

Location:
issm/trunk/src/c/ModelProcessorx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/ModelProcessorx/Partitioning.cpp

    r3446 r3549  
    213213        /*Get edges and elements*/
    214214        IoModelFetchData(&iomodel->edges,&iomodel->numberofedges,NULL,iomodel_handle,"edges");
     215        IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
    215216
    216217        /*!All elements have been partitioned above, only create elements for this CPU: */
     
    233234
    234235                        /*2: Get the column where these ids are located in the index*/
    235                         pos==UNDEF;
     236                        pos=UNDEF;
    236237                        for(j=0;j<3;j++){
    237                                 if (iomodel->elements[3*(int)e2+j]==i1) pos=j+1;
    238                         }
    239                         ISSMASSERT(pos!=UNDEF);
     238                                if ((int)iomodel->elements[3*(int)e2+j]==i1) pos=j;
     239                        }
    240240
    241241                        /*3: We have the id of the elements and the position of the vertices in the index
    242242                         * we can now create the corresponding nodes:*/
    243                         my_nodes[(int)e2*3+pos-1]=1;
    244                         my_nodes[(int)e2*3+((pos+1)%3)]=1;
     243                        if (pos==0){
     244                                my_nodes[(int)e2*3+0]=1;
     245                                my_nodes[(int)e2*3+2]=1;
     246                        }
     247                        else if(pos==1){
     248                                my_nodes[(int)e2*3+1]=1;
     249                                my_nodes[(int)e2*3+0]=1;
     250                        }
     251                        else if (pos==2){
     252                                my_nodes[(int)e2*3+2]=1;
     253                                my_nodes[(int)e2*3+1]=1;
     254                        }
     255                        else{
     256                                ISSMERROR("Problem in edges creation");
     257                        }
    245258                }
    246259        }
    247260
    248261        /*Free data: */
     262        xfree((void**)&iomodel->elements);
    249263        xfree((void**)&iomodel->edges);
    250264
  • issm/trunk/src/c/ModelProcessorx/Prognostic2/CreateLoadsPrognostic2.cpp

    r3548 r3549  
    4747                /*Create load*/
    4848                numericalflux_id=i+1; //Matlab indexing
     49                numericalflux_elem_id=(int)e1+1;//id is in matlab index
     50
     51                /*1: Get vertices ids*/
     52                i1=(int)iomodel->edges[4*i+0];
     53                i2=(int)iomodel->edges[4*i+1];
    4954
    5055                if (!isnan(e2)){
    5156                        strcpy(numericalflux_type,"internal");
    5257
    53                         numericalflux_elem_id=(int)e1+1;//id is in matlab index
    54 
    5558                        /*Now, we must get the nodes of the 4 nodes located on the edge*/
    56 
    57                         /*1: Get vertices ids*/
    58                         i1=(int)iomodel->edges[4*i+0];
    59                         i2=(int)iomodel->edges[4*i+1];
    6059
    6160                        /*2: Get the column where these ids are located in the index*/
     
    7675                else{
    7776                        strcpy(numericalflux_type,"boundary");
    78 
    79                         numericalflux_elem_id=(int)e1+1;
    80 
    81                         /*1: Get vertices ids*/
    82                         i1=(int)iomodel->edges[4*i+0];
    83                         i2=(int)iomodel->edges[4*i+1];
    8477
    8578                        /*2: Get the column where these ids are located in the index*/
Note: See TracChangeset for help on using the changeset viewer.