[20498] | 1 | Index: ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp (revision 19387)
|
---|
| 4 | +++ ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp (revision 19388)
|
---|
| 5 | @@ -129,7 +129,7 @@
|
---|
| 6 | IssmDouble epsf,stress_threshold,eps0;
|
---|
| 7 | IssmDouble damage,B,n,epseff;
|
---|
| 8 | IssmDouble eps_xx,eps_yy,eps_xy,eps1,eps2,epstmp;
|
---|
| 9 | - int domaintype,damagelaw;
|
---|
| 10 | + int domaintype;
|
---|
| 11 |
|
---|
| 12 | /*Fetch number of vertices and allocate output*/
|
---|
| 13 | int numnodes = element->GetNumberOfNodes();
|
---|
| 14 | @@ -139,7 +139,6 @@
|
---|
| 15 | element->FindParam(&epsf,DamageC1Enum);
|
---|
| 16 | element->FindParam(&stress_threshold,DamageStressThresholdEnum);
|
---|
| 17 | element->FindParam(&domaintype,DomainTypeEnum);
|
---|
| 18 | - element->FindParam(&damagelaw,DamageLawEnum);
|
---|
| 19 |
|
---|
| 20 | /*Compute stress tensor: */
|
---|
| 21 | element->ComputeStrainRate();
|
---|
| 22 | @@ -201,7 +200,7 @@
|
---|
| 23 | IssmDouble s_xx,s_xy,s_xz,s_yy,s_yz,s_zz,s1,s2,s3,stmp;
|
---|
| 24 | IssmDouble J2s,Chi,Psi,PosPsi,NegPsi;
|
---|
| 25 | IssmDouble damage,tau_xx,tau_xy,tau_xz,tau_yy,tau_yz,tau_zz,stressMaxPrincipal;
|
---|
| 26 | - int equivstress,domaintype,damagelaw,dim;
|
---|
| 27 | + int equivstress,domaintype,dim;
|
---|
| 28 |
|
---|
| 29 | /*Fetch number of vertices and allocate output*/
|
---|
| 30 | int numnodes = element->GetNumberOfNodes();
|
---|
| 31 | @@ -214,7 +213,6 @@
|
---|
| 32 | element->FindParam(&healing,DamageHealingEnum);
|
---|
| 33 | element->FindParam(&stress_threshold,DamageStressThresholdEnum);
|
---|
| 34 | element->FindParam(&domaintype,DomainTypeEnum);
|
---|
| 35 | - element->FindParam(&damagelaw,DamageLawEnum);
|
---|
| 36 |
|
---|
| 37 | /*Get problem dimension*/
|
---|
| 38 | switch(domaintype){
|
---|
| 39 | @@ -290,16 +288,8 @@
|
---|
| 40 | }
|
---|
| 41 | Psi=Chi-stress_threshold;
|
---|
| 42 | NegPsi=max(-Chi,0.); /* healing only for compressive stresses */
|
---|
| 43 | -
|
---|
| 44 | - if(damagelaw==1){
|
---|
| 45 | - PosPsi=max(Psi,0.);
|
---|
| 46 | - f[i]= c1*(pow(PosPsi,c2) - healing*pow(NegPsi,c2))*pow((1./(1.-damage)),c3);
|
---|
| 47 | - }
|
---|
| 48 | - else if(damagelaw==2){
|
---|
| 49 | - PosPsi=max(Psi,1.);
|
---|
| 50 | - f[i]= c1*(pow(log10(PosPsi),c2) - healing*pow(NegPsi,c2))*pow((1./(1.-damage)),c3);
|
---|
| 51 | - }
|
---|
| 52 | - else _error_("damage law not supported");
|
---|
| 53 | + PosPsi=max(Psi,0.);
|
---|
| 54 | + f[i]= c1*(pow(PosPsi,c2) - healing*pow(NegPsi,c2))*pow((1./(1.-damage)),c3);
|
---|
| 55 | }
|
---|
| 56 | else{
|
---|
| 57 | if(equivstress==1){/* max principal stress */
|
---|
| 58 | @@ -311,15 +301,8 @@
|
---|
| 59 | }
|
---|
| 60 | Psi=Chi-stress_threshold;
|
---|
| 61 | NegPsi=max(-Chi,0.); /* healing only for compressive stresses */
|
---|
| 62 | - if(damagelaw==1){
|
---|
| 63 | - PosPsi=max(Psi,0.);
|
---|
| 64 | - f[i]= c1*(pow(PosPsi,c2) - healing*pow(NegPsi,c2))*pow((1./(1.-damage)),c3);
|
---|
| 65 | - }
|
---|
| 66 | - else if(damagelaw==2){
|
---|
| 67 | - PosPsi=max(Psi,1.);
|
---|
| 68 | - f[i]= c1*(pow(log10(PosPsi),c2) - healing*pow(NegPsi,c2))*pow((1./(1.-damage)),c3);
|
---|
| 69 | - }
|
---|
| 70 | - else _error_("damage law not supported");
|
---|
| 71 | + PosPsi=max(Psi,0.);
|
---|
| 72 | + f[i]= c1*(pow(PosPsi,c2) - healing*pow(NegPsi,c2))*pow((1./(1.-damage)),c3);
|
---|
| 73 | }
|
---|
| 74 | }
|
---|
| 75 | /*Add input*/
|
---|
| 76 | @@ -533,9 +516,6 @@
|
---|
| 77 | this->CreateDamageFInputPralong(element);
|
---|
| 78 | break;
|
---|
| 79 | case 2:
|
---|
| 80 | - this->CreateDamageFInputPralong(element);
|
---|
| 81 | - break;
|
---|
| 82 | - case 3:
|
---|
| 83 | this->CreateDamageFInputExp(element);
|
---|
| 84 | break;
|
---|
| 85 | default:
|
---|
| 86 | Index: ../trunk-jpl/src/c/modules/Damagex/Damagex.cpp
|
---|
| 87 | ===================================================================
|
---|
| 88 | --- ../trunk-jpl/src/c/modules/Damagex/Damagex.cpp (revision 0)
|
---|
| 89 | +++ ../trunk-jpl/src/c/modules/Damagex/Damagex.cpp (revision 19388)
|
---|
| 90 | @@ -0,0 +1,29 @@
|
---|
| 91 | +/*!\file Damagex
|
---|
| 92 | + * \brief: compute damage
|
---|
| 93 | + */
|
---|
| 94 | +
|
---|
| 95 | +#include "./Damagex.h"
|
---|
| 96 | +#include "../../shared/shared.h"
|
---|
| 97 | +#include "../../toolkits/toolkits.h"
|
---|
| 98 | +
|
---|
| 99 | +void Damagex(FemModel* femmodel){
|
---|
| 100 | +
|
---|
| 101 | + /*Recover Damage law Enum*/
|
---|
| 102 | + int damagelaw;
|
---|
| 103 | + femmodel->parameters->FindParam(&damagelaw,DamageLawEnum);
|
---|
| 104 | +
|
---|
| 105 | + /*Calculate damage*/
|
---|
| 106 | + switch(damagelaw){
|
---|
| 107 | + case 0:
|
---|
| 108 | + if(VerboseModule()) _printf0_(" computing damage analytically\n");
|
---|
| 109 | + femmodel->ElementOperationx(&Element::ComputeNewDamage);
|
---|
| 110 | + break;
|
---|
| 111 | + case 1:
|
---|
| 112 | + case 2:
|
---|
| 113 | + if(VerboseModule()) _printf0_(" computing damage using source term in advection scheme\n");
|
---|
| 114 | + /* Damage calculated using source term in DamageEvolutionAnalysis */
|
---|
| 115 | + break;
|
---|
| 116 | + default:
|
---|
| 117 | + _error_("Damage law "<<EnumToStringx(damagelaw)<<" not implemented yet");
|
---|
| 118 | + }
|
---|
| 119 | +}
|
---|
| 120 | Index: ../trunk-jpl/src/c/modules/Damagex/Damagex.h
|
---|
| 121 | ===================================================================
|
---|
| 122 | --- ../trunk-jpl/src/c/modules/Damagex/Damagex.h (revision 0)
|
---|
| 123 | +++ ../trunk-jpl/src/c/modules/Damagex/Damagex.h (revision 19388)
|
---|
| 124 | @@ -0,0 +1,10 @@
|
---|
| 125 | +#ifndef _DAMAGEX_H
|
---|
| 126 | +#define _DAMGEX_H
|
---|
| 127 | +
|
---|
| 128 | +#include "../../classes/classes.h"
|
---|
| 129 | +#include "../../analyses/analyses.h"
|
---|
| 130 | +
|
---|
| 131 | +/* local prototypes: */
|
---|
| 132 | +void Damagex(FemModel* femmodel);
|
---|
| 133 | +
|
---|
| 134 | +#endif
|
---|
| 135 |
|
---|
| 136 | Property changes on: ../trunk-jpl/src/c/modules/Damagex
|
---|
| 137 | ___________________________________________________________________
|
---|
| 138 | Added: svn:ignore
|
---|
| 139 | + *.deps
|
---|
| 140 | *.dirstamp
|
---|
| 141 |
|
---|
| 142 |
|
---|
| 143 | Index: ../trunk-jpl/src/c/modules/modules.h
|
---|
| 144 | ===================================================================
|
---|
| 145 | --- ../trunk-jpl/src/c/modules/modules.h (revision 19387)
|
---|
| 146 | +++ ../trunk-jpl/src/c/modules/modules.h (revision 19388)
|
---|
| 147 | @@ -19,6 +19,7 @@
|
---|
| 148 | #include "./ControlInputSetGradientx/ControlInputSetGradientx.h"
|
---|
| 149 | #include "./CreateNodalConstraintsx/CreateNodalConstraintsx.h"
|
---|
| 150 | #include "./CreateJacobianMatrixx/CreateJacobianMatrixx.h"
|
---|
| 151 | +#include "./Damagex/Damagex.h"
|
---|
| 152 | #include "./DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h"
|
---|
| 153 | #include "./ExpToLevelSetx/ExpToLevelSetx.h"
|
---|
| 154 | #include "./ElementConnectivityx/ElementConnectivityx.h"
|
---|
| 155 | Index: ../trunk-jpl/src/c/Makefile.am
|
---|
| 156 | ===================================================================
|
---|
| 157 | --- ../trunk-jpl/src/c/Makefile.am (revision 19387)
|
---|
| 158 | +++ ../trunk-jpl/src/c/Makefile.am (revision 19388)
|
---|
| 159 | @@ -366,6 +366,7 @@
|
---|
| 160 | endif
|
---|
| 161 | if DAMAGEEVOLUTION
|
---|
| 162 | issm_sources += ./analyses/DamageEvolutionAnalysis.cpp
|
---|
| 163 | +issm_sources += ./modules/Damagex/Damagex.cpp
|
---|
| 164 | endif
|
---|
| 165 | if STRESSBALANCE
|
---|
| 166 | issm_sources += ./analyses/StressbalanceAnalysis.cpp
|
---|
| 167 | Index: ../trunk-jpl/src/c/cores/damage_core.cpp
|
---|
| 168 | ===================================================================
|
---|
| 169 | --- ../trunk-jpl/src/c/cores/damage_core.cpp (revision 19387)
|
---|
| 170 | +++ ../trunk-jpl/src/c/cores/damage_core.cpp (revision 19388)
|
---|
| 171 | @@ -27,6 +27,7 @@
|
---|
| 172 | femmodel->parameters->FindParam(&stabilization,DamageStabilizationEnum);
|
---|
| 173 |
|
---|
| 174 | if(VerboseSolution()) _printf0_(" computing damage\n");
|
---|
| 175 | + Damagex(femmodel); /* optionally calculate damage analytically first */
|
---|
| 176 | femmodel->SetCurrentConfiguration(DamageEvolutionAnalysisEnum);
|
---|
| 177 | if(stabilization==4){
|
---|
| 178 | solutionsequence_fct(femmodel);
|
---|