The problem is the spatial database settings in pylithapp.cfg
, which are for an elastic material, are incompatible with the spatial database settings in powerlaw_spontaneous.cfg
.
Here is the relevant portion of your current pylithapp.cfg
:
[pylithapp.problem.materials.upper_crust]
--omitted lines--
db_properties.label = Properties for upper crust
db_properties.iohandler.filename = spatialdb/mat_elastic.spatialdb
Here is the relevant portion of your current powerlaw_spontaneous.cfg
:
[pylithapp.timedependent.materials.upper_crust]
db_properties = spatialdata.spatialdb.CompositeDB
db_properties.db_A = spatialdata.spatialdb.SimpleDB
db_properties.db_B = spatialdata.spatialdb.SimpleDB
--omitted lines--
[pylithapp.timedependent.materials.upper_crust.db_properties]
values_A = [density,vs,vp] ; Elastic properties.
db_A.label = Elastic properties
db_A.iohandler.filename = spatialdb/mat_elastic.spatialdb
values_B = [reference-stress,reference-strain-rate,power-law-exponent] ; Power-law properties.
db_B.label = Power-law properties
db_B.iohandler.filename = spatialdb/mat_powerlaw.spatialdb
db_B.query_type = linear
The settings in pylithapp.cfg
are specific to a SimpleDB
spatial database. When you use the CompositeDB
, those settings for the SimpleDB
generate an error. The most robust solution is to separate your settings into different files based on material. I would further separate your fault settings as well-- one file for prescribed slip and one for spontaneous rupture.
Suggested refactoring of .cfg files for material information
pylithapp.cfg
Parameters that are independent of the type of material. This includes the number of materials, labels, id, and quadrature. It does not include anything about the spatial databases.
[pylithapp.problem]
materials = [upper_crust]
[pylithapp.problem.materials.upper_crust]
label = Upper crust material
id = 300
quadrature.cell = pylith.feassemble.FIATSimplex
quadrature.cell.dimension = 3
mat_elastic.cfg
[pylithapp.problem.materials.upper_crust]
# Here I explicitly specify the database for clarity. The `SimpleDB` is the default, so specifying it is optional.
db_properties = spatialdata.spatialdb.SimpleDB
db_properties.label = Properties for upper crust
db_properties.iohandler.filename = spatialdb/mat_elastic.spatialdb
mat_powerlaw.cfg
[pylithapp.problem.materials]
upper_crust = pylith.materials.PowerLaw3D
[pylithapp.timedependent.materials.upper_crust]
db_properties = spatialdata.spatialdb.CompositeDB
db_properties.db_A = spatialdata.spatialdb.SimpleDB
db_properties.db_B = spatialdata.spatialdb.SimpleDB
# Provide the values to be obtained from each database and the database name.
[pylithapp.timedependent.materials.upper_crust.db_properties]
values_A = [density,vs,vp] ; Elastic properties.
db_A.label = Elastic properties
db_A.iohandler.filename = spatialdb/mat_elastic.spatialdb
values_B = [reference-stress,reference-strain-rate,power-law-exponent] ; Power-law properties.
db_B.label = Power-law properties
db_B.iohandler.filename = spatialdb/mat_powerlaw.spatialdb
db_B.query_type = linear
# Since there are additional properties and state variables for the power-law model, we explicitly
# request that they be output.
[pylithapp.timedependent.materials.upper_crust]
output.cell_info_fields = [density,mu,lambda,reference_strain_rate,reference_stress,power_law_exponent]
output.cell_data_fields = [total_strain,stress,viscous_strain]
Using the .cfg files
# Running a simulation with the elastic material.
pylith mat_elastic.cfg
# Running a simulation with a powerlaw material
pylith mat_powerlaw.cfg