Ignore:
Timestamp:
07/03/20 06:23:13 (5 years ago)
Author:
Cheng Gong
Message:

NEW: add an inversion of the friciton coefficient in Schoof's friction law.
In order to reuse the default code of the Budd's law, the coefficient C in Schoof's law is changed to C=sqrt(C_old).
The name of the control_parameter in Schoof's law is called 'FrictionC'.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp

    r24933 r25201  
    11031103        if(control_type!=MaterialsRheologyBbarEnum &&
    11041104                control_type!=FrictionCoefficientEnum   &&
     1105                control_type!=FrictionCEnum   &&
    11051106                control_type!=FrictionAsEnum   &&
    11061107                control_type!=DamageDbarEnum            &&
     
    11261127        switch(control_type){
    11271128                case FrictionCoefficientEnum:
     1129                case FrictionCEnum:
    11281130                        switch(approximation){
    11291131                                case SSAApproximationEnum: GradientJDragSSA(element,gradient,control_index); break;
     
    16521654        /*Intermediaries*/
    16531655        int      domaintype,dim;
     1656        int frictionlaw;
    16541657        Element* basalelement;
    16551658
     
    16901693        basalelement->GetVerticesCoordinates(&xyz_list);
    16911694        basalelement->GradientIndexing(&vertexpidlist[0],control_index);
    1692         Input2* dragcoefficient_input = basalelement->GetInput2(FrictionCoefficientEnum);                _assert_(dragcoefficient_input);
     1695
     1696        /* get the friction law: if 11-Schoof, use a special name for the coefficient*/
     1697        element->FindParam(&frictionlaw, FrictionLawEnum);
     1698        Input2* dragcoefficient_input;
     1699        switch(frictionlaw) {
     1700                case 11:
     1701                        dragcoefficient_input = basalelement->GetInput2(FrictionCEnum); _assert_(dragcoefficient_input);
     1702                        break;
     1703                default:
     1704                        dragcoefficient_input = basalelement->GetInput2(FrictionCoefficientEnum); _assert_(dragcoefficient_input);
     1705        }
     1706
    16931707        DatasetInput2* weights_input         = basalelement->GetDatasetInput2(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
    16941708
     
    19391953        /*Fetch number of vertices for this finite element*/
    19401954        int numvertices = basalelement->GetNumberOfVertices();
     1955        int frictionlaw;
    19411956
    19421957        /*Initialize some vectors*/
     
    19551970        Input2* adjointx_input  = basalelement->GetInput2(AdjointxEnum);             _assert_(adjointx_input);
    19561971        Input2* adjointy_input  = basalelement->GetInput2(AdjointyEnum);             _assert_(adjointy_input);
    1957         Input2* dragcoeff_input = basalelement->GetInput2(FrictionCoefficientEnum);  _assert_(dragcoeff_input);
     1972
     1973        /* get the friction law: 1- Budd, 11-Schoof*/
     1974        element->FindParam(&frictionlaw, FrictionLawEnum);
     1975        Input2* dragcoeff_input;
     1976        switch(frictionlaw) {
     1977                case 1:
     1978                        dragcoeff_input = basalelement->GetInput2(FrictionCoefficientEnum); _assert_(dragcoeff_input);
     1979                        break;
     1980                case 11:
     1981                        dragcoeff_input = basalelement->GetInput2(FrictionCEnum); _assert_(dragcoeff_input);
     1982                        break;
     1983                default:
     1984                        _error_("Friction law "<< frictionlaw <<" not supported in the inversion.");
     1985        }
    19581986
    19591987        /* Start  looping on the number of gaussian points: */
Note: See TracChangeset for help on using the changeset viewer.