Step 3: Gravitational Body Forces with Incompressible Elasticity#
Features
Triangular cells
pylith.meshio.MeshIOPetsc
pylith.problems.TimeDependent
pylith.bc.DirichletTimeDependent
spatialdata.spatialdb.SimpleDB
spatialdata.spatialdb.ZeroDB
pylith.meshio.OutputSolnBoundary
pylith.meshio.DataWriterHDF5
Static simulation
pylith.materials.IncompressibleElasticity
spatialdata.spatialdb.GravityField
field split preconditioner
Schur complement preconditioner
Simulation parameters#
In this example we use incompressible elasticity (see Incompressible Isotropic Elasticity with Infinitesimal Strain (Bathe) for the finite-element formulation) to obtain the stress field associated with gravitational body forces,
Because the material is incompressible and the material is confined on the lateral boundaries and bottom, we do not expect any deformation.
In general, this is a more robust way to determine an initial stress state for gravitational body forces compared to using a reference stress state, especially when the material properties are not uniform.
We use the same roller boundary conditions that we used in Steps 1 and 2.
The parameters specific to this example are in step03_gravity_incompressible.cfg
.
solution = pylith.problems.SolnDispPres
[pylithapp.problem.materials]
slab = pylith.materials.IncompressibleElasticity
crust = pylith.materials.IncompressibleElasticity
wedge = pylith.materials.IncompressibleElasticity
[pylithapp.problem.materials.slab]
db_auxiliary_field.iohandler.filename = mat_elastic_incompressible.spatialdb
[pylithapp.problem.materials.crust]
db_auxiliary_field.iohandler.filename = mat_elastic_incompressible.spatialdb
[pylithapp.problem.materials.wedge]
db_auxiliary_field.iohandler.filename = mat_elastic_incompressible.spatialdb
With pressure as a solution subfield, we add a Dirichlet boundary condition to set the confining pressure to 0 on the ground surface (+y boundary).
[pylithapp.problem]
bc = [bc_xneg, bc_xpos, bc_yneg, bc_ypos]
bc.bc_ypos = pylith.bc.DirichletTimeDependent
[pylithapp.problem.bc.bc_ypos]
label = boundary_ypos
label_value = 13
constrained_dof = [0]
field = pressure
db_auxiliary_field = pylith.bc.ZeroDB
db_auxiliary_field.description = Dirichlet BC for pressure on +y edge
auxiliary_subfields.initial_amplitude.basis_order = 0
observers.observer.data_fields = [pressure]
Running the simulation#
$ pylith step03_gravity_incompressible.cfg
# The output should look something like the following.
>> /software/unix/py38-venv/pylith-debug/lib/python3.8/site-packages/pylith/meshio/MeshIOObj.py:44:read
-- meshiopetsc(info)
-- Reading finite-element mesh
>> /src/cig/pylith/libsrc/pylith/meshio/MeshIO.cc:94:void pylith::meshio::MeshIO::read(pylith::topology::Mesh*)
-- meshiopetsc(info)
-- Component 'reader': Domain bounding box:
(-100000, 100000)
(-100000, 0)
# -- many lines omitted --
>> /src/cig/pylith/libsrc/pylith/utils/PetscOptions.cc:235:static void pylith::utils::_PetscOptions::write(pythia::journal::info_t &, const char *, const pylith::utils::PetscOptions &)
-- petscoptions(info)
-- Setting PETSc options:
ksp_atol = 1.0e-12
ksp_converged_reason = true
ksp_error_if_not_converged = true
ksp_rtol = 1.0e-12
pc_fieldsplit_schur_factorization_type = full
snes_atol = 1.0e-9
snes_converged_reason = true
snes_error_if_not_converged = true
snes_monitor = true
snes_rtol = 1.0e-12
ts_error_if_step_fails = true
ts_monitor = true
ts_type = beuler
>> /src/cig/pylith/libsrc/pylith/utils/PetscOptions.cc:235:static void pylith::utils::_PetscOptions::write(pythia::journal::info_t &, const char *, const pylith::utils::PetscOptions &)
-- petscoptions(info)
-- Ignoring PETSc options (already set):
fieldsplit_displacement_pc_type = lu
fieldsplit_pressure_pc_type = lu
pc_fieldsplit_schur_precondition = full
pc_fieldsplit_type = schur
pc_type = fieldsplit
>> /software/unix/py39-venv/pylith-debug/lib/python3.9/site-packages/pylith/meshio/MeshIOObj.py:44:read
-- timedependent(info)
-- Solving problem.
0 TS dt 0.01 time 0.
0 SNES Function norm 4.866941773461e-01
Linear solve converged due to CONVERGED_ATOL iterations 1
1 SNES Function norm 3.099989574301e-13
Nonlinear solve converged due to CONVERGED_FNORM_ABS iterations 1
1 TS dt 0.01 time 0.01
>> /software/unix/py39-venv/pylith-debug/lib/python3.9/site-packages/pylith/problems/Problem.py:201:finalize
-- timedependent(info)
-- Finalizing problem.
PyLith detected use of incompressible elasticity, so it selected a field split preconditioner with an LU preconditioner for each of the solution subfields as described in PETSc Options. As a result, the linear solve converged in 1 iterations.
Visualizing the results#
The output
directory contains the simulation output.
Each “observer” writes its own set of files, so the solution over the domain is in one set of files, the boundary condition information is in another set of files, and the material information is in yet another set of files.
The HDF5 (.h5
) files contain the mesh geometry and topology information along with the solution fields.
The Xdmf (.xmf
) files contain metadata that allow visualization tools like ParaView to know where to find the information in the HDF5 files.
To visualize the data using ParaView or Visit, load the Xdmf files.
In Fig. 78 we use ParaView to visualize the displacement field using the viz/plot_dispwarp.py
Python script.
First, we start ParaView from the examples/reverse-2d
directory.
Before running the viz/plot_dispwarp.py
Python script as described in ParaView Python Scripts, we set the simulation name in the ParaView Python Shell.
>>> SIM = "step03_gravity_incompressible"