Skip to content

Commit 7bc6dff

Browse files
committed
Fix errors in setting up 2d/strikeslip examples.
1 parent 0accbde commit 7bc6dff

File tree

5 files changed

+130
-129
lines changed

5 files changed

+130
-129
lines changed

examples/2d/strikeslip/pylithapp.cfg

Lines changed: 85 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,31 @@ reader = pylith.meshio.MeshIOCubit
2525
reader.filename = mesh_tri.exo
2626
reader.coordsys.space_dim = 2
2727

28+
# ----------------------------------------------------------------------
29+
# solution
30+
# ----------------------------------------------------------------------
31+
[pylithapp.problem]
32+
# For a quastistatic simulation with a fault, we have two solution fields:
33+
# (1) displacement and (2) Lagrange multiplier. We use a predefined containter
34+
# to create a solution field with these two subfields.
35+
solution = pylith.problems.SolnDispLagrange
36+
37+
[pylithapp.problem.solution.subfields]
38+
displacement.basis_order = 1
39+
displacement.quadrature_order = 1
40+
41+
lagrange_fault.basis_order = 1
42+
lagrange_fault.quadrature_order = 1
43+
44+
[pylithapp.problem.solution_observers.domain]
45+
writer.filename = output/step01_slip_tri-domain.h5
46+
47+
[pylithapp.problem.solution_observers.top_boundary]
48+
writer.filename = output/step01_slip_tri-boundary_ypos.h5
49+
50+
[pylithapp.problem.solution_observers.bot_boundary]
51+
writer.filename = output/step01_slip_tri-boundary_yneg.h5
52+
2853
# ----------------------------------------------------------------------
2954
# solution
3055
# ----------------------------------------------------------------------
@@ -46,14 +71,17 @@ solution_observers.top_boundary = pylith.meshio.OutputSolnBoundary
4671
solution_observers.bot_boundary = pylith.meshio.OutputSolnBoundary
4772

4873
[pylithapp.problem.solution_observers.domain]
74+
data_fields = [displacement]
4975
# writer.filename = output/SIMULATION-domain.h5
5076

5177
[pylithapp.problem.solution_observers.top_boundary]
5278
label = face_ypos
79+
data_fields = [displacement]
5380
#writer.filename = output/SIMULATION-boundary_ypos.h5
5481

5582
[pylithapp.problem.solution_observers.bot_boundary]
5683
label = face_yneg
84+
data_fields = [displacement]
5785
#writer.filename = output/SIMULATION-boundary_yneg.h5
5886

5987
# ----------------------------------------------------------------------
@@ -78,6 +106,7 @@ db_auxiliary_field = spatialdata.spatialdb.SimpleDB
78106
db_auxiliary_field.label = Elastic properties xneg
79107
db_auxiliary_field.iohandler.filename = elastic_xneg_matfields.spatialdb
80108

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

83112
auxiliary_subfields.density.basis_order = 0
@@ -105,8 +134,8 @@ db_auxiliary_field = spatialdata.spatialdb.SimpleDB
105134
db_auxiliary_field.label = Elastic properties xpos
106135
db_auxiliary_field.iohandler.filename = elastic_xpos_matfields.spatialdb
107136

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

111140
auxiliary_subfields.density.basis_order = 0
112141
auxiliary_subfields.density.quadrature_order = 1
@@ -124,13 +153,65 @@ auxiliary_subfields.bulk_modulus.quadrature_order = 1
124153
auxiliary_subfields.shear_modulus.basis_order = 0
125154
auxiliary_subfields.shear_modulus.quadrature_order = 1
126155

156+
# ----------------------------------------------------------------------
157+
# fault
158+
# ----------------------------------------------------------------------
159+
[pylithapp.problem]
160+
interfaces = [fault]
161+
162+
[pylithapp.problem.interfaces.fault]
163+
# The label corresponds to the nodeset we created in CUBIT/Trelis for the fault.
164+
label = fault
165+
166+
# For the fault, we need to specify an id associated with the cohesive cells that is
167+
# different from any of the ids for the materials.
168+
id = 10
169+
observers.observer.data_fields = [slip]
170+
#observers.observer.writer.filename = output/SIMULATION_slip-fault.h5
171+
172+
# ----------------------------------------------------------------------
173+
# boundary conditions
174+
# ----------------------------------------------------------------------
175+
[pylithapp.problem]
176+
bc = [x_neg, x_pos]
177+
bc.x_neg = pylith.bc.DirichletTimeDependent
178+
bc.x_pos = pylith.bc.DirichletTimeDependent
179+
180+
[pylithapp.problem.bc.x_pos]
181+
constrained_dof = [0, 1]
182+
label = face_xpos
183+
db_auxiliary_field = pylith.bc.ZeroDB
184+
db_auxiliary_field.label = Dirichlet BC +x boundary
185+
186+
observers.observer.data_fields = [displacement]
187+
#observers.observer.writer.filename = output/SIMULATION_slip-bc_xpos.h5
188+
189+
[pylithapp.problem.bc.x_neg]
190+
constrained_dof = [0, 1]
191+
label = face_xneg
192+
db_auxiliary_field = pylith.bc.ZeroDB
193+
db_auxiliary_field.label = Dirichlet BC -x boundary
194+
195+
observers.observer.data_fields = [displacement]
196+
#observers.observer.writer.filename = output/SIMULATION_slip-bc_xneg.h5
197+
127198
# ----------------------------------------------------------------------
128199
# PETSc
129200
# ----------------------------------------------------------------------
130201
[pylithapp.petsc]
131202
ts_type = beuler
132203

133-
pc_type = ilu
204+
pc_type = fieldsplit
205+
pc_use_amat = true
206+
pc_fieldsplit_type = schur
207+
pc_fieldsplit_schur_factorization_type = full
208+
pc_fieldsplit_dm_splits = true
209+
fieldsplit_displacement_ksp_type = preonly
210+
fieldsplit_displacement_pc_type = lu
211+
fieldsplit_lagrange_multiplier_fault_pc_type = jacobi
212+
fieldsplit_lagrange_multiplier_fault_ksp_type = gmres
213+
fieldsplit_lagrange_multiplier_fault_ksp_rtol = 1.0e-11
214+
fieldsplit_lagrange_multiplier_fault_ksp_converged_reason = true
134215

135216
ksp_rtol = 1.0e-8
136217
ksp_atol = 1.0e-12
@@ -150,8 +231,8 @@ snes_monitor = true
150231
snes_converged_reason = true
151232
snes_linesearch_monitor = true
152233

153-
ksp_view = true
154-
snes_view = true
234+
#ksp_view = true
235+
#snes_view = true
155236

156237

157238
# End of file

examples/2d/strikeslip/step01_slip.cfg

Lines changed: 15 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -28,87 +28,55 @@
2828
[pylithapp]
2929
# You can view this file using the pylith_parameters application or
3030
# online at https://geodynamics.github.io/pylith_parameters/.
31-
dump_parameters.filename = output/step01_slip_tri-parameters.json
32-
# problem.progress_monitor.filename = output/step01_slip_tri-progress.txt
31+
dump_parameters.filename = output/step01_slip-parameters.json
32+
# problem.progress_monitor.filename = output/step01_slip-progress.txt
3333

3434
# ----------------------------------------------------------------------
3535
# solution
3636
# ----------------------------------------------------------------------
37-
[pylithapp.problem]
38-
# For a quastistatic simulation with a fault, we have two solution fields:
39-
# (1) displacement and (2) Lagrange multiplier. We use a predefined containter
40-
# to create a solution field with these two subfields.
41-
solution = pylith.problems.SolnDispLagrange
42-
43-
[pylithapp.problem.solution.subfields]
44-
displacement.basis_order = 1
45-
displacement.quadrature_order = 1
46-
47-
lagrange_fault.basis_order = 1
48-
lagrange_fault.quadrature_order = 1
49-
5037
[pylithapp.problem.solution_observers.domain]
51-
writer.filename = output/step01_slip_tri-domain.h5
38+
writer.filename = output/step01_slip-domain.h5
5239

5340
[pylithapp.problem.solution_observers.top_boundary]
54-
writer.filename = output/step01_slip_tri-boundary_ypos.h5
41+
writer.filename = output/step01_slip-boundary_ypos.h5
5542

5643
[pylithapp.problem.solution_observers.bot_boundary]
57-
writer.filename = output/step01_slip_tri-boundary_yneg.h5
44+
writer.filename = output/step01_slip-boundary_yneg.h5
5845

5946
# ----------------------------------------------------------------------
6047
# materials
6148
# ----------------------------------------------------------------------
6249
[pylithapp.problem.materials.elastic_xneg]
63-
observers.observer.writer.filename = output/step01_slip_tri-elastic_xneg.h5
50+
observers.observer.writer.filename = output/step01_slip-elastic_xneg.h5
6451

6552
[pylithapp.problem.materials.elastic_xpos]
66-
observers.observer.writer.filename = output/step01_slip_tri-elastic_xpos.h5
53+
observers.observer.writer.filename = output/step01_slip-elastic_xpos.h5
6754

6855
# ----------------------------------------------------------------------
6956
# fault
7057
# ----------------------------------------------------------------------
71-
[pylithapp.problem]
72-
interfaces = [fault]
73-
7458
[pylithapp.problem.interfaces.fault]
75-
# The label corresponds to the nodeset we created in CUBIT/Trelis for the fault.
76-
label = fault
77-
78-
# For the fault, we need to specify an id associated with the cohesive cells that is
79-
# different from any of the ids for the materials.
80-
id = 10
81-
observers.observer.writer.filename = output/step01_slip_tri-fault.h5
59+
observers.observer.writer.filename = output/step01_slip-fault.h5
8260

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

8967
# ----------------------------------------------------------------------
9068
# boundary conditions
9169
# ----------------------------------------------------------------------
92-
[pylithapp.problem]
93-
bc = [x_neg,x_pos]
94-
bc.x_neg = pylith.bc.DirichletTimeDependent
95-
bc.x_pos = pylith.bc.DirichletTimeDependent
96-
9770
[pylithapp.problem.bc.x_pos]
98-
constrained_dof = [0, 1]
99-
label = face_xpos
100-
db_auxiliary_field = pylith.bc.ZeroDB
101-
db_auxiliary_field.label = Dirichlet BC +x boundary
102-
103-
observers.observer.writer.filename = output/step01_slip_tri-bc_xpos.h5
71+
observers.observer.writer.filename = output/step01_slip-bc_xpos.h5
10472

10573
[pylithapp.problem.bc.x_neg]
106-
constrained_dof = [0, 1]
107-
label = face_xneg
108-
db_auxiliary_field = pylith.bc.ZeroDB
109-
db_auxiliary_field.label = Dirichlet BC -x boundary
74+
observers.observer.writer.filename = output/step01_slip-bc_xneg.h5
75+
11076

111-
observers.observer.writer.filename = output/step01_slip_tri-bc_xneg.h5
77+
[pylithapp.petsc]
78+
ksp_view = true
79+
snes_view = true
11280

11381

11482
# End of file

examples/2d/strikeslip/step02_slip_velbc.cfg

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -28,100 +28,76 @@
2828
[pylithapp]
2929
# You can view this file using the pylith_parameters application or
3030
# online at https://geodynamics.github.io/pylith_parameters/.
31-
dump_parameters.filename = output/step02_slip_velbc_tri-parameters.json
32-
# problem.progress_monitor.filename = output/step02_slip_velbc_tri-progress.txt
31+
dump_parameters.filename = output/step02_slip_velbc-parameters.json
32+
# problem.progress_monitor.filename = output/step02_slip_velbc-progress.txt
3333

3434
# ----------------------------------------------------------------------
3535
# problem
3636
# ----------------------------------------------------------------------
3737
[pylithapp.problem]
3838
initial_dt = 5.0*year
3939
start_time = -5.0*year
40-
total_time = 100.0*year
40+
total_time = 120.0*year
4141

4242
# ----------------------------------------------------------------------
4343
# solution
4444
# ----------------------------------------------------------------------
45-
[pylithapp.problem]
46-
solution = pylith.problems.SolnDispLagrange
47-
48-
[pylithapp.problem.solution.subfields]
49-
displacement.basis_order = 1
50-
displacement.quadrature_order = 1
51-
52-
lagrange_fault.basis_order = 1
53-
lagrange_fault.quadrature_order = 1
54-
5545
[pylithapp.problem.solution_observers.domain]
56-
writer.filename = output/step02_slip_velbc_tri-domain.h5
46+
writer.filename = output/step02_slip_velbc-domain.h5
5747

5848
[pylithapp.problem.solution_observers.top_boundary]
59-
writer.filename = output/step02_slip_velbc_tri-boundary_ypos.h5
49+
writer.filename = output/step02_slip_velbc-boundary_ypos.h5
6050

6151
[pylithapp.problem.solution_observers.bot_boundary]
62-
writer.filename = output/step02_slip_velbc_tri-boundary_yneg.h5
52+
writer.filename = output/step02_slip_velbc-boundary_yneg.h5
6353

6454
# ----------------------------------------------------------------------
6555
# materials
6656
# ----------------------------------------------------------------------
6757
[pylithapp.problem.materials.elastic_xneg]
68-
observers.observer.writer.filename = output/step02_slip_velbc_tri-elastic_xneg.h5
58+
observers.observer.writer.filename = output/step02_slip_velbc-elastic_xneg.h5
6959

7060
[pylithapp.problem.materials.elastic_xpos]
71-
observers.observer.writer.filename = output/step02_slip_velbc_tri-elastic_xpos.h5
61+
observers.observer.writer.filename = output/step02_slip_velbc-elastic_xpos.h5
7262

7363
# ----------------------------------------------------------------------
7464
# fault
7565
# ----------------------------------------------------------------------
76-
[pylithapp.problem]
77-
interfaces = [fault]
78-
7966
[pylithapp.problem.interfaces.fault]
80-
label = fault
81-
id = 10
82-
observers.observer.writer.filename = output/step02_slip_velbc_tri-fault.h5
67+
observers.observer.writer.filename = output/step02_slip_velbc-fault.h5
8368

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

9277
# ----------------------------------------------------------------------
9378
# boundary conditions
9479
# ----------------------------------------------------------------------
95-
[pylithapp.problem]
96-
bc = [x_neg, x_pos]
97-
bc.x_neg = pylith.bc.DirichletTimeDependent
98-
bc.x_pos = pylith.bc.DirichletTimeDependent
99-
10080
# We have velocity boundary conditions, so we use the rate term in the
10181
# expression for time-dependent boundary conditions.
10282
[pylithapp.problem.bc.x_pos]
103-
constrained_dof = [0, 1]
104-
label = face_xpos
10583
use_initial = False
10684
use_rate = True
10785

10886
db_auxiliary_field = spatialdata.spatialdb.SimpleDB
10987
db_auxiliary_field.label = Dirichlet BC +x boundary
11088
db_auxiliary_field.iohandler.filename = disprate_bc_xpos.spatialdb
11189

112-
observers.observer.writer.filename = output/step02_slip_velbc_tri-bc_xpos.h5
90+
observers.observer.writer.filename = output/step02_slip_velbc-bc_xpos.h5
11391

11492
[pylithapp.problem.bc.x_neg]
115-
constrained_dof = [0, 1]
116-
label = face_xneg
11793
use_initial = False
11894
use_rate = True
11995

12096
db_auxiliary_field = spatialdata.spatialdb.SimpleDB
12197
db_auxiliary_field.label = Dirichlet BC -x boundary
12298
db_auxiliary_field.iohandler.filename = disprate_bc_xneg.spatialdb
12399

124-
observers.observer.writer.filename = output/step02_slip_velbc_tri-bc_xneg.h5
100+
observers.observer.writer.filename = output/step02_slip_velbc-bc_xneg.h5
125101

126102

127103
# End of file

0 commit comments

Comments
 (0)