Changeset 5452


Ignore:
Timestamp:
08/20/10 12:27:58 (15 years ago)
Author:
Mathieu Morlighem
Message:

Fixed Echo and vertex position in element

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

Legend:

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

    r5353 r5452  
    7979                printf("      num=%i\n",this->num);
    8080                printf("      ids: ");
    81                 for (i=0;i<this->num;i++){
    82                         printf("%i ",this->ids[i]);
    83                 }
     81                for (i=0;i<this->num;i++) printf("%i ",this->ids[i]);
    8482                printf("\n");
    8583                printf("      offsets: ");
    86                 for (i=0;i<this->num;i++){
    87                         printf("%i ",this->offsets[i]);
    88                 }
     84                for (i=0;i<this->num;i++) printf("%i ",this->offsets[i]);
    8985                printf("\n");
    9086        }
     
    10298                printf("      num=%i\n",this->num);
    10399                printf("      ids: ");
    104                 for (i=0;i<this->num;i++){
    105                         printf("%i ",this->ids[i]);
    106                 }
     100                for (i=0;i<this->num;i++) printf("%i ",this->ids[i]);
    107101                printf("\n");
    108102                printf("      offsets: ");
    109                 for (i=0;i<this->num;i++){
    110                         printf("%i ",this->offsets[i]);
    111                 }
     103                for (i=0;i<this->num;i++) printf("%i ",this->offsets[i]);
    112104                printf("\n");
    113105                if (!objects) printf("      warning: object not hooked yet\n");
     
    116108                        for (i=0;i<this->num;i++){
    117109                                printf("         object %i\n",i);
    118                                 objects[i]->DeepEcho();
     110                                if(objects[i]) objects[i]->DeepEcho();
     111                                else           printf("            no object hooked yet (not configured)\n");
    119112                        }
    120113                }
  • TabularUnified issm/trunk/src/c/objects/Loads/Numericalflux.cpp

    r5322 r5452  
    3434        int  i1,i2;
    3535        int  j;
    36         int  pos1,pos2;
     36        int  pos1,pos2,pos3,pos4;
    3737        int  num_nodes;
    3838        int  num_elems;
     
    7777
    7878                /*2: Get the column where these ids are located in the index*/
     79                pos1=pos2=pos3=pos4=UNDEF;
     80                for(j=0;j<3;j++){
     81                        if (iomodel->elements[3*(e1-1)+j]==i1) pos1=j+1;
     82                        if (iomodel->elements[3*(e1-1)+j]==i2) pos2=j+1;
     83                        if (iomodel->elements[3*(e2-1)+j]==i1) pos3=j+1;
     84                        if (iomodel->elements[3*(e2-1)+j]==i2) pos4=j+1;
     85                }
     86                ISSMASSERT(pos1!=UNDEF && pos2!=UNDEF && pos3!=UNDEF && pos4!=UNDEF);
     87
     88                /*3: We have the id of the elements and the position of the vertices in the index
     89                 * we can compute their dofs!*/
     90                numericalflux_node_ids[0]=iomodel->nodecounter+3*(e1-1)+pos1;
     91                numericalflux_node_ids[1]=iomodel->nodecounter+3*(e1-1)+pos2;
     92                numericalflux_node_ids[2]=iomodel->nodecounter+3*(e2-1)+pos3;
     93                numericalflux_node_ids[3]=iomodel->nodecounter+3*(e2-1)+pos4;
     94        }
     95        else{
     96
     97                /*2: Get the column where these ids are located in the index*/
    7998                pos1=pos2=UNDEF;
    8099                for(j=0;j<3;j++){
    81100                        if (iomodel->elements[3*(e1-1)+j]==i1) pos1=j+1;
    82                         if (iomodel->elements[3*(e2-1)+j]==i1) pos2=j+1;
     101                        if (iomodel->elements[3*(e1-1)+j]==i2) pos2=j+1;
    83102                }
    84103                ISSMASSERT(pos1!=UNDEF && pos2!=UNDEF);
    85 
    86                 /*3: We have the id of the elements and the position of the vertices in the index
    87                  * we can compute their dofs!*/
    88                 numericalflux_node_ids[0]=iomodel->nodecounter+3*(e1-1)+pos1;       //ex: 1 2 3
    89                 numericalflux_node_ids[1]=iomodel->nodecounter+3*(e1-1)+(pos1%3)+1; //ex: 2 3 1
    90                 numericalflux_node_ids[2]=iomodel->nodecounter+3*(e2-1)+pos2;           //ex: 1 2 3
    91                 numericalflux_node_ids[3]=iomodel->nodecounter+3*(e2-1)+((pos2+1)%3)+1; //ex: 3 1 2
    92         }
    93         else{
    94 
    95                 /*2: Get the column where these ids are located in the index*/
    96                 pos1==UNDEF;
    97                 for(j=0;j<3;j++){
    98                         if (iomodel->elements[3*(e1-1)+j]==i1) pos1=j+1;
    99                 }
    100                 ISSMASSERT(pos1!=UNDEF);
    101104
    102105                /*3: We have the id of the elements and the position of the vertices in the index
    103106                 * we can compute their dofs!*/
    104107                numericalflux_node_ids[0]=iomodel->nodecounter+3*(e1-1)+pos1;
    105                 numericalflux_node_ids[1]=iomodel->nodecounter+3*(e1-1)+(pos1%3)+1;
     108                numericalflux_node_ids[1]=iomodel->nodecounter+3*(e1-1)+pos2;
    106109        }
    107110
     
    134137/*FUNCTION Numericalflux::Echo {{{1*/
    135138void Numericalflux::Echo(void){
    136         this->DeepEcho();
     139        printf("Numericalflux:\n");
     140        printf("   id: %i\n",id);
     141        printf("   analysis_type: %s\n",EnumToString(analysis_type));
     142        hnodes->Echo();
     143        helement->Echo();
     144        printf("   parameters: %p\n",parameters);
     145        printf("   inputs: %p\n",inputs);
    137146}
    138147/*}}}*/
     
    146155        helement->DeepEcho();
    147156        printf("   parameters\n");
    148         parameters->DeepEcho();
     157        if(parameters)
     158         parameters->DeepEcho();
     159        else
     160         printf("      NULL\n");
    149161        printf("   inputs\n");
    150162        inputs->DeepEcho();
     
    395407
    396408        /*dynamic objects pointed to by hooks: */
    397         Node**  nodes=NULL;
    398         Tria*   tria=NULL;
    399         Input*  vxaverage_input=NULL;
    400         Input*  vyaverage_input=NULL;
     409        Node  **nodes           = NULL;
     410        Tria   *tria            = NULL;
     411        Input  *vxaverage_input = NULL;
     412        Input  *vyaverage_input = NULL;
    401413
    402414        /*Retrieve parameters: */
Note: See TracChangeset for help on using the changeset viewer.