Ignore:
Timestamp:
07/29/10 11:26:26 (15 years ago)
Author:
Mathieu Morlighem
Message:

now input convergence returns number of elements above or below criterion

File:
1 edited

Legend:

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

    r4873 r4880  
    10581058/*}}}*/
    10591059/*FUNCTION Penta::InputConvergence{{{1*/
    1060 void  Penta::InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums){
    1061 
    1062         int     i;
     1060bool Penta::InputConvergence(double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums){
     1061
     1062        int i;
    10631063        Input** new_inputs=NULL;
    10641064        Input** old_inputs=NULL;
    1065         int     converged=1;
     1065        bool    converged=true;
    10661066
    10671067        new_inputs=(Input**)xmalloc(num_enums/2*sizeof(Input*)); //half the enums are for the new inputs
    10681068        old_inputs=(Input**)xmalloc(num_enums/2*sizeof(Input*)); //half the enums are for the old inputs
    1069        
     1069
    10701070        for(i=0;i<num_enums/2;i++){
    10711071                new_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+0]);
     
    10781078        for(i=0;i<num_criterionenums;i++){
    10791079                IsInputConverged(eps+i,new_inputs,old_inputs,num_enums/2,criterionenums[i]);
    1080                 if(eps[i]>criterionvalues[i]) converged=0;
     1080                if(eps[i]>criterionvalues[i]) converged=false;
    10811081        }
    10821082
     
    10851085        xfree((void**)&old_inputs);
    10861086
    1087         /*Assign output pointers:*/
    1088         *pconverged=converged;
     1087        /*Return output*/
     1088        return converged;
    10891089
    10901090}
Note: See TracChangeset for help on using the changeset viewer.