Changeset 17159


Ignore:
Timestamp:
01/22/14 16:14:20 (11 years ago)
Author:
jbondzio
Message:

CHG: extrapolation of scalar field using a steadystate solver

Location:
issm/trunk-jpl/src
Files:
9 edited

Legend:

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

    r17075 r17159  
    3636                case ExtrudeFromTopAnalysisEnum : return new ExtrudeFromTopAnalysis();
    3737                case ThermalAnalysisEnum : return new ThermalAnalysis();
    38           case LevelsetAnalysisEnum : return new LevelsetAnalysis();
     38                case LevelsetAnalysisEnum : return new LevelsetAnalysis();
     39                case ExtrapolationAnalysisEnum : return new ExtrapolationAnalysis();
    3940                #ifdef _HAVE_GIA_
    4041                case GiaAnalysisEnum : return new GiaAnalysis();
  • issm/trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp

    r17144 r17159  
    1111/*}}}*/
    1212void ExtrapolationAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
    13         _error_("not implemented yet");
     13        //do nothing for now
    1414}
    1515/*}}}*/
     
    2929                }
    3030        }
    31         iomodel->FetchDataToInput(elements,ExtrapolationVariableEnum);//FIXME: is this the correct way?
    3231}
    3332/*}}}*/
     
    3837/*}}}*/
    3938void ExtrapolationAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
    40 
    41         _error_("not implemented yet");
    42 
     39        // do nothing for now
    4340}
    4441/*}}}*/
    4542void ExtrapolationAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
    46        
    47         _error_("not implemented yet");
    48 
     43//      do nothing for now
    4944}/*}}}*/
    5045
     
    5247void ExtrapolationAnalysis::Core(FemModel* femmodel){/*{{{*/
    5348
     49        /* Intermediaries */
     50        bool save_results;
    5451        /*activate formulation: */
    5552        femmodel->SetCurrentConfiguration(ExtrapolationAnalysisEnum);
     
    5855        UpdateConstraints(femmodel->elements);
    5956        solutionsequence_linear(femmodel);
     57
     58        /*recover parameters: */
     59        femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
     60        if(save_results){
     61                if(VerboseSolution()) _printf0_("   Warning: Adding extrapolated variable to results\n");
     62               
     63                int outputs;
     64                femmodel->parameters->FindParam(&outputs, ExtrapolationVariableEnum);
     65                femmodel->RequestedOutputsx(&femmodel->results,&outputs,1);
     66        }
    6067
    6168}/*}}}*/
     
    248255        Node* node = NULL;
    249256
    250         /* Get further parameters */
     257        /* Get parameters */
    251258        element->FindParam(&extvar_enum, ExtrapolationVariableEnum);
    252259       
    253260        Input* levelset_input=element->GetInput(MaskIceLevelsetEnum); _assert_(levelset_input);
    254261        Input* extvar_input=element->GetInput(extvar_enum); _assert_(extvar_input);
    255        
    256         GaussPenta* gauss=new GaussPenta();
     262
     263        Gauss* gauss=element->NewGauss();
    257264        for(int in=0;in<numnodes;in++){
    258265                gauss->GaussNode(element->GetElementType(),in);
    259266                node=element->GetNode(in);
    260267                levelset_input->GetInputValue(&phi,gauss);
    261                 extvar_input->GetInputValue(&value,gauss);
    262268                if(phi<=0.){
    263269                        /* if ice, set dirichlet BC */
     270                        extvar_input->GetInputValue(&value,gauss);
    264271                        node->ApplyConstraint(1,value);
    265272                }
  • issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp

    r17156 r17159  
    6060void LevelsetAnalysis::Core(FemModel* femmodel){/*{{{*/
    6161
    62         #if !defined(_DEVELOPEMENT_)
     62        #if !defined(_DEVELOPMENT_)
    6363        _error_("Not implemented yet");
    6464        #endif
     
    6666        /*parameters: */
    6767        bool save_results;
     68
     69        /* extrapolate */
     70        Analysis* analysis = new ExtrapolationAnalysis();
     71        femmodel->parameters->SetParam(VxEnum,ExtrapolationVariableEnum);
     72        analysis->Core(femmodel);
     73        delete analysis;
    6874
    6975        /*activate formulation: */
  • issm/trunk-jpl/src/c/cores/AnalysisConfiguration.cpp

    r17075 r17159  
    116116
    117117                case TransientSolutionEnum:
    118                         numanalyses=13;
     118                        numanalyses=14;
    119119                        analyses=xNew<int>(numanalyses);
    120120                        analyses[ 0]=StressbalanceAnalysisEnum;
     
    131131                        analyses[11]=ExtrudeFromTopAnalysisEnum;
    132132                        analyses[12]=LevelsetAnalysisEnum;
     133                        analyses[13]=ExtrapolationAnalysisEnum;
    133134                        break;
    134135
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp

    r17075 r17159  
    7575                if(solution_enum==SteadystateSolutionEnum && analysis_enum==EnthalpyAnalysisEnum && isenthalpy==false) continue;
    7676                if(solution_enum==TransientSolutionEnum && analysis_enum==LevelsetAnalysisEnum && islevelset==false) continue;
     77                if(solution_enum==TransientSolutionEnum && analysis_enum==ExtrapolationAnalysisEnum && islevelset==false) continue;
    7778
    7879
  • issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h

    r17139 r17159  
    352352        MeshdeformationSolutionEnum,
    353353        MeshdeformationAnalysisEnum,
     354        LevelsetAnalysisEnum,
     355        ExtrapolationAnalysisEnum,
    354356        /*}}}*/
    355357        /*Approximations {{{*/
     
    674676        /*}}}*/
    675677        /*Levelset related enums (will be moved to appropriate place when finished){{{*/
    676         LevelsetAnalysisEnum,
    677678        TransientIslevelsetEnum,
    678         ExtrapolationAnalysisEnum,
    679679        ExtrapolationVariableEnum,
    680680        /*}}}*/
  • issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp

    r17139 r17159  
    353353                case MeshdeformationSolutionEnum : return "MeshdeformationSolution";
    354354                case MeshdeformationAnalysisEnum : return "MeshdeformationAnalysis";
     355                case LevelsetAnalysisEnum : return "LevelsetAnalysis";
     356                case ExtrapolationAnalysisEnum : return "ExtrapolationAnalysis";
    355357                case ApproximationEnum : return "Approximation";
    356358                case NoneApproximationEnum : return "NoneApproximation";
     
    633635                case ArrheniusEnum : return "Arrhenius";
    634636                case LliboutryDuvalEnum : return "LliboutryDuval";
    635                 case LevelsetAnalysisEnum : return "LevelsetAnalysis";
    636637                case TransientIslevelsetEnum : return "TransientIslevelset";
    637                 case ExtrapolationAnalysisEnum : return "ExtrapolationAnalysis";
    638638                case ExtrapolationVariableEnum : return "ExtrapolationVariable";
    639639                case MaximumNumberOfDefinitionsEnum : return "MaximumNumberOfDefinitions";
  • issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp

    r17139 r17159  
    359359              else if (strcmp(name,"MeshdeformationSolution")==0) return MeshdeformationSolutionEnum;
    360360              else if (strcmp(name,"MeshdeformationAnalysis")==0) return MeshdeformationAnalysisEnum;
     361              else if (strcmp(name,"LevelsetAnalysis")==0) return LevelsetAnalysisEnum;
     362              else if (strcmp(name,"ExtrapolationAnalysis")==0) return ExtrapolationAnalysisEnum;
    361363              else if (strcmp(name,"Approximation")==0) return ApproximationEnum;
    362364              else if (strcmp(name,"NoneApproximation")==0) return NoneApproximationEnum;
     
    381383              else if (strcmp(name,"GenericParam")==0) return GenericParamEnum;
    382384              else if (strcmp(name,"AdolcParam")==0) return AdolcParamEnum;
    383               else if (strcmp(name,"BoolInput")==0) return BoolInputEnum;
    384               else if (strcmp(name,"BoolParam")==0) return BoolParamEnum;
    385385         else stage=4;
    386386   }
    387387   if(stage==4){
    388               if (strcmp(name,"Contour")==0) return ContourEnum;
     388              if (strcmp(name,"BoolInput")==0) return BoolInputEnum;
     389              else if (strcmp(name,"BoolParam")==0) return BoolParamEnum;
     390              else if (strcmp(name,"Contour")==0) return ContourEnum;
    389391              else if (strcmp(name,"ControlInput")==0) return ControlInputEnum;
    390392              else if (strcmp(name,"DatasetInput")==0) return DatasetInputEnum;
     
    504506              else if (strcmp(name,"Enthalpy")==0) return EnthalpyEnum;
    505507              else if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
    506               else if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
    507               else if (strcmp(name,"ThicknessAlongGradient")==0) return ThicknessAlongGradientEnum;
    508508         else stage=5;
    509509   }
    510510   if(stage==5){
    511               if (strcmp(name,"ThicknessAcrossGradient")==0) return ThicknessAcrossGradientEnum;
     511              if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
     512              else if (strcmp(name,"ThicknessAlongGradient")==0) return ThicknessAlongGradientEnum;
     513              else if (strcmp(name,"ThicknessAcrossGradient")==0) return ThicknessAcrossGradientEnum;
    512514              else if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum;
    513515              else if (strcmp(name,"RheologyBbarAbsGradient")==0) return RheologyBbarAbsGradientEnum;
     
    627629              else if (strcmp(name,"Verbose")==0) return VerboseEnum;
    628630              else if (strcmp(name,"TriangleInterp")==0) return TriangleInterpEnum;
    629               else if (strcmp(name,"BilinearInterp")==0) return BilinearInterpEnum;
    630               else if (strcmp(name,"NearestInterp")==0) return NearestInterpEnum;
    631631         else stage=6;
    632632   }
    633633   if(stage==6){
    634               if (strcmp(name,"XY")==0) return XYEnum;
     634              if (strcmp(name,"BilinearInterp")==0) return BilinearInterpEnum;
     635              else if (strcmp(name,"NearestInterp")==0) return NearestInterpEnum;
     636              else if (strcmp(name,"XY")==0) return XYEnum;
    635637              else if (strcmp(name,"XYZ")==0) return XYZEnum;
    636638              else if (strcmp(name,"Dense")==0) return DenseEnum;
     
    648650              else if (strcmp(name,"Arrhenius")==0) return ArrheniusEnum;
    649651              else if (strcmp(name,"LliboutryDuval")==0) return LliboutryDuvalEnum;
    650               else if (strcmp(name,"LevelsetAnalysis")==0) return LevelsetAnalysisEnum;
    651652              else if (strcmp(name,"TransientIslevelset")==0) return TransientIslevelsetEnum;
    652               else if (strcmp(name,"ExtrapolationAnalysis")==0) return ExtrapolationAnalysisEnum;
    653653              else if (strcmp(name,"ExtrapolationVariable")==0) return ExtrapolationVariableEnum;
    654654              else if (strcmp(name,"MaximumNumberOfDefinitions")==0) return MaximumNumberOfDefinitionsEnum;
  • issm/trunk-jpl/src/m/enum/EnumDefinitions.py

    r17139 r17159  
    345345def MeshdeformationSolutionEnum(): return StringToEnum("MeshdeformationSolution")[0]
    346346def MeshdeformationAnalysisEnum(): return StringToEnum("MeshdeformationAnalysis")[0]
     347def LevelsetAnalysisEnum(): return StringToEnum("LevelsetAnalysis")[0]
     348def ExtrapolationAnalysisEnum(): return StringToEnum("ExtrapolationAnalysis")[0]
    347349def ApproximationEnum(): return StringToEnum("Approximation")[0]
    348350def NoneApproximationEnum(): return StringToEnum("NoneApproximation")[0]
     
    625627def ArrheniusEnum(): return StringToEnum("Arrhenius")[0]
    626628def LliboutryDuvalEnum(): return StringToEnum("LliboutryDuval")[0]
    627 def LevelsetAnalysisEnum(): return StringToEnum("LevelsetAnalysis")[0]
    628629def TransientIslevelsetEnum(): return StringToEnum("TransientIslevelset")[0]
    629 def ExtrapolationAnalysisEnum(): return StringToEnum("ExtrapolationAnalysis")[0]
    630630def ExtrapolationVariableEnum(): return StringToEnum("ExtrapolationVariable")[0]
    631631def MaximumNumberOfDefinitionsEnum(): return StringToEnum("MaximumNumberOfDefinitions")[0]
Note: See TracChangeset for help on using the changeset viewer.