Changeset 4267


Ignore:
Timestamp:
06/28/10 13:24:30 (15 years ago)
Author:
Mathieu Morlighem
Message:

collapse is now in INPUT of Penta, not a field

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

Legend:

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

    r4266 r4267  
    2727        this->matpar=NULL;
    2828        this->neighbors=NULL;
    29         this->collapse=NULL;
    3029       
    3130        this->inputs=NULL;
     
    3938        delete results;
    4039        this->parameters=NULL;
    41         xfree((void**)&collapse);
    4240}
    4341/*}}}*/
     
    8179        this->inputs=new Inputs();
    8280        this->results=new Results();
    83 
    84         //collpase flags
    85         collapse=(bool*)xcalloc(nummodels,sizeof(bool));
    8681
    8782}
     
    154149        printf("   results\n");
    155150        results->DeepEcho();
    156         printf("   collapse: \n   ");
    157         for(i=0;i<numanalyses;i++)printf("%s|",collapse[i]?"true":"false");
    158151        return;
    159152}
     
    175168
    176169        /*allocate dynamic memory: */
    177         collapse=(bool*)xmalloc(numanalyses*sizeof(bool));
    178170        InitHookNodes(numanalyses);
    179171
     
    194186        results=(Results*)DataSetDemarshallRaw(&marshalled_dataset);
    195187
    196         /*demarshall internal parameters: */
    197         memcpy(collapse,marshalled_dataset,numanalyses*sizeof(bool));marshalled_dataset+=numanalyses*sizeof(bool);
    198 
    199188        /*parameters: may not exist even yet, so let Configure handle it: */
    200189        this->parameters=NULL;
     
    264253        marshalled_dataset+=marshalled_results_size;
    265254
    266         /*marshall internal parameters: */
    267         memcpy(marshalled_dataset,collapse,numanalyses*sizeof(bool));marshalled_dataset+=numanalyses*sizeof(bool);
    268 
    269255        /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
    270256
     
    291277                +inputs->MarshallSize()
    292278                +results->MarshallSize()
    293                 +numanalyses*sizeof(bool)
    294279                +sizeof(int); //sizeof(int) for enum type
    295280}
     
    854839
    855840        /*Just branch to the correct InputUpdateFromSolution generator, according to the type of analysis we are carrying out: */
    856         if (analysis_type==DiagnosticAnalysisEnum){
    857                 if (sub_analysis_type==HorizAnalysisEnum){
    858                         GetSolutionFromInputsDiagnosticHoriz(solution);
    859                 }
    860                 else if(sub_analysis_type==VertAnalysisEnum){
    861                         GetSolutionFromInputsDiagnosticVert(solution);
    862                 }
    863                 else if(sub_analysis_type==StokesAnalysisEnum){
    864                         GetSolutionFromInputsDiagnosticStokes(solution);
    865                 }
    866                 else ISSMERROR("sub_analysis: %i (%s) not supported yet",sub_analysis_type,EnumAsString(sub_analysis_type));
     841        if (analysis_type==DiagnosticHorizAnalysisEnum){
     842                GetSolutionFromInputsDiagnosticHoriz(solution);
     843        }
     844        else if(analysis_type==DiagnosticVertAnalysisEnum){
     845                GetSolutionFromInputsDiagnosticVert(solution);
     846        }
     847        else if(analysis_type==DiagnosticStokesAnalysisEnum){
     848                GetSolutionFromInputsDiagnosticStokes(solution);
    867849        }
    868850        else{
     
    17171699        //elements of type 3 are macayeal type penta. we collapse the formulation on their base.
    17181700        if(iomodel->elements_type){
    1719                 if (*(iomodel->elements_type+2*index+0)==MacAyealFormulationEnum){
    1720                         collapse[analysis_counter]=true;
    1721                 }
    1722                 else{
    1723                         collapse[analysis_counter]=false;
    1724                 }
     1701                if (*(iomodel->elements_type+2*index+0)==MacAyealFormulationEnum)
     1702                 this->inputs->AddInput(new BoolInput(CollapseEnum,true));
     1703                else
     1704                 this->inputs->AddInput(new BoolInput(CollapseEnum,false));
    17251705        }
    17261706}
  • issm/trunk/src/c/objects/Elements/Penta.h

    r4250 r4267  
    3737                Inputs      *inputs;
    3838                Results      *results;
    39 
    40                 /*internal parameters: */
    41                 bool        *collapse; //collapse elements, depending on analysis_type
    4239
    4340                /*Penta constructors and destructor: {{{1*/
Note: See TracChangeset for help on using the changeset viewer.