Changeset 20198


Ignore:
Timestamp:
02/17/16 11:01:28 (9 years ago)
Author:
Mathieu Morlighem
Message:

CHG: always recompute requested output for some specific cases

File:
1 edited

Legend:

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

    r20156 r20198  
    19531953void       Element::ResultInterpolation(int* pinterpolation,int* pnodesperelement,int* parray_size, int output_enum){/*{{{*/
    19541954
     1955        /*Some intputs need to be computed, even if they are already in inputs, they might not be up to date!*/
     1956        switch(output_enum){
     1957                case ViscousHeatingEnum: this->ViscousHeatingCreateInput(); break;
     1958                case StressMaxPrincipalEnum: this->StressMaxPrincipalCreateInput(); break;
     1959                case StressTensorxxEnum:
     1960                case StressTensorxyEnum:
     1961                case StressTensorxzEnum:
     1962                case StressTensoryyEnum:
     1963                case StressTensoryzEnum:
     1964                case StressTensorzzEnum: this->ComputeStressTensor(); break;
     1965                case StrainRatexxEnum:
     1966                case StrainRatexyEnum:
     1967                case StrainRatexzEnum:
     1968                case StrainRateyyEnum:
     1969                case StrainRateyzEnum:
     1970                case StrainRatezzEnum:
     1971                case StrainRateeffectiveEnum: this->ComputeStrainRate(); break;
     1972                case DeviatoricStressxxEnum:
     1973                case DeviatoricStressxyEnum:
     1974                case DeviatoricStressxzEnum:
     1975                case DeviatoricStressyyEnum:
     1976                case DeviatoricStressyzEnum:
     1977                case DeviatoricStresszzEnum:
     1978                case DeviatoricStresseffectiveEnum: this->ComputeDeviatoricStressTensor(); break;
     1979                case SigmaNNEnum: this->ComputeSigmaNN(); break;
     1980                case NewDamageEnum: this->ComputeNewDamage(); break;
     1981                case StressIntensityFactorEnum: this->StressIntensityFactor(); break;
     1982                case CalvingratexEnum:
     1983                case CalvingrateyEnum:
     1984                case CalvingCalvingrateEnum:
     1985                        this->StrainRateparallel();
     1986                        this->StrainRateperpendicular();
     1987                        int calvinglaw;
     1988                        this->FindParam(&calvinglaw,CalvingLawEnum);
     1989                        switch(calvinglaw){
     1990                                case DefaultCalvingEnum:
     1991                                        //do nothing
     1992                                        break;
     1993                                case CalvingLevermannEnum:
     1994                                        this->CalvingRateLevermann();
     1995                                        break;
     1996                                case CalvingPiEnum:
     1997                                        this->CalvingRatePi();
     1998                                        break;
     1999                                default:
     2000                                        _error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
     2001                        }
     2002                        break;
     2003                case StrainRateparallelEnum: this->StrainRateparallel(); break;
     2004                case StrainRateperpendicularEnum: this->StrainRateperpendicular(); break;
     2005                default:
     2006                                                                                                         /*Nothing to do*/
     2007        }
     2008
     2009        /*Find input*/
    19552010        Input* input=this->inputs->GetInput(output_enum);
    19562011
    19572012        /*If this input is not already in Inputs, maybe it needs to be computed?*/
    1958         if(!input){
    1959                 switch(output_enum){
    1960                         case ViscousHeatingEnum:
    1961                                 this->ViscousHeatingCreateInput();
    1962                                 input=this->inputs->GetInput(output_enum);
    1963                                 break;
    1964                         case StressMaxPrincipalEnum:
    1965                                 this->StressMaxPrincipalCreateInput();
    1966                                 input=this->inputs->GetInput(output_enum);
    1967                                 break;
    1968                         case StressTensorxxEnum:
    1969                         case StressTensorxyEnum:
    1970                         case StressTensorxzEnum:
    1971                         case StressTensoryyEnum:
    1972                         case StressTensoryzEnum:
    1973                         case StressTensorzzEnum:
    1974                                 this->ComputeStressTensor();
    1975                                 input=this->inputs->GetInput(output_enum);
    1976                                 break;
    1977                         case StrainRatexxEnum:
    1978                         case StrainRatexyEnum:
    1979                         case StrainRatexzEnum:
    1980                         case StrainRateyyEnum:
    1981                         case StrainRateyzEnum:
    1982                         case StrainRatezzEnum:
    1983                         case StrainRateeffectiveEnum:
    1984                                 this->ComputeStrainRate();
    1985                                 input=this->inputs->GetInput(output_enum);
    1986                                 break;
    1987                         case DeviatoricStressxxEnum:
    1988                         case DeviatoricStressxyEnum:
    1989                         case DeviatoricStressxzEnum:
    1990                         case DeviatoricStressyyEnum:
    1991                         case DeviatoricStressyzEnum:
    1992                         case DeviatoricStresszzEnum:
    1993                         case DeviatoricStresseffectiveEnum:
    1994                                 this->ComputeDeviatoricStressTensor();
    1995                                 input=this->inputs->GetInput(output_enum);
    1996                                 break;
    1997                         case SigmaNNEnum:
    1998                                 this->ComputeSigmaNN();
    1999                                 input=this->inputs->GetInput(output_enum);
    2000                                 break;
    2001                         case NewDamageEnum:
    2002                                 this->ComputeNewDamage();
    2003                                 input=this->inputs->GetInput(output_enum);
    2004                                 break;
    2005                         case StressIntensityFactorEnum:
    2006                                 this->StressIntensityFactor();
    2007                                 input=this->inputs->GetInput(output_enum);
    2008                                 break;
    2009                         case CalvingratexEnum:
    2010                         case CalvingrateyEnum:
    2011                         case CalvingCalvingrateEnum:
    2012                                 this->StrainRateparallel();
    2013                                 this->StrainRateperpendicular();
    2014                                 int calvinglaw;
    2015                                 this->FindParam(&calvinglaw,CalvingLawEnum);
    2016                                         switch(calvinglaw){
    2017                                                 case DefaultCalvingEnum:
    2018                                                         //do nothing
    2019                                                         break;
    2020                                                 case CalvingLevermannEnum:
    2021                                                         this->CalvingRateLevermann();
    2022                                                         break;
    2023                                                 case CalvingPiEnum:
    2024                                                         this->CalvingRatePi();
    2025                                                         break;
    2026                                                 default:
    2027                                                         _error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
    2028                                 }
    2029                                 input=this->inputs->GetInput(output_enum);
    2030                                 break;
    2031                         case StrainRateparallelEnum:
    2032                                 this->StrainRateparallel();
    2033                                 input=this->inputs->GetInput(output_enum);
    2034                                 break;
    2035                         case StrainRateperpendicularEnum:
    2036                                 this->StrainRateperpendicular();
    2037                                 input=this->inputs->GetInput(output_enum);
    2038                                 break;
    2039                         default:
    2040                                 _error_("input "<<EnumToStringx(output_enum)<<" not found in element");
    2041                 }
    2042         }
     2013        if(!input) _error_("input "<<EnumToStringx(output_enum)<<" not found in element");
    20432014
    20442015        /*Assign output pointer*/
    2045         _assert_(input);
    20462016        *pinterpolation   = input->GetResultInterpolation();
    20472017        *pnodesperelement = input->GetResultNumberOfNodes();
Note: See TracChangeset for help on using the changeset viewer.