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

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

oecreview from 11518 to present

File size: 5.3 KB
RevLine 
[11991]1Index: /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/solutions/thermal_core.cpp
2===================================================================
3--- /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/solutions/thermal_core.cpp (revision 11821)
4+++ /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/solutions/thermal_core.cpp (revision 11822)
5@@ -17,52 +17,28 @@
6 int i;
7
8 /*intermediary*/
9- double time;
10- int nsteps;
11- double starttime,final_time;
12- double dt;
13 double melting_offset;
14 bool control_analysis;
15 int solution_type;
16 bool dakota_analysis = false;
17
18 //first recover parameters common to all solutions
19- femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
20- femmodel->parameters->FindParam(&final_time,TimesteppingFinalTimeEnum);
21- femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
22 femmodel->parameters->FindParam(&control_analysis,InversionIscontrolEnum);
23 femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
24 femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);
25
26- /*Compute number of time steps: */
27- if((dt==0)|| (final_time==0)){
28- dt=0;
29- nsteps=1;
30- }
31- else nsteps=(int)((final_time-starttime)/dt);
32- time=starttime;
33-
34 if(dakota_analysis){
35 femmodel->SetCurrentConfiguration(ThermalAnalysisEnum);
36 ResetConstraintsx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
37 }
38- printf("start = %g final = %g n=%i\n",starttime,final_time,nsteps);
39
40- /*Loop through time: */
41- for(i=0;i<nsteps;i++){
42-
43- if(nsteps)_printf_(VerboseSolution(),"time step: %i/%i\n",i+1,nsteps);
44- time+=dt;
45- femmodel->parameters->SetParam(time,TimeEnum);
46+ /*call thermal_core_step: */
47+ thermal_core_step(femmodel);
48
49- /*call thermal_core_step: */
50- thermal_core_step(femmodel,i,time);
51-
52- if(solution_type==ThermalSolutionEnum && !control_analysis){
53- _printf_(VerboseSolution()," saving results\n");
54- InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,TemperatureEnum,i+1,time);
55- InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,BasalforcingsMeltingRateEnum,i+1,time);
56- }
57-
58+ if(solution_type==ThermalSolutionEnum && !control_analysis){
59+ _printf_(VerboseSolution()," saving results\n");
60+ InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,TemperatureEnum);
61+ InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,BasalforcingsMeltingRateEnum);
62 }
63+
64 }
65Index: /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/solutions/solutions.h
66===================================================================
67--- /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/solutions/solutions.h (revision 11821)
68+++ /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/solutions/solutions.h (revision 11822)
69@@ -19,7 +19,7 @@
70 void hydrology_core(FemModel* femmodel);
71 void hydrology_core_step(FemModel* femmodel,int step, double time);
72 void thermal_core(FemModel* femmodel);
73-void thermal_core_step(FemModel* femmodel,int step, double time);
74+void thermal_core_step(FemModel* femmodel,int step=0, double time=0);
75 void enthalpy_core(FemModel* femmodel);
76 void enthalpy_core_step(FemModel* femmodel,int step, double time);
77 void surfaceslope_core(FemModel* femmodel);
78Index: /proj/ice/larour/issm-uci-clean/trunk-jpl/src/m/solutions/thermal_core.m
79===================================================================
80--- /proj/ice/larour/issm-uci-clean/trunk-jpl/src/m/solutions/thermal_core.m (revision 11821)
81+++ /proj/ice/larour/issm-uci-clean/trunk-jpl/src/m/solutions/thermal_core.m (revision 11822)
82@@ -11,27 +11,13 @@
83 control_analysis=femmodel.parameters.InversionIscontrol;
84 solution_type=femmodel.parameters.SolutionType;
85
86- %Compute number of timesteps
87- if (dt==0 | ndt==0),
88- dt=0;
89- nsteps=1;
90- else
91- nsteps=floor(ndt/dt);
92- end
93+ issmprintf(VerboseSolution,'\n%s',[' computing temperature']);
94+ femmodel=thermal_core_step(femmodel);
95
96- %Loop through time
97- for i=1:nsteps,
98- issmprintf(VerboseSolution,'\n%s%i/%i\n','time step: ',i,nsteps);
99- time=(i+1)*dt;
100-
101- issmprintf(VerboseSolution,'\n%s',[' computing temperature']);
102- femmodel=thermal_core_step(femmodel,i,time);
103-
104- if (solution_type==ThermalSolutionEnum & ~control_analysis),
105- issmprintf(VerboseSolution,'\n%s',[' saving results']);
106- femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,TemperatureEnum,i,time);
107- femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,BasalforcingsMeltingRateEnum,i,time);
108- end
109+ if (solution_type==ThermalSolutionEnum & ~control_analysis),
110+ issmprintf(VerboseSolution,'\n%s',[' saving results']);
111+ femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,TemperatureEnum);
112+ femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,BasalforcingsMeltingRateEnum);
113 end
114
115 end %end of function
Note: See TracBrowser for help on using the repository browser.