source: issm/oecreview/Archive/11821-11840/ISSM-11821-11822.diff

Last change on this file was 11991, checked in by Eric.Larour, 13 years ago

oecreview from 11518 to present

File size: 5.3 KB
  • proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/solutions/thermal_core.cpp

     
    1717        int i;
    1818
    1919        /*intermediary*/
    20         double time;
    21         int    nsteps;
    22         double starttime,final_time;
    23         double dt;
    2420        double melting_offset;
    2521        bool   control_analysis;
    2622        int    solution_type;
    2723        bool   dakota_analysis  = false;
    2824
    2925        //first recover parameters common to all solutions
    30         femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
    31         femmodel->parameters->FindParam(&final_time,TimesteppingFinalTimeEnum);
    32         femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
    3326        femmodel->parameters->FindParam(&control_analysis,InversionIscontrolEnum);
    3427        femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
    3528        femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);
    3629
    37         /*Compute number of time steps: */
    38         if((dt==0)|| (final_time==0)){
    39                 dt=0;
    40                 nsteps=1;
    41         }
    42         else nsteps=(int)((final_time-starttime)/dt);
    43         time=starttime;
    44 
    4530        if(dakota_analysis){
    4631                femmodel->SetCurrentConfiguration(ThermalAnalysisEnum);
    4732                ResetConstraintsx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
    4833        }
    49         printf("start = %g final = %g n=%i\n",starttime,final_time,nsteps);
    5034
    51         /*Loop through time: */
    52         for(i=0;i<nsteps;i++){
    53                
    54                 if(nsteps)_printf_(VerboseSolution(),"time step: %i/%i\n",i+1,nsteps);
    55                 time+=dt;
    56                 femmodel->parameters->SetParam(time,TimeEnum);
     35        /*call thermal_core_step: */
     36        thermal_core_step(femmodel);
    5737
    58                 /*call thermal_core_step: */
    59                 thermal_core_step(femmodel,i,time);
    60 
    61                 if(solution_type==ThermalSolutionEnum && !control_analysis){
    62                         _printf_(VerboseSolution(),"   saving results\n");
    63                         InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,TemperatureEnum,i+1,time);
    64                         InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,BasalforcingsMeltingRateEnum,i+1,time);
    65                 }
    66 
     38        if(solution_type==ThermalSolutionEnum && !control_analysis){
     39                _printf_(VerboseSolution(),"   saving results\n");
     40                InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,TemperatureEnum);
     41                InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,BasalforcingsMeltingRateEnum);
    6742        }
     43
    6844}
  • proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/solutions/solutions.h

     
    1919void hydrology_core(FemModel* femmodel);
    2020void hydrology_core_step(FemModel* femmodel,int step, double time);
    2121void thermal_core(FemModel* femmodel);
    22 void thermal_core_step(FemModel* femmodel,int step, double time);
     22void thermal_core_step(FemModel* femmodel,int step=0, double time=0);
    2323void enthalpy_core(FemModel* femmodel);
    2424void enthalpy_core_step(FemModel* femmodel,int step, double time);
    2525void surfaceslope_core(FemModel* femmodel);
  • proj/ice/larour/issm-uci-clean/trunk-jpl/src/m/solutions/thermal_core.m

     
    1111        control_analysis=femmodel.parameters.InversionIscontrol;
    1212        solution_type=femmodel.parameters.SolutionType;
    1313
    14         %Compute number of timesteps
    15         if (dt==0 | ndt==0),
    16                 dt=0;
    17                 nsteps=1;
    18         else
    19                 nsteps=floor(ndt/dt);
    20         end
     14        issmprintf(VerboseSolution,'\n%s',['   computing temperature']);
     15        femmodel=thermal_core_step(femmodel);
    2116
    22         %Loop through time
    23         for i=1:nsteps,
    24                 issmprintf(VerboseSolution,'\n%s%i/%i\n','time step: ',i,nsteps);
    25                 time=(i+1)*dt;
    26 
    27                 issmprintf(VerboseSolution,'\n%s',['   computing temperature']);
    28                 femmodel=thermal_core_step(femmodel,i,time);
    29 
    30                 if (solution_type==ThermalSolutionEnum & ~control_analysis),
    31                         issmprintf(VerboseSolution,'\n%s',['   saving results']);
    32                         femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,TemperatureEnum,i,time);
    33                         femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,BasalforcingsMeltingRateEnum,i,time);
    34                 end
     17        if (solution_type==ThermalSolutionEnum & ~control_analysis),
     18                issmprintf(VerboseSolution,'\n%s',['   saving results']);
     19                femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,TemperatureEnum);
     20                femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,BasalforcingsMeltingRateEnum);
    3521        end
    3622
    3723end %end of function
Note: See TracBrowser for help on using the repository browser.