Changeset 26237
- Timestamp:
- 05/04/21 12:41:09 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/cores/love_core.cpp ¶
r26236 r26237 9 9 #include "../modules/modules.h" 10 10 #include "../solutionsequences/solutionsequences.h" 11 #include "petscblaslapack.h" 12 11 #include <petscblaslapack.h> 13 12 14 13 void love_init(FemModel* femmodel, Matlitho* matlitho){/*{{{*/ … … 42 41 femmodel->parameters->SetParam(nyi,LoveNYiEquationsEnum); 43 42 femmodel->parameters->SetParam(starting_layer,LoveStartingLayerEnum); 44 } 45 43 }/*}}}*/ 46 44 void GetEarthRheology(IssmDouble* pla, IssmDouble* pmu, int layer_index, IssmDouble omega,FemModel* femmodel, Matlitho* matlitho){ /*{{{*/ 47 45 … … 103 101 104 102 } /*}}}*/ 105 106 107 103 IssmDouble GetGravity(IssmDouble r2, int layer_index, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/ 108 104 //computes gravity at radius r2 … … 124 120 return g= GG*M/pow(r2,2.0); 125 121 }/*}}}*/ 126 127 122 void fill_yi_prefactor(IssmDouble* yi_prefactor, int* pdeg, IssmDouble* pomega, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/ 128 123 //precalculates partial derivative factors for function yi_derivatives … … 265 260 } 266 261 }/*}}}*/ 267 268 262 IssmDouble* yi_derivatives(IssmDouble* y, int layer_index, int n, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/ 269 263 //computes yi derivatives at r=radius[layer_index]+ n/nstep*(radius[layer_index+1]-radius[layer_index]) … … 355 349 return dydx; 356 350 }/*}}}*/ 357 358 351 void propagate_yi_euler(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/ 359 352 //yields this: if we have y[j]=1.0 and y[!j]=0.0 at the bottom of the layer, what is y at the top of the layer? … … 374 367 xDelete<IssmDouble>(dydx); 375 368 }/*}}}*/ 376 377 369 void propagate_yi_RK2(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/ 378 370 //yields this: if we have y[j]=1.0 and y[!j]=0.0 at the bottom of the layer, what is y at the top of the layer? … … 409 401 xDelete<IssmDouble>(y3); 410 402 }/*}}}*/ 411 412 403 void propagate_yi_RK4(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/ 413 404 //yields this: if we have y[j]=1.0 and y[!j]=0.0 at the bottom of the layer, what is y at the top of the layer? … … 465 456 xDelete<IssmDouble>(y3); 466 457 }/*}}}*/ 467 468 458 void Innersphere_boundaryconditions(IssmDouble* yi, int layer_index, int deg, IssmDouble omega, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/ 469 459 //fills the boundary conditions at the bottom of layer[layer_index] in yi[0:2][0:5] … … 517 507 yi[5+nyi*2]=deg/(r*g0); 518 508 }/*}}}*/ 519 520 509 void build_yi_system(IssmDouble* yi, int deg, IssmDouble omega, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho) { /*{{{*/ 521 510 … … 581 570 if (matlitho->issolid[i]){ 582 571 one = -1.0; 583 if (i>0 & !matlitho->issolid[i-1]) one = 1.0;572 if (i>0 && !matlitho->issolid[i-1]) one = 1.0; 584 573 for (int j=0;j<6;j++){ 585 574 yi[(j+6*ici)+ nyi*(j+6*ici+3)] = one; … … 627 616 } 628 617 }/*}}}*/ 629 630 618 void yi_boundary_conditions(IssmDouble* yi_righthandside, int deg, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/ 631 619 … … 710 698 } 711 699 }/*}}}*/ 712 713 714 700 void solve_yi_system(IssmDouble* loveh, IssmDouble* lovel, IssmDouble* lovek, int deg, IssmDouble omega, IssmDouble* yi, IssmDouble* rhs, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/ 715 701 … … 831 817 xDelete<IssmDouble>(frequencies); 832 818 }/*}}}*/ 833 834 819 IssmDouble factorial(int n){ /*{{{*/ 835 820 IssmDouble prod=1; … … 837 822 return prod; 838 823 }/*}}}*/ 839 840 824 IssmDouble n_C_r(int n, int r){ /*{{{*/ 841 825 //n choose r … … 879 863 return res = num/den; 880 864 }/*}}}*/ 881 882 883 865 IssmDouble* postwidder_coef(int NTit){ /*{{{*/ 884 866 //Coefficients of the Post-Widder method through Saltzer summation for inverse Laplace transform: … … 903 885 return xi; 904 886 }/*}}}*/ 905 906 887 void postwidder_transform(IssmDouble* Lovet, IssmDouble* Lovef,int d, int t, int NTit, IssmDouble* xi, FemModel* femmodel){ /*{{{*/ 907 888 //Computes Lovet for time step t and degree d from the PW coefficients xi and the corresponding 2*NTit frequency samples in Lovef … … 934 915 Lovet[d*nt+t]=LoveM[NTit-1]; 935 916 }/*}}}*/ 936 937 917 void love_freq_to_temporal(IssmDouble* LoveHt,IssmDouble* LoveLt,IssmDouble* LoveKt,IssmDouble* LoveHf,IssmDouble* LoveLf,IssmDouble* LoveKf, FemModel* femmodel){ /*{{{*/ 938 918 //Transforms all frequency-dependent love numbers into time-dependent love numbers … … 957 937 xDelete<IssmDouble>(xi); 958 938 }/*}}}*/ 959 960 961 962 939 void love_core(FemModel* femmodel){ /*{{{*/ 963 940 … … 1120 1097 xDelete<IssmDouble>(LoveKernelsImag); 1121 1098 } /*}}}*/ 1122
Note:
See TracChangeset
for help on using the changeset viewer.