source: issm/oecreview/Archive/27230-27343/ISSM-27293-27294.diff

Last change on this file was 27344, checked in by Mathieu Morlighem, 2 years ago

CHG: added Archive/27230-27343

File size: 2.6 KB
RevLine 
[27344]1Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
2===================================================================
3--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp (revision 27293)
4+++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp (revision 27294)
5@@ -3900,11 +3900,13 @@
6 IssmDouble Penta::TimeAdapt(void){/*{{{*/
7
8 /*intermediary: */
9+ bool ishydro;
10 IssmDouble C;
11 IssmDouble xyz_list[NUMVERTICES][3];
12
13 /*get CFL coefficient:*/
14 this->parameters->FindParam(&C,TimesteppingCflCoefficientEnum);
15+ this->parameters->FindParam(&ishydro,TransientIshydrologyEnum);
16
17 /*Get for Vx and Vy, the max of abs value: */
18 Input* vx_input = this->GetInput(VxEnum); _assert_(vx_input);
19@@ -3939,6 +3941,20 @@
20 /*CFL criterion: */
21 IssmDouble dt = C/(maxabsvx/dx+maxabsvy/dy+maxabsvz/dz + 1.e-18);
22
23+ /*Check hydro timestep also and take the minimum*/
24+ if(ishydro){
25+ if(IsOnBase()){
26+ Input* vx_input = this->GetInput(HydrologyWaterVxEnum); _assert_(vx_input);
27+ Input* vy_input = this->GetInput(HydrologyWaterVyEnum); _assert_(vy_input);
28+ IssmDouble maxabsvx = vx_input->GetInputMaxAbs();
29+ IssmDouble maxabsvy = vy_input->GetInputMaxAbs();
30+
31+ /*CFL criterion: */
32+ IssmDouble dt2 = C/(maxabsvx/dx+maxabsvy/dy + 1.e-18);
33+ if(dt2<dt) dt = dt2;
34+ }
35+ }
36+
37 return dt;
38 }/*}}}*/
39 IssmDouble Penta::TotalCalvingFluxLevelset(bool scaled){/*{{{*/
40Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
41===================================================================
42--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp (revision 27293)
43+++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp (revision 27294)
44@@ -5252,11 +5252,13 @@
45 IssmDouble Tria::TimeAdapt(void){/*{{{*/
46
47 /*intermediary: */
48+ bool ishydro;
49 IssmDouble C;
50 IssmDouble xyz_list[NUMVERTICES][3];
51
52 /*get CFL coefficient:*/
53 this->parameters->FindParam(&C,TimesteppingCflCoefficientEnum);
54+ this->parameters->FindParam(&ishydro,TransientIshydrologyEnum);
55
56 /*Get for Vx and Vy, the max of abs value: */
57 Input* vx_input = this->GetInput(VxEnum); _assert_(vx_input);
58@@ -5284,6 +5286,18 @@
59 /*CFL criterion: */
60 IssmDouble dt = C/(maxabsvx/dx+maxabsvy/dy + 1.e-18);
61
62+ /*Check hydro timestep also and take the minimum*/
63+ if(ishydro){
64+ Input* vx_input = this->GetInput(HydrologyWaterVxEnum); _assert_(vx_input);
65+ Input* vy_input = this->GetInput(HydrologyWaterVyEnum); _assert_(vy_input);
66+ IssmDouble maxabsvx = vx_input->GetInputMaxAbs();
67+ IssmDouble maxabsvy = vy_input->GetInputMaxAbs();
68+
69+ /*CFL criterion: */
70+ IssmDouble dt2 = C/(maxabsvx/dx+maxabsvy/dy + 1.e-18);
71+ if(dt2<dt) dt = dt2;
72+ }
73+
74 return dt;
75 }
76 /*}}}*/
Note: See TracBrowser for help on using the repository browser.