source:
issm/oecreview/Archive/19101-20495/ISSM-19387-19388.diff@
20498
Last change on this file since 20498 was 20498, checked in by , 9 years ago | |
---|---|
File size: 6.2 KB |
-
TabularUnified ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp
129 129 IssmDouble epsf,stress_threshold,eps0; 130 130 IssmDouble damage,B,n,epseff; 131 131 IssmDouble eps_xx,eps_yy,eps_xy,eps1,eps2,epstmp; 132 int domaintype ,damagelaw;132 int domaintype; 133 133 134 134 /*Fetch number of vertices and allocate output*/ 135 135 int numnodes = element->GetNumberOfNodes(); … … 139 139 element->FindParam(&epsf,DamageC1Enum); 140 140 element->FindParam(&stress_threshold,DamageStressThresholdEnum); 141 141 element->FindParam(&domaintype,DomainTypeEnum); 142 element->FindParam(&damagelaw,DamageLawEnum);143 142 144 143 /*Compute stress tensor: */ 145 144 element->ComputeStrainRate(); … … 201 200 IssmDouble s_xx,s_xy,s_xz,s_yy,s_yz,s_zz,s1,s2,s3,stmp; 202 201 IssmDouble J2s,Chi,Psi,PosPsi,NegPsi; 203 202 IssmDouble damage,tau_xx,tau_xy,tau_xz,tau_yy,tau_yz,tau_zz,stressMaxPrincipal; 204 int equivstress,domaintype,d amagelaw,dim;203 int equivstress,domaintype,dim; 205 204 206 205 /*Fetch number of vertices and allocate output*/ 207 206 int numnodes = element->GetNumberOfNodes(); … … 214 213 element->FindParam(&healing,DamageHealingEnum); 215 214 element->FindParam(&stress_threshold,DamageStressThresholdEnum); 216 215 element->FindParam(&domaintype,DomainTypeEnum); 217 element->FindParam(&damagelaw,DamageLawEnum);218 216 219 217 /*Get problem dimension*/ 220 218 switch(domaintype){ … … 290 288 } 291 289 Psi=Chi-stress_threshold; 292 290 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); 303 293 } 304 294 else{ 305 295 if(equivstress==1){/* max principal stress */ … … 311 301 } 312 302 Psi=Chi-stress_threshold; 313 303 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); 323 306 } 324 307 } 325 308 /*Add input*/ … … 533 516 this->CreateDamageFInputPralong(element); 534 517 break; 535 518 case 2: 536 this->CreateDamageFInputPralong(element);537 break;538 case 3:539 519 this->CreateDamageFInputExp(element); 540 520 break; 541 521 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 9 void 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: */ 8 void 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
19 19 #include "./ControlInputSetGradientx/ControlInputSetGradientx.h" 20 20 #include "./CreateNodalConstraintsx/CreateNodalConstraintsx.h" 21 21 #include "./CreateJacobianMatrixx/CreateJacobianMatrixx.h" 22 #include "./Damagex/Damagex.h" 22 23 #include "./DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h" 23 24 #include "./ExpToLevelSetx/ExpToLevelSetx.h" 24 25 #include "./ElementConnectivityx/ElementConnectivityx.h" -
TabularUnified ../trunk-jpl/src/c/Makefile.am
366 366 endif 367 367 if DAMAGEEVOLUTION 368 368 issm_sources += ./analyses/DamageEvolutionAnalysis.cpp 369 issm_sources += ./modules/Damagex/Damagex.cpp 369 370 endif 370 371 if STRESSBALANCE 371 372 issm_sources += ./analyses/StressbalanceAnalysis.cpp -
TabularUnified ../trunk-jpl/src/c/cores/damage_core.cpp
27 27 femmodel->parameters->FindParam(&stabilization,DamageStabilizationEnum); 28 28 29 29 if(VerboseSolution()) _printf0_(" computing damage\n"); 30 Damagex(femmodel); /* optionally calculate damage analytically first */ 30 31 femmodel->SetCurrentConfiguration(DamageEvolutionAnalysisEnum); 31 32 if(stabilization==4){ 32 33 solutionsequence_fct(femmodel);
Note:
See TracBrowser
for help on using the repository browser.