Changeset 12285


Ignore:
Timestamp:
05/24/12 14:10:19 (13 years ago)
Author:
cborstad
Message:

finished code for setting a discontinuous threshold for inverse parameter

Location:
issm/branches/trunk-jpl-damage/src/c/objects/Inputs
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • issm/branches/trunk-jpl-damage/src/c/objects/Inputs/BoolInput.h

    r12168 r12285  
    4040                Input* PointwiseMin(Input* inputB){_error_("not implemented yet");};
    4141                Input* PointwiseMax(Input* inputB){_error_("not implemented yet");};
     42                Input* PointwiseThresh(Input* inputB,Input* inputC){_error_("not implemented yet");};
    4243                ElementResult* SpawnResult(int step, double time);
    4344                void Configure(Parameters* parameters);
  • issm/branches/trunk-jpl-damage/src/c/objects/Inputs/ControlInput.cpp

    r12167 r12285  
    375375        Input* newvalues=NULL;
    376376
    377         newvalues=this->values->PointwiseMin(maxvalues);
     377        newvalues=this->values->PointwiseMin(maxvalues); /*compare input to maxvalues and retain pointwise minimum*/
    378378        delete values; this->values=newvalues;
    379379        newvalues=this->values->PointwiseMax(minvalues);
     380        delete values; this->values=newvalues;
     381        newvalues=this->values->PointwiseThresh(threshvalues,minvalues);
    380382        delete values; this->values=newvalues;
    381383}/*}}}*/
  • issm/branches/trunk-jpl-damage/src/c/objects/Inputs/ControlInput.h

    r12168 r12285  
    4545                Input* PointwiseMin(Input* inputB){_error_("not implemented yet");};
    4646                Input* PointwiseMax(Input* inputB){_error_("not implemented yet");};
     47                Input* PointwiseThresh(Input* inputB,Input* inputC){_error_("not implemented yet");};
    4748                ElementResult* SpawnResult(int step, double time);
    4849                void AddTimeValues(double* values,int step,double time){_error_("not supported yet");};
  • issm/branches/trunk-jpl-damage/src/c/objects/Inputs/DatasetInput.h

    r12168 r12285  
    4040                Input* PointwiseMin(Input* inputB){_error_("not implemented yet");};
    4141                Input* PointwiseMax(Input* inputB){_error_("not implemented yet");};
     42                Input* PointwiseThresh(Input* inputB,Input* inputC){_error_("not implemented yet");};
    4243                ElementResult* SpawnResult(int step, double time){_error_("not implemented yet");};
    4344                void AddTimeValues(double* values,int step,double time){_error_("not supported yet");};
  • issm/branches/trunk-jpl-damage/src/c/objects/Inputs/DoubleInput.h

    r12168 r12285  
    3939                Input* PointwiseMin(Input* inputB);
    4040                Input* PointwiseMax(Input* inputB);
     41                Input* PointwiseThresh(Input* inputB,Input* inputC){_error_("not supported yet");};
    4142                ElementResult* SpawnResult(int step, double time);
    4243                void AddTimeValues(double* values,int step,double time){_error_("not supported yet");};
  • issm/branches/trunk-jpl-damage/src/c/objects/Inputs/Input.h

    r11984 r12285  
    6363                virtual Input* PointwiseMax(Input* inputmax)=0;
    6464                virtual Input* PointwiseMin(Input* inputmin)=0;
     65                virtual Input* PointwiseThresh(Input* inputthresh,Input* inputmin)=0;
    6566                virtual ElementResult* SpawnResult(int step, double time)=0;
    6667
  • issm/branches/trunk-jpl-damage/src/c/objects/Inputs/IntInput.h

    r12168 r12285  
    4040                Input* PointwiseMin(Input* inputB){_error_("not implemented yet");};
    4141                Input* PointwiseMax(Input* inputB){_error_("not implemented yet");};
     42                Input* PointwiseThresh(Input* inputB,Input* inputC){_error_("not implemented yet");};
    4243                ElementResult* SpawnResult(int step, double time);
    4344                void AddTimeValues(double* values,int step,double time){_error_("not supported yet");};
  • issm/branches/trunk-jpl-damage/src/c/objects/Inputs/PentaP1Input.cpp

    r12168 r12285  
    609609}
    610610/*}}}*/
     611/*FUNCTION PentaP1Input::PointwiseThresh{{{1*/
     612Input* PentaP1Input::PointwiseThresh(Input* inputB,Input* inputC){
     613
     614        /*Ouput*/
     615        PentaP1Input* outinput=NULL;
     616
     617        /*Intermediaries*/
     618        int               i;
     619        PentaP1Input *xinputB     = NULL;
     620        PentaP1Input *xinputC     = NULL;
     621        int               B_numvalues;
     622        const int         numnodes    = 6;
     623        double            threshvalues[numnodes];
     624
     625        /*Check that inputB is of the same type*/
     626        if (inputB->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputB is of type %s",EnumToStringx(inputB->ObjectEnum()));
     627        xinputB=(PentaP1Input*)inputB;
     628
     629        /*Check that inputB is of the same type*/
     630        if (inputC->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputC is of type %s",EnumToStringx(inputC->ObjectEnum()));
     631        xinputC=(PentaP1Input*)inputC;
     632
     633        /*Create point wise thresh*/
     634        for(i=0;i<numnodes;i++){
     635                if(this->values[i] < xinputB->values[i]) threshvalues[i]=xinputC->values[i];
     636                else threshvalues[i]=this->values[i];
     637        }
     638
     639        /*Create new Penta vertex input (copy of current input)*/
     640        outinput=new PentaP1Input(this->enum_type,&threshvalues[0]);
     641
     642        /*Return output pointer*/
     643        return outinput;
     644
     645}
     646/*}}}*/
    611647/*FUNCTION PentaP1Input::GetVectorFromInputs{{{1*/
    612648void PentaP1Input::GetVectorFromInputs(Vector* vector,int* doflist){
  • issm/branches/trunk-jpl-damage/src/c/objects/Inputs/PentaP1Input.h

    r12168 r12285  
    4040                Input* PointwiseMin(Input* inputB);
    4141                Input* PointwiseMax(Input* inputB);
     42                Input* PointwiseThresh(Input* inputB,Input* inputC);
    4243                ElementResult* SpawnResult(int step, double time);
    4344                void AddTimeValues(double* values,int step,double time){_error_("not supported yet");};
  • issm/branches/trunk-jpl-damage/src/c/objects/Inputs/TransientInput.h

    r12168 r12285  
    4343                Input* PointwiseMin(Input* forcingB){_error_("not implemented yet");};
    4444                Input* PointwiseMax(Input* forcingB){_error_("not implemented yet");};
     45                Input* PointwiseThresh(Input* forcingB,Input* forcingC){_error_("not implemented yet");};
    4546                ElementResult* SpawnResult(int step, double time);
    4647                void Configure(Parameters* parameters);
  • issm/branches/trunk-jpl-damage/src/c/objects/Inputs/TriaP1Input.cpp

    r12168 r12285  
    364364        int               i;
    365365        TriaP1Input *xinputB     = NULL;
    366         int               B_numvalues;
     366        int               B_numvalues; /* doesn't look like this is used */
    367367        const int         numnodes    = 3;
    368368        double            minvalues[numnodes];
     
    395395        int               i;
    396396        TriaP1Input *xinputB     = NULL;
    397         int               B_numvalues;
     397        int               B_numvalues; /* doesn't look like this is used */
    398398        const int         numnodes    = 3;
    399399        double            maxvalues[numnodes];
     
    417417}
    418418/*}}}*/
     419/*FUNCTION TriaP1Input::PointwiseThresh{{{1*/
     420Input* TriaP1Input::PointwiseThresh(Input* inputB, Input* inputC){
     421        /*pointwise comparison to inputB.  If less than inputB, set nodal output to input C*/
     422
     423        /*Ouput*/
     424        TriaP1Input* outinput=NULL;
     425
     426        /*Intermediaries*/
     427        int               i;
     428        TriaP1Input *xinputB     = NULL;
     429        TriaP1Input *xinputC     = NULL;
     430        int               B_numvalues; /* doesn't look like this is used */
     431        const int         numnodes    = 3;
     432        double            threshvalues[numnodes];
     433
     434        /*Check that inputB is of the same type*/
     435        if (inputB->ObjectEnum()!=TriaP1InputEnum) _error_("Operation not permitted because inputB is of type %s",EnumToStringx(inputB->ObjectEnum()));
     436        xinputB=(TriaP1Input*)inputB;
     437
     438        /*Check that inputC is of the same type*/
     439        if (inputC->ObjectEnum()!=TriaP1InputEnum) _error_("Operation not permitted because inputC is of type %s",EnumToStringx(inputC->ObjectEnum()));
     440        xinputC=(TriaP1Input*)inputC;
     441
     442        /*Create point wise thresh*/
     443        for(i=0;i<numnodes;i++){
     444                if(this->values[i] < xinputB->values[i]) threshvalues[i]=xinputC->values[i];
     445                else threshvalues[i]=this->values[i];
     446        }
     447
     448        /*Create new Tria vertex input (copy of current input)*/
     449        outinput=new TriaP1Input(this->enum_type,&threshvalues[0]);
     450
     451        /*Return output pointer*/
     452        return outinput;
     453
     454}
     455/*}}}*/
    419456/*FUNCTION TriaP1Input::Configure{{{1*/
    420457void TriaP1Input::Configure(Parameters* parameters){
  • issm/branches/trunk-jpl-damage/src/c/objects/Inputs/TriaP1Input.h

    r12168 r12285  
    4040                Input* PointwiseMin(Input* inputB);
    4141                Input* PointwiseMax(Input* inputB);
     42                Input* PointwiseThresh(Input* inputB, Input* inputC);
    4243                ElementResult* SpawnResult(int step, double time);
    4344                void AddTimeValues(double* values,int step,double time){_error_("not supported yet");};
Note: See TracChangeset for help on using the changeset viewer.