Changeset 13542


Ignore:
Timestamp:
10/04/12 18:08:49 (13 years ago)
Author:
Eric.Larour
Message:

CHG: transferred AD statements to CreateParametersAutodiff, namely
the creation of an AdolcEdf parameter to holds solver pointers.

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

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp

    r13516 r13542  
    77#include "../../../io/io.h"
    88#include "../../../EnumDefinitions/EnumDefinitions.h"
    9 #include "../../../classes/objects/objects.h"
     9#include "../../../classes/classes.h"
    1010#include "../../../shared/shared.h"
    1111#include "../../../include/include.h"
     12#include "../../Solverx/Solverx.h"
    1213#include "../ModelProcessorx.h"
    1314
     
    108109                parameters->AddObject(new DataSetParam(AutodiffIndependentObjectsEnum,iomodel->independent_objects));
    109110                /*}}}*/
     111        /*initialize a placeholder to store solver pointers: {{{*/
     112        GenericParam<Adolc_edf> *theAdolcEDF_p=new GenericParam<Adolc_edf>(AdolcParamEnum);
     113        theAdolcEDF_p->GetParameterValue().myEDF_for_solverx_p=reg_ext_fct(EDF_for_solverx);
     114        // to save some space:
     115        // we know we won't use adolc inside of  the solver:
     116        theAdolcEDF_p->GetParameterValue().myEDF_for_solverx_p->nestedAdolc=false;
     117        // the solution vector is just allocated and doesn't have a meaningfull prior value
     118        theAdolcEDF_p->GetParameterValue().myEDF_for_solverx_p->dp_y_priorRequired=false;
     119         // the solver wrapper makes sure the matrix and the right hand side don't change
     120        theAdolcEDF_p->GetParameterValue().myEDF_for_solverx_p->dp_x_changes=false;
     121        parameters->AddObject(theAdolcEDF_p);
     122        /*}}}*/
    110123
    111124                /*Assign output pointer: */
  • issm/trunk-jpl/src/c/solutions/issm.cpp

    r13540 r13542  
    6161        /*Create femmodel, using input file: */
    6262        profiler->Tag(StartInit);
    63        
    6463        femmodel=new FemModel(rootpath,binfilename,outbinfilename,solution_type,analyses,numanalyses);
    6564       
     
    8382        profiler->Tag(FinishInit);
    8483       
    85         /*If running AD, then initialize a placeholder with which to work: */
    86         #ifdef _HAVE_ADOLC_
    87         GenericParam<Adolc_edf> *theAdolcEDF_p=new GenericParam<Adolc_edf>(AdolcParamEnum);
    88         theAdolcEDF_p->GetParameterValue().myEDF_for_solverx_p=reg_ext_fct(EDF_for_solverx);
    89         // to save some space:
    90         // we know we won't use adolc inside of  the solver:
    91         theAdolcEDF_p->GetParameterValue().myEDF_for_solverx_p->nestedAdolc=false;
    92         // the solution vector is just allocated and doesn't have a meaningfull prior value
    93         theAdolcEDF_p->GetParameterValue().myEDF_for_solverx_p->dp_y_priorRequired=false;
    94          // the solver wrapper makes sure the matrix and the right hand side don't change
    95         theAdolcEDF_p->GetParameterValue().myEDF_for_solverx_p->dp_x_changes=false;
    96         femmodel->parameters->AddObject(theAdolcEDF_p);
    97         #else
    98         if(autodiff) _error_("ISSM was not compiled with ADOLC support, cannot carry out autodiff analysis!");
    99         #endif
    100 
    10184        _pprintLine_("call computational core:");
    10285        profiler->Tag(StartCore); solutioncore(femmodel); profiler->Tag(FinishCore);
Note: See TracChangeset for help on using the changeset viewer.