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/Beam.cpp

    r4873 r4880  
    407407/*}}}*/
    408408/*FUNCTION Beam::InputConvergence{{{1*/
    409 void  Beam::InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums){
    410 
    411         int     i;
     409bool Beam::InputConvergence(double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums){
     410
     411        int i;
    412412        Input** new_inputs=NULL;
    413413        Input** old_inputs=NULL;
    414         int     converged=1;
     414        bool    converged=true;
    415415
    416416        new_inputs=(Input**)xmalloc(num_enums/2*sizeof(Input*)); //half the enums are for the new inputs
    417417        old_inputs=(Input**)xmalloc(num_enums/2*sizeof(Input*)); //half the enums are for the old inputs
    418        
     418
    419419        for(i=0;i<num_enums/2;i++){
    420420                new_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+0]);
     
    427427        for(i=0;i<num_criterionenums;i++){
    428428                IsInputConverged(eps+i,new_inputs,old_inputs,num_enums/2,criterionenums[i]);
    429                 if(eps[i]>criterionvalues[i]) converged=0;
     429                if(eps[i]>criterionvalues[i]) converged=false;
    430430        }
    431431
     
    434434        xfree((void**)&old_inputs);
    435435
    436         /*Assign output pointers:*/
    437         *pconverged=converged;
     436        /*Return output*/
     437        return converged;
    438438
    439439}
Note: See TracChangeset for help on using the changeset viewer.