[CIG-SHORT] [Pylith] Gravity in 2D problems

Lucas Abraham Willemsen lawillem at MIT.EDU
Mon Mar 4 13:53:10 PST 2013


Hello Charles,

I wasn't aware that that property of the gravity field could also be changed. I quickly ran a test and it seems to have solved my problem. Thanks for your fast response!

cheers,
Lucas

________________________________
From: cig-short-bounces at geodynamics.org [cig-short-bounces at geodynamics.org] on behalf of Charles Williams [willic3 at gmail.com]
Sent: Monday, March 04, 2013 16:47
To: cig-short at geodynamics.org
Subject: Re: [CIG-SHORT] [Pylith] Gravity in 2D problems

Hi Lucas,

I am pasting below a section from the PyLith User's Manual:

Gravity is turned off by default. To include gravitational effects in a simulation, you can turn it on as follows:
[pylithapp.timedependent] use_gravity = true
By simply adding this flag, the default gravity field values will be used and a gravity_field component will be assigned for the problem. The default values may be changed by altering the properties of gravity_field:
[pylithapp.timedependent.gravity_field] acceleration = 100.0*m*s**-2 gravity_dir = [0, -1, 0]
An example problem using gravity is described in Section 7.8.8.

There is no need to change any of the Python code.  Instead, I would just change the setting in pylithapp.cfg (assuming all of your projects will be using gravity).  Otherwise, you could just have a separate gravity.cfg file for problems that use gravity.

I hope this helps.

Cheers,
Charles


On 5/03/2013, at 10:34 AM, Lucas Abraham Willemsen wrote:

Hello,

I have used CUBIT to generate a 2D mesh. This mesh is in the X-Y coordinate system, and as far as I know a 2D mesh cannot be written in the X-Z coordinate system. (This would have prevented the problem I will describe below)

I then read this mesh into pylith and turn on gravity in pylithapp.cfg. The gravity does not work. The reason for this is that site-packages/spatialdata/spatialdb/GravityField.py defines:

gravityDir = pyre.inventory.list("gravity_dir", default=[0.0,0.0,-1.0])

Which is in the Z-direction. And the 2D mesh I get from cubit is forced to be in the X-Y plane with Y being depth.

If I change this into

'gravityDir = pyre.inventory.list("gravity_dir", default=[0.0,-1.0,0.0])'

I basically direct it in the Y-direction which is depth in my mesh. Now the gravity functionality correctly generates the vertical stress gradient I would expect.

My question is: Is it possible to locally override GravityField.py for a specific project only ? I tried putting GravityField.py in my project directory in the hope that Pylith would grab this instead of the one in site-packages. I prefer not to change the original in site-packages. First of all this is probably not best practice, but also I'm not sure if the cluster I will run the project on allows me to modify the Pylith installation. Does anyone know an elegant solution to this problem? I'm using the binary distribution of Pylith on Linux and I don't have a very in-depth knowledge of the structure of the source-code.

sincerely,
Lucas
_______________________________________________
CIG-SHORT mailing list
CIG-SHORT at geodynamics.org<mailto:CIG-SHORT at geodynamics.org>
http://geodynamics.org/cgi-bin/mailman/listinfo/cig-short

Charles A. Williams
Scientist
GNS Science
1 Fairway Drive, Avalon
PO Box 30368
Lower Hutt  5040
New Zealand
ph (office): 0064-4570-4566
fax (office): 0064-4570-4600
C.Williams at gns.cri.nz<mailto:C.Williams at gns.cri.nz>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://geodynamics.org/pipermail/cig-short/attachments/20130304/864d083d/attachment-0001.htm 


More information about the CIG-SHORT mailing list