Changeset 24374


Ignore:
Timestamp:
11/21/19 08:37:07 (5 years ago)
Author:
Mathieu Morlighem
Message:

BUG: fixing AD, need to create method for PDouble

Location:
issm/trunk-jpl/src/c
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp

    r24371 r24374  
    156156        if(isgroundingline)     iomodel->FetchDataToInput(inputs2,elements,"md.geometry.bed",BedEnum);
    157157        /*Initialize cumdeltalthickness input*/
    158         IssmDouble zero =0.; //For AD we need to initialize it with a IssmDouble variable
    159         InputUpdateFromConstantx(inputs2,elements,zero,SealevelriseCumDeltathicknessEnum);
     158        InputUpdateFromConstantx(inputs2,elements,0.,SealevelriseCumDeltathicknessEnum);
    160159        /*Initialize ThicknessResidual input*/
    161         InputUpdateFromConstantx(inputs2,elements,zero,ThicknessResidualEnum);
     160        InputUpdateFromConstantx(inputs2,elements,0.,ThicknessResidualEnum);
    162161
    163162        /*Get what we need for ocean-induced basal melting*/
  • issm/trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp

    r24360 r24374  
    7070        }
    7171}
     72#ifdef _HAVE_AD_
     73void InputUpdateFromConstantx(Inputs2* inputs2,Elements* elements,IssmPDouble constant, int name){
     74
     75        if(VerboseModule()) _printf0_("   Input updates from constant\n");
     76
     77        /*Convert to active variable!*/
     78        IssmDouble constant2 = constant;
     79
     80        /*Elements and loads drive the update: */
     81        for(int i=0;i<elements->Size();i++){
     82                Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
     83                element->SetElementInput(inputs2,name,constant2);
     84        }
     85}
     86#endif
  • issm/trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.h

    r24360 r24374  
    1313void InputUpdateFromConstantx(FemModel* femmodel,int        constant,int name);
    1414void InputUpdateFromConstantx(FemModel* femmodel,IssmDouble constant,int name);
     15#ifdef _HAVE_AD_
     16void InputUpdateFromConstantx(Inputs2* inputs2,Elements* elements,IssmPDouble constant,int name);
     17#endif
    1518void InputUpdateFromConstantx(Inputs2* inputs2,Elements* elements,IssmDouble constant,int name);
    1619void InputUpdateFromConstantx(Inputs2* inputs2,Elements* elements,bool       constant,int name);
Note: See TracChangeset for help on using the changeset viewer.