Skip to content

Commit

Permalink
Merge pull request #630 from rwalkerlewis/poroelastic_material_fault
Browse files Browse the repository at this point in the history
Poroelastic material fault
  • Loading branch information
baagaard-usgs authored Sep 29, 2023
2 parents 4bd3328 + e6a826d commit 56dd824
Show file tree
Hide file tree
Showing 25 changed files with 222 additions and 27 deletions.
2 changes: 1 addition & 1 deletion docs/user/examples/strikeslip-2d/step04-varslip.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ defaults.quadrature_order = 2
[pylithapp.problem.solution.subfields]
displacement.basis_order = 2
lagrange_fault.basis_order = 2
lagrange_multiplier_fault.basis_order = 2
[pylithapp.problem]
solution_observers = [domain, top_boundary, bot_boundary, gps_stations]
Expand Down
2 changes: 1 addition & 1 deletion examples/barwaves-2d/step04_swave_prescribedslip.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ defaults.quadrature_order = 1
[pylithapp.problem.solution.subfields]
displacement.basis_order = 1
velocity.basis_order = 1
lagrange_fault.basis_order = 1
lagrange_multiplier_fault.basis_order = 1

# ----------------------------------------------------------------------
# fault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ solution = pylith.problems.SolnDispLagrange
displacement.basis_order = 1
displacement.quadrature_order = 1

lagrange_fault.basis_order = 1
lagrange_fault.quadrature_order = 1
lagrange_multiplier_fault.basis_order = 1
lagrange_multiplier_fault.quadrature_order = 1

[pylithapp.problem]
solution_observers = [domain]
Expand Down
2 changes: 1 addition & 1 deletion examples/strikeslip-2d/step04_varslip.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ defaults.quadrature_order = 2

[pylithapp.problem.solution.subfields]
displacement.basis_order = 2
lagrange_fault.basis_order = 2
lagrange_multiplier_fault.basis_order = 2

[pylithapp.problem]
# We add output at our fake GPS stations that we will use a fake observations.
Expand Down
2 changes: 1 addition & 1 deletion examples/subduction-3d/step02_coseismic.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ solution = pylith.problems.SolnDispLagrange

[pylithapp.problem.solution.subfields]
displacement.basis_order = 1
lagrange_fault.basis_order = 1
lagrange_multiplier_fault.basis_order = 1

# ----------------------------------------------------------------------
# faults
Expand Down
2 changes: 1 addition & 1 deletion examples/subduction-3d/step03_interseismic.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ solution = pylith.problems.SolnDispLagrange

[pylithapp.problem.solution.subfields]
displacement.basis_order = 1
lagrange_fault.basis_order = 1
lagrange_multiplier_fault.basis_order = 1

# ----------------------------------------------------------------------
# faults
Expand Down
2 changes: 1 addition & 1 deletion examples/subduction-3d/step04_eqcycle.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ solution = pylith.problems.SolnDispLagrange

[pylithapp.problem.solution.subfields]
displacement.basis_order = 1
lagrange_fault.basis_order = 1
lagrange_multiplier_fault.basis_order = 1

# ----------------------------------------------------------------------
# faults
Expand Down
2 changes: 1 addition & 1 deletion examples/subduction-3d/step06_slowslip.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ solution = pylith.problems.SolnDispLagrange

[pylithapp.problem.solution.subfields]
displacement.basis_order = 1
lagrange_fault.basis_order = 1
lagrange_multiplier_fault.basis_order = 1

[pylithapp.problem]
solution_observers = [domain, groundsurf, gps_stations]
Expand Down
2 changes: 1 addition & 1 deletion examples/subduction-3d/step07a_leftlateral.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ defaults.quadrature_order = 1
# for the solution fields should be the same as the basis order for the slip impulses;
# higher basis orders are also valid.
displacement.basis_order = 1
lagrange_fault.basis_order = 1
lagrange_multiplier_fault.basis_order = 1

[pylithapp.problem]
# We add output at our fake GPS stations that we will use to invert for the slip.
Expand Down
2 changes: 2 additions & 0 deletions pylith/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ EXTRA_DIST = \
problems/SolnDispPres.py \
problems/SolnDispPresLagrange.py \
problems/SolnDispPresTracStrain.py \
problems/SolnDispPresTracStrainLagrange.py \
problems/SolnDispPresTracStrainVelPdotTdot.py \
problems/SolnDispPresTracStrainVelPdotTdotLagrange.py \
problems/SolnDispPresVel.py \
problems/SolnDispVel.py \
problems/SolnDispVelLagrange.py \
Expand Down
4 changes: 2 additions & 2 deletions pylith/problems/SolnDispLagrange.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class SolnDispLagrange(PetscComponent):
displacement.meta['tip'] = "Displacement subfield."

from .SubfieldLagrangeFault import SubfieldLagrangeFault
lagrangeFault = pythia.pyre.inventory.facility("lagrange_fault", family="soln_subfield", factory=SubfieldLagrangeFault)
lagrangeFault = pythia.pyre.inventory.facility("lagrange_multiplier_fault", family="soln_subfield", factory=SubfieldLagrangeFault)
lagrangeFault.meta['tip'] = "Fault Lagrange multiplier subfield."

# PUBLIC METHODS /////////////////////////////////////////////////////
Expand All @@ -57,7 +57,7 @@ def _configure(self):

def components(self):
"""Order of facilities in Inventory is ambiguous, so overwrite
components() to insure order is [displacement, lagrange_fault].
components() to insure order is [displacement, lagrange_multiplier_fault].
"""
return [self.displacement, self.lagrangeFault]
Expand Down
4 changes: 2 additions & 2 deletions pylith/problems/SolnDispPresLagrange.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SolnDispPresLagrange(PetscComponent):
pressure.meta['tip'] = "Pressure subfield."

from .SubfieldLagrangeFault import SubfieldLagrangeFault
lagrangeFault = pythia.pyre.inventory.facility("lagrange_fault", family="soln_subfield", factory=SubfieldLagrangeFault)
lagrangeFault = pythia.pyre.inventory.facility("lagrange_multiplier_fault", family="soln_subfield", factory=SubfieldLagrangeFault)
lagrangeFault.meta['tip'] = "Fault Lagrange multiplier subfield."

def __init__(self, name="solndisppres"):
Expand All @@ -52,7 +52,7 @@ def _configure(self):

def components(self):
"""Order of facilities in Inventory is ambiguous, so overwrite
components() to insure order is [displacement, pressure, lagrange_fault].
components() to insure order is [displacement, pressure, lagrange_multiplier_fault].
"""
return [self.displacement, self.pressure, self.lagrangeFault]
Expand Down
84 changes: 84 additions & 0 deletions pylith/problems/SolnDispPresTracStrainLagrange.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University at Buffalo
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copyright (c) 2010-2022 University of California, Davis
#
# See LICENSE.md for license information.
#
# ----------------------------------------------------------------------

from pylith.utils.PetscComponent import PetscComponent
from .Solution import Solution as SolutionBase


class SolnDispPresTracStrainLagrange(PetscComponent):
"""
Container for solution subfields with displacement, pore pressure, trace strain subfields, and fault Lagrange multiplier subfields.
"""
DOC_CONFIG = {
"cfg": """
[pylithapp.problem]
solution = pylith.problems.SolnDispPresTracStrainLagrange
"""
}

import pythia.pyre.inventory

from .SubfieldDisplacement import SubfieldDisplacement
displacement = pythia.pyre.inventory.facility("displacement", family="soln_subfield", factory=SubfieldDisplacement)
displacement.meta['tip'] = "Displacement subfield."

from .SubfieldPressure import SubfieldPressure
pressure = pythia.pyre.inventory.facility("pressure", family="soln_subfield", factory=SubfieldPressure)
pressure.meta['tip'] = "Pressure subfield."

from .SubfieldTraceStrain import SubfieldTraceStrain
traceStrain = pythia.pyre.inventory.facility("trace_strain", family="soln_subfield", factory=SubfieldTraceStrain)
traceStrain.meta['tip'] = "Trace strain subfield."

from .SubfieldLagrangeFault import SubfieldLagrangeFault
lagrangeFault = pythia.pyre.inventory.facility("lagrange_multiplier_fault", family="soln_subfield", factory=SubfieldLagrangeFault)
lagrangeFault.meta['tip'] = "Fault Lagrange multiplier subfield."

def __init__(self, name="SolnDispPresTracStrainLagrange"):
"""Constructor.
"""
PetscComponent.__init__(self, name, facility="soln_subfields")

def _configure(self):
PetscComponent._configure(self)

def components(self):
"""Order of facilities in Inventory is ambiguous, so overwrite
components() to insure order is [displacement, pressure, trace_strain, lagrange_multiplier_fault].
"""
return [self.displacement, self.pressure, self.traceStrain, self.lagrangeFault]


class Solution(SolutionBase):
"""Python solution field with displacement, pressure, trace strain,and Lagrange multiplier subfields.
"""

import pythia.pyre.inventory

from .SolutionSubfield import subfieldFactory
subfields = pythia.pyre.inventory.facilityArray(
"subfields", family="soln_subfields", itemFactory=subfieldFactory, factory=SolnDispPresTracStrainLagrange)
subfields.meta['tip'] = "Subfields in solution."


# FACTORIES ////////////////////////////////////////////////////////////
def solution():
"""Factory associated with Solution.
"""
return Solution()


# End of file
107 changes: 107 additions & 0 deletions pylith/problems/SolnDispPresTracStrainVelPdotTdotLagrange.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University at Buffalo
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copyright (c) 2010-2022 University of California, Davis
#
# See LICENSE.md for license information.
#
# ----------------------------------------------------------------------
#

# @file pylith/problems/SolnDispPresTracStrainVelPdotTdotLagrange.py
#
# @brief Python subfields container with displacement, pore pressure, and trace strain subfields, along with their time derivatives.

from pylith.utils.PetscComponent import PetscComponent
from .Solution import Solution as SolutionBase


class SolnDispPresTracStrainVelPdotTdotLagrange(PetscComponent):
"""
Python solution field with displacement, pressure, and trace strain subfields, along with their time derivatives, and a lagrange fault.
"""
DOC_CONFIG = {
"cfg": """
[pylithapp.problem]
solution = pylith.problems.SolnDispPresTracStrainVelPdotTdotLagrange
"""
}

import pythia.pyre.inventory

from .SubfieldDisplacement import SubfieldDisplacement
displacement = pythia.pyre.inventory.facility(
"displacement", family="soln_subfield", factory=SubfieldDisplacement)
displacement.meta['tip'] = "Displacement subfield."

from .SubfieldPressure import SubfieldPressure
pressure = pythia.pyre.inventory.facility(
"pressure", family="soln_subfield", factory=SubfieldPressure)
pressure.meta['tip'] = "Pressure subfield."

from .SubfieldTraceStrain import SubfieldTraceStrain
traceStrain = pythia.pyre.inventory.facility(
"trace_strain", family="soln_subfield", factory=SubfieldTraceStrain)
traceStrain.meta['tip'] = "Trace strain subfield."

from .SubfieldVelocity import SubfieldVelocity
velocity = pythia.pyre.inventory.facility(
"velocity", family="soln_subfield", factory=SubfieldVelocity)
velocity.meta['tip'] = "Velocity subfield."

from .SubfieldPressureDot import SubfieldPressureDot
pressureT = pythia.pyre.inventory.facility(
"pressure_t", family="soln_subfield", factory=SubfieldPressureDot)
pressureT.meta['tip'] = "PressureT subfield."

from .SubfieldTraceStrainDot import SubfieldTraceStrainDot
traceStrainT = pythia.pyre.inventory.facility(
"trace_strain_t", family="soln_subfield", factory=SubfieldTraceStrainDot)
traceStrainT.meta['tip'] = "TraceStrainT subfield."

from .SubfieldLagrangeFault import SubfieldLagrangeFault
lagrangeFault = pythia.pyre.inventory.facility("lagrange_multiplier_fault", family="soln_subfield", factory=SubfieldLagrangeFault)
lagrangeFault.meta['tip'] = "Fault Lagrange multiplier subfield."

def __init__(self, name="solndispprestracstrainvelpdottdotlagrange"):
"""Constructor.
"""
PetscComponent.__init__(self, name, facility="soln_subfields")

def _configure(self):
PetscComponent._configure(self)

def components(self):
"""Order of facilities in Inventory is ambiguous, so overwrite
components() to insure order is [displacement, pressure, trace_strain, velocity, pressure_t, trace_strain_t, lagrange_multiplier_fault].
"""
return [self.displacement, self.pressure, self.traceStrain, self.velocity, self.pressureT, self.traceStrainT, self.lagrangeFault]


class Solution(SolutionBase):
"""Python solution field with displacement, pressure, and trace strain subfields, along with their time derivatives, and a lagrange fault.
"""

import pythia.pyre.inventory

from .SolutionSubfield import subfieldFactory
subfields = pythia.pyre.inventory.facilityArray(
"subfields", family="soln_subfields", itemFactory=subfieldFactory, factory=SolnDispPresTracStrainVelPdotTdotLagrange)
subfields.meta['tip'] = "Subfields in solution."


# FACTORIES ////////////////////////////////////////////////////////////
def solution():
"""Factory associated with Solution.
"""
return Solution()


# End of file
4 changes: 2 additions & 2 deletions pylith/problems/SolnDispVelLagrange.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SolnDispVelLagrange(PetscComponent):
velocity.meta['tip'] = "Velocity subfield."

from .SubfieldLagrangeFault import SubfieldLagrangeFault
lagrangeFault = pythia.pyre.inventory.facility("lagrange_fault", family="soln_subfield", factory=SubfieldLagrangeFault)
lagrangeFault = pythia.pyre.inventory.facility("lagrange_multiplier_fault", family="soln_subfield", factory=SubfieldLagrangeFault)
lagrangeFault.meta['tip'] = "Fault Lagrange multiplier subfield."

def __init__(self, name="solndispvel"):
Expand All @@ -52,7 +52,7 @@ def _configure(self):

def components(self):
"""Order of facilities in Inventory is ambiguous, so overwrite
components() to insure order is [displacement, velocity, lagrange_fault].
components() to insure order is [displacement, velocity, lagrange_multiplier_fault].
"""
return [self.displacement, self.velocity, self.lagrangeFault]

Expand Down
2 changes: 1 addition & 1 deletion pylith/problems/SubfieldLagrangeFault.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SubfieldLagrangeFault(SolutionSubfield):
"""
DOC_CONFIG = {
"cfg": """
[pylithapp.problems.solution.subfields.lagrange_fault]
[pylithapp.problems.solution.subfields.lagrange_multiplier_fault]
alias = lagrange_multiplier_fault
basis_order = 1
"""
Expand Down
4 changes: 3 additions & 1 deletion pylith/problems/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
"SolnDispVelLagrange",
"SolnDispVel",
"SolnDispPresTracStrain",
"SolnDispPresTracStrainVelPdotTdot",
"SolnDispPresTracStrainLagrange",
"SolnDispPresTracStrainVelPdotTdot",
"SolnDispPresTracStrainVelPdotTdotLagrange",
"SolnDispPresVel",
"SolutionSubfield",
"SubfieldDisplacement",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ solution = pylith.problems.SolnDispLagrange

[pylithapp.problem.solution.subfields]
displacement.basis_order = 1
lagrange_fault.basis_order = 1
lagrange_multiplier_fault.basis_order = 1

[pylithapp.problem]
solution_observers = [domain, bc_ypos]
Expand Down
2 changes: 1 addition & 1 deletion tests/fullscale/linearelasticity/faults-3d/pylithapp.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ solution = pylith.problems.SolnDispLagrange

[pylithapp.problem.solution.subfields]
displacement.basis_order = 1
lagrange_fault.basis_order = 1
lagrange_multiplier_fault.basis_order = 1

[pylithapp.problem]
solution_observers = [domain, bc_ypos, points]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defaults.quadrature_order = 1

[pylithapp.problem.solution.subfields]
displacement.basis_order = 1
lagrange_fault.basis_order = 1
lagrange_multiplier_fault.basis_order = 1

# ----------------------------------------------------------------------
# fault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defaults.quadrature_order = 1

[pylithapp.problem.solution.subfields]
displacement.basis_order = 1
lagrange_fault.basis_order = 1
lagrange_multiplier_fault.basis_order = 1

# ----------------------------------------------------------------------
# fault
Expand Down
Loading

0 comments on commit 56dd824

Please sign in to comment.