[cig-commits] r18562 - short/3D/PyLith/trunk/libsrc/pylith/materials
willic3 at geodynamics.org
willic3 at geodynamics.org
Wed Jun 8 21:54:38 PDT 2011
Author: willic3
Date: 2011-06-08 21:54:37 -0700 (Wed, 08 Jun 2011)
New Revision: 18562
Modified:
short/3D/PyLith/trunk/libsrc/pylith/materials/GenMaxwellIsotropic3D.cc
short/3D/PyLith/trunk/libsrc/pylith/materials/GenMaxwellPlaneStrain.cc
short/3D/PyLith/trunk/libsrc/pylith/materials/MaxwellIsotropic3D.cc
short/3D/PyLith/trunk/libsrc/pylith/materials/MaxwellPlaneStrain.cc
Log:
Fixed regular Maxwell models to properly update state variables using
initial stresses for the elastic solution. Minor changes to generalized
Maxwell models.
Modified: short/3D/PyLith/trunk/libsrc/pylith/materials/GenMaxwellIsotropic3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/materials/GenMaxwellIsotropic3D.cc 2011-06-09 04:23:38 UTC (rev 18561)
+++ short/3D/PyLith/trunk/libsrc/pylith/materials/GenMaxwellIsotropic3D.cc 2011-06-09 04:54:37 UTC (rev 18562)
@@ -814,7 +814,7 @@
// Maxwell model 3
stateVars[s_viscousStrain3+iComp] = devStrain;
} // for
- PetscLogFlops(6 + 2 * tensorSize);
+ PetscLogFlops(9 + 2 * tensorSize);
_needNewJacobian = true;
} // _updateStateVarsElastic
Modified: short/3D/PyLith/trunk/libsrc/pylith/materials/GenMaxwellPlaneStrain.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/materials/GenMaxwellPlaneStrain.cc 2011-06-09 04:23:38 UTC (rev 18561)
+++ short/3D/PyLith/trunk/libsrc/pylith/materials/GenMaxwellPlaneStrain.cc 2011-06-09 04:54:37 UTC (rev 18562)
@@ -762,7 +762,7 @@
// Maxwell model 3
stateVars[s_viscousStrain3+iComp] = devStrain;
} // for
- PetscLogFlops(2 + 2 * 4);
+ PetscLogFlops(5 + 2 * 4);
_needNewJacobian = true;
} // _updateStateVarsElastic
Modified: short/3D/PyLith/trunk/libsrc/pylith/materials/MaxwellIsotropic3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/materials/MaxwellIsotropic3D.cc 2011-06-09 04:23:38 UTC (rev 18561)
+++ short/3D/PyLith/trunk/libsrc/pylith/materials/MaxwellIsotropic3D.cc 2011-06-09 04:54:37 UTC (rev 18562)
@@ -653,23 +653,25 @@
const int tensorSize = _tensorSize;
const double maxwellTime = properties[p_maxwellTime];
- const double e11 = totalStrain[0];
- const double e22 = totalStrain[1];
- const double e33 = totalStrain[2];
+ const double strainTpdt[] = {totalStrain[0] - initialStrain[0],
+ totalStrain[1] - initialStrain[1],
+ totalStrain[2] - initialStrain[2],
+ totalStrain[3] - initialStrain[3],
+ totalStrain[4] - initialStrain[4],
+ totalStrain[5] - initialStrain[5]};
- const double traceStrainTpdt = e11 + e22 + e33;
- const double meanStrainTpdt = traceStrainTpdt / 3.0;
+ const double meanStrainTpdt =
+ (strainTpdt[0] + strainTpdt[1] + strainTpdt[2]) / 3.0;
const double diag[] = { 1.0, 1.0, 1.0, 0.0, 0.0, 0.0 };
- // :TODO: Need to account for initial values for state variables
- // and the initial strain??
+ // Initialize all viscous strains to deviatoric elastic strains.
for (int iComp=0; iComp < tensorSize; ++iComp) {
stateVars[s_totalStrain+iComp] = totalStrain[iComp];
stateVars[s_viscousStrain+iComp] =
- totalStrain[iComp] - diag[iComp] * meanStrainTpdt;
+ strainTpdt[iComp] - diag[iComp] * meanStrainTpdt;
} // for
- PetscLogFlops(3 + 2 * _tensorSize);
+ PetscLogFlops(9 + 2 * _tensorSize);
_needNewJacobian = true;
} // _updateStateVarsElastic
Modified: short/3D/PyLith/trunk/libsrc/pylith/materials/MaxwellPlaneStrain.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/materials/MaxwellPlaneStrain.cc 2011-06-09 04:23:38 UTC (rev 18561)
+++ short/3D/PyLith/trunk/libsrc/pylith/materials/MaxwellPlaneStrain.cc 2011-06-09 04:54:37 UTC (rev 18562)
@@ -612,13 +612,12 @@
const int tensorSize = _tensorSize;
const double maxwellTime = properties[p_maxwellTime];
- const double strainTpdt[] = {totalStrain[0],
- totalStrain[1],
+ const double strainTpdt[] = {totalStrain[0] - initialStrain[0],
+ totalStrain[1] - initialStrain[1],
0.0,
- totalStrain[2]};
+ totalStrain[2] - initialStrain[2]};
- const double traceStrainTpdt = strainTpdt[0] + strainTpdt[1] + strainTpdt[2];
- const double meanStrainTpdt = traceStrainTpdt / 3.0;
+ const double meanStrainTpdt = (strainTpdt[0] + strainTpdt[1])/3.0;
const double diag[] = { 1.0, 1.0, 1.0, 0.0 };
@@ -630,7 +629,7 @@
stateVars[s_viscousStrain + iComp] =
strainTpdt[iComp] - diag[iComp] * meanStrainTpdt;
} // for
- PetscLogFlops(11);
+ PetscLogFlops(13);
_needNewJacobian = true;
} // _updateStateVarsElastic
More information about the CIG-COMMITS
mailing list