Changeset 26237


Ignore:
Timestamp:
05/04/21 12:41:09 (4 years ago)
Author:
Mathieu Morlighem
Message:

CHG: minor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/trunk-jpl/src/c/cores/love_core.cpp

    r26236 r26237  
    99#include "../modules/modules.h"
    1010#include "../solutionsequences/solutionsequences.h"
    11 #include "petscblaslapack.h"
    12 
     11#include <petscblaslapack.h>
    1312
    1413void love_init(FemModel* femmodel, Matlitho* matlitho){/*{{{*/
     
    4241        femmodel->parameters->SetParam(nyi,LoveNYiEquationsEnum);
    4342        femmodel->parameters->SetParam(starting_layer,LoveStartingLayerEnum);
    44 }
    45 
     43}/*}}}*/
    4644void GetEarthRheology(IssmDouble* pla, IssmDouble* pmu, int layer_index, IssmDouble omega,FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
    4745
     
    103101
    104102} /*}}}*/
    105 
    106 
    107103IssmDouble GetGravity(IssmDouble r2, int layer_index, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
    108104        //computes gravity at radius r2
     
    124120        return  g= GG*M/pow(r2,2.0);
    125121}/*}}}*/
    126 
    127122void fill_yi_prefactor(IssmDouble* yi_prefactor, int* pdeg, IssmDouble* pomega, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
    128123        //precalculates partial derivative factors for function yi_derivatives
     
    265260        }
    266261}/*}}}*/
    267 
    268262IssmDouble* yi_derivatives(IssmDouble* y, int layer_index, int n, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
    269263        //computes yi derivatives at r=radius[layer_index]+ n/nstep*(radius[layer_index+1]-radius[layer_index])
     
    355349        return dydx;
    356350}/*}}}*/
    357 
    358351void propagate_yi_euler(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
    359352        //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?
     
    374367        xDelete<IssmDouble>(dydx);
    375368}/*}}}*/
    376 
    377369void propagate_yi_RK2(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
    378370        //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?
     
    409401        xDelete<IssmDouble>(y3);
    410402}/*}}}*/
    411 
    412403void propagate_yi_RK4(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
    413404        //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?
     
    465456        xDelete<IssmDouble>(y3);
    466457}/*}}}*/
    467 
    468458void Innersphere_boundaryconditions(IssmDouble* yi, int layer_index, int deg, IssmDouble omega, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
    469459        //fills the boundary conditions at the bottom of layer[layer_index] in yi[0:2][0:5]
     
    517507        yi[5+nyi*2]=deg/(r*g0);
    518508}/*}}}*/
    519 
    520509void build_yi_system(IssmDouble* yi, int deg, IssmDouble omega, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho) { /*{{{*/
    521510
     
    581570                if (matlitho->issolid[i]){
    582571                        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;
    584573                        for (int j=0;j<6;j++){
    585574                                yi[(j+6*ici)+ nyi*(j+6*ici+3)] = one;
     
    627616        }
    628617}/*}}}*/
    629 
    630618void yi_boundary_conditions(IssmDouble* yi_righthandside, int deg, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
    631619
     
    710698        }
    711699}/*}}}*/
    712 
    713 
    714700void solve_yi_system(IssmDouble* loveh, IssmDouble* lovel, IssmDouble* lovek, int deg, IssmDouble omega, IssmDouble* yi, IssmDouble* rhs, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
    715701
     
    831817        xDelete<IssmDouble>(frequencies);       
    832818}/*}}}*/
    833 
    834819IssmDouble factorial(int n){ /*{{{*/
    835820        IssmDouble prod=1;
     
    837822        return prod;
    838823}/*}}}*/
    839 
    840824IssmDouble n_C_r(int n, int r){ /*{{{*/
    841825        //n choose r
     
    879863        return res = num/den;
    880864}/*}}}*/
    881 
    882 
    883865IssmDouble* postwidder_coef(int NTit){ /*{{{*/
    884866        //Coefficients of the Post-Widder method through Saltzer summation for inverse Laplace transform:
     
    903885        return xi;
    904886}/*}}}*/
    905 
    906887void postwidder_transform(IssmDouble* Lovet, IssmDouble* Lovef,int d, int t, int NTit, IssmDouble* xi, FemModel* femmodel){ /*{{{*/
    907888        //Computes Lovet for time step t and degree d from the PW coefficients xi and the corresponding 2*NTit frequency samples in Lovef
     
    934915        Lovet[d*nt+t]=LoveM[NTit-1];
    935916}/*}}}*/
    936 
    937917void love_freq_to_temporal(IssmDouble* LoveHt,IssmDouble* LoveLt,IssmDouble* LoveKt,IssmDouble* LoveHf,IssmDouble* LoveLf,IssmDouble* LoveKf, FemModel* femmodel){ /*{{{*/
    938918        //Transforms all frequency-dependent love numbers into time-dependent love numbers
     
    957937        xDelete<IssmDouble>(xi);
    958938}/*}}}*/
    959 
    960 
    961 
    962939void love_core(FemModel* femmodel){ /*{{{*/
    963940
     
    11201097        xDelete<IssmDouble>(LoveKernelsImag);
    11211098} /*}}}*/
    1122 
Note: See TracChangeset for help on using the changeset viewer.