Changeset 20023


Ignore:
Timestamp:
01/29/16 17:16:08 (9 years ago)
Author:
Eric.Larour
Message:

CHG: use precomputed legendre polynomial values if requested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r20018 r20023  
    35583558        /*recover legendre coefficients if they have been precomputed:*/
    35593559        this->parameters->FindParam(&legendre_precompute,SealevelriseLegendrePrecomputeEnum);
    3560         if(legendre_precompute)this->parameters->FindParam(&legendre_coefficients,&M,NULL,SealevelriseLegendreCoefficientsEnum);
     3560        if(legendre_precompute){
     3561                DoubleMatParam* parameter = static_cast<DoubleMatParam*>(this->parameters->FindParamObject(SealevelriseLegendreCoefficientsEnum)); _assert_(parameter);
     3562                parameter->GetParameterValueByPointer(&legendre_coefficients,NULL,&M);
     3563        }
    35613564
    35623565        /*how many dofs are we working with here? */
     
    36443647                                G_elastic = (love_k[nl-1]-love_h[nl-1])/2.0/sin(alpha/2.0);
    36453648                                if(legendre_precompute){
    3646                                         for(int n=0;n<nl;n++) G_elastic += deltalove[n]*legendre_coefficients[reCast<int,IssmDouble>((M-1)*(cosalpha+1.0)/2.0)*nl+n];
     3649                                        int index=reCast<int,IssmDouble>((M-1)*(1-alpha/PI));
     3650                                        for(int n=0;n<nl;n++) G_elastic += deltalove[n]*legendre_coefficients[M*n + index];
    36473651                                }
    36483652                                else{
     
    38043808                /*recover legendre coefficients if they have been precomputed:*/
    38053809                this->parameters->FindParam(&legendre_precompute,SealevelriseLegendrePrecomputeEnum);
    3806                 if(legendre_precompute)this->parameters->FindParam(&legendre_coefficients,&M,NULL,SealevelriseLegendreCoefficientsEnum);
     3810                if(legendre_precompute){
     3811                        DoubleMatParam* parameter = static_cast<DoubleMatParam*>(this->parameters->FindParamObject(SealevelriseLegendreCoefficientsEnum)); _assert_(parameter);
     3812                        parameter->GetParameterValueByPointer(&legendre_coefficients,NULL,&M);
     3813                }
    38073814
    38083815                /*Speed up of love number comutation for elastic mode: */
     
    38453852                                G_elastic[i] = (love_k[nl-1]-love_h[nl-1])/2.0/sin(alpha/2.0);
    38463853                                if(legendre_precompute){
    3847                                         for(int n=0;n<nl;n++) G_elastic[i] += deltalove[n]*legendre_coefficients[reCast<int,IssmDouble>((M-1)*(cosalpha+1.0)/2.0)*nl+n];
     3854                                        int index=reCast<int,IssmDouble>((M-1)*(1-alpha/PI));
     3855                                        for(int n=0;n<nl;n++) G_elastic[i] += deltalove[n]*legendre_coefficients[M*n + index];
    38483856                                }
    38493857                                else{
Note: See TracChangeset for help on using the changeset viewer.