[cig-commits] [commit] knepley/upgrade-petsc-interface: Added tests for out-of-plane initial stress. (c43037a)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Mon Feb 3 15:05:29 PST 2014
Repository : ssh://geoshell/pylith
On branch : knepley/upgrade-petsc-interface
Link : https://github.com/geodynamics/pylith/compare/ce57346d13de006e0a70f6ecbe8fd7683fe6f38e...c43037a41530c56ce066a8e3a571204e92b1be6c
>---------------------------------------------------------------
commit c43037a41530c56ce066a8e3a571204e92b1be6c
Author: Charles Williams <C.Williams at gns.cri.nz>
Date: Tue Feb 4 12:04:21 2014 +1300
Added tests for out-of-plane initial stress.
>---------------------------------------------------------------
c43037a41530c56ce066a8e3a571204e92b1be6c
tests/2d/powerlaw/Makefile.am | 5 ++
...xialdisp2d.cfg => axialdisp_init_stress_2d.cfg} | 19 +++++--
...xialdisp3d.cfg => axialdisp_init_stress_3d.cfg} | 58 +++++++++++++---------
tests/2d/powerlaw/init_state_2d.spatialdb | 38 ++++++++++++++
tests/2d/powerlaw/init_stress_2d.spatialdb | 29 +++++++++++
.../2d/powerlaw/init_stress_3d.spatialdb | 11 ++--
6 files changed, 126 insertions(+), 34 deletions(-)
diff --git a/tests/2d/powerlaw/Makefile.am b/tests/2d/powerlaw/Makefile.am
index c04fa6a..28390b3 100644
--- a/tests/2d/powerlaw/Makefile.am
+++ b/tests/2d/powerlaw/Makefile.am
@@ -20,6 +20,11 @@ dist_noinst_DATA = \
README \
axialdisp2d.cfg \
axialdisp3d.cfg \
+ axialdisp_init_stress_2d.cfg \
+ axialdisp_init_stress_3d.cfg \
+ init_state_2d.spatialdb \
+ init_stress_2d.spatialdb \
+ init_stress_3d.spatialdb \
planestrain2d.cfg \
planestrain3d.cfg \
pylithapp.cfg \
diff --git a/tests/2d/powerlaw/axialdisp2d.cfg b/tests/2d/powerlaw/axialdisp_init_stress_2d.cfg
similarity index 79%
copy from tests/2d/powerlaw/axialdisp2d.cfg
copy to tests/2d/powerlaw/axialdisp_init_stress_2d.cfg
index a067551..e5683f8 100644
--- a/tests/2d/powerlaw/axialdisp2d.cfg
+++ b/tests/2d/powerlaw/axialdisp_init_stress_2d.cfg
@@ -1,5 +1,5 @@
-# To run this problem, type "pylith planestrain2d.cfg axialdisp2d.cfg".
+# To run this problem, type "pylith planestrain2d.cfg axialdisp_init_stress_2d.cfg".
# The settings in pylithapp.cfg will be read by default. See the README for
# how to run other problems in this directory.
#
@@ -16,6 +16,8 @@
# Axial tension is applied by pulling on the left and right boundaries
# in the horizontal direction.
# Bottom boundary is pinned in the vertical direction.
+# The difference between this problem and axialdisp2d.cfg is that initial
+# stresses are applied.
[pylithapp]
@@ -87,17 +89,28 @@ label = y_neg
db_initial.label = Dirichlet BC -y edge
# ----------------------------------------------------------------------
+# initial stresses
+# ----------------------------------------------------------------------
+[pylithapp.problem.materials.material]
+db_initial_stress = spatialdata.spatialdb.SimpleDB
+db_initial_stress.label = 2D initial stress
+db_initial_stress.iohandler.filename = init_stress_2d.spatialdb
+db_initial_state = spatialdata.spatialdb.SimpleDB
+db_initial_state.label = Out of plane strain initial stress
+db_initial_state.iohandler.filename = init_state_2d.spatialdb
+
+# ----------------------------------------------------------------------
# output
# ----------------------------------------------------------------------
# Give basename for VTK output of solution over domain.
[pylithapp.problem.formulation.output.output.writer]
-filename = axialdisp2d.vtk
+filename = axialdisp_init_stress_2d.vtk
time_format = %04.0f
time_constant = 1.0*year
# Give basename for VTK output of state variables.
[pylithapp.timedependent.materials.material.output]
cell_filter = pylith.meshio.CellFilterAvg
-writer.filename = axialdisp2d-statevars.vtk
+writer.filename = axialdisp_init_stress_2d-statevars.vtk
writer.time_format = %04.0f
writer.time_constant = 1.0*year
diff --git a/tests/2d/powerlaw/axialdisp3d.cfg b/tests/2d/powerlaw/axialdisp_init_stress_3d.cfg
similarity index 70%
copy from tests/2d/powerlaw/axialdisp3d.cfg
copy to tests/2d/powerlaw/axialdisp_init_stress_3d.cfg
index 611353a..9a852e5 100644
--- a/tests/2d/powerlaw/axialdisp3d.cfg
+++ b/tests/2d/powerlaw/axialdisp_init_stress_3d.cfg
@@ -1,5 +1,5 @@
-# To run this problem, type "pylith planestrain.cfg axialdisp3d.cfg".
+# To run this problem, type "pylith planestrain3d.cfg axialdisp_init_stress_3d.cfg".
# The settings in pylithapp.cfg will be read by default. See the README for
# how to run other problems in this directory.
#
@@ -16,8 +16,10 @@
# Axial tension is applied by pulling on the left and right boundaries
# in the horizontal direction.
# Bottom boundary is pinned in the vertical direction.
-# In this problem, we are simulating plane strain, so all z-displacements
-# are fixed.
+# Displacements into and out of the plane (z-direction) are pinned to simulate
+# a plane strain problem.
+# The difference between this problem and axialdisp3d.cfg is that initial
+# stresses are applied.
[pylithapp]
@@ -27,7 +29,7 @@
# Specify the problem settings.
[pylithapp.timedependent]
# Set bc to an array with 5 boundary conditions: 'x_neg', 'x_pos', 'y_neg',
-# 'z_neg', 'z_pos'.
+# 'z_neg', and 'z_pos'.
bc = [x_neg,x_pos,y_neg,z_neg,z_pos]
# ----------------------------------------------------------------------
@@ -48,8 +50,8 @@ label = x_neg
# ZeroDispDB (which has a uniform zero spatial distribution) to UniformDB.
db_initial = spatialdata.spatialdb.UniformDB
-# Assign the label 'Dirichlet BC -x edge' to the database.
-db_initial.label = Dirichlet BC -x edge
+# Assign the label 'Dirichlet BC -x face' to the database.
+db_initial.label = Dirichlet BC -x face
# Assign the displacement BC values
db_initial.values = [displacement-x]
@@ -69,8 +71,8 @@ label = x_pos
# ZeroDispDB (which has a uniform spatial distribution) to UniformDB
db_initial = spatialdata.spatialdb.UniformDB
-# Assign the label 'Dirichlet BC +x edge' to the database.
-db_initial.label = Dirichlet BC +x edge
+# Assign the label 'Dirichlet BC +x face' to the database.
+db_initial.label = Dirichlet BC +x face
# Assign the displacement BC values
db_initial.values = [displacement-x]
@@ -86,47 +88,55 @@ bc_dof = [1]
# condition have the name 'y_neg'.
label = y_neg
-# Assign the label 'Dirichlet BC -y corners' to the database.
-db_initial.label = Dirichlet BC -y edge
+# Assign the label 'Dirichlet BC -y face' to the database.
+db_initial.label = Dirichlet BC -y face
-# Boundary conditions to be applied to the front of the mesh.
-[pylithapp.timedependent.bc.z_pos]
+# Boundary conditions to be applied to the back boundary of the mesh.
+[pylithapp.timedependent.bc.z_neg]
# We are fixing the 2 (z) degree of freedom.
bc_dof = [2]
# The group of vertices in the mesh file associated with this boundary
-# condition have the name 'z_pos'.
-label = z_pos
+# condition have the name 'z_neg'.
+label = z_neg
-# Assign the label 'Dirichlet BC +z corners' to the database.
-db_initial.label = Dirichlet BC +z edge
+# Assign the label 'Dirichlet BC -z face' to the database.
+db_initial.label = Dirichlet BC -z face
-# Boundary conditions to be applied to the back of the mesh.
-[pylithapp.timedependent.bc.z_neg]
+# Boundary conditions to be applied to the front boundary of the mesh.
+[pylithapp.timedependent.bc.z_pos]
# We are fixing the 2 (z) degree of freedom.
bc_dof = [2]
# The group of vertices in the mesh file associated with this boundary
-# condition have the name 'z_neg'.
-label = z_neg
+# condition have the name 'z_pos'.
+label = z_pos
-# Assign the label 'Dirichlet BC -z corners' to the database.
-db_initial.label = Dirichlet BC -z edge
+# Assign the label 'Dirichlet BC +z face' to the database.
+db_initial.label = Dirichlet BC +z face
+
+# ----------------------------------------------------------------------
+# initial stresses
+# ----------------------------------------------------------------------
+[pylithapp.problem.materials.material]
+db_initial_stress = spatialdata.spatialdb.SimpleDB
+db_initial_stress.label = 3D initial stress
+db_initial_stress.iohandler.filename = init_stress_3d.spatialdb
# ----------------------------------------------------------------------
# output
# ----------------------------------------------------------------------
# Give basename for VTK output of solution over domain.
[pylithapp.problem.formulation.output.output.writer]
-filename = axialdisp3d.vtk
+filename = axialdisp_init_stress_3d.vtk
time_format = %04.0f
time_constant = 1.0*year
# Give basename for VTK output of state variables.
[pylithapp.timedependent.materials.material.output]
cell_filter = pylith.meshio.CellFilterAvg
-writer.filename = axialdisp3d-statevars.vtk
+writer.filename = axialdisp_init_stress_3d-statevars.vtk
writer.time_format = %04.0f
writer.time_constant = 1.0*year
diff --git a/tests/2d/powerlaw/init_state_2d.spatialdb b/tests/2d/powerlaw/init_state_2d.spatialdb
new file mode 100644
index 0000000..e7b5614
--- /dev/null
+++ b/tests/2d/powerlaw/init_state_2d.spatialdb
@@ -0,0 +1,38 @@
+// -*- C++ -*- (tell Emacs to use C++ mode for syntax highlighting)
+//
+// This spatial database specifies the initial state variables.
+//
+#SPATIAL.ascii 1
+SimpleDB {
+ num-values = 12
+
+ // names of the stress components
+ value-names = stress-zz-initial total-strain-xx total-strain-yy total-strain-xy viscous-strain-xx viscous-strain-yy viscous-strain-zz viscous-strain-xy stress4-xx stress4-yy stress4-zz stress4-xy
+
+ value-units = Pa None None None None None None None Pa Pa Pa Pa
+
+ num-locs = 1
+
+ data-dim = 0
+ space-dim = 2
+ cs-data = cartesian {
+ to-meters = 1.0
+ space-dim = 2
+ }
+}
+// Columns are
+// (1) x coordinate (m)
+// (2) y coordinate (m)
+// (3) stress-zz-initial (Pa)
+// (4) total-strain-xx (None)
+// (5) total-strain-yy (None)
+// (6) total-strain-xy (None)
+// (7) viscous-strain-xx (None)
+// (8) viscous-strain-yy (None)
+// (9) viscous-strain-zz (None)
+// (10) viscous-strain-xy (None)
+// (11) stress4-xx (None)
+// (12) stress4-yy (None)
+// (13) stress4-zz (None)
+// (14) stress4-xy (None)
+0.0 0.0 -1.5e8 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
diff --git a/tests/2d/powerlaw/init_stress_2d.spatialdb b/tests/2d/powerlaw/init_stress_2d.spatialdb
new file mode 100644
index 0000000..2a43705
--- /dev/null
+++ b/tests/2d/powerlaw/init_stress_2d.spatialdb
@@ -0,0 +1,29 @@
+// -*- C++ -*- (tell Emacs to use C++ mode for syntax highlighting)
+//
+// This spatial database specifies the initial stresses for the model
+//
+#SPATIAL.ascii 1
+SimpleDB {
+ num-values = 3 // number of stress components
+
+ // names of the stress components
+ value-names = stress-xx stress-yy stress-xy
+
+ value-units = Pa Pa Pa// units
+
+ num-locs = 1
+
+ data-dim = 0
+ space-dim = 2
+ cs-data = cartesian {
+ to-meters = 1.0
+ space-dim = 2
+ }
+}
+// Columns are
+// (1) x coordinate (m)
+// (2) y coordinate (m)
+// (3) stress-xx (Pa)
+// (4) stress-yy (Pa)
+// (5) stress-xy (Pa)
+0.0 0.0 -3.0e8 0.0e0 0.0
diff --git a/examples/3d/hex8/spatialdb/initial_stress.spatialdb b/tests/2d/powerlaw/init_stress_3d.spatialdb
similarity index 65%
copy from examples/3d/hex8/spatialdb/initial_stress.spatialdb
copy to tests/2d/powerlaw/init_stress_3d.spatialdb
index 0191c85..615a79f 100644
--- a/examples/3d/hex8/spatialdb/initial_stress.spatialdb
+++ b/tests/2d/powerlaw/init_stress_3d.spatialdb
@@ -1,7 +1,6 @@
// -*- C++ -*- (tell Emacs to use C++ mode for syntax highlighting)
//
// This spatial database specifies the initial stresses for the model
-// The stresses increase linearly with depth.
//
#SPATIAL.ascii 1
SimpleDB {
@@ -10,12 +9,11 @@ SimpleDB {
// names of the stress components
value-names = stress-xx stress-yy stress-zz stress-xy stress-yz stress-xz
- value-units = Pa Pa Pa Pa Pa Pa // units
+ value-units = Pa Pa Pa Pa Pa Pa// units
- num-locs = 2 // number of locations: 1 value each at the upper and lower
- // surfaces. Linear interpolation should be used.
+ num-locs = 1
- data-dim = 1
+ data-dim = 0
space-dim = 3
cs-data = cartesian {
to-meters = 1.0
@@ -32,5 +30,4 @@ SimpleDB {
// (7) stress-xy (Pa)
// (8) stress-yz (Pa)
// (9) stress-xz (Pa)
-0.0 0.0 -4000.0 -98066500 -98066500 -98066500 0.0 0.0 0.0
-0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
+0.0 0.0 0.0 -3.0e8 0.0e0 -1.5e8 0.0 0.0 0.0
More information about the CIG-COMMITS
mailing list