source: issm/oecreview/Archive/19101-20495/ISSM-19387-19388.diff@ 20498

Last change on this file since 20498 was 20498, checked in by Mathieu Morlighem, 9 years ago

CHG: done with Archive/19101-20495

File size: 6.2 KB
  • TabularUnified ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp

     
    129129        IssmDouble epsf,stress_threshold,eps0;
    130130        IssmDouble damage,B,n,epseff;
    131131        IssmDouble eps_xx,eps_yy,eps_xy,eps1,eps2,epstmp;
    132         int domaintype,damagelaw;
     132        int domaintype;
    133133
    134134        /*Fetch number of vertices and allocate output*/
    135135        int numnodes = element->GetNumberOfNodes();
     
    139139        element->FindParam(&epsf,DamageC1Enum);
    140140        element->FindParam(&stress_threshold,DamageStressThresholdEnum);
    141141        element->FindParam(&domaintype,DomainTypeEnum);
    142         element->FindParam(&damagelaw,DamageLawEnum);
    143142
    144143        /*Compute stress tensor: */
    145144        element->ComputeStrainRate();
     
    201200        IssmDouble s_xx,s_xy,s_xz,s_yy,s_yz,s_zz,s1,s2,s3,stmp;
    202201        IssmDouble J2s,Chi,Psi,PosPsi,NegPsi;
    203202        IssmDouble damage,tau_xx,tau_xy,tau_xz,tau_yy,tau_yz,tau_zz,stressMaxPrincipal;
    204         int equivstress,domaintype,damagelaw,dim;
     203        int equivstress,domaintype,dim;
    205204
    206205        /*Fetch number of vertices and allocate output*/
    207206        int numnodes = element->GetNumberOfNodes();
     
    214213        element->FindParam(&healing,DamageHealingEnum);
    215214        element->FindParam(&stress_threshold,DamageStressThresholdEnum);
    216215        element->FindParam(&domaintype,DomainTypeEnum);
    217         element->FindParam(&damagelaw,DamageLawEnum);
    218216
    219217        /*Get problem dimension*/
    220218        switch(domaintype){
     
    290288                        }
    291289                        Psi=Chi-stress_threshold;
    292290                        NegPsi=max(-Chi,0.); /* healing only for compressive stresses */
    293 
    294                         if(damagelaw==1){
    295                                 PosPsi=max(Psi,0.);
    296                                 f[i]= c1*(pow(PosPsi,c2) - healing*pow(NegPsi,c2))*pow((1./(1.-damage)),c3);
    297                         }
    298                         else if(damagelaw==2){
    299                                 PosPsi=max(Psi,1.);
    300                                 f[i]= c1*(pow(log10(PosPsi),c2) - healing*pow(NegPsi,c2))*pow((1./(1.-damage)),c3);
    301                         }
    302                         else _error_("damage law not supported");
     291                        PosPsi=max(Psi,0.);
     292                        f[i]= c1*(pow(PosPsi,c2) - healing*pow(NegPsi,c2))*pow((1./(1.-damage)),c3);
    303293                }
    304294                else{
    305295                        if(equivstress==1){/* max principal stress */
     
    311301                        }
    312302                        Psi=Chi-stress_threshold;
    313303                        NegPsi=max(-Chi,0.); /* healing only for compressive stresses */
    314                         if(damagelaw==1){
    315                                 PosPsi=max(Psi,0.);
    316                                 f[i]= c1*(pow(PosPsi,c2) - healing*pow(NegPsi,c2))*pow((1./(1.-damage)),c3);
    317                         }
    318                         else if(damagelaw==2){
    319                                 PosPsi=max(Psi,1.);
    320                                 f[i]= c1*(pow(log10(PosPsi),c2) - healing*pow(NegPsi,c2))*pow((1./(1.-damage)),c3);
    321                         }
    322                         else _error_("damage law not supported");
     304                        PosPsi=max(Psi,0.);
     305                        f[i]= c1*(pow(PosPsi,c2) - healing*pow(NegPsi,c2))*pow((1./(1.-damage)),c3);
    323306                }
    324307        }
    325308        /*Add input*/
     
    533516                        this->CreateDamageFInputPralong(element);
    534517                        break;
    535518                case 2:
    536                         this->CreateDamageFInputPralong(element);
    537                         break;
    538                 case 3:
    539519                        this->CreateDamageFInputExp(element);
    540520                        break;
    541521                default:
  • TabularUnified ../trunk-jpl/src/c/modules/Damagex/Damagex.cpp

     
     1/*!\file Damagex
     2 * \brief: compute damage
     3 */
     4
     5#include "./Damagex.h"
     6#include "../../shared/shared.h"
     7#include "../../toolkits/toolkits.h"
     8
     9void Damagex(FemModel* femmodel){
     10
     11        /*Recover Damage law Enum*/
     12        int damagelaw;
     13        femmodel->parameters->FindParam(&damagelaw,DamageLawEnum);
     14
     15        /*Calculate damage*/
     16        switch(damagelaw){
     17                case 0:
     18                        if(VerboseModule()) _printf0_("   computing damage analytically\n");
     19                        femmodel->ElementOperationx(&Element::ComputeNewDamage);
     20                        break;
     21                case 1:
     22                case 2:
     23                        if(VerboseModule()) _printf0_("   computing damage using source term in advection scheme\n");
     24                        /* Damage calculated using source term in DamageEvolutionAnalysis */
     25                        break;
     26                default:
     27                        _error_("Damage law "<<EnumToStringx(damagelaw)<<" not implemented yet");
     28        }
     29}
  • TabularUnified ../trunk-jpl/src/c/modules/Damagex/Damagex.h

     
     1#ifndef _DAMAGEX_H
     2#define _DAMGEX_H
     3
     4#include "../../classes/classes.h"
     5#include "../../analyses/analyses.h"
     6
     7/* local prototypes: */
     8void Damagex(FemModel* femmodel);
     9
     10#endif
  • TabularUnified ../trunk-jpl/src/c/modules/modules.h

    Property changes on: ../trunk-jpl/src/c/modules/Damagex
    ___________________________________________________________________
    Added: svn:ignore
       + *.deps
    *.dirstamp
    
    
     
    1919#include "./ControlInputSetGradientx/ControlInputSetGradientx.h"
    2020#include "./CreateNodalConstraintsx/CreateNodalConstraintsx.h"
    2121#include "./CreateJacobianMatrixx/CreateJacobianMatrixx.h"
     22#include "./Damagex/Damagex.h"
    2223#include "./DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h"
    2324#include "./ExpToLevelSetx/ExpToLevelSetx.h"
    2425#include "./ElementConnectivityx/ElementConnectivityx.h"
  • TabularUnified ../trunk-jpl/src/c/Makefile.am

     
    366366endif
    367367if DAMAGEEVOLUTION
    368368issm_sources += ./analyses/DamageEvolutionAnalysis.cpp
     369issm_sources += ./modules/Damagex/Damagex.cpp
    369370endif
    370371if STRESSBALANCE
    371372issm_sources += ./analyses/StressbalanceAnalysis.cpp
  • TabularUnified ../trunk-jpl/src/c/cores/damage_core.cpp

     
    2727        femmodel->parameters->FindParam(&stabilization,DamageStabilizationEnum);
    2828
    2929        if(VerboseSolution()) _printf0_("   computing damage\n");
     30        Damagex(femmodel); /* optionally calculate damage analytically first */
    3031        femmodel->SetCurrentConfiguration(DamageEvolutionAnalysisEnum);
    3132        if(stabilization==4){
    3233                solutionsequence_fct(femmodel);
Note: See TracBrowser for help on using the repository browser.