# SimpleDB boundary condition for varied displacement rate

**URL:** <https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792>\
**Category:** PyLith\
**Tags:** seismology\
**Created:** [December 11, 2024, 5:14am UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792 "2024-12-11T05:14:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dian.k](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/dian.k/32/2334_2.png) [@dian.k](https://community.geodynamics.org/u/dian.k)\
**Post date:** [December 11, 2024, 5:14am UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792/1 "2024-12-11T05:14:14Z")

</div>

Dear Pylith developer,

I would like to create 3D modeling of inter-seismic fault deformation with boundary condition of displacement rate like in this figure below. The displacement rate (mm/ year) is applied and varied laterally (nodes with the same longitude latitude but different depth have the same displacement rate value).

I would like to use Pylith v2.2.1 or v2.2.2. I checked on the example we can used the SimpleDB for different boundary condition value at different points. However, I could not find example of SimpleDB for displacement rate value (mm/ yr) (kindly correct If I’m wrong).

I would like to ask, can I use displacement rate value (mm/ yr) that varied laterally (as shown in the figure) for the boundary condition in the SimpleDB file? How shall I modify the example code? Kindly suggest.

Thank you in advance

Dian

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/2/28ef8ab22ee3e06f8d77c68f9fa08fec25c889ce.jpeg)

(Huang et al., 2023)

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [December 11, 2024, 9:45pm UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792/2 "2024-12-11T21:45:05Z")

</div>

We may not have an example with a SimpleDB with a displacement rate for PyLith v2.2, but the concepts are very similar to the cases of a UniformDB with a displacement rate (refer to `examples/3d/hex8/step04.cfg`) and a SimpleDB for spatially varying values (refer to `examples/3d/hex8/step18.cfg`).

---

<div class="post-metadata">

**Author:** ![dian.k](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/dian.k/32/2334_2.png) [@dian.k](https://community.geodynamics.org/u/dian.k)\
**Post date:** [December 12, 2024, 6:55am UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792/3 "2024-12-12T06:55:35Z")

</div>

Thank you @baagaard

I will check these examples

Dian

---

<div class="post-metadata">

**Author:** ![dian.k](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/dian.k/32/2334_2.png) [@dian.k](https://community.geodynamics.org/u/dian.k)\
**Post date:** [January 16, 2025, 11:02am UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792/4 "2025-01-16T11:02:20Z")

</div>

Dear @baagaard

I have tried SimpleDB file for spatially varying values, for the boundary condition at +x face, -x face, +y face, and -y face. However I found a problem related to degree of freedom.

Below is the illustration for boundary condition that I apply (black arrow):

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/2/2f7f5b4bc2b9a9e3fe534f91171315625ab2c37d.png)

I created two files for the SimpleDB files: …\_xface.spatialdb and …\_yface.spatialdb.  
In the .cfg file I defined 5 boundary conditions for x\_pos, x\_neg, y\_pos, y\_neg, and z\_neg.

But I found error:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/b/bf9ebb5191b8fd14bec76d7a4d1027b2d006d892.png)

I attached the .cfg and .spatialdb files in the ZIP folder.  
[files.zip](https://community.geodynamics.org/uploads/short-url/qBOsi8BXHtenU20eIJhxOjBnmxP.zip) (5.3 KB)

Please advice what should I do. Thank you.

Dian

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [January 16, 2025, 2:55pm UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792/5 "2025-01-16T14:55:22Z")

</div>

Along the edges and corners where the boundaries overlap, you cannot constrain the displacement at points using two different boundary conditions. For example, you cannot constrain the x and y degrees of freedom of a point from the BC on the +x boundary and from the BC on the +y boundary.

In cases where the displacements are zero (not your case), we usually constrain the degree of freedom normal to the boundary. This prevents overlapping boundary conditions.

In cases where the multiple degrees of freedom are constrained and will overlap at edges and corners, the correct procedure is to remove the overlap by not including the overlappling points in _one_ of the groups specifying the boundary. For example, in creating the group of point on the +x boundary, you can remove the points that are on the -y and +y boundaries (assuming you are constraining the horizontal components of displacement). In CUBIT this is done using the the boolean options on groups.

---

<div class="post-metadata">

**Author:** ![dian.k](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/dian.k/32/2334_2.png) [@dian.k](https://community.geodynamics.org/u/dian.k)\
**Post date:** [January 17, 2025, 7:00am UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792/6 "2025-01-17T07:00:49Z")

</div>

Thank you so much for the reply and advice @baagaard  
I will try it!

Regards

Dian

---

<div class="post-metadata">

**Author:** ![dian.k](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/dian.k/32/2334_2.png) [@dian.k](https://community.geodynamics.org/u/dian.k)\
**Post date:** [September 8, 2025, 6:58am UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792/7 "2025-09-08T06:58:35Z")

</div>

Dear @baagaard,

I want to apply varied displacement rates for the boundary condition: laterally varied (x, y), but has the same value within depths of the same points, similar to the above figure example. I used Pylith 2.2.1 (I am interested in applying the friction parameter).

Due to the displacement rate that can not yet be applied in SimpleDB files, I tried to make a workaround by creating many SimpleDB files for each observation years, e.g., for year 0, year 50, .. etc, and ran it for each year.

I tried to test this workaround in the uniform BC model (left vs right below figures). But when I compared the results, e.g., displacement at the domain and fault slip, the results are a bit different. Especially the fault slip.

I would like to ask, is the workaround conceptual can be acceptable/ applied in the Pylith coding? Maybe is there any suggestion? I attached the cfg and spatial db files.

Please take a look. Kindly advise.

Thank you

[Pylithfiles.zip](https://community.geodynamics.org/uploads/short-url/geen51xLjWgKGhVqTL58ooyOAZg.zip) (240 KB)

 ![Screenshot 2025-09-08 140245 new](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/d/d4eadbd2906f4254f0e5d548c3e8bd56a9391c0a.png)

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [September 8, 2025, 8:14pm UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792/8 "2025-09-08T20:14:39Z")

</div>

I do not understand what variation in boundary condition values you are trying to impose. Can you describe what you want to do in mathematical terms, similar to the equation for the time dependent boundary conditions in the PyLith manual [Time-Dependent Boundary Conditions — PyLith 5.0.0dev documentation](https://pylith.readthedocs.io/en/latest/user/physics/bc/time-dependent.html#equation-ced4e4d3-caca-4821-b1a7-5d72d050a646) (this is the same equation used in PyLith v2.2.2)?

---

<div class="post-metadata">

**Author:** ![dian.k](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/dian.k/32/2334_2.png) [@dian.k](https://community.geodynamics.org/u/dian.k)\
**Post date:** [September 11, 2025, 2:45am UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792/9 "2025-09-11T02:45:33Z")

</div>

Kindly apologize.

I have not yet calculated the equation for the boundary condition values. Because I interpolated the velocity (or the displacement rate: Ve mm/ yr and Vn mm/ yr) at the boundary condition from sparse GPS data inside the study area, similar to Figure 4 above (red arrow). The variation of the displacement rate at the BC is 2D (laterally), varied in the easting (x) and northing (y), but not varied between depths (z).

I still used SimpleDB with spatialDB files in the Pylith command. To accomodate the ‘rate’ in the boundary condition, I created the spatialDB files for each time step, e.g. at year 0, year 50, year 100, year 150 etc., by multiplying the rate at the boundaries with time step. I ran the cfg each at those time step.

But I was uncertain, perhaps is it ok to do this method? Because I obtained the slip at faults smaller than what is expected. Kindly advice.

Thank you

(I still use Pylith 2.2 for this because I need the fault friction parameter)

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [September 11, 2025, 2:38pm UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792/10 "2025-09-11T14:38:24Z")

</div>

It sounds like you are breaking a time-dependent boundary value problem into multiple static boundary value problems. That is, you are solving for the displacements at each time in independent simulations. If the physics at each time step is decoupled, then this could work. However, if the physics at one time depends on the physics at previous times, then this approach will not yield equivalent results. In general, simulations with fault friction are nonlinear, and the physics depends on the current state, which is sensitive to the behaviour at previous times.

---

<div class="post-metadata">

**Author:** ![dian.k](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/dian.k/32/2334_2.png) [@dian.k](https://community.geodynamics.org/u/dian.k)\
**Post date:** [September 15, 2025, 4:23am UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792/11 "2025-09-15T04:23:02Z")

</div>

Dear @baagaard

Thank you very much for your reply.

If the case is time-dependent (coupled), may I ask if you might have any suggestions or possible workarounds that would allow us to apply spatially varied time-dependent boundary conditions (2D variation) while still making use of the friction parameter in PyLith 2.2?

Alternatively, if we would like to represent creeping faults (assuming zero friction) or locked faults (assuming significant friction) with spatially varying time-dependent boundary conditions (e.g. displacement rate), but without employing the friction parameter (i.e., without _FaultCohesiveDyn_), which version of PyLith is recommended? is there any example close to this case?

I apologize if these questions are rather basic, and I greatly appreciate your kind guidance.

Dian

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [September 15, 2025, 2:39pm UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792/12 "2025-09-15T14:39:53Z")

</div>

It would help if you could describe the general mathematical form of the constraint you want to provide. If I understand your description, you want to specify the velocity on each boundary that is spatially variable. Is this correct? Does the velocity vary in time? If so, what is the general mathematical form that it has?

---

<div class="post-metadata">

**Author:** ![dian.k](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/dian.k/32/2334_2.png) [@dian.k](https://community.geodynamics.org/u/dian.k)\
**Post date:** [September 16, 2025, 4:20pm UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792/13 "2025-09-16T16:20:47Z")

</div>

Dear @baagaard

Thank you for your reply.

Yes the velocity is spatially varied on each boundary. The velocity (mm/ year) is constant over time. The velocity or displacement rate is the same over time. But if converted to displacement, the displacement is increasing over time following the displacement rate.

Here is the mathematical form of my velocity (displacement rate) at the boundary condition. It depends on position easting and northing (2D varied). I tried to estimate the general equation for all boundaries (x-face and y-face).

```auto
U(x, y) = [-8.5983 + -0.0019x + -0.0151y + -0.000023x^2 + -0.000041xy + 0.000049y^2]
V(x, y) = [13.1281 + 0.0223x + 0.0149y + -0.000004x^2 + -0.000054xy + 0.000049y^2]

```

```auto
x easting in km
y northing in km
U displacement rate in x component (mm/year)
V displacement rate in y component (mm/year)

```

I attached the figure of the velocity (displacement rate) at the boundary condition (green arrows).

Thank you for your help.

Dian

 ![Interpolation_Quadratic](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/f/fdda448b8724394faf6483fccafefd137e984116.png)

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [September 16, 2025, 5:11pm UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792/14 "2025-09-16T17:11:07Z")

</div>

The Dirichlet time-dependent boundary condition uses a simple expression for the spatial and temporal dependence ([Time-Dependent Boundary Conditions — PyLith 5.0.0dev documentation](https://pylith.readthedocs.io/en/latest/user/physics/bc/time-dependent.html#time-dependent-boundary-conditions); this same expression is used in PyLith v2),

```python
f(x, t) = f_0(x) + fdot_1(x)*(t-t_1(x) + f_2(x) * a(t-t_2(x))

```

Note: `x` refers to the spatial coordinates, such as (x,y) in 2D and (x, y, z) in 3D.

Your spatially varying velocities correspond to `fdot_1(x)`. If they all start at the same time, then t\_1(x) = 0 (uniform in space). So I think you can use a SimpleDB or SimpleGridDB for the `db_rate`. I would create a boundary condition (and spatial database) for each boundary, making sure that there is no overlap in the vertices in the boundary conditions.

For example, for a boundary condition on the +x boundary, you could have something like:

```cfg
[pylithapp.problem.bc.bc_xpos]
label = boundary_xpos
bc_dof = [0, 1]
db_initial.label = Dirichlet BC on +x
db_rate = spatialdata.spatialdb.SimpleGridDB
db_rate.filename = velocity_xpos.spatialdb

```

The `SimpleGridDB` file `velocity_xpos.spatialdb` would provide values `displacement-rate-x`, `displacement-rate-y`, `rate-start-time` in which the displacement rate values vary in space and the start time is 0 at each point.

---

<div class="post-metadata">

**Author:** ![dian.k](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/dian.k/32/2334_2.png) [@dian.k](https://community.geodynamics.org/u/dian.k)\
**Post date:** [September 17, 2025, 2:11am UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792/15 "2025-09-17T02:11:57Z")

</div>

Thank you so much @baagaard

I will try it!

Dian

---

<div class="post-metadata">

**Author:** ![dian.k](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/dian.k/32/2334_2.png) [@dian.k](https://community.geodynamics.org/u/dian.k)\
**Post date:** [September 19, 2025, 9:16am UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792/16 "2025-09-19T09:16:03Z")

</div>

Dear @baagaard

May I ask another question. I have faults intersecting with the x-face-pos (as shown in yellow circle in figure below). Shall I exclude them (the faults edges at the x-face-pos) from the boundary condition group of the x-face-pos?

Thank you

 ![Screenshot 2025-09-19 161041](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/4/4783ed80922fcfacfd714f7d02134fb594cb0e43.png)

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [September 19, 2025, 7:32pm UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792/17 "2025-09-19T19:32:57Z")

</div>

Yes, you should remove any overlap between faults and Dirichlet boundary conditions. Usually, we keep vertices on the edges of the domain as part of the fault and remove them from the Dirichlet boundary condition.

---

<div class="post-metadata">

**Author:** ![dian.k](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/dian.k/32/2334_2.png) [@dian.k](https://community.geodynamics.org/u/dian.k)\
**Post date:** [September 20, 2025, 3:31am UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792/18 "2025-09-20T03:31:15Z")

</div>

Ok. Thank you @baagaard

Dian

---

<div class="post-metadata">

**Author:** ![dian.k](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/dian.k/32/2334_2.png) [@dian.k](https://community.geodynamics.org/u/dian.k)\
**Post date:** [June 8, 2026, 3:10am UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792/19 "2026-06-08T03:10:55Z")

</div>

Dear @baagaard ,

May I ask a follow-up question regarding the use of **dbrate**?

How to configure **SimpleDB** and **dbrate** for a time-dependent Dirichlet boundary condition?

I am interested in applying a time-dependent Dirichlet boundary condition on a boundary face with a non-orthogonal mesh (x-faces in the figure below). In particular, I would like to prescribe boundary values that vary with time and spatial (x and y), but I don’t know how to configure **SimpleDB** and **dbrate** for this purpose. I used to use SimpleGridDB but when applying to non-orthogonal mesh, there’s some error arises.

Could you please provide some suggestions or guidance on how to implement this type of boundary condition?

(I am still using **PyLith 2.2** because I would like to employ the friction-parameter formulation on the fault within the model)

Kindly advice. Thank you very much for your time and assistance.

Best regards,

Dian

Mesh for the boundary condition

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/b/b707f7347f0acb27734716343a4eb44fb111e3da.png)

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [June 8, 2026, 3:51pm UTC](https://community.geodynamics.org/t/simpledb-boundary-condition-for-varied-displacement-rate/3792/20 "2026-06-08T15:51:55Z")

</div>

You will need to specify the boundary conditions values at locations on the boundary that describe the spatial variation. The locations will have x, y, and z coordinates. For a complex spatial variation I would use a grid of points over the boundary. For a 1D variation, you can just specify location along the 1D variation.
