Changeset 9594


Ignore:
Timestamp:
09/02/11 16:10:21 (14 years ago)
Author:
Mathieu Morlighem
Message:

Fixed problem with control: CorePointer needs to be revised

Location:
issm/trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/solutions/CorePointerFromSolutionEnum.cpp

    r9571 r9594  
    7171        }
    7272       
    73         /*if control is being run on top of a solution, change core: */
    74         if(control_analysis){
    75                 #ifdef _HAVE_TAO_
    76                 //solutioncore=&controltao_core;
    77                 solutioncore=&control_core;
    78                 #else
    79                 solutioncore=&control_core;
    80                 #endif
    81         }       
    82                
    83         if(dakota_analysis){
    84                 #ifndef _HAVE_DAKOTA_
    85                 _error_(" Dakota not present, cannot do qmu!");
    86                 #endif
    87         }
    88 
    8973        /*Assign output pointer:*/
    9074        _assert_(psolutioncore);
  • issm/trunk/src/c/solutions/issm.cpp

    r9571 r9594  
    1515        FILE *petscoptionsfid  = NULL;
    1616        bool  waitonlock       = false;
    17         bool  dakota_analysis  = false;
     17        bool  dakota_analysis;
     18        bool  control_analysis;
    1819
    1920        /*FemModel: */
     
    8788        femmodel->parameters->FindParam(&waitonlock,WaitonlockEnum);
    8889        femmodel->parameters->FindParam(&dakota_analysis,DakotaAnalysisEnum);
     90        femmodel->parameters->FindParam(&control_analysis,ControlAnalysisEnum);
    8991
    9092        MPI_Barrier(MPI_COMM_WORLD); finish_init=MPI_Wtime();
     
    9496        _printf_(true,"call computational core:\n");
    9597        MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
    96         if(dakota_analysis) Dakotax(femmodel);
    97         else                solutioncore(femmodel);
     98        if(dakota_analysis){
     99                Dakotax(femmodel);
     100        }
     101        else if(control_analysis){
     102                #ifdef _HAVE_TAO_
     103                //controltao_core(femmodel);
     104                control_core(femmodel);
     105                #else
     106                control_core(femmodel);
     107                #endif
     108        }
     109        else{
     110                solutioncore(femmodel);
     111        }
    98112        MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
    99113
  • issm/trunk/src/m/solutions/CorePointerFromSolutionEnum.m

    r9571 r9594  
    44%   Usage:
    55%      [solutioncore]=CorePointerFromSolutionEnum(parameters,solutiontype);
    6 
    7 control_analysis=parameters.ControlAnalysis;
    8 dakota_analysis=parameters.DakotaAnalysis;
    96
    107switch solutiontype,
     
    2522
    2623end
    27 
    28 %if control being run on top of solution, change core
    29 if(control_analysis)solutioncore='control_core';end
  • issm/trunk/src/m/solutions/control_core.m

    r9580 r9594  
    2828
    2929        %Get core from solution type
    30         solutioncore=CorePointerFromSolutionEnum(solution_type);
     30        solutioncore=CorePointerFromSolutionEnum(femmodel.parameters,solution_type);
    3131        adjointcore=AdjointCorePointerFromSolutionEnum(solution_type);
    3232
  • issm/trunk/src/m/solutions/issm.m

    r9571 r9594  
    2323        %retrieve parameters
    2424        dakota_analysis=femmodel.parameters.DakotaAnalysis;
     25        control_analysis=femmodel.parameters.ControlAnalysis;
    2526
    2627        %compute solution
    27 
    2828        issmprintf(VerboseSolution,'%s',['call computational core']);
    2929        if dakota_analysis,
    3030                Dakota(femmodel);
     31        elseif control_analysis
     32                femmodel=control_core(femmodel);
    3133        else
    3234                eval(['femmodel=' solutioncore '(femmodel);']);
Note: See TracChangeset for help on using the changeset viewer.