<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1" style="word-wrap:break-word">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hello Charles,<br>
<br>
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!<br>
<br>
cheers,<br>
Lucas<br>
<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF69527"><font color="#000000" face="Tahoma" size="2"><b>From:</b> cig-short-bounces@geodynamics.org [cig-short-bounces@geodynamics.org] on behalf of Charles Williams [willic3@gmail.com]<br>
<b>Sent:</b> Monday, March 04, 2013 16:47<br>
<b>To:</b> cig-short@geodynamics.org<br>
<b>Subject:</b> Re: [CIG-SHORT] [Pylith] Gravity in 2D problems<br>
</font><br>
</div>
<div></div>
<div>Hi Lucas,
<div><br>
</div>
<div>I am pasting below a section from the PyLith User's Manual:</div>
<div><br>
</div>
<div>
<div style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; font:normal normal normal 10px/normal Helvetica">
Gravity is turned off by default. To include gravitational effects in a simulation, you can turn it on as follows:</div>
<div style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; font:normal normal normal 10px/normal Helvetica">
[pylithapp.timedependent] use_gravity = true</div>
<div style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; font:normal normal normal 10px/normal Helvetica">
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:</div>
<div style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; font:normal normal normal 10px/normal Helvetica">
[pylithapp.timedependent.gravity_field] acceleration = 100.0*m*s**-2 gravity_dir = [0, -1, 0]</div>
<div style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; font:normal normal normal 10px/normal Helvetica">
An example problem using gravity is described in Section <span style="color:#ff0100">
7.8.8</span>.</div>
</div>
<div><br>
</div>
<div>There is no need to change any of the Python code. &nbsp;Instead, I would just change the setting in pylithapp.cfg (assuming all of your projects will be using gravity). &nbsp;Otherwise, you could just have a separate gravity.cfg file for problems that use gravity.</div>
<div><br>
</div>
<div>I hope this helps.</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Charles</div>
<div><br>
</div>
<div><br>
<div>
<div>On 5/03/2013, at 10:34 AM, Lucas Abraham Willemsen wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div>
<div style="direction:ltr; font-family:Tahoma; color:rgb(0,0,0); font-size:10pt">
Hello,<span class="Apple-converted-space">&nbsp;</span><br>
<br>
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)<br>
<br>
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:<br>
<br>
gravityDir = pyre.inventory.list(&quot;gravity_dir&quot;, default=[0.0,0.0,-1.0])<br>
<br>
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.<br>
<br>
If I change this into<span class="Apple-converted-space">&nbsp;</span><br>
<br>
'gravityDir = pyre.inventory.list(&quot;gravity_dir&quot;, default=[0.0,-1.0,0.0])'<br>
<br>
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.<br>
<br>
My question is:<span class="Apple-converted-space">&nbsp;</span><b>Is it possible to locally override GravityField.py for a specific project only</b><span class="Apple-converted-space">&nbsp;</span>? 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.<br>
<br>
sincerely,<br>
Lucas<br>
</div>
_______________________________________________<br>
CIG-SHORT mailing list<br>
<a href="mailto:CIG-SHORT@geodynamics.org" target="_blank">CIG-SHORT@geodynamics.org</a><br>
<a href="http://geodynamics.org/cgi-bin/mailman/listinfo/cig-short" target="_blank">http://geodynamics.org/cgi-bin/mailman/listinfo/cig-short</a></div>
</blockquote>
</div>
<br>
<div><span class="Apple-style-span" style="border-collapse:separate; color:rgb(0,0,0); font-family:Helvetica; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:2; text-align:auto; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; font-size:medium"><span class="Apple-style-span" style="border-collapse:separate; color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:2; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px">
<div style="word-wrap:break-word">
<div>
<div style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px">
<font style="font:normal normal normal 12px/normal Helvetica" face="Helvetica" size="3">Charles A. Williams</font></div>
<div style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px">
Scientist<br>
GNS Science<br>
1 Fairway Drive, Avalon<br>
PO Box 30368<br>
Lower Hutt &nbsp;5040<br>
New Zealand<br>
ph (office): 0064-4570-4566<br>
fax (office): 0064-4570-4600</div>
<div style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px">
<a href="mailto:C.Williams@gns.cri.nz" target="_blank">C.Williams@gns.cri.nz</a></div>
</div>
</div>
</span></span></div>
<br>
</div>
</div>
</div>
</div>
</body>
</html>