Skip to content

Commit

Permalink
Fix errors in setting up 2d/strikeslip examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
baagaard-usgs committed Jun 11, 2019
1 parent 0accbde commit 7bc6dff
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 129 deletions.
89 changes: 85 additions & 4 deletions examples/2d/strikeslip/pylithapp.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,31 @@ reader = pylith.meshio.MeshIOCubit
reader.filename = mesh_tri.exo
reader.coordsys.space_dim = 2

# ----------------------------------------------------------------------
# solution
# ----------------------------------------------------------------------
[pylithapp.problem]
# For a quastistatic simulation with a fault, we have two solution fields:
# (1) displacement and (2) Lagrange multiplier. We use a predefined containter
# to create a solution field with these two subfields.
solution = pylith.problems.SolnDispLagrange

[pylithapp.problem.solution.subfields]
displacement.basis_order = 1
displacement.quadrature_order = 1

lagrange_fault.basis_order = 1
lagrange_fault.quadrature_order = 1

[pylithapp.problem.solution_observers.domain]
writer.filename = output/step01_slip_tri-domain.h5

[pylithapp.problem.solution_observers.top_boundary]
writer.filename = output/step01_slip_tri-boundary_ypos.h5

[pylithapp.problem.solution_observers.bot_boundary]
writer.filename = output/step01_slip_tri-boundary_yneg.h5

# ----------------------------------------------------------------------
# solution
# ----------------------------------------------------------------------
Expand All @@ -46,14 +71,17 @@ solution_observers.top_boundary = pylith.meshio.OutputSolnBoundary
solution_observers.bot_boundary = pylith.meshio.OutputSolnBoundary

[pylithapp.problem.solution_observers.domain]
data_fields = [displacement]
# writer.filename = output/SIMULATION-domain.h5

[pylithapp.problem.solution_observers.top_boundary]
label = face_ypos
data_fields = [displacement]
#writer.filename = output/SIMULATION-boundary_ypos.h5

[pylithapp.problem.solution_observers.bot_boundary]
label = face_yneg
data_fields = [displacement]
#writer.filename = output/SIMULATION-boundary_yneg.h5

# ----------------------------------------------------------------------
Expand All @@ -78,6 +106,7 @@ db_auxiliary_field = spatialdata.spatialdb.SimpleDB
db_auxiliary_field.label = Elastic properties xneg
db_auxiliary_field.iohandler.filename = elastic_xneg_matfields.spatialdb

observers.observer.data_fields = [displacement, cauchy_stress, cauchy_strain]
# observers.observer.writer.filename = output/SIMULATION-elastic_xneg.h5

auxiliary_subfields.density.basis_order = 0
Expand Down Expand Up @@ -105,8 +134,8 @@ db_auxiliary_field = spatialdata.spatialdb.SimpleDB
db_auxiliary_field.label = Elastic properties xpos
db_auxiliary_field.iohandler.filename = elastic_xpos_matfields.spatialdb

observers.observer.data_fields = [displacement, cauchy_stress, cauchy_strain]
# observers.observer.writer.filename = output/SIMULATION-elastic_xpos.h5
observers.observer.field_filter = pylith.meshio.FieldFilterNone

auxiliary_subfields.density.basis_order = 0
auxiliary_subfields.density.quadrature_order = 1
Expand All @@ -124,13 +153,65 @@ auxiliary_subfields.bulk_modulus.quadrature_order = 1
auxiliary_subfields.shear_modulus.basis_order = 0
auxiliary_subfields.shear_modulus.quadrature_order = 1

# ----------------------------------------------------------------------
# fault
# ----------------------------------------------------------------------
[pylithapp.problem]
interfaces = [fault]

[pylithapp.problem.interfaces.fault]
# The label corresponds to the nodeset we created in CUBIT/Trelis for the fault.
label = fault

# For the fault, we need to specify an id associated with the cohesive cells that is
# different from any of the ids for the materials.
id = 10
observers.observer.data_fields = [slip]
#observers.observer.writer.filename = output/SIMULATION_slip-fault.h5

# ----------------------------------------------------------------------
# boundary conditions
# ----------------------------------------------------------------------
[pylithapp.problem]
bc = [x_neg, x_pos]
bc.x_neg = pylith.bc.DirichletTimeDependent
bc.x_pos = pylith.bc.DirichletTimeDependent

[pylithapp.problem.bc.x_pos]
constrained_dof = [0, 1]
label = face_xpos
db_auxiliary_field = pylith.bc.ZeroDB
db_auxiliary_field.label = Dirichlet BC +x boundary

observers.observer.data_fields = [displacement]
#observers.observer.writer.filename = output/SIMULATION_slip-bc_xpos.h5

[pylithapp.problem.bc.x_neg]
constrained_dof = [0, 1]
label = face_xneg
db_auxiliary_field = pylith.bc.ZeroDB
db_auxiliary_field.label = Dirichlet BC -x boundary

observers.observer.data_fields = [displacement]
#observers.observer.writer.filename = output/SIMULATION_slip-bc_xneg.h5

# ----------------------------------------------------------------------
# PETSc
# ----------------------------------------------------------------------
[pylithapp.petsc]
ts_type = beuler

pc_type = ilu
pc_type = fieldsplit
pc_use_amat = true
pc_fieldsplit_type = schur
pc_fieldsplit_schur_factorization_type = full
pc_fieldsplit_dm_splits = true
fieldsplit_displacement_ksp_type = preonly
fieldsplit_displacement_pc_type = lu
fieldsplit_lagrange_multiplier_fault_pc_type = jacobi
fieldsplit_lagrange_multiplier_fault_ksp_type = gmres
fieldsplit_lagrange_multiplier_fault_ksp_rtol = 1.0e-11
fieldsplit_lagrange_multiplier_fault_ksp_converged_reason = true

ksp_rtol = 1.0e-8
ksp_atol = 1.0e-12
Expand All @@ -150,8 +231,8 @@ snes_monitor = true
snes_converged_reason = true
snes_linesearch_monitor = true

ksp_view = true
snes_view = true
#ksp_view = true
#snes_view = true


# End of file
62 changes: 15 additions & 47 deletions examples/2d/strikeslip/step01_slip.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,87 +28,55 @@
[pylithapp]
# You can view this file using the pylith_parameters application or
# online at https://geodynamics.github.io/pylith_parameters/.
dump_parameters.filename = output/step01_slip_tri-parameters.json
# problem.progress_monitor.filename = output/step01_slip_tri-progress.txt
dump_parameters.filename = output/step01_slip-parameters.json
# problem.progress_monitor.filename = output/step01_slip-progress.txt

# ----------------------------------------------------------------------
# solution
# ----------------------------------------------------------------------
[pylithapp.problem]
# For a quastistatic simulation with a fault, we have two solution fields:
# (1) displacement and (2) Lagrange multiplier. We use a predefined containter
# to create a solution field with these two subfields.
solution = pylith.problems.SolnDispLagrange

[pylithapp.problem.solution.subfields]
displacement.basis_order = 1
displacement.quadrature_order = 1

lagrange_fault.basis_order = 1
lagrange_fault.quadrature_order = 1

[pylithapp.problem.solution_observers.domain]
writer.filename = output/step01_slip_tri-domain.h5
writer.filename = output/step01_slip-domain.h5

[pylithapp.problem.solution_observers.top_boundary]
writer.filename = output/step01_slip_tri-boundary_ypos.h5
writer.filename = output/step01_slip-boundary_ypos.h5

[pylithapp.problem.solution_observers.bot_boundary]
writer.filename = output/step01_slip_tri-boundary_yneg.h5
writer.filename = output/step01_slip-boundary_yneg.h5

# ----------------------------------------------------------------------
# materials
# ----------------------------------------------------------------------
[pylithapp.problem.materials.elastic_xneg]
observers.observer.writer.filename = output/step01_slip_tri-elastic_xneg.h5
observers.observer.writer.filename = output/step01_slip-elastic_xneg.h5

[pylithapp.problem.materials.elastic_xpos]
observers.observer.writer.filename = output/step01_slip_tri-elastic_xpos.h5
observers.observer.writer.filename = output/step01_slip-elastic_xpos.h5

# ----------------------------------------------------------------------
# fault
# ----------------------------------------------------------------------
[pylithapp.problem]
interfaces = [fault]

[pylithapp.problem.interfaces.fault]
# The label corresponds to the nodeset we created in CUBIT/Trelis for the fault.
label = fault

# For the fault, we need to specify an id associated with the cohesive cells that is
# different from any of the ids for the materials.
id = 10
observers.observer.writer.filename = output/step01_slip_tri-fault.h5
observers.observer.writer.filename = output/step01_slip-fault.h5

[pylithapp.problem.interfaces.fault.eq_ruptures.rupture]
db_auxiliary_field = spatialdata.spatialdb.UniformDB
db_auxiliary_field.label = Fault rupture auxiliary field spatial database
db_auxiliary_field.values = [initiation_time, final_slip_left_lateral, final_slip_opening]
db_auxiliary_field.data = [0.0*s, 2.0*m, 0.0*m]
db_auxiliary_field.data = [0.0*s, -2.0*m, 0.0*m]

# ----------------------------------------------------------------------
# boundary conditions
# ----------------------------------------------------------------------
[pylithapp.problem]
bc = [x_neg,x_pos]
bc.x_neg = pylith.bc.DirichletTimeDependent
bc.x_pos = pylith.bc.DirichletTimeDependent

[pylithapp.problem.bc.x_pos]
constrained_dof = [0, 1]
label = face_xpos
db_auxiliary_field = pylith.bc.ZeroDB
db_auxiliary_field.label = Dirichlet BC +x boundary

observers.observer.writer.filename = output/step01_slip_tri-bc_xpos.h5
observers.observer.writer.filename = output/step01_slip-bc_xpos.h5

[pylithapp.problem.bc.x_neg]
constrained_dof = [0, 1]
label = face_xneg
db_auxiliary_field = pylith.bc.ZeroDB
db_auxiliary_field.label = Dirichlet BC -x boundary
observers.observer.writer.filename = output/step01_slip-bc_xneg.h5


observers.observer.writer.filename = output/step01_slip_tri-bc_xneg.h5
[pylithapp.petsc]
ksp_view = true
snes_view = true


# End of file
50 changes: 13 additions & 37 deletions examples/2d/strikeslip/step02_slip_velbc.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,100 +28,76 @@
[pylithapp]
# You can view this file using the pylith_parameters application or
# online at https://geodynamics.github.io/pylith_parameters/.
dump_parameters.filename = output/step02_slip_velbc_tri-parameters.json
# problem.progress_monitor.filename = output/step02_slip_velbc_tri-progress.txt
dump_parameters.filename = output/step02_slip_velbc-parameters.json
# problem.progress_monitor.filename = output/step02_slip_velbc-progress.txt

# ----------------------------------------------------------------------
# problem
# ----------------------------------------------------------------------
[pylithapp.problem]
initial_dt = 5.0*year
start_time = -5.0*year
total_time = 100.0*year
total_time = 120.0*year

# ----------------------------------------------------------------------
# solution
# ----------------------------------------------------------------------
[pylithapp.problem]
solution = pylith.problems.SolnDispLagrange

[pylithapp.problem.solution.subfields]
displacement.basis_order = 1
displacement.quadrature_order = 1

lagrange_fault.basis_order = 1
lagrange_fault.quadrature_order = 1

[pylithapp.problem.solution_observers.domain]
writer.filename = output/step02_slip_velbc_tri-domain.h5
writer.filename = output/step02_slip_velbc-domain.h5

[pylithapp.problem.solution_observers.top_boundary]
writer.filename = output/step02_slip_velbc_tri-boundary_ypos.h5
writer.filename = output/step02_slip_velbc-boundary_ypos.h5

[pylithapp.problem.solution_observers.bot_boundary]
writer.filename = output/step02_slip_velbc_tri-boundary_yneg.h5
writer.filename = output/step02_slip_velbc-boundary_yneg.h5

# ----------------------------------------------------------------------
# materials
# ----------------------------------------------------------------------
[pylithapp.problem.materials.elastic_xneg]
observers.observer.writer.filename = output/step02_slip_velbc_tri-elastic_xneg.h5
observers.observer.writer.filename = output/step02_slip_velbc-elastic_xneg.h5

[pylithapp.problem.materials.elastic_xpos]
observers.observer.writer.filename = output/step02_slip_velbc_tri-elastic_xpos.h5
observers.observer.writer.filename = output/step02_slip_velbc-elastic_xpos.h5

# ----------------------------------------------------------------------
# fault
# ----------------------------------------------------------------------
[pylithapp.problem]
interfaces = [fault]

[pylithapp.problem.interfaces.fault]
label = fault
id = 10
observers.observer.writer.filename = output/step02_slip_velbc_tri-fault.h5
observers.observer.writer.filename = output/step02_slip_velbc-fault.h5

# Earthquake rupture of 2.0*m of left-lateral motion occurs at 100 years.
# Earthquake rupture of 2.0*m of right-lateral motion occurs at 100 years.
# We use the default slip-time function, which is a step.
[pylithapp.problem.interfaces.fault.eq_ruptures.rupture]
db_auxiliary_field = spatialdata.spatialdb.UniformDB
db_auxiliary_field.label = Fault rupture auxiliary field spatial database
db_auxiliary_field.values = [initiation_time, final_slip_left_lateral, final_slip_opening]
db_auxiliary_field.data = [100.0*year, 2.0*m, 0.0*m]
db_auxiliary_field.data = [100.0*year, -2.0*m, 0.0*m]

# ----------------------------------------------------------------------
# boundary conditions
# ----------------------------------------------------------------------
[pylithapp.problem]
bc = [x_neg, x_pos]
bc.x_neg = pylith.bc.DirichletTimeDependent
bc.x_pos = pylith.bc.DirichletTimeDependent

# We have velocity boundary conditions, so we use the rate term in the
# expression for time-dependent boundary conditions.
[pylithapp.problem.bc.x_pos]
constrained_dof = [0, 1]
label = face_xpos
use_initial = False
use_rate = True

db_auxiliary_field = spatialdata.spatialdb.SimpleDB
db_auxiliary_field.label = Dirichlet BC +x boundary
db_auxiliary_field.iohandler.filename = disprate_bc_xpos.spatialdb

observers.observer.writer.filename = output/step02_slip_velbc_tri-bc_xpos.h5
observers.observer.writer.filename = output/step02_slip_velbc-bc_xpos.h5

[pylithapp.problem.bc.x_neg]
constrained_dof = [0, 1]
label = face_xneg
use_initial = False
use_rate = True

db_auxiliary_field = spatialdata.spatialdb.SimpleDB
db_auxiliary_field.label = Dirichlet BC -x boundary
db_auxiliary_field.iohandler.filename = disprate_bc_xneg.spatialdb

observers.observer.writer.filename = output/step02_slip_velbc_tri-bc_xneg.h5
observers.observer.writer.filename = output/step02_slip_velbc-bc_xneg.h5


# End of file
Loading

0 comments on commit 7bc6dff

Please sign in to comment.